:root {
  --ink: #0b0d0c; --shell: #121614; --panel: #181d1a; --panel2: #1f2622; --line: #2c3530; --text: #eef2ef; --muted: #9aa7a0;
  --green: #3ccf5a; --green-d: #1f9a3a; --green-bg: #12301c; --amber: #ffc94a; --amber-bg: #3a2e0e; --red: #ff6b5e; --red-bg: #3b1714;
  --blue: #7cc4ff; --blue-bg: #13283a; --paper: #f7f7f3; --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
[hidden] { display: none !important; }
h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
h4 { margin: .6rem 0 .3rem; font-size: .95rem; }
code { font-size: .78rem; color: var(--muted); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .55rem 1rem;
  padding-top: calc(.55rem + env(safe-area-inset-top)); background: #050605; border-bottom: 2px solid var(--green-d); }
.brand { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.wordmark { font-weight: 900; letter-spacing: .06em; font-size: 1.15rem; color: #fff; }
.wordmark b { color: var(--green); margin-left: .3em; }
.product { color: var(--muted); font-weight: 600; }
.seg { display: flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.seg button { border: 0; background: none; padding: .35rem .8rem; border-radius: 99px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--green); color: #04110a; }
.bar-right { display: flex; align-items: center; gap: .4rem; }
.sync { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: .3rem .7rem; font-size: .8rem; cursor: pointer; max-width: 16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync::before { content: "●"; margin-right: .35rem; }
.sync.ok::before { color: var(--green); } .sync.warn::before { color: var(--amber); } .sync.bad::before { color: var(--red); }
.sync.bad { border-color: var(--red); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-weight: 900; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 2.2rem; width: min(20rem, 88vw); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; display: grid; gap: .6rem; box-shadow: 0 10px 30px #000a; }
.menu-body button { text-align: left; background: none; border: 0; padding: 0; color: var(--red); cursor: pointer; }
.banner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: var(--amber-bg); color: var(--amber); padding: .5rem 1rem; }
.banner button { background: none; border: 1px solid currentColor; border-radius: 6px; cursor: pointer; }

/* generic controls */
button { cursor: pointer; }
.panel button, .toolbar button, .modal button, .failed button, .row button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; min-height: 2.4rem; }
button.primary { background: var(--green); border-color: var(--green); color: #04110a; font-weight: 700; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.accent { border-color: var(--green-d); color: var(--green); font-weight: 600; }
button.ghost, a.ghost { background: none !important; border-color: transparent !important; color: var(--muted); }
a.small { font-size: .85rem; margin-left: auto; }
button.danger { color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.block { width: 100%; margin-top: .6rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.field { display: grid; gap: .2rem; margin: .5rem 0; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.field.inline { display: flex; align-items: center; gap: .4rem; margin: 0; }
input, select, textarea { background: #0f1311; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; min-width: 0; }
.field.inline select { width: auto; max-width: 15rem; }
textarea { resize: vertical; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid4 { display: grid; grid-template-columns: 2fr .8fr .8fr 1.4fr; gap: .4rem; margin-bottom: .4rem; }
.fine { font-size: .78rem; color: var(--muted); margin: .3rem 0; overflow-wrap: anywhere; }
.hint { color: var(--muted); }
.counts { font-size: .85rem; color: var(--green); font-weight: 600; margin: .2rem 0 .6rem; }
.note { background: var(--panel2); border-left: 3px solid var(--blue); padding: .5rem .7rem; border-radius: 6px; margin: .5rem 0; }
.note.warn { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.loading, .empty { color: var(--muted); padding: 2rem 1rem; text-align: center; }
.chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; white-space: nowrap; }
.chip.grey { background: #2a312d; color: #c4cec8; } .chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.amber { background: var(--amber-bg); color: var(--amber); } .chip.red { background: var(--red-bg); color: var(--red); }
.chip.green, .chip.ok { background: var(--green-bg); color: var(--green); }

/* layouts */
main { padding: 1rem; max-width: 1600px; margin: 0 auto; }
.site { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start; }
.review { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1rem; align-items: start; }
.panel, .queue-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; }
.side-col { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow: auto; border-radius: var(--r); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.zoom { display: flex; align-items: center; gap: .3rem; }
.zoom span { font-size: .8rem; color: var(--muted); min-width: 3rem; text-align: center; }

/* drawing */
.plan { background: var(--paper); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 10rem); border: 1px solid var(--line); touch-action: pan-x pan-y; }
.plan.placing { cursor: crosshair; outline: 3px solid var(--green); }
.plan-inner { position: relative; }
.plan-inner img { display: block; width: 100%; height: auto; user-select: none; }
.pin { position: absolute; transform: translate(-50%, -100%); width: 30px; height: 38px; padding: 0; border: 0; background: none; cursor: pointer; }
.pin::before { content: ""; position: absolute; inset: 0 0 8px 0; background: var(--ink); border: 2px solid var(--green); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: 50% 50%; width: 26px; height: 26px; left: 2px; top: 2px; box-shadow: 0 2px 6px #0007; }
.pin span { position: relative; color: #fff; font-weight: 800; font-size: .78rem; display: block; margin-top: -10px; }
.pin i { position: absolute; top: -8px; right: -8px; background: var(--green); color: #04110a; font-style: normal; font-size: .65rem; font-weight: 800; border-radius: 99px; padding: 0 .3rem; }
.pin.sel::before { background: var(--green); border-color: #fff; }
.pin.sel span { color: #04110a; }
.pin.pending::before { border-style: dashed; border-color: var(--amber); }
.loc { margin: 0 0 .8rem; }
.crop { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; position: relative; background: var(--paper); border-radius: 8px; border: 1px solid var(--line); }
.crop-hit { position: absolute; inset: 0; width: 100%; height: 100%; background: none; border: 0; cursor: zoom-in; }
.crop-inner { position: relative; }
.crop-inner img { width: 100%; display: block; }
.loc figcaption { font-size: .8rem; color: var(--muted); margin-top: .3rem; overflow-wrap: anywhere; }

/* lists & queues */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.list button { width: 100%; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }
.list button.sel { border-color: var(--green); }
.list b { flex: 1 1 100%; }
.list small { color: var(--muted); flex: 1 1 100%; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.tabs button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: .3rem .7rem; color: var(--muted); font-size: .85rem; }
.tabs button[aria-selected="true"] { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.back { display: none; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.photo { margin: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo.pending { border-color: var(--amber); }
.photo-open { display: block; width: 100%; padding: 0 !important; border: 0 !important; background: none !important; }
.photo-wrap { position: relative; line-height: 0; }
.photo-wrap img { width: 100%; height: auto; display: block; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo figcaption { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; padding: .4rem; font-size: .75rem; }
.acts { display: flex; gap: .3rem; width: 100%; }
.acts button { flex: 1; min-height: 2rem; padding: .2rem .4rem; font-size: .8rem; }
.sheet .photo { max-width: 100%; }
.editing { touch-action: none; user-select: none; }
.editing .overlay { cursor: crosshair; }
.mark.sel { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 2px #3ccf5a); }
.tools { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tools button[aria-pressed="true"] { background: var(--green); color: #04110a; border-color: var(--green); }
.swatches { display: flex; gap: .3rem; }
.swatch { width: 2rem; min-height: 2rem !important; padding: 0 !important; border-radius: 50% !important; border: 2px solid var(--line) !important; }
.swatch[aria-pressed="true"] { border-color: #fff !important; }

/* office / qs */
.evidence { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; }
.form { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .4rem; }
.cats { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.cats legend { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.cat, .dec { position: relative; display: grid; gap: .2rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem; cursor: pointer; }
.cat input, .dec input { position: absolute; opacity: 0; pointer-events: none; }
.cat small { color: var(--muted); }
.cat.on, .dec.on { border-color: var(--green); background: var(--green-bg); }
.cat:focus-within, .dec:focus-within { outline: 2px solid var(--green); }
.decisions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.dec { text-align: center; font-weight: 700; }
.dec.on.decline, .dec.on.return, .dec.on.query { border-color: var(--amber); background: var(--amber-bg); }
.proposal { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; margin: .5rem 0; }
.proposal.current { border-color: var(--green-d); }
.proposal header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.proposal header small { color: var(--muted); margin-left: auto; }
.proposal dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .5rem 0; font-size: .9rem; }
.proposal dt { color: var(--muted); }
.proposal dd { margin: 0; }
.labour { width: 100%; border-collapse: collapse; font-size: .85rem; }
.labour th, .labour td { text-align: left; border-bottom: 1px solid var(--line); padding: .25rem; }
.review-note { border-left: 3px solid var(--green); padding: .4rem .6rem; margin-top: .5rem; background: #0f1311; border-radius: 6px; }
.review-note.query, .review-note.return, .review-note.decline { border-color: var(--amber); }
.review-note p { margin: .3rem 0 0; }
.versions summary, .history summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-top: 1rem; }
.history ol { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .3rem; font-size: .82rem; }
.history li { display: flex; flex-wrap: wrap; gap: .2rem .6rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.history time { color: var(--muted); min-width: 9rem; }
.history .who { color: var(--green); min-width: 7rem; }
.history small { color: var(--muted); flex: 1 1 100%; overflow-wrap: anywhere; }
.failed { background: var(--red-bg); border: 1px solid var(--red); border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1rem; }
.failed-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.failed-row span { flex: 1 1 14rem; overflow-wrap: anywhere; }
.sticky { position: sticky; bottom: 0; background: var(--panel); padding: .5rem 0; margin-bottom: 0; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.scrim { position: absolute; inset: 0; background: #000c; }
.sheet { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; width: min(30rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; }
.sheet.wide { width: min(70rem, 100%); }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.close { font-size: 1.4rem; line-height: 1; min-height: 2.4rem; min-width: 2.4rem; }
.editor .photo-wrap { max-height: 65vh; }
.editor .photo-wrap img { max-height: 65vh; width: auto; max-width: 100%; margin: 0 auto; }
.editor .photo-wrap { width: fit-content; max-width: 100%; margin: .5rem auto; }

@media (max-width: 1000px) {
  .site, .review { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; max-height: none; }
  .plan { max-height: 60vh; }
  .review .queue-col.has-detail { display: none; }
  .back { display: inline-block; }
  .evidence { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main { padding: .6rem; }
  .bar { padding-left: .6rem; padding-right: .6rem; }
  .seg { flex: 1; }
  .seg button { flex: 1; padding: .4rem .3rem; }
  .bar-right { margin-left: auto; }
  .sync { max-width: 11rem; }
  .cats { grid-template-columns: minmax(0, 1fr); }
  .decisions { grid-template-columns: 1fr 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .field.inline select { max-width: 11rem; }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .product { display: none; }
  .sync { max-width: 8.5rem; }
}
.crop .crop-hit { background: transparent !important; border: 0 !important; min-height: 0 !important; padding: 0 !important; }
button.ghost { white-space: nowrap; }
.evd { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.evd summary { cursor: pointer; }
.evd ul { margin: .3rem 0; padding-left: 1rem; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }

/* ---- working product: navigation, landing, admin, earlier records ---- */
.nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto; min-width: 0; }
.proj select { max-width: 16rem; background: var(--panel2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sync.idle::before { color: var(--muted); }
.menu-body a { color: var(--green); }
.menu-body p { margin: 0; }
.hero { max-width: 44rem; margin: 2rem auto; padding: 0 .2rem; }
.hero h1 { font-size: 2rem; margin: 0 0 .3rem; }
.hero .lead { font-size: 1.1rem; color: var(--muted); }
.hero .primary { padding: .6rem 1.1rem; border-radius: 8px; border: 0; min-height: 2.6rem; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; counter-reset: s; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 8px; padding: .6rem .7rem; font-size: .9rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin: 1rem 0; }
.card h2, .card h3 { margin-top: 0; }
.card button, .card select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; min-height: 2.4rem; }
.card button.primary { background: var(--green); border-color: var(--green); color: #04110a; }
.legacy { border-color: var(--amber); }
.admin .card { background: var(--panel2); }
.members { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .4rem; }
.members li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.roles { display: flex; flex-wrap: wrap; gap: .6rem; }
.check { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; }
.check input { width: auto; }
.history-list { list-style: none; padding: 0; display: grid; gap: .3rem; font-size: .85rem; }
.history-list li { display: flex; flex-wrap: wrap; gap: .6rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.history-list time { color: var(--muted); min-width: 9rem; }
.history-list .who { color: var(--green); }
.rec-list { display: grid; gap: .6rem; }
.rec { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; }
.rec header { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.rec p { margin: .35rem 0; overflow-wrap: anywhere; }
.rec .photos { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
@media (max-width: 640px) {
  .nav { order: 3; width: 100%; margin-left: 0; }
  .proj { flex: 1 1 100%; }
  .proj select { max-width: 100%; width: 100%; }
  .nav .seg { flex: 1 1 100%; overflow-x: auto; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.6rem; }
}
.pre { white-space: pre-line; }
.carry { display: block; margin-bottom: .8rem; }
.carry button { margin-left: .5rem; }

/* ---- capture choices, unlocated records, office evidence, dayworks figures, site works sheets ---- */
.flow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: stretch; margin: 0 0 .8rem; }
.flow > button, .flow .step { display: grid; gap: 0; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .35rem .7rem; font-size: .8rem; color: var(--muted); min-height: 0; }
.flow > button b, .flow .step b { color: var(--text); font-size: .85rem; }
.flow > button.on { border-color: var(--green); background: var(--green-bg); }
.flow > button.on b { color: var(--green); }
.flow .acting { margin-left: auto; align-self: center; font-size: .8rem; color: var(--green); font-weight: 600; }
.choices { display: grid; gap: .5rem; margin: .6rem 0 1rem; }
.choices.two { grid-template-columns: 1fr 1fr; }
button.big { display: grid; gap: .15rem; text-align: left; padding: .8rem .9rem !important; min-height: 4rem !important; font-weight: 700; font-size: 1rem; }
button.big small { font-weight: 400; font-size: .78rem; opacity: .85; }
button.primary.big small { color: #04110a; }
.note.unlocated { border-color: var(--amber); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.note.unlocated button { margin-left: auto; }
.empty-plan { min-height: 12rem; }
.account { border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem .5rem; margin: .7rem 0; }
.account legend { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 .3rem; }
.with-btn { display: flex; gap: .3rem; align-items: center; }
.with-btn input { flex: 1; }
button.small-btn { min-height: 2.2rem !important; padding: .2rem .5rem !important; font-size: .8rem; color: var(--green) !important; }
.account-view dl, .totals-dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .3rem 0; font-size: .9rem; }
.account-view dt, .totals-dl dt { color: var(--muted); }
.account-view dd, .totals-dl dd { margin: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.office-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .8rem; }
.office-cards .card, .sheets { background: var(--panel2); margin: .6rem 0 0; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.doc { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.doc.pending { border-color: var(--amber); }
.doc img { width: 100%; height: 7rem; object-fit: cover; display: block; background: var(--paper); }
.pdf-tile { display: grid; place-items: center; height: 7rem; background: var(--paper); color: #a11; font-weight: 900; font-size: 1.4rem; text-decoration: none; }
.doc figcaption { display: grid; gap: .1rem; padding: .4rem; font-size: .78rem; overflow-wrap: anywhere; }
.doc figcaption small { color: var(--muted); }
.doc-add { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .3rem; }
.unit-field { display: flex; align-items: center; gap: .3rem; }
.unit-field input { flex: 1; min-width: 0; }
.unit { color: var(--muted); font-size: .82rem; white-space: nowrap; font-weight: 600; }
.lab-head, .lab-row, .mat-row { display: grid; grid-template-columns: minmax(8rem, 2fr) 5.5rem 7.5rem 9rem 6.5rem 2.4rem; gap: .4rem; align-items: center; }
.lab-head { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.lab-row, .mat-row { margin-bottom: .4rem; }
.cell { display: grid; gap: .1rem; min-width: 0; }
.cell-label { display: none; font-size: .72rem; color: var(--muted); font-weight: 600; }
.cell.total output { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.neg { color: var(--red) !important; }
button.row-x { min-height: 2.2rem !important; padding: 0 !important; }
.totals { display: grid; gap: .25rem; background: #0f1311; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; max-width: 28rem; margin-left: auto; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.totals .calc { border-top: 1px solid var(--line); padding-top: .25rem; }
.totals .grand { border-top: 2px solid var(--green-d); padding-top: .3rem; font-size: 1.05rem; }
.totals .grand b { color: var(--green); }
.override summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.labour td.n, .labour th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.labour tr.sub td { font-weight: 700; }
.totals-dl dd.grand { font-weight: 800; color: var(--green); }
.tablewrap { overflow-x: auto; }
.pick-list { list-style: none; padding: 0; margin: .3rem 0 .8rem; display: grid; gap: .4rem; }
.pick-list button, .pick-done { width: 100%; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .4rem; }
.pick-list button > span, .pick-done > span { display: grid; gap: .1rem; min-width: 0; }
.pick-list small { color: var(--muted); overflow-wrap: anywhere; }
.pick-done { opacity: .75; }
.thumb { width: 4.5rem; height: 3.4rem; object-fit: cover; border-radius: 6px; background: var(--paper); display: grid; place-items: center; font-size: .65rem; color: #555; }
.sheet-frame { width: 100%; height: min(70vh, 48rem); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sheet-frame.short { height: min(38vh, 22rem); }
.sigpad { display: block; width: 100%; height: 11rem; background: #fff; border: 2px dashed var(--green-d); border-radius: 8px; touch-action: none; margin: .5rem 0; cursor: crosshair; }
.signing .statement { background: var(--panel2); border-left: 3px solid var(--green); padding: .5rem .7rem; border-radius: 6px; }
.check.confirm { margin: .5rem 0; font-weight: 600; align-items: flex-start; }
.check.confirm input { margin-top: .2rem; }
a.ghost { text-decoration: none; padding: .45rem .3rem; }
@media (max-width: 1000px) {
  .office-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .lab-head { display: none; }
  .lab-row, .mat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
  .cell-label { display: block; }
  .cell.trade { grid-column: 1 / -1; }
  .cell.total { align-self: end; }
  button.row-x { justify-self: end; align-self: end; }
  .choices.two { grid-template-columns: minmax(0, 1fr); }
  .flow .acting { margin-left: 0; flex: 1 1 100%; }
  .flow > button, .flow .step { flex: 1 1 40%; }
}
