/* Technaus Installer Portal
   Palette taken from the Technaus Solar mark: navy wordmark, sky-blue accent.
   Layout rule: lists and tables, not tile grids. */
:root {
  --ink: #13294B;
  --blue: #1F8FD6;
  --blue-deep: #1570AB;
  --tint: #EAF3FA;
  --canvas: #F4F7FA;
  --paper: #FFFFFF;
  --line: #DCE3EB;
  --line-soft: #E9EEF3;
  --text: #1D2733;
  --muted: #5B6B7F;
  --ok: #1E7F4F;   --ok-bg: #E7F4EC;
  --warn: #9A5B00; --warn-bg: #FDF1DC;
  --bad: #B42318;  --bad-bg: #FDECEA;
  --radius: 6px;
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--canvas); }
a { color: var(--blue-deep); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid rgba(31,143,214,.45); outline-offset: 2px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
.num, td.num, .rate { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 26px; width: auto; }
.brand span { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; }
.nav { display: flex; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.nav a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--muted);
  font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); border-bottom-color: var(--blue); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.who form { margin: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.crumb { font-size: 13px; margin-bottom: 6px; }
.crumb a { text-decoration: none; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 14px/1 var(--font);
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: #B9C6D4; color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #0C1D37; color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-deep); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; min-height: 30px; font-size: 13px; }
.btn.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--blue-deep); text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number],
input[type=search], input:not([type]), select, textarea {
  width: 100%; font: 15px/1.4 var(--font); color: var(--text); background: #fff;
  border: 1px solid #C9D3DE; border-radius: var(--radius); padding: 9px 11px; min-height: 40px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(31,143,214,.18); }
input.bad, select.bad { border-color: var(--bad); }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 11px; background: #fff; cursor: pointer; margin: 0; }
.check input { margin: 0; width: 16px; height: 16px; accent-color: var(--ink); }
.check:has(input:checked) { border-color: var(--ink); background: var(--tint); }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14.5px; color: var(--text); }
.tick input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }

/* ---------- flash / notices ---------- */
.flash { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: #BFE1CC; color: #11502F; }
.flash.error { background: var(--bad-bg); border-color: #F4C3BE; color: #7A1A12; }
.notice { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; margin-bottom: 16px; }
.notice.info { border-left-color: var(--blue); background: var(--tint); }
.notice.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- panels & tables ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.empty { padding: 22px 18px; color: var(--muted); font-size: 14px; }

.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: #FAFBFD; white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.rowlink { cursor: pointer; }
table.list tr.rowlink:hover td { background: #F7FAFD; }
table.list td.r, table.list th.r { text-align: right; }
.primary-cell a { font-weight: 600; color: var(--ink); text-decoration: none; }
.primary-cell a:hover { text-decoration: underline; }
.sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.id { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 9px 3px 8px;
  border-radius: 999px; white-space: nowrap; background: #EEF1F5; color: #3C4A5C; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.draft { background: #EEF1F5; color: #56657A; }
.pill.invited { background: var(--tint); color: var(--blue-deep); }
.pill.submitted { background: #FFF4D6; color: #8A5A00; }
.pill.changes_requested { background: #FDEBDD; color: #A04A0C; }
.pill.active, .pill.approved, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.suspended, .pill.rejected, .pill.expired { background: var(--bad-bg); color: var(--bad); }
.pill.archived { background: #F0F0F0; color: #767676; }
.pill.pending, .pill.soon { background: #FFF4D6; color: #8A5A00; }
.pill.none { background: transparent; color: var(--muted); padding-left: 0; }
.pill.none::before { display: none; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg a { padding: 7px 12px; font-size: 13.5px; text-decoration: none; color: var(--muted); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--ink); color: #fff; }
.filters input[type=search] { width: 260px; min-height: 36px; padding: 7px 10px; }
.filters select { width: auto; min-height: 36px; padding: 6px 10px; }

/* ---------- dashboard ---------- */
.pipeline { padding: 18px; }
.pipeline-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-soft); }
.pipeline-bar span { display: block; height: 100%; }
.pipeline-key { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 14px; font-size: 14px; }
.pipeline-key a { text-decoration: none; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.pipeline-key b { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pipeline-key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.c-draft { background: #B7C2CF; } .c-invited { background: var(--blue); } .c-submitted { background: #E3A21A; }
.c-changes_requested { background: #D97A2B; } .c-active { background: var(--ok); } .c-suspended { background: var(--bad); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12px; }

/* ---------- detail ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.detail-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.steps { display: flex; list-style: none; margin: 0 0 22px; padding: 0; counter-reset: s; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { flex: 1; padding: 11px 14px 11px 16px; font-size: 13.5px; color: var(--muted); position: relative;
  border-right: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.steps li:last-child { border-right: 0; }
.steps li::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #C3CDD8; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "✓"; background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.now { color: var(--ink); font-weight: 600; background: var(--tint); }
.steps li.now::before { border-color: var(--blue); color: var(--blue-deep); }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.rail .panel-body { font-size: 14px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
dl.kv dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
dl.kv.tight { grid-template-columns: 110px 1fr; }
.copyline { display: flex; gap: 6px; }
.copyline input { font-size: 12.5px; min-height: 34px; }
details.inline > summary { cursor: pointer; list-style: none; display: inline-flex; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] > summary { margin-bottom: 12px; }
.addform { background: #FAFBFD; border-top: 1px solid var(--line-soft); padding: 14px 18px; }
.review-note { font-size: 12.5px; color: var(--bad); margin-top: 3px; }
.checklist { margin: 0; padding-left: 18px; }

/* signature */
.sigbox { border: 1px dashed #9FB0C3; border-radius: var(--radius); background: #fff; position: relative; touch-action: none; }
.sigbox canvas { display: block; width: 100%; height: 150px; cursor: crosshair; }
.sigbox .sig-clear { position: absolute; right: 8px; top: 8px; }
.sigbox .sig-line { position: absolute; left: 16px; right: 16px; bottom: 34px; border-bottom: 1px solid #C9D3DE; pointer-events: none; }

/* dialogs */
dialog { border: 0; border-radius: 8px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(19,41,75,.25); }
dialog::backdrop { background: rgba(19,41,75,.35); }
dialog .panel-head { border-bottom: 1px solid var(--line); }
dialog .panel-body { max-height: 70vh; overflow: auto; }

/* ---------- rate card (the one bold piece) ---------- */
.ratecard { width: 100%; border-collapse: collapse; }
.ratecard caption { text-align: left; padding: 16px 18px 6px; font-weight: 600; color: var(--ink); font-size: 15px; }
.ratecard th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 8px 18px; border-bottom: 1px solid var(--line); }
.ratecard td { padding: 9px 18px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; vertical-align: middle; }
.ratecard .grp td { font-weight: 600; color: var(--ink); padding-top: 14px; border-bottom: 0; }
.ratecard .in td:first-child { padding-left: 34px; }
.ratecard .rate { text-align: right; font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ratecard .unit { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ratecard tr.changed td { background: #F1F8FD; }
.ratecard tr.changed .rate { color: var(--blue-deep); }
.was { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-decoration: line-through; }
.std { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.ratecard.edit td { padding: 5px 8px; }
.ratecard.edit td:first-child { padding-left: 18px; }
.ratecard.edit input, .ratecard.edit select { min-height: 34px; padding: 6px 8px; font-size: 14px; }
.ratecard.edit .rate-in { text-align: right; font-weight: 600; width: 110px; font-variant-numeric: tabular-nums; }
.ratecard.edit tr.removed td { opacity: .4; text-decoration: line-through; }
.ratecard.edit .col-group { width: 26%; } .ratecard.edit .col-unit { width: 16%; }
.terms { padding: 14px 18px; font-size: 14px; color: var(--muted); }
.terms li { margin-bottom: 4px; }

/* ---------- sign-in / public ---------- */
.solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.solo-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: 30px; }
.solo-card img { height: 30px; margin-bottom: 22px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

.pub-top { background: var(--ink); color: #fff; }
.pub-top-in { max-width: 760px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-top img { height: 24px; background: #fff; padding: 5px 8px; border-radius: 4px; box-sizing: content-box; }
.pub-top span { font-size: 13px; opacity: .8; text-align: right; }
.pub { max-width: 760px; margin: 0 auto; padding: 24px 20px 80px; }
.pub h1 { font-size: 24px; }
.pub-intro { color: var(--muted); margin: 8px 0 20px; }
.stepnav { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 18px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.stepnav button { font: 500 14px var(--font); background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.stepnav button .n { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #C3CDD8; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.stepnav button.on { color: var(--ink); border-bottom-color: var(--blue); }
.stepnav button.on .n { border-color: var(--blue); color: var(--blue-deep); }
.stepnav button.ok .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step { display: none; }
.step.on { display: block; }
.step-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.doc-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.doc-row:last-child { border-bottom: 0; }
.doc-row strong { color: var(--ink); }
.savestate { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); display: none; }
.toast.bad { background: var(--bad); }
.toast.show { display: block; }
.uploading { opacity: .6; pointer-events: none; }

@media (max-width: 980px) {
  .dash-cols, .detail-cols { grid-template-columns: 1fr; }
  .brand span { display: none; }
}
@media (max-width: 720px) {
  .topbar-in { gap: 12px; padding: 0 14px; }
  .who .name { display: none; }
  .wrap { padding: 20px 14px 48px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 0; }
  .steps { flex-direction: column; }
  .steps li { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .filters input[type=search] { width: 100%; }
  /* tables restack as rows of label/value */
  table.list.stack thead { display: none; }
  table.list.stack tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
  table.list.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  table.list.stack td::before { content: attr(data-l); color: var(--muted); font-size: 12.5px; text-align: left; }
  table.list.stack td.primary-cell { display: block; text-align: left; }
  table.list.stack td.primary-cell::before { content: none; }
  .ratecard td, .ratecard th { padding-left: 12px; padding-right: 12px; }
  .ratecard .in td:first-child { padding-left: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.field-err { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.sigbox.need { border-color: var(--bad); }
.more-activity > summary { padding: 11px 18px; cursor: pointer; color: var(--blue-deep); font-size: 13.5px; border-top: 1px solid var(--line-soft); list-style: none; }
.more-activity > summary::-webkit-details-marker { display: none; }
.more-activity > summary:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.agreement h3 { font-size: 14px; color: var(--ink); margin: 18px 0 6px; }
.agreement h3:first-child { margin-top: 0; }
.agreement .clauses { margin: 0 0 4px; padding-left: 26px; }
.agreement .clauses li { margin: 0 0 7px; line-height: 1.55; }
.tick.waiting { color: var(--muted); }

/* --- phones: the rate editor becomes a stack of cards ---------------------- */
@media (max-width: 720px) {
  table.ratecard.edit, table.ratecard.edit tbody, table.ratecard.edit tr, table.ratecard.edit td { display: block; width: auto; }
  table.ratecard.edit thead { display: none; }
  table.ratecard.edit tr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    margin: 0 12px 10px; background: var(--paper); }
  table.ratecard.edit td { border: 0; padding: 5px 0; display: flex; align-items: center; gap: 10px; }
  table.ratecard.edit td::before { content: attr(data-l); flex: 0 0 96px; color: var(--muted); font-size: 12.5px; }
  table.ratecard.edit td[data-l=""]::before { display: none; }
  table.ratecard.edit td input, table.ratecard.edit td select { flex: 1; min-width: 0; }
  table.ratecard.edit td[data-l="Rate (ex GST)"] { flex-wrap: wrap; text-align: left !important; }
  table.ratecard.edit td[data-l="Rate (ex GST)"] input { width: auto !important; margin-top: 0 !important; }
  table.ratecard.edit .std { flex: 1 0 100%; padding-left: 106px; }
  table.ratecard.edit .rm-cell { justify-content: flex-end; }
  .table-scroll { overflow-x: visible; }
}

/* --- phone-first: menu, tap targets, sheets --------------------------------- */
.navmenu { display: none; position: relative; }
.navmenu > summary { list-style: none; cursor: pointer; width: 44px; height: 44px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 10px; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.navmenu[open] > summary span:first-child { transform: translateY(7px) rotate(45deg); }
.navmenu[open] > summary span:nth-child(2) { opacity: 0; }
.navmenu[open] > summary span:last-child { transform: translateY(-7px) rotate(-45deg); }
.navmenu nav { position: absolute; left: -10px; top: 52px; z-index: 40; width: 74vw; max-width: 300px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 18px 50px rgba(19,41,75,.22); }
.navmenu nav a { display: block; padding: 13px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-weight: 500; }
.navmenu nav a.on { background: var(--tint); color: var(--blue-deep); }
.navwho { padding: 12px; margin-top: 4px; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .navmenu { display: block; }
  .topbar .nav, .who { display: none; }
  .topbar-in { justify-content: flex-start; gap: 6px; }
  .brand { margin-right: auto; }

  /* thumb-sized controls, and 16px inputs so iOS doesn't zoom on focus */
  .btn { min-height: 44px; padding: 11px 16px; font-size: 15px; }
  .btn.small { min-height: 38px; font-size: 14px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 96px; }
  .tick input[type=checkbox] { width: 22px; height: 22px; }

  /* page actions go full width instead of squeezing onto one line */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head .actions > * { width: 100%; }
  .panel-foot.actions .btn { flex: 1 1 100%; }

  /* dialogs become bottom sheets */
  dialog { width: 100vw; max-width: 100vw; margin: 0; position: fixed; bottom: 0; top: auto;
    border-radius: 16px 16px 0 0; max-height: 92vh; }
  dialog .panel-body { max-height: 60vh; }
  dialog .sigbox { height: 190px; }

  /* filters scroll as a strip rather than wrapping into a block */
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .seg, .filters select, .filters button { flex: 0 0 auto; }
  .filters .seg { overflow: visible; }
  .filters input[type=search] { flex: 1 0 60%; }

  /* a photo of the document beside each row, so review works on a phone */
  .doc-thumb { display: block; }
  /* stacked cells are flex, so stop pills being squeezed into circles */
  table.list.stack td .pill { flex: 0 0 auto; white-space: nowrap; }
  table.list.stack td { align-items: flex-start; }
}
.doc-thumb { width: 100%; max-width: 260px; margin: 6px 0 2px;
  border: 1px solid var(--line); border-radius: 8px; }
@media (min-width: 721px) { .doc-thumb { display: none; } }

/* Editable settings tables stack too, so the fields stay tappable */
@media (max-width: 720px) {
  #copies, #copies tbody, #copies tr, #copies td,
  #people-add, #people-add tbody, #people-add tr, #people-add td { display: block; width: auto; }
  #copies thead, #people-add thead { display: none; }
  #copies tr, #people-add tr { border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 10px; }
  #copies td, #people-add td { border: 0; padding: 4px 0; }
  #copies td:last-child, #people-add td:last-child { text-align: right; }
}

/* rate reading: quoted source text and low-confidence rows */
.quote { color: var(--muted); font-style: italic; font-size: 13px; }
tr.low-conf { background: #FFFBF2; }
.pill.warn { background: #FCEFD6; color: #8A5A08; }
.tick.big { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; line-height: 1.5; }
.tick.big input { margin-top: 3px; }

/* Waiting screen for slow jobs (pack build + email) */
.busy-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(12, 29, 55, .45); padding: 16px; }
.busy-box { background: #fff; border-radius: 12px; padding: 24px 28px; max-width: 360px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.busy-box b { display: block; font-size: 16px; margin-top: 12px; }
.busy-box p { margin: 6px 0 0; color: #5b6475; font-size: 14px; }
.busy-spin { width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; border: 4px solid #d8dee8; border-top-color: #088AC2; animation: busy-rot .8s linear infinite; }
@keyframes busy-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spin { animation-duration: 2.4s; } }
