/* FieldCert EICR – true dark theme, teal accent */
:root {
  --bg: #000; --card: #1c1c1e; --field: #2c2c2e; --line: #3a3a3c; --text: #fff; --muted: #8e8e93; --muted2: #aeaeb2;
  --teal: #30a492; --teal-d: #247c6f; --blue: #64d2ff; --red: #ff453a; --red-l: #ff8a80; --green-l: #7ee2a8;
  --r: 12px; --r-s: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 820px; margin: 0 auto; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.boot { padding: 40vh 20px; text-align: center; color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .hint { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.row { display: flex; align-items: center; } .between { justify-content: space-between; } .gap { gap: 10px; } .wrap-row { flex-wrap: wrap; gap: 10px; }
.ok { color: var(--green-l); } .warn { color: #ffd60a; }

/* header */
.apphead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + var(--safe-t)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); max-width: 820px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand-ic { color: var(--teal); width: 22px; height: 22px; }
.hbtns { display: flex; gap: 8px; }
.hbtns .btn { min-height: 38px; padding: 8px 11px; font-size: 14px; gap: 5px; }
.hbtns { flex: none; }
.brand { min-width: 0; overflow: hidden; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.syncdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 2px; }
.syncdot.ok { background: #30d158; } .syncdot.busy { background: #ffd60a; } .syncdot.err { background: var(--red); } .syncdot.off { display: none; }
@media (max-width: 360px) { .brand span { font-size: 16px; } .hbtns .btn { padding: 8px 9px; } }

/* buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 14px; min-height: 42px; font-weight: 600; cursor: pointer; background: var(--field); color: var(--text); text-decoration: none; }
.btn.sm { min-height: 34px; padding: 6px 11px; font-size: 14px; }
.btn.big { width: 100%; min-height: 50px; justify-content: flex-start; padding: 12px 16px; }
.btn.teal { background: var(--teal); color: #fff; } .btn.teal:active { background: var(--teal-d); }
.btn.grey { background: #2c2c2e; } .btn.grey:active { background: #3a3a3c; }
.btn.red { background: #b3261e; color: #fff; }
.btn.ghost { background: transparent; color: var(--muted2); padding-left: 6px; padding-right: 6px; }
.btn.danger, .iconbtn.danger { color: var(--red-l); }
.btn:disabled { opacity: .4; cursor: default; }
.iconbtn { border: 0; background: transparent; color: var(--text); width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.iconbtn:active { background: var(--field); } .iconbtn.sm { width: 34px; height: 34px; }
.link { border: 0; background: none; padding: 4px 0; cursor: pointer; text-align: left; }
.link.blue, .blue { color: var(--blue); }

/* cards & fields */
.card { background: var(--card); border-radius: var(--r); padding: 14px; margin: 12px 0; }
.card-title, h2.sec { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 0 0 10px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }
.fld { display: block; margin: 0 0 12px; min-width: 0; }
.fld .lbl { display: block; font-size: 13px; color: var(--muted2); margin-bottom: 5px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; background: var(--field); border: 1px solid transparent; border-radius: 10px; padding: 11px 12px; font-size: 16px; color: var(--text); outline: none; min-height: 44px; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input::placeholder, textarea::placeholder { color: #6c6c70; }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-height: 44px; }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input.over { color: var(--red-l); border-color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chips.tight { gap: 6px; margin-top: -6px; }
.chip { border: 1px solid var(--line); background: var(--field); color: var(--text); border-radius: 999px; padding: 7px 14px; min-height: 36px; font-size: 15px; font-weight: 600; cursor: pointer; }
.chip.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip b { font-weight: 700; margin-left: 3px; opacity: .85; }
.chip.done:not(.on) { border-color: var(--teal-d); color: var(--green-l); }
.chip.sat.on { background: #1d5a36; border-color: #1d5a36; color: var(--green-l); }
.chip.unsat.on, .chip.code-C1.on, .chip.code-C2.on { background: #6b1a17; border-color: #6b1a17; color: var(--red-l); }
.chip.code-FI.on { background: #5a3d00; border-color: #5a3d00; color: #ffd60a; }
.chip.code-C3.on { background: #1f3f66; border-color: #1f3f66; color: var(--blue); }
.chip-head { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.chip-head .kicker { margin: 6px 0; } .selv { color: var(--teal); font-weight: 700; }

/* badges */
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.draft { background: #3a3a3c; color: #d1d1d6; }
.badge.sat { background: #173d27; color: var(--green-l); }
.badge.unsat { background: #4a1714; color: var(--red-l); }
.beta { border: 1px solid var(--teal); color: var(--teal); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #3a3a3c; color: #d1d1d6; margin-left: 6px; vertical-align: 1px; }
.tag.red { background: #4a1714; color: var(--red-l); }

/* list screen */
.intro .lead { font-size: 17px; font-weight: 600; margin: 6px 0 4px; }
.intro p { margin: 0 0 6px; }
.backup-nag { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: #3a2e00; color: #ffd60a; border: 0; border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 14px; cursor: pointer; }
.autosaved { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; color: #7ddc9a; }
.autosaved.pending { color: #a8b0bd; }
.autosaved svg { width: 14px; height: 14px; flex: none; }
.autosaved-m { margin-bottom: 4px; }
.searchbox { position: relative; margin: 14px 0 10px; }
.searchbox .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.searchbox input { padding-left: 38px !important; }
.filter { margin: 0 0 6px; }
.cards { display: grid; gap: 10px; }
@media (min-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
.rcard { background: var(--card); border-radius: var(--r); padding: 13px 14px 8px; cursor: pointer; min-width: 0; }
.rcard:active { background: #242426; }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-top h3 { margin: 0; font-size: 17px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; min-width: 0; }
.rc-addr { color: var(--muted2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.rc-actions { display: flex; gap: 6px; margin-top: 6px; margin-left: -6px; }
.empty { padding: 20px; text-align: center; }
.datacard { margin: 18px 0 30px; display: grid; gap: 3px; }
.banner { background: #0f3530; border: 1px solid var(--teal); border-radius: 10px; padding: 10px 12px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* report editor */
.topbar { position: sticky; top: 0; z-index: 20; background: #000; border-bottom: 1px solid #1c1c1e; padding-top: var(--safe-t); }
.tb-row { display: flex; align-items: center; gap: 6px; height: 50px; }
.tb-title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--card); color: var(--muted2); font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--teal); color: #fff; }
.editor { padding-bottom: calc(96px + var(--safe-b)); }
.editor.walking { padding-bottom: calc(90px + var(--safe-b)); }
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(0,0,0,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid #1c1c1e; padding: 8px 0 calc(8px + var(--safe-b)); }
.navbar .btn { min-width: 120px; }

/* supply */
.ai { border: 1px solid #1f4d45; }
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ai-head h2 { font-size: 16px; }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.ai-grid .btn { font-size: 14px; padding: 10px 8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.thumb { border: 0; padding: 0; background: var(--field); border-radius: 8px; overflow: hidden; width: 86px; flex: none; cursor: pointer; color: var(--muted2); font-size: 11px; text-align: left; }
.thumb img { width: 86px; height: 64px; object-fit: cover; display: block; }
.thumb span { display: block; padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipf-help { margin: -4px 0 10px; }
.ipf-help .link { font-weight: 600; }
.bond { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.bond:first-of-type { border-top: 0; padding-top: 0; }
.bond-name { font-weight: 700; margin-bottom: 6px; }

/* circuits */
.circuits h2.sec { margin: 0; }
.warn-line { color: var(--red-l); font-size: 14px; font-weight: 600; margin: 4px 0 10px; display: flex; gap: 6px; align-items: center; }
.ok-line { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.clist { border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.crow { display: flex; align-items: center; gap: 10px; background: var(--field); padding: 8px 6px 8px 10px; border-bottom: 1px solid #1c1c1e; cursor: pointer; min-height: 52px; }
.crow:active { background: #3a3a3c; }
.crow.inc { box-shadow: inset 3px 0 0 var(--red); }
.crow.reo { flex-wrap: wrap; row-gap: 2px; cursor: default; padding-bottom: 6px; }
.crow.reo:active { background: var(--field); }
.crow .reo-acts { flex: 1 0 100%; display: flex; justify-content: flex-end; align-items: center; gap: 2px; margin-top: -2px; }
.iconbtn:disabled { opacity: .3; cursor: default; }
.crow.flash { animation: flash 1.4s; }
.crow { touch-action: pan-y; position: relative; } /* vertical scroll stays native; horizontal swipes are ours */
.crow.swiping { transition: none; }
.crow.swipe-back { transition: transform .18s ease-out; }
.crow.swipe-out { transition: transform .15s ease-in, opacity .15s; transform: translateX(-110%) !important; opacity: 0; }
.crow .cdel { width: 44px; height: 44px; color: var(--red-l); }
.crow .cdel:active { background: rgba(255,69,58,.15); }
@keyframes flash { 0%, 40% { background: #1f5c53; } }
.cnum { width: 28px; text-align: center; font-weight: 700; color: var(--muted2); flex: none; }
.cdesc { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inc-note { display: block; color: var(--red-l); font-size: 12px; }
.inc-note .ic { width: 12px; height: 12px; vertical-align: -1px; }
.camps { font-weight: 700; color: var(--teal); flex: none; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
/* tiny RCBO marker (BS EN 61009): under the amps on Circuits rows, at the start of the action line in the Supply review */
.rcbo-tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .6px; line-height: 1; padding: 2px 4px 1.5px; margin-top: 3px; border-radius: 4px; color: #b9a6ff; background: rgba(155,130,255,.14); border: 1px solid rgba(155,130,255,.35); white-space: nowrap; }
.st-acts .rcbo-tag { margin: 0 auto 0 4px; align-self: center; }
.reorder-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; position: sticky; top: var(--tb-h, 108px); z-index: 5; background: var(--card); padding: 6px 0; box-shadow: 0 6px 8px -6px rgba(0,0,0,.6); }
.reo-t { color: var(--teal); font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.reo-t .ic { width: 16px; height: 16px; }
.rename { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 10px 0; cursor: pointer; }
.cname { display: block; font-size: 22px; font-weight: 800; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tg { width: 46px; height: 28px; border-radius: 999px; background: #3a3a3c; position: relative; transition: background .15s; flex: none; }
.tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .tg { background: var(--red); }
.toggle input:checked + .tg::after { transform: translateX(18px); }
.csum { background: #111113; border-radius: 10px; padding: 10px 12px; }
.summary { font-weight: 700; font-size: 17px; }
.check { margin-top: 6px; font-size: 14px; font-weight: 600; }
.check.ok { color: var(--green-l); } .check.bad { color: var(--red-l); }
.walk-k { color: var(--teal); margin: 0; }
.walk-head { background: #111113; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.wh-name { font-size: 20px; font-weight: 800; }
.wh-spec { color: var(--muted2); margin-top: 2px; }
.jump { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.jump .chip { flex: none; }
.tests { margin-top: 8px; }
.walkhelp { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px; }
.walkhelp .link { font-weight: 700; }
.maxzs { color: var(--muted2); font-weight: 700; }
.maxzs.bad { color: var(--red-l); }
.subhead { color: var(--muted2); font-weight: 600; margin: 6px 0 8px; font-size: 14px; }

/* observations & photos */
.obs { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.photo-list { display: grid; gap: 8px; margin-bottom: 10px; }
.prow { display: flex; gap: 10px; align-items: center; }
.pfields { flex: 1; display: grid; gap: 6px; min-width: 0; }
.pfields input, .pfields select { min-height: 38px; padding: 7px 10px; }

/* sign-off */
.sigwrap { position: relative; background: #fff; border-radius: 10px; overflow: hidden; height: 170px; margin-bottom: 6px; }
#sigpad { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-ph { position: absolute; left: 0; right: 0; top: 50%; text-align: center; color: #999; pointer-events: none; transform: translateY(-50%); }

/* modals */
body.modal-open { overflow: hidden; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px 16px calc(18px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet.wide { max-width: 760px; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 16px; } }
.m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.m-head h2 { font-size: 19px; margin: 0; display: flex; gap: 8px; align-items: center; }
.m-head h2 .ic { color: var(--teal); width: 22px; height: 22px; }
.m-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.m-actions .btn { flex: 1; min-width: 120px; }
.m-stack { display: grid; gap: 10px; margin: 12px 0; }
.tight-list { padding-left: 18px; margin: 6px 0 12px; } .tight-list li { margin-bottom: 4px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted2); margin: -4px 0 8px; }
.err { background: #3b1210; color: var(--red-l); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.foot { margin-top: 12px; text-align: center; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-photo, .photo-full { width: 100%; max-height: 42vh; object-fit: contain; background: #111; border-radius: 10px; margin-bottom: 8px; }
.photo-full { max-height: 70vh; }
.scan-table { display: grid; gap: 6px; margin: 10px 0; }
.st-row { display: grid; grid-template-columns: 40px 1fr 50px 38px 54px; gap: 5px; align-items: center; }
.st-row .st-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 2px; margin-top: -2px; }
.st-row.st-head .st-acts { display: none; }
.st-row + .st-row:not(.st-head) { border-top: 1px solid #1c1c1e; padding-top: 4px; }
@media (min-width: 620px) { .st-row { grid-template-columns: 44px 1fr 54px 42px 58px auto; } .st-row .st-acts { grid-column: auto; margin-top: 0; } .st-row.st-head .st-acts { display: block; } }
.st-row input { min-height: 38px !important; padding: 6px 7px !important; font-size: 15px !important; }
.st-head { font-size: 12px; color: var(--muted); font-weight: 700; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(130px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #2c2c2e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 80; opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.6); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #6b1a17; }
.toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 16px; }
.toast-act { border: 0; background: transparent; color: var(--blue); font-weight: 700; font-size: 15px; min-height: 44px; min-width: 64px; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.toast-act:active { background: rgba(255,255,255,.08); }

/* desktop */
@media (min-width: 1000px) {
  .wrap, .apphead { max-width: 1040px; }
  .grid2.tests, .grid2 { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 18px 20px; }
}

/* ---------------- certificate (screen preview + print) ---------------- */
#print-root { display: none; }
body.printing #app { display: none; }
body.printing { background: #e5e5ea; color: #111; }
body.printing #print-root { display: block; }
.print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px; background: #1c1c1e; color: #fff; }
.cert { background: #fff; color: #111; max-width: 210mm; margin: 12px auto 40px; padding: 12mm 11mm; font: 9.5pt/1.35 -apple-system, "Helvetica Neue", Arial, sans-serif; box-shadow: 0 2px 16px rgba(0,0,0,.15); }
.cert h1 { font-size: 16pt; margin: 0; }
.cert h2 { font-size: 10pt; background: #e8f5f2; border-left: 3px solid #30a492; padding: 3px 6px; margin: 10px 0 5px; }
.cert .sub, .cert .small { font-size: 8pt; color: #444; }
.cert-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #30a492; padding-bottom: 6px; }
.cert-no { text-align: right; font-size: 8.5pt; } .cert-no strong { font-size: 11pt; } .cert-no .type { color: #555; }
.outcome-box { margin: 8px 0; padding: 6px 10px; border: 2px solid #999; font-size: 10.5pt; }
.outcome-box.satisfactory { border-color: #1b7a43; background: #eaf7ef; }
.outcome-box.unsatisfactory { border-color: #b3261e; background: #fdecea; }
.grid2 .pf, .grid3 .pf { }
.cert .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cert .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.pf { display: flex; gap: 6px; border-bottom: 1px dotted #ccc; padding: 2px 0; break-inside: avoid; }
.pl { color: #555; min-width: 38%; flex: none; font-size: 8.5pt; } .pv { flex: 1; }
.nil { color: #aaa; }
.nil-line { margin: 2px 0; color: #777; font-size: 8.5pt; }
.sig { max-height: 44px; max-width: 180px; }
.tbl { width: 100%; border-collapse: collapse; margin: 4px 0; }
.tbl th, .tbl td { border: 1px solid #bbb; padding: 2px 4px; text-align: left; vertical-align: top; }
.tbl th { background: #f2f2f2; font-size: 8pt; }
.small-tbl { font-size: 8.5pt; }
.code { font-weight: 700; text-align: center !important; }
.code-C1, .code-C2 { color: #b3261e; } .code-FI { color: #9a6700; } .code-C3 { color: #1f5fa8; }
.sched-tbl { font-size: 6.6pt; table-layout: auto; }
.sched-tbl th, .sched-tbl td { padding: 1px 2px; text-align: center; }
.sched-tbl td.desc { text-align: left; }
.sched-tbl tr.rem td { background: #fdecea; }
.sched-tbl tr.main td, .sched-tbl tr.rcd td { background: #f6f6f6; }
.sched-tbl td.over { color: #b3261e; font-weight: 700; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pgrid figure { margin: 0; break-inside: avoid; } .pgrid img { width: 100%; height: 42mm; object-fit: cover; border: 1px solid #ddd; }
.pgrid figcaption { font-size: 7.5pt; color: #444; }
.cert-foot { margin-top: 10px; border-top: 1px solid #ccc; padding-top: 4px; font-size: 7.5pt; color: #666; }
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; color: #111; }
  #app, #modal-root, #toast, .print-bar, .navbar { display: none !important; }
  #print-root { display: block !important; }
  .cert { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .cert h2 { break-after: avoid; } section.avoid, .tbl tr { break-inside: avoid; }
  .cert h2, .outcome-box, .tbl th, .sched-tbl tr.rem td, .sched-tbl tr.main td, .sched-tbl tr.rcd td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* live sync modal */
.notice { background: #3a2e00; color: #ffd60a; border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; font-size: 14px; }
.inrow { display: flex; gap: 6px; align-items: center; }
.inrow input { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; }
.code-tools { margin: -4px 0 8px; }
.qrbox { background: #fff; color: #333; border-radius: 12px; padding: 12px; text-align: center; margin: 6px 0 10px; }
.qrbox svg { width: 220px; height: 220px; display: block; margin: 0 auto 6px; }
details.xfer { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
details.xfer summary { cursor: pointer; font-weight: 600; color: var(--muted2); }
.syncdot.offd { background: #636366; }
.foot .syncdot { vertical-align: 1px; margin-right: 4px; }

/* calculations & checks */
.calc-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); border: 1px solid var(--teal-d); border-radius: 5px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.calc-tag[hidden] { display: none; }
input.calc { font-style: italic; color: #9fe3d6; }
ul.checks { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 4px; }
.ck { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.ck .ic { width: 16px; height: 16px; margin-top: 2px; }
.ck.pass { color: var(--green-l); } .ck.fail { color: var(--red-l); font-weight: 600; } .ck.warn { color: #ffd60a; } .ck.info { color: var(--muted2); }
.failbox { background: #3b1210; color: var(--red-l); border-radius: 10px; padding: 8px 10px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.ringinfo { margin: -4px 0 10px; display: grid; gap: 4px; }
.chip.sug { border-style: dashed; border-color: var(--blue); color: var(--blue); }
.checkwrap { margin-top: 6px; }

/* presets */
.plist { display: grid; gap: 8px; margin: 8px 0; }
.pset { background: #2C2C2E; border-radius: 12px; padding: 10px 12px; }
.pset-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pset-top b { font-size: 16px; }
.pset-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.pset-opts .use { margin-left: auto; min-width: 64px; }
.seg { display: inline-flex; background: #1C1C1E; border-radius: 9px; padding: 2px; }
.segb { border: 0; background: transparent; color: #d1d1d6; font: inherit; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 7px; min-height: 32px; cursor: pointer; }
.segb.on { background: var(--teal); color: #fff; }
.checkrow { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-size: 15px; }
.checkrow input { width: 20px; height: 20px; accent-color: var(--teal); }
.m-actions.wrapbtns { flex-wrap: wrap; }
ul.conf { margin: 6px 0 12px; padding-left: 18px; }

/* 3-tab bar: always fits, no horizontal scroll */
.tabs { overflow-x: visible; }
.tabs .tab { flex: 1 1 0; min-width: 0; white-space: nowrap; text-align: center; }
/* collapsible sections (Sign-off & certificate, Observations) */
details.fold { padding: 0; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 14px 44px 14px 16px; position: relative; min-height: 48px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ''; position: absolute; right: 18px; top: 22px; width: 9px; height: 9px; border-right: 2px solid var(--muted2); border-bottom: 2px solid var(--muted2); transform: rotate(45deg); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); top: 26px; }
.fold-t { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.fold-t .ic { width: 18px; height: 18px; color: var(--teal); }
.fold-s { font-size: 14px; color: var(--muted2); display: flex; align-items: center; gap: 4px; }
.fold-s .ic { width: 14px; height: 14px; color: var(--green-l); }
.fold-body { padding: 0 16px 16px; }
.fold-body > section.card { background: transparent; border-radius: 0; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--line); box-shadow: none; }
.fold-body > section.card:first-child { border-top: 0; padding-top: 0; }
.linkobs { font-size: 14px; color: var(--muted2); margin: 6px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linkobs .ic { width: 15px; height: 15px; color: #ffd60a; }
.btn.left { justify-content: flex-start; text-align: left; }
.obs.flash { animation: flash 1.2s; }
.scan-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 8px 0; border-radius: 10px; background: #12302b; font-size: 14px; }
.scan-done { padding: 10px 12px; margin: 8px 0; border-radius: 10px; background: #12302b; border: 1px solid var(--teal); font-size: 14px; }
/* "Move to…" picker: a native select (wheel picker on iPhone). 16px text so iOS doesn't zoom. */
select.moveto { font-size: 16px; min-height: 40px; max-width: 128px; padding: 6px 8px; border-radius: 10px; background: #2c2c2e; color: var(--text, #fff); border: 1px solid #3a3a3c; }
.crow select.moveto { margin-left: auto; flex: 0 0 auto; }
.st-row.flash { animation: flash 1.4s; }

/* complete + 4 Status */
.complete-card .complete-btn { justify-content: center; font-size: 17px; font-weight: 800; min-height: 54px; }
.complete-card .hint { margin: 8px 0 0; }
.stopts { display: grid; gap: 10px; margin-top: 8px; }
.stopt { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--text); cursor: pointer; min-height: 64px; font: inherit; }
.stopt.on { border-color: var(--teal); background: #0f3530; }
.stradio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted2); flex: none; }
.stopt.on .stradio { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 4px #0f3530; }
.stopt-t { display: flex; flex-direction: column; gap: 3px; }
.refrow { margin: 4px 0 8px; }
.refcode { font: 800 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; color: var(--teal); -webkit-user-select: all; user-select: all; }
.pubrec { background: var(--field); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.pubrec .warn-line { margin: 0; font-size: 14px; }
.pub-ok { color: var(--teal); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.keyline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.keyline .ic { width: 14px; height: 14px; color: var(--teal); }
.linkline { overflow-wrap: anywhere; margin: 10px 0 4px; }
.pubstate { color: var(--muted2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pubstate .ic { width: 15px; height: 15px; }
.rc-badges { display: flex; gap: 6px; flex: none; }
.badge.jst { background: #10334f; color: #8ec5ff; }
.badge.jst.issued { background: #0f3530; color: var(--teal); }
