/* ===== Tokens ===== */
:root {
  --ink:        #0f172a;
  --ink-2:      #334155;
  --ink-3:      #64748b;
  --ink-4:      #94a3b8;
  --surface:    #ffffff;
  --bg:         #f1f5f9;
  --line:       #e2e8f0;
  --green:      #1a6b55;
  --green-dark: #134d3d;
  --green-lt:   #ecfdf5;
  --green-mid:  #d1fae5;
  --red:        #dc2626;
  --amber:      #d97706;
  --blue:       #2563eb;
  --violet:     #7c3aed;
  --r:          10px;
  --r-sm:       6px;
  --sh:         0 1px 3px rgb(0 0 0/.08), 0 1px 2px -1px rgb(0 0 0/.06);
  --sh-md:      0 4px 12px rgb(0 0 0/.10), 0 1px 4px rgb(0 0 0/.06);
  --sh-lg:      0 8px 24px rgb(0 0 0/.12), 0 2px 8px rgb(0 0 0/.06);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--ink-2); line-height: 1.65; }
ul { padding-left: 1.25rem; }
li { margin-bottom: .3rem; color: var(--ink-2); }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 0;
  height: 52px; padding: 0 1.75rem;
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-brand {
  font-weight: 800; font-size: 1rem; color: #fff;
  letter-spacing: -.02em; margin-right: 2rem;
}
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 0; flex: 1; }
.nav-links a {
  color: rgba(255,255,255,.6); font-size: .875rem; font-weight: 500;
  padding: 0 .875rem; height: 52px; display: flex; align-items: center;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; border-bottom-color: #4ade80; }
.nav-user { display: flex; align-items: center; gap: .75rem; }
.nav-user span { font-size: .8rem; color: rgba(255,255,255,.5); }

/* ===== Shell ===== */
.shell { max-width: 800px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.shell.auth-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

/* ===== Page header ===== */
.page-header { margin-bottom: 2.25rem; }
.page-header.compact { margin-bottom: 1.5rem; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green); margin-bottom: .3rem;
}
h1 {
  font-size: 2.25rem; font-weight: 800; letter-spacing: -.04em;
  line-height: 1.15; color: var(--ink); margin-bottom: .5rem;
}
.subtitle { color: var(--ink-3); max-width: 600px; font-size: .9375rem; }

/* ===== Auth ===== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, .12), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(26, 107, 85, .16), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef7f4 100%);
}
.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vw, 6.5rem);
}
.auth-hero h1 {
  max-width: 620px;
  font-size: clamp(2.6rem, 6vw, 5.75rem);
  line-height: .95;
  letter-spacing: -.05em;
}
.auth-hero p {
  max-width: 560px;
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 2rem;
}
.auth-points span {
  border: 1px solid rgba(26, 107, 85, .18);
  border-radius: 999px;
  padding: .45rem .75rem;
  background: rgba(255,255,255,.72);
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 700;
}
.auth-card {
  align-self: center;
  justify-self: start;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
  padding: 2.25rem;
  width: min(420px, calc(100% - 2rem));
  backdrop-filter: blur(12px);
}
.auth-card form { display: flex; flex-direction: column; gap: .875rem; }
.auth-header { margin-bottom: 1.75rem; }
.auth-header .eyebrow { margin-bottom: .4rem; }
.auth-header h1 { font-size: 2rem; letter-spacing: -.035em; }
.auth-header p { color: var(--ink-3); font-size: .9rem; margin-top: .25rem; }
.auth-alt { margin-top: 1.25rem; text-align: center; font-size: .85rem; color: var(--ink-3); }
.auth-alt a { color: var(--green); font-weight: 600; }

/* ===== Form labels & inputs ===== */
label { display: flex; flex-direction: column; gap: .35rem; }
label > span { font-size: .825rem; font-weight: 600; color: var(--ink-2); }
label small { font-weight: 400; color: var(--ink-4); }
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%; padding: .625rem .875rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-family: inherit; font-size: .9375rem; color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,85,.15);
}
textarea { resize: vertical; min-height: 84px; }
.required { color: var(--red); }
.char-count { font-size: .72rem; color: var(--ink-4); align-self: flex-end; }

/* ===== Voice ===== */
.voice-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: start;
  gap: .5rem;
}
.voice-field textarea { padding-right: .875rem; }
.mic-btn {
  min-height: 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .45rem .55rem;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--green-dark);
  transition: background .15s, border-color .15s, color .15s;
}
.mic-btn:hover { background: var(--green-lt); border-color: var(--green); }
.mic-btn.listening {
  background: #fef2f2;
  border-color: var(--red);
  color: var(--red);
  animation: pulse .8s infinite;
}
.mic-btn:disabled {
  cursor: not-allowed;
  color: var(--ink-4);
  background: var(--bg);
}
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.45 } }
.voice-hint { font-size: .775rem; color: var(--ink-4); }

/* ===== File drop ===== */
.file-drop {
  border: 2px dashed var(--line); border-radius: var(--r-sm);
  padding: 1.5rem 1rem; text-align: center;
  color: var(--ink-3); font-size: .875rem; transition: border-color .2s, background .2s;
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--green); background: var(--green-lt);
}
.file-drop input[type="file"] { display: none; }
.file-drop button {
  color: var(--green); background: none; border: none;
  cursor: pointer; font-size: .875rem; font-weight: 600;
  text-decoration: underline; padding: 0;
}
.file-hint { color: var(--ink-4); font-size: .75rem; margin-top: .3rem; }
.file-list { list-style: none; padding: 0; margin-top: .625rem; text-align: left; }
.file-list li {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .625rem; background: var(--green-mid);
  border-radius: 4px; font-size: .8rem; color: var(--green-dark);
  margin-top: .3rem;
}

/* ===== Panels ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.75rem;
  margin-bottom: 1.125rem;
  box-shadow: var(--sh);
}
.panel-head { display: flex; align-items: flex-start; gap: .875rem; margin-bottom: 1.5rem; }
.panel-head h2 { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: .1rem; }
.panel-head p { font-size: .85rem; color: var(--ink-3); margin: 0; }
.step-badge {
  flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .825rem;
}
.field-group { display: flex; flex-direction: column; gap: 1.125rem; }
.decision-form { display: flex; flex-direction: column; gap: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== Form actions ===== */
.form-actions {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.5rem 0 0;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1.5rem; border: none; border-radius: var(--r-sm);
  background: var(--green); color: #fff; font-family: inherit;
  font-size: .9375rem; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--green-dark); text-decoration: none; color: #fff; }
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .55rem 1.125rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); font-family: inherit;
  font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--ink-3); background: var(--bg); text-decoration: none; }
.btn-full { width: 100%; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-sm { padding: .35rem .875rem; font-size: .825rem; }

/* ===== Nav exit button ===== */
.nav-user .btn-ghost {
  color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.2);
  background: transparent; font-size: .825rem; padding: .35rem .875rem;
}
.nav-user .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }

/* ===== Notice ===== */
.notice {
  border-radius: var(--r-sm); padding: .875rem 1.125rem;
  margin-bottom: 1.25rem; font-size: .875rem; border: 1px solid;
  background: #fffbeb; border-color: #fde68a;
}
.notice p { margin: 0; font-size: .875rem; color: #78350f; }
.notice-warn { background: #fff7ed; border-color: #fed7aa; }
.notice-warn p { color: #9a3412; }

/* ===== Metrics strip ===== */
.metrics-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .875rem; margin-bottom: 1.25rem;
}
.metric-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.125rem 1.25rem; box-shadow: var(--sh);
}
.metric-label {
  display: block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); margin-bottom: .3rem;
}
.metric-value { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.metric-value small { font-size: .95rem; font-weight: 500; color: var(--ink-3); }
.system-metric .metric-value { font-size: 1.25rem; }
.metric-card.risk-bajo  .metric-value { color: #16a34a; }
.metric-card.risk-medio .metric-value { color: var(--amber); }
.metric-card.risk-alto  .metric-value { color: var(--red); }
.score-bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: .625rem; }
.score-fill { height: 100%; background: var(--green); border-radius: 2px; }

/* ===== Result sections ===== */
.result-section h2 {
  font-size: 1rem; font-weight: 700; color: var(--ink);
  margin-bottom: .875rem; padding-bottom: .625rem;
  border-bottom: 1px solid var(--line);
}
.section-intro { color: var(--ink-3); font-size: .875rem; margin-bottom: .875rem; margin-top: -.25rem; }
.section-icon { font-size: 1.25rem; margin-bottom: .375rem; }

/* ===== Decision map ===== */
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.map-cell {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .875rem 1rem;
}
.map-cell.map-strength { border-left: 3px solid #16a34a; }
.map-cell.map-weak     { border-left: 3px solid var(--amber); }
.map-label {
  display: block; font-size: .68rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: .35rem;
}
.map-cell p { margin: 0; color: var(--ink); font-size: .875rem; }

/* ===== System 1 / System 2 ===== */
.panel-system {
  border-left: 4px solid var(--blue);
  background: linear-gradient(to right, #eff6ff, #ffffff);
}
.panel-system-primary {
  box-shadow: var(--sh-md);
  border-color: #bfdbfe;
}
.panel-system .eyebrow {
  color: var(--blue);
  margin-bottom: .25rem;
}
.panel-system h2 {
  font-size: 1.2rem;
  border-bottom-color: #bfdbfe;
}
.system-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.system-overview div {
  background: rgba(255,255,255,.78);
  border: 1px solid #bfdbfe;
  border-radius: var(--r-sm);
  padding: .85rem 1rem;
}
.system-overview span {
  display: block;
  color: var(--ink-4);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.system-overview strong {
  display: block;
  font-size: 1.2rem;
  color: var(--ink);
  margin-top: .25rem;
}
.system-overview small {
  font-size: .85rem;
  color: var(--ink-3);
  font-weight: 600;
}
.system-read {
  color: var(--ink);
  font-size: .95rem;
}
.system-columns h4 {
  color: var(--ink);
  margin-bottom: .5rem;
}
.system-risk-box {
  margin-top: .75rem;
  padding: .75rem .85rem;
  border-radius: var(--r-sm);
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.system-risk-box span {
  display: block;
  color: #9a3412;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  margin-bottom: .35rem;
  text-transform: uppercase;
}
.system-risk-box ul { margin-bottom: 0; }
.system-status {
  color: var(--ink-3);
  font-size: .875rem;
  margin-bottom: .625rem;
}
.system-switch {
  margin-top: 1rem;
  padding: .875rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.7);
}
.system-switch p {
  margin: 0 0 .45rem;
  font-size: .9rem;
}
.system-switch p:last-child { margin-bottom: 0; }

/* ===== Bias cards ===== */
.bias-card {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 1.125rem; margin-bottom: .75rem;
  border-left: 4px solid var(--line);
}
.bias-card.conf-alta  { border-left-color: var(--red); }
.bias-card.conf-media { border-left-color: var(--amber); }
.bias-card.conf-baja  { border-left-color: var(--ink-4); }
.bias-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .625rem; }
.bias-head h3 { font-size: .9375rem; font-weight: 700; margin: 0; color: var(--ink); }
.bias-body p { font-size: .875rem; color: var(--ink-2); margin-bottom: .45rem; }
.bias-question {
  background: var(--green-lt); border-radius: var(--r-sm);
  padding: .625rem .875rem; margin-top: .625rem;
  border-left: 3px solid var(--green);
}
.bias-question span {
  display: block; font-size: .68rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--green); margin-bottom: .2rem;
}
.bias-question p { font-size: .875rem; color: var(--ink); font-weight: 600; margin: 0; }
.bias-system-link {
  margin-top: .55rem;
  padding: .55rem .75rem;
  border-left: 3px solid var(--blue);
  border-radius: var(--r-sm);
  background: #f8fafc;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.conf-badge { background: #f1f5f9; color: var(--ink-3); }
.risk-badge.risk-bajo  { background: #dcfce7; color: #166534; }
.risk-badge.risk-medio { background: #fef3c7; color: #92400e; }
.risk-badge.risk-alto  { background: #fee2e2; color: #991b1b; }
.score-inline { background: var(--green-lt); color: var(--green-dark); }

/* ===== Pre-mortem ===== */
.panel-premortem {
  border-left: 4px solid var(--amber);
  background: linear-gradient(to right, #fffbeb, #fffff);
}
blockquote.premortem-scenario {
  font-style: italic; color: var(--ink-2); font-size: .9rem;
  border-left: 3px solid var(--amber); padding-left: .875rem;
  margin: .625rem 0 1rem;
}

/* ===== Devil's advocate ===== */
.panel-devil {
  border-left: 4px solid var(--violet);
  background: linear-gradient(to right, #faf5ff, #ffffff);
}
blockquote.devil-counter {
  font-style: italic; color: var(--ink-2); font-size: .9rem;
  border-left: 3px solid var(--violet); padding-left: .875rem;
  margin: .625rem 0 1rem;
}

/* ===== Two-col list ===== */
.two-col-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.two-col-list h4 {
  font-size: .78rem; font-weight: 700; margin-bottom: .5rem;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em;
}
.two-col-list ul, .two-col-list p { font-size: .875rem; }

/* ===== Score breakdown ===== */
.score-breakdown { display: flex; flex-direction: column; gap: .5rem; }
.score-row { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.score-row > span:first-child { width: 210px; color: var(--ink-2); text-transform: capitalize; }
.mini-bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--green); border-radius: 3px; }
.score-num { width: 2.75rem; text-align: right; font-weight: 700; color: var(--ink); }

/* ===== Next step ===== */
.panel-next { background: var(--green-lt); border-color: #a7f3d0; border-left: 4px solid var(--green); }
.next-step { font-size: .9375rem; font-weight: 600; color: var(--green-dark); }

/* ===== Result actions ===== */
.result-actions { display: flex; gap: .875rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ===== History ===== */
.history-list { display: flex; flex-direction: column; gap: .875rem; }
.history-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--r); padding: 1.25rem; box-shadow: var(--sh);
  transition: box-shadow .2s;
}
.history-card:hover { box-shadow: var(--sh-md); }
.history-card.risk-border-bajo  { border-left-color: #16a34a; }
.history-card.risk-border-medio { border-left-color: var(--amber); }
.history-card.risk-border-alto  { border-left-color: var(--red); }
.history-meta {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-bottom: .5rem;
}
.history-meta time { font-size: .78rem; color: var(--ink-4); }
.history-meta strong { font-size: .85rem; color: var(--ink); }
.history-card h3 { font-size: .9375rem; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.history-story { font-size: .85rem; color: var(--ink-3); margin-bottom: .75rem; }
.history-link { font-size: .85rem; font-weight: 700; color: var(--green); }
.bias-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.bias-tag {
  padding: .15rem .55rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; font-size: .7rem; color: var(--ink-3); font-weight: 500;
}
.bias-tag.more { color: var(--ink-4); }

/* ===== Profile ===== */
.bias-freq-list { display: flex; flex-direction: column; gap: .625rem; }
.freq-row { display: flex; align-items: center; gap: .75rem; }
.freq-label { width: 210px; font-size: .85rem; color: var(--ink-2); }
.freq-bar-wrap { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.freq-bar { height: 100%; background: var(--green); border-radius: 4px; }
.freq-count { width: 2.5rem; text-align: right; font-size: .78rem; font-weight: 700; color: var(--ink-4); }

/* ===== Sparkline ===== */
.sparkline-wrap { display: flex; gap: .875rem; align-items: flex-start; }
.sparkline {
  flex: 1; display: flex; align-items: flex-end; gap: 3px;
  height: 90px; padding: 0 0 2px;
}
.spark-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 0; }
.spark-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.spark-bar {
  width: 100%; background: var(--green); border-radius: 3px 3px 0 0;
  min-height: 3px; opacity: .85;
}
.spark-label { font-size: .62rem; color: var(--ink-4); white-space: nowrap; overflow: hidden; }
.spark-scale {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: .62rem; color: var(--ink-4); height: 90px; padding-bottom: 18px;
  text-align: right; flex-shrink: 0;
}

/* ===== Dashboard table ===== */
.teacher-summary { margin-bottom: 1rem; }
.students-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.students-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.students-table th {
  text-align: left; padding: .5rem .75rem;
  border-bottom: 2px solid var(--line);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4);
}
.students-table td { padding: .625rem .75rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.students-table tr:last-child td { border-bottom: none; }
.students-table tr:hover td { background: var(--bg); }
.students-table-rich td { vertical-align: top; }
.students-table-rich td strong {
  display: block;
  color: var(--ink);
  font-size: .9rem;
}
.students-table-rich td span,
.students-table-rich td small {
  display: block;
  color: var(--ink-3);
  font-size: .78rem;
  margin-top: .15rem;
}
.students-table-rich .compact-tags span {
  display: inline-flex;
  margin-top: 0;
}
.table-action { text-align: right; white-space: nowrap; }
.risk-pill {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-weight: 800;
}
.risk-pill-alert {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}
.metric-date { font-size: 1.25rem; }
.compact-sparkline {
  margin-top: .25rem;
}
.inline-actions {
  justify-content: flex-start;
  margin-top: .75rem;
}
.section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.section-head-row h2 { margin-bottom: .25rem; }
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .875rem;
}
.course-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh);
}
.course-card h3 {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: .35rem;
}
.course-card p {
  color: var(--ink-3);
  font-size: .85rem;
}
.course-code {
  display: inline-flex;
  width: max-content;
  margin-bottom: .45rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--green-lt);
  color: var(--green);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.course-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.course-stats span,
.rubric-list span {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: .18rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: .75rem;
  font-weight: 650;
}
.card-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.inline-form {
  display: flex;
  gap: .65rem;
  align-items: center;
  margin: .75rem 0 1rem;
}
.inline-form input { flex: 1; }
.assignment-form { margin-top: .5rem; }
.rubric-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.compact-rubric { margin-top: .75rem; }
.assignment-context {
  border-left: 4px solid var(--violet);
}
.feedback-panel {
  border-left: 4px solid var(--green);
}
.feedback-item {
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.feedback-item:first-of-type { padding-top: 0; }
.feedback-item:last-of-type { border-bottom: none; }
.feedback-item strong {
  display: block;
  color: var(--ink);
  font-size: .9rem;
}
.feedback-item span {
  color: var(--ink-4);
  font-size: .75rem;
}
.feedback-item p {
  margin-top: .4rem;
  font-size: .9rem;
}
.feedback-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.form-row-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: .65rem;
}
.form-row-actions select { max-width: 240px; }

/* ===== Empty states ===== */
.empty-state { color: var(--ink-4); font-size: .875rem; }
.empty-page {
  text-align: center; padding: 3.5rem 1.5rem;
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--r); margin-top: 1rem;
}
.empty-page-icon { font-size: 2.5rem; margin-bottom: .875rem; opacity: .5; }
.empty-page h3 { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: .375rem; }
.empty-page p { color: var(--ink-3); font-size: .875rem; margin-bottom: 1.25rem; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  h1 { font-size: 1.625rem; }
  .auth-wrap {
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding: 1rem;
  }
  .auth-hero {
    padding: 2rem .25rem 1rem;
  }
  .auth-hero h1 {
    font-size: 2.5rem;
  }
  .auth-card {
    justify-self: stretch;
    width: 100%;
    padding: 1.5rem;
  }
  .voice-field {
    grid-template-columns: 1fr;
  }
  .mic-btn {
    justify-self: start;
    min-width: 90px;
  }
  .two-col, .map-grid, .two-col-list { grid-template-columns: 1fr; }
  .system-overview { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .section-head-row, .inline-form, .form-row-actions { flex-direction: column; align-items: stretch; }
  .form-row-actions select { max-width: none; }
  .metrics-strip { grid-template-columns: 1fr 1fr; }
  .nav { padding: 0 1rem; }
  .nav-links a { padding: 0 .6rem; font-size: .8rem; }
  .score-row > span:first-child { width: 140px; }
  .freq-label { width: 140px; }
  .shell { padding: 1.5rem 1rem 3rem; }
  .form-actions { flex-direction: column; align-items: flex-start; }
}
