/* Franco & Co Reporting: the calm console layout (redesign 2026-09-22; the old look is in ../archive/).
   Grey-white page, white panels on hairlines, one blue accent for primary actions and selection,
   status as a dot plus words, technical detail folded away until asked for. */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --line: #dadce0;
  --line-soft: #e8eaed;
  --text: #202124;
  --text-2: #5f6368;
  --text-3: #6f7479;
  --accent: #1a5fc4;
  --accent-hover: #174ea6;
  --accent-soft: #e8f0fe;
  --accent-ring: rgba(26, 95, 196, .28);
  --ok: #188038;
  --warn: #b06000;
  --warn-soft: #fef7e0;
  --err: #c5221f;
  --err-soft: #fce8e6;
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --shadow-pop: 0 1px 3px rgba(60, 64, 67, .15), 0 4px 12px rgba(60, 64, 67, .12);
  --side-w: 232px;
  --top-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: #c6dafc; color: var(--text); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
h1, h2, h3, h4 { text-wrap: balance; }
* { scrollbar-color: #c4c7c9 transparent; scrollbar-width: thin; }

/* ---------- shell: top bar, side nav, content ---------- */
.topbar { position: sticky; top: 0; z-index: 10; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 20px 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 400; white-space: nowrap; color: var(--text-2); text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }
.brand-app { padding-left: 12px; border-left: 1px solid var(--line); line-height: 22px; }
.brand small { font-size: 12px; font-weight: 400; color: var(--text-2); padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.brand small:empty { display: none; }
.topbar .spacer { flex: 1; }
@media (max-width: 900px) { .topbar .spacer { display: none; } }
#client-selector { width: 280px; background-color: var(--surface-2); border-color: transparent; }
#client-selector:hover { border-color: var(--line); }
.userchip { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.userchip b { color: var(--text); font-weight: 500; }

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.sidenav { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); padding: 12px 12px 12px 0; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 16px 0 24px; border-radius: 0 999px 999px 0; color: var(--text); font-weight: 500; font-size: 14px; }
.sidenav a:hover { text-decoration: none; background: var(--surface-2); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); }
.sidenav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.sidenav a.active svg { color: var(--accent); }

main { padding: 28px 32px 72px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 400; letter-spacing: -.01em; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.page-head h1 .hint { font-size: 14px; }
.page-head .sub { color: var(--text-2); margin-top: 4px; max-width: 75ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.crumbs { color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 500; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.card h3 .hint { font-weight: 400; }
.card h4 { font-size: 14px; font-weight: 500; }
.card .card-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* minmax(0, …) and min-width: 0 let long unbroken text (QuickBooks field paths) wrap instead of widening the column. */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > * { min-width: 0; }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); row-gap: 10px; column-gap: 16px; margin: 0; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* A table that sits in a panel with its filters above it. */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.panel-bar select { width: auto; min-width: 150px; }
.panel-bar .check { margin: 0 4px; }
.panel-bar .search { position: relative; flex: 1 1 240px; max-width: 360px; display: flex; align-items: center; }
.panel-bar .search svg.i { position: absolute; left: 10px; color: var(--text-2); pointer-events: none; }
.panel-bar .search input { padding-left: 36px; }
.panel .tbl { border: 0; border-radius: 0; }
.panel .tbl-wrap + .tbl-wrap { border-top: 1px solid var(--line); }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; }

/* Folded detail: technical fields, trees, and each Settings section open on request. */
details.fold { margin-top: 14px; }
details.fold > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 13px; list-style: none; padding: 4px 0; border-radius: 4px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease-out; margin-right: 2px; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > .fold-body { margin-top: 10px; }

.sections { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 1040px; }
details.sect + details.sect { border-top: 1px solid var(--line); }
details.sect > summary { display: grid; grid-template-columns: 240px minmax(0, 1fr) 20px; gap: 16px; align-items: center; padding: 16px 24px; cursor: pointer; list-style: none; }
details.sect > summary::-webkit-details-marker { display: none; }
details.sect > summary:hover { background: #fafbfc; }
details.sect > summary .s-title { font-weight: 500; }
details.sect > summary .s-sum { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.sect > summary::after { content: ""; justify-self: end; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); transition: transform .15s ease-out; margin-top: -4px; }
details.sect[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.sect[open] > summary { border-bottom: 1px solid var(--line-soft); }
details.sect > .sect-body { padding: 20px 24px 24px; }
.sect-body > p.hint:first-child { margin-top: 0; }
.savebar { position: sticky; bottom: 0; z-index: 5; max-width: 1040px; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: linear-gradient(to top, var(--bg) 75%, transparent); }
.savebar .hint { margin-right: auto; }

/* Summary strip: the few numbers that matter, in one row. */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-row.three { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 14px 20px; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .v.bad { color: var(--err); }
.stat .l { color: var(--text-2); font-size: 13px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { font-weight: 500; color: var(--text-2); font-size: 12.5px; background: var(--surface); border-bottom-color: var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td, .tbl tr[data-href]:hover td { background: #f6f8fc; }
.tbl tr[data-href] { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl th.wide, .tbl td.wide { min-width: 220px; }
.tbl .row-actions { display: flex; gap: 2px; white-space: nowrap; justify-content: flex-end; }
.tbl .sub-line { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.tbl .sub-line.mono { font-size: 12px; }
.tbl tr.group td { background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 500; padding-top: 7px; padding-bottom: 7px; }
.tbl tr.group td b { color: var(--text); font-weight: 500; }
.tbl td.mono { color: var(--text-2); }
.tbl-wrap { overflow-x: auto; }
.empty { padding: 32px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Status: a dot plus plain words. Neutral labels are just quiet text. */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; vertical-align: baseline; }
.pill.ok, .pill.err, .pill.warn, .pill.info { color: var(--text); }
.pill.ok::before, .pill.err::before, .pill.warn::before, .pill.info::before, .pill.muted.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill.ok::before { background: var(--ok); }
.pill.err { color: var(--err); }
.pill.err::before { background: var(--err); }
.pill.warn { color: var(--warn); }
.pill.warn::before { background: #e37400; }
.pill.info::before { background: #80868b; }
.pill.muted { color: var(--text-3); }
.kind { font-size: 13px; color: var(--text-2); white-space: nowrap; }
h1 .pill { font-size: 13px; letter-spacing: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); border-radius: var(--radius-sm); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color .15s ease-out, border-color .15s ease-out; text-decoration: none; }
.btn:hover { background: #f6f9fe; border-color: #c6d4ea; text-decoration: none; }
.btn:active { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: #f1bdb8; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--line); }
.btn.primary:disabled:hover { background: var(--accent); }
/* Inside tables, row buttons are quiet text buttons until hovered. */
.tbl .btn.sm:not(.primary) { border-color: transparent; background: transparent; padding: 0 8px; }
.tbl .btn.sm:not(.primary):hover { background: var(--accent-soft); }
.tbl .btn.sm.danger:hover { background: var(--err-soft); }

/* Drawn icons (index.html side nav set) and icon-only buttons. */
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.icon, .tbl .btn.sm.icon:not(.primary) { width: 30px; padding: 0; color: var(--text-2); }
.btn.sm svg.i { width: 16px; height: 16px; }
.tbl .btn.sm:not(.primary):has(svg.i) { color: var(--text-2); }
/* Row "More" menu: a popover in the top layer, anchored under its button. */
.menu[popover] { margin: 0; inset: auto; top: anchor(bottom); right: anchor(right); margin-top: 4px; padding: 6px 0; min-width: 168px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 16px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- banners ---------- */
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; display: flex; gap: 12px; align-items: center; border: 1px solid; background: var(--surface); }
.banner.err { background: #fdf4f3; border-color: #f4d3cf; color: #8c1d18; }
.banner.warn { background: #fffaeb; border-color: #f5e2b3; color: #7a4a00; }
.banner.info { background: #f4f8fe; border-color: #d2e3fc; color: #174ea6; }
.banner a { color: inherit; text-decoration: underline; }
.banner .banner-actions { margin-left: auto; flex: none; }
.banner .banner-actions .btn { text-decoration: none; }

/* ---------- tabs ---------- */
/* The rule under the tabs is an inset shadow, not a border: the active tab's underline sits over it without the
   negative margin that made the strip overflow by a pixel and show a vertical scrollbar. */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; }
.tabs a { padding: 10px 16px; color: var(--text-2); border-bottom: 3px solid transparent; font-weight: 500; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }

/* ---------- forms ---------- */
form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
form label { font-size: 13px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #767a7e; }
input:hover, select:hover, textarea:hover { border-color: #bdc1c6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.form-grid .span2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.check input { width: 16px; }
.check label { color: var(--text); font-weight: 400; font-size: 14px; }
.hint { color: var(--text-2); font-size: 13px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); align-items: center; }
.form-actions .right { margin-left: auto; display: flex; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 14px; }
.switch input { appearance: none; width: 34px; height: 14px; border-radius: 999px; background: #bdc1c6; position: relative; transition: background-color .15s ease-out; margin: 0 4px; flex: none; }
.switch input::after { content: ""; position: absolute; top: -3px; left: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(60, 64, 67, .4); transition: left .15s ease-out, background-color .15s ease-out; }
.switch input:checked { background: #a8c7fa; }
.switch input:checked::after { left: 18px; background: var(--accent); }
.switch input:disabled { opacity: .5; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--accent-soft); border-color: transparent; color: #0b3d91; }
.chip.small { height: auto; min-height: 26px; padding: 3px 10px; font-size: 12.5px; font-weight: 400; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.chip.meta { border-style: dashed; }
.chip.meta.active { background: #e6f4ea; border-color: transparent; color: #0d652d; }
.chip.disabled { opacity: .45; cursor: not-allowed; }

.preview { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.preview .kv { grid-template-columns: 130px 1fr; }

/* Wizard steps: a quiet numbered line. */
.steps { display: flex; gap: 0; margin-bottom: 20px; align-items: center; counter-reset: step; }
.steps .step { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; padding-right: 16px; }
.steps .step + .step::before { content: ""; width: 32px; height: 1px; background: var(--line); margin-right: 6px; }
.steps .step b { font-size: 0; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); counter-increment: step; }
.steps .step b::before { content: counter(step); font-size: 12px; font-weight: 500; color: var(--text-2); }
.steps .step.active { color: var(--text); font-weight: 500; }
.steps .step.active b { background: var(--accent); border-color: var(--accent); }
.steps .step.active b::before { color: #fff; }
.steps .step.done b { background: #e6f4ea; border-color: transparent; }
.steps .step.done b::before { color: var(--ok); }

.tree { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 16px; white-space: pre; overflow-x: auto; color: var(--text); }
.tree .new { color: var(--ok); }
.tree .note { color: var(--text-2); }

.col-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.col-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.col-list li:last-child { border-bottom: 0; }
.col-list .key { color: var(--text-2); font-family: var(--mono); font-size: 12px; flex: 1 1 40%; min-width: 0; overflow-wrap: anywhere; }
.col-list .label { flex: 1 1 60%; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.col-list .btn, .col-list .grip { flex: none; }
.col-list .btn { height: 26px; padding: 0 8px; }
.col-list li.computed { background: var(--bg); color: var(--text); }
.col-list li[draggable] { cursor: grab; }
.col-list li.dragging { opacity: .4; }
.col-list li.drop-target { box-shadow: inset 0 2px 0 var(--accent); }
.col-list .grip { color: #9aa0a6; width: 18px; display: inline-flex; user-select: none; }

dialog { border: 0; border-radius: 12px; padding: 0; max-width: 520px; width: 92vw; box-shadow: 0 4px 8px rgba(60, 64, 67, .15), 0 12px 32px rgba(60, 64, 67, .25); color: var(--text); }
dialog::backdrop { background: rgba(32, 33, 36, .4); }
dialog .dlg-body { padding: 24px 24px 8px; }
dialog h3 { margin: 0 0 10px; font-size: 18px; font-weight: 400; }
dialog p { margin: 0 0 8px; color: var(--text-2); }
dialog .dlg-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px 20px; }

.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 100vw; background: var(--surface); box-shadow: -4px 0 24px rgba(60, 64, 67, .2); z-index: 20; padding: 20px 24px; overflow-y: auto; }
.drawer h3 { margin: 0 0 16px; display: flex; align-items: center; font-size: 18px; font-weight: 400; gap: 12px; }
.drawer h3 .close { margin-left: auto; }
.drawer .error-box { background: var(--err-soft); color: #8c1d18; border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; margin-top: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: #303134; color: #fff; padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; z-index: 30; opacity: 0; transition: opacity .2s ease-out, transform .2s ease-out; pointer-events: none; box-shadow: var(--shadow-pop); max-width: min(640px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Run notices: bottom right, newest at the bottom; each new card lifts the ones above it. */
.notices { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 40px); z-index: 31; pointer-events: none; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 12px 14px; font-size: 13px; pointer-events: auto; opacity: 0; transform: translateY(8px); transition: opacity .25s ease-out, transform .25s ease-out; }
.notice.show { opacity: 1; transform: none; }
.notice.fade { opacity: 0; transform: translateY(6px); }
.notice .n-head { display: flex; align-items: center; gap: 8px; }
.notice .n-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.notice.ok .n-head::before { background: var(--ok); }
.notice.err .n-head::before { background: var(--err); }
.notice.warn .n-head::before { background: #e37400; }
.notice:has(.spin) .n-head::before { display: none; }
.notice .n-title { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice .n-close { border: 0; background: none; color: var(--text-2); cursor: pointer; line-height: 0; padding: 2px; border-radius: 4px; }
.notice .n-close svg.i { width: 16px; height: 16px; }
.notice .n-close:hover { background: var(--surface-2); }
.notice .n-body { color: var(--text-2); margin-top: 4px; }
.notice .n-links { display: flex; gap: 14px; margin-top: 8px; }
.notice .n-links a { color: var(--accent); font-weight: 500; }
.notice .spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.notice .n-bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.notice .n-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }

.placeholder { padding: 40px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.placeholder b { display: block; color: var(--text); margin-bottom: 6px; font-weight: 500; }

.subtabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.subtabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 10px 14px; margin-bottom: -1px; font: inherit; font-weight: 500; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.subtabs button:hover { color: var(--text); background: var(--surface-2); }
.subtabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs button b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 500; }
.subtabs button.active b { background: var(--accent); color: #fff; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.radio-card:hover { border-color: #bdc1c6; }
.radio-card:has(input:checked) { border-color: var(--accent); background: #f6f9fe; }
.radio-card .hint { display: block; flex-basis: 100%; margin-top: 4px; }

.filter-row { display: grid; grid-template-columns: 1.3fr 90px 1.4fr 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter-row.report { grid-template-columns: 1.4fr 1.6fr 36px; }
.filter-row .btn { padding: 0 8px; }
.filter-row .token { font-family: var(--mono); font-size: 12px; }

.hdr-preview { display: flex; flex-wrap: wrap; gap: 4px; }
.hdr-preview span { max-width: 100%; overflow-wrap: anywhere; font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.hdr-preview span.meta { border-color: #a8dab5; color: #0d652d; }
.hdr-preview span.computed { border-style: dashed; color: var(--text-2); }

.section-head { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; font-weight: 500; font-size: 15px; }
.section-head:first-child { margin-top: 0; }
.checks-inline { display: flex; flex-wrap: wrap; gap: 0 20px; }
.checks-inline .check { margin: 4px 0; }
.call-box { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); }
.sticky { position: sticky; top: calc(var(--top-h) + 16px); }
.token { font-family: var(--mono); font-size: 12.5px; padding: 6px 0; }
.steps-list { margin: 0; padding-left: 20px; }
.steps-list li { margin: 4px 0; }
.inline-add { display: flex; gap: 8px; align-items: center; margin: -4px 0 16px; }
.inline-add input { max-width: 280px; }
.tbl td input.mono { font-family: var(--mono); font-size: 12.5px; height: 32px; padding: 0 10px; max-width: 260px; }

/* ---------- sign-in (web/firebase.js) ---------- */
.signed-out .sidenav, .signed-out #client-selector, .signed-out #userchip { visibility: hidden; }
.signed-out .shell { grid-template-columns: 1fr; }
.signed-out .sidenav { display: none; }
.signin { max-width: 440px; margin: 72px auto; display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.signin h1 { margin: 0; font-size: 20px; font-weight: 400; color: var(--text-2); }
/* align-self keeps the flex column from stretching the mark to the card's width. */
.signin-logo { display: block; width: 64px; height: 64px; align-self: flex-start; border-radius: 12px; }
.signin .btn { align-self: flex-start; }

/* ---------- computed columns (Phase 4) ---------- */
.tbl th.computed { border-bottom: 2px dashed var(--line); font-style: italic; }

/* ---------- narrow screens: the side nav becomes a scrolling tab row ---------- */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .brand small, .brand-app { display: none; }
  .brand img { height: 22px; }
  #client-selector { width: auto; min-width: 0; flex: 1; }
  .userchip { font-size: 0; gap: 0; }
  .userchip b { display: none; }
  .userchip .btn { font-size: 13px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidenav { position: sticky; top: var(--top-h); z-index: 9; height: auto; flex-direction: row; padding: 0 8px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); gap: 0; scrollbar-width: none; mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 40px), transparent); }
  .tabs { scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .sidenav a { height: 44px; padding: 0 14px; border-radius: 0; gap: 8px; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidenav a.active { background: none; border-bottom-color: var(--accent); }
  .sidenav svg { width: 18px; height: 18px; }
  main { padding: 20px 16px 64px; }
  .page-head { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .stat-row, .stat-row.three { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .kv { grid-template-columns: 120px 1fr; }
  .card { padding: 16px; }
  details.sect > summary { grid-template-columns: minmax(0, 1fr) 20px; padding: 14px 16px; gap: 4px 12px; }
  details.sect > summary .s-sum { grid-row: 2; white-space: normal; font-size: 13px; }
  details.sect > summary::after { grid-row: 1 / span 2; grid-column: 2; }
  details.sect > .sect-body { padding: 16px; }
  .steps { flex-wrap: wrap; row-gap: 8px; }
  .steps .step + .step::before { width: 12px; }
  .drawer { width: 100vw; }
  .sidenav { padding-left: 24px; padding-right: 48px; }
  .tabs { padding-right: 32px; }
  /* Phone dashboard: client, QuickBooks, and last sync fit without sideways scrolling; next run and count are on the client page. */
  .tbl.clients th, .tbl.clients td { padding: 10px 10px; }
  .tbl.clients th:first-child, .tbl.clients td:first-child { padding-left: 16px; }
  .tbl.clients .wide { min-width: 0; }
  .tbl.clients th:nth-child(n+4), .tbl.clients td:nth-child(n+4) { display: none; }
  /* Sync monitor on phones: window and row count live in the run drawer. */
  .tbl th.opt, .tbl td.opt { display: none; }
  .tbl .wide { min-width: 0; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl.runs { table-layout: fixed; }
  .tbl.runs th.c-client { width: 30%; }
  .tbl.runs th:nth-last-child(4) { width: 96px; }
  .tbl.runs td { overflow-wrap: anywhere; }
  .stat-row.three { grid-template-columns: repeat(3, 1fr); }
  .stat-row.three .stat { border-top: 0; }
  .stat-row.three .stat:nth-child(3) { border-left: 1px solid var(--line-soft); }
  .filter-row, .filter-row.report { grid-template-columns: 1fr 1fr 36px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}

.t-err { color: var(--err); }
