/* RigMind. A calm, light interface in the spirit of Things 3: lots of white space, thin lines instead of boxes, round
   check marks, one blue accent, soft shadows only where something floats. Light, dark and automatic (follows the device).
   Big touch targets stay, because it is used with gloves on a rig floor. System fonts, so it looks at home on Windows,
   macOS, Android and iOS and nothing has to be downloaded. */

:root {
  color-scheme: light;

  /* surfaces */
  --bg: #FFFFFF;           /* the page */
  --bg-side: #F5F5F7;     /* sidebar, quiet areas */
  --panel: #FFFFFF;       /* cards, sheets */
  --wash: #F5F5F7;        /* soft fill: notes, table heads, rows on hover */
  --fill: #EDEDF0;        /* buttons without emphasis */
  --fill-hover: #E3E3E8;
  --scrim: rgba(20, 22, 28, .38);
  --glass: rgba(255, 255, 255, .82);

  /* text and lines */
  --ink: #1D1D1F;
  --ink-2: #515156;
  --ink-3: #6B6B72;
  --line: #D4D4DA;        /* the border of a field */
  --line-2: #E8E8EC;      /* hairlines between rows */

  /* the accent */
  --accent: #1F66E5;
  --accent-press: #1856C4;
  --accent-soft: rgba(31, 102, 229, .12);
  --on-accent: #FFFFFF;

  /* criticality */
  --high: #D4282F;
  --high-bg: #FCE8E9;
  --high-ink: #B71D24;
  --med: #E39A00;
  --med-text: #8A5600;
  --med-bg: #FFF3D9;
  --low: #3C82DB;
  --low-bg: #E7F0FC;
  --low-ink: #1F5BA8;

  /* status */
  --s-open: #E8590C;
  --s-open-bg: #FDEBDD;
  --s-open-ink: #B8450A;
  --s-pending: #7A4FD1;
  --s-pending-bg: #EFE8FB;
  --s-pending-ink: #5E34B0;
  --s-returned: #E8590C;
  --s-closed: #2E9B5E;
  --s-closed-bg: #E2F4EA;
  --s-closed-ink: #17703F;
  --good: #2E9B5E;

  /* the colour of each part of the project, as the lists of Things have theirs */
  --c-obs: #1F66E5;
  --c-docs: #E8890C;
  --c-stats: #2E9B5E;
  --c-live: #E5484D;
  --c-walk: #14A3A8;
  --c-more: #8A8A93;

  /* the RigMind logo (shared/brand.js): navy on light pages, the reversed white version on dark ones */
  --logo-hex: #0E2A47;
  --logo-lattice: #FFFFFF;
  --brand-orange: #E8601C;

  --shadow-1: 0 1px 2px rgba(20, 22, 28, .06), 0 1px 1px rgba(20, 22, 28, .04);
  --shadow-2: 0 8px 28px rgba(20, 22, 28, .16), 0 2px 6px rgba(20, 22, 28, .08);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-cond: var(--font);
  --r: 10px;
  --r-lg: 14px;
  --gutter: 16px;
  --tabbar: 58px;
  --top: 52px;
  --side: 264px;

  /* old names, still used by a few inline styles and charts */
  --navy: var(--accent);
  --navy-2: var(--accent);
  --orange: var(--accent);
  --orange-press: var(--accent-press);
  --surface: var(--panel);
  --surface-2: var(--wash);
}

/* dark: the same names with other values. Two copies, one for "automatic" and one for "always dark" (test/look.test.js checks they match). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #1B1B1E;
    --bg-side: #141416;
    --panel: #242428;
    --wash: #2A2A2F;
    --fill: #34343A;
    --fill-hover: #3E3E45;
    --scrim: rgba(0, 0, 0, .55);
    --glass: rgba(27, 27, 30, .8);
    --ink: #F3F3F6;
    --ink-2: #C9C9D0;
    --ink-3: #9C9CA6;
    --line: #45454D;
    --line-2: #333339;
    --accent: #5A9BFF;
    --accent-press: #7BB0FF;
    --accent-soft: rgba(90, 155, 255, .18);
    --on-accent: #0B1A33;
    --high: #FF6B70;
    --high-bg: rgba(255, 107, 112, .16);
    --high-ink: #FF8A8E;
    --med: #F2B33D;
    --med-text: #F5C467;
    --med-bg: rgba(242, 179, 61, .16);
    --low: #6FA8F0;
    --low-bg: rgba(111, 168, 240, .16);
    --low-ink: #8FBCF5;
    --s-open: #FF8A4C;
    --s-open-bg: rgba(255, 138, 76, .16);
    --s-open-ink: #FFA877;
    --s-pending: #A98BEA;
    --s-pending-bg: rgba(169, 139, 234, .18);
    --s-pending-ink: #BCA3F0;
    --s-returned: #FF8A4C;
    --s-closed: #4CC083;
    --s-closed-bg: rgba(76, 192, 131, .16);
    --s-closed-ink: #6FD39C;
    --good: #4CC083;
    --c-obs: #5A9BFF;
    --c-docs: #F5A340;
    --c-stats: #4CC083;
    --c-live: #FF6B70;
    --c-walk: #36C2C7;
    --c-more: #9C9CA6;
    --logo-hex: #FFFFFF;
    --logo-lattice: #0E2A47;
    --brand-orange: #E8601C;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1B1B1E;
  --bg-side: #141416;
  --panel: #242428;
  --wash: #2A2A2F;
  --fill: #34343A;
  --fill-hover: #3E3E45;
  --scrim: rgba(0, 0, 0, .55);
  --glass: rgba(27, 27, 30, .8);
  --ink: #F3F3F6;
  --ink-2: #C9C9D0;
  --ink-3: #9C9CA6;
  --line: #45454D;
  --line-2: #333339;
  --accent: #5A9BFF;
  --accent-press: #7BB0FF;
  --accent-soft: rgba(90, 155, 255, .18);
  --on-accent: #0B1A33;
  --high: #FF6B70;
  --high-bg: rgba(255, 107, 112, .16);
  --high-ink: #FF8A8E;
  --med: #F2B33D;
  --med-text: #F5C467;
  --med-bg: rgba(242, 179, 61, .16);
  --low: #6FA8F0;
  --low-bg: rgba(111, 168, 240, .16);
  --low-ink: #8FBCF5;
  --s-open: #FF8A4C;
  --s-open-bg: rgba(255, 138, 76, .16);
  --s-open-ink: #FFA877;
  --s-pending: #A98BEA;
  --s-pending-bg: rgba(169, 139, 234, .18);
  --s-pending-ink: #BCA3F0;
  --s-returned: #FF8A4C;
  --s-closed: #4CC083;
  --s-closed-bg: rgba(76, 192, 131, .16);
  --s-closed-ink: #6FD39C;
  --good: #4CC083;
  --c-obs: #5A9BFF;
  --c-docs: #F5A340;
  --c-stats: #4CC083;
  --c-live: #FF6B70;
  --c-walk: #36C2C7;
  --c-more: #9C9CA6;
  --logo-hex: #FFFFFF;
  --logo-lattice: #0E2A47;
  --brand-orange: #E8601C;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}
@media (hover: hover) and (pointer: fine) { body { font-size: 15px; } }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.18; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 30px; letter-spacing: -0.022em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
svg.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  background: var(--glass); color: var(--ink); display: flex; align-items: center; gap: 12px;
  padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  box-sizing: content-box; border-bottom: 1px solid var(--line-2);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; }
/* the wordmark is Barlow Bold (SIL Open Font Licence, fonts/OFL.txt): "Rig" in the text colour, "Mind" in Drill Orange */
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/barlow-700.woff2') format('woff2'); }
.wordmark { font-family: 'Barlow', var(--font); font-weight: 700; font-size: 1.14em; line-height: 1; letter-spacing: -0.02em; }
.wordmark b { color: var(--brand-orange); font-weight: inherit; }
.tagline { color: var(--ink-3); font-size: 14px; margin: 0 0 14px; }
.top .back { color: var(--accent); background: transparent; border: 0; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 0; font-weight: 600; cursor: pointer; }
.top .title { font-weight: 600; font-size: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--fill); color: var(--ink-2); border: 0; cursor: pointer; }
.net:hover { background: var(--fill-hover); }
.net .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-closed); }
.net.off .dot { background: var(--high); }
.net.wait .dot { background: var(--med); }
.iconbtn { background: transparent; border: 0; color: inherit; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.iconbtn:hover { background: var(--fill); }
.top .iconbtn:hover { background: var(--fill); }

/* ---------- layout ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 20px var(--gutter); padding-bottom: calc(var(--tabbar) + 100px + env(safe-area-inset-bottom)); animation: rm-in .18s ease-out; }
.page.narrow { max-width: 640px; }
@keyframes rm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.shell { display: block; }
.rail { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--glass); border-top: 1px solid var(--line-2);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; border: 0; color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; min-height: 52px; position: relative; text-decoration: none; }
.tab svg { width: 24px; height: 24px; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar .tab { font-size: 11px; }
.tabbar .tab[aria-current='page'] { color: var(--accent); }
.tab .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--high); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 29;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 38%, transparent), 0 2px 6px rgba(20, 22, 28, .18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.fab:hover { background: var(--accent-press); }
.fab:active { transform: scale(.94); }
.fab svg { width: 28px; height: 28px; stroke-width: 2.4; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 0; max-width: none; margin: 0; align-items: start; }
  .rail { display: block; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 18px 12px 24px; border-right: 1px solid var(--line-2); background: var(--bg-side); }
  .tabbar { display: none; }
  .page { padding: 28px 36px; padding-bottom: 110px; }
  .fab { bottom: 26px; right: 32px; width: auto; height: 46px; padding: 0 22px 0 16px; border-radius: 23px; font-size: 15px; }
  .fab svg { width: 22px; height: 22px; }
  .only-narrow { display: none !important; }
}
@media (max-width: 899px) { .only-wide { display: none !important; } }

.rail .rig { font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; }
.rail nav { margin-top: 18px; display: grid; gap: 2px; }
.rail .tab { flex-direction: row; justify-content: flex-start; gap: 11px; padding: 0 10px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--ink); border-radius: 8px; }
.rail .tab svg { width: 22px; height: 22px; color: var(--c, var(--accent)); }
.rail .tab:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.rail .tab[aria-current='page'] { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.rail .tab .badge { position: static; margin-left: auto; background: transparent; color: var(--ink-3); font-size: 14px; font-weight: 600; min-width: 0; padding: 0; height: auto; }
.tab[data-k=''] { --c: var(--c-obs); }
.tab[data-k='docs'] { --c: var(--c-docs); }
.tab[data-k='stats'] { --c: var(--c-stats); }
.tab[data-k='live'] { --c: var(--c-live); }
.tab[data-k='check'] { --c: var(--c-walk); }
.tab[data-k='more'] { --c: var(--c-more); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r);
  border: 0; background: var(--fill); color: var(--ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .12s ease, transform .1s ease;
}
@media (hover: hover) and (pointer: fine) { .btn { min-height: 38px; font-size: 14.5px; padding: 0 16px; } .btn.sm { min-height: 32px; } }
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: scale(.985); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-press); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.dark:hover { opacity: .88; background: var(--ink); }
.btn.quiet { background: transparent; color: var(--accent); }
.btn.quiet:hover { background: var(--accent-soft); }
.btn.danger { background: var(--high-bg); color: var(--high-ink); }
.btn.danger:hover { background: color-mix(in srgb, var(--high) 24%, transparent); }
.btn.good { background: var(--s-closed); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 15px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btns .btn { flex: 1 1 180px; }
.btns.col { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.btns.col .btn { flex: 0 0 auto; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.field .hint { font-size: 13.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
@media (hover: hover) and (pointer: fine) { .input, .select { min-height: 38px; } }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid='true'] { border-color: var(--high); }
input[type='search'].input { background: var(--wash); border-color: transparent; padding-left: 14px; }
input[type='search'].input:focus { background: var(--panel); border-color: var(--accent); }
.grid2 { display: grid; gap: 12px; align-items: start; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { min-height: 52px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-size: 16px; }
.seg button:hover { background: var(--wash); }
#camera-card .seg { grid-template-columns: 1fr 1fr; }
#camera-card .seg button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#camera-card .seg button:disabled { opacity: .5; cursor: default; }
.seg button[aria-pressed='true'].high { background: var(--high); border-color: var(--high); color: #fff; }
.seg button[aria-pressed='true'].medium { background: var(--med-bg); border-color: var(--med); color: var(--med-text); }
.seg button[aria-pressed='true'].low { background: var(--low-bg); border-color: var(--low); color: var(--low-ink); }
.seg small { font-weight: 500; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-1); }
.card.flat { background: var(--wash); box-shadow: none; border-color: transparent; }
.sec { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.sec > header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.sec > header h2, .sec > header h3 { font-size: 17px; }
.sec .body { padding: 18px; }

/* ---------- badges ---------- */
.crit { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; padding: 2px 9px 2px 7px; border-radius: 999px; white-space: nowrap; }
.crit svg { width: 13px; height: 13px; stroke-width: 2.4; }
.crit.high { background: var(--high-bg); color: var(--high-ink); }
.crit.medium { background: var(--med-bg); color: var(--med-text); }
.crit.low { background: var(--low-bg); color: var(--low-ink); }
.st { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; padding: 2px 10px 2px 7px; border-radius: 999px; white-space: nowrap; background: var(--wash); color: var(--ink-2); }
.st svg { width: 13px; height: 13px; stroke-width: 2.4; }
.st.open { color: var(--s-open-ink); background: var(--s-open-bg); }
.st.pending { color: var(--s-pending-ink); background: var(--s-pending-bg); }
.st.returned { color: var(--s-open-ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--s-open); }
.st.closed { color: var(--s-closed-ink); background: var(--s-closed-bg); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--wash); color: var(--ink-2); }
.pill.warn { background: var(--med-bg); color: var(--med-text); }
.pill.fail, .pill.bad { background: var(--high-bg); color: var(--high-ink); }
.pill.ok, .pill.good { background: var(--s-closed-bg); color: var(--s-closed-ink); }

/* ---------- tally: one round mark per observation, as Things shows the progress of a project ---------- */
.tally { display: flex; flex-wrap: wrap; gap: 4px; }
.tally i { width: 13px; height: 13px; border-radius: 50%; background: transparent; border: 2px solid var(--s-open); display: block; }
.tally i.closed { background: var(--s-closed); border-color: var(--s-closed); }
.tally i.pending { background: var(--s-pending); border-color: var(--s-pending); }
.tally i.returned { border-style: dashed; }
.tally.big i { width: 18px; height: 18px; }
.tally.dense i { width: 8px; height: 8px; border-width: 1.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--s-open); background: transparent; display: inline-block; }
.legend i.closed { background: var(--s-closed); border-color: var(--s-closed); }
.legend i.pending { background: var(--s-pending); border-color: var(--s-pending); }
.legend i.returned { border-style: dashed; }

/* ---------- project list ---------- */
.proj { display: block; text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px; position: relative; box-shadow: var(--shadow-1); transition: transform .12s ease, box-shadow .12s ease; }
.proj:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.proj .rig { font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; }
.proj .code { font-weight: 600; font-size: 13px; color: var(--ink-3); background: var(--wash); padding: 1px 9px; border-radius: 999px; }
.proj .meta { color: var(--ink-3); font-size: 14.5px; margin: 4px 0 12px; }
/* the number of an observation: a round mark like the check mark of a to-do */
a.plate, a .plate { text-decoration: none; }
.plate { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--wash); border: 2px solid var(--line); border-radius: 50%; }

/* ---------- observation rows ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--fill); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-2); transition: background .12s ease; }
.chip:hover { background: var(--fill-hover); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.chip .n { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .8; }
.obs-list { display: grid; gap: 0; }
.obs { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; text-decoration: none; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); padding: 14px 6px 14px 2px; cursor: pointer; border-radius: 0; }
.obs:hover { background: var(--wash); }
.obs .plate { border-color: var(--c, var(--line)); background: transparent; color: var(--ink); align-self: start; }
.obs.high { --c: var(--high); }
.obs.medium { --c: var(--med); }
.obs.low { --c: var(--low); }
.obs .t { font-weight: 600; font-size: 16.5px; line-height: 1.3; letter-spacing: -0.005em; }
.obs .m { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.obs .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.obs .quote { margin-top: 8px; padding: 7px 11px; background: var(--wash); border-radius: 8px; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.obs.is-closed .plate { background: var(--s-closed); border-color: var(--s-closed); color: #fff; }
.obs.is-closed .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }

/* the live sheet, wide screens */
.sheet-wrap { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: auto; box-shadow: var(--shadow-1); }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1400px; font-size: 14px; }
table.sheet th { position: sticky; top: 0; background: var(--wash); color: var(--ink-3); text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0; padding: 10px 12px; white-space: nowrap; z-index: 1; border-bottom: 1px solid var(--line-2); }
table.sheet th.edit { background: var(--med-bg); color: var(--med-text); }
table.sheet td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.sheet .w-obs { min-width: 260px; }
table.sheet .w-act { min-width: 200px; }
table.sheet .w-com { min-width: 220px; }
table.sheet tr.row-link { cursor: pointer; }
table.sheet tr.row-link:hover td { background: var(--wash); }
table.sheet td.c-high { box-shadow: inset 4px 0 0 var(--high); }
table.sheet td.c-medium { box-shadow: inset 4px 0 0 var(--med); }
table.sheet td.c-low { box-shadow: inset 4px 0 0 var(--low); }
table.sheet td.edit { background: color-mix(in srgb, var(--med-bg) 55%, transparent); }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- observation detail ---------- */
.detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.detail-head .plate { min-width: 56px; height: 56px; font-size: 22px; border-color: var(--line); }
.kv { display: grid; gap: 16px; }
.kv dt { font-weight: 600; font-size: 13px; color: var(--ink-3); margin-bottom: 2px; letter-spacing: .01em; }
.kv dd { margin: 0; white-space: pre-wrap; }
.note { padding: 12px 14px; border-radius: var(--r); background: var(--wash); border: 0; }
.note.warn { background: var(--med-bg); }
.note.info { background: var(--s-pending-bg); }
.note.good { background: var(--s-closed-bg); }
.note .who { font-weight: 700; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 14px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .pt { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--panel); margin-top: 2px; }
.timeline .pt.ok { border-color: var(--s-closed); background: var(--s-closed); }
.timeline .pt.ret { border-color: var(--s-open); }
.actionbar { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 20; background: var(--glass); border-top: 1px solid var(--line-2); padding: 12px var(--gutter); margin: 24px calc(var(--gutter) * -1) 0; -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
@media (min-width: 900px) { .actionbar { bottom: 0; } }
.actionbar .btns .btn { flex: 1 1 140px; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 4 / 3; background: var(--fill) center / cover no-repeat; border: 0; border-radius: 10px; overflow: hidden; padding: 0; cursor: zoom-in; display: block; }
.photo.file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; padding: 6px; cursor: pointer; }
.photo .x { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(20, 22, 28, .72); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.photo.gone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: center; padding: 6px; cursor: default; background: var(--wash); box-shadow: inset 0 0 0 1.5px var(--line); }
.photo .loc { position: absolute; left: 5px; bottom: 5px; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); padding: 1px 7px; border-radius: 999px; }
.addphoto { aspect-ratio: 4 / 3; border: 1.5px dashed var(--line); border-radius: 10px; background: transparent; color: var(--accent); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 14px; }
.addphoto:hover { background: var(--accent-soft); border-color: var(--accent); }
.addphoto svg { width: 26px; height: 26px; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 9, 12, .94); display: flex; flex-direction: column; }
.lightbox .bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; color: #fff; padding-top: calc(8px + env(safe-area-inset-top)); }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }

/* ---------- suggestion box ---------- */
.say { position: relative; }
.say .textarea { padding-right: 64px; min-height: 120px; font-size: 17px; }
.mic { position: absolute; right: 8px; top: 8px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mic[aria-pressed='true'] { background: var(--high); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--high) 25%, transparent); } }
.sugg { display: grid; gap: 8px; }
.sugg button { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 11px 13px; cursor: pointer; display: grid; gap: 4px; }
.sugg button:hover { background: var(--wash); border-color: var(--accent); }
.sugg .t { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { min-height: 40px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-1); position: relative; }
.kpi::before { content: ''; position: absolute; left: 16px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.kpi .v { font-weight: 700; font-size: 34px; line-height: 1; margin-top: 18px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 14px; color: var(--ink-3); margin-top: 4px; }
.kpi.k-closed::before { background: var(--s-closed); }
.kpi.k-pending::before { background: var(--s-pending); }
.kpi.k-open::before { background: var(--s-open); }
.kpi.k-high::before { background: var(--high); }
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } .dash-grid .wide { grid-column: 1 / -1; } }
.hbar { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) 54px; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; }
.hbar .track { height: 10px; background: var(--wash); border-radius: 999px; display: flex; gap: 2px; overflow: hidden; }
.hbar .track b { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.hbar .val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--ink-3); }
.bignum { font-weight: 700; font-size: 60px; line-height: .95; letter-spacing: -0.04em; }
.meter { height: 10px; background: var(--wash); border-radius: 999px; display: flex; gap: 2px; padding: 0; overflow: hidden; }
.meter b { display: block; border-radius: 999px; }

/* ---------- documents ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; cursor: pointer; align-items: center; }
.doc:last-child { border-bottom: 0; }
.doc:hover { background: var(--wash); }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; padding: 3px 12px 3px 9px; border-radius: 999px; letter-spacing: 0.01em; }
.verdict.PASS { color: var(--s-closed-ink); background: var(--s-closed-bg); }
.verdict.FAIL { color: var(--high-ink); background: var(--high-bg); }
.verdict.REVIEW { color: var(--med-text); background: var(--med-bg); }
.verdict.INCOMPLETE { color: var(--ink-3); background: var(--wash); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; }
.checks svg { width: 22px; height: 22px; stroke-width: 2.2; }
.checks .pass svg { color: var(--s-closed-ink); }
.checks .fail svg { color: var(--high); }
.checks .warn svg { color: var(--med); }
.checks .info svg { color: var(--ink-3); }
.np { background: var(--wash); border-radius: var(--r); padding: 14px 16px; position: relative; }
.np h3 { text-align: left; font-size: 13px; font-weight: 600; letter-spacing: 0; margin-bottom: 8px; color: var(--ink-3); }

/* ---------- dialogs, toasts, banners ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: rm-fade .15s ease-out; }
.sheetm { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--panel); border-radius: 18px 18px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); animation: rm-rise .2s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 640px) { .scrim { align-items: center; } .sheetm { border-radius: 16px; animation-name: rm-pop; } }
@keyframes rm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rm-rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes rm-pop { from { transform: scale(.97) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheetm h2 { margin-bottom: 10px; }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + 88px + env(safe-area-inset-bottom)); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 92px; } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-2); max-width: 520px; pointer-events: auto; animation: rm-pop .18s ease-out; }
.toast.bad { background: var(--high); color: #fff; }
.toast.good { background: var(--s-closed); color: #fff; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); background: var(--med-bg); color: var(--med-text); border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 14.5px; }
.banner.bad { background: var(--high-bg); color: var(--high-ink); }
.banner button { margin-left: auto; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; color: var(--ink-3); opacity: .7; margin-bottom: 8px; stroke-width: 1.5; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.cred { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; background: var(--wash); border-radius: var(--r); padding: 11px 14px; }
.cred .k { font-size: 14px; color: var(--ink-3); }
.cred .v { font-weight: 700; font-size: 18px; word-break: break-all; font-variant-numeric: tabular-nums; }
.unsent { font-size: 12px; font-weight: 700; color: var(--s-open-ink); background: var(--s-open-bg); border-radius: 999px; padding: 1px 8px; }
.login { min-height: 100vh; display: grid; align-content: center; padding: 24px var(--gutter); max-width: 460px; margin: 0 auto; }
.login .hero { background: transparent; color: var(--ink); border-radius: 0; padding: 8px 0 18px; margin-bottom: 8px; position: relative; overflow: visible; }
.login .hero h1 { font-size: 34px; letter-spacing: -0.03em; }
.login .hero p { color: var(--ink-3); margin: 6px 0 0; }
.login .hero p.tagline { margin: 0 0 16px; font-size: 14px; }
.login .hero svg.mast { display: none; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 10px; padding: 3px; gap: 3px; }
.seg2 button { min-height: 40px; border: 0; background: transparent; font-weight: 600; cursor: pointer; color: var(--ink-2); border-radius: 8px; }
.seg2 button[aria-pressed='true'] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.spin { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.checkrow:last-child { border-bottom: 0; }
.checkrow .pick { display: flex; gap: 6px; }
.checkrow .pick button { width: 52px; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.checkrow .pick button:hover { background: var(--wash); }
.checkrow .pick button[aria-pressed='true'].ok { background: var(--s-closed); border-color: var(--s-closed); color: #fff; }
.checkrow .pick button[aria-pressed='true'].na { background: var(--ink-3); border-color: var(--ink-3); color: var(--bg); }
.checkrow .pick button.bad { border-color: color-mix(in srgb, var(--high) 55%, var(--line)); color: var(--high); }
.checkrow .pick button[aria-pressed='true'].bad { background: var(--high); border-color: var(--high); color: #fff; }
.spacer-sm { height: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .top, .tabbar, .fab, .rail, .actionbar { display: none !important; } body { background: #fff; color: #000; } }

/* ---------- small fixes found when driving the app on a phone ---------- */
.note .btn, .banner .btn { flex: none; white-space: nowrap; }
.bignum { flex: none; white-space: nowrap; overflow-wrap: normal; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--ink-3); font-weight: 600; }
.top .title { min-width: 0; }

/* ---- camera screen (PC): always dark, like a camera ------------------------------------------------ */
.camera { position: fixed; inset: 0; z-index: 90; background: #05080C; color: #fff; display: flex; flex-direction: column; }
.cam-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
.cam-bar .iconbtn { color: #fff; }
.cam-bar .iconbtn:hover { background: rgba(255, 255, 255, .12); }
.cam-bar .grow { flex: 1; }
.cam-select { max-width: 55%; min-height: 40px; background: #1B2733; color: #fff; border: 1px solid #3B4A5A; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 15px; }
.cam-view { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.cam-view video, .cam-view img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.cam-view { touch-action: none; overflow: hidden; } /* the enlarged picture must not cover the buttons below it */
.talk-cam { touch-action: pan-y; }
.cam-view video, .talk-cam video { will-change: transform; }
.zoom-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(5, 8, 12, .62); color: #fff; max-width: calc(100% - 16px); }
.zoom-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .3); }
.zoom-btn:disabled { opacity: .35; cursor: default; }
.zoom-range { width: min(34vw, 200px); accent-color: #fff; min-width: 70px; }
.zoom-level { flex: none; min-width: 54px; min-height: 40px; border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: .7; }
.cam-err { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(5, 8, 12, .92); }
.cam-err p { font-size: 18px; max-width: 460px; margin: 0; }
.cam-strip { display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto; background: #0B141D; }
.cam-thumb { position: relative; flex: 0 0 auto; }
.cam-thumb img { height: 64px; width: auto; border-radius: 6px; border: 1px solid #3B4A5A; display: block; }
.cam-thumb button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #fff; color: #14202E; font-size: 16px; line-height: 1; cursor: pointer; }
.cam-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: #0B141D; }
.cam-side { flex: 1 1 0; min-width: 0; }
.cam-actions .btn { background: rgba(255, 255, 255, .14); color: #fff; }
.cam-actions .btn.primary { background: var(--accent); color: var(--on-accent); }
.cam-actions .btn.quiet { color: #fff; background: transparent; }
.cam-actions .btn.quiet:hover { background: rgba(255, 255, 255, .12); }
.cam-actions .cam-side:last-child { display: flex; justify-content: flex-end; }
.cam-shutter { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: #E8451E; cursor: pointer; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.cam-shutter:disabled { opacity: .4; cursor: not-allowed; }
.cam-shutter:active { transform: scale(.94); }

/* ---- project form: contacts, action party switch ----------------------------------------------- */
.party { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.party legend { font-weight: 700; padding: 0 6px; color: var(--ink); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 0; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Drop zone, tab switch inside a page, standards list */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 16px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); background: var(--wash); color: var(--ink-3); transition: background 0.12s, border-color 0.12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop.off { opacity: 0.55; }
.subtabs, .viewswitch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); overflow-x: auto; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 0 0 4px; scrollbar-width: none; }
.subtabs button, .viewswitch button { min-height: 46px; padding: 4px 8px; font-size: 15px; overflow-wrap: normal; hyphens: none; border: 0; background: none; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: normal; line-height: 1.2; text-align: center; }
.subtabs button:hover, .viewswitch button:hover { color: var(--ink); }
.subtabs button[aria-selected='true'], .viewswitch button[aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs a { overflow-wrap: normal; word-break: keep-all; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 4px 8px; font-size: 15px; font-weight: 600; color: var(--ink-3); text-decoration: none; border-bottom: 2.5px solid transparent; line-height: 1.2; text-align: center; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: -3px; }
@media (max-width: 380px) { .subtabs, .viewswitch { gap: 0; } .subtabs a, .subtabs button, .viewswitch button { font-size: 14px; padding: 4px 3px; } }
.viewswitch .n { font-weight: 500; opacity: .75; margin-left: 4px; }
.upl.ignored { color: var(--ink-3); }
.upl.done .grow strong, .upl.ignored .grow strong { overflow-wrap: anywhere; }
.learned { display: flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.presence { margin: 0 0 10px; }
details > summary { cursor: pointer; padding: 4px 0; }
.std { padding: 12px 0; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.std:first-child { border-top: 0; }
.std .code { font-weight: 700; }
.upl { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 15px; }
.upl.error { color: var(--high); }
.found { border-left: 3px solid var(--accent); padding: 4px 0 4px 10px; display: grid; gap: 2px; }

/* ---- analysis of photos and videos, standards found in the library, name plate reading */
.analyse .sugg-card { margin-top: 10px; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 10px; background: var(--wash); }
.analyse .ocr { white-space: pre-wrap; font: 13px/1.4 ui-monospace, 'SF Mono', Consolas, monospace; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 180px; overflow: auto; }
.analyse .notes { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.found { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line-2); border-left: 0; padding-left: 0; }
.found .btn { justify-self: start; }
.pkg { display: grid; gap: 0; }
.pkg-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.pkg-row.skip { opacity: .7; }
.pkg-row .chk.fail { color: var(--high); }
.pkg-row .chk.warn { color: var(--med); }
.pkg-row label { display: grid; gap: 4px; }
.plate-card { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); align-items: start; }
.plate-card:first-child { border-top: 0; padding-top: 0; }
.plate-card > img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
.plate-card.saved { grid-template-columns: 120px 1fr auto; }
.plate-card label { display: grid; gap: 4px; }
/* what the saved plate did to the observation of its equipment */
.plate-outcome.good { color: var(--good); }
.plate-outcome.warn { color: var(--s-returned); }
.plate-card.saved > .stack:last-child { align-content: start; justify-items: end; }
@media (max-width: 520px) { .plate-card, .plate-card.saved { grid-template-columns: 80px 1fr; } .plate-card > img { width: 80px; height: 60px; } .plate-card.saved > .btn { grid-column: 1 / -1; justify-self: start; } }

/* ---- marking up and measuring on a photo (dark, like a drawing tool) */
.annot-tools { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; background: #111; align-items: center; }
.annot-tools .btn { white-space: nowrap; flex: none; background: rgba(255, 255, 255, .12); color: #fff; }
.annot-tools .btn.primary { background: var(--accent); color: var(--on-accent); }
.annot-tools .sep { width: 1px; align-self: stretch; background: #444; margin: 0 4px; flex: none; }
.annot-view { display: grid; place-items: center; overflow: hidden; }
.annot-view canvas { background: #000; border-radius: 6px; }
.annot-help { padding: 8px 12px; background: #1b1b1b; color: #eee; display: grid; gap: 4px; min-height: 44px; }
.annot-help .input, .annot-help .select { background: #fff; color: #111; }

/* ---- live inspection: a conversation between the inspector and RigMind */
.live .chat { display: grid; gap: 10px; align-content: start; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 16.5px; line-height: 1.4; overflow-wrap: anywhere; }
.bubble.bot { background: var(--fill); color: var(--ink); border-bottom-left-radius: 5px; justify-self: start; }
.bubble.me { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; justify-self: end; }
.livepanel { max-height: 44vh; overflow-y: auto; position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 20; background: var(--glass); border-top: 1px solid var(--line-2); padding: 12px var(--gutter); margin: 0 calc(var(--gutter) * -1); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumb { width: 64px; height: 48px; border-radius: 8px; background: var(--fill) center / cover no-repeat; }
.live .sugg-card { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 10px; background: var(--panel); box-shadow: var(--shadow-1); }
.live .notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
@media (min-width: 900px) { .livepanel { bottom: 0; } }
.live .chips .chip { min-height: 38px; }

/* company logos beside RigMind's, in the top bar */
.party-logos { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: 4px; }
.party-logos img { height: 32px; max-width: 96px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px 5px; display: block; box-shadow: inset 0 0 0 1px rgba(20, 22, 28, .08); }
@media (max-width: 520px) {
  .party-logos img { height: 28px; max-width: 66px; padding: 2px 3px; }
  .top:has(.party-logos) .brand span { display: none; }
  .top:has(.party-logos) .title { font-size: 14px; }
}
.logo-slot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-2); }
.logo-slot:first-of-type { border-top: 0; }
.logo-box { width: 140px; height: 70px; border: 1.5px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 132px; max-height: 62px; object-fit: contain; }

/* equipment register */
.reg-totals { display: flex; flex-wrap: wrap; gap: 6px; }
.reg-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel); -webkit-overflow-scrolling: touch; box-shadow: var(--shadow-1); }
.reg-wrap:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.reg { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: 14px; }
.reg th, .reg td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.reg thead th { position: sticky; top: 0; background: var(--wash); color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: normal; line-height: 1.25; }
.reg thead th:first-child, .reg tbody th { position: sticky; left: 0; z-index: 1; }
.reg thead th:first-child { z-index: 2; }
.reg thead th { vertical-align: bottom; }
.reg thead th:not(:first-child) { min-width: 104px; }
.reg thead th:nth-child(3) { min-width: 150px; }
.reg tbody th { background: var(--panel); min-width: 150px; max-width: 200px; box-shadow: 1px 0 0 var(--line-2); font-weight: 400; }
.reg.bk { min-width: 0; }
.reg.bk thead th:not(:first-child), .reg.bk thead th:nth-child(3) { min-width: 0; }
.reg.bk tbody th { min-width: 130px; }
.reg.bk .restore { white-space: nowrap; }
@media (max-width: 600px) {
  /* a phone: each backup is a block (date, what is in it, then the button), not three squeezed columns */
  .reg.bk thead { position: absolute; left: -9999px; }
  .reg.bk, .reg.bk tbody, .reg.bk tr { display: block; width: 100%; }
  .reg.bk tr { padding: 8px 10px 12px; border-bottom: 1px solid var(--line-2); }
  .reg.bk tbody th, .reg.bk td { display: block; position: static; box-shadow: none; border: 0; padding: 2px 0; min-width: 0; max-width: none; background: transparent; text-align: left !important; }
  .reg.bk td:last-child { padding-top: 8px; }
}
.reg tr.is-open th, .reg tr.reg-more td { background: var(--wash); }
.reg-name { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-weight: 600; color: var(--accent); }
.reg-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.reg-name:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 6px; }
.reg-name .small { font-weight: 400; color: var(--ink-3); }
.reg-c { white-space: nowrap; }
.reg-c > span { margin-left: 4px; }
.reg-c svg { vertical-align: -2px; }
.reg-c.good { color: var(--s-closed-ink); }
.reg-c.bad { color: var(--high-ink); background: var(--high-bg); font-weight: 600; }
.reg-c.warn { color: var(--med-text); }
.reg-more td { white-space: normal; }
.subtabs.small-tabs button { min-height: 38px; font-size: 13px; }
details.note > summary { cursor: pointer; }
.narrow-sec { max-width: 820px; }

/* talking live inspection */
.talk-cam { position: relative; background: #0b1520; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; max-height: 62vh; }
.talk-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.talk-cam-off { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; padding: 16px; text-align: center; color: #dfe6ee; }
.talk-status { position: absolute; left: 10px; bottom: 10px; right: 56px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(11, 21, 32, .78); color: #fff; font-size: 14px; font-weight: 600; width: fit-content; max-width: calc(100% - 66px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talk-status .dot { width: 10px; height: 10px; border-radius: 50%; background: #8a97a5; flex: none; }
.talk-status.listening .dot { background: #34c06e; animation: rm-pulse 1.4s ease-in-out infinite; }
.talk-status.speaking .dot { background: #5A9BFF; }
@keyframes rm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .talk-status.listening .dot { animation: none; } }
.talk-flip { position: absolute; right: 10px; bottom: 8px; background: rgba(11, 21, 32, .78); color: #fff; }
.talk-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.talk-mic { flex: 1 1 100%; min-height: 56px; font-size: 17px; }
.talk-mic.on { background: var(--high-bg); color: var(--high-ink); }
.talk-draft h2 { font-size: 17px; }
.talk .thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }

/* document viewer */
.viewer { position: fixed; inset: 0; z-index: 85; background: var(--bg); display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--glass); border-bottom: 1px solid var(--line-2); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
.viewer-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.viewer-bar .btn { flex: none; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--bg-side); }
.pv-pdf { display: flex; flex-direction: column; gap: 10px; max-width: 1000px; margin: 0 auto; }
.pv-pages { overflow-x: auto; display: flex; flex-direction: column; gap: 10px; }
.pv-page { display: block; max-width: none; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .22); margin: 0 auto; }
.pv-img { display: block; max-width: 100%; margin: 0 auto; background: #fff; }
.pv-text { white-space: pre-wrap; word-break: break-word; background: var(--panel); padding: 14px; border-radius: var(--r); max-width: 1000px; margin: 0 auto; font-size: 14px; }
.pv-doc { max-width: 1000px; margin: 0 auto; background: var(--panel); padding: 18px; border-radius: var(--r); }
.pv-doc p { margin: 0 0 10px; }
.pv-table { overflow-x: auto; margin: 0 0 12px; }
.pv-table table { border-collapse: collapse; font-size: 13px; }
.pv-table td { border: 1px solid var(--line-2); padding: 4px 6px; vertical-align: top; min-width: 60px; }
.doclink { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
.doclink:hover { text-decoration: underline; }
.doc-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .doc { border-bottom: 0; min-width: 0; }
.doc-row .doc-open { flex: none; margin-right: 8px; }
.reg-more > td > .stack { position: sticky; left: 10px; max-width: min(680px, calc(100vw - 72px)); white-space: normal; }
.doc-tabs { grid-auto-columns: minmax(104px, max-content); }
.manual-links { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; margin-left: 4px; }
.manual-link, .manual-title { text-align: left; }

/* record tabs and observations from the documentation */
.reg.rec th, .reg.rec td { position: static; min-width: 90px; }
.reg.rec thead th { position: sticky; top: 0; }
.reg.rec td.rec-work, .reg.rec td.rec-finding, .reg.rec td.rec-remarks, .reg.rec td.rec-action { min-width: 240px; white-space: normal; }
.reg.rec td.rec-eq { font-weight: 700; min-width: 140px; }
.reg.rec tr.rec-group td { border-top: 2px solid var(--line-2); }
.docobs { display: flex; flex-direction: column; }
.docobs-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.docobs-row:last-child { border-bottom: 0; }
.docobs-row input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.docobs-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.crit.high { font-weight: 600; }

/* document audit: one card for each thing the inspector checks in the documents */
.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); border-left: 4px solid var(--line); overflow: hidden; }
.audit-card.clear { border-left-color: var(--s-closed); }
.audit-card.open { border-left-color: var(--high); }
.audit-card.missing { border-left-color: var(--med); }
.audit-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 14px; background: none; border: 0; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.audit-head:hover { background: var(--wash); }
.audit-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.audit-line { color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.audit-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--wash); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.audit-card.clear .audit-n { background: var(--s-closed-bg); color: var(--s-closed-ink); }
.audit-card.open .audit-n { background: var(--high-bg); color: var(--high-ink); }
.audit-card.missing .audit-n { background: var(--med-bg); color: var(--med-text); }
.audit-head .pill { flex: none; }
.audit-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px 54px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.audit-ask { margin: 0; }
.audit-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.audit-lines li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.audit-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--wash); color: var(--ink-2); margin-top: 1px; }
.audit-lines li.bad .audit-mark { background: var(--high-bg); color: var(--high-ink); }
.audit-lines li.warn .audit-mark { background: var(--med-bg); color: var(--med-text); }
.audit-basis { margin: 0; }
@media (max-width: 560px) {
  .audit-head { gap: 10px; padding: 12px; }
  .audit-body { padding-left: 16px; padding-right: 14px; }
}

/* walk-through */
.walk-sec > header { padding: 0; }
.walk-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 10px 16px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.walk-head:hover { background: var(--wash); border-radius: var(--r-lg); }
.walk-done { color: var(--s-closed-ink); font-weight: 700; }
.walk-no { color: var(--ink-3); font-size: 13px; margin-right: 2px; }
.walk-docs { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; background: var(--wash); border-bottom: 1px solid var(--line-2); }
.checkrow .tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--wash); color: var(--ink-2); vertical-align: 1px; }
.checkrow .tag.DROPS { background: var(--s-open-bg); color: var(--s-open-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.talk-rec { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(200, 30, 30, .92); color: #fff; font-weight: 700; font-size: 13px; }
.talk-rec .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: rm-pulse 1s ease-in-out infinite; }
.btn.rec-on { background: var(--high-bg); color: var(--high-ink); }
.thumb-video { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 72px; height: 54px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700; }
@media (max-width: 560px) {
  .walk-sec .checkrow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .walk-sec .checkrow .pick { justify-content: flex-end; }
}
.checkrow .tag.party { cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; border: 0; }
.checkrow .tag.party.elec { background: var(--med-bg); color: var(--med-text); }
.checkrow .tag.party.struct { background: var(--low-bg); color: var(--low-ink); }
.checkrow .tag.party.hse { background: var(--s-closed-bg); color: var(--s-closed-ink); }
.walk-move { font-size: 13px; padding: 2px 4px; }
.walk-by { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.walk-by .who { display: inline-block; min-width: 20px; padding: 0 4px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700; text-align: center; line-height: 18px; }
.dash-tabs { grid-auto-columns: minmax(112px, max-content); }
.ts-rows { display: flex; flex-direction: column; gap: 10px; }
.ts-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.ts-row .field { margin: 0; min-width: 130px; }
.ts-row .field.grow { flex: 1 1 180px; }
.ts-row .ts-off { max-width: 130px; }
.ts-days { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.ts-days strong { font-size: 20px; }
.ts-problem { flex-basis: 100%; color: var(--high); }
.talk-guide .btn.guide-ok { background: var(--s-closed-bg); color: var(--s-closed-ink); }

/* live with Gemini */
.gl-badge { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; max-width: 70%; }
.gl-live { padding: 3px 9px; border-radius: 999px; background: #E5484D; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .06em; }
.gl-model { padding: 3px 9px; border-radius: 999px; background: rgba(11, 21, 32, .78); color: #dfe6ee; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-meter { position: absolute; left: 10px; right: 56px; bottom: 50px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.gl-meter span { display: block; height: 100%; background: #34c06e; transform: scaleX(0); transform-origin: left; transition: transform 90ms linear; }
@media (prefers-reduced-motion: reduce) { .gl-meter span { transition: none; } }
.gl-start { min-height: 56px; font-size: 17px; width: 100%; }
.gl-hold { touch-action: none; user-select: none; -webkit-user-select: none; }
.gl .sugg-card { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 8px; background: var(--panel); box-shadow: var(--shadow-1); }
.gl-prop.saved { border-color: var(--s-closed); background: var(--s-closed-bg); }
.gl .thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.gl-chat { display: grid; gap: 10px; align-content: start; }
.bubble.gl-note { font-size: 14px; color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.defs { margin: 4px 0 0; padding-left: 20px; }
.defs li { margin: 3px 0; }

/* ---- Appearance card (Settings) and the desktop program ---------------------------------------- */
.appearance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.appearance button { display: grid; gap: 8px; justify-items: center; padding: 10px 8px 8px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.appearance button:hover { background: var(--wash); }
.appearance button[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.appearance .swatch { width: 100%; height: 46px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; grid-template-columns: 28% 1fr; overflow: hidden; }
.appearance .swatch i { display: block; }
.appearance .light i:first-child { background: #F5F5F7; } .appearance .light i:last-child { background: #fff; }
.appearance .dark i:first-child { background: #141416; } .appearance .dark i:last-child { background: #1B1B1E; }
.appearance .auto { background: linear-gradient(105deg, #fff 50%, #1B1B1E 50%); }
.appearance .auto i { background: transparent; }

html.desktop { overscroll-behavior: none; }
html.desktop body { user-select: none; -webkit-user-select: none; cursor: default; }
html.desktop input, html.desktop textarea, html.desktop select, html.desktop [contenteditable], html.desktop .selectable, html.desktop .kv dd, html.desktop .cred .v, html.desktop .obs .t, html.desktop p { user-select: text; -webkit-user-select: text; }
html.desktop a, html.desktop button { cursor: default; }
html.desktop .input, html.desktop .textarea { cursor: text; }
/* macOS: the traffic lights sit in the top-left corner of the window, so the bar leaves room for them and drags the window */
html.os-darwin.desktop .top { padding-left: 84px; -webkit-app-region: drag; }
html.os-darwin.desktop .top a, html.os-darwin.desktop .top button, html.os-darwin.desktop .top .party-logos { -webkit-app-region: no-drag; }


/* Back to the main tab (pages inside a tab), the account button of the contractor and the owner, seven tabs on a phone */
.backbar { margin: 0 0 6px; padding: 10px var(--gutter) 0; max-width: 1120px; margin-left: auto; margin-right: auto; }
.backbar .btn { gap: 4px; padding-left: 6px; }
.acct-wrap { position: relative; flex: none; }
.acct-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.acct-btn:hover { background: var(--fill-hover); }
.acct-menu { position: absolute; right: 0; top: 42px; z-index: 60; width: min(320px, calc(100vw - 24px)); display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(20, 22, 28, .22); }
.acct-menu .sec { box-shadow: none; border: 0; background: transparent; }
.tabbar.many .tab { font-size: 10px; padding-left: 0; padding-right: 0; }
.tabbar.many .tab svg { width: 22px; height: 22px; }

/* ---- Settings: inspector accounts, my voice, the voice lock chip on Live (1.5.0) */
.pill.quiet { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }
.acct-row { padding: 12px 0; border-top: 1px solid var(--line-2); }
.acct-row:first-child { border-top: 0; padding-top: 0; }
.acct-row.off strong { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.login-row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.login-row:first-child { border-top: 0; padding-top: 0; }
.login-row.off strong { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.login-row .btns .btn { flex: 0 0 auto; }
.login-row .lg-pass { letter-spacing: .04em; }
.acct-login { margin-top: 10px; }
#share-missing, #logins-missing { display: grid; gap: 10px; justify-items: start; }
.acct-login .btns .btn { flex: 0 0 auto; }
.acct-login .lg-pass { letter-spacing: .04em; }
#logins-filter { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { #logins-filter { grid-template-columns: 1fr 1fr; } }
.acct-btns { flex: 0 0 auto; }
.acct-btns .btn { flex: 0 0 auto; }
.acct-edit { margin-top: 12px; padding: 14px; background: var(--wash); border-radius: var(--r); }
.voice-phrase { margin: 0; padding: 14px 16px; border-left: 4px solid var(--accent); background: var(--wash); border-radius: var(--r); font-size: 18px; line-height: 1.5; font-weight: 600; }
.gl-meter.static { position: static; height: 8px; border-radius: 4px; background: var(--fill); }
.gl-lock { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: rgba(20, 24, 31, .72); backdrop-filter: blur(6px); }
.gl-lock .i { width: 15px; height: 15px; }
.gl-lock.open { background: rgba(26, 127, 75, .88); }
.gl-lock.checking { background: rgba(60, 90, 160, .85); }
.gl-lock.blocked { background: rgba(176, 90, 20, .9); }

/* ---- Settings: account types, the filter, and the selected choice in My voice (1.5.1) */
.acct-seg button { min-height: 48px; padding: 4px 6px; font-size: 15px; text-align: center; line-height: 1.2; }
#acct-filter { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { #acct-filter { grid-template-columns: 1fr 1fr; } #acct-type { grid-template-columns: 1fr; } }
.acct-seg button[aria-pressed='true'], #voice-card .seg button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.voice-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.voice-steps li { line-height: 1.45; }
.voice-progress { display: flex; gap: 6px; }
.voice-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--fill); }
.voice-progress i.done { background: var(--s-closed); }
.voice-progress i.now { background: var(--accent); }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--wash); }
.voice-row > .i { flex: none; }
.voice-row > .grow { flex: 1 1 200px; min-width: 0; }

/* ---------- 1.6.0: a row wider than the screen, with a sliding bar under it (Slider) ---------- */
.slider { position: relative; min-width: 0; }
.slider-wrap { position: relative; }
.slider-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; cursor: grab; }
.slider-row::-webkit-scrollbar { display: none; }
.slider-row > * { flex: none; scroll-snap-align: start; }
.slider-row:active { cursor: grabbing; }
.slider-arrow { position: absolute; top: 0; bottom: 6px; width: 38px; z-index: 2; display: flex; align-items: center; border: 0; padding: 0; color: var(--ink); cursor: pointer; }
.slider-arrow.left { left: 0; justify-content: flex-start; background: linear-gradient(90deg, var(--bg) 45%, transparent); }
.slider-arrow.right { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--bg) 45%, transparent); }
.slider-arrow .i { width: 22px; height: 22px; }
.slider-bar { display: block; width: 100%; height: 26px; margin: 0; padding: 0; background: none; accent-color: var(--accent); cursor: pointer; }
.slider .subtabs { margin-bottom: 0; }
.slider-wrap > .subtabs { display: flex; }
.slider-wrap > .subtabs > a { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; white-space: nowrap; }

/* welcome screen (after signing in) and the invitations under it */
.welcome { position: relative; isolation: isolate; }
/* the RigMind symbol as the background of the welcome: large and faint, fixed behind the page, in the colours of the theme (navy on light pages,
   the reversed version on dark ones) */
.welcome-bg { position: fixed; inset: 56px 0 0 0; z-index: -1; display: grid; place-items: center; overflow: hidden; pointer-events: none; user-select: none; opacity: .14; }
.welcome-bg svg { width: min(94vw, 620px); height: auto; max-height: 92%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .welcome-bg { opacity: .11; } }
:root[data-theme='dark'] .welcome-bg { opacity: .11; }
.welcome .welcome-card, .welcome .invite { background: color-mix(in srgb, var(--panel) 80%, transparent); }
.welcome-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 24px 22px; }
.welcome-card h1 { font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
.invite { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel); color: var(--ink); text-decoration: none; }
.invite:hover { border-color: var(--accent); }
.invite:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.invite > .i { width: 22px; height: 22px; flex: none; color: var(--accent); }

/* two-step sign-in: the QR code (white behind it, also in the dark theme: a phone camera needs dark on light) and the recovery codes */
.qr { display: block; flex: none; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; }
.twostep-key { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.twostep-key > .stack { min-width: 200px; flex: 1 1 200px; }
.recovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.recovery-grid code { padding: 9px 10px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; font-size: 16px; letter-spacing: .5px; background: var(--panel); user-select: all; }

/* ---- 1.7.0: QR code under a link, and the logins of the contractor and the owner */
.qr-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qr-box .small { max-width: 28ch; }
