:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #16202b;
  --ink-2: #5a6878;
  --line: #dde3ea;
  --brand: #2b2c2f;
  --brand-red: #c4161c;
  --brand-red-on-dark: #e8434a;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --gold: #f5b642;
  --good: #1a7f4b;
  --good-bg: #e3f4ea;
  --warn: #9a6400;
  --warn-bg: #fff3d6;
  --crit: #b42318;
  --crit-bg: #fde8e6;
  --info: #155eaa;
  --info-bg: #e5effb;
  --muted-bg: #eef1f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f141a; --panel: #171e26; --ink: #e6ebf1; --ink-2: #9aa7b5; --line: #2a3441; --brand: #202124;
    --accent: #4c8dff; --good: #4cc38a; --good-bg: #133526; --warn: #f0b94d; --warn-bg: #3a2c0c; --crit: #ff7b6e; --crit-bg: #3d1614;
    --info: #7fb2ff; --info-bg: #13263f; --muted-bg: #222b36; color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f141a; --panel: #171e26; --ink: #e6ebf1; --ink-2: #9aa7b5; --line: #2a3441; --brand: #202124;
  --accent: #4c8dff; --good: #4cc38a; --good-bg: #133526; --warn: #f0b94d; --warn-bg: #3a2c0c; --crit: #ff7b6e; --crit-bg: #3d1614;
  --info: #7fb2ff; --info-bg: #13263f; --muted-bg: #222b36; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }
h4 { font-size: 0.9rem; margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input:disabled, select:disabled, textarea:disabled { background: var(--muted-bg); color: var(--ink); opacity: 1; }
input[type='checkbox'] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); flex: none; }
.loading { padding: 40px; text-align: center; color: var(--ink-2); }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 16px; background: var(--brand); color: #fff; padding: 0 16px; min-height: 54px; }
.brand { color: #fff; font-weight: 800; letter-spacing: 0.04em; font-size: 1.15rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { height: 34px; width: auto; display: block; }
.brand span { color: #fff; font-weight: 700; letter-spacing: 0.08em; border-left: 1px solid rgba(255,255,255,0.35); padding-left: 8px; }
.login-logo { display: block; width: min(260px, 70%); height: auto; margin: 0 0 8px; }
.login-title { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-2); margin: 0 0 12px; }
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .only-dark { display: block !important; } :root:not([data-theme='light']) .only-light { display: none !important; } }
:root[data-theme='dark'] .only-dark { display: block !important; }
:root[data-theme='dark'] .only-light { display: none !important; }
.brand .dot { position: absolute; top: -4px; right: -20px; background: var(--crit); color: #fff; font-size: 0.7rem; border-radius: 10px; padding: 0 6px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex: 1; margin-left: 12px; }
.nav a { color: #cdd7e3; padding: 16px 10px; border-bottom: 3px solid transparent; }
.nav a.on, .nav a:hover { color: #fff; text-decoration: none; border-bottom-color: var(--brand-red-on-dark); }
.me { display: flex; align-items: center; gap: 8px; }
.me-name { color: #fff; font-size: 0.9rem; white-space: nowrap; }
.switch { width: auto; min-height: 32px; padding: 4px 8px; background: #3a3b3f; color: #fff; border-color: #55565b; }
.menu { display: none; color: #fff; }
@media (max-width: 860px) {
  .menu { display: inline-flex; }
  .nav { display: none; position: absolute; top: 54px; left: 0; right: 0; flex-direction: column; background: var(--brand); margin: 0; padding-bottom: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav a.on { border-left-color: var(--brand-red-on-dark); }
  .me-name { display: none; }
  .switch { max-width: 140px; }
}
.banner { padding: 6px 16px; font-size: 0.85rem; text-align: center; }
.banner.demo { background: var(--info-bg); color: var(--info); }
.banner.practice { background: var(--crit-bg); color: var(--crit); font-weight: 600; }
.practice-strip { border: 2px solid #b3261e; color: #b3261e; font-weight: 700; text-align: center; padding: 4px; margin: 0 0 12px; letter-spacing: .05em; }
.practice-mark { position: fixed; top: 45%; left: 0; right: 0; text-align: center; transform: rotate(-30deg); font-size: 44px; font-weight: 800; color: rgba(179, 38, 30, .16); pointer-events: none; z-index: 5; white-space: nowrap; }
.banner.paper { background: var(--warn-bg); color: var(--warn); }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.linklike.danger { color: var(--crit); }

/* layout */
.main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.page.narrow { max-width: 760px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.page-head .sub { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.light { font-weight: 400; color: var(--ink-2); }
.crumbs { font-size: 0.85rem; color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.left { justify-content: flex-start; margin-top: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.foot { text-align: center; color: var(--ink-2); font-size: 0.75rem; padding: 24px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.fine { font-size: 0.78rem; color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-2); padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--crit); }
.btn.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 0.85rem; }
.btn.big { min-height: 48px; padding: 10px 22px; font-size: 1.05rem; }
.btn.block { width: 100%; justify-content: flex-start; margin-bottom: 6px; white-space: normal; text-align: left; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 6px; color: var(--ink-2); }
.icon-btn:hover { background: var(--muted-bg); }

/* pills */
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warning { background: var(--warn-bg); color: var(--warn); }
.pill.critical { background: var(--crit-bg); color: var(--crit); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.muted { opacity: 0.7; }
.due { font-size: 0.8rem; font-weight: 600; }
.due.ok { color: var(--ink-2); }
.due.due_soon { color: var(--warn); }
.due.due_today, .due.overdue { color: var(--crit); }
.count { background: var(--muted-bg); color: var(--ink-2); border-radius: 999px; padding: 0 7px; font-size: 0.75rem; font-weight: 700; }
.chip { display: inline-block; font-size: 0.8rem; background: var(--muted-bg); border-radius: 6px; padding: 2px 8px; margin: 4px 4px 0 0; }

/* callouts */
.callout { border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 0.9rem; border: 1px solid transparent; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout.info { background: var(--info-bg); color: var(--info); }
.callout.warning { background: var(--warn-bg); color: var(--warn); }
.callout.critical { background: var(--crit-bg); color: var(--crit); }
.callout.good { background: var(--good-bg); color: var(--good); }

/* dashboard */
.fleet { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.ac-card { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--good); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.ac-card.critical { border-left-color: var(--crit); }
.ac-card.warning { border-left-color: var(--gold); }
.ac-top { display: flex; justify-content: space-between; align-items: center; }
.tail { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.ac-stats { display: grid; gap: 4px; margin-top: 10px; }
.ac-stats a { color: var(--ink); }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { padding: 9px 10px 9px 14px; border-left: 4px solid var(--info); margin-bottom: 6px; background: var(--muted-bg); border-radius: 0 6px 6px 0; }
.attn li.warning { border-left-color: var(--gold); }
.attn li.critical { border-left-color: var(--crit); background: var(--crit-bg); }
.attn a { color: var(--ink); }

/* tables */
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-2); border-bottom: 1px solid var(--line); padding: 6px 8px; }
.grid td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.grid.small td { padding: 5px 8px; font-size: 0.88rem; }
.grid tr.sel td { background: var(--info-bg); }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--muted-bg); }
.grid tfoot td { border-bottom: 0; font-weight: 600; }
.grid tfoot tr.total td { font-size: 1.05rem; border-top: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }
@media (max-width: 700px) {
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 6px; background: var(--panel); }
  .grid td { border: 0; padding: 3px 6px; }
  .grid td:empty { display: none; }
  .num { text-align: left; }
  .table-scroll .grid thead { display: table-header-group; }
  .table-scroll .grid { display: table; }
  .table-scroll .grid tbody { display: table-row-group; }
  .table-scroll .grid tr { display: table-row; }
  .table-scroll .grid td { display: table-cell; width: auto; }
}

/* toolbar, tabs */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { width: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 36px; }
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab.on .count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.bulk { position: sticky; top: 58px; z-index: 5; display: flex; gap: 12px; align-items: center; background: var(--info-bg); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; flex-wrap: wrap; }
.seg-btn { border: 0; background: var(--panel); padding: 10px 16px; cursor: pointer; font-weight: 600; }
.seg-btn.on { background: var(--brand); color: #fff; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.lbl { font-size: 0.75rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.03em; }
.hint { font-size: 0.75rem; color: var(--ink-2); }
.ro { min-height: 40px; padding: 8px 0; }
.ro.strong { font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check.big { font-size: 1rem; }
.check.ack { background: var(--muted-bg); padding: 12px; border-radius: 8px; margin: 12px 0; }
.checks { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.checks .inline { margin: -2px 0 6px 30px; }
.picklist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-2); font-size: 0.85rem; }
.kv dd { margin: 0; }
ul.plain { margin: 0; padding-left: 18px; }
.compact { width: auto; min-height: 32px; padding: 4px 8px; font-size: 0.85rem; }
.compact.ata { width: 70px; }
.num-in { max-width: 90px; }
.note-in { max-width: 200px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.quick select { width: auto; max-width: 200px; }
.quick input { width: auto; }

/* work order items */
.item { border-left: 5px solid var(--line); }
.item.good { border-left-color: var(--good); }
.item.warning { border-left-color: var(--gold); }
.item.info { border-left-color: var(--info); }
.item.void { opacity: 0.65; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.item-head h3 { margin: 0; }
.sub-block { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.part-form { background: var(--muted-bg); padding: 12px; border-radius: 8px; margin-top: 8px; }
.line { display: flex; gap: 8px; align-items: center; }
.sigs { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sig { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; min-width: 220px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.sig.done { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.sig-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--ink-2); }
.sig-name { font-weight: 700; }
.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.72rem; color: var(--ink-2); }
.history { margin-top: 10px; font-size: 0.85rem; color: var(--ink-2); }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rts.ready { border: 2px solid var(--good); }
.rts.done { border-left: 5px solid var(--good); }
.times { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; grid-column: 1 / -1; }
.times .lbl { min-width: 150px; }
.times input { width: 130px; }
pre.entry { white-space: pre-wrap; background: var(--muted-bg); border-radius: 8px; padding: 12px; font: 0.85rem/1.5 ui-monospace, Menlo, Consolas, monospace; margin: 6px 0 12px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; }
.qb-entry { background: var(--muted-bg); border-radius: 8px; padding: 12px; width: 100%; }
.qb-entry input { width: auto; }
.inv-lines input { min-height: 32px; padding: 4px 6px; }
details.tpl { border-bottom: 1px solid var(--line); padding: 8px 0; }
details.tpl summary { cursor: pointer; padding: 6px 0; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 24, 0.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.sign-scope .scope { display: grid; gap: 6px; background: var(--muted-bg); padding: 12px; border-radius: 8px; }
.sign-scope .scope .lbl { display: inline-block; min-width: 130px; }
.pin-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pin-row label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.pin-row input { width: 160px; font-size: 1.3rem; letter-spacing: 0.3em; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 520px; width: 100%; box-shadow: var(--shadow); }
.user-pick { display: grid; gap: 8px; margin-top: 12px; }
.user-pick .btn { flex-direction: column; align-items: flex-start; white-space: normal; }
.user-pick .btn span { font-weight: 400; color: var(--ink-2); font-size: 0.85rem; }

/* toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); }
.toast { background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.toast.error { background: var(--crit); color: #fff; }

/* print documents */
.print-main { max-width: 900px; background: #fff; color: #000; }
.print-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.doc { font-size: 13px; color: #000; }
.doc h1 { font-size: 18px; }
.doc h2 { font-size: 16px; margin: 0; }
.doc-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; gap: 16px; }
.doc-head .right { text-align: right; }
.doc-meta { display: flex; gap: 48px; margin-bottom: 12px; }
.p-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.p-table th, .p-table td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
.p-table .num { text-align: right; }
.p-table tfoot td { border: 0; font-weight: 600; }
.p-table tfoot tr.total td { border-top: 2px solid #000; font-size: 15px; }
.p-item { border: 1px solid #999; padding: 8px 10px; margin-bottom: 8px; break-inside: avoid; }
.p-item-head { font-weight: 700; margin-bottom: 4px; }
.p-item .lbl { color: #333; min-width: 130px; display: inline-block; }
.p-sig { margin-top: 6px; }
.wet { display: block; margin-top: 18px; }
.wet.big { font-size: 14px; margin-top: 22px; }
.wet.st-sig { font-size: 13px; margin-top: 12px; line-height: 1.6; }
.sticker { border: 1.5px dashed #000; padding: 10px 12px; margin-bottom: 14px; break-inside: avoid; }
.sticker pre { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; margin: 6px 0; }
.st-head { font-size: 11px; text-transform: uppercase; color: #333; }
.doc pre.entry { background: #f3f3f3; color: #000; }
@media print {
  .no-print, .top, .banner, .foot, .toasts { display: none !important; }
  body, html { background: #fff; }
  .main { padding: 0; max-width: none; }
}
.kv.locked { grid-template-columns: 150px 1fr; }
.kv.locked dd { white-space: pre-wrap; }
@media (max-width: 600px) { .kv.locked { grid-template-columns: 1fr; } .kv.locked dt { margin-top: 6px; } }

.doc-logo { height: 56px; width: auto; display: block; margin-bottom: 6px; }
.st-head { display: flex; align-items: center; gap: 8px; }
.st-head img { height: 18px; width: auto; }

/* photos */
.photos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.photos-label { font-size: 0.8rem; color: var(--ink-2); margin-right: 4px; }
.thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }
label.btn.disabled { opacity: .6; pointer-events: none; }

/* shop board */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--muted-bg); border-radius: 10px; padding: 8px; min-height: 120px; }
.board-col-head { font-weight: 600; font-size: 0.85rem; padding: 4px 6px 8px; display: flex; gap: 6px; align-items: center; }
.board-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.board-card:hover { border-color: var(--accent); }
.board-card.outside { border-left: 3px solid var(--accent); }
.bc-top { display: flex; justify-content: space-between; gap: 6px; }
.bc-title { margin: 4px 0; font-size: 0.9rem; }
.bc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bc-prog { flex: 1 1 50px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 40px; }
.bc-prog span { display: block; height: 100%; background: var(--good); }
.bc-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--info-bg); color: var(--info); font-size: 0.65rem; font-weight: 700; }
.board-empty { color: var(--ink-2); text-align: center; padding: 16px 0; }
@media (max-width: 860px) { .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .board-col { scroll-snap-align: start; } }
.assignee { font-size: 0.8rem; color: var(--ink-2); }
select.compact.assign.set { font-weight: 600; }
.mywork li { margin: 4px 0; }
.board-tools { display: flex; gap: 8px; align-items: center; } .board-tools select { width: auto; }
/* unserviceable tag */
.tag { border: 3px solid #b3261e; border-radius: 8px; max-width: 420px; padding: 14px 18px; margin: 16px 0; background: #fff; color: #111; }
.tag-head { background: #b3261e; color: #fff; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 6px; margin: -14px -18px 8px; font-size: 1.3rem; }
.tag-sub { text-align: center; font-size: .8rem; margin-bottom: 8px; }
.tag .kv dt { font-size: .75rem; }
.sub-head select.compact { width: auto; max-width: 340px; }

/* invoice (CORRIDOR-style: summary page, then one page per component) */
.doc.inv { font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11.5px; }
.inv-page { padding-bottom: 12px; }
.inv-page.break { break-before: page; border-top: 1px dashed #bbb; padding-top: 16px; margin-top: 16px; }
@media print { .inv-page.break { border-top: 0; margin-top: 0; padding-top: 0; } }
.inv-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; margin-bottom: 14px; }
.inv-head .doc-logo { height: 48px; }
.inv-head .right { text-align: right; align-self: start; }
.inv-head-mid { white-space: nowrap; }
.inv-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.prelim-note { border: 2px solid #b45309; color: #b45309; font-weight: 700; padding: 6px 10px; margin: 0 0 12px; text-align: center; letter-spacing: .02em; }
.inv-meta { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 8px; }
.billto { display: flex; gap: 12px; }
.inv .lbl { font-weight: 700; min-width: 90px; display: inline-block; text-transform: none; letter-spacing: 0; color: #000; font-size: inherit; }
.doc.inv table th, .doc.inv table td { font-size: 11.5px; }
.doc.inv .inv-list th, .doc.inv .inv-tm tr.extra th { font-size: 10.5px; }
.doc.inv .inv-tm tr.sum th, .doc.inv .inv-tm tr.sum td { font-size: 12.5px; }
.doc.inv .inv-tm tr.grand th, .doc.inv .inv-tm tr.grand td { font-size: 14px; }
.inv-kv { display: grid; grid-template-columns: auto auto; gap: 2px 8px; margin: 0; }
.inv-kv dt { font-weight: 700; text-align: right; }
.inv-kv dd { margin: 0; min-width: 140px; }
.inv-kv.small { font-size: 10.5px; }
.inv-terms { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 6px 0; }
.inv-band { display: flex; justify-content: space-between; font-weight: 700; border-bottom: 1px solid #000; padding: 4px 0; margin: 8px 0 10px; }
.inv-tm { margin: 6px 0 10px 12%; width: 76%; border-collapse: collapse; }
.inv-tm thead th { font-weight: 700; border-bottom: 1px solid #000; padding: 3px 6px; }
.inv-tm th { text-align: left; font-weight: 700; padding: 2px 6px; }
.inv-tm td { padding: 2px 6px; }
.inv-tm .num { text-align: right; white-space: nowrap; }
.inv-tm tr.sum th, .inv-tm tr.sum td { border-top: 1px solid #000; font-weight: 700; font-size: 12.5px; padding-top: 4px; }
.inv-tm tr.extra th { font-weight: 700; font-size: 10.5px; }
.inv-tm tr.grand th, .inv-tm tr.grand td { border-top: 2px solid #000; font-size: 14px; font-weight: 700; padding-top: 6px; }
.inv-notes { margin-top: 12px; white-space: pre-wrap; }
.inv-sub { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 6px; }
.inv-item-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
.inv-disc { border-bottom: 1px solid #999; padding: 6px 0 8px; break-inside: avoid; }
.inv-disc .row2 { display: flex; gap: 8px; margin-bottom: 4px; }
.inv-disc .row2 > span:last-child { white-space: pre-wrap; flex: 1; }
.inv-list { width: 100%; border-collapse: collapse; margin: 2px 0 6px; }
.inv-list th { text-align: left; border-bottom: 1px solid #000; font-weight: 700; padding: 2px 4px; font-size: 10.5px; }
.inv-list td { padding: 2px 4px; }
.inv-list .num { text-align: right; }
@media (max-width: 640px) { .inv-head, .inv-meta, .inv-item-head { grid-template-columns: 1fr; flex-direction: column; } .inv-tm { margin-left: 0; width: 100%; } }

/* logbook entries, readable layout */
div.entry { background: var(--muted-bg); border-radius: 8px; padding: 12px 14px; margin: 6px 0 12px; }
.doc div.entry { background: #f3f3f3; color: #000; }
.entry-text { font-size: 0.9rem; line-height: 1.45; }
.doc .entry-text { font-size: 12.5px; }
.et-head { font-weight: 600; }
.et-gap { height: 0.6em; }
.et-item { display: flex; gap: 6px; margin-top: 2px; }
.et-n { min-width: 1.6em; font-weight: 600; }
.et-sub { padding-left: 1.6em; margin-left: 6px; }
.et-k { color: var(--ink-2); }
.doc .et-k { color: #444; }
.et-p { margin: 2px 0; }
.sticker .entry-text { margin: 6px 0; }

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--muted-bg); }

/* shop tag (Repairable green / Unserviceable red / Serviceable yellow), about 3.25 x 6.5 in like CAS's tag stock */
.tag-switch { margin: 0 0 12px; }
.shoptag { --tag: #3fd14a; --tagink: #111; width: 3.25in; min-height: 6.5in; box-sizing: border-box; background: var(--tag); color: #111;
  border-radius: 0.45in 0.45in 6px 6px; padding: 0.15in 0.2in 0.2in; margin: 8px 0; font: 11.5px/1.25 Arial, Helvetica, sans-serif;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; position: relative; break-inside: avoid; }
.tg-hole { width: 0.2in; height: 0.2in; border-radius: 50%; background: #fff; border: 1px solid #0003; margin: 0 auto 0.08in; }
.tg-base { text-align: center; font-weight: 900; font-size: 20px; letter-spacing: .06em; }
.tg-co { text-align: center; font-weight: 700; font-size: 14px; }
.tg-addr { text-align: center; font-size: 9.5px; }
.tg-title { text-align: center; font-weight: 900; font-size: 25px; letter-spacing: .02em; margin: 0.08in 0 0.12in; color: var(--tagink); }
.shoptag[style*="#e0352b"] .tg-title { background: #111; color: #fff; }
.tg-line { display: flex; gap: 4px; align-items: flex-end; margin: 0.07in 0 0; }
.tg-line span { white-space: nowrap; }
.tg-line b { flex: 1; border-bottom: 1px solid #111; font-weight: 600; min-height: 1.15em; padding-left: 2px; font-size: 11px; overflow: hidden; }
.tg-defects { border-bottom: 1px solid #111; min-height: 3.6em; font-weight: 600; font-size: 11px; line-height: 1.3; padding: 2px 2px 3px;
  background: repeating-linear-gradient(transparent, transparent 1.25em, #111 1.25em, #111 calc(1.25em + 1px)); }
.tg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg-note { margin-top: 0.08in; font-size: 10px; font-weight: 700; }
@media print { .shoptag { margin: 0; } }

/* full-page logbook entries (one logbook per US Letter page, for page protectors) */
.logpage { background: #fff; color: #000; border: 1px solid #ccc; width: 8.5in; height: 11in; padding: 0.55in 0.7in 0.5in; margin: 0 0 18px; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; }
.lp-measure { position: absolute; left: -10000px; top: 0; visibility: hidden; }
.lp-measure .logpage { height: auto; }
.lp-unit.gap { padding-top: 0.6em; }
.lp-more { margin-top: 10px; font-style: italic; font-size: 11px; color: #444; }
.lp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
.lp-head img { height: 46px; }
.lp-book { font-weight: 800; font-size: 16px; letter-spacing: .04em; }
.lp-title { font-size: 12.5px; }
.lp-ref { text-align: right; font-size: 12.5px; font-weight: 600; }
.lp-practice { color: #b3261e; font-weight: 700; text-align: center; margin-bottom: 8px; }
.lp-body { flex: 0 0 auto; }
.lp-lineout { flex: 1 1 auto; min-height: 0; margin-top: 4px; }
.lp-lineout svg { display: block; width: 100%; height: 100%; }
.lp-lineout line { stroke: #000; stroke-width: 1; }
.lp-end { font-size: 10px; font-style: italic; color: #444; text-align: center; margin-top: 6px; }
.et-ca strong { font-weight: 600; }
.lp-body .entry-text { font-size: 12.5px; line-height: 1.5; }
.lp-sign { margin-top: 6px; font-size: 12.5px; }
.lp-sigblock + .lp-sigblock { margin-top: 10px; }
.lp-sigblock.esig + .lp-sigblock.esig { margin-top: 8px; }
.lp-role { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.st-role { font-weight: 700; }
.lp-sigline { display: flex; flex-direction: column; margin-bottom: 18px; }
.lp-sigline span { border-bottom: 1px solid #000; height: 34px; max-width: 4in; }
.lp-sign label { font-size: 10px; color: #444; }
.lp-sigrow { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 16px; }
.lp-sigrow > div { border-bottom: 1px solid #000; display: flex; flex-direction: column-reverse; padding-bottom: 2px; }
.lp-sigrow b { font-weight: 600; }
.lp-sigrow label { order: -1; margin-top: 2px; }
.lp-foot { display: flex; justify-content: space-between; border-top: 1px solid #999; margin-top: 18px; padding-top: 6px; font-size: 10px; color: #444; }
@page logbook { size: letter; margin: 0; }
.logpage { page: logbook; }
@media print {
  .logpage { border: 0; margin: 0; height: 10.98in; break-after: page; page-break-after: always; }
  .lp-measure { display: none; }
  .logpage:last-of-type { break-after: auto; page-break-after: auto; }
}

mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
.search.big { flex: 1; min-width: 260px; font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.history-text { white-space: pre-wrap; font-size: 12px; background: var(--surface-2, #f4f4f5); padding: 12px; border-radius: 6px; max-height: 60vh; overflow: auto; }
.timeline { margin: 4px 0; }
.timeline li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.toolbar input[type="search"] { flex: 1 1 220px; }
.top .build { font-size: 0.7rem; color: rgba(255, 255, 255, 0.6); margin-left: -6px; align-self: center; white-space: nowrap; }
@media (max-width: 760px) { .top .build { display: none; } }

.inline-pair { display: flex; gap: 6px; }
.inline-pair input { flex: 1; min-width: 0; }
.inline-pair select { width: auto; }
.line.clickable { cursor: pointer; }
.line.clickable:hover { background: var(--hover, rgba(0,0,0,.03)); }
.suggest .sg-row { display: grid; grid-template-columns: 9em 1fr 1fr; gap: 8px; margin: 4px 0; }
.suggest .sg-old { text-decoration: line-through; opacity: .7; }
.suggest .sg-new { font-weight: 600; }
@media (max-width: 640px) { .suggest .sg-row { grid-template-columns: 1fr; } }
