:root {
  --bg: #f6f8fb;
  --ink: #102033;
  --muted: #5d6c7c;
  --line: #d9e1ea;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-2: #2563eb;
  --warm: #f59e0b;
  --dash-bg: #07111f;
  --dash-panel: rgba(15, 23, 42, .82);
  --dash-panel-2: rgba(13, 35, 58, .72);
  --dash-line: rgba(148, 163, 184, .22);
  --dash-text: #e8f3ff;
  --dash-muted: #9fb2c8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
.page { min-height: 100vh; padding: 24px; }
.mobile { max-width: 720px; margin: 0 auto; padding: 20px; }
.hero { margin: 8px 0 24px; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 8px 0 10px; font-size: clamp(30px, 5vw, 64px); line-height: 1.05; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 22px; }
p { color: var(--muted); line-height: 1.6; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 8px 24px rgba(16, 32, 51, .06); }
.field { margin: 18px 0; }
label, legend { display: block; font-weight: 750; margin: 0 0 10px; }
input[type="text"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
.options { display: grid; gap: 10px; }
.option { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; background: #fff; }
.option input { margin-top: 3px; flex: 0 0 auto; }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.range-value { width: 44px; height: 44px; border-radius: 8px; background: #e8f5f3; color: var(--brand); display: grid; place-items: center; font-size: 24px; font-weight: 900; }
.btn { border: 0; border-radius: 8px; padding: 13px 18px; background: var(--brand); color: #fff; font-weight: 850; cursor: pointer; }
.btn.secondary { background: #e8eef6; color: var(--ink); }
.btn.danger { background: #dc2626; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.success { display: none; margin-top: 18px; border-color: #b8e3d8; background: #effbf7; }
.survey-shell { min-height: 100vh; display: flex; flex-direction: column; }
.survey-hero { margin-bottom: 14px; }
.survey-hero h1 { font-size: clamp(32px, 9vw, 50px); }
.survey-card { padding: 18px; }
.survey-top { margin-bottom: 18px; }
.step-label { font-weight: 900; color: var(--brand); margin-bottom: 10px; }
.progress { height: 9px; border-radius: 999px; background: #e5edf5; overflow: hidden; }
.progress-fill { height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .25s ease; }
.question-page { display: none; min-height: 390px; }
.question-page.active { display: block; }
.question-hint { margin: -4px 0 16px; font-size: 14px; }
.option-grid { gap: 12px; }
.choice-card { min-height: 52px; align-items: center; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.choice-card:has(input:checked) { border-color: var(--brand); background: #ecfdf8; box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }
.choice-card:active { transform: scale(.99); }
.choice-card span { font-weight: 700; line-height: 1.42; }
.range-panel { display: grid; grid-template-columns: 1fr 76px; gap: 18px; align-items: center; padding: 24px 0; }
.range-panel input[type="range"] { height: 34px; }
.range-panel .range-value { width: 76px; height: 76px; font-size: 36px; }
.range-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.form-error { min-height: 24px; margin: 8px 0 0; color: #dc2626; font-weight: 800; }
.survey-actions { position: sticky; bottom: 0; padding-top: 12px; background: linear-gradient(180deg, rgba(246, 248, 251, 0), var(--panel) 28%); align-items: center; }
.survey-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; flex: 1; }
.submit-btn { display: none; }
.reward-page { margin-top: 10px; padding: 24px; text-align: center; border-color: #a7f3d0; background:
  radial-gradient(circle at 18% 0%, rgba(45, 212, 191, .22), transparent 32%),
  linear-gradient(180deg, #ffffff, #effbf7);
}
.reward-page[hidden] { display: none; }
.reward-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 7px 14px; background: #d1fae5; color: var(--brand); font-weight: 900; margin-bottom: 14px; }
.reward-page h2 { font-size: clamp(28px, 8vw, 44px); line-height: 1.08; margin-bottom: 10px; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.reward-grid > div { border: 1px solid #b8e3d8; border-radius: 8px; padding: 14px; background: rgba(255, 255, 255, .72); }
.reward-grid span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.reward-grid strong { display: block; color: var(--ink); font-size: 22px; line-height: 1.15; }
.reward-note { font-size: 14px; margin-bottom: 0; }
.screen { min-height: 100vh; padding: 28px; background: #edf2f7; }
.screen-dashboard {
  color: var(--dash-text);
  background:
    radial-gradient(circle at 18% 8%, rgba(45, 212, 191, .18), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(96, 165, 250, .18), transparent 30%),
    linear-gradient(135deg, #07111f 0%, #0b1830 54%, #08111d 100%);
  overflow-x: hidden;
}
.screen-dashboard:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 78%);
}
.topbar { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-bottom: 22px; }
.screen h1 { font-size: clamp(42px, 5vw, 78px); max-width: 1100px; }
.screen-dashboard h1 { color: var(--dash-text); text-shadow: 0 0 28px rgba(45, 212, 191, .18); }
.screen-dashboard h2 { color: var(--dash-text); }
.screen-dashboard p, .screen-dashboard .url { color: var(--dash-muted); }
.qr-wrap { display: grid; grid-template-columns: 230px 300px; gap: 22px; align-items: center; }
.screen-dashboard .qr-wrap {
  background: rgba(15, 23, 42, .68);
  border: 1px solid var(--dash-line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .28), inset 0 0 28px rgba(45, 212, 191, .04);
}
.qr { background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: 8px; width: 230px; height: 230px; }
.qr img { width: 100%; height: 100%; display: block; }
.url { word-break: break-all; color: var(--muted); font-size: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.screen-dashboard .kpi {
  background: linear-gradient(180deg, rgba(15, 23, 42, .9), rgba(13, 35, 58, .68));
  border-color: var(--dash-line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.kpi .num { font-size: clamp(34px, 4vw, 62px); font-weight: 950; color: var(--brand); line-height: 1; }
.screen-dashboard .kpi .num {
  color: #66f2dd;
  text-shadow: 0 0 24px rgba(45, 212, 191, .25);
}
.kpi .label { color: var(--muted); margin-top: 8px; }
.screen-dashboard .kpi .label { color: var(--dash-muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid { display: grid; grid-template-columns: 1.05fr 1.15fr 1fr; gap: 16px; align-items: stretch; }
.wide { grid-column: 1 / -1; }
.screen-dashboard .card {
  background: linear-gradient(180deg, var(--dash-panel), var(--dash-panel-2));
  border-color: var(--dash-line);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .045);
  backdrop-filter: blur(10px);
}
.chart-card { min-height: 330px; }
.chart { height: 255px; width: 100%; }
.screen-dashboard.echarts-ready .chart + div:not(:empty) { display: none; }
.bar { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 44px; gap: 12px; align-items: center; margin: 10px 0; }
.bar-label { font-weight: 700; overflow-wrap: anywhere; }
.track { height: 18px; background: #eef3f8; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; min-width: 2px; }
.bar-value { color: var(--muted); text-align: right; font-weight: 800; }
.screen-dashboard .bar-value, .screen-dashboard .bar-label { color: var(--dash-text); }
.screen-dashboard .track { background: rgba(148, 163, 184, .14); }
.insight { padding: 13px 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; font-size: 20px; line-height: 1.5; }
.screen-dashboard .insight {
  background: rgba(8, 17, 29, .58);
  border-color: rgba(45, 212, 191, .22);
  color: var(--dash-text);
  font-size: clamp(18px, 1.5vw, 24px);
}
.words { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 90px; }
.word { color: var(--brand); font-weight: 900; line-height: 1; }
.samples { display: grid; gap: 8px; }
.sample { border-left: 4px solid var(--brand); padding: 8px 12px; background: #f8fafc; color: var(--muted); border-radius: 4px; }
.screen-dashboard .sample {
  background: rgba(8, 17, 29, .52);
  color: var(--dash-muted);
  border-left-color: #2dd4bf;
}
.host { max-width: 960px; margin: 0 auto; }
.links { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.link-card { color: inherit; text-decoration: none; }
@media (max-width: 900px) {
  .page, .screen { padding: 16px; }
  .topbar, .qr-wrap, .grid, .chart-grid, .kpis, .links { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr; gap: 6px; }
  .bar-value { text-align: left; }
  .mobile { padding: 16px; }
  .survey-card { padding: 16px; }
  .question-page { min-height: 420px; }
  .reward-grid { grid-template-columns: 1fr; }
}

/* Single-screen presentation dashboard */
.fit-screen {
  height: 100vh;
  min-height: 700px;
  padding: clamp(12px, 1.2vw, 20px);
  display: grid;
  grid-template-rows: minmax(104px, 14vh) minmax(0, 1fr);
  gap: clamp(10px, .9vw, 14px);
  overflow: hidden;
}
.fit-screen .dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}
.fit-screen .hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fit-screen h1 {
  font-size: clamp(32px, 3.5vw, 56px);
  margin: 3px 0 0;
  max-width: 980px;
}
.fit-screen .eyebrow { font-size: 12px; }
.fit-screen .qr-wrap {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}
.fit-screen .qr {
  width: 112px;
  height: 112px;
  padding: 7px;
}
.fit-screen .qr-wrap h2 {
  font-size: 17px;
  margin: 0 0 2px;
}
.fit-screen .qr-wrap p {
  font-size: 12px;
  line-height: 1.32;
  margin: 4px 0;
}
.fit-screen .url {
  font-size: 11px;
  line-height: 1.32;
}
.fit-screen .dashboard-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 1.26fr .9fr .94fr;
  grid-template-rows: minmax(70px, .28fr) minmax(230px, 1fr) minmax(190px, .78fr);
  grid-template-areas:
    "kpis kpis kpis kpis"
    "use work work confidence"
    "worry insight insight words";
  gap: clamp(9px, .8vw, 13px);
}
.compact-kpis {
  grid-area: kpis;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.compact-kpis .kpi {
  padding: 10px 13px;
  min-width: 0;
}
.compact-kpis .kpi .num {
  font-size: clamp(25px, 2.5vw, 42px);
}
.compact-kpis .kpi .label {
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.use-card { grid-area: use; }
.work-card { grid-area: work; }
.confidence-card { grid-area: confidence; }
.worry-card { grid-area: worry; }
.insight-panel { grid-area: insight; }
.words-card { grid-area: words; }
.fit-screen .card {
  padding: clamp(9px, .85vw, 14px);
  min-height: 0;
  overflow: hidden;
}
.fit-screen .card h2 {
  font-size: clamp(14px, 1.08vw, 18px);
  margin-bottom: 5px;
}
.fit-screen .chart-card {
  min-height: 0;
}
.fit-screen .chart {
  height: calc(100% - 26px);
  min-height: 110px;
}
.fit-screen .insight {
  font-size: clamp(14px, 1.08vw, 18px);
  line-height: 1.34;
  margin: 6px 0;
  padding: 9px 11px;
}
.fit-screen .words {
  min-height: 0;
  height: calc(100% - 28px);
  align-content: flex-start;
  overflow: hidden;
  gap: 7px;
}
.fit-screen .word {
  max-width: 100%;
}
.screen-dashboard .word {
  color: #66f2dd;
  text-shadow: 0 0 16px rgba(45, 212, 191, .22);
}
@media (max-height: 820px) {
  .fit-screen {
    min-height: 620px;
    grid-template-rows: 98px minmax(0, 1fr);
    gap: 9px;
  }
  .fit-screen .dashboard-body {
    grid-template-rows: 62px minmax(205px, 1fr) minmax(165px, .72fr);
    gap: 9px;
  }
  .fit-screen .qr { width: 96px; height: 96px; }
  .fit-screen .qr-wrap { grid-template-columns: 96px minmax(0, 1fr); }
  .fit-screen .insight { font-size: 14px; margin: 5px 0; padding: 8px 10px; }
}
@media (max-width: 900px) {
  .screen-dashboard { overflow: auto; }
  .fit-screen { height: auto; grid-template-rows: auto auto; }
  .fit-screen .dashboard-hero,
  .fit-screen .dashboard-body,
  .fit-screen .compact-kpis {
    grid-template-columns: 1fr;
  }
  .fit-screen .dashboard-body {
    grid-template-areas: none;
    grid-template-rows: none;
  }
  .compact-kpis, .use-card, .work-card, .confidence-card, .worry-card, .insight-panel, .words-card {
    grid-area: auto;
  }
}
