/* Pentagon Envisioned Operations — white, black and red; readable on small phones */
:root {
  --red: #C41E2A; --red-dark: #9E1620; --red-soft: #FCEDEE;
  --ink: #111111; --muted: #5A5A5A; --line: #E4E4E4; --soft: #F6F6F6; --bg: #FFFFFF;
  --ok: #1E7B34; --ok-soft: #E8F4EB; --warn: #8A5200; --warn-soft: #FFF4E0; --info: #1F5FBF; --info-soft: #EAF1FC;
  --purple: #6B3FA0; --purple-soft: #F1EBF8;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --nav-w: 236px; --top-h: 58px; --bottom-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--red-dark); }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 0 0 10px; } h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.wordmark { display: flex; flex-direction: column; line-height: 1; text-decoration: none; }
.wordmark b { color: var(--red); letter-spacing: 2px; font-size: 17px; }
.wordmark span { color: var(--ink); letter-spacing: 4.5px; font-size: 10.5px; margin-top: 2px; }
.top .spacer { flex: 1; }
.env-badge { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 3px 8px; }
.icon-btn { position: relative; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; padding: 0 12px; color: var(--ink); text-decoration: none; }
.icon-btn .count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.side { width: var(--nav-w); flex: none; border-right: 1px solid var(--line); padding: 12px 10px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; min-height: 44px; }
.side a:hover { background: var(--soft); }
.side a.active { background: var(--red-soft); color: var(--red-dark); box-shadow: inset 3px 0 0 var(--red); }
.side .who { margin-top: 14px; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
main { flex: 1; min-width: 0; padding: 20px 24px 40px; max-width: 1280px; }
.bottom { display: none; }
.offline { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 14px; border-bottom: 1px solid #f0d9b0; }

@media (max-width: 899px) {
  .side { display: none; }
  main { padding: 14px 16px calc(var(--bottom-h) + 24px); }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); text-decoration: none; background: none; border: 0; font-family: inherit; }
  .bottom a .ic, .bottom button .ic { font-size: 20px; line-height: 1; }
  .bottom a.active { color: var(--red); font-weight: 700; }
  .top .who-top { display: none; }
}
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: flex; justify-content: flex-end; }
.drawer nav { width: min(320px, 86vw); height: 100%; background: var(--bg); padding: 16px; overflow-y: auto; }
.drawer nav a { display: block; padding: 14px 12px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }

/* ---------- building blocks ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; background: var(--bg); }
.stat .n { font-size: 26px; font-weight: 700; } .stat .l { font-size: 13px; color: var(--muted); }
.stat.alert { border-color: var(--red); background: var(--red-soft); } .stat.alert .n { color: var(--red-dark); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg); box-shadow: var(--shadow); min-width: 0; }
.card > h2, .card > h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card + .card { margin-top: 0; }
.section { margin-bottom: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .main { min-width: 0; } .list .main b { display: block; }
.list .meta { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.banner { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0d9b0; }
.banner.err { background: var(--red-soft); color: var(--red-dark); border: 1px solid #f3c6ca; }
.banner.info { background: var(--info-soft); color: var(--info); border: 1px solid #c9dbf6; }
.banner.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #c3e2cb; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--ink); white-space: nowrap; text-transform: capitalize; }
.chip.available, .chip.paid, .chip.done, .chip.converted, .chip.closed, .chip.approved { background: var(--ok-soft); color: var(--ok); }
.chip.reserved, .chip.confirmed, .chip.quoted, .chip.contacted, .chip.scheduled { background: var(--info-soft); color: var(--info); }
.chip.out_on_hire, .chip.on_hire { background: var(--ink); color: #fff; }
.chip.awaiting_inspection, .chip.provisional, .chip.part_paid, .chip.pending, .chip.awaiting_customer, .chip.in_progress, .chip.high, .chip.open { background: var(--warn-soft); color: var(--warn); }
.chip.cleaning, .chip.returned { background: var(--purple-soft); color: var(--purple); }
.chip.maintenance, .chip.unpaid, .chip.urgent, .chip.lost, .chip.rejected, .chip.safety, .chip.overdue, .chip.new { background: var(--red-soft); color: var(--red-dark); }
.chip.unavailable, .chip.cancelled, .chip.expired, .chip.quotation { background: #EEEEEE; color: #444; }
.chip.demo { background: #FFF0B3; color: #5C4A00; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; } .btn.primary:hover { background: var(--red-dark); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--red-dark); border-color: var(--red); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 56px; font-size: 17px; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* forms */
form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input, select, textarea { font: inherit; font-size: 16px; border: 1px solid #BDBDBD; border-radius: 8px; padding: 10px 12px; min-height: 46px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(196,30,42,.35); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--red); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.fieldset > legend { font-weight: 700; padding: 0 6px; }
.err-text { color: var(--red-dark); font-size: 14px; margin-top: 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 899px) { .sticky-actions { bottom: var(--bottom-h); } }

/* fuel gauge selector */
.fuel { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.fuel button { min-height: 48px; border: 1px solid #BDBDBD; background: #fff; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.fuel button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .prog { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--red); transition: width .2s; }
.photo .lbl { position: absolute; left: 4px; top: 4px; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 5px; border-radius: 4px; }
.photo.failed { border-color: var(--red); }
.camera-btn { border: 2px dashed #BDBDBD; border-radius: 8px; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--muted); font-weight: 600; text-align: center; font-size: 13px; }
.camera-btn input { display: none; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 8px; white-space: nowrap; }
table.t td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--soft); }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
@media (max-width: 699px) {
  table.t.stack thead { display: none; }
  table.t.stack tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 10px; }
  table.t.stack td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 5px 0; text-align: right; }
  table.t.stack td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; }
  table.t.stack td.num { text-align: right; }
}

/* calendar */
.cal { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.cal-inner { min-width: 900px; }
.cal-row { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--line); min-height: 46px; }
.cal-row:last-child { border-bottom: 0; }
.cal-name { padding: 6px 10px; font-size: 13px; border-right: 1px solid var(--line); background: var(--bg); position: sticky; left: 0; z-index: 2; }
.cal-name b { display: block; font-size: 14px; }
.cal-track { position: relative; }
.cal-days { display: grid; }
.cal-days div { border-left: 1px solid var(--line); font-size: 11.5px; color: var(--muted); padding: 6px 4px; text-align: center; }
.cal-days div.today { background: var(--red-soft); color: var(--red-dark); font-weight: 700; }
.cal-grid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.cal-grid div { border-left: 1px solid #F0F0F0; }
.bar { position: absolute; top: 7px; height: 32px; border-radius: 6px; font-size: 12px; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fff; text-decoration: none; display: block; line-height: 1.25; }
.bar.confirmed { background: var(--info); } .bar.on_hire { background: var(--ink); } .bar.provisional { background: #fff; color: var(--warn); border: 2px dashed var(--warn); }
.bar.returned, .bar.closed { background: #9A9A9A; }
.bar.turn { background: repeating-linear-gradient(45deg, #ddd, #ddd 4px, #f4f4f4 4px, #f4f4f4 8px); color: transparent; }
.bar.maint { background: repeating-linear-gradient(45deg, var(--red), var(--red) 6px, var(--red-dark) 6px, var(--red-dark) 12px); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; background: var(--sw); border: var(--bd, 0); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
@media (max-width: 899px) { .kanban { grid-template-columns: 1fr; } }
.kanban .col { background: var(--soft); border-radius: var(--radius); padding: 10px; }
.kanban .col h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kcard { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; display: block; color: inherit; text-decoration: none; }
.kcard.overdue { border-left: 4px solid var(--red); }

/* job cards (phone) */
.job { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.job .when { font-size: 20px; font-weight: 700; }
.job .where { font-size: 15px; margin: 4px 0 10px; }
.job .btn-row .btn { flex: 1; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.4); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.modal { background: var(--bg); border-radius: 12px; width: min(560px, 100%); padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal h2 { display: flex; justify-content: space-between; align-items: center; }
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + 16px); display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 10px; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--red-dark); } .toast.ok { background: var(--ok); }

/* auth */
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.auth .wordmark { align-items: center; margin-bottom: 18px; }
.auth .wordmark b { font-size: 30px; letter-spacing: 4px; } .auth .wordmark span { font-size: 15px; letter-spacing: 8px; }
.auth .sig { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: 2px; background: var(--soft); padding: 10px; border-radius: 8px; word-break: break-all; text-align: center; }

.ledger td.neg { color: var(--red-dark); }
.tz { font-size: 12px; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.steps li.done::before { background: var(--ok); color: #fff; content: "✓"; }
.steps li.late::before { background: var(--red); color: #fff; }
.steps .grow { flex: 1; min-width: 0; }
.stats.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats.mini .stat { padding: 8px 10px; } .stats.mini .n { font-size: 17px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--red); }
.linkbox { word-break: break-all; white-space: pre-wrap; background: var(--soft); border-radius: 8px; padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Step 1–3: guided photo slots ---------- */
.pslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
@media (max-width: 420px) { .pslots { grid-template-columns: 1fr 1fr; } .pslot { padding: 6px; } .pslot-h { font-size: 13px; } }
.pslot { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--bg); min-width: 0; }
.pslot.req { border-color: #BDBDBD; border-style: dashed; }
.pslot.has { border-color: var(--ok); }
.pslot-h { font-size: 14px; margin-bottom: 6px; }
.pslot .ok-tick { color: var(--ok); font-weight: 700; }
.pslot-item { margin-bottom: 8px; }
.pslot-item .btn-row { margin-top: 4px; }
.pslot-photo { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft); border: 1px solid var(--line); }
.pslot-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pslot-photo .pst { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 3px 6px; background: rgba(0,0,0,.65); color: #fff; }
.pslot-photo.done .pst { background: rgba(30,123,52,.9); }
.pslot-photo.local .pst { background: rgba(138,82,0,.92); }
.pslot-photo.failed .pst { background: var(--red); }
.pslot-photo .prog { position: absolute; left: 0; top: 0; height: 5px; background: var(--red); transition: width .2s; }
.camera-btn.small-cam { aspect-ratio: auto; min-height: 92px; flex-direction: row; gap: 8px; font-size: 14px; color: var(--ink); }
.pnote { width: 100%; margin-top: 6px; font-size: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- Pass / Defect / N/A checks ---------- */
.checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.checkrow { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.checkrow.is-defect { border-color: var(--red); background: var(--red-soft); }
.cr-label { font-weight: 600; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 0; min-width: 72px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; text-align: center; padding: 10px 6px; border: 1px solid #BDBDBD; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--bg); }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg label.bad input:checked + span { background: var(--red); border-color: var(--red); }
.seg input:focus-visible + span { outline: 3px solid var(--info); outline-offset: 1px; }
.seg-wide label { min-width: 140px; }
.defect-box { margin-top: 8px; }
.photos.labelled .photo .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-rec { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.insp-rec:last-child { border-bottom: 0; }

/* ---------- Today ---------- */
.today-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tchip { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; background: var(--bg); }
.tchip b { font-size: 24px; line-height: 1.1; }
.tchip.some { border-color: var(--ink); }
.tchip.alert { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }
.count-pill { display: inline-block; min-width: 24px; text-align: center; font-size: 13px; border-radius: 999px; padding: 1px 8px; background: var(--soft); color: var(--muted); vertical-align: middle; }
.today-sec.has .count-pill { background: var(--ink); color: #fff; }
.blockers { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.blockers li { color: var(--red-dark); margin-bottom: 2px; }

/* ---------- Inspection checklist editor ---------- */
.tmpl { list-style: none; margin: 0 0 10px; padding: 0; }
.tmpl-row { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 6px; }
.tmpl-row.off { opacity: .55; }
.tmpl-main { flex: 1; min-width: 0; }
.tmpl-main > input { width: 100%; font-size: 15px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.tmpl-flags { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.check.inline { display: inline-flex; margin: 0; font-size: 13px; }
.tmpl-move { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) { .tmpl-row { flex-direction: column; } .tmpl-move { flex-direction: row; } }
.ph-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ph-pair .pslots { grid-template-columns: 1fr; }
.list li.struck .main > b { text-decoration: line-through; color: var(--muted); }

/* ---------- Accounts ---------- */
.neg { color: var(--red-dark); }
.big-num { font-size: 24px; font-weight: 700; margin: 4px 0; }
table.fin { width: 100%; border-collapse: collapse; }
table.fin td, table.fin th { padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.fin tr.sec th { text-align: left; background: var(--soft); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
table.fin tr.tot td { font-weight: 700; border-top: 1px solid var(--ink); }
table.fin tr.grand td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
table.fin tr.off td { opacity: .5; }
.stat.alert { border-color: var(--red); background: var(--red-soft); }
@media print {
  .top, nav.side, nav.bottom, .btn-row.section, #rf .btn, .actions, .toasts { display: none !important; }
  .layout main { padding: 0 !important; }
  body { font-size: 12px; }
}
.stats.fin-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stats.fin-stats .n { font-size: 21px; overflow-wrap: anywhere; }
