/* Academy identity inside the existing Arcade studio. All assets are local. */
@font-face { font-family: Poppins; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: Poppins; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
:root {
  color-scheme: dark;
  --arc-bg: #14152a;
  --arc-panel: #1f2140;
  --arc-line: #4a4d8a;
  --arc-ink: #f2f2ff;
  --arc-soft: #b0b3d2;
  --arc-pink: #ff6ba8;
  --arc-cyan: #5be7ff;
  --academy-green: #93B33D;
  --academy-light: #B6CF72;
  --academy-hover: #A6C554;
  --academy-dark: #0A0C04;
  --arc-green: var(--academy-green);
  --arc-deep: #101222;
  --arc-surface: #1a1c34;
  --arc-border: #363a58;
  --arc-track: #3c405e;
  --arc-warm: #f2d38a;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-pad: clamp(20px, 4vw, 64px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--arc-bg); color: var(--arc-ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
body { min-width: 280px; }
button, input, textarea, select { font: inherit; color: inherit; }
button, input, textarea, select, .pane, .pane-inner { min-width: 0; }
button { border: 1px solid var(--arc-border); background: var(--arc-panel); border-radius: 6px; padding: 10px 16px; min-height: 44px; cursor: pointer; line-height: 1.4; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover:not(:disabled) { border-color: var(--academy-green); background: #252945; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--academy-green); border-color: var(--academy-green); color: var(--academy-dark); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--academy-hover); border-color: var(--academy-hover); box-shadow: 0 0 24px #93b33d1a; }
button.quiet { background: transparent; }
:focus-visible { outline: 2px solid var(--academy-green); outline-offset: 4px; }
input, textarea, select { background: var(--arc-deep); border: 1px solid var(--arc-line); border-radius: 6px; padding: 12px 14px; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--arc-soft); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 2px; }
select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--arc-soft) 50%), linear-gradient(135deg, var(--arc-soft) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 12px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.6; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 700; }
h2 { font-size: 26px; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--arc-soft); }
.err { color: var(--arc-pink); overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: .8rem; }
.eyebrow { display: block; color: var(--arc-soft); font: 600 10px/1.5 var(--sans); letter-spacing: .16em; }
.brand { display: flex; align-items: center; gap: 20px; flex: none; max-width: 100%; }
.brand-copy { border-left: 1px solid var(--arc-border); padding-left: 20px; min-width: 0; }
.brand-logo { display: block; width: 180px; height: auto; flex: none; }
.brand strong { display: block; font-size: 19px; letter-spacing: -.04em; }
.brand-sub { display: block; margin-top: 2px; color: var(--arc-soft); font: 9px/1.5 var(--sans); letter-spacing: .19em; }

/* Sign-in: a deliberately asymmetric title, arcade scene, and control panel. */
.login { min-height: 100svh; display: flex; flex-direction: column; padding: 36px max(24px, calc((100vw - 1248px) / 2)); background: radial-gradient(ellipse at 15% 57%, #22274a 0, transparent 52%); }
.login-brand { padding-bottom: 28px; border-bottom: 1px solid var(--arc-border); }
.login-brand .brand-logo { width: 224px; }
.login-entry { display: grid; gap: 24px; min-width: 0; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(48px, 8vw, 120px); flex: 1; padding: 70px 0 60px; }
.login-story > .eyebrow { color: var(--arc-soft); margin-bottom: 26px; }
.login-story h1 { font-size: clamp(44px, 5.6vw, 80px); letter-spacing: -.06em; line-height: 1.04; font-weight: 700; }
.login-story h1 span { color: var(--academy-green); }
.login-story > p { color: var(--arc-soft); max-width: 340px; font-size: 18px; margin-top: 26px; line-height: 1.65; }
.login-form { position: relative; border: 1px solid var(--arc-border); border-top: 2px solid var(--academy-green); padding: clamp(26px, 3.3vw, 46px); background: linear-gradient(145deg, #242642, var(--arc-surface)); box-shadow: 0 30px 80px #090a1938; border-radius: 4px 4px 16px 4px; display: grid; gap: 22px; }
.login-form > .eyebrow { color: var(--academy-light); margin-bottom: -6px; }
.login-form h2 { font-size: clamp(26px, 2.5vw, 33px); }
.login-help { margin-top: -8px; line-height: 1.65; }
.field { display: grid; gap: 9px; font-weight: 500; }
.field input { min-height: 52px; font-weight: 400; }
.login-form .err:empty { display: none; }
.login-form button.primary { margin-top: 4px; min-height: 52px; }
.login-support { text-align: center; font-size: 12px; }
.login-demo-copy { display: none; }
.login-fields { display: contents; }
/* Demo choices lead in document order; the normal PIN layout stays unchanged. */
.login:has(.demo-login:not([hidden])) { padding-top: 24px; padding-bottom: 24px; }
.login:has(.demo-login:not([hidden])) .login-brand { padding-bottom: 20px; }
.login:has(.demo-login:not([hidden])) .login-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; padding: 28px 0; }
.login:has(.demo-login:not([hidden])) .login-story h1 { font-size: clamp(44px, 5vw, 68px); }
.login:has(.demo-login:not([hidden])) .arcade-scene { height: 180px; margin-top: 24px; }
.login-entry:has(.demo-login:not([hidden])) { gap: 16px; }
.demo-login { padding: 24px; border: 1px solid var(--academy-green); border-top-width: 3px; border-radius: 6px; background: var(--arc-deep); }
.demo-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.demo-label { color: var(--arc-cyan); background: #5be7ff0a; border: 1px solid #5be7ff40; border-radius: 3px; padding: 3px 7px; font: 600 10px/1.5 var(--sans); letter-spacing: .12em; }
.demo-title { font-size: 22px; font-weight: 600; }
.demo-help { font-size: 13px; line-height: 1.7; margin-top: 10px; }
.demo-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.demo-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; align-content: start; gap: 6px; text-align: left; padding: 14px 12px; min-height: 66px; background: var(--arc-surface); border-color: var(--arc-line); }
.demo-btn strong { color: var(--academy-light); font-size: 16px; font-weight: 600; }
.demo-btn .muted { grid-column: 1 / -1; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.demo-arrow { grid-column: 2; grid-row: 1; color: var(--academy-light); font-size: 18px; }
.demo-btn:hover:not(:disabled) { background: #252945; border-color: var(--academy-green); }
.login-entry:has(.demo-login:not([hidden])) .login-form { padding: 22px 24px; gap: 14px; border-top: 1px solid var(--arc-border); background: var(--arc-surface); box-shadow: none; }
.login-entry:has(.demo-login:not([hidden])) .login-standard-copy,
.login-entry:has(.demo-login:not([hidden])) .login-form > .eyebrow { display: none; }
.login-entry:has(.demo-login:not([hidden])) .login-demo-copy { display: inline; }
.login-entry:has(.demo-login:not([hidden])) .login-form h2 { font-size: 20px; }
.login-entry:has(.demo-login:not([hidden])) .login-help { margin-top: 0; font-size: 13px; }
.login-entry:has(.demo-login:not([hidden])) .login-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.login-entry:has(.demo-login:not([hidden])) .field { gap: 6px; font-size: 13px; }
.login-entry:has(.demo-login:not([hidden])) button.primary { margin-top: 0; min-height: 44px; color: var(--arc-ink); border-color: var(--arc-line); background: var(--arc-panel); }
.login-entry:has(.demo-login:not([hidden])) button.primary:hover:not(:disabled) { border-color: var(--academy-green); background: #252945; }
.login-footer { border-top: 1px solid var(--arc-border); padding-top: 22px; color: var(--arc-soft); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font: 11px/1.5 var(--sans); }
.arcade-scene { height: 210px; position: relative; margin-top: 36px; max-width: 510px; overflow: hidden; }
.scene-grid { position: absolute; inset: 30% -15% -60%; background-image: linear-gradient(#5be7ff1c 1px, transparent 1px), linear-gradient(90deg, #5be7ff1c 1px, transparent 1px); background-size: 36px 36px; transform: perspective(250px) rotateX(52deg); mask-image: linear-gradient(transparent, black 60%, transparent); }
.scene-orbit { position: absolute; width: 270px; height: 270px; border: 1px solid #5be7ff22; border-radius: 50%; top: -30px; left: 90px; box-shadow: 0 0 0 22px #5be7ff05, 0 0 0 44px #5be7ff03; }
.scene-step { position: absolute; height: 22px; background: linear-gradient(#3b4662, #202b46); border: 1px solid #5be7ff44; border-top: 3px solid var(--arc-cyan); box-shadow: 0 12px 28px #0b1026; transform: skewY(-8deg); }
.step-one { width: 95px; left: 24px; top: 150px; }
.step-two { width: 116px; left: 142px; top: 116px; }
.step-three { width: 95px; left: 282px; top: 80px; border-top-color: var(--arc-pink); }
.scene-spark { position: absolute; width: 38px; height: 38px; left: 308px; top: 15px; background: var(--arc-pink); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.scene-caption { position: absolute; bottom: 2px; left: 0; color: var(--arc-soft); font: 9px var(--sans); letter-spacing: .2em; }

/* Flexible shell: no viewport-height guesses tied to a single-line header. */
#app:has(> .topbar) { height: 100vh; height: 100dvh; min-height: 560px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 32px; padding: 18px var(--page-pad); border-bottom: 1px solid var(--arc-border); background: #101222; }
.topbar .who { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-left: auto; min-width: 0; }
.profile { display: flex; align-items: center; gap: 12px; margin-right: 12px; min-width: 0; }
.profile-copy { display: grid; min-width: 0; }
.profile-copy strong { font-size: 14px; overflow-wrap: anywhere; }
.profile-role { font-size: 12px; text-transform: capitalize; }
.topbar .who > button { font-size: 12px; }
.sign-out { background: transparent; }
.phase-control { display: grid; gap: 5px; margin-left: auto; }
.phase-button { background: #f2d38a0a; border-color: #f2d38a66; color: var(--arc-warm); font-size: 12px; }
.phase-button:hover:not(:disabled) { background: #f2d38a16; border-color: var(--arc-warm); }
.phase-impact { font-size: 10px; color: var(--arc-soft); text-align: center; }
.desk-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 var(--page-pad); border-bottom: 1px solid var(--arc-border); }
.tabs { display: flex; flex-wrap: wrap; gap: 24px; min-width: 0; }
.tabs button { position: relative; border: 0; border-radius: 0; padding: 16px 3px; min-width: 48px; background: transparent; color: var(--arc-soft); font-size: 13px; }
.tabs button.active { color: var(--academy-light); }
.tabs button.active::after { content: ''; position: absolute; bottom: -1px; height: 3px; background: var(--academy-green); left: 0; right: 0; }
.tabs button:hover:not(:disabled) { background: transparent; color: var(--academy-light); }
.tabs button:focus-visible { outline-offset: -5px; }
.phase-label { font: 11px/1.6 var(--sans); color: var(--arc-cyan); text-align: right; }
.pane { min-height: 0; overflow: auto; background: radial-gradient(ellipse at 85% 0, #24294244, transparent 65%); }
.pane-inner { min-height: 0; overflow: hidden; }

/* Chat: a broad reading surface and a grounded, familiar composer. */
.chat { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; max-width: 1020px; margin: 0 auto; padding: 0 36px; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0 22px; border-bottom: 1px solid var(--arc-border); }
.chat-heading .eyebrow { margin-bottom: 6px; }
.chat-heading h1 { font-size: 25px; letter-spacing: -.03em; }
.chat-heading p { font-size: 12px; }
.chat-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 12px 28px 0; display: flex; flex-direction: column; gap: 24px; scrollbar-width: thin; scrollbar-color: var(--arc-line) transparent; }
.chat-list:focus-visible { outline-offset: -2px; }
.bubble { flex: none; max-width: min(740px, 90%); padding: 18px 22px; border-radius: 2px 12px 12px 12px; border: 1px solid var(--arc-border); background: var(--arc-surface); }
.bubble.user { align-self: flex-end; background: #24273a; border-color: #454b61; border-radius: 12px 2px 12px 12px; }
.bubble.assistant { align-self: flex-start; border: 0; border-left: 2px solid #93b33d80; background: transparent; border-radius: 0; padding-left: 22px; }
.bubble.system { align-self: stretch; max-width: none; background: #b0b3d209; border-style: dashed; border-radius: 4px; font-size: 13px; }
.bubble .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.bubble.assistant .who { color: var(--academy-light); }
.bubble.user .who { color: var(--arc-soft); }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.bubble.streaming .text::after { content: '▍'; color: var(--arc-green); animation: cursor-pulse 1s step-end infinite; }
.bubble.flagged { border: 1px solid var(--arc-pink); box-shadow: inset 3px 0 var(--arc-pink); }
.flag-tag { display: block; color: #ff9bc5; font-weight: 500; overflow-wrap: anywhere; }
.flag-btn { margin-top: 14px; font-size: 12px; background: transparent; color: #ffb5d3; border-color: #72506d; }
.tool-chip { flex: none; align-self: flex-start; max-width: 100%; padding: 8px 12px; font: 11px/1.6 var(--mono); color: var(--arc-cyan); background: #5be7ff08; border: 1px solid #5be7ff30; border-radius: 4px; overflow-wrap: anywhere; }
.typing { padding: 8px 24px; font: 12px var(--sans); }
.typing::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--academy-green); margin-right: 10px; animation: cursor-pulse 1.2s infinite; }
.chat-empty { margin: auto; text-align: center; padding: 32px 20px; max-width: 440px; }
.empty-spark { display: block; font-size: 48px; color: var(--academy-green); margin-bottom: 20px; }
.chat-empty h2 { font-size: 26px; margin-bottom: 14px; }
.chat-empty p { line-height: 1.7; }
.chat-input { padding: 16px; border: 1px solid var(--arc-line); border-radius: 10px; background: var(--arc-panel); box-shadow: 0 10px 30px #0b0d211a; }
.chat-input:focus-within { border-color: var(--academy-green); }
.chat-input textarea { display: block; background: transparent; border: 0; padding: 6px 8px 12px; max-height: 180px; min-height: 76px; font-size: 15px; }
.composer-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.agent-field { display: flex; gap: 10px; align-items: center; font-size: 11px; }
.agent-field select { width: auto; max-width: 100%; background-color: var(--arc-surface); border-color: var(--arc-border); padding: 9px 28px 9px 12px; min-height: 44px; font-size: 12px; }
.composer-hint { flex: 1; text-align: right; font-size: 10px; }
.composer-actions { display: flex; gap: 8px; margin-left: auto; }
.composer-actions button { min-width: 72px; }
.stop-button { border-color: #ff6ba87a; color: #ffb5d3; }
.chat-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 2px 20px; font-size: 11px; }
.chat-notice:empty { display: none; }
.chat-notice { flex: 1 1 220px; }
.budget { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
.budget-label strong { color: var(--arc-ink); }
meter { display: block; appearance: none; border: 0; width: 100%; height: 5px; background: var(--arc-track); border-radius: 0; }
meter::-webkit-meter-inner-element { display: block; }
meter::-webkit-meter-bar { border: 0; background: var(--arc-track); border-radius: 0; height: 5px; box-shadow: none; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--academy-green); border-radius: 0; }
meter::-moz-meter-bar { background: var(--academy-green); }
.low meter::-webkit-meter-optimum-value, .low meter::-webkit-meter-suboptimum-value, .low meter::-webkit-meter-even-less-good-value { background: var(--arc-pink); }
.low meter::-moz-meter-bar { background: var(--arc-pink); }
.budget meter { width: 96px; }
.budget-warning { color: #ff9bc5; font-size: 11px; }
.chat-ro { padding: 14px 18px; font-size: 12px; background: var(--arc-surface); border: 1px solid var(--arc-border); border-radius: 6px; }

/* Wall: portraits first, activity second, a consistent tool rail below. */
.wall { min-height: 100%; padding: 0 var(--page-pad) 36px; max-width: 1600px; margin: 0 auto; }
.wall-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 40px 0 34px; }
.wall-heading .eyebrow { color: var(--academy-light); margin-bottom: 10px; }
.wall-heading p { margin-top: 14px; font-size: 14px; }
.wall-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding-bottom: 3px; color: var(--arc-soft); font-size: 11px; }
.wall-legend > span { display: flex; align-items: center; gap: 7px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.wall-card { --status-color: #747a9f; text-align: left; position: relative; display: flex; flex-direction: column; min-width: 0; padding: 26px; border: 1px solid var(--arc-border); border-top: 2px solid var(--status-color); background: linear-gradient(135deg, #22253f, var(--arc-surface)); border-radius: 4px 4px 12px 4px; box-shadow: 0 10px 26px #090c201a; }
.wall-card.live { --status-color: var(--arc-green); }
.wall-card.recent { --status-color: var(--arc-cyan); }
.wall-card.quiet { background: linear-gradient(135deg, #202239, #191b30); }
.wall-card:hover:not(:disabled) { background: linear-gradient(135deg, #292d49, #20233b); border-color: var(--status-color); box-shadow: 0 10px 28px #090c2033; }
.wall-card.live::after { content: ''; position: absolute; top: -2px; height: 2px; width: 30%; left: 0; background: var(--academy-light); animation: activity-glow 3s ease-in-out infinite; }
.wall-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.wall-who { display: grid; flex: 1; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.wall-who strong { font-size: 22px; letter-spacing: -.035em; }
.wall-who > span { font: 12px/1.5 var(--sans); }
.desk-arrow { align-self: flex-start; color: var(--arc-soft); font-size: 20px; }
.wall-status { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--arc-border); padding-top: 18px; font-size: 11px; }
.status-label { display: flex; align-items: center; gap: 8px; color: var(--arc-soft); }
.status-label.live { color: var(--academy-light); }
.status-label.recent { color: var(--arc-cyan); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #989ebf; flex: none; }
.dot.live { background: var(--arc-green); }
.dot.recent { background: var(--arc-cyan); }
.wall-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 14px; color: var(--arc-soft); font-size: 12px; }
.wall-stats strong { color: var(--arc-ink); font-size: 16px; }
.flag-count { color: #ff9bc5; }
.wall-credit { display: grid; gap: 9px; margin: 18px 0 22px; font-size: 11px; font-variant-numeric: tabular-nums; }
.wall-credit strong { color: var(--arc-ink); font-size: 13px; }
.wall-prompt { min-height: 100px; margin-bottom: 20px; }
.wall-prompt .eyebrow { font-size: 9px; margin-bottom: 8px; }
.wall-line { font-size: 17px; letter-spacing: -.015em; line-height: 1.55; overflow-wrap: anywhere; max-height: 4.65em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.wall-tools { display: flex; gap: 7px; flex-wrap: wrap; font-size: 11px; align-items: center; margin-top: auto; padding-bottom: 20px; }
.tool-pill { font: 10px/1.5 var(--mono); border: 1px solid #5be7ff30; border-radius: 3px; padding: 5px 7px; color: var(--arc-cyan); background: #5be7ff06; overflow-wrap: anywhere; max-width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--arc-border); border-radius: 4px; padding: 4px 8px; color: var(--academy-light); font: 10px/1.5 var(--sans); overflow-wrap: anywhere; max-width: 100%; }
.badge.engine { font-family: var(--mono); color: var(--arc-cyan); background: #5be7ff08; border-color: #5be7ff30; }
.browser-note { flex-basis: 100%; margin-top: 2px; }
.wall-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--arc-border); padding-top: 16px; font-size: 11px; }
.wall-badges .badge { font-family: var(--mono); }
.wall-badges { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.open-desk { color: var(--academy-light); }
.wall-empty { grid-column: 1 / -1; padding: 48px 0; border-top: 1px solid var(--arc-border); }
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 15px; overflow: hidden; flex: none; background: hsl(var(--hue) 36% 25%); border: 1px solid hsl(var(--hue) 30% 42%); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-weight: 600; font-size: 1em; }
.wall-head .avatar-initials { font-size: 23px; }
.profile .avatar { border-radius: 12px; }

/* Mirror reuses the reading surface while keeping the student visible. */
.wall:has(.mirror-pane) { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding-bottom: 0; }
.mirror-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--arc-border); }
.mirror-bar > button { background: transparent; font-size: 12px; }
.mirror-student { display: flex; align-items: center; gap: 12px; }
.mirror-student > div { display: grid; }
.mirror-student strong { font-size: 16px; }
.mirror-student .muted { font: 11px/1.5 var(--sans); }
.readonly-label { color: var(--arc-cyan); margin-left: auto; font: 11px/1.5 var(--sans); border: 1px solid #5be7ff33; background: #5be7ff08; padding: 6px 10px; border-radius: 4px; }
.mirror-pane { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.mirror-pane > .tabs { border-bottom: 1px solid var(--arc-border); }
.is-mirror .chat-heading { padding: 20px 0 16px; }
.is-mirror .chat-heading h1 { font-size: 20px; }

/* Terminal theme keeps the Arcade ANSI accents with Academy green and cursor. */
.term { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; background: var(--arc-deep); }
.term-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 12px 24px; min-height: 54px; background: var(--arc-surface); border-bottom: 1px solid var(--arc-border); }
.term-title { font: 12px/1.5 var(--mono); color: var(--academy-light); }
.term-note { font-size: 12px; overflow-wrap: anywhere; }
.term-bar button { margin-left: auto; font-size: 12px; }
.term-screen { padding: 16px 12px 12px 24px; overflow: hidden; min-height: 0; min-width: 0; }

/* Keys are a simple status list, never a key editor. */
.keys-wrap { max-width: 880px; margin: 0 auto; padding: 48px 36px; }
.keys-wrap > .eyebrow { color: var(--academy-light); margin-bottom: 12px; }
.keys-intro { max-width: 570px; margin: 18px 0 36px; line-height: 1.8; }
.keys { border-top: 1px solid var(--arc-border); }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--arc-border); }
.key-copy { min-width: 0; overflow-wrap: anywhere; }
.key-copy strong { display: block; font-size: 20px; margin-bottom: 7px; letter-spacing: -.02em; }
.key-copy .muted { font-size: 13px; line-height: 1.7; }
.key-row .badge { flex: none; padding: 6px 10px; }
.badge.off { color: var(--arc-soft); border-style: dashed; }
.key-status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.keys-help { font-size: 12px; line-height: 1.8; margin-top: 28px; padding-left: 16px; border-left: 2px solid var(--arc-line); }

@keyframes cursor-pulse { 50% { opacity: .25; } }
@keyframes activity-glow { 50% { opacity: .25; } }
@media (min-width: 1600px) { .wall-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1199px) {
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .topbar { gap: 16px 24px; }
  .phase-control { order: 3; width: 100%; display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--arc-border); }
  .phase-impact { text-align: left; }
}
@media (max-width: 1000px) {
  .login:has(.demo-login:not([hidden])) .login-layout { gap: 32px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}
@media (max-width: 800px) {
  .login:has(.demo-login:not([hidden])) .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login:has(.demo-login:not([hidden])) .login-story { display: none; }
  .login-entry:has(.demo-login:not([hidden])) { width: 100%; max-width: 600px; margin-inline: auto; }
  .login-layout { gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 48px 0; }
  .login-story h1 { font-size: 44px; }
  .login-story > p { font-size: 16px; }
  .login-form { padding: 28px; }
  .arcade-scene { height: 180px; }
  .step-three { left: 220px; }
  .scene-spark { left: 244px; }
  .step-two { left: 112px; width: 88px; }
  .step-one { width: 66px; }
  .chat { padding: 0 24px; }
  .composer-hint { flex-basis: 100%; order: 3; text-align: left; }
  .agent-field { flex-wrap: wrap; gap: 6px 10px; }
  .wall-card { padding: 22px; }
  .wall-head { gap: 12px; }
  .wall-who strong { font-size: 20px; }
  .desk-nav { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  :root { --page-pad: 20px; }
  #app:has(> .topbar) { min-height: 660px; }
  .login { padding: 24px; }
  .login-brand { padding-bottom: 22px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); padding: 36px 0; gap: 30px; }
  .login-story > .eyebrow { font-size: 9px; margin-bottom: 16px; }
  .login-story h1 { font-size: clamp(38px, 10vw, 58px); }
  .login-story > p { font-size: 14px; margin-top: 16px; max-width: 280px; }
  .arcade-scene { display: none; }
  .login-form { gap: 20px; padding: 28px 24px; }
  .login-form h2 { font-size: 27px; }
  .login-form input { font-size: 16px; }
  .login-footer { gap: 8px; font-size: 10px; }
  .topbar { padding-top: 14px; padding-bottom: 14px; gap: 14px; }
  .topbar .brand { width: 100%; }
  .brand { gap: 14px; }
  .brand-copy { padding-left: 14px; }
  .brand-logo, .login-brand .brand-logo { width: 140px; }
  .brand strong { font-size: 16px; }
  .brand-sub { font-size: 8px; }
  .demo-login { padding: 20px; }
  .login:has(.demo-login:not([hidden])) .login-layout { padding: 24px 0; }
  .demo-buttons { grid-template-columns: minmax(0, 1fr); }
  .demo-btn { align-content: center; gap: 2px 14px; }
  .demo-btn .muted { grid-column: 1; }
  .demo-arrow { grid-row: 1 / 3; }
  .login-entry:has(.demo-login:not([hidden])) .login-form { padding: 20px; }
  .login-entry:has(.demo-login:not([hidden])) .login-fields { grid-template-columns: minmax(0, 1fr); }
  .topbar .who { width: 100%; margin: 0; gap: 8px; }
  .profile { margin-right: auto; gap: 8px; }
  .profile-copy strong { font-size: 12px; }
  .profile-role { font-size: 10px; }
  .topbar .who > button { padding: 10px; font-size: 11px; }
  .phase-control { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; }
  .phase-impact { text-align: center; }
  .phase-button { font-size: 12px; }
  .desk-nav { gap: 0 12px; }
  .tabs { gap: 16px; }
  .tabs button { padding: 14px 2px; font-size: 12px; min-width: 44px; }
  .phase-label { font-size: 9px; padding: 10px 0; }
  .phase-label .muted { display: none; }
  .chat { padding: 0 16px; }
  .chat-heading { padding: 18px 0 14px; gap: 12px; }
  .chat-heading h1 { font-size: 21px; }
  .chat-heading .eyebrow { font-size: 9px; }
  .chat-heading p { font-size: 10px; max-width: 90px; text-align: right; }
  .chat-list { gap: 20px; padding: 22px 6px 22px 0; }
  .bubble { max-width: 96%; padding: 14px 16px; }
  .bubble.assistant { padding-left: 14px; }
  .bubble .text { line-height: 1.8; font-size: 15px; }
  .bubble .who { font-size: 10px; }
  .chat-input { padding: 10px; }
  .chat-input textarea { font-size: 16px; min-height: 68px; padding: 4px 4px 8px; }
  .composer-controls { gap: 8px; margin-top: 4px; align-items: flex-end; }
  .agent-field { flex: 1; display: grid; gap: 4px; font-size: 10px; }
  .agent-field select { width: 100%; font-size: 12px; padding-left: 8px; padding-right: 24px; }
  .composer-actions { flex-wrap: wrap; gap: 6px; }
  .composer-actions button { min-width: 54px; font-size: 12px; padding: 10px 12px; }
  .composer-hint { font-size: 9px; }
  .chat-foot { padding: 12px 0 16px; gap: 8px; }
  .budget { margin-left: 0; width: 100%; font-size: 10px; }
  .budget meter { flex: 1; min-width: 56px; }
  .budget-warning { font-size: 10px; }
  .chat-empty { padding: 20px 8px; }
  .chat-empty h2 { font-size: 22px; }
  .chat-empty p { font-size: 13px; }
  .empty-spark { font-size: 32px; margin-bottom: 14px; }
  .wall { padding-bottom: 24px; }
  .wall-heading { padding: 28px 0 26px; gap: 20px; }
  .wall-heading h1 { font-size: 30px; }
  .wall-heading p { font-size: 13px; line-height: 1.7; }
  .wall-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .wall-card { padding: 24px; }
  .wall-head { gap: 16px; }
  .wall-prompt { min-height: 80px; }
  .mirror-bar { gap: 12px; padding: 14px 0; }
  .mirror-bar > button { padding: 10px 12px; }
  .mirror-student { gap: 10px; flex: 1; }
  .mirror-student strong { font-size: 14px; }
  .readonly-label { font-size: 9px; margin-left: 0; }
  .mirror-pane .chat { padding: 0; }
  .is-mirror .chat-heading { padding: 14px 0; }
  .is-mirror .chat-heading h1 { font-size: 18px; }
  .chat-ro { font-size: 11px; padding: 12px; }
  .term-bar { padding: 12px 16px; gap: 8px 12px; }
  .term-screen { padding: 12px 8px 8px 12px; }
  .keys-wrap { padding: 28px 24px; }
  .keys-intro { font-size: 14px; margin-bottom: 24px; }
  .key-row { gap: 16px; padding: 24px 0; flex-wrap: wrap; }
  .key-copy { flex: 1 1 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Pass 3: spacious learning pages, a classroom display, and a campus overview. */
:root { --role-pad: clamp(20px, 3vw, 48px); }
.phase-label { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.class-label { color: var(--arc-soft); margin-right: 10px; }
.welcome, .course, .usage, .classes { width: 100%; max-width: 1320px; margin: 0 auto; padding: 48px var(--role-pad) 64px; overflow-wrap: anywhere; }
.welcome h2, .usage h2 { font-size: 25px; }
.welcome p, .usage p { line-height: 1.85; }
.welcome .eyebrow, .course-head > .eyebrow, .usage > header .eyebrow, .classes > header .eyebrow { color: var(--academy-light); margin-bottom: 14px; font-size: 11px; }

/* Welcome is an arrival: a first step, a course route, then four plain rules. */
.welcome { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px 64px; }
.welcome-hero { padding: 18px 0; align-self: center; }
.welcome-hero h1 { font-size: clamp(38px, 4.2vw, 62px); letter-spacing: -.055em; line-height: 1.12; max-width: 620px; }
.welcome-hero h1 > span { display: block; color: var(--academy-light); margin-top: 8px; }
.welcome .lead { font-size: 17px; color: var(--arc-soft); margin-top: 24px; max-width: 480px; }
.welcome-class { border-left: 2px solid var(--arc-border); padding-left: 14px; margin-top: 24px; font-size: 13px; color: var(--arc-soft); }
.welcome-class strong { color: var(--arc-ink); }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 32px; }
.welcome-actions .primary { min-height: 54px; padding: 14px 24px; }
.welcome-actions > span { font-size: 12px; flex-basis: 100%; }
.welcome-block > p { margin-top: 16px; color: var(--arc-soft); }
.welcome-route { border-left: 1px solid var(--arc-border); padding-left: 40px; }
.welcome-route > p { font-size: 13px; }
.welcome-weeks { list-style: none; counter-reset: route; margin: 22px 0; padding: 0; }
.welcome-weeks li { counter-increment: route; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 14px; border-bottom: 1px solid var(--arc-border); padding: 15px 0; }
.welcome-weeks li::before { content: counter(route, decimal-leading-zero); grid-row: 1 / 3; color: var(--academy-light); font: 14px/1.8 var(--mono); }
.welcome-weeks strong { font-size: 14px; line-height: 1.7; }
.welcome-weeks .muted { grid-column: 2; font-size: 12px; }
.welcome-route button { font-size: 13px; }
.welcome-rules { grid-column: 1 / -1; border-top: 1px solid var(--arc-border); padding-top: 36px; }
.welcome-rules ul { list-style: none; counter-reset: rules; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding: 0; margin: 28px 0 0; }
.welcome-rules li { counter-increment: rules; color: var(--arc-soft); line-height: 1.85; font-size: 13px; }
.welcome-rules li::before { content: counter(rules, decimal-leading-zero); display: block; color: var(--academy-light); font: 28px/1.5 var(--mono); margin-bottom: 16px; }
.welcome-rules strong { display: block; font-size: 15px; line-height: 1.65; color: var(--arc-ink); margin-bottom: 8px; }
.welcome-pointer { border-top: 1px solid var(--arc-border); padding-top: 28px; }
.welcome-pointer > p { font-size: 14px; }
.welcome-pointer button { margin-top: 20px; font-size: 13px; }

/* Keep chat and its composer together. Notes scroll independently on wide screens. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100%; min-height: 0; gap: 0; }
.split-main, .split-side { min-width: 0; min-height: 0; overflow: auto; }
.split-side { border-left: 1px solid var(--arc-border); background: var(--arc-deep); padding: 28px 24px 36px; }
.student-chat .chat { padding: 0 clamp(20px, 3vw, 48px); max-width: 1120px; }
.student-chat .split-main { overflow: hidden; }
.student-chat .chat-foot { font-size: 12px; }
.student-chat .budget-warning { font-size: 12px; }
.notes { overflow-wrap: anywhere; }
.notes-head { margin-bottom: 28px; }
.notes-head .eyebrow { margin-bottom: 7px; font-size: 10px; }
.notes h2 { font-size: 28px; }
.notes-section { border-top: 1px solid var(--arc-border); padding: 24px 0; }
.note-visibility { display: block; font-size: 10px; letter-spacing: .08em; font-weight: 600; color: var(--arc-cyan); margin-bottom: 8px; }
.student_own .note-visibility { color: var(--academy-light); }
.trainer_private .note-visibility { color: var(--arc-warm); }
.notes-section h3 { font-size: 17px; line-height: 1.5; letter-spacing: -.025em; margin: 0 0 8px; }
.notes-section h3 > .muted { display: block; font-size: 14px; font-weight: 400; }
.notes-section p { font-size: 13px; line-height: 1.8; }
.notes-section .hint { margin-bottom: 16px; }
.notes-section.trainer_private { border-top: 2px dashed #8b7953; }
.note-composer { display: grid; gap: 10px; margin: 16px 0 20px; }
.note-composer textarea { font-size: 14px; min-height: 94px; max-height: 240px; border-color: var(--arc-border); }
.note-composer button { justify-self: start; font-size: 13px; }
.trainer_private .note-composer textarea { border-color: #8b7953; }
.trainer_private .note-composer button { background: #242437; color: var(--arc-warm); border-color: #8b7953; }
.notes ul { padding: 0; margin: 16px 0 0; list-style: none; }
.note { border: 0; border-left: 2px solid var(--arc-border); padding: 0 0 0 14px; margin: 20px 0; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; }
.note-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; font-size: 11px; line-height: 1.7; }
.note-actions { display: flex; gap: 8px; flex-basis: 100%; }
.note-actions button { font-size: 11px; padding: 10px 12px; }
.note-empty { padding: 14px; border: 1px dashed var(--arc-border); border-radius: 4px; }

/* Course: progress at the top; weeks beside the lesson checklist. */
.course { max-width: 1180px; }
.course-head { border-bottom: 1px solid var(--arc-border); padding-bottom: 32px; margin-bottom: 40px; }
.course-head h1 { max-width: 850px; }
.course-progress { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; gap: 18px; align-items: center; margin: 28px 0 18px; padding: 20px 24px; background: var(--arc-surface); border: 1px solid var(--arc-border); border-left: 3px solid var(--academy-green); border-radius: 4px; }
.course-progress .eyebrow { color: var(--academy-light); }
.course-progress > span:last-child { font-size: 14px; }
.course-progress meter { height: 7px; }
.course-progress meter::-webkit-meter-bar { height: 7px; }
.draft-note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; line-height: 1.8; }
.draft-note .badge { color: var(--arc-soft); font-size: 11px; border-style: dashed; }
.course-phase { margin-top: 32px; }
.course-phase > h2 { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 25px; margin-bottom: 24px; }
.phase-number { color: var(--arc-cyan); font: 12px/1.6 var(--mono); border: 1px solid #5be7ff40; padding: 8px 12px; border-radius: 4px; }
.course-phase .badge { font-size: 11px; letter-spacing: 0; }
.course-band { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.6fr); gap: 28px; border-top: 1px solid var(--arc-border); padding: 22px 0; }
.course-band h3 { display: grid; align-content: start; gap: 10px; margin: 8px 0 0; font-size: 16px; line-height: 1.65; }
.course-band h3 > .muted { font-size: 12px; font-weight: 400; }
.course-band ul { margin: 0; padding: 0; }
.lesson { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; list-style: none; padding: 8px 12px; min-height: 64px; border-bottom: 1px solid #363a5866; border-left: 2px solid transparent; }
.lesson input { appearance: none; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; display: grid; place-content: center; cursor: pointer; }
.lesson input::before { content: ''; width: 20px; height: 20px; border: 1px solid #8b91b0; border-radius: 4px; background: var(--arc-deep); }
.lesson input:checked::before { content: '✓'; display: grid; place-content: center; background: var(--academy-green); border-color: var(--academy-green); color: var(--academy-dark); font-size: 15px; font-weight: 600; }
.lesson label { flex: 1; min-width: 120px; cursor: pointer; font-size: 14px; line-height: 1.8; }
.lesson-id { font-family: var(--mono); font-size: 11px; color: var(--arc-soft); margin-right: 6px; }
.lesson .badge { margin-left: auto; font-size: 10px; }
.lesson.this-week { background: #93b33d0e; border-left-color: var(--academy-green); }
.lesson.done label { color: var(--academy-light); }
.lesson-state { display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--arc-soft); }
.lesson.done .lesson-state { color: var(--academy-light); }
.course-phase.locked { border: 1px dashed var(--arc-border); background: #10122266; border-radius: 6px; padding: 28px; }
.course-phase.locked .phase-number, .phase-locked { color: var(--arc-soft); }
.course-phase.locked label { cursor: default; }

/* Credits: a teaching spread with a separate, practical calculator. */
.usage { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 32px 48px; align-items: start; }
.usage > header, .usage-credit, .usage-mine { grid-column: 1 / -1; }
.usage > header .lead { margin-top: 16px; font-size: 16px; }
.usage-credit { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 32px; background: var(--arc-surface); border: 1px solid var(--arc-border); border-left: 3px solid var(--academy-green); border-radius: 4px; padding: 24px 28px; }
.usage-credit h2 { font-size: 18px; }
.usage-credit .budget { font-size: 14px; flex: 1; min-width: 200px; gap: 16px; }
.usage-credit strong { font-size: 23px; margin: 0 3px; }
.usage-credit meter { flex: 1; min-width: 120px; }
.usage-credit p { font-size: 12px; }
.usage-explain > p { margin: 18px 0 24px; font-size: 14px; color: var(--arc-soft); }
.token-example { margin: 24px 0 16px; padding: 24px; background: var(--arc-deep); border: 1px solid var(--arc-border); border-radius: 6px; }
.token-example figcaption { font-size: 13px; margin-bottom: 16px; }
.token-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.token-chips > span { font: 16px/1.5 var(--mono); white-space: pre; border: 1px solid #5be7ff66; background: #5be7ff0a; color: var(--arc-cyan); padding: 8px 10px; border-radius: 4px; }
.token-chips > span:nth-child(even) { color: var(--academy-light); border-color: #93b33d66; background: #93b33d0a; }
.token-example p { font-size: 11px; margin-top: 16px; }
.token-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 8px 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--arc-border); }
.token-scale strong { font-size: 21px; }
.token-scale > span { color: var(--academy-light); font-size: 26px; }
.usage-explain ol { list-style: none; counter-reset: cost; margin: 24px 0; padding: 0; }
.usage-explain ol li { counter-increment: cost; position: relative; padding-left: 42px; margin: 20px 0; color: var(--arc-soft); font-size: 14px; line-height: 1.85; }
.usage-explain ol li::before { content: counter(cost, decimal-leading-zero); position: absolute; left: 0; top: 2px; color: var(--arc-cyan); font: 14px/1.8 var(--mono); }
.usage-explain li strong { color: var(--arc-ink); }
.usage table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.usage th, .usage td { text-align: left; padding: 16px 12px; border-bottom: 1px solid var(--arc-border); }
.usage thead { background: var(--arc-deep); font-size: 11px; color: var(--arc-soft); }
.price-table th { width: 34%; }
.price-table th > span { display: block; font-size: 11px; font-weight: 400; margin-top: 4px; }
.price-table td { color: var(--arc-cyan); font-family: var(--mono); }
.usage-explain > .price-note { padding: 14px 16px; border-left: 2px solid var(--arc-line); font-size: 12px; line-height: 1.85; margin: 18px 0 36px; background: var(--arc-deep); }
.usage-explain > ul { padding-left: 20px; color: var(--arc-soft); font-size: 14px; line-height: 1.85; }
.usage-explain > ul li { padding: 6px 0 6px 4px; }
.usage-calc { border: 1px solid var(--arc-border); border-top: 2px solid var(--academy-green); border-radius: 4px 4px 12px 4px; padding: 28px; background: var(--arc-surface); }
.usage-calc .eyebrow { color: var(--academy-light); margin-bottom: 12px; }
.usage-calc p { font-size: 13px; margin: 16px 0 20px; }
.usage-calc textarea { min-height: 172px; font-size: 14px; }
.calc-out { margin-top: 20px; border-top: 1px solid var(--arc-border); padding-top: 20px; font-size: 13px; line-height: 1.85; color: var(--arc-soft); }
.calc-out strong { display: block; font-size: 28px; color: var(--academy-light); }
.calc-out > div + div { margin-top: 12px; }
.usage-mine { border-top: 1px solid var(--arc-border); padding-top: 32px; }
.usage-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 28px 0; }
.usage-totals > div { border-left: 2px solid var(--arc-border); padding-left: 20px; }
.usage-totals strong { display: block; font-size: 26px; }
.usage-totals span { font-size: 12px; }
.usage caption { text-align: left; color: var(--arc-soft); font-size: 12px; padding: 12px; }
.usage details { margin-top: 24px; border: 1px solid var(--arc-border); border-radius: 4px; }
.usage summary { padding: 16px 20px; min-height: 48px; cursor: pointer; font-size: 14px; }
.usage details ul { padding: 0 24px 20px 40px; font-size: 13px; color: var(--arc-soft); line-height: 2; }

/* Classroom: wall and notes share one screen; names, credit and status lead. */
.class-holder { height: 100%; min-height: 0; }
.pane:has(> .class-holder) { display: grid; grid-template-rows: minmax(0, 1fr); }
.pane:has(> .class-switch) { grid-template-rows: auto minmax(0, 1fr); }
.class-display .wall { max-width: none; padding: 0 28px 32px; }
.class-display .wall-heading { display: block; padding: 30px 0 24px; }
.class-display .wall-heading h1 { font-size: clamp(28px, 2.6vw, 44px); }
.class-display .wall-heading p { font-size: 15px; line-height: 1.8; margin-top: 12px; }
.class-display .wall-legend { margin-top: 18px; font-size: 13px; }
.class-display .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.class-display .wall-card { padding: 24px; border-radius: 4px 4px 10px 4px; }
.class-display .wall-head { gap: 14px; margin-bottom: 18px; }
.class-display .wall-who strong { font-size: 26px; }
.class-display .wall-who > span { font-size: 14px; }
.class-display .wall-status { font-size: 14px; padding-top: 16px; gap: 10px; }
.class-display .status-label { font-size: 17px; font-weight: 500; }
.class-display .dot { width: 8px; height: 8px; }
.class-display .wall-lessons { font-size: 15px; color: var(--arc-ink); margin-top: 16px; }
.class-display .wall-stats { font-size: 14px; }
.class-display .wall-stats strong { font-size: 18px; }
.class-display .wall-credit { margin: 18px 0; font-size: 14px; }
.class-display .wall-credit strong { font-size: 24px; }
.class-display .budget-warning { font-size: 14px; }
.class-display .wall-prompt { margin-bottom: 18px; min-height: 104px; }
.class-display .wall-prompt .eyebrow { font-size: 11px; }
.class-display .wall-line { font-size: 18px; }
.class-display .wall-tools { font-size: 13px; padding-bottom: 16px; }
.class-display .tool-pill, .class-display .badge.engine { font-size: 12px; }
.class-display .wall-card-foot { font-size: 13px; }
.class-display .wall-badges .badge { font-size: 12px; }
.class-display .notes-head { margin-top: 4px; }
.class-display .wall:has(.mirror-pane) { padding-bottom: 0; }
.class-display .mirror-bar { gap: 12px; }
.class-display .chat { padding: 0; }
.pane-inner:has(> .course), .pane-inner:has(> .usage) { overflow: auto; }
.mirror-pane .course, .mirror-pane .usage { padding: 28px 8px 40px; }
.mirror-pane .course-head h1, .mirror-pane .usage h1 { font-size: 30px; }
.mirror-pane .usage { gap: 24px; grid-template-columns: minmax(0, 1fr); }
.class-switch { padding: 12px 28px; border-bottom: 1px solid var(--arc-border); }
.class-switch label { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.class-switch select { width: auto; max-width: 100%; }

/* Admin: class cards are the front door; settings is an in-page drawer. */
.classes { max-width: 1600px; }
.classes > header p { margin-top: 16px; line-height: 1.8; }
.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 32px 0 48px; }
.class-card { display: flex; flex-direction: column; text-align: left; padding: 28px; background: linear-gradient(135deg, #22253f, var(--arc-surface)); border-top: 2px solid var(--arc-border); border-radius: 4px 4px 12px 4px; min-width: 0; }
.class-card.is-live { border-top-color: var(--academy-green); }
.class-title { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.class-title strong { font-size: 27px; letter-spacing: -.04em; line-height: 1.35; }
.class-title .badge { color: var(--arc-cyan); border-color: #5be7ff40; font-size: 11px; }
.class-location { font-size: 13px; line-height: 1.8; margin-bottom: 24px; }
.class-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; font-size: 13px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--arc-border); }
.class-stats strong { display: block; font-size: 34px; margin-bottom: 3px; letter-spacing: -.04em; }
.class-live { color: var(--academy-light); }
.class-card-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--arc-border); font-size: 12px; color: var(--arc-soft); }
.class-card-foot > span:last-child, .is-live .class-card-foot > span:first-child { color: var(--academy-light); }
.class-new { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.8fr); gap: 48px; border-top: 1px solid var(--arc-border); padding: 36px 0 0; }
.class-new-intro .eyebrow { color: var(--academy-light); margin-bottom: 12px; }
.class-new-intro p { margin-top: 18px; font-size: 14px; line-height: 1.85; max-width: 320px; }
.class-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-content: start; }
.class-fields label, .class-roster label { display: grid; gap: 10px; font-size: 13px; }
.class-fields input, .class-fields select, .class-roster select { min-height: 48px; font-size: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding-top: 4px; }
.form-actions .err:empty { display: none; }
.pane:has(> .class-top) { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.class-top { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--arc-border); background: var(--arc-deep); }
.class-top strong { flex: 1; font-size: 16px; overflow-wrap: anywhere; }
.class-top > button { font-size: 13px; }
.class-top > button[aria-expanded=true] { color: var(--academy-light); border-color: var(--academy-green); }
.settings-host { max-height: min(68dvh, 720px); overflow: auto; border-bottom: 2px solid var(--arc-border); background: var(--arc-surface); }
.class-settings { padding: 28px; max-width: 1500px; margin: 0 auto; }
.class-settings header { margin-bottom: 24px; }
.class-settings header .eyebrow { color: var(--academy-light); margin-bottom: 8px; }
.class-settings h2 { font-size: 26px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; }
.phase-setting { grid-column: 1 / -1; background: #f2d38a08; border-left: 2px solid var(--arc-warm); padding: 18px; }
.phase-consequence { font-size: 12px; color: var(--arc-warm); line-height: 1.8; }
.class-roster { border-left: 1px solid var(--arc-border); padding-left: 32px; }
.class-roster h3 { margin: 0 0 12px; font-size: 18px; }
.class-roster ul { list-style: none; padding: 0; margin: 0 0 24px; }
.class-roster li { padding: 10px 0; border-bottom: 1px solid var(--arc-border); font-size: 14px; }
.class-roster li span { display: inline-block; font-size: 12px; margin-left: 6px; }
.class-roster p { font-size: 12px; line-height: 1.8; margin: 12px 0; }
.class-roster > button { font-size: 13px; }

@media (min-width: 1750px) {
  .split { grid-template-columns: minmax(0, 1fr) 410px; }
  .split-side { padding: 32px; }
  .class-display .wall { padding: 0 40px 40px; }
  .class-display .wall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .class-display .wall-who strong { font-size: 30px; }
  .class-display .wall-heading { padding-top: 36px; }
  .class-display .wall-card { padding: 28px; }
  .class-display .wall-line { font-size: 20px; }
  .class-display .wall-lessons, .class-display .wall-stats, .class-display .wall-credit, .class-display .wall-who > span, .class-display .last-active { font-size: 16px; }
  .class-display .status-label { font-size: 19px; }
  .class-display .wall-credit strong { font-size: 28px; }
  .class-display .notes-section h3 { font-size: 20px; }
  .class-display .notes-section p, .class-display .note-body, .class-display .note-composer textarea { font-size: 16px; }
  .class-display .note-visibility, .class-display .note-meta, .class-display .note-actions button, .class-display .tool-pill, .class-display .wall-tools, .class-display .wall-card-foot, .class-display .wall-prompt .eyebrow, .class-display .wall-legend, .class-display .badge.engine, .class-display .wall-badges .badge { font-size: 14px; }
}
@media (max-width: 1199px) {
  .split { grid-template-columns: minmax(0, 1fr) 310px; }
  .split-side { padding: 24px 20px; }
  .class-display .wall-grid { grid-template-columns: minmax(0, 1fr); }
  .class-display .wall-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
  .class-display .wall-head, .class-display .wall-status, .class-display .wall-card-foot { grid-column: 1 / -1; }
  .class-display .wall-stats { display: grid; justify-content: start; }
  .class-display .wall-prompt { grid-column: 1 / -1; }
  .class-display .wall-tools { grid-column: 1 / -1; }
  .class-display .wall-credit { grid-column: 1 / -1; }
  .welcome { gap: 36px; }
  .welcome-route { padding-left: 28px; }
  .welcome-rules ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage { gap: 32px; }
  .usage-credit p { flex-basis: 100%; }
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mirror-pane .course-band { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mirror-pane .course-progress { grid-template-columns: minmax(0, 1fr); }
  .mirror-pane .usage-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .split-main, .split-side { overflow: visible; }
  .split-side { border-left: 0; border-top: 1px solid var(--arc-border); padding: 28px var(--role-pad); }
  .student-chat { grid-template-rows: minmax(560px, calc(100dvh - 160px)) auto; }
  .student-chat .split-main { min-height: 0; }
  .student-chat .chat { padding: 0 var(--role-pad); }
  .notes { max-width: 740px; margin: 0 auto; }
  .pane:has(> .class-holder), .pane:has(> .class-top) { display: block; }
  .class-holder { height: auto; }
  .class-display .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-display .wall-card { display: flex; }
  .class-display .wall-stats { display: flex; justify-content: space-between; }
  .class-display .wall:has(.mirror-pane) { height: max(700px, calc(100dvh - 160px)); }
  .class-display .wall { padding: 0 var(--role-pad) 32px; }
  .course-band { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .course-band h3 { gap: 4px; }
  .course-progress { grid-template-columns: minmax(0, 1fr) auto; }
  .course-progress .eyebrow { grid-column: 1 / -1; }
  .usage { grid-template-columns: minmax(0, 1fr); }
  .usage-credit .budget { min-width: 240px; }
  .usage-credit p { flex-basis: auto; }
  .class-new { gap: 28px; grid-template-columns: minmax(0, 1fr); }
  .class-new-intro p { max-width: 550px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .class-roster { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid var(--arc-border); }
}
@media (max-width: 600px) {
  .welcome, .course, .usage, .classes { padding-top: 28px; padding-bottom: 40px; }
  .phase-label { font-size: 10px; gap: 4px; text-align: left; justify-content: flex-start; padding-top: 8px; padding-bottom: 10px; }
  .phase-label .class-label { color: var(--arc-soft); margin-right: 4px; }
  .welcome { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .welcome-hero { padding: 8px 0; }
  .welcome-hero h1 { font-size: 42px; }
  .welcome .lead { font-size: 15px; margin-top: 20px; }
  .welcome-class { font-size: 12px; }
  .welcome-actions .primary { width: 100%; }
  .welcome-actions > span { text-align: center; }
  .welcome-route { border-left: 0; border-top: 1px solid var(--arc-border); padding: 28px 0 0; }
  .welcome-rules { padding-top: 28px; }
  .welcome-rules ul { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .welcome-rules li { position: relative; padding-left: 46px; }
  .welcome-rules li::before { position: absolute; left: 0; top: 0; font-size: 24px; }
  .welcome-pointer .eyebrow { font-size: 10px; }
  .student-chat { grid-template-rows: minmax(540px, calc(100dvh - 222px)) auto; }
  .student-chat .chat-foot .budget { font-size: 11px; }
  .student-chat .chat-heading p { font-size: 11px; }
  .note-composer textarea, .usage-calc textarea, .class-fields input, .class-fields select, .class-roster select { font-size: 16px; }
  .notes-section h3 { font-size: 19px; }
  .notes-section p, .note-body { font-size: 14px; }
  .note-visibility { font-size: 11px; }
  .course-head { margin-bottom: 28px; padding-bottom: 24px; }
  .course-head h1, .usage h1 { font-size: 32px; }
  .course-progress { padding: 18px; gap: 12px; grid-template-columns: minmax(0, 1fr); }
  .course-progress > span:last-child { font-size: 13px; }
  .course-phase > h2 { font-size: 23px; gap: 10px; }
  .course-phase > h2 > span:nth-child(2) { flex-basis: 100%; order: 2; }
  .course-phase.locked { padding: 18px 12px; }
  .lesson { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding: 8px 4px; gap: 4px 8px; }
  .lesson label { min-width: 0; font-size: 13px; }
  .lesson .badge { grid-column: 2; justify-self: start; margin-left: 0; }
  .usage { gap: 28px; }
  .usage-credit { padding: 20px; gap: 16px; }
  .usage-credit .budget { min-width: 0; flex-basis: 100%; font-size: 12px; }
  .usage-credit .budget > span { width: 100%; }
  .usage-credit meter { flex-basis: 100%; }
  .usage-credit p { font-size: 12px; }
  .usage h2 { font-size: 23px; }
  .usage-calc { padding: 24px 20px; }
  .token-example { padding: 20px 16px; }
  .token-chips { gap: 5px; }
  .token-chips > span { font-size: 14px; padding: 7px; }
  .token-scale { gap: 12px; }
  .token-scale strong { font-size: 18px; }
  .usage table { font-size: 12px; table-layout: fixed; }
  .usage th, .usage td { padding: 14px 8px; overflow-wrap: anywhere; }
  .usage thead { font-size: 10px; }
  .usage-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .usage-totals > div { padding-left: 14px; }
  .usage-totals strong { font-size: 22px; }
  .class-display .wall-grid { grid-template-columns: minmax(0, 1fr); }
  .class-display .wall-card { padding: 22px; }
  .class-display .wall-heading { padding-top: 28px; }
  .class-display .wall-heading p { font-size: 14px; }
  .class-display .wall-legend { font-size: 12px; gap: 12px; }
  .class-display .wall-who strong { font-size: 25px; }
  .class-display .wall-tools { font-size: 12px; }
  .class-display .mirror-student { min-width: 0; overflow-wrap: anywhere; }
  .class-display .mirror-bar > button { flex-basis: 100%; }
  .class-display .wall:has(.mirror-pane) { height: max(780px, calc(100dvh - 222px)); }
  .mirror-pane .course, .mirror-pane .usage { padding-left: 0; padding-right: 0; }
  .mirror-pane .course-head h1, .mirror-pane .usage h1 { font-size: 26px; }
  .class-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 28px 0 36px; }
  .class-card { padding: 24px; }
  .class-fields { grid-template-columns: minmax(0, 1fr); }
  .class-top { padding: 14px 20px; gap: 12px; }
  .class-top strong { flex-basis: 100%; order: -1; }
  .class-top > button { flex: 1; }
  .class-settings { padding: 24px 20px; }
  .phase-setting { padding: 16px; }
  .class-switch { padding: 12px 20px; }
}

/* Plain anchors help students reach stacked notes without another UI state. */
.notes-jump { display: none; }
@media (max-width: 900px) {
  .notes-jump { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--arc-border); border-radius: 4px; color: var(--academy-light); font-size: 12px; text-decoration: none; }
  .notes-jump:hover { border-color: var(--academy-green); }
  .chat-context { display: grid; justify-items: end; gap: 8px; }
  .chat-context p { display: none; }
  .notes-head .notes-jump { margin-top: 16px; }
}
