/* SDMS — Khan Associates Service Department
   Light / dark / system themes via tokens. IBM Plex Sans (OFL), self-hosted. */

@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #14212B;
  --ink-2: #44525C;
  --ink-3: #6B7882;
  --paper: #F4F6F7;
  --surface: #FFFFFF;
  --surface-2: #EEF2F4;
  --rule: #D6DDE1;
  --rule-strong: #B9C4CA;
  --accent: #0E7686;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1F1F3;
  --side: #14212B;
  --side-ink: #C9D4DA;
  --side-ink-strong: #FFFFFF;
  --side-hover: #1E2F3B;
  --ok: #1E7A46;      --ok-soft: #E3F2E9;
  --warn: #9A5B00;    --warn-soft: #FBF0DC;
  --bad: #B42318;     --bad-soft: #FBE7E5;
  --info: #1F5F99;    --info-soft: #E4EEF8;
  --focus: #0E7686;
  --radius-s: 4px;
  --radius-m: 6px;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06);
  --font: "Plex", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E3EAEE; --ink-2: #B3C0C7; --ink-3: #8696A0;
    --paper: #0E161C; --surface: #15212A; --surface-2: #1B2A35;
    --rule: #263844; --rule-strong: #34495A;
    --accent: #3FB6C6; --accent-ink: #062228; --accent-soft: #123A41;
    --side: #0A1116; --side-ink: #9FB0BA; --side-ink-strong: #FFFFFF; --side-hover: #15212A;
    --ok: #5CC48A; --ok-soft: #12301F; --warn: #E3A64A; --warn-soft: #3A2A10;
    --bad: #F0857B; --bad-soft: #3D1814; --info: #79B2E8; --info-soft: #142B40;
    --focus: #3FB6C6; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E3EAEE; --ink-2: #B3C0C7; --ink-3: #8696A0;
  --paper: #0E161C; --surface: #15212A; --surface-2: #1B2A35;
  --rule: #263844; --rule-strong: #34495A;
  --accent: #3FB6C6; --accent-ink: #062228; --accent-soft: #123A41;
  --side: #0A1116; --side-ink: #9FB0BA; --side-ink-strong: #FFFFFF; --side-hover: #15212A;
  --ok: #5CC48A; --ok-soft: #12301F; --warn: #E3A64A; --warn-soft: #3A2A10;
  --bad: #F0857B; --bad-soft: #3D1814; --info: #79B2E8; --info-soft: #142B40;
  --focus: #3FB6C6; --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 1.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; }
h3 { font-size: .9375rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; gap: .75rem; align-items: center; padding: 1.125rem 1.25rem 1rem; color: var(--side-ink-strong); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-s); background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: .8125rem; letter-spacing: .02em; flex: none; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font-weight: 600; line-height: 1.2; font-size: .9375rem; }
.brand-sub { font-size: .75rem; color: var(--side-ink); }
.nav { padding: .5rem .75rem 1rem; flex: 1; }
.nav-group { margin-top: 1.25rem; }
.nav-heading { font-size: .75rem; color: var(--side-ink); opacity: .75; padding: 0 .75rem .375rem; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; border-radius: var(--radius-s);
  color: var(--side-ink); text-decoration: none; font-size: .9rem; position: relative;
}
.nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a[aria-current="page"] { background: var(--side-hover); color: var(--side-ink-strong); font-weight: 500; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -.75rem; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8125rem; }
.side-foot .who { color: var(--side-ink-strong); font-weight: 500; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .75rem 2rem; border-bottom: 1px solid var(--rule);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { margin: .25rem 0 0; color: var(--ink-3); }
.crumbs { font-size: .8125rem; color: var(--ink-3); margin-bottom: .25rem; }
.crumbs a { color: var(--ink-3); }

/* ---------- Theme switch ---------- */
.theme-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; }
.theme-switch button { background: transparent; border: 0; padding: .3rem .55rem; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.theme-switch button + button { border-left: 1px solid var(--rule); }
.theme-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.theme-switch svg { width: 16px; height: 16px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .875rem 1.125rem; border-bottom: 1px solid var(--rule); }
.panel-body { padding: 1.125rem; }
.panel-body.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }

/* Readout strip: dashboard figures read like an instrument display */
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); margin-bottom: 1.5rem; overflow: hidden; }
.readout a { padding: 1rem 1.25rem; color: inherit; text-decoration: none; border-right: 1px solid var(--rule); display: block; }
.readout a:last-child { border-right: 0; }
.readout a:hover { background: var(--surface-2); }
.readout .val { font-size: 1.875rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.readout .lbl { font-size: .8125rem; color: var(--ink-3); margin-top: .25rem; display: flex; gap: .375rem; align-items: center; }
.readout .tone-warn .val { color: var(--warn); }
.readout .tone-ok .val { color: var(--ok); }

/* ---------- ID tags (styled like engraved instrument asset labels) ---------- */
.tag-id {
  display: inline-block; font-weight: 600; font-size: .8125rem; letter-spacing: .03em; white-space: nowrap;
  padding: .0625rem .4375rem; border: 1px solid var(--rule-strong); border-radius: 3px;
  background: linear-gradient(var(--surface-2), var(--surface)); color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--rule);
}
a.tag-id { text-decoration: none; }
a.tag-id:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Status pills (text always present; colour supports it) ---------- */
.pill { display: inline-flex; align-items: center; gap: .3125rem; font-size: .75rem; font-weight: 500; padding: .125rem .5rem; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.plain::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: .8125rem; padding: .625rem 1rem; border-bottom: 1px solid var(--rule); background: var(--surface); white-space: nowrap; }
table.data td { padding: .625rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .sub { color: var(--ink-3); font-size: .8125rem; }
.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); margin-bottom: .25rem; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; font-size: .9rem; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; }

/* Timeline (activity) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: .75rem; padding: .625rem 1.125rem; border-bottom: 1px solid var(--rule); font-size: .875rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--ink-3); font-size: .8125rem; }
.timeline .who { font-weight: 500; }

/* ---------- Forms ---------- */
.form { max-width: 760px; }
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-weight: 500; font-size: .875rem; margin-bottom: .3125rem; }
.field .hint { font-size: .8125rem; color: var(--ink-3); margin-top: .25rem; }
.req::after { content: " *"; color: var(--bad); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s); padding: .5rem .625rem; min-height: 38px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.error-text { color: var(--bad); font-size: .8125rem; margin-top: .25rem; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .875rem; padding: .25rem 0; }
.check input { margin-top: .25rem; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.form-actions { display: flex; gap: .75rem; align-items: center; padding-top: .5rem; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }

.filters { display: flex; flex-wrap: wrap; gap: .625rem; align-items: flex-end; padding: .875rem 1.125rem; border-bottom: 1px solid var(--rule); }
.filters .field { margin: 0; min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters label { font-size: .75rem; color: var(--ink-3); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4375rem; font: inherit; font-size: .875rem; font-weight: 500;
  padding: .5rem .9rem; min-height: 38px; border-radius: var(--radius-s); border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.small { min-height: 30px; padding: .25rem .625rem; font-size: .8125rem; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Alerts ---------- */
.alert { padding: .75rem 1rem; border-radius: var(--radius-s); border: 1px solid; margin-bottom: 1rem; font-size: .9rem; display: flex; gap: .625rem; }
.alert.success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ink); }
.alert.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--ink); }
.alert.warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--ink); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--ink); }
.alert strong { font-weight: 600; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.125rem; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--ink-3); flex-wrap: wrap; }
.pager nav { display: flex; gap: .375rem; }

/* ---------- Permission matrix ---------- */
.perm-module { border-top: 1px solid var(--rule); padding: 1rem 1.125rem; }
.perm-module:first-child { border-top: 0; }
.perm-module-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; gap: 1rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .125rem 1.5rem; }
.perm-grid code { font-size: .75rem; color: var(--ink-3); }

/* ---------- Diff ---------- */
table.diff td.old { color: var(--bad); }
table.diff td.new { color: var(--ok); }
pre.json { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .8125rem; background: var(--surface-2); padding: .75rem; border-radius: var(--radius-s); }

/* ---------- Guest (sign-in) layout ---------- */
.guest { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.guest-art { background: var(--side); color: var(--side-ink); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.guest-art .brand { padding: 0; }
.guest-art h2 { color: var(--side-ink-strong); font-size: 1.75rem; font-weight: 500; max-width: 18ch; line-height: 1.2; letter-spacing: -0.01em; }
.guest-art p { max-width: 42ch; margin-top: .75rem; }
.spectrum { position: absolute; left: 0; right: 0; bottom: 30%; height: 160px; opacity: .9; pointer-events: none; }
.guest-form { display: grid; place-items: center; padding: 2rem; }
.guest-card { width: 100%; max-width: 400px; }
.guest-card h1 { margin-bottom: .375rem; }
.guest-card .lead { color: var(--ink-3); margin-bottom: 1.5rem; }
.guest-card .btn.primary { width: 100%; min-height: 42px; }
.install-card { max-width: 560px; }
.checks { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .875rem; }
.checks li { display: flex; gap: .5rem; padding: .25rem 0; }

/* ---------- Header: dropdowns, clock, bell, account ---------- */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary svg:last-child:not(:first-child) { width: 14px; height: 14px; opacity: .7; }
.dd[open] > summary { background: var(--surface-2); }
.dd-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(20, 33, 43, .14); padding: .375rem; display: flex; flex-direction: column;
}
.dd-panel.dd-left { left: 0; right: auto; }
.dd-panel.dd-wide { width: 340px; padding: 0; }
.dd-panel > a, .dd-panel form > button[role=menuitem] {
  display: flex; align-items: center; gap: .625rem; padding: .5rem .625rem; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font: inherit; font-size: .875rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.dd-panel > a:hover, .dd-panel form > button[role=menuitem]:hover { background: var(--surface-2); text-decoration: none; }
.dd-panel svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.dd-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .625rem .75rem; border-bottom: 1px solid var(--rule); font-size: .875rem; }
.dd-panel:not(.dd-wide) .dd-head { margin: -.375rem -.375rem .375rem; }
.dd-foot { display: block !important; text-align: center; padding: .625rem !important; border-top: 1px solid var(--rule); border-radius: 0 !important; font-size: .8125rem !important; color: var(--accent) !important; }
.dd-theme { display: none; align-items: center; gap: .25rem; padding: .25rem .625rem; }
.dd-theme span { flex: 1; }

.clock { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--ink-2); padding: 0 .5rem; white-space: nowrap; }
.clock svg { width: 16px; height: 16px; color: var(--ink-3); }
.clock strong { color: var(--ink); font-weight: 600; font-size: .875rem; margin-left: .25rem; }

.bell { position: relative; }
.bell .badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: .6875rem; font-weight: 600; line-height: 17px; text-align: center;
}
.avatar-btn { display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.dd[open] > .avatar-btn { background: transparent; box-shadow: 0 0 0 2px var(--accent-soft); }
.nav-count { margin-left: auto; background: var(--bad); color: #fff; font-size: .6875rem; font-weight: 600; border-radius: 9px; padding: 0 6px; line-height: 17px; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { border-bottom: 1px solid var(--rule); }
.notice-list li:last-child { border-bottom: 0; }
.notice { display: flex; gap: .75rem; width: 100%; text-align: left; background: none; border: 0; padding: .75rem 1.125rem; font: inherit; color: var(--ink); cursor: pointer; }
.notice:hover { background: var(--surface-2); }
.notice-list.compact .notice { padding: .625rem .75rem; }
.notice .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; flex: none; background: var(--rule-strong); }
.notice-list li.unread .dot.tone-info { background: var(--info); }
.notice-list li.unread .dot.tone-ok { background: var(--ok); }
.notice-list li.unread .dot.tone-warn { background: var(--warn); }
.notice-list li.unread .dot.tone-bad { background: var(--bad); }
.notice-list li.unread .notice-title { font-weight: 600; }
.notice-text { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.notice-title { font-size: .875rem; }
.notice-body { font-size: .8125rem; color: var(--ink-2); }
.notice-time { font-size: .75rem; color: var(--ink-3); }

/* Header job search */
.top-search input { width: 240px; min-height: 34px; padding: .375rem .625rem; font-size: .875rem; background: var(--surface-2); border-color: var(--rule); }
.top-search input:focus { background: var(--surface); }
/* 1.3 global search suggestions */
.top-search { position: relative; }
.m-search { display: none; }
.gs-panel { position: absolute; top: calc(100% + 6px); left: 0; width: min(460px, 90vw); max-height: 70vh; overflow-y: auto; z-index: 60; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: .375rem; }
.gs-panel[hidden] { display: none; }
.gs-group { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: .5rem .625rem .25rem; }
.gs-item { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .4375rem .625rem; border-radius: 6px; color: inherit; text-decoration: none; }
.gs-item:hover, .gs-item[aria-selected="true"] { background: var(--accent-soft); }
.gs-item .t { font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; }
.gs-item .s { grid-column: 1; font-size: .75rem; color: var(--ink-3); overflow-wrap: anywhere; }
.gs-item .b { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .6875rem; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: .0625rem .5rem; white-space: nowrap; }
.gs-foot, .gs-empty { display: block; padding: .5rem .625rem; font-size: .8125rem; }
.gs-empty { color: var(--ink-3); }
.search-results .gs-item { border-bottom: 1px solid var(--rule); border-radius: 0; padding: .625rem 1.125rem; }
.search-results .gs-item:last-child { border-bottom: 0; }

/* ---------- Footer ---------- */
.app-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: 1rem 2rem; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--ink-3); }
.guest-card .app-foot { border-top: 0; padding: 2.5rem 0 0; justify-content: flex-start; flex-direction: column; gap: .125rem; }
.main { min-height: 100vh; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .grid-2, .grid-even { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: .625rem 1rem; gap: .5rem; }
  .topbar .btn .label { display: none; }
  .hide-mobile { display: none !important; }
  .top-search { display: none; }
  .m-search { display: inline-flex; }
  .dd-theme.show-mobile { display: flex; }
  .clock .clock-date { display: none; }
  .clock { padding: 0 .25rem; }
  .dd-panel.dd-wide { position: fixed; left: .75rem; right: .75rem; top: 56px; width: auto; }
  .dd-panel.dd-left { position: fixed; left: .75rem; right: .75rem; top: 56px; }
  .app-foot { padding: 1rem; }
  .filters .field, .filters .field.grow { min-width: 0; flex: 1 1 100%; }
  .filters .btn { flex: 1 1 auto; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .guest { grid-template-columns: 1fr; }
  .guest-art { display: none; }
  .readout a { border-right: 0; border-bottom: 1px solid var(--rule); }
  .timeline li { grid-template-columns: 1fr; gap: .125rem; }
  table.data.stack-mobile thead { display: none; }
  table.data.stack-mobile tr { display: block; border-bottom: 1px solid var(--rule); padding: .5rem 0; }
  table.data.stack-mobile td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .25rem 1rem; }
  table.data.stack-mobile td::before { content: attr(data-label); color: var(--ink-3); font-size: .8125rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .side, .topbar, .filters, .pager, .btn, .theme-switch { display: none !important; }
  .shell { display: block; } body { background: #fff; color: #000; }
  .panel { border-color: #999; box-shadow: none; }
}

/* ---------- Phase 2: registration form ---------- */
.reg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.reg-side { position: sticky; top: 76px; }
.reg-submit { width: 100%; min-height: 44px; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(20,33,43,.14); max-height: 320px; overflow-y: auto; }
.combo-list li { padding: .5rem .625rem; border-radius: var(--radius-s); cursor: pointer; display: flex; flex-direction: column; }
.combo-list li:hover, .combo-list li.active { background: var(--surface-2); }
.combo-list li .sub, .inst-option .sub { color: var(--ink-3); font-size: .8125rem; }
.combo-empty { color: var(--ink-3); cursor: default !important; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-m); margin-bottom: 1rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.inst-list { display: grid; gap: .5rem; margin-bottom: .5rem; }
.inst-option { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius-m); cursor: pointer; }
.inst-option:hover { background: var(--surface-2); }
.inst-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.inst-option input { margin-top: .25rem; accent-color: var(--accent); }
.inst-option > span { display: flex; flex-direction: column; gap: .125rem; }
.inst-option .pill { align-self: flex-start; margin-top: .25rem; }
#new-inst, #new-cust { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }

/* ---------- Job lists ---------- */
.job-table td { font-size: .8125rem; }
.job-table td strong { font-size: .875rem; }
tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.remarks-cell { max-width: 220px; color: var(--ink-2); }

/* ---------- Job Update Center ---------- */
.job-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.job-head h1 { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.job-head h1 .tag-id { font-size: 1.125rem; padding: .125rem .625rem; }
.job-sub { display: flex; flex-wrap: wrap; gap: .375rem .75rem; align-items: center; margin-top: .5rem; color: var(--ink-2); font-size: .875rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .625rem .875rem; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .9rem; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tabs .count { font-size: .75rem; color: var(--ink-3); margin-left: .25rem; }
.now-card { border: 1px solid var(--accent); border-radius: var(--radius-m); background: var(--surface); }
.now-card .panel-head { background: var(--accent-soft); border-bottom-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper li { display: grid; grid-template-columns: 28px 1fr auto; gap: .75rem; padding: .75rem 1.125rem; border-bottom: 1px solid var(--rule); align-items: start; }
.stepper li:last-child { border-bottom: 0; }
.stepper .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 600; border: 1.5px solid var(--rule-strong); color: var(--ink-3); background: var(--surface); }
.stepper .mark svg { width: 14px; height: 14px; }
.stepper li.done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.skipped .mark { border-style: dashed; color: var(--ink-3); }
.stepper li.current { background: var(--accent-soft); }
.stepper li.current .mark { border-color: var(--accent); color: var(--accent); border-width: 2px; }
.stepper .step-meta { font-size: .8125rem; color: var(--ink-3); }
.stepper .step-remarks { font-size: .8125rem; color: var(--ink-2); margin-top: .25rem; white-space: pre-line; }
.mini-steps { display: flex; gap: 3px; margin-top: .5rem; }
.mini-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--rule); }
.mini-steps span.done { background: var(--ok); }
.mini-steps span.skipped { background: var(--rule-strong); }
.mini-steps span.current { background: var(--accent); }
.comment { padding: .875rem 1.125rem; border-bottom: 1px solid var(--rule); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .8125rem; color: var(--ink-3); margin-bottom: .25rem; }
.comment-head strong { color: var(--ink); font-size: .875rem; }
.comment-body { white-space: pre-line; font-size: .9rem; }
.event-diff { font-size: .8125rem; margin-top: .25rem; color: var(--ink-2); }
.event-diff del { color: var(--bad); text-decoration: line-through; }
.event-diff ins { color: var(--ok); text-decoration: none; }
.print-only { display: none; }
@media (max-width: 1020px) { .reg-grid { grid-template-columns: 1fr; } .reg-side { position: static; } }
@media print { .tabs, .no-print, .reg-side .btn { display: none !important; } .print-only { display: block; } }
.readout-jobs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.readout-jobs a:nth-child(4n) { border-right: 0; }
.readout-jobs a:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }
.readout .tone-bad .val { color: var(--bad); }
.readout .tone-info .val { color: var(--accent); }
@media (max-width: 860px) { .readout-jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .readout-jobs a:nth-child(odd) { border-right: 1px solid var(--rule); } }

/* ---------- Phase 3: technical records, calibration, reports, developer tools ---------- */
.action-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.record { padding: 1rem 1.25rem; border-top: 1px solid var(--rule); }
.record:first-of-type { border-top: 0; }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.record-meta { color: var(--ink-3); font-size: .8125rem; margin-left: auto; }
.record-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: .75rem; }
.record-actions form { margin: 0; }
.inline-form > summary { list-style: none; display: inline-flex; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] { flex-basis: 100%; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .75rem; }
.inline-form[open] > summary { margin-bottom: .75rem; }
.add-record { padding: 1rem 1.25rem; border-top: 1px solid var(--rule); }
.add-record > summary { list-style: none; display: inline-flex; }
.add-record > summary::-webkit-details-marker { display: none; }
.add-record[open] > summary { margin-bottom: 1rem; }
.record-form { max-width: 920px; }
.data.compact th, .data.compact td { padding: .375rem .5rem; font-size: .875rem; }
.rows-editor input { min-width: 70px; padding: .375rem .5rem; }
.rows-editor td:last-child { width: 1%; }
.label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .375rem; }
.label.req::after { content: ' *'; color: var(--bad); }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.sig-pad { position: relative; border: 1px dashed var(--rule); border-radius: var(--radius-m); background: #fff; touch-action: none; }
.sig-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 56 / 18; cursor: crosshair; }
.sig-pad::before { content: 'Sign here'; position: absolute; left: .75rem; bottom: .5rem; font-size: .75rem; color: #9aa6ae; pointer-events: none; }
.sig-pad.signed::before { content: ''; }
.sig-pad [data-sig-clear] { position: absolute; top: .25rem; right: .25rem; }
.mono, .mono-table td, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mono-table td { font-size: .8125rem; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.mono-table td.changed { background: rgba(214, 160, 0, .18); font-weight: 600; }
textarea.mono { font-size: .875rem; }
.code-block { margin: 0; padding: .75rem 1rem; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-m); font: .8125rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow: auto; }
.log-view { border: 0; border-radius: 0; max-height: 70vh; }
.stack-sm > * + * { margin-top: .875rem; }
.dev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: -.25rem 0 1.25rem; padding: .5rem .75rem; border: 1px solid #c58a00; background: rgba(214, 160, 0, .1); border-radius: var(--radius-m); }
.dev-badge { display: inline-flex; align-items: center; gap: .375rem; font-weight: 600; font-size: .8125rem; color: #8a5a00; }
.dev-badge svg { width: 16px; height: 16px; }
.dev-nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.dev-nav a { padding: .375rem .625rem; border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none; font-size: .875rem; }
.dev-nav a[aria-current="page"], .dev-nav a:hover { background: var(--surface); color: var(--ink); }
.dev-bar form { margin: 0; }
[data-theme="dark"] .sig-pad { background: #fff; }
@media (max-width: 720px) { .record { padding: .875rem; } .record-meta { margin-left: 0; flex-basis: 100%; } .rows-editor { min-width: 560px; } }

/* ---------------------------------------------------------------- Phase 4: finance, costs, inventory */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; }
form.inline { display: inline-flex; margin: 0; }
.strike td { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.strike td .pill, .strike td .tag-id { text-decoration: none; }
.text-warn { color: var(--warn); }
.record.superseded { opacity: .6; }
.record.superseded .record-head { margin-bottom: 0; }
.mini-h { font-size: .8125rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 1.25rem 0 .5rem; }
.subnav { margin-top: -.5rem; }
.static-value { padding: .55rem 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.num, td.right, th.right, .money-facts dd, .readout .val { font-variant-numeric: tabular-nums; }
input.num { text-align: right; }
.fin-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .625rem; }
.fin-checklist li { display: flex; gap: .75rem; align-items: flex-start; }
.fin-checklist .mark { width: 1.375rem; height: 1.375rem; border-radius: 50%; border: 2px solid var(--rule-strong); flex: none; display: grid; place-items: center; margin-top: .1rem; }
.fin-checklist li.done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.fin-checklist .mark svg { width: .85rem; height: .85rem; }
.fin-checklist .sub { color: var(--ink-3); font-size: .8125rem; }
.quote-lines input { min-width: 0; }
.quote-totals { display: grid; grid-template-columns: max-content 9rem; gap: .25rem 1rem; justify-content: end; margin: .75rem 0 0; font-variant-numeric: tabular-nums; }
.quote-totals dt { color: var(--ink-3); text-align: right; }
.quote-totals dd { margin: 0; text-align: right; }
dl.inline-facts { grid-template-columns: repeat(4, max-content max-content); gap: .25rem .875rem; margin: .25rem 0 .5rem; }
.cost-readout { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cost-readout > div, .fin-readout > div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.cost-readout > div:last-child { border-right: 0; }
.cost-readout .val { font-size: 1.375rem; }
.readout .tone-bad .val { color: var(--bad); }
.fin-readout { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fin-readout .val { font-size: 1.5rem; }
.inline-filters { border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 1.25rem; }
.filters-sum { margin-left: auto !important; text-align: right; display: flex; flex-direction: column; min-width: 0 !important; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .375rem; }
.legend i { width: .75rem; height: .75rem; border-radius: 3px; display: inline-block; }
.bars { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .25rem; height: 220px; align-items: end; padding-top: 1.75rem; border-bottom: 1px solid var(--rule-strong); }
.bar-group { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; outline: none; cursor: default; border-radius: 4px; }
.bar-group:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.bar-stack { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar-stack span { width: 28%; max-width: 12px; min-height: 0; border-radius: 4px 4px 0 0; transition: opacity .15s; }
.bar-group.dim .bar-stack span { opacity: .35; }
.bar-label { font-size: .6875rem; color: var(--ink-3); text-align: center; padding-top: .375rem; white-space: nowrap; position: relative; top: 1.5rem; margin-top: -1.25rem; }
.bars { margin-bottom: 1.75rem; }
.bar-tip { position: absolute; z-index: 5; background: var(--ink); color: var(--paper); font-size: .75rem; padding: .375rem .5rem; border-radius: var(--radius-s); max-width: 280px; pointer-events: none; box-shadow: var(--shadow); }
.hbar { display: grid; grid-template-columns: 8.5rem 1fr 7rem; gap: .625rem; align-items: center; font-size: .8125rem; margin-bottom: .5rem; }
.hbar-label { color: var(--ink-2); }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--series-1); border-radius: 5px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .cost-readout, .fin-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-readout > div, .fin-readout > div, .fin-readout > a { border-bottom: 1px solid var(--rule); }
  dl.inline-facts { grid-template-columns: max-content 1fr; }
  .bar-label { font-size: .5625rem; }
  .hbar { grid-template-columns: 6.5rem 1fr 5.5rem; }
}

/* ---------------------------------------------------------------- Phase 5: tasks & maintenance */
.text-bad { color: var(--bad); }
.tabs .count-bad { color: #fff; background: var(--bad); border-radius: 999px; padding: 0 .4rem; }
.nav-count.neutral { background: rgba(255, 255, 255, .14); color: var(--side-ink-strong); }
.small-id { font-size: .6875rem; padding: 0 .3rem; }
.group-row td { background: var(--surface-2); font-size: .8125rem; padding-top: .5rem; padding-bottom: .5rem; }
.task-table td:last-child form + form { margin-left: .25rem; }
.plain-list { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; display: grid; gap: .625rem; font-size: .9rem; }
.plain-list .sub { color: var(--ink-3); font-size: .8125rem; }
.day-picks { display: flex; flex-wrap: wrap; gap: .25rem .875rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.field legend { font-size: .875rem; font-weight: 500; margin-bottom: .375rem; padding: 0; }
.task-mini { list-style: none; margin: 0; padding: .25rem 0; }
.task-mini li { display: flex; gap: .75rem; align-items: flex-start; padding: .625rem 1.25rem; border-top: 1px solid var(--rule); }
.task-mini li:first-child { border-top: 0; }
.task-mini li.overdue { box-shadow: inset 3px 0 0 var(--bad); }
.task-mini .sub { color: var(--ink-3); font-size: .8125rem; margin-top: .125rem; }
.task-mini .tick { width: 1.375rem; height: 1.375rem; border-radius: 50%; border: 2px solid var(--rule-strong); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: .1rem; flex: none; }
.task-mini .tick svg { width: .8rem; height: .8rem; }
.task-mini .tick:hover, .task-mini .tick:focus-visible { border-color: var(--ok); color: var(--ok); }
a.alert { text-decoration: none; color: inherit; }
.timeline.compact li { padding-top: .25rem; padding-bottom: .25rem; }
td.center, th.center { text-align: center; }
.alert > svg, .alert > .icon { width: 1.125rem; height: 1.125rem; flex: none; margin-top: .1rem; }
.readout > div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.readout > div:last-child { border-right: 0; }

/* ---------------------------------------------------------------- Databases */
.db-banner { display: flex; align-items: center; gap: .5rem; padding: .5rem 1.5rem; background: var(--info); color: #fff; font-size: .875rem; }
.db-banner.test { background: repeating-linear-gradient(-45deg, #b45309, #b45309 14px, #a14a07 14px, #a14a07 28px); }
.db-banner svg { width: 1.1rem; height: 1.1rem; flex: none; }
.db-banner a { color: #fff; margin-left: auto; font-weight: 600; }
.db-card { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .875rem 1rem; display: grid; gap: .375rem; }
.db-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.db-list { display: grid; gap: .75rem; padding: 1rem 1.25rem; }
.danger-zone { border-color: var(--bad); }
.danger-zone .panel-head h2 { color: var(--bad); }
.text-ok { color: var(--ok); }
.db-card .small svg { width: 1rem; height: 1rem; vertical-align: -3px; }

/* Phase 6: analytics charts and report builder */
.chart-wrap { position: relative; }
.chart-wrap .legend { margin-bottom: .5rem; }
.svg-chart { width: 100%; height: auto; display: block; overflow: visible; }
.svg-chart .gl { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.svg-chart .base { stroke: var(--ink-3); stroke-width: 1; }
.svg-chart .ax { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
.svg-chart .cg { outline: none; cursor: default; }
.svg-chart a .cg { cursor: pointer; }
.svg-chart .cg:focus-visible rect { stroke: var(--focus); stroke-width: 2; }
.svg-chart.has-hover .cg:not(.on) path, .svg-chart.has-hover .cg:not(.on) circle[r="4"] { opacity: .4; }
.chart-tip { position: absolute; z-index: 5; background: var(--ink); color: var(--paper); font-size: .75rem; padding: .375rem .5rem; border-radius: var(--radius-s); max-width: 300px; pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: .125rem; }
.hb-row { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 4.5rem; gap: .625rem; align-items: center; font-size: .8125rem; padding: .3125rem .375rem; border-radius: var(--radius-s); color: inherit; text-decoration: none; }
a.hb-row:hover { background: var(--surface-2); text-decoration: none; }
.hb-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hb-track span { display: block; height: 100%; border-radius: 5px; }
.hb-val { text-align: right; font-variant-numeric: tabular-nums; }
.an-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.an-kpis > a, .an-kpis > div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.an-kpis > :last-child { border-right: 0; }
.an-kpis .lbl .sub { color: var(--ink-3); }
.rb-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .25rem .75rem; }
.rb-cols label { display: flex; gap: .375rem; align-items: center; font-size: .875rem; font-weight: 400; }
.rb-filter { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }
.rb-filter .field { margin: 0; }
.rb-desc { font-size: .875rem; color: var(--ink-2); background: var(--surface-2); padding: .5rem .75rem; border-radius: var(--radius-s); }
table.data tr.total-row td { font-weight: 600; border-top: 2px solid var(--rule); background: var(--surface-2); }
.export-btns { display: flex; gap: .375rem; flex-wrap: wrap; }
@media (max-width: 720px) { .rb-filter { grid-template-columns: 1fr 1fr; } .hb-row { grid-template-columns: minmax(0, 8rem) 1fr 3.5rem; } .an-kpis > a, .an-kpis > div { border-right: 0; border-bottom: 1px solid var(--rule); } }
@media print { .chart-tip { display: none !important; } }

/* Phase 8: knowledge base / help content */
.md { line-height: 1.6; font-size: .95rem; }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 4.5rem; }
.md h3 { font-size: 1.05rem; margin: 1.25rem 0 .375rem; scroll-margin-top: 4.5rem; }
.md h4, .md h5 { font-size: .95rem; margin: 1rem 0 .25rem; }
.md p { margin: .5rem 0; }
.md .md-list { margin: .5rem 0; padding-left: 1.5rem; }
.md .md-list li { margin: .25rem 0; }
.md ol.md-list > li::marker { font-weight: 600; color: var(--accent); }
.md .md-check { list-style: none; margin-left: -1.25rem; display: flex; gap: .5rem; align-items: baseline; }
.md .md-check .box { width: .9rem; height: .9rem; border: 1.5px solid var(--ink-3); border-radius: 3px; flex: none; transform: translateY(.1rem); }
.md .md-check.done .box { background: var(--ok); border-color: var(--ok); }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.md .md-code { background: var(--surface-2); padding: .75rem 1rem; border-radius: var(--radius-s); overflow-x: auto; font-size: .85rem; }
.md .md-code code { background: none; padding: 0; }
.md .md-callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: .625rem .875rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: .75rem 0; }
.md .md-callout.warn { border-left-color: var(--warn); background: var(--warn-soft, color-mix(in srgb, var(--warn) 12%, transparent)); }
.md .md-callout.warn::before { content: "⚠ "; font-weight: 700; color: var(--warn); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 1.25rem 0; }
.md .md-table { margin: .5rem 0; }
.md-toc { background: var(--surface-2); border-radius: var(--radius-s); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .875rem; }
.md-toc ol { margin: .375rem 0 0; padding-left: 1.25rem; }
.md-toc .lv3 { margin-left: 1rem; list-style: circle; }
.kb-editor { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .875rem; line-height: 1.5; min-height: 28rem; resize: vertical; }
.kb-preview { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 1rem; min-height: 28rem; background: var(--surface); }
.kb-tabs { margin-bottom: .5rem; }
.kb-diff { margin: 0; padding: .75rem 1rem; font-size: .8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto; }
.kb-diff span { display: block; }
.kb-diff .add, .diff-legend.add { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.kb-diff .del, .diff-legend.del { background: color-mix(in srgb, var(--bad) 14%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.diff-legend { padding: 0 .375rem; border-radius: 3px; }
.kb-related li { display: flex; flex-direction: column; }
.help-nav a[aria-current] { font-weight: 600; color: var(--ink); }
.kb-in-aside { border: 0; border-top: 1px solid var(--rule); border-radius: 0; box-shadow: none; }
.help-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
@media (max-width: 860px) { .help-grid { grid-template-columns: 1fr; } }
.form.kb-form { max-width: none; }

/* 1.1: password eye */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.75rem; width: 100%; }
.pw-eye { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-3); width: 2.25rem; height: 2.25rem; border-radius: var(--radius-s); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye.on { color: var(--accent); }
.pw-eye svg { width: 18px; height: 18px; }

/* 1.1: compact, collapsible menu */
.brand-mark { background: #fff; padding: 3px; }
.nav { padding: .25rem .75rem 1rem; }
.nav-group { margin-top: .25rem; }
.nav-main { margin-top: 0; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: .375rem; }
.nav-heading { all: unset; box-sizing: border-box; display: flex; align-items: center; width: 100%; padding: .5rem .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--side-ink); opacity: .8; cursor: pointer; border-radius: var(--radius-s); }
.nav-heading:hover { opacity: 1; background: rgba(255,255,255,.04); }
.nav-heading:focus-visible { outline: 2px solid var(--focus); }
.nav-caret { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav-heading[aria-expanded="true"] .nav-caret { transform: rotate(45deg); }
.nav-items[hidden] { display: none; }
.nav a { min-height: 36px; }
.nav a > span:not(.nav-count) { flex: 1; }

/* 1.1: sign-in page */
.guest-art { justify-content: flex-start; gap: 2.5rem; padding: 2.5rem 3rem; background: linear-gradient(160deg, #0f2733 0%, #12384a 55%, #0e5a6a 100%); }
.ga-logo { background: #fff; border-radius: 14px; padding: .875rem 1.25rem; align-self: flex-start; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ga-logo img { height: 52px; display: block; }
.ga-body { position: relative; z-index: 1; max-width: 34rem; }
.ga-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: #7fd3de; margin: 0 0 .5rem; }
.guest-art h2 { font-size: 2.125rem; max-width: 20ch; color: #fff; font-weight: 600; margin: 0; }
.ga-sub { color: rgba(255,255,255,.78); font-size: 1rem; line-height: 1.55; max-width: 44ch; margin: .75rem 0 0; }
.ga-photo { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-top: 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ga-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .875rem; }
.ga-points li { display: flex; gap: .875rem; align-items: flex-start; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: .875rem 1rem; }
.ga-points strong { display: block; color: #fff; font-size: .9375rem; margin-bottom: .125rem; }
.ga-points span { color: rgba(255,255,255,.75); font-size: .875rem; line-height: 1.45; }
.ga-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: rgba(63,182,198,.18); color: #7fd3de; display: grid; place-items: center; }
.ga-ico svg { width: 20px; height: 20px; }
.ga-watermark { position: absolute; right: -60px; bottom: -60px; width: 340px; opacity: .06; filter: grayscale(1) brightness(3); pointer-events: none; }
.guest-mobile-logo { display: none; }
@media (max-width: 860px) { .guest-mobile-logo { display: block; height: 44px; margin-bottom: 1.5rem; } }

/* 1.1: dashboard */
.team-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.team-card { display: grid; grid-template-columns: 40px 1fr; column-gap: .75rem; row-gap: .125rem; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m);
  padding: .875rem 1rem; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.team-card:hover { border-color: var(--accent); text-decoration: none; }
.team-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.tc-avatar { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .875rem; }
.tc-avatar svg { width: 20px; height: 20px; }
.tc-name { font-weight: 600; font-size: .9375rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-role { font-size: .75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-line { grid-column: 1 / -1; font-size: .8125rem; margin-top: .25rem; }
.tc-progress { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: .5rem; }
.tc-progress span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.dash-grid { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.work-table td { vertical-align: middle; }
.wf-step { display: block; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.wf-bar { display: block; width: 100%; max-width: 9rem; height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: .3rem; overflow: hidden; }
.wf-bar span { display: block; height: 100%; background: var(--accent); }
.inline-edit { display: flex; gap: .25rem; align-items: center; min-width: 12rem; }
.inline-edit input { flex: 1; min-width: 0; min-height: 30px; padding: .25rem .5rem; font-size: .8125rem; border: 1px solid transparent; background: transparent; border-radius: var(--radius-s); }
.inline-edit input:hover, .inline-edit input:focus { border-color: var(--rule); background: var(--surface); }
.inline-edit .btn { visibility: hidden; }
.inline-edit:focus-within .btn { visibility: visible; }
.compact-tl li { padding-top: .5rem; padding-bottom: .5rem; }
.dash-foot { margin-top: 1.25rem; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } .inline-edit .btn { visibility: visible; } }
.sig-preview { background: #fff; border: 1px dashed var(--rule); border-radius: var(--radius-s); padding: .5rem; margin-bottom: .75rem; text-align: center; } .sig-preview img { max-height: 70px; max-width: 100%; }
.dash-grid .task-mini li { padding: .4375rem 1.25rem; align-items: center; }
.dash-grid .task-mini .sub { display: inline; margin-left: .375rem; }
.dash-grid .task-mini li > div { line-height: 1.5; }
.recent-users { margin-bottom: 1.25rem; }
.ru-list { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .375rem; }
.ru-chip { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .375rem .75rem; font: inherit; font-size: .8125rem; cursor: pointer; }
.ru-chip:hover, .ru-chip.on { border-color: var(--accent); background: var(--accent-soft); }

/* 1.1: registration form */
.combo-list li { flex-direction: row; align-items: baseline; gap: .5rem; padding: .375rem .625rem; }
.combo-list .cl-name { font-weight: 500; font-size: .875rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-list .cl-meta { color: var(--ink-3); font-size: .75rem; white-space: nowrap; }
.combo input[type=search] { min-height: 36px; }
.inst-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .375rem; }
.inst-option { padding: .5rem .75rem; gap: .5rem; font-size: .875rem; }
.inst-option .sub { font-size: .75rem; }
.inst-option .pill { font-size: .6875rem; }
.alert.special { background: #fff1e0; border-color: #f0b46a; color: #6b3a00; font-weight: 500; }
[data-theme="dark"] .alert.special { background: #3a2610; color: #ffd9a8; border-color: #8a5a20; }
.more-fields { margin-top: .5rem; }
.more-fields > summary { cursor: pointer; font-size: .875rem; color: var(--accent); padding: .25rem 0; }
.more-fields[open] > summary { margin-bottom: .5rem; }
.units-table input, .units-table select { min-height: 32px; padding: .25rem .4rem; font-size: .8125rem; width: 100%; min-width: 5.5rem; }
.recv-box { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
.recv-box legend { font-weight: 600; font-size: .875rem; padding: 0 .375rem; }
.seg { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .75rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: .375rem .75rem; font-size: .8125rem; background: var(--surface); cursor: pointer; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); }
.fault-row { align-items: end; }
.reg-actions { display: grid; gap: .5rem; }
.reg-actions .btn { width: 100%; justify-content: center; }
.sig-pad canvas { max-width: 100%; }
.unit-list { margin: 0; padding-left: 1rem; } .unit-list li { margin: .125rem 0; }
.dc-upload { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.dc-upload .field { margin: 0; }
.inst-items td:first-child { width: 2rem; text-align: center; }
.inst-items input[type=checkbox] { width: 18px; height: 18px; min-width: 0; accent-color: var(--accent); }
.inst-items tr:has(input[type=checkbox]:not(:checked)) td:not(:first-child) { opacity: .5; }

/* 1.1: status boards */
.board-head { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.board-head h1 { margin: 0; font-size: 1.5rem; }
.board-head p { margin: .125rem 0 0; }
.board-search { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 0 .875rem; }
.board-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.board-search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.board-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 40px; width: 100%; outline: none; }
.board-actions { display: flex; gap: .375rem; flex-wrap: wrap; justify-content: flex-end; }
.board-settings { margin-bottom: .75rem; font-size: .875rem; }
.board-settings > summary { cursor: pointer; color: var(--ink-3); display: inline-flex; align-items: center; gap: .375rem; }
.board-settings > summary svg { width: 15px; height: 15px; }
.board-settings-form { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem; margin-top: .5rem; display: grid; gap: .75rem; max-width: 760px; }
.board-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.board th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; padding: .5rem .5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; z-index: 1; }
.board td { padding: .3125rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.board tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.board tr.dragging { opacity: .45; }
.board tr.row-overdue td:nth-child(2) { box-shadow: inset 3px 0 0 var(--bad); }
.board .b-job { font-weight: 700; font-variant-numeric: tabular-nums; }
.board .b-date, .board .b-days, .board .b-job { white-space: nowrap; }
.board .b-company { min-width: 12rem; }
.board .b-instrument { min-width: 11rem; }
.board .b-fault { min-width: 9rem; }
.board .b-remarks { min-width: 11rem; }
.board .b-grip { width: 2.25rem; white-space: nowrap; color: var(--ink-3); }
.board .grip { cursor: grab; display: inline-grid; place-items: center; }
.board .grip svg { width: 16px; height: 16px; }
.board .mv { display: none; }
.board tr:focus-within .mv, .board tr:hover .mv { display: inline-flex; flex-direction: column; vertical-align: middle; }
.board .mv button { border: 0; background: none; font-size: .5625rem; line-height: 1; padding: 1px 3px; cursor: pointer; color: var(--ink-3); }
.board .b-edit { font: inherit; font-size: .8125rem; border: 1px solid transparent; background: transparent; border-radius: var(--radius-s); padding: .25rem .375rem; min-height: 30px; width: 100%; color: inherit; }
.board .b-edit:hover, .board .b-edit:focus { border-color: var(--rule); background: var(--surface); }
.board select.b-edit { min-width: 8rem; cursor: pointer; }
.board .b-edit.saving { opacity: .6; }
.board .b-edit.saved { border-color: var(--ok); }
.board .pri-urgent .b-pri { color: var(--bad); font-weight: 700; }
.board .pri-high .b-pri { color: var(--warn); font-weight: 600; }
.board .b-missing { color: var(--ink-3); }
.board .b-add { white-space: nowrap; }
.board-toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: 999px; font-size: .875rem; z-index: 60; box-shadow: var(--shadow); }
.board-toast.bad { background: var(--bad); color: #fff; }
.fin-dialog { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.25rem; width: min(560px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.fin-dialog::backdrop { background: rgba(10, 20, 26, .45); }
.fd-head { display: flex; justify-content: space-between; align-items: center; }
.fd-head h2 { margin: 0; font-size: 1.125rem; }
.fd-form { display: grid; gap: .75rem; }
@media (max-width: 960px) { .board-head { grid-template-columns: 1fr; } .board-actions { justify-content: flex-start; } }
.board { font-size: .78rem; }
.board td { padding: .25rem .375rem; }
.board .b-company { min-width: 9rem; max-width: 15rem; }
.board .b-instrument { min-width: 8rem; max-width: 13rem; }
.board .b-fault { min-width: 7rem; max-width: 12rem; }
.board select.b-edit { min-width: 6.5rem; max-width: 10rem; font-size: .78rem; padding-right: 1.25rem; }
.board .b-remarks { min-width: 10rem; }
.board .b-priority select { min-width: 5.5rem; }
.compact-filters { padding: .75rem 0 0; border: 0; gap: .5rem .75rem; }
.compact-filters .field { min-width: 0; }
.compact-filters select, .compact-filters input { min-height: 32px; font-size: .8125rem; }
.all-jobs td { padding-top: .4rem; padding-bottom: .4rem; }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { text-decoration: underline; }
.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; font-size: .875rem; }
@media (max-width: 720px) { .board.stack-mobile thead { display: none; } .board.stack-mobile tr { display: block; border-bottom: 1px solid var(--rule); padding: .5rem 0; } .board.stack-mobile td { display: flex; gap: .5rem; border: 0; } .board.stack-mobile td::before { content: attr(data-label); min-width: 6rem; color: var(--ink-3); font-size: .75rem; } }
.fin-check { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .25rem; }
.fin-check li { display: flex; gap: .5rem; align-items: baseline; font-size: .8125rem; }
.fin-check .fc-mark { width: 1rem; color: var(--ink-3); }
.fin-check li.done .fc-mark { color: var(--ok); font-weight: 700; }
/* report form */
.report-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.report-fields .field:has(textarea) { grid-column: 1 / -1; }
.report-fields .internal-field textarea { background: #fff8e6; border-color: #e8c66a; }
@media (max-width: 700px) { .report-fields { grid-template-columns: 1fr; } }
.std-points { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.std-points span { font-size: .72rem; background: var(--surface-2, #eef3f5); border-radius: 4px; padding: 1px 6px; color: var(--muted, #556); }
/* petty cash */
.cash-people { list-style: none; margin: 0; padding: 0; }
.cash-people li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem 1rem; border-top: 1px solid var(--border, #e3e8ec); }
.cash-people li:first-child { border-top: 0; }
.cash-people li a:first-child { color: inherit; text-decoration: none; }
.cash-people li .sub { display: block; }
.cash-people li.late { background: color-mix(in srgb, #d64545 7%, transparent); }
.cash-people .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.warn-t { color: #b7791f; } .info-t { color: #2b6cb0; }
.steps-list { margin: 0 0 .5rem 1.1rem; padding: 0; } .steps-list li { margin-bottom: .35rem; }
.claim-lines input { min-width: 0; }
.claim-lines td.amt-cell { width: 120px; }
.claim-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-top: .75rem; }
.claim-sum div { background: var(--surface-2, #f3f6f8); border-radius: 8px; padding: .5rem .75rem; }
.claim-sum .v { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.claim-sum .l { font-size: .75rem; color: var(--muted, #667); }
.readout > div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.readout > div:last-child { border-right: 0; }
.readout .tone-bad .val { color: var(--bad, #c53030); }
.cash-people li { border-top-color: var(--rule); }
.warn-t { color: var(--warn); }
.claim-sum .l { color: var(--ink-3); }
.fuel-box { border: 1px dashed var(--rule-strong); border-radius: 8px; padding: .5rem .9rem .75rem; margin: 0 0 1rem; }
.fuel-box legend { font-size: .8rem; color: var(--ink-3); padding: 0 .3rem; }
.field .static { padding: .55rem 0; font-size: .9rem; }
.big-num { font-size: 1.8rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
/* analytics 1.1 */
.prog { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; min-width: 70px; }
.prog span { display: block; height: 100%; background: var(--ok); }
.tabs-inline { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tabs-inline .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mbar { height: 6px; margin: 2px 0; } .mbar span { display: block; height: 100%; border-radius: 3px; }
.mbar .e, .mkey.e { background: var(--accent); } .mbar .c, .mkey.c { background: var(--warn); }
.mkey { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 .25rem 0 .5rem; }
@media (max-width: 700px) { .hide-mobile { display: none; } }
/* finance status 1.1.1 */
.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.chip { font-size: .78rem; padding: .2rem .6rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2, inherit); text-decoration: none; background: var(--surface); }
.chip .n { font-weight: 700; margin-left: .2rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fin-sum { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); margin: 0 0 .8rem; overflow: hidden; }
.fin-sum > div { padding: .55rem .9rem; border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-width: 110px; }
.fin-sum > div:last-child { border-right: 0; }
.fin-sum .v { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.fin-sum .l { font-size: .72rem; color: var(--ink-3); }
.fin-sum .warn .v { color: var(--warn); }
.fin-sum .acts { flex: 1; min-width: 220px; } .fin-sum .acts .pill { margin: .15rem .15rem 0 0; }

/* ---------- 1.2 fonts: self-hosted (SIL OFL 1.1; Roboto Apache 2.0). Chosen in Settings / My profile. ---------- */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/nunito-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/nunito-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root[data-font="inter"] { --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="source-sans"] { --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="nunito-sans"] { --font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="noto-sans"] { --font: "Noto Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="roboto"] { --font: "Roboto", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="plex"] { --font: "Plex", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="system"] { --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
:root { --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
/* calmer headings */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 1.45rem; line-height: 1.3; }
h2 { font-size: 1.02rem; line-height: 1.35; }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; }
.nav-heading { letter-spacing: .04em; }
.mini-h { letter-spacing: .03em; }
.data th, .board th { font-weight: 600; }

/* ---------- 1.2 sidebar modes, content width, density ---------- */
.topbar .menu-btn { display: inline-flex; }
:root[data-width="full"] .content { max-width: none; }
:root[data-width="wide"] .content { max-width: 1600px; }
@media (min-width: 861px) {
  :root[data-sidebar="collapsed"] .shell, :root[data-sidebar="autohide"] .shell { grid-template-columns: 64px minmax(0, 1fr); }
  :root[data-sidebar="hidden"] .shell { grid-template-columns: minmax(0, 1fr); }
  :root[data-sidebar="collapsed"] .side, :root[data-sidebar="autohide"] .side { width: 64px; overflow-x: hidden; z-index: 40; transition: width .15s ease, box-shadow .15s ease; }
  :root[data-sidebar="collapsed"] .side .brand > span:not(.brand-mark), :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .brand > span:not(.brand-mark),
  :root[data-sidebar="collapsed"] .nav a > span, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav a > span,
  :root[data-sidebar="collapsed"] .side-foot, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .side-foot { display: none; }
  :root[data-sidebar="collapsed"] .nav-heading, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav-heading { font-size: 0; padding: 0; height: 1px; margin: .5rem .5rem; background: rgba(255,255,255,.12); pointer-events: none; }
  :root[data-sidebar="collapsed"] .nav-items[hidden], :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav-items[hidden] { display: block; }
  :root[data-sidebar="collapsed"] .nav, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav { padding: .5rem .5rem 1rem; }
  :root[data-sidebar="collapsed"] .nav a, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav a { justify-content: center; padding: .55rem 0; }
  :root[data-sidebar="collapsed"] .nav-group, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav-group { margin-top: .25rem; }
  :root[data-sidebar="collapsed"] .brand, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .brand { padding: 1rem 0; justify-content: center; }
  :root[data-sidebar="autohide"] .side:hover, :root[data-sidebar="autohide"] .side:focus-within { width: 248px; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
  :root[data-sidebar="hidden"] .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  :root[data-sidebar="hidden"] .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar { overflow: hidden; }
.dd-mode .btn.on { background: var(--accent-soft); color: var(--accent); }
.dd-mode { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .4rem .75rem; border-top: 1px solid var(--rule); } .dd-mode span { flex: 1 0 100%; }
:root[data-density="compact"] .data td, :root[data-density="compact"] .data th { padding-top: .3rem; padding-bottom: .3rem; }
:root[data-density="compact"] .panel-body { padding: .75rem 1rem; }
:root[data-density="compact"] .content { padding-top: 1.1rem; }
.avatar-panel { display: flex; gap: 1rem; align-items: flex-start; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; overflow: hidden; flex: none; }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
/* 1.2 engineer cards — compact */
.team-strip { display: grid; margin-bottom: 1rem; }
.team-strip .team-card { grid-template-columns: 30px minmax(0, 1fr); column-gap: .55rem; row-gap: 0; padding: .5rem .65rem; }
.team-strip .tc-avatar { width: 30px; height: 30px; font-size: .72rem; overflow: hidden; grid-row: span 2; }
.team-strip .tc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-strip .tc-avatar svg { width: 16px; height: 16px; }
.team-strip .tc-name { font-size: .84rem; font-weight: 600; }
.team-strip .tc-counts { font-size: .76rem; color: var(--ink-2); white-space: nowrap; }
.team-strip .tc-line { font-size: .7rem; margin-top: .2rem; color: var(--ink-3); }
.team-strip .tc-progress { height: 3px; margin-top: .35rem; }
.team-strip.ts-normal .team-card { grid-template-columns: 38px minmax(0, 1fr); padding: .7rem .85rem; }
.team-strip.ts-normal .tc-avatar { width: 38px; height: 38px; font-size: .85rem; }
.team-strip.ts-normal .tc-name { font-size: .92rem; }
.team-strip.ts-normal .tc-counts { font-size: .82rem; }
.team-card.none .tc-avatar { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 700px) { .team-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* 1.2 dashboard layout */
.dash-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.dash-side { min-width: 0; }
.dash-side .panel-head h2 { font-size: .92rem; }
.dash-side .plain-list li { padding: .45rem 1rem; font-size: .85rem; }
.dash-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; align-items: start; }
.dash-lower:empty { display: none; }
@media (max-width: 1100px) { .dash-main { grid-template-columns: 1fr; } }
.readout-slim .val { font-size: 1.35rem; }
.readout-slim a { padding: .6rem .9rem; }
.readout-slim { margin-bottom: 1rem; }
.panel-tools { display: flex; align-items: center; gap: .6rem; }
.cols-form { padding: .75rem; min-width: 280px; }
.cols-form .rb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; margin: .5rem 0 .75rem; font-size: .82rem; }
.cols-form .rb-cols label, .seg-mini label { display: flex; gap: .35rem; align-items: center; }
.seg-mini { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; }
.dash-jobs td { vertical-align: middle; }
.dash-jobs .c-customer { min-width: 10rem; } .dash-jobs .c-instrument { min-width: 8rem; }
.dash-jobs .c-next { min-width: 12rem; }
.dash-jobs .ie { font: inherit; font-size: .8rem; padding: .2rem .35rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; max-width: 11rem; }
.dash-jobs .ie:hover, .dash-jobs .ie:focus { border-color: var(--rule-strong); background: var(--surface); }
.dash-jobs .ie-text { width: 100%; max-width: none; }
.dash-jobs .ie-date { max-width: 9.5rem; } .dash-jobs .ie-date.late { color: var(--bad); }
.dash-jobs .ie.saving { opacity: .55; } .dash-jobs .ie.saved { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.ie-toast { position: sticky; bottom: .5rem; margin: .5rem 1rem; padding: .45rem .75rem; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: .82rem; width: max-content; max-width: 90%; }
.ie-toast.bad { background: var(--bad); color: #fff; }
.task-cols { columns: 2 320px; column-gap: 1.5rem; }
.task-cols li { break-inside: avoid; }
.w-figs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid var(--rule); }
.w-figs div { padding: .45rem .75rem; } .w-figs dt { font-size: .7rem; color: var(--ink-3); } .w-figs dd { margin: 0; font-weight: 700; }
.w-money { display: flex; flex-direction: column; gap: .15rem; font-size: .82rem; padding: .6rem 1rem; }
.customize-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.customize-hidden { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2rem; min-width: 12rem; padding: .25rem; border: 1px dashed var(--rule-strong); border-radius: 8px; flex: 1; }
.w-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: .15rem .55rem; cursor: grab; }
.w-chip svg, .w-grip svg { width: 14px; height: 14px; }
.w-grip { cursor: grab; color: var(--ink-3); margin-right: .25rem; display: inline-flex; }
.customizing ~ .dash-lower, .customizing .dash-side { min-height: 4rem; outline: 2px dashed var(--rule-strong); outline-offset: 6px; border-radius: 6px; }
.widget.dragging, .w-chip.dragging { opacity: .5; }
.dd-right { right: 0; left: auto; }
.settings-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.5rem 0 1rem; }
.settings-nav a { font-size: .82rem; padding: .25rem .7rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; background: var(--surface); }
.num-in { width: 4.5rem; }
.cols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .3rem .75rem; font-size: .85rem; }
.font-samples { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .5rem; font-size: 1rem; }
[data-font-sample="inter"] { font-family: "Inter"; } [data-font-sample="source-sans"] { font-family: "Source Sans 3"; } [data-font-sample="nunito-sans"] { font-family: "Nunito Sans"; }
[data-font-sample="noto-sans"] { font-family: "Noto Sans"; } [data-font-sample="roboto"] { font-family: "Roboto"; } [data-font-sample="plex"] { font-family: "Plex"; }
.dash-jobs select.ie { max-width: 8.5rem; padding-right: 1.1rem; }
.dash-jobs .c-customer { min-width: 8rem; } .dash-jobs .c-instrument { min-width: 7rem; } .dash-jobs .c-next { min-width: 10rem; }
.dash-jobs .c-workflow .wf-step { max-width: 10rem; }
@media (min-width: 861px) {
  /* collapsed menu: each group is a small clickable divider with a caret that opens its icons */
  :root[data-sidebar="collapsed"] .nav-heading, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav-heading {
    font-size: 0; height: 16px; padding: 0; margin: .35rem .4rem; background: none; pointer-events: auto; cursor: pointer; justify-content: center; border-top: 1px solid rgba(255,255,255,.12); border-radius: 0; }
  :root[data-sidebar="collapsed"] .nav-heading .nav-caret, :root[data-sidebar="autohide"] .side:not(:hover):not(:focus-within) .nav-heading .nav-caret { margin: 0 auto; width: 5px; height: 5px; }
}
/* 1.2 registration: compact instrument picker, customer jobs */
.inst-existing { border: 1px solid var(--rule); border-radius: var(--radius-m); margin-bottom: .6rem; overflow: hidden; }
.inst-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .5rem .75rem; background: var(--surface-2); }
.inst-tools input[type=search] { max-width: 18rem; flex: 1; padding: .3rem .55rem; font-size: .85rem; }
.inst-scroll { max-height: 260px; overflow-y: auto; }
.inst-table td, .inst-table th { padding: .3rem .55rem; font-size: .84rem; }
.inst-table tbody tr { cursor: pointer; }
.inst-table tbody tr:hover { background: var(--surface-2); }
.inst-table tbody tr:has(input:checked) { background: var(--accent-soft); }
.inst-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.inst-new-choice { display: flex; gap: .55rem; align-items: center; padding: .5rem .75rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius-m); cursor: pointer; font-size: .9rem; }
.inst-new-choice svg { width: 15px; height: 15px; vertical-align: -2px; }
.inst-new-choice:has(input:checked) { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.cust-jobs { margin-top: .75rem; border: 1px solid var(--rule); border-radius: var(--radius-m); }
.cust-jobs > summary { padding: .5rem .75rem; cursor: pointer; font-weight: 600; font-size: .9rem; }
.cust-jobs .btn { margin: .5rem .75rem; }
#widgets select { min-width: 9.5rem; }
.b-sel { width: 28px; } @media (max-width: 720px) { td.b-sel { display: none !important; } }
.panel-tools a svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.inline-new { display: inline-flex; gap: .35rem; align-items: center; } .inline-new input { padding: .4rem .5rem; }
.reports-grid { grid-template-columns: minmax(0, 1fr) 280px; }
@media (max-width: 1100px) { .reports-grid { grid-template-columns: 1fr; } }
.panel > form.compact-filters { padding: .75rem 1rem; }
/* 1.2 Phase 3: quick finance entry */
.qf { margin-bottom: 1rem; }
.qf-table th[scope=row] { width: 9.5rem; vertical-align: top; padding-top: .55rem; font-weight: 600; font-size: .85rem; color: var(--ink-2, inherit); white-space: nowrap; }
.qf-table td { vertical-align: top; }
.qf-item { display: inline-block; margin: 0 .3rem .3rem 0; vertical-align: top; }
.qf-item > summary { list-style: none; cursor: pointer; }
.qf-item > summary::-webkit-details-marker { display: none; }
.qf-item[open] { display: block; }
.qf-chip { display: inline-block; padding: .2rem .55rem; border: 1px solid var(--rule); border-radius: 999px; font-size: .82rem; background: var(--surface-2); line-height: 1.5; margin: 0 .3rem .3rem 0; }
.qf-item > summary .qf-chip { margin: 0; }
.qf-item > summary .qf-chip:hover { border-color: var(--accent); }
.qf-chip.ok { background: var(--ok-soft); border-color: transparent; }
.qf-chip.warn { background: var(--warn-soft); border-color: transparent; }
.qf-chip.off, .qf-item.gone .qf-chip { opacity: .6; text-decoration: line-through; }
.qf-pop { margin: .4rem 0 .6rem; padding: .65rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); max-width: 760px; }
.qf-form { max-width: none; }
.qf-form .field { margin-bottom: .5rem; }
.qf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem .75rem; align-items: end; }
.qf-form .form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: .25rem; }
.qf-remove { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--rule); }
.qf-add { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
@media (max-width: 700px) { .qf-table th[scope=row] { width: auto; display: block; padding-bottom: 0; } .qf-table td { display: block; } .qf-table tr { display: block; border-bottom: 1px solid var(--rule); } }
.fin-top { margin-bottom: 1.25rem; }
/* 1.2 Phase 3: job lookup, expense kinds */
.job-pick { position: relative; }
.jp-list { position: absolute; z-index: 30; left: 0; right: 0; top: 4.2rem; margin: 0; padding: .25rem 0; list-style: none; background: var(--surface); border: 1px solid var(--rule-strong, var(--rule)); border-radius: var(--radius-m); box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.jp-list li { padding: .4rem .7rem; cursor: pointer; font-size: .88rem; }
.jp-list li .sub { display: block; }
.jp-list li.on, .jp-list li[data-i]:hover { background: var(--accent-soft); }
.jp-card { margin-top: .5rem; padding: .55rem .75rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius-m); background: var(--surface-2); font-size: .86rem; }
.jp-card dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; margin: .35rem 0 0; }
.jp-card dt { color: var(--muted, #667); } .jp-card dd { margin: 0; }
.exp-for, .exp-kind { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .5rem .9rem .25rem; margin: 0 0 1rem; }
.exp-for legend, .exp-kind legend { font-weight: 600; font-size: .85rem; padding: 0 .35rem; }
.exp-for .seg { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: .5rem; }
/* 1.2 Phase 4: stock documents */
.stock-lines input { width: 100%; }
.stock-total { text-align: right; margin: .5rem 0 1rem; font-size: 1.05rem; }
.loc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip.warn { background: var(--warn-soft); border-color: transparent; }
/* 1.2 Phase 5: competency matrix, job competency note */
.matrix th[scope=row] { white-space: nowrap; font-weight: 600; }
.matrix .center { text-align: center; }
.mx-cell { display: inline-block; margin: 1px; padding: .05rem .4rem; border-radius: 4px; font-size: .78rem; font-weight: 600; background: var(--surface-2); }
.mx-cell.lv1 { background: var(--warn-soft); } .mx-cell.lv2 { background: var(--ok-soft); } .mx-cell.lv3 { background: var(--accent-soft); }
.mx-cell.expired { outline: 2px solid var(--bad, #b42318); }
.comp-note { display: flex; gap: .4rem; align-items: center; font-size: .85rem; margin-top: .35rem; }

/* 1.2 Phase 6: accent colour themes (company default or personal choice). Contrast of button text ≥ 4.5:1 in both modes. */
:root[data-accent="blue"] { --accent: #1F5FA8; --accent-ink: #FFFFFF; --accent-soft: #E4EEF8; --focus: #1F5FA8; }
@media (prefers-color-scheme: dark) { :root[data-accent="blue"]:not([data-theme="light"]) { --accent: #6AA8E8; --accent-ink: #06182A; --accent-soft: #102A44; --focus: #6AA8E8; } }
:root[data-theme="dark"][data-accent="blue"] { --accent: #6AA8E8; --accent-ink: #06182A; --accent-soft: #102A44; --focus: #6AA8E8; }
:root[data-accent="green"] { --accent: #1E7A46; --accent-ink: #FFFFFF; --accent-soft: #E3F2E9; --focus: #1E7A46; }
@media (prefers-color-scheme: dark) { :root[data-accent="green"]:not([data-theme="light"]) { --accent: #5CC48A; --accent-ink: #072414; --accent-soft: #12301F; --focus: #5CC48A; } }
:root[data-theme="dark"][data-accent="green"] { --accent: #5CC48A; --accent-ink: #072414; --accent-soft: #12301F; --focus: #5CC48A; }
:root[data-accent="purple"] { --accent: #6B3FA0; --accent-ink: #FFFFFF; --accent-soft: #EFE8F8; --focus: #6B3FA0; }
@media (prefers-color-scheme: dark) { :root[data-accent="purple"]:not([data-theme="light"]) { --accent: #B49AE0; --accent-ink: #1B0F2E; --accent-soft: #2A1E3D; --focus: #B49AE0; } }
:root[data-theme="dark"][data-accent="purple"] { --accent: #B49AE0; --accent-ink: #1B0F2E; --accent-soft: #2A1E3D; --focus: #B49AE0; }
:root[data-accent="maroon"] { --accent: #9B2C3A; --accent-ink: #FFFFFF; --accent-soft: #F8E6E9; --focus: #9B2C3A; }
@media (prefers-color-scheme: dark) { :root[data-accent="maroon"]:not([data-theme="light"]) { --accent: #E58A96; --accent-ink: #2A0A10; --accent-soft: #3A1820; --focus: #E58A96; } }
:root[data-theme="dark"][data-accent="maroon"] { --accent: #E58A96; --accent-ink: #2A0A10; --accent-soft: #3A1820; --focus: #E58A96; }
:root[data-accent="slate"] { --accent: #3D5466; --accent-ink: #FFFFFF; --accent-soft: #E7ECF0; --focus: #3D5466; }
@media (prefers-color-scheme: dark) { :root[data-accent="slate"]:not([data-theme="light"]) { --accent: #9DB4C6; --accent-ink: #0E1A22; --accent-soft: #1E2A33; --focus: #9DB4C6; } }
:root[data-theme="dark"][data-accent="slate"] { --accent: #9DB4C6; --accent-ink: #0E1A22; --accent-soft: #1E2A33; --focus: #9DB4C6; }
.accent-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.accent-swatches label { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; font-size: .875rem; }
.accent-swatches label:has(input:checked) { border-color: var(--ink-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.accent-swatches i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
/* 1.2 Phase 6: job status colours, board (Kanban), status settings */
.st-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--st) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st) 55%, transparent); }
select.b-edit[data-field=status] { border-left: 4px solid var(--st, transparent); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.kb-col { background: var(--surface-2); border: 1px solid var(--rule); border-top: 4px solid var(--st); border-radius: var(--radius-m); min-height: 140px; display: flex; flex-direction: column; }
.kb-col header { display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; position: sticky; top: 0; }
.kb-col h2 { font-size: .9rem; margin: 0; flex: 1; }
.kb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st); flex: none; }
.kb-n { font-size: .75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 0 .45rem; }
.kb-cards { display: flex; flex-direction: column; gap: .5rem; padding: 0 .5rem .6rem; min-height: 60px; flex: 1; }
.kb-card { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--st); border-radius: var(--radius-m); padding: .5rem .6rem; font-size: .85rem; cursor: grab; }
.kb-card.dragging { opacity: .5; }
.kb-card.late { box-shadow: inset 0 0 0 1px var(--warn); }
.kb-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.kb-cust { margin-top: .2rem; font-weight: 500; }
.kb-meta { display: flex; justify-content: space-between; margin-top: .3rem; }
.kb-move select { width: 100%; margin-top: .4rem; padding: .2rem .35rem; font-size: .8rem; }
.kb-col.kb-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kb-col.kb-no { opacity: .45; }
.status-table input[type=text] { min-width: 12rem; }
.status-table input[type=color] { width: 42px; height: 28px; padding: 0; border: 1px solid var(--rule); vertical-align: middle; }
.st-next summary { cursor: pointer; max-width: 22rem; }
.st-next-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .2rem .75rem; padding: .4rem 0; max-width: 34rem; }
.seg-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.seg-options .check { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .6rem .7rem; }
.seg-options .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
/* 1.2 Phase 6: sign-in slideshow, settings hub */
.ga-slides { position: relative; margin-top: 1.5rem; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); aspect-ratio: 16 / 9; max-height: 260px; background: rgba(255,255,255,.06); }
.ga-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s ease; }
.ga-slide.on { opacity: 1; }
.ga-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ga-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .9rem .7rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: .85rem; }
.ga-slide figcaption strong { display: block; font-size: 1rem; }
.ga-dots { position: absolute; top: .6rem; right: .6rem; display: flex; gap: .35rem; }
.ga-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; }
.ga-dots button[aria-current="true"] { background: #fff; }
@media (prefers-reduced-motion: reduce) { .ga-slide { transition: none; } }
.slide-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.slide-row { display: grid; grid-template-columns: 96px 1fr auto; gap: .6rem; align-items: center; }
.slide-row img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); }
.slide-row input { width: 100%; margin-bottom: .25rem; padding: .3rem .5rem; }
.slide-act { display: flex; gap: .25rem; }
.settings-hub { margin: -.5rem 0 1.25rem; }
.settings-hub > summary { cursor: pointer; font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; }
.settings-hub > summary svg { width: 16px; height: 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; margin-top: .75rem; }
.hub-card { display: flex; gap: .65rem; padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); text-decoration: none; }
.hub-card:hover { border-color: var(--accent); }
.hub-card strong { display: block; }
.hub-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.hub-ico svg { width: 17px; height: 17px; }
.changelog-grid { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1100px) { .changelog-grid { grid-template-columns: 1fr; } }
.cl-sec { border-top: 1px solid var(--rule); padding: .2rem 1rem; }
.cl-sec > summary { cursor: pointer; list-style: none; }
.cl-sec > summary h2 { display: inline; font-size: 1rem; }
.cl-sec > summary::before { content: "▸ "; color: var(--ink-3); }
.cl-sec[open] > summary::before { content: "▾ "; }
.cl-body { font-size: .9rem; padding-bottom: .6rem; }
.status-table .b-grip { width: 56px; white-space: nowrap; }
.status-table .grip { cursor: grab; color: var(--ink-3); display: inline-flex; vertical-align: middle; }
.status-table .grip svg { width: 14px; height: 14px; }
.status-table .mv { display: inline-flex; gap: 2px; vertical-align: middle; }
.status-table .mv button { border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); font-size: .6rem; line-height: 1; padding: 2px 4px; border-radius: 3px; cursor: pointer; }
.changelog-grid aside td.small { word-break: break-all; }

/* 1.2 Phase 7 — comments: mentions, replies, inbox */
.mention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 .1875rem; font-weight: 500; }
.comment:target { background: var(--accent-soft); }
.comment-quote { display: block; border-left: 3px solid var(--rule); padding: .25rem .625rem; margin: .25rem 0 .375rem; font-size: .8125rem; color: var(--ink-3); text-decoration: none; overflow-wrap: anywhere; }
.comment-quote span { display: block; font-weight: 500; color: var(--ink-2); }
.comment-quote:hover { border-left-color: var(--accent); }
.comment-body { overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.comment-head .link-btn { margin-left: auto; }
.reply-note { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; background: var(--surface-2); border-radius: 6px; padding: .5rem .625rem; margin-bottom: .75rem; font-size: .8125rem; }
.reply-note[hidden] { display: none; }
.mention-field { position: relative; }
.mention-list { position: absolute; left: 0; right: 0; z-index: 30; list-style: none; margin: .25rem 0 0; padding: .25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; }
.mention-list[hidden] { display: none; }
.mention-list li { padding: .4375rem .625rem; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: .75rem; font-size: .875rem; }
.mention-list li small { color: var(--ink-3); }
.mention-list li[aria-selected="true"], .mention-list li:hover { background: var(--accent-soft); }
.inbox-row { display: grid; gap: .1875rem; padding: .75rem 1.125rem; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-row.new { border-left: 3px solid var(--accent); padding-left: calc(1.125rem - 3px); }
.inbox-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .8125rem; color: var(--ink-3); }
.inbox-meta strong { color: var(--ink); font-size: .875rem; }
.inbox-text { font-size: .9rem; overflow-wrap: anywhere; }
.inbox-time { font-size: .75rem; color: var(--ink-3); }
.filters input[type=search] { min-width: 0; flex: 1 1 200px; }

/* 1.3 Job tracking */
.track-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); gap: .75rem; margin-bottom: 1.25rem; }
.ts-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius, 10px); padding: .75rem 1rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ts-k { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.ts-v { font-size: .95rem; overflow-wrap: anywhere; }
.ts-s { font-size: .75rem; color: var(--ink-3); overflow-wrap: anywhere; }
@media (max-width: 1020px) { .track-status { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ts-card.wide { grid-column: 1 / -1; } }
@media (max-width: 600px) { .track-status { grid-template-columns: 1fr; } }
.stepper { list-style: none; margin: 0; padding: .75rem 1.125rem 1rem; }
.stepper li { display: grid; grid-template-columns: 22px 1fr; gap: .75rem; position: relative; padding-bottom: .875rem; }
.stepper li:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--rule); }
.stepper li.st-done:not(:last-child)::before { background: var(--ok); }
.st-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.st-dot svg { width: 13px; height: 13px; stroke-width: 3; }
.st-done .st-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.st-current .st-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.st-na .st-dot { border-style: dashed; }
.st-na strong, .st-todo strong { color: var(--ink-3); font-weight: 500; }
.st-tag { font-size: .6875rem; color: var(--ink-3); margin-left: .375rem; }
.st-current .st-tag { color: var(--accent); font-weight: 600; }
.link-list { list-style: none; margin: 0; padding: .5rem 1.125rem 1rem; }
.link-list li { padding: .375rem 0; border-bottom: 1px solid var(--rule); }
.link-list li:last-child { border-bottom: 0; }
.link-list li > a { display: inline-flex; gap: .5rem; align-items: center; font-weight: 500; }
.link-list svg { width: 16px; height: 16px; }
.link-list .sub-link { padding-left: 1.5rem; }
.history { list-style: none; margin: 0; padding: .5rem 1.125rem 1rem; }
.history li { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-size: .875rem; }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--ink-3); font-size: .8125rem; }
@media (max-width: 600px) { .history li { grid-template-columns: 1fr; gap: .125rem; } }
.col-picker { display: flex; flex-wrap: wrap; gap: .375rem 1rem; padding: .75rem 1.125rem; }
.col-picker label { display: inline-flex; gap: .375rem; align-items: center; font-size: .8125rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (max-width: 440px) { .topbar .clock { display: none; } }

/* 1.3 Technical cases */
.code-chip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; font-weight: 600; background: var(--ink); color: var(--surface); border-radius: 5px; padding: .0625rem .4375rem; vertical-align: .05em; }
.code-chip.big { font-size: 1.125rem; padding: .125rem .5rem; }
.case-warn { display: flex; gap: .5rem; align-items: flex-start; margin: 0; padding: .75rem 1.125rem; }
.case-warn svg { width: 16px; height: 16px; flex: none; margin-top: .125rem; color: var(--warn); }
.case-list { display: grid; gap: .75rem; }
.case-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius, 10px); padding: .875rem 1.125rem; display: grid; gap: .5rem; }
.case-card.unverified { border-left: 3px solid var(--warn); }
.case-card header { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: baseline; }
.case-title { font-weight: 600; font-size: 1rem; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.case-title:hover { color: var(--accent); }
.case-meta { display: inline-flex; gap: .375rem; align-items: center; }
.case-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; font-size: .875rem; }
.case-grid .k { display: block; font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; margin-bottom: .125rem; }
.case-grid > div { overflow-wrap: anywhere; }
@media (max-width: 1020px) { .case-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .case-grid { grid-template-columns: 1fr; } }
.case-card footer .why { color: var(--accent); }
.case-steps { margin: 0; padding: .5rem 1.125rem .5rem 2.5rem; display: grid; gap: .5rem; font-size: .875rem; }
dd.pre { white-space: pre-line; overflow-wrap: anywhere; }
.case-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; padding: 1rem 1.125rem; }
.case-file { display: grid; gap: .25rem; text-decoration: none; color: inherit; }
.case-file img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); }
.case-file .file-ico { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--surface-2); border-radius: 6px; }
.row-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .5rem; }
.dyn-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: end; }
.dyn-row.parts { grid-template-columns: 2fr 1fr 80px 1.5fr auto; }
.dyn-row .field { margin: 0; }
@media (max-width: 700px) { .dyn-row, .dyn-row.parts { grid-template-columns: 1fr; border-bottom: 1px solid var(--rule); padding-bottom: .5rem; } }

/* 1.3 menu options: text-only entries, top menu bar (desktop) */
:root[data-labels="text"] .nav a > svg, :root[data-labels="text"] .topnav a.tn-link > svg, :root[data-labels="text"] .topnav .tn-panel a > svg { display: none; }
:root[data-labels="icons"] .topnav .tn-link > span:first-of-type { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.topnav { display: none; }
@media (min-width: 861px) {
  :root[data-menu="top"][data-sidebar] .shell { grid-template-columns: minmax(0, 1fr); }
  :root[data-menu="top"] .side, :root[data-menu="top"] .topbar .menu-btn { display: none; }
  :root[data-menu="top"] .topnav { display: flex; flex-wrap: wrap; gap: .125rem .25rem; align-items: center; padding: .375rem 2rem; background: var(--surface); border-bottom: 1px solid var(--rule); position: relative; z-index: 30; }
  .topnav .tn-link { display: inline-flex; align-items: center; gap: .375rem; padding: .4375rem .625rem; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: .875rem; font-weight: 500; cursor: pointer; list-style: none; }
  .topnav .tn-link::-webkit-details-marker { display: none; }
  .topnav .tn-link:hover { background: var(--surface-2); color: var(--ink); }
  .topnav .tn-link[aria-current="page"], .topnav .tn-link.active { background: var(--accent-soft); color: var(--accent); }
  .topnav svg { width: 16px; height: 16px; }
  .topnav .tn-group summary svg { width: 14px; height: 14px; }
  .topnav .tn-panel { min-width: 240px; }
  .topnav .tn-panel a { display: flex; gap: .5rem; align-items: center; }
  .topnav .tn-panel a[aria-current="page"] { color: var(--accent); font-weight: 600; }
}

/* 1.3 job registration: numbered sections with a section list */
.reg-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.reg-nav { position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius, 10px); padding: .875rem; display: grid; gap: .75rem; }
.reg-nav-id { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.reg-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; }
.reg-nav a { display: flex; gap: .5rem; align-items: center; padding: .375rem .5rem; border-radius: 6px; font-size: .8125rem; color: var(--ink-2); text-decoration: none; }
.reg-nav a:hover { background: var(--surface-2); }
.reg-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.reg-nav a.has-error { color: var(--bad); }
.reg-nav a.has-error .sec-n { background: var(--bad); color: #fff; border-color: var(--bad); }
.sec-n { display: inline-flex; align-items: center; justify-content: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; border: 1px solid var(--rule-strong); font-size: .6875rem; font-weight: 600; margin-right: .5rem; flex: none; color: var(--ink-2); background: var(--surface); }
.reg-nav a .sec-n { margin-right: 0; }
.reg-nav a.on .sec-n { border-color: var(--accent); color: var(--accent); }
.reg-sec { scroll-margin-top: 1rem; }
.reg-sec .panel-head h2 { display: flex; align-items: center; }
.req-mark { color: var(--bad); }
.reg-actions-bar { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius, 10px); padding: .75rem 1rem; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
@media (max-width: 1020px) {
  .reg-layout { grid-template-columns: 1fr; }
  .reg-nav { position: sticky; top: 0; z-index: 25; padding: .5rem; border-radius: 0 0 8px 8px; }
  .reg-nav-id, .reg-nav > p { display: none; }
  .reg-nav ol { display: flex; overflow-x: auto; gap: .25rem; scrollbar-width: thin; }
  .reg-nav a { white-space: nowrap; }
  .reg-sec { scroll-margin-top: 4rem; }
}
.reg-actions.reg-actions-bar .btn { width: auto; min-width: 12rem; }
@media (max-width: 600px) { .reg-actions.reg-actions-bar .btn { width: 100%; } }

/* 1.3 dashboard: full-width job table; right-hand panels below it */
.dash-main.wide { grid-template-columns: minmax(0, 1fr); }
.dash-main.wide .dash-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; align-items: start; }
.dash-main.wide .dash-side:empty { display: none; }
.w-figs.w-figs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w-figs.w-figs-3 dd { font-size: .95rem; overflow-wrap: anywhere; }
.customize-bar { flex-wrap: wrap; align-items: center; }
@media (min-width: 861px) {
  .topnav .tn-link { white-space: nowrap; padding: .4375rem .5rem; }
  .topnav .nav-count { margin-left: .125rem; }
  .topnav .nav-count.neutral { background: var(--surface-2); color: var(--ink-2); }
}
/* 1.3: every icon has a sensible size even where no component rule sizes it (zero specificity, so component rules win) */
:where(svg[viewBox="0 0 24 24"][stroke-width="1.75"]) { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* 1.3 Import Center */
.imp-readout > div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.imp-readout > div:last-child { border-right: 0; }
.readout .tone-bad .val { color: var(--bad); }
.readout .tone-info .val { color: var(--accent); }
.mig-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 1rem 1.125rem .5rem; }
.mig-steps li { display: flex; align-items: center; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.imp-grid .panel { margin: 0; }
.imp-card .panel-head h2 { display: flex; align-items: center; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: .5rem; }
.bar-track span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.msg-error { color: var(--bad); }
.msg-warning { color: var(--warn); }
.msg-info { color: var(--ink-3); }
.map-table select { min-width: 14rem; }
.preview-table td, .preview-table th { white-space: nowrap; font-size: .8125rem; }

/* ===== 1.3.2 navigation: five categories on an icon rail + the chosen category's pages ===== */
.shell { grid-template-columns: 296px minmax(0, 1fr); }
.side { overflow: visible; }
.side .brand { flex: none; }
.nav2 { flex: 1; min-height: 0; display: grid; grid-template-columns: 80px minmax(0, 1fr); border-top: 1px solid rgba(255,255,255,.06); }
.rail { display: flex; flex-direction: column; gap: .25rem; padding: .625rem .375rem; background: rgba(0,0,0,.14); overflow-y: auto; }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3125rem; width: 100%; padding: .625rem .25rem .5625rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--side-ink); cursor: pointer; font: inherit; text-align: center; transition: background .15s ease, color .15s ease; }
.rail-btn svg { width: 24px; height: 24px; stroke-width: 1.6; }
.rail-label { font-size: .6875rem; font-weight: 500; line-height: 1.2; letter-spacing: .01em; overflow-wrap: anywhere; }
.rail-btn:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.rail-btn.on { background: var(--side-hover); color: var(--side-ink-strong); }
.rail-btn.on::before { content: ""; position: absolute; left: -.375rem; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-btn.has-page:not(.on)::after { content: ""; position: absolute; top: 8px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rail-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rail-dot { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .625rem; font-weight: 700; line-height: 18px; }
.cat-panels { padding: .75rem .625rem 1rem; overflow-y: auto; min-width: 0; }
.cat-title { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--side-ink); opacity: .8; padding: .25rem .625rem .625rem; }
.cat-panel a { display: flex; align-items: center; gap: .625rem; padding: .5rem .625rem; border-radius: 7px; color: var(--side-ink); text-decoration: none; font-size: .875rem; line-height: 1.3; position: relative; }
.cat-panel a span:not(.nav-count) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cat-panel a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.cat-panel a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.cat-panel a[aria-current="page"] { background: var(--accent); color: #fff; font-weight: 500; }
.cat-panel a[aria-current="page"] .nav-count.neutral { background: rgba(255,255,255,.25); }
.cat-panel[hidden] { display: none; }
:root[data-labels="text"] .cat-panel a > svg { display: none; }
.gear-btn.active { color: var(--accent); background: var(--accent-soft); }
.gear-panel { min-width: 250px; max-height: 75vh; overflow-y: auto; }
.gear-panel a[aria-current="page"] { color: var(--accent); font-weight: 600; }
@media (min-width: 861px) {
  :root[data-sidebar="collapsed"] .shell, :root[data-sidebar="autohide"] .shell { grid-template-columns: 80px minmax(0, 1fr); }
  :root[data-sidebar="collapsed"] .side, :root[data-sidebar="autohide"] .side { width: 80px; overflow: visible; z-index: 45; }
  :root[data-sidebar="collapsed"] .nav2, :root[data-sidebar="autohide"] .nav2 { grid-template-columns: 80px; position: relative; }
  :root[data-sidebar="collapsed"] .cat-panels, :root[data-sidebar="autohide"] .cat-panels { display: none; position: absolute; left: 80px; top: 0; bottom: 0; width: 240px; background: var(--side); box-shadow: 10px 0 30px rgba(0,0,0,.28); z-index: 46; }
  :root[data-sidebar="collapsed"] .side.flyout .cat-panels, :root[data-sidebar="autohide"] .side.flyout .cat-panels, :root[data-sidebar="autohide"] .side:hover .cat-panels { display: block; }
  :root[data-sidebar="collapsed"] .side .brand, :root[data-sidebar="autohide"] .side .brand { padding: 1rem 0; justify-content: center; }
  :root[data-sidebar="collapsed"] .side .brand > span:not(.brand-mark), :root[data-sidebar="autohide"] .side .brand > span:not(.brand-mark),
  :root[data-sidebar="collapsed"] .side-foot, :root[data-sidebar="autohide"] .side-foot { display: none; }
  :root[data-sidebar="autohide"] .side:hover, :root[data-sidebar="autohide"] .side:focus-within { width: 80px; }
  :root[data-labels="icons"] .rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  :root[data-sidebar="hidden"] .side { width: 296px; }
}
@media (max-width: 860px) {
  .side { width: min(320px, 88vw); }
  .nav2 { grid-template-columns: 80px minmax(0, 1fr); }
}

/* ===== 1.3.2 open-jobs tables: readable without shrinking — wrap text, size drop-downs to their content ===== */
.board.board-service { font-size: .8125rem; }
.board.board-service td { padding: .4375rem .5rem; vertical-align: top; line-height: 1.35; }
.board.board-service td.b-job, .board.board-service td.b-date, .board.board-service td.b-days, .board.board-service td.b-actions, .board.board-service td.b-tag { white-space: nowrap; }
.board.board-service .b-company { min-width: 10rem; max-width: 18rem; }
.board.board-service .b-instrument { min-width: 9rem; max-width: 16rem; }
.board.board-service .b-fault { min-width: 8rem; max-width: 16rem; }
.board.board-service td { overflow-wrap: break-word; }
.board.board-service select.b-edit { width: auto; min-width: 7.5rem; max-width: 16rem; field-sizing: content; font-size: .8125rem; padding-right: 1.5rem; }
.board.board-service .b-priority select.b-edit { min-width: 6.5rem; }
.board.board-service .b-remarks { min-width: 13rem; }
.board.board-service textarea.b-edit { display: block; width: 100%; min-height: 30px; resize: none; field-sizing: content; overflow: hidden; line-height: 1.35; font: inherit; }
.row-actions { display: inline-flex; gap: .125rem; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--ink-3); text-decoration: none; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
@media (max-width: 860px) {
  .board.board-service thead { display: none; }
  .board.board-service, .board.board-service tbody, .board.board-service tr, .board.board-service td { display: block; width: 100%; }
  .board.board-service tr { padding: .625rem .75rem; border-bottom: 1px solid var(--rule); }
  .board.board-service td { border: 0; padding: .1875rem 0; max-width: none !important; min-width: 0 !important; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; align-items: center; white-space: normal !important; }
  .board.board-service td::before { content: attr(data-label); color: var(--ink-3); font-size: .75rem; }
  .board.board-service td.b-grip { display: none; }
  .board.board-service td.b-job { font-size: .9375rem; }
  .board.board-service select.b-edit { max-width: 100%; }
  .board.board-service tr.row-overdue td:nth-child(2) { box-shadow: none; }
  .board.board-service tr.row-overdue { box-shadow: inset 3px 0 0 var(--bad); }
}

/* ===== 1.3.2 top bar: everything fits from tablet to wide desktop (no page overflow) ===== */
.topbar { min-width: 0; }
.topbar > * { flex-shrink: 0; }
.topbar .top-search { flex: 0 1 260px; min-width: 120px; }
.topbar .top-search input { width: 100%; }
@media (max-width: 1280px) and (min-width: 861px) {
  .topbar .clock .clock-date { display: none; }
  .topbar .btn .label { display: none; }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .topbar .clock { display: none; }
  .topbar { gap: .375rem; padding-left: 1rem; padding-right: 1rem; }
}

/* ===== 1.3.2 dashboard: two columns — wide work area (≈65 %) and a side column (≈35 %) ===== */
.dash-main { grid-template-columns: minmax(0, 65fr) minmax(300px, 35fr); }
.dash-primary { min-width: 0; }
.dash-primary .dash-lower { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.dash-primary .dash-lower .widget[data-widget="recent_jobs"], .dash-primary .dash-lower .widget[data-widget="activity"] { grid-column: 1 / -1; }
.dash-primary .dash-lower .widget[data-widget="recent_jobs"] .timeline, .dash-primary .dash-lower .widget[data-widget="activity"] .timeline { columns: 2 300px; column-gap: 2rem; }
.dash-primary .dash-lower .timeline li { break-inside: avoid; }
.dash-side .dash-tasks .task-mini li { padding: .5rem 1rem; }
.dash-side .dash-tasks .task-mini .sub { font-size: .75rem; }
.dash-side [data-zone="right"]:empty { display: none; }
.dash-main.wide .dash-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dash-main.wide .dash-side [data-zone="right"] { display: contents; }
.customizing [data-zone] { min-height: 4rem; outline: 2px dashed var(--rule-strong); outline-offset: 6px; border-radius: 6px; }
@media (max-width: 1100px) { .dash-main { grid-template-columns: minmax(0, 1fr); } }

/* Dashboard open-jobs table: no clipped drop-downs or dates; long text wraps */
.dash-jobs { font-size: .8125rem; }
.dash-jobs td { vertical-align: top; overflow-wrap: break-word; }
.dash-jobs .c-job, .dash-jobs .c-date, .dash-jobs .c-due, .dash-jobs .c-tag, .dash-jobs .c-priority { white-space: nowrap; }
.dash-jobs .ie { max-width: none; }
.dash-jobs select.ie { min-width: 10.5rem; field-sizing: content; }
.dash-jobs .ie-date { width: 9.75rem; max-width: none; }
.dash-jobs .c-assigned { min-width: 9rem; }
.dash-jobs .c-workflow { min-width: 9rem; }
@media (max-width: 860px) {
  .dash-jobs td { white-space: normal !important; }
  .dash-jobs select.ie, .dash-jobs .ie-date { width: 100%; }
}
.dash-primary .dash-lower { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.dash-main .compact-tl li { grid-template-columns: 3rem minmax(0, 1fr); gap: .625rem; }
.dash-side .compact-tl li { padding-left: 1rem; padding-right: 1rem; font-size: .8125rem; }
@media (max-width: 860px) { .shell, :root[data-sidebar] .shell { grid-template-columns: minmax(0, 1fr); } }
.tpl-buttons { display: grid; gap: .375rem; margin: .5rem 0 .625rem; }
.tpl-buttons .btn { justify-content: flex-start; width: 100%; white-space: normal; text-align: left; }
.imp-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
@media (max-width: 600px) { .imp-grid { grid-template-columns: 1fr; } }

/* 1.3 Phase 3.3 — Prepare for production */
.pp-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:.5rem 1.25rem;margin:.5rem 0}
.pp-groups .check{align-items:flex-start}
