/* WFR Field Guide — styles. System fonts only (no network needed). */
:root {
  --logo-red: #E11D1D;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 10px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
[data-theme="light"] {
  --bg: #F4F1EA; --surface: #FFFDF8; --surface2: #ECE7DC; --ink: #1B1F1C; --muted: #5C615B; --line: #DCD5C6;
  --accent: #C2410C; --accent-ink: #FFFFFF; --accent-soft: #FBE6D9;
  --danger: #B91C1C; --danger-soft: #FCE4E2; --warn: #9A5B00; --warn-soft: #FBEFD4; --ok: #2F6B3F; --ok-soft: #DDEEDF; --info-soft: #E2ECF3;
  --c-assess: #3B5B7A; --c-trauma: #B91C1C; --c-env: #1F6F8B; --c-med: #2F6B3F; --c-proc: #6B4E8B; --c-ref: #7A6531;
  --shadow: 0 1px 2px rgba(40,30,10,.06), 0 4px 14px rgba(40,30,10,.05);
}
[data-theme="dark"] {
  --bg: #121413; --surface: #1C1F1D; --surface2: #262A27; --ink: #ECEAE4; --muted: #A2A69F; --line: #323632;
  --accent: #FB7A3C; --accent-ink: #1A0E06; --accent-soft: #3A2316;
  --danger: #F26B6B; --danger-soft: #3A1B1B; --warn: #F0B44C; --warn-soft: #3A2E15; --ok: #74C08A; --ok-soft: #1B3323; --info-soft: #1B2A35;
  --c-assess: #8AB0D4; --c-trauma: #F26B6B; --c-env: #6CC3DD; --c-med: #74C08A; --c-proc: #B89BDA; --c-ref: #D2B66E;
  --shadow: none;
}
/* Night mode: dim red on black to preserve dark adaptation */
[data-theme="night"] {
  --bg: #000000; --surface: #0B0000; --surface2: #160303; --ink: #E5382E; --muted: #9C2A22; --line: #2E0A08;
  --accent: #FF3B30; --accent-ink: #000000; --accent-soft: #250504;
  --danger: #FF3B30; --danger-soft: #2A0503; --warn: #E5382E; --warn-soft: #1C0402; --ok: #E5382E; --ok-soft: #160303; --info-soft: #120202;
  --c-assess: #E5382E; --c-trauma: #FF3B30; --c-env: #E5382E; --c-med: #E5382E; --c-proc: #E5382E; --c-ref: #E5382E;
  --shadow: none;
}
* { box-sizing: border-box; }
/* ---- App shell: header / scrolling content / tab bar in a flex column (no position:fixed bars).
   Avoids iOS 26+ bugs where fixed bars are painted in the wrong place or the viewport is too short. */
html { -webkit-text-size-adjust: 100%; --app-height: 100vh; height: 100%; background: var(--surface); }
@supports (height: 100dvh) { html { --app-height: 100dvh; } }
html.standalone { --app-height: 100%; }             /* home-screen: JS sets exact visible height */
body { margin: 0; height: var(--app-height); min-height: var(--app-height); overflow: hidden; overscroll-behavior: none; background: var(--surface); color: var(--ink); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { display: flex; flex-direction: column; height: var(--app-height); min-height: var(--app-height); width: 100%; overflow: hidden; background: var(--bg); }
/* Legacy installs added while the status bar was translucent: grow by the top inset (0 on fresh installs). */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: .35rem 0 .6rem; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.ic { width: 22px; height: 22px; flex: none; }
.link { font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; min-height: 40px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar { flex: none; position: relative; z-index: 20; display: flex; align-items: center; gap: .3rem; padding: calc(var(--safe-t) + .25rem) max(.6rem, env(safe-area-inset-right), calc(50% - var(--col) / 2)) .25rem max(.6rem, env(safe-area-inset-left), calc(50% - var(--col) / 2)); background: var(--bg); border-bottom: 1px solid var(--line); min-height: 52px; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 800; font-size: 1rem; min-height: 44px; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; color: var(--ink); }
.badges { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: .78rem; font-weight: 800; padding: .3rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge.red { background: var(--danger); color: #fff; }
.badge.amber { background: var(--warn); color: #fff; }
[data-theme="night"] .badge.red, [data-theme="night"] .badge.amber { color: #000; }
.net { display: inline-flex; color: var(--ok); }
.net.off { color: var(--warn, #B45309); }
.net.unk { color: var(--muted); opacity: .55; }
.net .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface2); }
.pt-chip { display: flex; align-items: center; gap: .35rem; margin: 0 auto 0 .25rem; padding: .3rem .7rem; min-height: 36px; min-width: 0; flex: 0 1 auto; border-radius: 999px; background: var(--surface2); color: var(--ink); font-size: .82rem; font-weight: 600; }
.pt-chip:hover { text-decoration: none; }
.pt-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-chip .ic { width: 16px; height: 16px; }

/* Centered content column: padding grows on wide screens (tablets, large phones in landscape) so every
 * child — cards, grids, steppers, buttons — stays centered regardless of its own margins. */
:root { --col: 800px; --gutter-l: max(.9rem, env(safe-area-inset-left), calc(50% - var(--col) / 2)); --gutter-r: max(.9rem, env(safe-area-inset-right), calc(50% - var(--col) / 2)); }
main { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; outline: none; padding: .6rem var(--gutter-r) 1.5rem var(--gutter-l); }

/* Tab bar */
.tabbar { flex: none; position: relative; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 0 max(env(safe-area-inset-right), calc(50% - var(--col) / 2)) max(4px, calc(var(--safe-b) - 14px)) max(env(safe-area-inset-left), calc(50% - var(--col) / 2)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; color: var(--muted); font-size: .72rem; font-weight: 650; }
.tabbar a:hover { text-decoration: none; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on .ic { stroke-width: 2.5; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin: 0 0 .85rem; box-shadow: var(--shadow); }
.view-h { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin: .5rem 0 .75rem; flex-wrap: wrap; }
.view-h h1 { margin: 0; }
.sec-h { margin: 1.4rem 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 750; color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.col { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.foot { text-align: center; margin-top: 1.5rem; }
.warn-card { border-color: var(--warn); background: var(--warn-soft); }
.warn-card h2 { display: flex; gap: .5rem; align-items: center; }
.info-card { background: var(--info-soft); }
.danger-card { border-color: var(--danger); background: var(--danger-soft); }
.danger-card strong { display: flex; gap: .4rem; align-items: center; color: var(--danger); }
.tag { font-style: normal; font-size: .7rem; background: var(--accent); color: var(--accent-ink); padding: .1rem .4rem; border-radius: 6px; vertical-align: middle; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--tap); padding: .55rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); font: 650 .98rem/1.1 var(--font); cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="night"] .btn.danger { color: #000; }
.btn.danger-ghost { color: var(--danger); background: transparent; border-color: var(--danger); margin-top: .5rem; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 1.08rem; }
.btn.wide { width: 100%; margin-top: .5rem; }
.small-btn { min-height: 40px; padding: .35rem .75rem; font-size: .9rem; margin-top: .4rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.btn-row.tight { margin-top: .4rem; }
.btn-row .btn { flex: 1 1 auto; }
.icon-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .6rem; }
.btn.icon-only { padding: 0; min-height: 52px; }
.btn.icon-only .ic { width: 24px; height: 24px; }
.sticky-actions { position: sticky; top: -.6rem; z-index: 5; background: var(--bg); padding: .4rem 0; margin: 0 0 .5rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .35rem 0 .2rem; }
.chips.center { justify-content: center; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .93rem/1.1 var(--font); cursor: pointer; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.chip-bad.on { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="night"] .chip.chip-bad.on { color: #000; }
.chip.tiny { min-height: 32px; padding: .2rem .6rem; font-size: .78rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin: .6rem 0; }
.field > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field.compact { margin: 0; }
.field.compact select, .field.compact input { min-height: 40px; }
input, textarea, select { width: 100%; font: 400 1rem/1.35 var(--font); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .65rem .75rem; min-height: var(--tap); }
textarea { resize: vertical; min-height: 48px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
.check { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { width: 26px; height: 26px; min-height: 26px; flex: none; accent-color: var(--accent); margin: 0; }
.sub { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; }

/* Home */
.pt-card .pt-name { font-size: 1.4rem; margin: .2rem 0 .1rem; }
.crit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.crit { display: flex; flex-direction: column; justify-content: center; min-height: 74px; padding: .7rem .85rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--danger); color: var(--ink); }
.crit:hover { text-decoration: none; background: var(--surface2); }
.crit strong { font-size: 1.02rem; }
.crit span { font-size: .8rem; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.cat { display: flex; flex-direction: column; padding: .8rem .9rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-top: 4px solid var(--cc, var(--accent)); min-height: 72px; }
.cat:hover { text-decoration: none; background: var(--surface2); }
.cat span { font-size: .8rem; color: var(--muted); }
.cat-assess { --cc: var(--c-assess); } .cat-trauma { --cc: var(--c-trauma); } .cat-env { --cc: var(--c-env); } .cat-med { --cc: var(--c-med); } .cat-proc { --cc: var(--c-proc); } .cat-ref { --cc: var(--c-ref); }
.cat-text-assess { color: var(--c-assess); } .cat-text-trauma { color: var(--c-trauma); } .cat-text-env { color: var(--c-env); } .cat-text-med { color: var(--c-med); } .cat-text-proc { color: var(--c-proc); } .cat-text-ref { color: var(--c-ref); }
.cat-h { color: var(--cc); }
.tq-live { border-color: var(--danger); }
.tq-live h3 { display: flex; align-items: center; gap: .4rem; color: var(--danger); margin: 0; }
.tq-mini { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* Lists */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; min-height: 60px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; background: var(--surface2); }
.list-item.on { background: var(--accent-soft); }
.list-item > span:not(.cat-ic):not(.dot), .li-main > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-item small { color: var(--muted); font-size: .82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-item .chev { color: var(--muted); width: 18px; }
.li-main { display: flex; align-items: center; gap: .75rem; flex: 1; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cat-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--cc); background: var(--surface2); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.cat-ic .ic { width: 20px; height: 20px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); flex: none; }

/* Stepper */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin-bottom: .85rem; }
.stepper a { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .1rem; border-radius: 10px; color: var(--muted); font-size: .74rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); }
.stepper a:hover { text-decoration: none; }
.stepper b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface2); color: var(--ink); font-size: .82rem; }
.stepper a.on { border-color: var(--accent); color: var(--ink); }
.stepper a.on b { background: var(--accent); color: var(--accent-ink); }
.stepper a.done b { background: var(--ink); color: var(--bg); }
.step-nav { display: flex; justify-content: space-between; gap: .6rem; margin: .5rem 0 1rem; }
.pa-item { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.pa-item:last-child { border-bottom: 0; }
.pa-item.flag { background: var(--danger-soft); margin: 0 -1rem; padding: .75rem 1rem; }
.pa-t { font-weight: 750; }
.pa-item p { margin: .15rem 0 .2rem; }
.exam-row { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.exam-row p { margin: 0 0 .35rem; }
.problem { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .45rem; }
details.opqrst { background: var(--surface2); border-radius: var(--r-sm); padding: .5rem .8rem; margin: .4rem 0; }
details summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }

/* Vitals */
.due-card .due-time { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.due-card.overdue { border-color: var(--warn); background: var(--warn-soft); }
.due-card.overdue .due-time { color: var(--warn); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: .74rem; }
td.abn { color: var(--danger); font-weight: 800; }
.vt td { white-space: nowrap; }
.note-row td { color: var(--muted); font-size: .82rem; border-bottom: 1px solid var(--line); white-space: normal !important; }
table.ref td { min-width: 90px; }
.sparks { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.spark { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 44px; gap: .2rem .5rem; align-items: center; color: var(--accent); }
.spark span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.spark svg { grid-column: 1 / -1; width: 100%; height: 44px; }
.spark b { grid-row: 1; grid-column: 2; color: var(--ink); font-size: .9rem; }

/* SOAP */
.soap-sec { padding: .6rem 0 .4rem; border-bottom: 1px solid var(--line); }
.soap-sec:last-child { border-bottom: 0; }
.soap-sec h3 { color: var(--accent); margin: 0; }
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; padding: .3rem 0; font-size: .95rem; }
.kv > span { color: var(--muted); font-size: .82rem; font-weight: 700; padding-top: .1rem; }
.kv p { margin: 0 0 .15rem; white-space: pre-wrap; }
.plist { margin: .3rem 0; padding-left: 1.3rem; }
.soap-pre { white-space: pre-wrap; font: .82rem/1.45 var(--mono); background: var(--surface2); padding: .8rem; border-radius: var(--r-sm); overflow-x: auto; }

/* Guide */
.search { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 .8rem; margin-bottom: .6rem; }
.search:focus-within { border-color: var(--accent); }
.search .ic { color: var(--muted); }
.search input { border: 0; background: transparent; padding-left: 0; }
.back { display: inline-flex; align-items: center; gap: .2rem; font-weight: 650; min-height: 44px; margin: .2rem 0; }
.topic header { margin-bottom: 1rem; }
.topic h1 { font-size: 1.75rem; margin: .2rem 0 .4rem; }
.lead { font-size: 1.05rem; color: var(--muted); }
.tsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem .5rem; margin-bottom: .75rem; }
.tsec h2 { font-size: 1.05rem; color: var(--ink); }
.bul { margin: .2rem 0 .4rem; padding-left: 1.15rem; }
.bul li { margin: .35rem 0; }
.bul li.warn { list-style: none; margin-left: -1.15rem; display: flex; gap: .45rem; background: var(--danger-soft); color: var(--ink); padding: .5rem .6rem; border-radius: 10px; }
.bul li.warn .ic { color: var(--danger); width: 18px; height: 18px; margin-top: .15rem; }
.bul li.subli { list-style: "– "; margin-left: .8rem; }
.red-box { background: var(--danger-soft); border: 1.5px solid var(--danger); border-radius: var(--r); padding: .8rem 1rem; margin-bottom: .75rem; }
.red-box h3 { display: flex; align-items: center; gap: .4rem; color: var(--danger); }
.red-box ul { margin: 0; padding-left: 1.2rem; }
.evac-box { border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); padding: .9rem 1rem; margin-bottom: .75rem; }
.ev { border-left: 4px solid; padding: .2rem 0 .1rem .75rem; margin: .5rem 0; }
.ev b { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.ev .bul { margin: .1rem 0; }
.ev-rapid { border-color: var(--danger); } .ev-rapid b { color: var(--danger); }
.ev-non { border-color: var(--warn); } .ev-non b { color: var(--warn); }
.ev-none { border-color: var(--ok); } .ev-none b { color: var(--ok); }
.related { margin-top: 1rem; }
p.warn { color: var(--danger); display: flex; gap: .35rem; }

/* Flows */
.trail { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-direction: column; gap: .3rem; }
.trail li { display: flex; justify-content: space-between; gap: .75rem; font-size: .86rem; padding: .45rem .7rem; background: var(--surface2); border-radius: 10px; color: var(--muted); }
.trail b.yes { color: var(--ok); } .trail b.no { color: var(--danger); }
.flow-q .q { font-size: 1.2rem; font-weight: 700; line-height: 1.35; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.btn.yes { background: var(--ok); border-color: var(--ok); color: #fff; min-height: 64px; font-size: 1.2rem; }
.btn.no { background: var(--surface2); min-height: 64px; font-size: 1.2rem; }
[data-theme="night"] .btn.yes { color: #000; }
.result { border-width: 2px; }
.result-t { font-size: 1.08rem; font-weight: 600; }
.lvl-rapid { border-color: var(--danger); background: var(--danger-soft); } .lvl-rapid .eyebrow { color: var(--danger); }
.lvl-non { border-color: var(--warn); background: var(--warn-soft); } .lvl-non .eyebrow { color: var(--warn); }
.lvl-none { border-color: var(--ok); background: var(--ok-soft); } .lvl-none .eyebrow { color: var(--ok); }
.lvl-info { border-color: var(--muted); }

/* Tools */
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.tool { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; min-height: 96px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.tool:hover { text-decoration: none; background: var(--surface2); }
.tool span { font-size: .82rem; color: var(--muted); }
.tq .tq-time { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--danger); line-height: 1.1; }
.tq.off .tq-time { color: var(--muted); }
.tq { border-left: 5px solid var(--danger); }
.tq.off { border-left-color: var(--line); }
.cpr-card { text-align: center; }
.cpr-display { font-size: 5.5rem; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; padding: 1rem 0 .4rem; color: var(--accent); }
.cpr-display.breathe { font-size: 2.6rem; color: var(--danger); padding: 2.2rem 0 1rem; }
.cpr-sub { color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: .6rem; }
.pulse { animation: pulse .18s ease-out; }
@keyframes pulse { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.score-card { display: flex; align-items: center; gap: 1rem; }
.score { font-size: 3rem; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); min-width: 5.5rem; }
.score small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.opt-list { display: flex; flex-direction: column; gap: .4rem; }
.opt { display: flex; align-items: center; gap: .75rem; min-height: 50px; padding: .5rem .8rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 550 .98rem var(--font); text-align: left; cursor: pointer; }
.opt b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface2); flex: none; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on b { background: var(--accent); color: var(--accent-ink); }
.burn-list { display: flex; flex-direction: column; }
.burn-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { min-width: 48px; min-height: 44px; border: 0; background: var(--surface); color: var(--ink); font: 700 .95rem var(--font); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--bg); }
.tap-pad { display: block; width: 100%; height: 38vh; min-height: 200px; max-height: 340px; border-radius: 24px; border: 0; background: var(--accent); color: var(--accent-ink); font: 850 2.4rem var(--font); letter-spacing: .1em; margin-bottom: .85rem; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.conv .eq { padding-bottom: 1.4rem; color: var(--muted); font-weight: 700; }

/* Modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: grid; place-items: end center; padding: 1rem 1rem calc(1rem + var(--safe-b)); }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 1.25rem; width: 100%; max-width: 440px; border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(72px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: var(--bg); padding: .65rem 1rem; border-radius: 12px; font-weight: 650; font-size: .92rem; max-width: calc(100% - 2rem); text-align: center; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .crit-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid, .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .sparks { grid-template-columns: repeat(4, 1fr); }
  .modal { place-items: center; }
}
@media (max-width: 440px) { .brand span { display: none; } }
@media (max-width: 380px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0; }
}

/* Print: only the SOAP document */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .tabbar, .topbar, .pt-chip, .toast, .view-h .muted { display: none !important; }
  html, body, #app { height: auto !important; min-height: 0 !important; overflow: visible !important; display: block; }
  main { padding: 0; max-width: none; overflow: visible; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .soap-sec h3 { color: #000; }
  .soap-sec .link { display: none; }
}
