:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #17233a;
  background: #eef5ff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: linear-gradient(135deg, #eef5ff 0%, #e4eaff 100%) fixed; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #3b82f6; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .48; }

.app-shell { min-height: 100vh; }
.topbar { height: 68px; display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; align-items: center; background: #fff; border-bottom: 1px solid #dce4f1; }
.brand { height: 100%; display: flex; align-items: center; gap: 9px; padding: 0 22px; font: 800 23px/1 Manrope, Arial, sans-serif; letter-spacing: -.04em; border-right: 1px solid #dce4f1; }
.brand-mark { color: #3b82f6; font-size: 20px; transform: rotate(-18deg); }
.topbar-title { padding: 0 25px; font: 700 16px/1.3 Manrope, Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title > span[aria-hidden] { color: #94a3b8; padding: 0 6px; }
.topbar-end { display: flex; align-items: center; gap: 13px; padding: 0 22px; }
.timer { font: 800 14px Manrope, Arial, sans-serif; font-variant-numeric: tabular-nums; color: #1d4ed8; padding: 7px 10px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; }
.timer.warning { color: #a74737; border-color: #e4aea3; background: #fff3f0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #3b82f6; color: white; font-weight: 700; font-size: 12px; }
.game-exit { border: 0; background: transparent; color: #315fb4; font-size: 13px; font-weight: 700; white-space: nowrap; }
.game-exit:hover { text-decoration: underline; }

.body-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { display: flex; flex-direction: column; background: #eaf0ff; border-right: 1px solid #dce4f1; padding: 22px 10px 16px; }
.profile { display: flex; flex-direction: column; gap: 4px; margin: 0 11px 16px; padding-bottom: 17px; border-bottom: 1px solid #dce4f1; }
.profile strong { font: 800 18px Manrope, Arial, sans-serif; }
.profile span { color: #64748b; font-size: 13px; }
.step-list { display: grid; gap: 4px; }
.step { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 8px; color: #475569; font-weight: 600; font-size: 14px; }
.step span { width: 23px; font-size: 11px; letter-spacing: .06em; color: #94a3b8; }
.step.active { background: #3b82f6; color: white; }
.step.active span { color: #fff; }
.sidebar-foot { margin-top: auto; padding: 20px 13px 0; color: #64748b; font-size: 12px; }

.screen { width: 100%; max-width: 1200px; padding: 30px clamp(20px, 4vw, 52px) 52px; outline: none; }
.eyebrow { color: #315fb4; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; font-weight: 800; margin: 0 0 9px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, Arial, sans-serif; letter-spacing: -.035em; }
.screen h1 { font-size: clamp(27px, 3vw, 38px); line-height: 1.16; margin-bottom: 10px; }
.screen h2 { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.25; margin-bottom: 13px; }
.screen h3 { font-size: 17px; line-height: 1.3; margin-bottom: 10px; }
.lead { color: #64748b; font-size: clamp(15px, 1.4vw, 17px); line-height: 1.48; max-width: 720px; }
.muted { color: #64748b; }
.small { font-size: 13px; }
.section-gap { margin-top: 25px; }
.panel { background: #fff; border: 1px solid #dce4f1; border-radius: 12px; box-shadow: 0 2px 12px rgba(24, 39, 76, .05); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.mail { padding: 20px 22px; }
.mail-head { display: flex; align-items: center; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid #e2e8f0; }
.mail-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #eff6ff; color: #3b82f6; font-size: 19px; }
.mail-meta { min-width: 0; }
.mail-meta strong { display: block; font: 800 16px Manrope, Arial, sans-serif; }
.mail-meta span { color: #64748b; overflow-wrap: anywhere; font-size: 14px; }
.sender-details { padding: 11px 0; border-bottom: 1px solid #e2e8f0; color: #475569; font-size: 13px; }
.sender-details summary { width: fit-content; color: #1d4ed8; font-weight: 700; cursor: pointer; }
.sender-details p { margin: 7px 0 0; overflow-wrap: anywhere; }
.mail-subject { padding: 13px 0 11px; border-bottom: 1px solid #e2e8f0; font: 800 17px Manrope, Arial, sans-serif; }
.mail-body { padding-top: 13px; line-height: 1.55; font-size: 15px; }
.mail-body p { margin-bottom: 11px; }
.attachment { display: inline-flex; padding: 7px 10px; border-radius: 7px; background: #eff6ff; color: #475569; font-size: 13px; }
.journal { padding: 16px 18px; }
.journal h3 { margin-bottom: 14px; }
.journal-empty { color: #64748b; font-size: 14px; margin: 0; }
.journal-item { border-top: 1px solid #e2e8f0; padding: 10px 0; font-size: 13px; line-height: 1.4; }
.journal-item:last-child { padding-bottom: 0; }
.journal-item strong { display: block; font-size: 14px; }
.journal-item span { color: #64748b; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-card { width: 100%; text-align: left; padding: 17px; border: 1px solid #dce4f1; border-radius: 10px; background: #fff; color: #17233a; box-shadow: none; transition: background .15s, border-color .15s; }
.choice-card:hover { background: #eff6ff; border-color: #93c5fd; }
.choice-card .icon { display: block; color: #3b82f6; font-size: 22px; margin-bottom: 8px; }
.choice-card strong { display: block; font: 750 16px/1.35 Manrope, Arial, sans-serif; }
.choice-card small { display: block; color: #64748b; font-size: 14px; line-height: 1.4; margin-top: 4px; }
.card-grid:not(.mode-grid) .choice-card { display: grid; grid-template-columns: 27px minmax(0, 1fr); column-gap: 10px; }
.card-grid:not(.mode-grid) .choice-card .icon { grid-row: span 2; margin: 0; }
.action-list { display: grid; gap: 8px; }
.action-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 15px; text-align: left; background: #fff; border: 1px solid #dce4f1; border-radius: 9px; color: #17233a; transition: background .15s, border-color .15s; }
.action-row:hover { background: #eff6ff; border-color: #93c5fd; }
.action-row .icon { width: 26px; flex: none; color: #3b82f6; font-size: 19px; text-align: center; }
.action-row .action-copy { flex: 1; }
.action-row strong { display: block; font: 750 16px Manrope, Arial, sans-serif; }
.action-row small { display: block; margin-top: 3px; color: #64748b; line-height: 1.4; font-size: 14px; }
.action-row .arrow { color: #3b82f6; font-size: 20px; }
.seen { margin-left: 7px; color: #315fb4; font-size: 12px; font-weight: 700; }
.result-card { padding: 21px; }
.result-card .result-label { color: #64748b; text-transform: uppercase; font-size: 12px; letter-spacing: .1em; font-weight: 800; }
.result-card p { font-size: 16px; line-height: 1.55; margin: 10px 0 0; }
.insight { margin-top: 14px; padding: 13px 15px; border-radius: 9px; background: #eff6ff; line-height: 1.5; color: #1e3a8a; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid #3b82f6; border-radius: 8px; background: #3b82f6; color: white; font-weight: 750; text-decoration: none; }
.button:hover { background: #2563eb; }
.button.secondary { background: white; color: #1d4ed8; border-color: #bfdbfe; }
.button.secondary:hover { background: #eff6ff; }
.button.link { border: 0; background: transparent; color: #1d4ed8; text-decoration: underline; padding-left: 0; }
.button.link:hover { color: #1e40af; }
.option-list { display: grid; gap: 8px; }
.option { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; border: 1px solid #dce4f1; border-radius: 8px; background: #fff; color: #17233a; line-height: 1.4; font-size: 15px; }
.option:hover { background: #eff6ff; border-color: #93c5fd; }
.option.selected { border-color: #3b82f6; background: #dbeafe; box-shadow: inset 0 0 0 1px #3b82f6; }
.option strong { font-weight: 750; }
.option-detail { display: block; margin-top: 3px; color: #64748b; font-size: 14px; }
.radio { display: grid; place-items: center; width: 19px; height: 19px; flex: none; border: 2px solid #94a3b8; border-radius: 50%; margin-top: 1px; }
.option.selected .radio { border-color: #3b82f6; }
.option.selected .radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3b82f6; }
.decision-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.decision-panel { padding: 17px; }
.decision-panel h2 { font-size: 20px; margin-bottom: 10px; }
.decision-panel > p { margin-bottom: 10px; }
.decision-lead { margin-bottom: 18px; }
.reminder { padding: 11px 14px; background: #fff8ed; border-left: 3px solid #bc8a4d; border-radius: 5px; color: #6a563b; font-size: 14px; margin-bottom: 16px; }
.outcome { padding: 23px; }
.outcome-badge { display: inline-flex; align-items: center; justify-content: center; height: 46px; width: 46px; border-radius: 50%; color: white; background: #3b82f6; font-size: 23px; margin-bottom: 11px; }
.outcome-badge.caution { background: #b28553; }
.outcome-badge.error { background: #ae6456; }
.outcome p { line-height: 1.65; }
.lesson-list { display: grid; gap: 9px; margin-top: 17px; }
.lesson { display: grid; grid-template-columns: minmax(135px, .35fr) 1fr; gap: 16px; padding-top: 12px; border-top: 1px solid #e2e8f0; line-height: 1.5; }
.lesson strong { font-family: Manrope, Arial, sans-serif; }
.welcome { max-width: 780px; }
.mode-home { max-width: 1050px; }
.mode-grid { margin-top: 20px; }
.mode-grid .choice-card { min-height: 135px; }
.mode-count { display: inline-block; margin-bottom: 10px; color: #315fb4; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.random-card { background: #eff6ff; border-color: #bfdbfe; }
.welcome-panel { padding: 20px 23px; margin: 18px 0; }
.welcome-panel ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.meta-line { display: flex; gap: 14px; flex-wrap: wrap; color: #64748b; font-size: 14px; margin: 14px 0 20px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.summary-card { display: flex; flex-direction: column; gap: 6px; padding: 17px; }
.summary-card strong { font: 800 27px/1.15 Manrope, Arial, sans-serif; color: #1d4ed8; }
.summary-card span { color: #64748b; font-size: 14px; line-height: 1.4; }
.summary-list { display: grid; gap: 8px; }
.summary-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.summary-number { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.summary-item div { display: grid; gap: 4px; flex: 1; }
.summary-item div strong { font: 800 16px Manrope, Arial, sans-serif; }
.summary-item div span { color: #64748b; font-size: 13px; }
.summary-time { color: #64748b; font-variant-numeric: tabular-nums; font-weight: 700; }

@media (max-width: 1000px) {
  .topbar { grid-template-columns: 185px minmax(0,1fr) auto; }
  .brand { padding: 0 18px; }
  .body-layout { grid-template-columns: 185px minmax(0,1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .journal { order: 2; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar { height: 58px; grid-template-columns: auto minmax(0,1fr) auto; }
  .brand { font-size: 19px; border-right: 0; padding: 0 11px; }
  .brand-mark { display: none; }
  .topbar-title { font-size: 12px; padding: 0 6px; }
  .topbar-end { gap: 6px; padding: 0 9px 0 0; }
  .timer { font-size: 12px; padding: 6px; }
  .avatar { display: none; }
  .game-exit { font-size: 11px; max-width: 70px; white-space: normal; line-height: 1.1; }
  .body-layout { display: block; }
  .sidebar { padding: 7px 13px; border-right: 0; border-bottom: 1px solid #dce4f1; }
  .profile, .sidebar-foot { display: none; }
  .step-list { display: flex; gap: 4px; }
  .step { gap: 5px; padding: 7px 8px; font-size: 11px; }
  .step span { width: auto; font-size: 10px; }
  .screen { padding: 19px 14px 96px; }
  .screen h1 { font-size: 27px; }
  .screen .decision-title { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr; }
  .mode-grid .choice-card { min-height: 0; }
  .mail { padding: 16px; }
  .mail-body { font-size: 15px; }
  .journal:has(.journal-empty) { display: none; }
  .decision-grid { gap: 16px; }
  .decision-panel { padding: 0; border: 0; box-shadow: none; background: transparent; }
  .decision-panel h2 { margin-bottom: 8px; }
  .decision-actions { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #dce4f1; background: rgba(248, 250, 255, .97); box-shadow: 0 -4px 16px rgba(24, 39, 76, .08); flex-wrap: nowrap; }
  .decision-actions .button { flex: 1; padding: 9px; font-size: 14px; }
  .decision-actions .button.secondary { flex: 0 0 38%; }
  .lesson { grid-template-columns: 1fr; gap: 4px; }
  .summary-grid { gap: 9px; }
  .summary-card { padding: 14px; }
  .summary-card strong { font-size: 24px; }
}
