:root {
  color-scheme: light;
  --ink: #171716;
  --muted: #74746f;
  --line: rgba(23, 23, 22, .1);
  --paper: #f5f5f2;
  --white: #fff;
  --accent: #b7ef58;
  --accent-deep: #396a18;
  --warm: #ffdd83;
  --danger: #b74646;
  --radius: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 82% 2%, rgba(183, 239, 88, .22), transparent 24rem), var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell { width: min(1440px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 40px 64px; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark, .login-icon { display: grid; place-items: center; background: var(--ink); color: var(--accent); font-weight: 900; border-radius: 12px; }
.brand-mark { width: 42px; height: 42px; font-size: 23px; }
.brand span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-deep); font-size: 13px; font-weight: 700; }
.live-pill i { width: 8px; height: 8px; background: #69b638; border-radius: 50%; box-shadow: 0 0 0 5px rgba(105, 182, 56, .13); }
.quiet-button, .refresh-button { border: 1px solid var(--line); background: rgba(255, 255, 255, .65); border-radius: 999px; padding: 10px 17px; color: var(--ink); }
.quiet-button:hover, .refresh-button:hover { background: var(--white); }

.login-view { min-height: calc(100vh - 94px); display: grid; place-items: center; padding: 56px 0; }
.login-card { width: min(660px, 100%); padding: 52px; border-radius: 38px; background: rgba(255, 255, 255, .91); box-shadow: 0 34px 100px rgba(40, 42, 32, .12); border: 1px solid rgba(255,255,255,.9); }
.login-icon { width: 58px; height: 58px; font-size: 29px; margin-bottom: 36px; }
.eyebrow, .panel-heading small { margin: 0 0 10px; font-size: 11px; letter-spacing: .17em; font-weight: 800; color: var(--accent-deep); }
.login-card h1, .hero-row h1 { margin: 0; font-size: clamp(38px, 5vw, 66px); line-height: .98; letter-spacing: -.055em; max-width: 760px; }
.login-copy, .hero-row p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.login-copy { max-width: 500px; margin: 22px 0 36px; }
.login-card label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.password-row input { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); padding: 0 17px; outline: none; }
.password-row input:focus { border-color: #8ac742; box-shadow: 0 0 0 4px rgba(183, 239, 88, .26); }
.primary-button { min-height: 52px; border: 0; border-radius: 15px; padding: 0 24px; background: var(--ink); color: white; font-weight: 750; }
.primary-button:hover { transform: translateY(-1px); }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.dashboard { padding-top: 58px; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px 0 50px; }
.hero-row h1 { font-size: clamp(48px, 7vw, 88px); }
.hero-row p { margin: 18px 0 0; }
.identity-strip { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 23px 26px; background: var(--ink); color: white; border-radius: var(--radius); }
.student-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--accent); color: var(--ink); font-size: 27px; font-weight: 900; }
.student-copy small, .sync-time small { color: #b6b7af; font-size: 11px; letter-spacing: .08em; }
.student-copy h2 { margin: 4px 0; font-size: 23px; }
.student-copy p, .sync-time span { margin: 0; color: #d0d1ca; font-size: 13px; }
.sync-time { text-align: right; display: grid; gap: 4px; }
.sync-time strong { color: var(--accent); font-size: 17px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0; }
.metric-card { min-height: 164px; padding: 25px; background: var(--white); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(20,20,20,.05); }
.metric-card small { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 47px; letter-spacing: -.06em; line-height: 1; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card.accent { background: var(--accent); }
.metric-card.accent small, .metric-card.accent span { color: #3c591c; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 14px; }
.panel { min-width: 0; padding: 27px; background: rgba(255,255,255,.94); border-radius: var(--radius); border: 1px solid rgba(20,20,20,.05); }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 26px; }
.panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.status-pill { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: rgba(183,239,88,.35); color: var(--accent-deep); font-size: 11px; font-weight: 750; }
.status-pill.neutral { background: #efefeb; color: #6f706a; }
.timeline { display: grid; gap: 12px; max-height: 600px; overflow: auto; padding-right: 4px; }
.trace-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 15px 0; border-top: 1px solid var(--line); }
.trace-row:first-child { border-top: 0; }
.trace-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--paper); font-size: 15px; font-weight: 850; }
.trace-row.coach .trace-icon { background: var(--ink); color: var(--accent); }
.trace-row.attempt .trace-icon { background: var(--warm); }
.trace-copy strong { display: block; margin-bottom: 5px; font-size: 13px; }
.trace-copy p { margin: 0; color: #4c4c49; line-height: 1.55; overflow-wrap: anywhere; }
.trace-row time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.knowledge-list, .activity-list { display: grid; gap: 11px; }
.knowledge-row, .activity-row { padding: 14px 15px; border-radius: 16px; background: var(--paper); }
.knowledge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.knowledge-row strong, .activity-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.knowledge-row small, .activity-row small { color: var(--muted); }
.knowledge-state { font-size: 11px; padding: 6px 8px; border-radius: 99px; background: white; color: var(--accent-deep); font-weight: 750; }
.report-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.report-module { border-radius: 18px; background: var(--paper); padding: 19px; }
.report-module h3 { margin: 0 0 10px; font-size: 15px; }
.report-module p { margin: 0; color: #4c4c49; font-size: 14px; line-height: 1.6; }
.empty-copy { color: var(--muted); font-size: 14px; line-height: 1.65; }
.empty-state { margin-top: 40px; padding: 70px 32px; text-align: center; border: 1px dashed rgba(23,23,22,.22); border-radius: var(--radius); }
.empty-state span { font-size: 24px; font-weight: 780; }
.empty-state p { color: var(--muted); }

@media (max-width: 980px) {
  .shell { padding-inline: 22px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .report-body { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { padding: 0 14px 34px; }
  .topbar { min-height: 72px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .live-pill span { display: none; }
  .login-view { min-height: calc(100vh - 72px); padding: 22px 0; }
  .login-card { padding: 31px 22px; border-radius: 27px; }
  .login-icon { margin-bottom: 26px; }
  .password-row { grid-template-columns: 1fr; }
  .password-row input { min-height: 52px; }
  .dashboard { padding-top: 30px; }
  .hero-row { align-items: start; padding-bottom: 30px; }
  .hero-row h1 { font-size: 49px; }
  .hero-row p { font-size: 14px; }
  .refresh-button { font-size: 0; width: 42px; height: 42px; padding: 0; }
  .refresh-button::after { content: "↻"; font-size: 21px; }
  .identity-strip { grid-template-columns: auto 1fr; padding: 18px; }
  .sync-time { grid-column: 1 / -1; text-align: left; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
  .metric-grid { gap: 9px; margin-block: 9px; }
  .metric-card { min-height: 135px; padding: 19px; border-radius: 22px; }
  .metric-card strong { font-size: 39px; }
  .content-grid { gap: 9px; }
  .panel { padding: 21px 18px; border-radius: 22px; }
  .panel-heading h2 { font-size: 21px; }
  .trace-row { grid-template-columns: 34px minmax(0,1fr); }
  .trace-row time { grid-column: 2; }
}
