/* =========================================================
   Field Job Logger — design system
   ========================================================= */
:root {
  /* light theme tokens */
  --bg: #eef2f7;
  --bg-grad-1: #e8eef6;
  --bg-grad-2: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --surface-3: #eaeff6;
  --ink: #0f172a;
  --ink-soft: #5a6b85;
  --ink-faint: #8a99b3;
  --line: #dce3ee;
  --line-strong: #c4cedd;

  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #e6edff;

  --hfc: #2563eb;     /* HFC family */
  --hfc-soft: #e3ecff;
  --epon: #0d9488;    /* EPON family */
  --epon-soft: #d7f3ee;

  --ok: #15803d; --ok-bg: #dcfce7; --ok-line:#86efac;
  --warn: #b45309; --warn-bg: #fef3c7; --warn-line:#fcd34d;
  --bad: #dc2626; --bad-bg: #fee2e2; --bad-line:#fca5a5;

  --tap: 56px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-2: 0 4px 12px rgba(15,23,42,.10), 0 2px 4px rgba(15,23,42,.06);
  --shadow-pop: 0 12px 30px rgba(15,23,42,.22);
  --appbar-1: #0b1f4d;
  --appbar-2: #15336e;
  --ease: cubic-bezier(.2,.8,.2,1);
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-grad-1: #0c1426;
  --bg-grad-2: #0a0f1c;
  --surface: #131c2e;
  --surface-2: #18233a;
  --surface-3: #1f2c46;
  --ink: #eaf0fb;
  --ink-soft: #9fb0cc;
  --ink-faint: #6f819f;
  --line: #243149;
  --line-strong: #34466a;
  --brand: #5b8bff;
  --brand-2: #7c83ff;
  --brand-ink: #06122e;
  --brand-soft: #1a2748;
  --hfc: #5b8bff; --hfc-soft:#17233f;
  --epon: #2dd4bf; --epon-soft:#12302c;
  --ok: #4ade80; --ok-bg: #102a1c; --ok-line:#1f7a45;
  --warn: #fbbf24; --warn-bg: #2c2410; --warn-line:#7a5a16;
  --bad: #f87171; --bad-bg: #2c1414; --bad-line:#7a2626;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 6px 16px rgba(0,0,0,.45);
  --shadow-pop: 0 14px 34px rgba(0,0,0,.6);
  --appbar-1: #0a1a3d;
  --appbar-2: #122a57;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg:#0b1220; --bg-grad-1:#0c1426; --bg-grad-2:#0a0f1c;
    --surface:#131c2e; --surface-2:#18233a; --surface-3:#1f2c46;
    --ink:#eaf0fb; --ink-soft:#9fb0cc; --ink-faint:#6f819f;
    --line:#243149; --line-strong:#34466a;
    --brand:#5b8bff; --brand-2:#7c83ff; --brand-ink:#06122e; --brand-soft:#1a2748;
    --hfc:#5b8bff; --hfc-soft:#17233f; --epon:#2dd4bf; --epon-soft:#12302c;
    --ok:#4ade80; --ok-bg:#102a1c; --ok-line:#1f7a45;
    --warn:#fbbf24; --warn-bg:#2c2410; --warn-line:#7a5a16;
    --bad:#f87171; --bad-bg:#2c1414; --bad-line:#7a2626;
    --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 6px 16px rgba(0,0,0,.45); --shadow-pop:0 14px 34px rgba(0,0,0,.6);
    --appbar-1:#0a1a3d; --appbar-2:#122a57;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
}

/* ---------- App bar ---------- */
#appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  color: #fff;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(120deg, var(--appbar-1), var(--appbar-2));
  box-shadow: var(--shadow-2);
}
#appbar h1 { font-size: 19px; margin: 0; flex: 1; font-weight: 750; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 2px 8px rgba(37,99,235,.5); }
.logo svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn {
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px;
  min-width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.iconbtn:active { transform: scale(.94); background: rgba(255,255,255,.26); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 11px 6px 9px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff; text-transform: uppercase; letter-spacing: .04em;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(220,38,38,.25); }
.badge.online .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.3); }

/* ---------- Main scroll area ---------- */
#app { flex: 1; overflow-y: auto; padding: 16px 14px 28px; -webkit-overflow-scrolling: touch; }
#app > * { animation: rise .28s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tab bar ---------- */
#tabbar {
  display: flex; gap: 2px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(15,23,42,.06);
}
.tab {
  flex: 1; min-height: var(--tap); border: 0; background: transparent; color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; cursor: pointer; padding: 8px 2px 6px; position: relative;
  transition: color .15s var(--ease);
}
.tab .ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s var(--ease); }
.tab:active .ico { transform: scale(.86); }
.tab.active { color: var(--brand); }
.tab.active .ico { transform: translateY(-1px); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-1);
}
.card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 750; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; }
.hicon { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.card h3 { margin: 18px 0 8px; font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.muted { color: var(--ink-soft); font-size: 14px; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 14px; font-weight: 650; font-size: 14px; }
label.field span.lbl { display: block; margin-bottom: 7px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; font-weight: 800; }
input[type=text], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; min-height: var(--tap); font-size: 18px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
  font-family: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 24px, calc(100% - 14px) 24px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: var(--tap); font-size: 17px; font-weight: 750; letter-spacing: .2px;
  border: 0; border-radius: var(--radius-sm); cursor: pointer; padding: 12px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 36%, transparent);
  transition: transform .1s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(.96); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.secondary { background: var(--surface); color: var(--brand); border: 2px solid color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-1); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(220,38,38,.35); color:#fff; }
.btn.ok { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 4px 14px rgba(21,128,61,.35); color:#fff; }
.btn[disabled] { opacity: .5; box-shadow: none; }
.btn.small { width: auto; min-height: 46px; font-size: 15px; padding: 8px 16px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------- Toggle ---------- */
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); gap: 12px; }
.switch { position: relative; width: 64px; height: 36px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .18s var(--ease); }
.slider::before { content: ""; position: absolute; height: 28px; width: 28px; left: 4px; top: 4px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.switch input:checked + .slider::before { transform: translateX(28px); }

/* ---------- Job-type accent helpers ---------- */
.accent-hfc  { --accent: var(--hfc);  --accent-soft: var(--hfc-soft); }
.accent-epon { --accent: var(--epon); --accent-soft: var(--epon-soft); }

/* ---------- Checklist header card (active job) ---------- */
.jobhead { position: relative; overflow: hidden; border-left: 6px solid var(--accent, var(--brand)); }
.jobhead .meta-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.jobhead .ring-wrap { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.ring { width: 76px; height: 76px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring .bar { fill: none; stroke: var(--accent, var(--brand)); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }
.ring-label { transform: rotate(90deg); }
.ring-pct { font-size: 20px; font-weight: 800; fill: var(--ink); }
.ring-meta .big { font-size: 22px; font-weight: 800; }
.ring-meta .sub { color: var(--ink-soft); font-size: 14px; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 750; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); letter-spacing: .02em; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill.brand { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.pill.accent { background: var(--accent-soft, var(--brand-soft)); color: var(--accent, var(--brand)); border-color: color-mix(in srgb, var(--accent, var(--brand)) 35%, transparent); }
.pill .pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Phases & checklist ---------- */
.phase { margin-top: 16px; }
.phase-head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent, var(--brand));
  padding: 11px 13px; border-radius: var(--radius-sm); box-shadow: var(--shadow-1);
}
.phase-head .pname { flex: 1; }
.phase-head .pnum { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--accent, var(--brand)); flex: 0 0 auto; }
.phase-head .pcount { font-size: 12px; font-weight: 800; color: var(--ink-soft); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; }
.phase-head.complete .pcount { background: var(--ok-bg); color: var(--ok); }
.phase.highsplit .phase-head { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-bg) 50%, var(--surface)); }
.phase.highsplit .phase-head .pnum { background: var(--warn); }

.check-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface); overflow: hidden; transition: background .2s var(--ease), border-color .2s var(--ease); box-shadow: var(--shadow-1); }
.check-item.done { background: color-mix(in srgb, var(--ok-bg) 60%, var(--surface)); border-color: var(--ok-line); }
.check-item.skipped { background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface)); border-color: var(--warn-line); }
.check-item.skipped .cbox { border-color: var(--warn); border-style: dashed; }
.check-item.needs-reason { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 16%, transparent); }
.check-row { display: flex; align-items: flex-start; gap: 13px; padding: 13px; cursor: pointer; min-height: var(--tap); }
.check-row .cbox { width: 30px; height: 30px; flex: 0 0 auto; border: 2.5px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; margin-top: 1px; transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
.check-row .cbox svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 28; stroke-dashoffset: 28; transition: stroke-dashoffset .22s var(--ease); }
.check-item.done .cbox { background: linear-gradient(135deg, #16a34a, #15803d); border-color: #15803d; }
.check-item.done .cbox svg { stroke-dashoffset: 0; }
.check-row input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.check-row:active .cbox { transform: scale(.88); }
.check-row .ctext { font-size: 16px; line-height: 1.4; padding-top: 3px; }
.check-item.done .ctext { color: var(--ink-soft); }

.note-item { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); color: var(--ink); font-size: 14.5px; margin-bottom: 8px; line-height: 1.45; }
.note-item .nicon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--brand); stroke-width: 2; margin-top: 1px; }
.note-item b { font-weight: 800; color: var(--brand); }

.skip { padding: 0 13px 13px; }
.skip input { min-height: 50px; font-size: 16px; border-color: var(--bad-line); background: color-mix(in srgb, var(--bad-bg) 40%, var(--surface)); }
.skip .skiplbl { font-size: 12px; font-weight: 800; color: var(--bad); display: block; margin: 2px 0 6px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Lists ---------- */
.list-item { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 9px; background: var(--surface); box-shadow: var(--shadow-1); transition: transform .12s var(--ease), box-shadow .15s var(--ease); }
.list-item .lead { width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-soft, var(--brand-soft)); color: var(--accent, var(--brand)); font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.list-item .lead svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow .t1 { font-weight: 750; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.list-item .grow .t2 { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.tap-row { cursor: pointer; }
.tap-row:active { transform: scale(.99); box-shadow: var(--shadow-2); }
.list-item .chev { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--ink-faint); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Steppers / equipment ---------- */
.eq-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.eq-row .name { flex: 1; min-width: 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; font-size: 22px; border-radius: 11px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 800; color: var(--ink); cursor: pointer; transition: transform .1s var(--ease), background .15s var(--ease); }
.stepper button:active { transform: scale(.9); background: var(--surface-3); }
.stepper button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.stepper .val { min-width: 38px; text-align: center; font-weight: 800; font-size: 18px; }

/* ---------- Reference tables ---------- */
.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0; }
.ref-table th, .ref-table td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.ref-table th { background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 800; }
.ref-table td.bad { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.ref-table td.ok { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-soft); }
.kv .v { font-weight: 750; text-align: right; }
.callout { display: flex; gap: 9px; border-left: 4px solid var(--warn); background: var(--warn-bg); color: var(--ink); padding: 11px 13px; border-radius: 10px; margin: 8px 0; font-size: 14px; }
.callout.bad { border-color: var(--bad); background: var(--bad-bg); }
.callout svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; margin-top: 1px; }
.callout.bad svg { stroke: var(--bad); }
.callout svg { stroke: var(--warn); }

/* ---------- Misc ---------- */
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 6px; margin-top: 12px; }
.notes-wrap { position: relative; }
.mic { position: absolute; right: 10px; bottom: 10px; width: 50px; height: 50px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-2); cursor: pointer; transition: transform .12s var(--ease); }
.mic:active { transform: scale(.9); }
.mic svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic.rec { background: linear-gradient(135deg, #ef4444, #dc2626); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); } }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 13px 20px; border-radius: 14px;
  font-size: 15px; font-weight: 700; z-index: 50; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow-pop); animation: toastIn .3s var(--ease) both;
}
:root[data-theme="dark"] .toast, @media (prefers-color-scheme: dark){ :root[data-theme="auto"] .toast { background:#eaf0fb; color:#0b1220; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty { text-align: center; color: var(--ink-soft); padding: 48px 16px; }
.empty .big { width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.empty .big svg { width: 32px; height: 32px; fill: none; stroke: var(--ink-faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty .et { font-weight: 700; color: var(--ink); font-size: 16px; }

.hr { height: 1px; background: var(--line); border: 0; margin: 14px 0; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; line-height: 1.45; }
.banner svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.banner.pii { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.banner.info { background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }

/* segmented control (theme switch) */
.seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 750; font-size: 14px; border-radius: 9px; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }

/* ---------- Ask / free-text checklist fields ---------- */
.hspill { font-size: 10px; padding: 1px 7px; vertical-align: middle; font-weight: 800; }
.check-item.ask { padding: 13px; background: var(--surface); }
.asklbl { display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.askbox { min-height: 96px; }
.check-item.ask .notes-wrap .mic { width: 44px; height: 44px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2, 6, 23, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
  animation: fade .2s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; width: 100%; max-width: 520px; max-height: 84dvh; overflow-y: auto;
  box-shadow: var(--shadow-pop); animation: rise .26s var(--ease) both;
}
.modal h2 { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 750; margin: 0 0 4px; }
.fu-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.fu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fu-head .t1 { font-weight: 750; font-size: 16px; }
.fu-head .t2 { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.fu-res { margin-top: 10px; }
.fu-res textarea { min-height: 80px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
