:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #5e6b85;
  --line: #d9e1f0;
  --brand: #4667f5;
  --brand-dark: #20346d;
  --soft: #eef3ff;
  --success: #1f8f5f;
  --warn: #a35112;
  --radius: 20px;
  --shadow: 0 12px 30px rgba(24, 38, 79, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}
.hero {
  background: linear-gradient(135deg, #162a59, #243d7a);
  color: white;
  border-radius: 28px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 6px 0 10px; font-size: clamp(2rem, 3.6vw, 3.3rem); line-height: 1.05; }
.subtitle { margin: 0; max-width: 760px; color: rgba(255,255,255,0.92); font-size: 1.14rem; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.92;
}
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill, .toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 10px 14px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toggle input { accent-color: #ffd166; }
.main-wrap { margin-top: 20px; }
.card {
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
}
.intro-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}
.simple-list { margin: 10px 0 0 18px; padding: 0; }
.simple-list.tight li { margin-bottom: 8px; }
.muted { color: var(--muted); }
.contract-box {
  background: var(--soft);
  border: 1px solid #d7e3ff;
  border-radius: 18px;
  padding: 18px;
}
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}
.select-input, .big-text, .text-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #cfd7ea;
  padding: 12px 14px;
  background: white;
}
.big-text { resize: vertical; }
.inline-actions, .session-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.primary, .secondary, .icon-button {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 12px 16px;
  font-weight: 700;
}
.primary { background: var(--brand); color: white; }
.primary:hover { filter: brightness(0.97); }
.secondary { background: white; border-color: #cfd7ea; color: var(--ink); }
.secondary.small, .primary.small { padding: 10px 12px; }
.icon-button { background: #11182d; color: white; width: 52px; }
.fine-print, .small-note { color: var(--muted); font-size: 0.95rem; }
.session-card { max-width: 860px; margin: 0 auto; }
.session-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.session-top h2 { margin: 6px 0 6px; font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
.stage-why { margin: 0; color: var(--muted); max-width: 650px; }
.progress-shell {
  width: 100%; height: 12px; background: #eef1f7; border-radius: 999px; overflow: hidden; margin: 18px 0 14px;
}
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #7e9eff); border-radius: 999px; transition: width 0.25s ease; }
.coach-prompt {
  background: #f8faff;
  border: 1px solid #dae3f7;
  border-radius: 18px;
  padding: 16px;
  font-size: 1.05rem;
  line-height: 1.55;
}
.working-note {
  margin-top: 14px;
  padding: 14px 16px;
  background: #fffdf7;
  border: 1px solid #f3e6b6;
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.5;
}
.stage-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: white;
}
.lesson-box {
  background: #f7faff;
  border: 1px solid #d9e4fb;
  border-radius: 16px;
  padding: 16px;
  line-height: 1.55;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.choice-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice-btn, .option-btn {
  text-align: left;
  border-radius: 14px;
  border: 1px solid #cfd7ea;
  background: white;
  padding: 12px 14px;
  line-height: 1.4;
}
.choice-btn.active, .option-btn:hover { border-color: var(--brand); background: #f4f7ff; }
.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
.text-input { flex: 1; min-height: 52px; }
.response-area { margin-top: 16px; }
.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
  padding: 18px;
  line-height: 1.55;
}
.result-card.warning {
  background: #fff9f2;
  border-color: #f4d0b0;
  color: #7c420d;
}
.result-card.loading { color: var(--muted); }
.option-stack { display: grid; gap: 10px; margin: 14px 0; }
.footer-note {
  max-width: 860px;
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Research console keeps a simpler multi-column layout */
.shell { max-width: 1280px; margin: 0 auto; padding: 24px 18px 40px; }
.topbar { background: linear-gradient(135deg, #162a59, #243d7a); color: white; border-radius: 24px; padding: 24px; display: flex; justify-content: space-between; gap: 16px; }
.layout { display: grid; grid-template-columns: 290px minmax(0,1fr) 280px; gap: 18px; margin-top: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 20px; }
.main-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.theory-box, .logger-note { background: #f7faff; border: 1px solid #d9e4fb; border-radius: 16px; padding: 14px; line-height: 1.5; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.metric span { display: block; color: var(--muted); font-size: 0.9rem; }
.metric strong { font-size: 1.6rem; }
.map-table { width: 100%; border-collapse: collapse; }
.map-table th, .map-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.empty-note { color: var(--muted); padding: 12px; border: 1px dashed #cfd7ea; border-radius: 14px; }
.linklike { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 980px) {
  .intro-card, .layout { grid-template-columns: 1fr; }
  .hero, .session-top, .footer-note, .topbar, .main-head { flex-direction: column; align-items: stretch; }
  .choice-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .page, .shell { padding: 16px 12px 28px; }
  .hero, .card, .panel, .topbar { padding: 18px; border-radius: 18px; }
  .choice-grid, .choice-grid.compact { grid-template-columns: 1fr; }
  .input-row { flex-direction: column; align-items: stretch; }
  .icon-button { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
}
