/* SFI Playbook
   Brand: Specialty Finishes green #005838, charcoal #58585A, white.
   Type: Archivo. Titles use the wide, heavy cut to echo the SFI wordmark.
   Motif: the 45 degree hatch from specialtyfinishes.com, and paint-chip strips for session kinds. */

:root {
  --green: #005838;
  --green-700: #004a2f;
  --green-800: #003a25;
  --green-950: #0d211a;
  --green-50: #e9f2ed;
  --green-100: #d3e6db;
  --mint: #7fd1a8;
  --ink: #1f2022;
  --text: #2a2b2d;
  --gray: #58585a;
  --muted: #6c6e71;
  --faint: #95979a;
  --paper: #f2f3f2;
  --surface: #ffffff;
  --sunken: #f7f8f7;
  --line: #d9dcda;
  --line-2: #e8eae9;
  --red: #d63a2c;
  --red-soft: #fbe9e7;
  --amber: #9a6512;
  --amber-soft: #f8eedc;
  --wide: 'Archivo', 'Arial Black', Arial, sans-serif;
  --body: 'Archivo', Arial, Helvetica, sans-serif;
  --r: 6px;
  --r-lg: 10px;
  --hatch: repeating-linear-gradient(135deg, rgba(0, 88, 56, 0.09) 0 2px, transparent 2px 9px);
  --rail: 264px;
  --tabbar: 70px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img, svg, canvas { display: block; }
a { color: var(--green); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--body); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--green); color: #fff; padding: 10px 14px; border-radius: var(--r); z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; }
.ic { flex: none; }

/* ---------- paint-chip marks */
.chipmark { display: inline-flex; flex-direction: column; width: 12px; height: 18px; border-radius: 2px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); flex: none; vertical-align: -4px; }
.chipmark i { flex: 1; }
.chipmark i:nth-child(1) { background: var(--c); }
.chipmark i:nth-child(2) { background: color-mix(in srgb, var(--c) 60%, white); }
.chipmark i:nth-child(3) { background: color-mix(in srgb, var(--c) 28%, white); }
.chipmark.sm { width: 9px; height: 13px; vertical-align: -2px; }
.chipmark.md { width: 14px; height: 22px; }
.chipmark.xl { width: 40px; height: 64px; border-radius: 3px; }
.chipmark.tall { width: 6px; height: auto; align-self: stretch; border-radius: 0; box-shadow: none; }

/* ---------- shell */
.shell { min-height: 100vh; min-height: 100dvh; }
.rail { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 3px solid var(--green); }
.topbar .brand-logo { width: 140px; height: auto; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.brand { display: block; line-height: 0; }
.brand-logo { width: 176px; height: auto; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--amber); }
.conn-dot.cloud { background: #1f9d63; }
main { padding: 22px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; outline: none; }
main.enter { animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding-bottom: 11px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a.active { color: var(--green); }
.tabbar a.active::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--green); }
.tab-record-btn { position: absolute; top: -18px; left: 50%; margin-left: -28px; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; box-shadow: 0 0 0 5px var(--surface), 0 8px 18px -6px rgba(0,58,37,.6); }
.tab-record.active::before { display: none; }
.tab-record.active .tab-record-btn { background: var(--red); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--rail) 1fr; }
  .topbar, .tabbar { display: none; }
  .rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 26px 20px 18px; background: var(--surface); border-right: 1px solid var(--line); }
  .product { display: flex; flex-direction: column; gap: 3px; padding: 12px 0 14px; border-top: 3px solid var(--green); border-bottom: 1px solid var(--line-2); }
  .product span { font: 800 15px/1 var(--wide); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
  .product small { font-size: 12.5px; color: var(--muted); }
  .rail-record { width: 100%; }
  .rail-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
  .rail-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--text); text-decoration: none; font-weight: 500; }
  .rail-nav a .ic { color: var(--gray); }
  .rail-nav a:hover { background: var(--sunken); }
  .rail-nav a.active { background: var(--green-50); color: var(--green-800); font-weight: 700; }
  .rail-nav a.active .ic { color: var(--green); }
  .rail-nav a.active::before { content: ''; position: absolute; left: -20px; top: 6px; bottom: 6px; width: 4px; background: var(--green); }
  .nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center; }
  .nav-count:empty { display: none; }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
  main { padding: 38px 48px 64px; width: 100%; }
  .hide-sm { display: inline-flex !important; }
}
.hide-sm { display: none !important; }

.conn, .me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--text); }
.conn { border: 1px solid var(--line); }
.conn span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.conn b { font-size: 13px; }
.conn small { font-size: 12px; color: var(--muted); }
.conn-led { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.cloud .conn-led { background: #1f9d63; box-shadow: 0 0 0 3px var(--green-50); }
.me { font-size: 13.5px; color: var(--gray); }
.me .me-gear { margin-left: auto; color: var(--faint); }
.me:hover, .conn:hover { background: var(--sunken); }
.me.active { background: var(--green-50); color: var(--green-800); }

/* ---------- buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-weight: 700; font-size: 14px; letter-spacing: .01em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.primary, .btn.record { background: var(--green); color: #fff; }
.btn.primary:hover, .btn.record:hover { background: var(--green-700); }
.btn.record .ic { box-sizing: content-box; padding: 4px; margin-left: -6px; border-radius: 50%; background: var(--red); color: #fff; width: 14px; height: 14px; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #b8bdba; background: var(--sunken); }
.btn.ghost .ic { color: var(--gray); }
.btn.ghost-light { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.danger-text, .danger-text .ic { color: var(--red) !important; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 42px; padding: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); border: 0; background: transparent; color: var(--gray); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; }
.row-actions { display: flex; gap: 10px; margin-top: 16px; }
.row-actions.wrap { flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 700; color: var(--gray); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-100); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2358585a' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px !important; }
.fields { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .span2 { grid-column: span 2; }
  .fields.one { grid-template-columns: 1fr; }
}
.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 560px; }
.search .ic { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 40px !important; }
.search.compact { max-width: 320px; }
.search.compact input { min-height: 38px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { position: relative; width: 40px; height: 24px; border-radius: 12px; background: #c3c7c5; transition: background .18s; flex: none; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.toggle input:checked + .toggle-ui { background: var(--green); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-ui { outline: 2.5px solid var(--green); outline-offset: 2px; }

/* ---------- page headers */
.page-head, .today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; padding-bottom: 16px; border-bottom: 2px solid var(--green); position: relative; }
.page-head::after, .today-head::after, .s-head::after { content: ''; position: absolute; right: 0; bottom: -2px; width: 120px; height: 10px; transform: translateY(100%); background: var(--hatch); }
.page-head h1, .today-head h1 { font: 800 27px/1.05 var(--wide); font-stretch: 125%; letter-spacing: .01em; text-transform: uppercase; color: var(--ink); }
.lede { margin-top: 8px; color: var(--muted); max-width: 64ch; }
.ph-actions { display: flex; gap: 10px; flex: none; }
.today-date { font-size: 13.5px; font-weight: 700; color: var(--green); margin-bottom: 6px; }
@media (min-width: 960px) { .page-head h1, .today-head h1 { font-size: 38px; } }
@media (max-width: 640px) { .today-head .ph-actions { display: none; } }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--green-50); border-left: 4px solid var(--green); font-size: 14px; }
.banner .ic { color: var(--green); margin-top: 1px; }
.banner.bad { background: var(--red-soft); border-left-color: var(--red); }
.banner.bad .ic { color: var(--red); }
.banner.subtle { background: var(--sunken); border-left-color: var(--faint); color: var(--muted); }
.banner.subtle .ic { color: var(--faint); }
.banner.answering { align-items: center; background: #f3eef6; border-left-color: #6d4f7b; }
.banner.answering .ic { color: #6d4f7b; }
.banner.answering .btn { margin-left: auto; }

.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; }
.filter span { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.filter:hover { border-color: #b8bdba; }
.filter.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter.on span { color: #b5b8bb; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--green-50); color: var(--green); }
.badge.wait { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.plain { color: var(--faint); border: 1px solid var(--line); font-weight: 600; }
.badge.path { background: var(--sunken); color: var(--gray); border: 1px solid var(--line); }

/* ---------- today */
.today-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span2, .span3 { grid-column: 1 / -1; } }
@media (min-width: 1180px) { .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; } }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel > p { font-size: 14.5px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h2 { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.panel-link { font-size: 13px; font-weight: 700; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel .btn { align-self: flex-start; }
.panel.film { background-image: var(--hatch); }
.panel.film.is-done { background-image: none; }
.big-num { display: flex; align-items: baseline; gap: 10px; }
.big-num b { font: 800 34px/1 var(--wide); font-stretch: 112%; color: var(--ink); font-variant-numeric: tabular-nums; }
.big-num span { font-size: 13.5px; color: var(--muted); }
.meter { height: 10px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); transition: width .4s ease; }
.next-up { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--sunken); border: 1px solid var(--line-2); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.next-up span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.next-up small { font-size: 12px; font-weight: 500; color: var(--muted); }
.next-up .ic { color: var(--faint); }
.next-up .chipmark { flex: 0 0 12px; display: inline-flex; flex-direction: column; }
.next-up:hover { border-color: var(--green); }
.streak { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: #b8481d; }
.streak.big { font-size: 15px; justify-content: center; }
.drill-meta { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.drill-meta b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.q-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.q-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.q-text { font-weight: 600; color: var(--ink); }
.q-list small, .bq small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .q-list li { flex-direction: column; align-items: flex-start; } }
.teach { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.teach li { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.teach-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teach-bar { height: 8px; background: var(--line-2); border-radius: 1px; }
.teach-bar i { display: block; height: 100%; background: var(--green); }
.teach-num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }

/* ---------- library rows */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.rows.compact { border-radius: var(--r); }
.rows-head { display: none; }
.row { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; grid-template-areas: 'chip main main' 'chip job status'; column-gap: 14px; row-gap: 6px; padding: 14px 16px 14px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--text); }
.row:first-child, .rows-head + .row { border-top: 0; }
.row:hover { background: var(--sunken); }
.row:hover .row-title { color: var(--green); }
.row .chipmark.tall { grid-area: chip; }
.row-main { grid-area: main; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-kind { font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.row-title { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.row-sum { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 82ch; }
.row-job { grid-area: job; font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.row-job small { color: var(--muted); font-size: 13px; }
.row-date { display: none; }
.row-status { grid-area: status; justify-self: end; }
@media (min-width: 900px) {
  .rows-head, .row { grid-template-columns: 6px minmax(0, 1fr) 210px 100px 120px; grid-template-areas: 'chip main job date status'; align-items: center; }
  .rows-head { display: grid; column-gap: 14px; padding: 10px 16px 10px 0; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--sunken); border-bottom: 1px solid var(--line); }
  .row-job { flex-direction: column; gap: 0; }
  .row-date { grid-area: date; display: flex; flex-direction: column; font-size: 13px; font-variant-numeric: tabular-nums; }
  .row-date small { color: var(--muted); }
  .row-status { justify-self: start; }
}

.pending { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid #ecd5ae; border-left: 4px solid var(--amber); border-radius: var(--r); }
.pending small { display: block; color: var(--muted); }
.pending-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); background: var(--amber-soft); color: var(--amber); }
.pending-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (min-width: 720px) { .pending { grid-template-columns: auto 1fr auto; } .pending-actions { grid-column: auto; } }

.empty { text-align: center; padding: 56px 20px; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-size: 22px; font-weight: 800; }
.empty p { color: var(--muted); }
.empty.small { padding: 36px 16px; }
.empty.small h2 { font-size: 18px; }
.empty-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.empty-chips .chipmark:nth-child(even) { transform: translateY(8px); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--line-2); color: var(--gray); }

/* ---------- record */
.rec-layout { display: grid; gap: 22px; }
@media (min-width: 1100px) { .rec-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: start; } .rec-layout .console { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 30px; } .rec-layout .setup { grid-column: 1; grid-row: 1; } .rec-layout .prompts { grid-column: 1; grid-row: 2; } }
@media (max-width: 1099px) { .rec-layout .console { order: -2; } .rec-layout .prompts { order: -1; } }
.type-grid { border: 0; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-grid legend { margin-bottom: 10px; padding: 0; }
@media (min-width: 640px) { .type-grid { grid-template-columns: repeat(3, 1fr); } }
.type-grid[disabled] .type-opt:not(:has(input:checked)) { opacity: .4; }
.type-opt { position: relative; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; }
.type-card { display: flex; gap: 11px; align-items: flex-start; height: 100%; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); transition: border-color .15s, background .15s; }
.type-text { display: flex; flex-direction: column; gap: 2px; }
.type-text b { font-size: 14px; color: var(--ink); }
.type-text small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.type-opt input:checked + .type-card { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, white); box-shadow: inset 0 0 0 1px var(--c); }
.type-opt input:focus-visible + .type-card { outline: 2.5px solid var(--green); outline-offset: 2px; }
@media (max-width: 639px) { .type-text small { display: none; } .type-card { align-items: center; } }

.console { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 18px 20px; border-radius: var(--r-lg); color: #e6efea; background: linear-gradient(180deg, #13392a 0%, var(--green-950) 70%); border-top: 4px solid var(--c); overflow: hidden; }
.console-top { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.console-kind { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.console-state { display: inline-flex; align-items: center; gap: 7px; color: #9fb8ab; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.is-live .console-state { color: #fff; }
.is-live .console-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(214,58,44,.3); animation: pulse 1.4s ease-in-out infinite; }
.is-paused .console-state::before { animation: none; background: #9fb8ab; box-shadow: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(214,58,44,0); } }
#wave { width: 100%; height: 86px; }
.timer { font: 700 66px/1 var(--wide); font-stretch: 112%; font-variant-numeric: tabular-nums; color: #fff; }
.console-actions { display: flex; align-items: center; gap: 24px; margin-top: 2px; }
.rec-btn { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer; background: var(--red); color: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.07), 0 0 0 7px rgba(255,255,255,.16); transition: transform .12s ease; }
.rec-btn:hover { transform: scale(1.03); }
.rec-btn:active { transform: scale(.97); }
.rec-btn.stop { background: #fff; color: var(--red); }
.round { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.05); color: #fff; cursor: pointer; }
.round:hover { background: rgba(255,255,255,.12); }
.mark-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.05); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mark-btn:hover { background: rgba(255,255,255,.12); }
.mark-btn .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 3px; background: var(--c); font-size: 12px; }
.console-hint { font-size: 13.5px; color: #a4bcb0; text-align: center; }
.captions { width: 100%; padding: 12px 14px; border-radius: var(--r); }
.captions-head { font-size: 12px; font-weight: 700; color: #c9dbd1; margin-bottom: 6px; }
.prompts { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.prompts-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.prompts-head h2 { font-size: 17px; }
.prompts > ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.prompts > ul li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--sunken); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none; transition: background .15s, border-color .15s, color .15s; }
.prompts > ul li:hover { border-color: var(--green); }
.prompts .tick { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b9bfbc; color: transparent; background: var(--surface); }
.prompts > ul li.asked { background: var(--green-50); border-color: var(--green-100); color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.prompts > ul li.asked .tick { background: var(--green); border-color: var(--green); color: #fff; }
.team-qs { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.team-qs h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #6d4f7b; margin-bottom: 8px; }
.team-qs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-qs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: #f6f2f8; font-weight: 600; font-size: 14px; color: var(--ink); }
.team-qs li small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.more-fields { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.more-fields summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; }
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary small { font-weight: 500; color: var(--muted); font-size: 13px; }
.more-fields summary::after { content: '+'; margin-left: auto; font-size: 20px; line-height: 1; color: var(--green); }
.more-fields[open] summary::after { content: '−'; }
.more-fields .fields { padding: 0 16px 16px; }
.field.mine .label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field.mine .label small { font-weight: 500; color: var(--muted); }
.field.mine textarea { min-height: 84px; resize: vertical; }
.captions { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.captions-head { display: flex; align-items: center; gap: 7px; }
.captions-status { margin-left: auto; font-weight: 500; color: #9fb8ab; }
.cap-text { font-size: 14.5px; line-height: 1.55; color: #f2f8f4; max-height: 132px; overflow-y: auto; }
.cap-text .dim, .interim { color: #94ad9f; }
.import { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding: 16px 18px; border-radius: var(--r); border: 1.5px dashed #c2c7c4; background: var(--surface); }
.import > div { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.import b { color: var(--ink); }
.import .ic { color: var(--green); }
@media (max-width: 639px) { #wave { height: 60px; } .timer { font-size: 54px; } .rec-btn { width: 84px; height: 84px; } }

.rec-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r); background: var(--green-950); color: #fff; text-decoration: none; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.rec-pill[hidden] { display: none; }
.rec-pill-label { font-weight: 500; color: #a4bcb0; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (min-width: 960px) { .rec-pill { bottom: 24px; left: calc(50% + var(--rail) / 2); } }

/* ---------- processing */
.processing { max-width: 560px; margin: 20px auto 0; }
.proc-kind { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.processing h1 { font: 800 26px/1.15 var(--wide); font-stretch: 112%; margin-top: 10px; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; color: var(--faint); font-weight: 600; border-top: 1px solid var(--line-2); }
.steps li:first-child { border-top: 0; }
.step-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c8ccca; justify-self: center; }
.steps li.active { color: var(--ink); background: var(--sunken); }
.steps li.active .step-mark { border-color: var(--green); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--text); }
.steps li.done .step-mark { border: 0; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/14px no-repeat; }
.steps li.failed { color: var(--red); }
.steps li.failed .step-mark { border-color: var(--red); }
.step-detail { font-size: 13px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
#procOut .banner { margin-top: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.3); border-top-color: #fff; }
.loading { display: grid; place-items: center; padding: 80px 0; }

/* ---------- session */
.session { max-width: 940px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.back:hover { color: var(--green); }
.s-head { padding-bottom: 18px; margin-bottom: 26px; border-bottom: 2px solid var(--green); position: relative; }
.s-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kind { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.s-head h1 { font: 800 28px/1.12 var(--wide); font-stretch: 106%; margin: 12px 0 14px; max-width: 28ch; }
@media (min-width: 960px) { .s-head h1 { font-size: 36px; } }
.s-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 18px; }
.s-meta div { display: flex; flex-direction: column; padding-left: 10px; border-left: 2px solid var(--line); }
.s-meta dt { font-size: 12px; font-weight: 600; color: var(--faint); }
.s-meta dd { margin: 0; font-weight: 600; font-size: 14px; }
.s-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; min-width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 40px -18px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.menu-list.right { left: auto; right: 0; }
.menu-list button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 4px; text-align: left; cursor: pointer; font-size: 14px; }
.menu-list button:hover { background: var(--sunken); }
.menu-list button .ic { color: var(--gray); }
.menu-list button.danger, .menu-list button.danger .ic { color: var(--red); }

.player { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.play { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--green); color: #fff; cursor: pointer; flex: none; }
.play.busy { opacity: .6; }
.player-track { position: relative; flex: 1; min-width: 0; }
.player-marks { position: relative; height: 0; }
.player-marks i { position: absolute; top: -15px; width: 3px; height: 10px; margin-left: -1px; background: var(--c); border-radius: 1px; pointer-events: none; }
.player-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--green); margin: 4px 0; }
.player select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: 13px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 11px 12px 12px; border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--green); }
.tabs .on .ic { color: var(--green); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 3px; background: var(--line-2); font-size: 12px; color: var(--gray); font-variant-numeric: tabular-nums; }
.tabs .on .count { background: var(--green-50); color: var(--green); }

.block { margin-bottom: 30px; }
.block h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.block-sub { margin: -4px 0 12px; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.block-head h2 { margin-bottom: 2px; }
.summary { font-size: 17px; line-height: 1.65; max-width: 70ch; }
.ed { border-radius: 3px; outline: none; transition: background .12s, box-shadow .12s; }
.ed:hover { background: color-mix(in srgb, var(--green-50) 70%, transparent); }
.ed:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--green); }
.ed:empty::before { content: 'Empty'; color: var(--faint); }
.moments { display: flex; flex-wrap: wrap; gap: 8px; }
.moment { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.moment .ic { color: var(--c); }
.moment:hover { border-color: var(--green); }
.takeaways { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: t; max-width: 72ch; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.takeaways li { counter-increment: t; display: grid; grid-template-columns: 38px 1fr; align-items: baseline; padding: 12px 16px 12px 0; border-top: 1px solid var(--line-2); font-size: 15.5px; }
.takeaways li:first-child { border-top: 0; }
.takeaways li::before { content: counter(t); justify-self: center; font: 800 15px var(--wide); font-stretch: 112%; color: var(--green); }
.glossary { display: grid; margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.glossary div { display: grid; gap: 2px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.glossary div:first-child { border-top: 0; }
@media (min-width: 640px) { .glossary div { grid-template-columns: 210px 1fr; gap: 16px; } }
.glossary dt { font-weight: 700; color: var(--ink); }
.glossary dd { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 3px 9px; border-radius: 3px; background: var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--gray); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 10px; }
.grid { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.grid th { text-align: left; font-size: 12px; font-weight: 700; color: var(--gray); padding: 10px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #fafbfa; }
.grid .ed { display: block; min-height: 22px; margin: -3px -5px; padding: 3px 5px; }
.w-xs { width: 90px; }
.w-sm { width: 140px; }
.w-check { width: 40px; }
.w-del { width: 44px; text-align: right; }
.grid td.w-del .icon-btn { opacity: .35; }
.grid tr:hover td.w-del .icon-btn, .grid td.w-del .icon-btn:focus-visible { opacity: 1; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.strong { font-weight: 700; color: var(--ink); }
.grid tr.done td:not(.w-check) { color: var(--faint); text-decoration: line-through; }
.grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); }
.empty-row td { color: var(--faint); text-align: center; padding: 18px; }
.grid.pb td.src a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; min-width: 190px; }
.grid.pb td.src a:hover span { color: var(--green); text-decoration: underline; }
.ver { color: var(--green); }

.transcript { max-width: 72ch; font-size: 15.5px; line-height: 1.75; display: flex; flex-direction: column; gap: 12px; }
.spk { font-weight: 800; color: var(--green); }
mark { background: #fde58a; color: inherit; border-radius: 2px; }

.quiz { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.card-q { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r); }
.card-q.right { border-left-color: var(--green); }
.card-q.wrong { border-left-color: var(--red); }
.q { display: flex; gap: 10px; font-size: 16.5px; font-weight: 700; color: var(--ink); margin-bottom: 12px; line-height: 1.35; }
.q-num { font: 800 16px var(--wide); font-stretch: 112%; color: var(--green); }
.opts { display: grid; gap: 8px; }
@media (min-width: 640px) { .opts:not(.stack) { grid-template-columns: 1fr 1fr; } }
.opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--sunken); text-align: left; cursor: pointer; font-size: 14.5px; font-weight: 500; }
.opt:hover:not([disabled]) { border-color: var(--green); background: var(--surface); }
.opt[disabled] { cursor: default; }
.opt-key { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--gray); flex: none; }
.opt.is-answer { border-color: var(--green); background: var(--green-50); }
.opt.is-answer .opt-key { background: var(--green); border-color: var(--green); color: #fff; }
.opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.opt.is-wrong .opt-key { background: var(--red); border-color: var(--red); color: #fff; }
.explain, .reveal { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; margin-top: 12px; font-size: 14.5px; }
.explain.ok .ic { color: var(--green); align-self: center; }
.reveal { padding: 12px; border-radius: var(--r); background: var(--green-50); }
.score { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-lg); background: var(--green-950); color: #cfe0d6; max-width: 760px; }
.score b { font: 800 26px var(--wide); font-stretch: 112%; color: #fff; }
.score .btn { margin-left: auto; }
.s-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.check-row { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--green); }

/* ---------- checklists */
.checklists { display: grid; gap: 14px; }
@media (min-width: 900px) { .checklists { grid-template-columns: 1fr 1fr; } }
.checklist { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--r); }
.checklist-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.checklist-head h2 { font-size: 16px; font-weight: 800; }
.checklist-head .icon-btn { margin-left: auto; }
.checklist ul { list-style: none; margin: 0; padding: 4px 0; }
.checklist li label { display: flex; gap: 12px; padding: 9px 16px; cursor: pointer; font-size: 14.5px; }
.checklist li label:hover { background: var(--sunken); }
.checklist input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.checklist input:checked + span { color: var(--faint); text-decoration: line-through; }
.src-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.src-link:hover { color: var(--green); text-decoration: underline; }

/* ---------- path */
.path-hero { display: grid; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 26px; }
@media (min-width: 760px) { .path-hero { grid-template-columns: auto 1fr; align-items: center; gap: 36px; } }
.path-who { font-size: 13.5px; color: var(--muted); }
.ph-left, .ph-right { display: grid; gap: 8px; }
.ph-stats { display: flex; gap: 20px; font-size: 13px; color: var(--muted); }
.ph-stats b { color: var(--ink); }
.path { list-style: none; padding: 0; margin: 0; }
.milestone { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding-bottom: 26px; }
.milestone::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 10px); }
.milestone:last-child::before { display: none; }
.ms-mark { width: 34px; height: 34px; border-radius: 4px; background: var(--surface); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 14px var(--wide); font-stretch: 112%; color: var(--ink); position: relative; z-index: 1; }
.milestone.complete .ms-mark { background: var(--green); border-color: var(--green); color: #fff; }
.milestone.complete::before { background: var(--green); }
.ms-head { position: relative; padding-right: 60px; }
.ms-when { font-size: 12.5px; font-weight: 800; color: var(--green); letter-spacing: .02em; }
.ms-head h2 { font: 800 20px/1.2 var(--wide); font-stretch: 106%; margin: 2px 0; }
.ms-head p { color: var(--muted); font-size: 14.5px; }
.ms-count { position: absolute; top: 0; right: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-list { list-style: none; padding: 0; margin: 12px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ms-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line-2); }
.ms-list li:first-child { border-top: 0; }
.ms-title { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.ms-title:hover span { color: var(--green); text-decoration: underline; }
.ms-check input { position: absolute; opacity: 0; }
.ms-check span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; border: 2px solid #bfc4c1; cursor: pointer; background: var(--surface); }
.ms-check input:checked + span { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--green); }
.ms-check input:focus-visible + span { outline: 2.5px solid var(--green); outline-offset: 2px; }
.score-chip { font-size: 12.5px; font-weight: 800; padding: 2px 8px; border-radius: 3px; background: var(--amber-soft); color: var(--amber); font-variant-numeric: tabular-nums; }
.score-chip.good { background: var(--green-50); color: var(--green); }
.quiz-link { font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.ms-empty { margin-top: 10px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: var(--r); font-size: 14px; color: var(--muted); }

/* ---------- drill */
.drill { max-width: 640px; margin: 0 auto; }
.drill-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.drill-top .back { margin: 0; }
.drill-progress { display: flex; gap: 5px; }
.drill-progress i { width: 30px; height: 6px; border-radius: 1px; background: var(--line); }
.drill-progress i.done { background: var(--green); }
.drill-progress i.now { background: var(--ink); }
.drill-from { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.drill-q { font: 800 25px/1.25 var(--wide); font-stretch: 106%; margin-bottom: 22px; }
.drill .opt { padding: 14px; font-size: 15.5px; }
.drill .next { margin-top: 18px; }
.drill-done { text-align: center; display: grid; gap: 12px; padding: 36px 0; }
.drill-score { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.drill-score b { font: 800 72px/1 var(--wide); font-stretch: 125%; color: var(--green); }
.drill-score span { font-size: 18px; color: var(--muted); }

/* ---------- ask and bench */
.ask-box { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r-lg); max-width: 820px; }
.ask-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-100); }
.ask-ic { color: var(--faint); }
.ask-box textarea { border: 0 !important; box-shadow: none !important; font-size: 16px; min-height: 44px !important; padding: 10px 4px !important; resize: none; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 22px; max-width: 820px; }
.answers { display: flex; flex-direction: column; gap: 14px; max-width: 820px; margin-bottom: 30px; }
.answer { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--r); }
.answer.bad { border-left-color: var(--red); }
.aq { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.aa { display: flex; flex-direction: column; gap: 10px; font-size: 15.5px; line-height: 1.65; }
.aa sup { font-size: 11px; font-weight: 800; color: var(--green); }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.sources a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 4px; background: var(--sunken); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.sources a:hover { border-color: var(--green); }
.answer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.shimmer { height: 14px; border-radius: 2px; margin: 10px 0; background: linear-gradient(90deg, var(--line-2), #f6f7f6, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.shimmer.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.bench { max-width: 820px; padding-top: 24px; border-top: 2px solid var(--ink); }
.bench-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bench-head h2 { font: 800 19px var(--wide); font-stretch: 112%; text-transform: uppercase; letter-spacing: .01em; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.seg span { font-weight: 500; opacity: .75; }
.bench-new { display: flex; gap: 8px; margin-bottom: 14px; }
@media (max-width: 640px) { .bench-new { flex-direction: column; } }
.bench-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.bench-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.bench-list li:first-child { border-top: 0; }
.bq-actions { display: flex; align-items: center; gap: 4px; flex: none; }
@media (max-width: 640px) { .bench-list li { flex-direction: column; align-items: flex-start; } }
.bench-empty { padding: 14px 0; }

/* ---------- settings */
.settings { display: grid; gap: 14px; max-width: 720px; }
.set-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; gap: 12px; }
.set-card h2 { font-size: 16px; font-weight: 800; }
.conn-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--sunken); border: 1px solid var(--line-2); }
.conn-row .conn-led { margin-top: 6px; }
.conn-row small { display: block; color: var(--muted); margin-top: 2px; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* ---------- modal and toast */
#layer { position: relative; z-index: 60; }
.modal-wrap { position: fixed; inset: 0; display: grid; align-items: end; justify-items: center; background: rgba(13,33,26,.5); animation: fade .18s ease; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
.modal { width: 100%; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 12px 12px 0 0; border-top: 4px solid var(--green); padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); animation: sheet .24s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 640px) {
  .modal-wrap { align-items: center; padding: 24px; }
  .modal { max-width: 450px; border-radius: var(--r-lg); padding: 26px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
  .modal.wide { max-width: 620px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
.m-title { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.m-body { color: var(--muted); margin-bottom: 18px; }
.m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.m-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 10px 0; }
.welcome-top { padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.welcome .m-title { font: 800 21px/1.15 var(--wide); font-stretch: 112%; text-transform: uppercase; }
.welcome .btn.block { margin-top: 6px; }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); animation: toast .22s ease; max-width: 90vw; }
.toast .ic { color: var(--mint); }
.toast.error .ic { color: #ff9a8f; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .4s; }
@keyframes toast { from { opacity: 0; transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- v1.2 additions */
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--line-2); }
.lang button { min-width: 38px; height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; font: 700 12.5px/1 var(--body); letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--surface); color: var(--green-800); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.lang.big button { height: 40px; min-width: 120px; font-size: 14px; letter-spacing: 0; }
.rail-foot .lang { align-self: flex-start; margin: 4px 0 2px 2px; }
.topbar-right .lang { margin-right: 4px; }
.product { flex-direction: row !important; align-items: center; gap: 11px !important; }
.product img { border-radius: 8px; flex: none; }
.product span { display: flex; flex-direction: column; gap: 4px; }
.product span small { font: 500 12px/1.3 var(--body); letter-spacing: 0; text-transform: none; font-stretch: 100%; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.banner.warn { align-items: center; background: var(--amber-soft); border-left-color: var(--amber); }
.banner.warn .ic { color: var(--amber); }
.banner.warn .btn, .banner.es .btn { margin-left: auto; flex: none; }
.banner.es { align-items: center; background: #eef3f8; border-left-color: #3e5c78; }
.banner.es .ic { color: #3e5c78; }
.mine-text { padding: 12px 14px; border-radius: var(--r); background: #fffbea; border: 1px solid #efe2b3; }
.ask-one h2 { display: flex; align-items: center; gap: 8px; }
.ask-box.small { display: flex; gap: 8px; margin-top: 10px; }
.ask-box.small input { flex: 1; }
#oneOut .answer { margin-top: 12px; }
.ask-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; }
.ask-steps span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--gray); }
.ask-steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; }
.suggest .muted { align-self: center; margin-right: 2px; }
.similar { margin: 10px 0 4px; padding: 12px 14px; border-radius: var(--r); background: #fffbea; border: 1px solid #efe2b3; }
.similar ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.similar li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.similar li span { flex: 1; }
.similar li .ic { color: var(--amber); flex: none; }
.metoo .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--green-50); color: var(--green); font-size: 12px; }
.bq-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.install-row { display: flex; gap: 16px; align-items: center; }
.install-row img { border-radius: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.15); flex: none; }
.welcome-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.welcome-icon { display: block; margin: 18px 0 4px; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,58,37,.25); }
@media (max-width: 639px) { .topbar .brand-logo { width: 128px; height: auto; } .bench-list li { flex-direction: column; align-items: stretch; } .bq-actions { justify-content: flex-start; } .ask-steps { display: none; } }
