:root {
  --ink: #16202e; --ink-2: #2b3a4f; --paper: #fbf8f3; --card: #ffffff; --line: #e7e1d6; --muted: #6b7280;
  --accent: #e8833a; --accent-soft: #fdf0e6; --ok: #15803d; --ok-soft: #e8f6ec; --warn: #b45309; --warn-soft: #fef3e2;
  --bad: #b91c1c; --bad-soft: #fdecec; --info: #1d4ed8; --info-soft: #eaf0fe; --violet: #6d28d9; --violet-soft: #f1ebfe;
  --radius: 14px; --shadow: 0 1px 2px rgba(22,32,46,.06), 0 4px 16px rgba(22,32,46,.06);
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 4.4vw, 46px); line-height: 1.08; }
h2 { font-size: 22px; } h3 { font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: var(--ink); color: #f3efe8; box-shadow: 0 2px 10px rgba(0,0,0,.15); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .dev { font-family: var(--serif); font-size: 24px; color: var(--accent); }
.brand .name { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.brand .tag { font-size: 12px; color: #b9c2cf; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.08); color: #e5e7eb; border: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.chip.on .dot { background: #4ade80; } .chip.off .dot { background: #fbbf24; }
.topbar select { background: var(--ink-2); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 4px 8px; }
.btn-guide { background: var(--accent); color: #1b1206; border: 0; border-radius: 999px; padding: 6px 14px; font-weight: 600; }

/* layout */
main { max-width: 1200px; margin: 0 auto; padding: 22px 20px 80px; }
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: 16px 16px 90px; } .brand .tag { display: none; }
  .topbar { gap: 6px; padding: 8px 12px; } .topbar .spacer { display: none; } .brand { flex: 1; } .chip { font-size: 11px; padding: 2px 8px; order: 5; }
  .btn-guide { padding: 5px 10px; font-size: 13px; } .topbar select { padding: 3px 6px; font-size: 13px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* buttons & fields */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 14px; font-weight: 500; }
.btn:hover { border-color: #cfc6b6; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.accent { background: var(--accent); color: #1b1206; border-color: var(--accent); font-weight: 600; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.bad { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: wait; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
textarea.field { min-height: 84px; resize: vertical; }
.field:focus { outline: 2px solid #f3c7a3; border-color: var(--accent); }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.toggle button { border: 0; background: transparent; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--muted); }
.toggle button.on { background: var(--ink); color: #fff; }
.toggle button.on.off-state { background: #9ca3af; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 18px; display: inline-grid; place-items: center; }
.iconbtn.rec { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.sample { border: 1px dashed #d6ccbb; background: #fffdf8; color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-verified { background: var(--ok-soft); color: var(--ok); } .b-tested { background: var(--info-soft); color: var(--info); }
.b-unreviewed { background: var(--warn-soft); color: var(--warn); } .b-failed { background: var(--bad-soft); color: var(--bad); }
.b-public { background: var(--violet-soft); color: var(--violet); } .b-site { background: #e0f2fe; color: #0369a1; }
.b-src { background: #f4f1ea; color: #57534e; font-weight: 500; } .b-high { background: var(--bad-soft); color: var(--bad); }
.b-medium { background: var(--warn-soft); color: var(--warn); } .b-low { background: var(--ok-soft); color: var(--ok); }
.b-attested { background: var(--info-soft); color: var(--info); } .b-self { background: #f3f4f6; color: #4b5563; }

/* home */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: end; margin: 8px 0 22px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hero .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; color: var(--accent); }
.hero p.lead { font-size: 17px; color: var(--ink-2); max-width: 560px; }
.loop { display: flex; gap: 8px; flex-wrap: wrap; }
.loop .step { flex: 1 1 140px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.loop .step b { display: block; font-family: var(--serif); font-size: 16px; }
.ind-card { position: relative; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; gap: 6px; min-height: 172px;
  transition: transform .15s ease, box-shadow .15s ease; border-top: 5px solid var(--c, var(--accent)); }
.ind-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22,32,46,.12); }
.ind-card .ico { font-size: 30px; }
.ind-card .meta { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.soon { opacity: .6; border-style: dashed; box-shadow: none; min-height: 0; }
.roi { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) 1.2fr; gap: 10px; align-items: end; }
@media (max-width: 820px) { .roi { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.roi .out { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; }
.roi .out b { font-family: var(--serif); font-size: 26px; color: var(--accent); display: block; }

/* industry / role */
.banner { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 12px; padding: 10px 14px; font-weight: 500; }
.role-card { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.role-card:hover { border-color: var(--accent); }
.role-card .tools { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }

/* workspace */
.ws { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; align-items: start; }
.side { position: sticky; top: 74px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.side .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.side a.on { background: var(--accent-soft); color: #9a4a12; }
.side a:hover { background: #f6f2ea; }
@media (max-width: 860px) {
  .ws { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 25; border-radius: 0; display: flex; overflow-x: auto; padding: 6px; gap: 2px; }
  .side .who { display: none; }
  .side a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; white-space: nowrap; }
}
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head p { margin: 0; }

/* answer */
.trust { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.trust.verified { background: var(--ok-soft); color: var(--ok); } .trust.partial { background: var(--warn-soft); color: var(--warn); }
.trust.new, .trust.off { background: #f3f4f6; color: #4b5563; }
.answer h3 { margin-top: 14px; }
.answer ol, .answer ul { padding-left: 20px; margin: 6px 0; }
.answer li { margin: 4px 0; }
.ref { display: inline-block; font-family: var(--mono); font-size: 11px; background: #f4f1ea; border-radius: 6px; padding: 0 5px; margin-left: 4px; cursor: pointer; }
.first { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.avoid li { color: var(--bad); }
.tipbox { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 14px; }
.mem { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.mem + .mem { margin-top: 8px; }
.mem .top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.mem .who { font-weight: 600; font-size: 13px; }
.mem.hl { outline: 2px solid var(--accent); }
.mem details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.guided { list-style: none; padding: 0; }
.guided li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: #fff; }
.guided li.done { background: var(--ok-soft); border-color: #bbe5c8; text-decoration: line-through; color: #3f6f4d; }
.guided input { width: 20px; height: 20px; margin-top: 2px; }

/* tables / misc */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid #f1ece3; vertical-align: top; }
.scroll { overflow-x: auto; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.kpi .delta { font-size: 12px; font-weight: 600; color: var(--ok); }
.heat td.c { text-align: center; font-weight: 600; border-radius: 6px; }
.chartbox { position: relative; height: 280px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; max-width: 380px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.alert { background: var(--bad); }
@media (max-width: 860px) { .toast { bottom: 76px; left: 16px; right: 16px; } }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 3px solid #e5dccd; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.quiz-opt { display: block; width: 100%; text-align: left; margin: 6px 0; }
.quiz-opt.right { background: var(--ok-soft); border-color: var(--ok); } .quiz-opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.passport { border: 2px solid var(--ink); border-radius: 18px; padding: 22px; background: linear-gradient(180deg, #fff 0%, #fffaf3 100%); }
.passport .seal { font-family: var(--serif); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.checklist .phase { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.checklist label { display: flex; gap: 10px; padding: 5px 0; align-items: flex-start; }
.checklist label.local { color: #0f766e; }
.sensor-legend span { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: 13px; }
.sensor-legend i { width: 12px; height: 3px; display: inline-block; border-radius: 2px; }

/* guide */
.guide { position: fixed; right: 18px; top: 74px; z-index: 50; width: 360px; max-height: calc(100vh - 100px); overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(22,32,46,.22); padding: 16px; }
@media (max-width: 620px) { .guide { left: 12px; right: 12px; width: auto; top: auto; bottom: 76px; max-height: 60vh; } }
.guide .story { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; cursor: pointer; }
.guide .story.on { border-color: var(--accent); background: var(--accent-soft); }
.guide .stepnow { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px; margin-top: 10px; }

/* easy mode: help line, hints, grouped sidebar, simple answer */
.help { background: #f4f1ea; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.hints { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.hints ol { margin: 6px 0 8px; padding-left: 20px; } .hints li { margin: 3px 0; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 10px 2px; }
@media (max-width: 860px) { .side .grp { display: none; } }
.btn.big { padding: 12px 20px; font-size: 16px; border-radius: 12px; }
.role-card.rec { border: 2px solid var(--ok); }
.trust.offtopic { background: var(--bad-soft); color: var(--bad); }
.mvt { margin-top: 10px; background: var(--violet-soft); border-left: 4px solid var(--violet); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.partsbox { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.expertbox { margin-top: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
details.why { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
details.why > summary, details.also > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14px; padding: 4px 0; }
details.also { margin-top: 10px; } details.also .mem { opacity: .75; }
.b-manual { background: var(--violet-soft); color: var(--violet); } .b-insight { background: #e0f2fe; color: #0369a1; }
.mem.insight { background: #f5fbff; }

.home-roi { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: baseline; margin-top: 14px; font-size: 14px; }
.home-roi b { color: var(--accent); font-size: 17px; }
.kpi.big b { font-size: 24px; }

/* my machines */
.mcard { text-decoration: none; display: flex; flex-direction: column; gap: 2px; transition: transform .15s ease; }
.mcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.src { display: flex; flex-direction: column; gap: 6px; box-shadow: none; padding: 12px; cursor: pointer; }
.src input[type=file] { font-size: 12px; max-width: 100%; }
.mhead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.health { border-radius: 12px; padding: 10px 14px; min-width: 210px; }
.health.green { background: var(--ok-soft); color: var(--ok); } .health.amber { background: var(--warn-soft); color: var(--warn); }
.health.red { background: var(--bad-soft); color: var(--bad); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.li { padding: 8px 0; border-bottom: 1px solid #f1ece3; } .li:last-child { border-bottom: 0; }
.sticker { display: flex; gap: 20px; align-items: center; max-width: 560px; border: 2px dashed var(--ink); }
.sticker .qr img { display: block; border-radius: 8px; background: #fff; }
@media (max-width: 620px) { .sticker { flex-direction: column; text-align: center; } }

/* print (SOP / passport → PDF) */
@media print {
  .topbar, .side, .no-print, .guide, .toast { display: none !important; }
  main { padding: 0; max-width: none; } .ws { display: block; } .card { box-shadow: none; border: 0; }
  body { background: #fff; }
  .tabs, .crumbs, .mhead, .help, .banner { display: none !important; }
  .sticker { border: 2px dashed #000 !important; }
}

/* key specs grid (green = checked in the source, orange = check it, red = looks wrong) */
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.sf { border: 1px solid var(--line, #e5e7eb); border-left: 4px solid #d1d5db; border-radius: 8px; padding: 6px 8px; background: #fff; min-width: 0; }
.sf.verified, .sf.converted { border-left-color: var(--ok); } .sf.unverified { border-left-color: var(--warn); background: #fffaf0; }
.sf.suspicious { border-left-color: var(--bad); background: #fff5f5; } .sf.edited { border-left-color: var(--info); } .sf.missing { opacity: .75; }
.sf-l { font-size: 12px; font-weight: 600; margin-bottom: 3px; } .sf .field { padding: 5px 7px; font-size: 13px; }
.sf-q { margin-top: 3px; overflow-wrap: anywhere; } .readp { background: #f8fafc; margin-top: 8px; }
.bench td, .bench th { font-size: 12px; }

/* the "listening" bar while recording */
.listen { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; width: min(560px, calc(100vw - 24px));
  background: #111827; color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.listen .btn { background: #fff; color: #111; } .listen .lv-txt { margin-top: 6px; color: #d1d5db; min-height: 18px; overflow-wrap: anywhere; }
.listen .lv-txt i { color: #fff; font-style: normal; }
.listen .lvl { flex: 1; height: 8px; background: #374151; border-radius: 6px; overflow: hidden; min-width: 60px; }
.listen .lvl i { display: block; height: 100%; width: 0; background: #4ade80; transition: width .08s linear; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: pulse 1s infinite; flex: none; }
.rec-dot.busy { background: #fbbf24; }

/* side drawer: manual page, part details, vendor message (full screen on phones) */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100vw); background: #fff; z-index: 70; padding: 14px 16px;
  overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,.18); }
.pg-text { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; background: #f8fafc; padding: 10px; border-radius: 8px; }
.pg-text mark { background: #fde68a; padding: 1px 2px; border-radius: 3px; }
a.pg { white-space: nowrap; font-size: 12px; }
.chip-part { border: 1px solid var(--line, #e5e7eb); background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.chip-part:hover { border-color: var(--accent); }
.lvl-bar { height: 8px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin: 4px 0; }
.lvl-bar i { display: block; height: 100%; background: var(--accent); }

/* smart diagnosis bars */
.diag { margin-top: 10px; background: #f8fafc; }
.prow { display: flex; align-items: center; gap: 10px; margin: 5px 0; flex-wrap: wrap; }
.pbar { flex: 1; min-width: 80px; height: 9px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); }
.pbar.overdue i { background: var(--bad); } .pbar.soon i { background: var(--warn); } .pbar.ok i { background: var(--ok); }
.chip-part.on { border-color: var(--accent); background: #fff7ed; }

/* ===== simple for everyone, deep for engineers ===== */
.eng-only { display: none !important; }
body.eng .eng-only { display: revert !important; }
body.eng details.eng-only, body.eng .row.eng-only { display: block !important; }
body.eng .row.eng-only { display: flex !important; }
body.eng .simple-only { display: none !important; }
.topbtn { background: transparent; color: #f3efe8; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 4px 9px; font-weight: 700; min-width: 36px; min-height: 32px; }
.topbtn.on { background: var(--accent); color: #1b1206; border-color: var(--accent); }
.langpick { display: inline-flex; align-items: center; gap: 4px; color: #f3efe8; }
body.big { font-size: 18px; } body.big .small { font-size: 16px; } body.big .tiny { font-size: 14px; } body.big .btn { padding: 11px 18px; }
body.big .side a { font-size: 17px; } body.big h2 { font-size: 26px; } body.big .field { padding: 12px 14px; }

/* ask: one big question box */
.askhero { padding: 22px; border-top: 4px solid var(--accent); }
.ask-title { font-size: 28px; }
.ask-actions { display: flex; gap: 12px; margin: 12px 0; }
.bigmic, .bigcam { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 18px; border: 0; cursor: pointer; }
.bigmic { flex: 2; min-height: 104px; background: var(--accent); color: #1b1206; box-shadow: 0 6px 18px rgba(232,131,58,.35); }
.bigmic span { font-size: 40px; line-height: 1; } .bigmic b { font-size: 17px; }
.bigmic.rec { background: #ef4444; color: #fff; animation: pulse 1s infinite; }
.bigcam { flex: 1; min-height: 104px; background: #fff; border: 2px solid var(--line); color: var(--ink); }
.bigcam span { font-size: 34px; line-height: 1; }
.bigfield { min-height: 70px; font-size: 16px; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; min-height: 48px; }

/* answer: action first */
.doit { margin: 14px 0 8px; padding: 14px 16px; background: #fff7ed; border: 2px solid var(--accent); border-radius: 14px; }
.doit-k { display: block; font-size: 13px; font-weight: 700; color: #9a4a12; text-transform: uppercase; letter-spacing: .05em; }
.doit-v { display: block; font-size: 20px; font-weight: 600; line-height: 1.35; margin-top: 2px; }
.ans-sum { font-size: 15px; margin: 10px 0; }
.usually { background: #f1f5f9; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.checklist { list-style: none; padding: 0; margin: 6px 0; }
.checklist li { border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; background: #fff; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.checklist input { width: 24px; height: 24px; flex: none; margin-top: 1px; accent-color: var(--ok); }
.checklist li.done { background: var(--ok-soft); border-color: #bbdec6; } .checklist li.done span { text-decoration: line-through; color: var(--muted); }
.safety { margin-top: 10px; background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.fbbox { margin-top: 16px; background: #fbf8f3; border: 2px solid var(--line); }
.fb-q { font-size: 18px; }
.fb-btns { margin-top: 10px; } .fb-btns .btn { flex: 1; min-width: 150px; }
.fb-more summary, details.why summary, details.trace summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
details.why { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.trace-list { margin: 6px 0 8px 18px; padding: 0; } .trace-list li { margin: 4px 0; }

/* welcome (first visit) */
.welcome { position: fixed; inset: 0; z-index: 90; background: rgba(22,32,46,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.welcome-box { background: #fff; border-radius: 20px; padding: 22px; width: min(640px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.brand-w { font-family: var(--serif); font-size: 22px; font-weight: 600; } .brand-w .dev { color: var(--accent); }
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.langbtn { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px; font-size: 16px; min-height: 46px; }
.langbtn.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.how3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.how3 > div { background: #f8fafc; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.how3 .pic { font-size: 40px; line-height: 1.1; }
@media (max-width: 560px) { .how3 { grid-template-columns: 1fr; } .how3 > div { flex-direction: row; text-align: left; align-items: center; gap: 10px; } .how3 .pic { font-size: 30px; } }

/* sidebar: few items + More tools */
.side details.more summary { padding: 9px 10px; border-radius: 10px; font-weight: 600; color: var(--ink-2); font-size: 14px; list-style: none; cursor: pointer; }
.side details.more summary::-webkit-details-marker { display: none; }
.side .more-m { display: none !important; }
@media (max-width: 860px) {
  .side details.more { display: none; }
  .side .more-m { display: flex !important; }
  .side { justify-content: space-around; }
  .side a { min-width: 64px; font-size: 12px; padding: 8px 6px; } .side a span:first-child { font-size: 22px; }
}
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.sheet-item { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.sheet-item span:first-child { font-size: 24px; }

/* read aloud button, footer, empty states */
.fab { position: fixed; left: 18px; bottom: 22px; z-index: 40; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 24px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .fab { bottom: 86px; left: 12px; width: 48px; height: 48px; } }
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 40px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot a { color: var(--ink-2); text-decoration: none; } .foot a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 28px; } .empty-state .btn { margin-top: 8px; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.flow span { background: #f1f5f9; border-radius: 8px; padding: 6px 10px; } .flow b { color: var(--accent); }
/* touch targets */
@media (pointer: coarse) { .btn { min-height: 44px; } .btn.sm { min-height: 36px; } .field { min-height: 44px; } }

@media (max-width: 620px) { .btn-guide { font-size: 0; padding: 6px 10px; } .btn-guide::before { content: "▶ Guide"; font-size: 13px; }
  .langpick select { max-width: 104px; } .topbtn { min-width: 32px; padding: 3px 7px; } }

/* Stage 4 */
.capture2 { margin-bottom: 4px; } .bigcap { display: flex; flex-direction: column; gap: 4px; cursor: pointer; border: 2px dashed var(--line); }
.bigcap:hover { border-color: var(--accent); } .bigcap .pic { font-size: 34px; line-height: 1.1; } .bigcap b { font-size: 16px; }
.lbt .field { padding: 5px 7px; font-size: 13px; min-width: 110px; }
.vg-steps { padding-left: 20px; } .vg-steps li { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.vg-steps img { width: 150px; border-radius: 8px; flex: none; } .vg-steps.view li div { font-size: 15px; }
@media (max-width: 560px) { .vg-steps li { flex-direction: column; } .vg-steps img { width: 100%; } }
.expertline { margin: 10px 0 0; background: #eef2ff; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.safetygate { margin-top: 14px; border: 2px solid var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; }
.safetygate label { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; font-size: 15px; }
.safetygate input { width: 22px; height: 22px; flex: none; accent-color: var(--ok); }
.safetygate.done { border-color: var(--ok); background: var(--ok-soft); }
.checklist.locked { opacity: .45; } .checklist.locked label { cursor: not-allowed; }
.moreopts summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 8px 0 0; }
th.solo { background: var(--bad-soft); color: var(--bad); } td.solo-cell { outline: 2px solid var(--bad); outline-offset: -2px; }
.skillgraph { width: 100%; height: auto; max-height: 300px; }
@media print { .drawer { position: static; box-shadow: none; width: auto; height: auto; } }

/* Stage 5: hands-free + briefing */
.handsfree { position: fixed; inset: 0; z-index: 95; background: #16202e; color: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; padding: 24px 16px; overflow-y: auto; text-align: center; }
.hf-x { position: absolute; top: 14px; right: 14px; }
.hf-state { font-size: 20px; font-weight: 600; max-width: 560px; }
.hf-btn { width: min(70vw, 260px); height: min(70vw, 260px); border-radius: 50%; border: 0; background: var(--accent); color: #1b1206;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 0 0 14px rgba(232,131,58,.18); }
.hf-btn span { font-size: 72px; line-height: 1; } .hf-btn b { font-size: 20px; }
.hf-btn.rec { background: #ef4444; color: #fff; animation: pulse 1s infinite; }
.hf-text { max-width: 620px; font-size: 18px; text-align: left; } .hf-first { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.hf-step { margin: 6px 0; } .handsfree .safety { color: var(--ink); }
.hf-fb .btn { min-width: 160px; }
.brief { border-left: 5px solid var(--accent); margin-bottom: 12px; }

/* Stage 6: the machine calls first, other plants, connect your AI */
#alerts { margin-bottom: 12px; }
.alertbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fef2f2;
  border: 1px solid #fecaca; border-left: 6px solid var(--bad); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; color: #7f1d1d; }
.alertbar .al-main { flex: 1; min-width: 220px; } .alertbar .al-btns { gap: 6px; }
.alertbar b:first-child { animation: alpulse 1.6s ease-in-out infinite; }
@keyframes alpulse { 50% { opacity: .55; } }
.net { border-left: 5px solid #2563eb; } .net-row { margin: 8px 0; }
.cx-link { border-top: 4px solid var(--accent); }
