:root {
  /* 4You Accounting & Taxation (4you.net.au) - the same tokens as 4You Signing */
  --brand: #c42a2a;
  --brand-strong: #a02020;
  --brand-soft: #fdf0f0;
  --brand-line: #f3c9c9;
  --info: #1d4ed8;
  --info-soft: #eff4ff;
  --info-line: #c7d6fe;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --line: #e4e7ee;
  --line-strong: #d1d6e0;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --ok-line: #bfe3cb;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --warn-line: #f2d7a6;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --violet: #6d28d9;
  --violet-soft: #f3effe;
  --muted-soft: #eef0f4;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 1px 3px rgb(16 24 40 / 6%);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / 14%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }

/* ── top bar ── */
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.topbar .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.topbar .logo img { height: 30px; }
.topbar .logo span { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a { text-decoration: none; color: var(--text-2); padding: 7px 11px; border-radius: var(--radius-sm); font-weight: 550; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.topbar nav a:hover { background: var(--muted-soft); color: var(--text); }
.topbar nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.topbar .count { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 650; }
.topbar .me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 650; }

/* ── buttons and inputs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--muted-soft); }
.btn.danger { color: var(--bad); }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 28px; padding: 0; }
.input, select.input, textarea.input { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); outline: none; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

/* ── badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 9px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge.preparing { background: var(--muted-soft); color: var(--text-2); }
.badge.in_review { background: var(--info-soft); color: var(--info); }
.badge.approved { background: var(--violet-soft); color: var(--violet); }
.badge.with_client { background: var(--warn-soft); color: var(--warn); }
.badge.to_lodge { background: var(--brand-soft); color: var(--brand-strong); }
.badge.to_file { background: var(--violet-soft); color: var(--violet); }
.badge.filed { background: var(--ok-soft); color: var(--ok); }
.badge.notes { background: var(--warn-soft); color: var(--warn); }
.chip { font-size: 10.5px; padding: 1px 6px; border-radius: 99px; font-weight: 650; background: var(--muted-soft); color: var(--text-2); }
.chip.scan { background: var(--warn-soft); color: var(--warn); }
.chip.digital { background: var(--info-soft); color: var(--info); }
.chip.signed { background: var(--ok-soft); color: var(--ok); }

/* ── page ── */
.page { max-width: 1280px; margin: 0 auto; padding: 22px 20px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.015em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.tabs { display: flex; gap: 2px; background: var(--muted-soft); padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs .n { font-size: 11px; color: var(--text-3); }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-weight: 650; white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover td { background: var(--surface-2); }
table.list tr:last-child td { border-bottom: 0; }
.progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar { flex: 1; height: 6px; background: var(--muted-soft); border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .done { background: var(--info); }
.bar .rev { background: var(--ok); }
.empty { text-align: center; color: var(--text-3); padding: 48px 16px; }
.refund { color: var(--ok); font-weight: 650; }
.payable { color: var(--bad); font-weight: 650; }

/* ── job workspace ── */
.ws { display: grid; grid-template-columns: 270px minmax(0, 1fr) 400px; height: calc(100vh - 56px); }
.ws.no-docs { grid-template-columns: 270px minmax(0, 1fr) 0; }
.ws-nav { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px 30px; }
.ws-main { overflow-y: auto; }
.ws-docs { background: var(--surface); border-left: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.job-head { padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.job-head .client { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.job-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); font-weight: 700; padding: 12px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); border: 0; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-soft); }
.nav-item .code { font-size: 10.5px; color: var(--text-3); font-weight: 650; min-width: 26px; }
.nav-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .amt { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav-item.na { color: var(--text-3); }
.state { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 10px; color: #fff; font-weight: 800; }
.state.done { background: var(--info); border-color: var(--info); }
.state.reviewed { background: var(--ok); border-color: var(--ok); }
.state.na { border-style: dashed; }
.dot-note { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }

.stagebar { display: flex; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 22px; align-items: center; position: sticky; top: 0; z-index: 5; }
.stage { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.stage .n { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; }
.stage.done { color: var(--ok); }
.stage.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.stage.now { color: var(--brand-strong); }
.stage.now .n { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.stage-sep { flex: 0 0 26px; height: 1.5px; background: var(--line-strong); margin: 0 8px; }
.stagebar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.sheet { padding: 20px 22px 60px; max-width: 1100px; }
.sheet-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.sheet-head .code { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 2px 7px; margin-right: 6px; vertical-align: 2px; }
.signoff { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.signoff b { color: var(--text-2); font-weight: 600; }
.hint { background: var(--info-soft); border: 1px solid var(--info-line); color: #1e3a8a; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }
.notice { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: #78350f; }
.notice.ok { background: var(--ok-soft); border: 1px solid var(--ok-line); color: #14532d; }
.notice.bad { background: var(--bad-soft); border: 1px solid var(--brand-line); color: #7f1d1d; }
.notice.info { background: var(--info-soft); border: 1px solid var(--info-line); color: #1e3a8a; }

/* the schedule */
table.sched { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.sched th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); text-align: left; padding: 8px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 650; white-space: nowrap; }
table.sched th.num { text-align: right; }
table.sched td { border-bottom: 1px solid var(--line); padding: 4px 6px; vertical-align: middle; }
table.sched tfoot td { font-weight: 700; background: var(--surface-2); padding: 9px 8px; border-bottom: 0; }
table.sched input.cell { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 6px 6px; outline: none; }
table.sched input.cell:hover { border-color: var(--line); }
table.sched input.cell:focus { border-color: var(--info); background: #fff; box-shadow: 0 0 0 3px var(--info-soft); }
table.sched input.cell.money, table.sched input.cell.number { text-align: right; font-variant-numeric: tabular-nums; }
table.sched .calc { padding: 6px; color: var(--text-2); font-variant-numeric: tabular-nums; }
table.sched tr.ticked td { background: #fbfefc; }
table.sched tr.flagged td { background: #fffbeb; }
.source { display: flex; align-items: center; gap: 4px; min-width: 190px; }
.source select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 4px; background: #fff; max-width: 150px; font-size: 12.5px; }
.source input { width: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 4px; text-align: center; font-size: 12.5px; }
.source .open { border: 0; background: none; color: var(--info); cursor: pointer; padding: 2px 4px; font-size: 12px; }
.tick { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: #fff; cursor: pointer; display: grid; place-items: center; color: transparent; font-weight: 900; }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick:disabled { cursor: default; }
.add-line { margin-top: 8px; }

.checklist .item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.checklist .item:last-child { border-bottom: 0; }
.checklist .who { font-size: 11.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

.section-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.section-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* review notes */
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.rnote { border: 1px solid var(--warn-line); background: #fffcf5; border-radius: var(--radius-sm); padding: 10px 12px; }
.rnote.cleared { border-color: var(--line); background: var(--surface-2); opacity: 0.8; }
.rnote .meta { font-size: 11.5px; color: var(--text-3); }
.rnote .body { margin: 3px 0 6px; white-space: pre-wrap; }
.rnote .answer { border-left: 3px solid var(--info-line); padding-left: 10px; margin: 6px 0; white-space: pre-wrap; }

/* overview */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.figures { width: 100%; border-collapse: collapse; }
.figures td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.figures tr:last-child td { border-bottom: 0; font-weight: 700; }
.applies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.applies .check { font-size: 13px; }
.applies .group { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; margin-top: 8px; }
.history { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.history .when { font-size: 11px; color: var(--text-3); }

/* documents panel */
.docs-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.docs-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.docs-list { overflow-y: auto; padding: 10px; flex: 0 1 auto; max-height: 45%; display: flex; flex-direction: column; gap: 4px; }
.docs-list.full { max-height: none; flex: 1; }
.doc { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px; background: var(--surface); }
.doc:hover { border-color: var(--line-strong); }
.doc.active { border-color: var(--info); background: var(--info-soft); }
.doc.old { opacity: 0.55; }
.doc .ico { width: 26px; height: 30px; border-radius: 4px; background: var(--bad-soft); color: var(--bad); font-size: 9px; font-weight: 800; display: grid; place-items: center; flex: none; }
.doc .ico.img { background: var(--info-soft); color: var(--info); }
.doc .name { flex: 1; min-width: 0; }
.doc .name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .name span { font-size: 11px; color: var(--text-3); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 8px; padding: 12px; text-align: center; color: var(--text-3); font-size: 12.5px; cursor: pointer; margin: 10px; }
.drop:hover, .drop.over { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.viewer { flex: 1; border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.viewer iframe, .viewer .imgwrap { flex: 1; border: 0; width: 100%; min-height: 0; background: #e5e7eb; }
.viewer .imgwrap { overflow: auto; display: flex; align-items: flex-start; justify-content: center; }
.viewer .imgwrap img { max-width: 100%; }

/* dialogs */
.dialog-backdrop { position: fixed; inset: 0; background: rgb(17 24 39 / 38%); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.dialog header { padding: 16px 20px 0; font-weight: 700; font-size: 16px; }
.dialog .body { padding: 14px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog footer { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.dialog .error { color: var(--bad); font-size: 12.5px; margin-right: auto; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-cards label { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; display: flex; gap: 8px; cursor: pointer; font-size: 13px; }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-cards small { display: block; color: var(--text-3); font-size: 11.5px; }
.preview-mail { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 13px; }
.preview-mail .subject { font-weight: 700; margin-bottom: 6px; }
.preview-mail .msg { white-space: pre-wrap; color: var(--text-2); }
.picker { border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow-y: auto; }
.picker button { display: flex; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.picker button:hover { background: var(--surface-2); }
.picker button:last-child { border-bottom: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login img { height: 44px; margin: 0 auto; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); max-width: 380px; }
.toast.bad { background: var(--bad); }

@media (max-width: 1180px) { .ws { grid-template-columns: 240px minmax(0, 1fr) 340px; } }
@media (max-width: 920px) {
  .ws { grid-template-columns: 1fr; height: auto; }
  .ws-nav, .ws-docs { border: 0; }
  .grid2, .fields, .applies { grid-template-columns: 1fr; }
  .topbar nav a span.label { display: none; }
}
.stagebar { flex-wrap: wrap; row-gap: 8px; padding: 10px 18px; }
.stage-sep { flex-basis: 14px; margin: 0 5px; }
.sched-wrap { overflow-x: auto; border-radius: var(--radius); }
table.sched td.c-text { min-width: 170px; }
table.sched td.c-money, table.sched td.c-number { min-width: 96px; }
table.sched td.c-number { min-width: 70px; }
.source { min-width: 0; }
.source select { max-width: 132px; }
table.sched tr.has-sub td { border-bottom: 0; }
table.sched tr.sub td { padding: 0 8px 8px; }
table.sched tr.sub .source span { margin-right: 4px; }

/* ── 0.2: a job is its pages ── */
.ws { grid-template-columns: 250px minmax(0, 1fr); }
.state.part { border-color: var(--info); background: linear-gradient(90deg, var(--info-soft) 50%, transparent 50%); }
.nav-soon { margin: 18px 8px 0; font-size: 11.5px; color: var(--text-3); border-top: 1px dashed var(--line); padding-top: 10px; }
.sheet { max-width: 1200px; }
.h3 { font-size: 14px; margin-bottom: 8px; }
.have { color: var(--ok); font-weight: 600; }
.missing { color: var(--text-3); text-decoration: line-through; }

.checklist { margin-bottom: 14px; }
.checklist .group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; padding: 12px 14px 6px; border-bottom: 1px solid var(--line); }
.checklist .item { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.checklist .item:last-child { border-bottom: 0; }
.checklist .item input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); flex: none; cursor: pointer; }
.checklist .item.done .label { color: var(--text-2); }
.checklist .item.flagged { background: #fffbeb; }
.checklist .label { font-size: 13.5px; }
.checklist .who { font-size: 11.5px; color: var(--text-3); white-space: nowrap; text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.note-input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: 3px 0 0 -6px; font-size: 12.5px; color: var(--text-2); resize: none; overflow: hidden; background: transparent; min-height: 26px; line-height: 1.4; }
.note-input:hover { border-color: var(--line); }
.note-input:focus { border-color: var(--info); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--info-soft); color: var(--text); }
.note-input:disabled { border-color: transparent; }
.link { background: none; border: 0; color: var(--info); cursor: pointer; font-size: 12px; padding: 0; }

.drop.compact { padding: 9px; margin: 0 0 14px; }
.drop { margin: 0 0 14px; }
.docs-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.doc-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 2px; }
.doc { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px; background: var(--surface); }
.doc.active { border-color: var(--info); background: var(--info-soft); }
.doc.dragging { opacity: 0.4; }
.doc.over { border-color: var(--brand); box-shadow: 0 -2px 0 var(--brand); }
.doc .grip { color: var(--text-3); cursor: grab; font-size: 11px; letter-spacing: -2px; }
.doc .n { font-size: 11px; color: var(--text-3); min-width: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.doc .thumb { width: 30px; height: 38px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); flex: none; }
.doc .ico { width: 30px; height: 38px; border-radius: 3px; background: var(--bad-soft); color: var(--bad); font-size: 9px; font-weight: 800; display: grid; place-items: center; flex: none; }
.viewer-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; font-size: 13px; }
.viewer-tools b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 120px; }
.viewer { border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; background: #e5e7eb; height: calc(100vh - 300px); min-height: 420px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.viewer.tall { border-radius: var(--radius); height: calc(100vh - 250px); }
.viewer iframe { flex: 1; border: 0; width: 100%; }
.viewer .imgwrap { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 12px; }
.viewer .imgwrap img { max-width: 100%; max-height: 100%; box-shadow: var(--shadow-lg); transition: transform 0.15s; }
.viewer .imgwrap img.rot90, .viewer .imgwrap img.rot270 { max-width: calc(100vh - 340px); max-height: none; }
.rot90 { transform: rotate(90deg); }
.rot180 { transform: rotate(180deg); }
.rot270 { transform: rotate(270deg); }
.qr { width: 240px; height: 240px; margin: 4px auto; }
.qr svg { width: 100%; height: 100%; }
@media (max-width: 1100px) { .docs-split { grid-template-columns: 1fr; } .doc-list { max-height: 260px; } }
.checklist .item { padding: 7px 14px; }
.checklist .item .add-note { opacity: 0; }
.checklist .item:hover .add-note, .checklist .item .add-note:focus { opacity: 1; }
@media (hover: none) { .checklist .item .add-note { opacity: 1; } }

/* Motor vehicle worksheet */
.vehicle { margin-bottom: 16px; }
.vehicle-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.vehicle-head .name { font-weight: 650; max-width: 280px; }
.vehicle-head .rego { max-width: 110px; }
.vehicle-head .claim { font-size: 15px; white-space: nowrap; }
.vehicle-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vehicle-body > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.vehicle-body > div:last-child { border-right: 0; }
.vehicle-body h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 6px; }
table.calc { width: 100%; border-collapse: collapse; }
table.calc td { padding: 3px 0; font-size: 13px; vertical-align: middle; }
table.calc td.num { padding-left: 8px; }
table.calc .input { height: 30px; }
table.calc .input.num { width: 110px; text-align: right; }
table.calc .input.date { width: 140px; }
table.calc tr.total td { font-weight: 700; border-top: 1px solid var(--line); padding-top: 7px; }
.vehicle-new { display: grid; grid-template-columns: 2fr 1fr 1.4fr 1fr 1.2fr auto; gap: 8px; align-items: center; }
table.fuel-prices .input.num { width: 80px; height: 28px; text-align: right; }
@media (max-width: 900px) {
  .vehicle-body { grid-template-columns: 1fr; }
  .vehicle-body > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .vehicle-new { grid-template-columns: 1fr 1fr; }
}
.car-pick { display: inline-flex; align-items: center; gap: 6px; }
.link.danger { color: var(--bad); }
table.car-history tr.car td { background: var(--surface-2); cursor: default; }
table.car-history tr.current td { background: var(--info-soft); }
