@font-face {
  font-family: "Google Sans";
  src: url("/static/assets/fonts/GoogleSans-Latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #222;
  --muted: #5f6368;
  --line: #dadce0;
  --soft: #f8f9fa;
  --blue: #4285f4;
  --action: #1967d2;
  --green: #34a853;
  --green-ink: #188038;
  --yellow: #fbbc05;
  --red: #ea4335;
  --font-sans: "Google Sans", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100svh; background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
[hidden] { display: none !important; }
.page-width { width: min(calc(100% - 96px), 1184px); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 20px; z-index: 100; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { border-bottom: 1px solid var(--line); background: white; }
.header-inner { width: min(calc(100% - 96px), 1280px); min-height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 500; white-space: nowrap; letter-spacing: -.6px; }
.brand img { width: 42px; height: 26px; }
.brand-campus { color: var(--muted); font-weight: 400; }
.view-nav { display: flex; align-items: center; gap: 30px; font-size: 14px; color: var(--muted); }
.view-nav a { position: relative; padding-block: 35px; white-space: nowrap; }
.view-nav a[aria-current] { color: var(--action); }
.view-nav a[aria-current]::after { content: ""; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); position: absolute; bottom: 0; inset-inline: 0; }
.view-nav a:hover { color: var(--action); }
.view-nav a > span { padding-left: 8px; }
.connection-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 100px; padding: 8px 12px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.status-dot, .tone-dot, .note-dot { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--green); }
.status-dot[data-status="connecting"] { background: var(--yellow); }
.status-dot[data-status="offline"] { background: var(--red); }
.four-dots { display: inline-flex; gap: 4px; }
.four-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.four-dots i:nth-child(2) { background: var(--red); }
.four-dots i:nth-child(3) { background: var(--yellow); }
.four-dots i:nth-child(4) { background: var(--green); }
.eyebrow { display: flex; align-items: center; gap: 11px; font-size: 12px; color: var(--muted); }
.small-label { color: var(--muted); font-size: 11px; font-weight: 500; }
.text-link { display: inline-flex; align-items: center; gap: 12px; color: var(--action); font-size: 13px; font-weight: 500; min-height: 32px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.participant-page { display: flex; flex-direction: column; background: var(--soft); }
.participant-page .page-width, .participant-page .header-inner { width: min(calc(100% - 32px), 460px); }
.participant-page .header-inner { min-height: 66px; }
.participant-page .brand { font-size: 20px; gap: 10px; }
.participant-page .brand img { width: 36px; height: 24px; }
.participant-layout { display: flex; flex-direction: column; gap: 22px; padding-block: 24px; flex: 1; }
.intro h1 { font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: -1.3px; }
.intro h1 > span { color: var(--action); }
.intro-detail { margin-top: 10px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.training-workspace { min-width: 0; scroll-margin-top: 24px; }
.experiment-tag { border: 1px solid var(--line); border-radius: 5px; color: var(--muted); padding: 5px 8px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .5px; white-space: nowrap; }
.training-card { border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 4px 0 #f1f3f4; background: white; }
.sample-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.section-label { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.step-marker { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 50%; font-size: 10px; font-family: var(--font-mono); }
.blue-marker { background: #e8f0fe; color: var(--action); }
.green-marker { background: #e6f4ea; color: var(--green-ink); }
.sample-id { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.sample-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: center; padding: 20px; }
.digit-frame { aspect-ratio: 1; width: 100%; max-width: 160px; display: grid; place-items: center; position: relative; background-color: #e8f0fe; border-radius: 16px; background-image: linear-gradient(#d3e3fd 1px, transparent 1px), linear-gradient(90deg, #d3e3fd 1px, transparent 1px); background-size: 22px 22px; background-position: center; overflow: hidden; }
.digit-image { width: 72%; height: 72%; image-rendering: pixelated; mix-blend-mode: multiply; filter: invert(1); }
.digit-placeholder { color: var(--action); font-size: 40px; letter-spacing: 4px; }
.digit-corner { position: absolute; width: 13px; height: 13px; border-color: var(--blue); border-style: solid; }
.top-left { top: 14px; left: 14px; border-width: 2px 0 0 2px; }
.bottom-right { right: 14px; bottom: 14px; border-width: 0 2px 2px 0; }
.prediction { min-width: 0; display: flex; align-items: flex-start; flex-direction: column; }
.prediction .small-label { font-size: 12px; }
.prediction-digit { color: var(--action); font-size: 64px; font-weight: 500; line-height: 1.15; letter-spacing: -4px; margin-block: 3px; }
.prediction-confidence { color: var(--muted); font-size: 11px; }
.confidence-track { height: 4px; width: 100%; max-width: 145px; border-radius: 100px; background: #e8f0fe; overflow: hidden; margin-top: 10px; }
.confidence-track > span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width 200ms ease; }
.prediction p { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 12px; max-width: 140px; }
.choice-section { padding: 20px 20px 12px; border-top: 1px solid #e8eaed; }
.choice-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.keyboard-hint { display: none; }
.number-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pad-btn { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); background: white; font-size: 25px; transition: background 140ms ease, border-color 140ms ease, transform 140ms ease; touch-action: manipulation; }
.pad-btn:hover:not(:disabled) { background: #e8f0fe; border-color: var(--blue); color: var(--action); }
.pad-btn:active:not(:disabled), .pad-btn.selected { background: var(--action); border-color: var(--action); color: white; transform: scale(.96); }
.pad-btn:disabled { color: #9aa0a6; background: var(--soft); cursor: default; }
.pad-btn.selected:disabled { color: white; background: var(--action); }
.action-status { min-height: 28px; padding-top: 12px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.5; }
.action-status[data-state="error"] { color: #b3261e; }
.training-banner { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #fef7e0; color: #705000; font-size: 11px; line-height: 1.6; border-top: 1px solid #f6e8b6; transition: background 180ms ease; }
.banner-symbol { font-size: 25px; line-height: 1; color: #a66b00; }
.training-banner.user-trained { background: #e6f4ea; border-color: #ceead6; color: #137333; }
.training-banner.peer-trained { background: #e8f0fe; border-color: #d2e3fc; color: var(--action); }
.contribution-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 16px; margin-top: 18px; padding-block: 17px; background: white; }
.contribution-item { display: flex; flex-direction: column; gap: 7px; padding-inline: 18px; }
.contribution-item + .contribution-item { border-left: 1px solid var(--line); }
.metric-value { font-size: 27px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.metric-label { color: var(--muted); font-size: 10px; }
.global-contribution .metric-value, .global-contribution .metric-label { color: var(--action); }
.global-contribution .metric-label > span { margin-left: 3px; }
.workspace-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.note-dot { width: 5px; height: 5px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 22px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); line-height: 1.7; }
.footer-separator { padding-inline: 8px; color: #bdc1c6; }

/* Projector layout fills the display and prioritizes plots and headline metrics. */
.stage-page { display: flex; flex-direction: column; height: 100svh; min-height: 680px; }
.stage-page .site-header { flex-shrink: 0; }
.stage-page .header-inner { width: calc(100% - 48px); min-height: 64px; }
.stage-page .view-nav { font-size: 16px; }
.stage-page .view-nav a { padding-block: 21px; }
.stage-page .connection-badge { font-size: 14px; }
.stage-page .page-width { width: calc(100% - 48px); }
.stage-layout { padding-block: 18px 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-shrink: 0; }
.stage-intro h1 { font-size: clamp(28px, 2.2vw, 42px); font-weight: 500; letter-spacing: -1px; line-height: 1.15; }
.stage-intro p { margin-top: 6px; color: var(--muted); font-size: clamp(14px, 1vw, 18px); }
.stage-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 18px; border-radius: 100px; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: white; min-height: 42px; }
.button-outline { color: var(--action); background: #e8f0fe; border-color: #d2e3fc; }
.button-outline.inactive { background: white; color: var(--muted); border-color: var(--line); }
.button-outline:hover { border-color: var(--blue); }
.button-reset { color: var(--muted); }
.button-reset:hover { color: #b3261e; background: #fce8e6; border-color: #fad2cf; }
.stage-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); flex-shrink: 0; border: 1px solid var(--line); border-radius: 16px; margin-block: 16px; padding-block: 14px; }
.stage-metrics > div { display: flex; flex-direction: column; gap: 8px; padding-inline: 20px; }
.stage-metrics > div + div { border-left: 1px solid var(--line); }
.stage-metrics .metric-label { display: flex; align-items: center; gap: 8px; font-size: clamp(14px, 1vw, 20px); }
.stage-metrics .tone-dot { width: 9px; height: 9px; }
.stage-metric-value { font-size: clamp(46px, 3.8vw, 76px); letter-spacing: -2px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.blue-dot { background: var(--blue); }
.yellow-dot { background: var(--yellow); }
.green-dot { background: var(--green); }
.red-dot { background: var(--red); }
.blue-text { color: var(--action); }
.green-text { color: var(--green-ink); }
.network-layout { display: flex; align-items: stretch; gap: 20px; flex: 1; min-height: 0; }
.network-card { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-width: 0; scroll-margin-top: 20px; }
.network-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #e8eaed; background: white; flex-shrink: 0; }
.network-heading h2, .panel-heading h2 { font-size: clamp(20px, 1.35vw, 26px); font-weight: 500; letter-spacing: -.3px; }
.stage-page .experiment-tag { font-size: 14px; }
.canvas-container { flex: 1; min-height: 0; width: 100%; position: relative; background-color: #f8faff; background-image: linear-gradient(#22222206 1px, transparent 1px), linear-gradient(90deg, #22222206 1px, transparent 1px); background-size: 28px 28px; }
#adminNetworkCanvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
#accuracyChartCanvas { display: block; width: 100%; height: 100%; }
.network-caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 20px; color: var(--muted); font-size: clamp(13px, .9vw, 17px); border-top: 1px solid #e8eaed; flex-shrink: 0; }
.network-caption strong { font-weight: 500; color: var(--ink); }
.telemetry-panel { width: 45%; flex-shrink: 0; border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.telemetry-panel.collapsed { display: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chart-wrapper { width: 100%; flex: 1; min-height: 100px; position: relative; }
#accuracyChartCanvas { position: absolute; inset: 0; }
.chart-legend { display: flex; gap: 24px; font-size: clamp(14px, 1vw, 19px); color: var(--ink); flex-shrink: 0; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend-line { width: 24px; height: 4px; border-radius: 3px; }
.green-line { background: var(--green-ink); }
.blue-line { background: var(--action); }
.weight-bar { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 24px; padding-top: 12px; font-size: 14px; color: var(--muted); }
.weight-scale { display: flex; align-items: center; gap: 10px; }
.weight-scale .small-label { margin-right: 5px; font-size: 14px; }
.scale-gradient { width: 130px; height: 7px; border-radius: 5px; background: linear-gradient(90deg, #1967d2, #8ab4f8, #dadce0, #f6aea8, #c5221f); }
.weight-stats { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 13px; }
.weight-stats strong { font-weight: 500; color: var(--ink); padding-left: 5px; }

@media (max-width: 1100px) {
  .page-width, .header-inner { width: calc(100% - 64px); }
  .sample-row { gap: 18px; padding-inline: 22px; }
  .sample-heading, .choice-section { padding-inline: 22px; }
  .keyboard-hint { display: none; }
  .prediction-digit { font-size: 65px; }
  .contribution-item { padding-inline: 15px; }
  .stage-page .page-width { width: calc(100% - 48px); }
  .stage-actions { gap: 8px; }
  .telemetry-panel { padding: 16px; }
  .network-caption { padding-inline: 16px; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .page-width, .header-inner, .stage-page .page-width { width: calc(100% - 40px); }
  .header-inner { min-height: 72px; gap: 12px; flex-wrap: wrap; padding-top: 15px; }
  .participant-page .header-inner { padding-top: 0; flex-wrap: nowrap; min-height: 62px; }
  .brand { font-size: 19px; gap: 9px; }
  .brand img { width: 35px; height: 24px; }
  .connection-badge { font-size: 10px; padding: 7px 10px; }
  .view-nav { order: 3; width: 100%; justify-content: center; gap: 36px; border-top: 1px solid #f1f3f4; margin-top: -3px; font-size: 12px; }
  .view-nav a, .stage-page .view-nav a { padding-block: 12px; }
  .participant-layout { gap: 20px; padding-block: 22px; }
  .eyebrow { font-size: 10px; gap: 9px; }
  .intro h1 { font-size: clamp(29px, 8.4vw, 34px); }
  .intro-detail { font-size: 12px; }
  .training-card { border-radius: 20px; }
  .sample-heading { padding: 20px 20px 0; }
  .sample-row { padding: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .section-label { font-size: 12px; gap: 7px; }
  .step-marker { width: 21px; height: 21px; font-size: 9px; }
  .sample-id { font-size: 9px; }
  .prediction .small-label { font-size: 10px; }
  .prediction-digit { font-size: 61px; }
  .prediction-confidence { font-size: 10px; }
  .prediction p { font-size: 10px; margin-top: 9px; }
  .choice-section { padding: 19px 20px 13px; }
  .choice-heading { margin-bottom: 16px; }
  .number-pad { gap: 8px; }
  .pad-btn { min-height: 56px; font-size: 24px; border-radius: 10px; }
  .training-banner { padding: 13px 18px; font-size: 10px; }
  .contribution-strip { margin-top: 18px; padding-block: 17px; }
  .contribution-item { padding-inline: 16px; }
  .metric-value { font-size: 24px; }
  .metric-label { font-size: 9px; }
  .site-footer { align-items: flex-start; font-size: 9px; gap: 14px; padding-block: 18px; }
  .footer-separator { padding-inline: 4px; }
  .stage-page { height: auto; min-height: 100svh; }
  .stage-page .header-inner { width: calc(100% - 40px); }
  .stage-page .view-nav { font-size: 12px; }
  .stage-page .connection-badge { font-size: 10px; }
  .stage-page .experiment-tag { font-size: 11px; }
  .stage-layout { padding-top: 26px; }
  .stage-intro { flex-direction: column; gap: 18px; }
  .stage-intro h1 { font-size: 30px; letter-spacing: -1px; }
  .stage-intro p { font-size: 13px; line-height: 1.6; }
  .stage-actions { flex-direction: row; }
  .stage-metrics { grid-template-columns: repeat(2, 1fr); padding: 0; margin-block: 22px; }
  .stage-metrics > div { padding: 17px; }
  .stage-metrics > div:nth-child(odd) { border-left: 0; }
  .stage-metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stage-metric-value { font-size: 38px; }
  .stage-metrics .metric-label { font-size: 12px; }
  .network-layout { flex-direction: column; }
  .network-heading { padding: 16px; }
  .canvas-container { height: 440px; min-height: 440px; }
  .network-caption { font-size: 11px; gap: 10px; }
  .telemetry-panel { width: 100%; padding: 20px; }
  .chart-wrapper { height: 280px; flex: none; }
  .weight-bar { flex-direction: column; align-items: flex-start; gap: 16px; font-size: 11px; }
  .weight-scale .small-label { font-size: 11px; }
  .weight-stats { gap: 14px; font-size: 11px; }
  .scale-gradient { width: 90px; }
  .weight-scale { gap: 8px; }
}
@media (max-width: 380px) {
  .page-width, .header-inner, .stage-page .page-width { width: calc(100% - 28px); }
  .sample-heading, .choice-section { padding-inline: 16px; }
  .sample-row { padding: 18px 16px; gap: 16px; }
  .prediction p { font-size: 9px; }
  .contribution-item { padding-inline: 11px; }
  .contribution-item .metric-label { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
