:root {
  color-scheme: dark;
  --bg: #0e1113;
  --sidebar: #111517;
  --panel: #171c1e;
  --panel-raised: #1c2224;
  --line: #282f32;
  --ink: #edf1ed;
  --muted: #a0aaa6;
  --dim: #86928e;
  --mint: #b9f888;
  --mint-deep: #172716;
  --danger: #ff9c9b;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 290px; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
a { color: var(--mint); text-underline-offset: .23em; }
a svg, button svg, .tag svg { vertical-align: middle; flex-shrink: 0; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3 { line-height: 1.15; }
p { margin-bottom: 1em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow:hidden; clip-path: inset(50%); }
.skip { position: fixed; z-index: 7; left: 12px; top: 12px; transform: translateY(-200%); background: #15251b; padding: 8px 12px; }
.skip:focus { transform:none; }
.subtle { color: var(--muted); font-size: .89rem; }
.loading { display:grid; min-height:100svh; place-items:center; color: var(--muted); }
.sidebar { width: 220px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 29px 17px 19px; border-right: 1px solid var(--line); background: var(--sidebar); overflow:auto; z-index: 3; }
.brand { display: flex; align-items: center; gap: 11px; color: #f5f7f2; font-size: 20px; letter-spacing: -.04em; font-weight: 770; line-height: 1.05; }
.brand > div > span { display: block; letter-spacing: .14em; color: var(--dim); margin-top: 4px; font-size: 10px; font-weight: 650; }
.brand-mark { display:grid; place-items:center; width:40px; height:40px; border-radius:11px; color:#162616; background:var(--mint); }
.sidebar .brand { margin: 0 6px 47px; }
.sidebar-nav-label { font-size: 10px; color: var(--dim); letter-spacing: .13em; font-weight: 700; margin: 0 9px 9px; }
.sidebar nav { display:grid; gap: 4px; }
.nav-item { display:flex; align-items:center; gap:11px; background:transparent; color: var(--muted); text-align:left; border:1px solid transparent; padding:10px 11px; border-radius:8px; font-size: .92rem; min-height:43px; width: 100%; }
.nav-item.on { background:#1d2c21; color:var(--mint); border-color:#2d4630; font-weight: 650; }
.nav-item:not(.on):hover { background:#1e2426; color:var(--ink); }
.sidebar-end { margin-top:auto; padding-top:30px; display:grid; gap:14px; }
.sidebar-source { border:1px solid var(--line); padding:13px; border-radius:9px; display:grid; gap:4px; }
.sidebar-source strong { font-size:.83rem; }
.sidebar-source a { color:var(--muted); font-size:.78rem; text-decoration:none; }
.sidebar-source a:hover { color:var(--mint); }
.workspace { padding-left: 220px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:67px; padding:0 30px; border-bottom:1px solid #232a2c; background:#111517; }
.crumb { display:flex; align-items:center; gap:9px; color:var(--dim); font-size:.86rem; }
.crumb strong { font-weight:620; color:#d6ded8; }
.top-profile { display:flex; gap:13px; align-items:center; }
.xp { display:inline-flex; gap:6px; align-items:center; border:1px solid #304233; background:#1a261b; color:var(--mint); border-radius:8px; padding:6px 10px; font-variant-numeric:tabular-nums; font-size:.81rem; font-weight:700; }
.avatar { display:grid; place-items:center; background:#262e30; color:#c8d5cc; border:1px solid #394245; width:35px; height:35px; border-radius:50%; }
.button.mobile-exit { display:none; }
.main { max-width: 1390px; padding: 27px 31px 40px; margin:0 auto; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:10px 15px; min-height:40px; border:1px solid transparent; border-radius:8px; white-space:nowrap; font-weight:650; transition:background .13s,color .13s,border-color .13s; }
.primary { color:#182515; background:var(--mint); border-color:var(--mint); }
.primary:hover:not(:disabled) { background:#d0ffaa; border-color:#d0ffaa; }
.secondary { border-color:#333d40; background:#202729; color:#e1e8e1; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { color:var(--mint); border-color:#465b4a; background:#222e25; }
.quiet { color:var(--muted); background:transparent; }
.hero { min-height: 288px; isolation:isolate; position:relative; display:flex; align-items:center; overflow:hidden; border:1px solid #344840; border-radius:15px; background:#172a25; }
.hero::before, .login-poster::before { content:""; position:absolute; z-index:-1; inset:0; background-image: linear-gradient(90deg,#10201bcf 4%,#14211a97 40%,#0d181431 75%), url("/city.webp"); background-size:cover; background-position:center, right 47%; }
.hero::after { content:""; inset:0; position:absolute; z-index:-1; background:linear-gradient(90deg,#111d15d8 0%,transparent 66%); pointer-events:none; }
.hero-content { padding: 32px clamp(22px,4.1vw,57px); }
.eyebrow { display:inline-flex; align-items:center; gap:9px; color:#c8d5cc; font-size:.71rem; letter-spacing:.13em; font-weight:730; }
.eyebrow i, .dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--mint); box-shadow:0 0 10px #b7f28865; }
.hero h1 { font-size:clamp(2.7rem,5vw,4.55rem); line-height:.96; letter-spacing:-.066em; margin:12px 0 13px; }
.hero p { color:#d4e0d5; margin:0 0 21px; font-size:.98rem; }
.metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; margin-top:16px; }
.metric { display:flex; align-items:center; gap:13px; border:1px solid var(--line); background:var(--panel); border-radius:11px; padding:13px 15px; min-height:74px; }
.metric-icon { color:#bee0bb; border:1px solid #38453e; background:#232d28; width:37px; height:37px; display:grid; place-items:center; border-radius:9px; flex:none; }
.metric strong { display:block; font-size:1.4rem; line-height:1.13; font-variant-numeric:tabular-nums; letter-spacing:-.035em; }
.metric div span { display:block; color:var(--muted); font-size:.79rem; }
.section { margin-top:23px; }
.section-head { display:flex; align-items:baseline; justify-content:space-between; gap:14px; margin-bottom:11px; }
.section-head h2, .panel-head h2 { font-size:1.2rem; letter-spacing:-.018em; margin:0; }
.course-grid { display:grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap:11px; }
.course-card { background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:11px; text-align:left; padding:14px 13px 11px; min-height:153px; display:flex; flex-direction:column; transition:background .15s,border-color .15s,transform .15s; overflow-wrap:anywhere; }
.course-card:hover { background:#1d2426; border-color:#465b4d; transform:translateY(-2px); }
.course-card-top { width:100%; display:flex; align-items:center; justify-content:space-between; gap:6px; color:#89938e; margin-bottom:11px; }
.course-card strong { font-size:1rem; line-height:1.19; font-weight:690; }
.course-card > span { display:block; margin:5px 0 10px; flex:1; color:var(--muted); font-size:.75rem; line-height:1.4; }
.course-card-footer { display:flex; align-items:center; gap:6px; width:100%; border-top:1px solid #2b3335; padding-top:8px; color:#a6b3ad; font-size:.71rem; }
.dot { background:#788580; box-shadow:none; width:5px; height:5px; flex:none; }
.dot.done { background:var(--mint); }
.course-icon { display:inline-grid; place-items:center; width:38px; height:38px; flex:none; border-radius:10px; background:#252d2a; color:#cbdfc8; }
.course-icon.violet { color:#d7c2ff; background:#322840; }
.course-icon.red { color:#ffb1a5; background:#402d2a; }
.course-icon.green { color:#c1f09f; background:#2b3d2a; }
.course-icon.amber { color:#f1cd91; background:#3c3326; }
.course-icon.blue { color:#a9d6ec; background:#263942; }
.home-bottom { display:grid; grid-template-columns: 1.08fr 1fr; gap:13px; }
.panel { border:1px solid var(--line); background:var(--panel); border-radius:11px; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:9px; padding:15px 16px 11px; }
.panel-head > svg { color:var(--dim); }
.panel-head h3 { margin:0; font-size:1.02rem; }
.panel-copy { margin:0; padding:0 16px 18px; }
.tag { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; color:#c3ceca; border:1px solid #3a4445; background:#232a2c; padding:3px 8px; line-height:1.45; font-size:.74rem; border-radius:6px; font-weight:620; }
.good-tag { background:#213220; color:#caf7b5; border-color:#3e5941; }
.week-list { margin:0; padding:0 16px 10px; }
.week-list div, .weak-list > div { display:flex; align-items:center; justify-content:space-between; border-top:1px solid #293133; padding:8px 0; gap:12px; }
.week-list div { font-size:.84rem; }
.week-list dt { color:#d0d9d3; }
.week-list dd { margin:0; white-space:nowrap; color:var(--muted); }
.weak-list { padding:0 16px 10px; }
.weak-list > div > span:nth-child(2) { flex:1; font-size:.85rem; }
.weak-list small, .history-row small, .exam-row small { display:block; color:var(--muted); line-height:1.35; }
.weak-list b { font-variant-numeric:tabular-nums; color:var(--dim); }
.weak-list .button { padding:5px 9px; min-height:32px; }
.page-label { margin:8px 0 25px; }
.page-label h1, .work-title h1 { margin:0 0 7px; font-size:clamp(1.85rem,3.4vw,2.8rem); letter-spacing:-.055em; }
.page-label p, .work-title p { color:var(--muted); margin:0; }
.course-heading { display:flex; gap:14px; align-items:flex-start; }
.course-heading > .course-icon { width:55px; height:55px; margin-top:6px; }
.back-link { padding-left:0; margin:-5px 0 8px; }
.section-head.spaced { margin-top:23px; }
.action-strip { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px; }
.action-strip strong, .action-strip span { display:block; }
.action-strip span { color:var(--muted); font-size:.85rem; }
.section-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.topic-card, .badge-card { min-height:175px; padding:17px; display:flex; flex-direction:column; align-items:flex-start; }
.topic-symbol,.badge-art { display:grid; place-items:center; color:#b8cbb9; width:40px; height:40px; border-radius:9px; border:1px solid #394741; background:#252f2b; }
.topic-card h3 { margin:12px 0 7px; font-size:1.09rem; }
.topic-card p, .badge-card p { color:var(--muted); font-size:.86rem; margin:0 0 14px; }
.topic-card .topic-lesson { white-space:pre-wrap; flex:1; }
.badge-card strong { margin:9px 0 5px; }
.badge-card .tag { margin-top:auto; }
.badge-card.earned { border-color:#476344; background:#1d281e; }
.badge-card.earned .badge-art { color:var(--mint); }
.exam-list { display:grid; gap:10px; }
.exam-row { display:flex; align-items:center; gap:13px; padding:14px; }
.exam-row > div { flex:1; }
.small-links { margin-top:16px; font-size:.83rem; }
.history-list { display:grid; }
.history-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto 34px; align-items:center; gap:12px; padding:10px 15px; border-top:1px solid #293133; }
.history-row:first-child { border-top:none; }
.history-row .quiet { min-height:34px; padding:4px; }
.history-mark { font-size:.88rem; color:#e2eae5; font-variant-numeric:tabular-nums; font-weight:620; }
.empty { display:grid; justify-items:center; text-align:center; color:var(--muted); padding:28px 18px; gap:6px; }
.empty svg { color:#809782; }
.empty strong { color:var(--ink); }
.empty p { margin:0; font-size:.85rem; }
.graph { padding:1px 15px; }
.graph-group { display:grid; grid-template-columns:38px minmax(110px,1fr) 3fr; gap:13px; align-items:center; padding:13px 0; border-bottom:1px solid var(--line); }
.graph-group:last-child { border-bottom:0; }
.bar-row { display:grid; grid-template-columns:64px 1fr 55px; align-items:center; gap:8px; color:var(--muted); font-size:.79rem; }
.bar-row b { text-align:right; color:var(--ink); font-variant-numeric:tabular-nums; }
progress { accent-color:var(--mint); width:100%; height:8px; border-radius:5px; }
progress::-webkit-progress-bar { background:#303936; border-radius:5px; }
progress::-webkit-progress-value { background:#a7e87c; border-radius:5px; }
.settings-form { max-width:560px; padding:18px; display:grid; gap:11px; }
.settings-form label, .field-label { font-size:.86rem; font-weight:680; color:#d9e1db; }
.settings-form p { margin:0 0 5px; }
.settings-form .button { justify-self:start; }
input[type="text"], input[type="password"], input[type="number"], textarea, select { width:100%; padding:10px 12px; color:var(--ink); background:#111718; border:1px solid #3a4545; border-radius:8px; }
textarea { resize:vertical; min-height:120px; }
::placeholder { color:#899792; }
.feedback, .feedback-static { color:#ffd0ce; background:#3a2221; border:1px solid #764442; padding:10px 13px; border-radius:8px; margin:0 0 13px; font-size:.88rem; }
.feedback.confirmed { color:#d1f7c4; background:#263824; border-color:#456342; }
.work-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:18px; }
.work-title { display:flex; align-items:center; gap:11px; }
.work-title h1 { font-size:clamp(1.55rem,3vw,2.4rem); margin:0 0 3px; }
.work-title p { font-size:.88rem; }
.clock { display:flex; align-items:center; gap:7px; background:#201f19; color:#f4d692; border:1px solid #534a32; border-radius:8px; padding:9px 10px; font-size:1.07rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.clock.urgent { background:#3c2321; border-color:#70433a; color:#ffb7a4; }
.work-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(185px,225px); gap:13px; align-items:start; }
.question-card { padding:clamp(14px, 2.5vw, 24px); min-width:0; scroll-margin-top:58px; }
.question-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.problem-text, .answer-display { white-space:pre-wrap; overflow-wrap:anywhere; }
.question-text { margin:18px 0; font-size:1.04rem; line-height:1.62; }
.source-text, .solution { background:#20282a; border:1px solid #344141; border-radius:8px; padding:10px 13px; color:#d3ddd6; font-size:.9rem; }
.source-text { margin-top:14px; }
.source-text p, .solution p { margin:.7em 0 .35em; }
.source-text summary, .solution summary { cursor:pointer; color:#dce7dd; font-weight:660; }
.solution { margin:10px 0; }
.answer-caption { display:block; font-weight:670; font-size:.84rem; margin:0 0 7px; }
.answer-tools { display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; margin:7px 0; }
.answer-tools .button { padding:5px 8px; min-height:32px; }
.word-count { margin:6px 0 0; }
.save-state { margin-left:auto; color:var(--dim); font-size:.75rem; }
.upload { position:relative; overflow:hidden; cursor:pointer; }
.upload input { width:1px; height:1px; opacity:0; position:absolute; }
.upload:focus-within { outline:2px solid var(--mint); outline-offset:2px; }
.photo-box { display:flex; gap:9px; align-items:center; margin:8px 0; }
.photo-box img { display:block; border-radius:7px; border:1px solid #485551; max-width:160px; object-fit:contain; }
.photo-dialog { border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:12px; }
.photo-dialog img { display:block; max-height:72vh; max-width:78vw; }
.photo-dialog button { margin-bottom:6px; }
.question-actions { display:flex; justify-content:space-between; gap:10px; margin-top:18px; }
.work-nav { position:sticky; top:12px; padding:0 12px 13px; }
.work-nav .panel-head { padding:13px 0 10px; }
.work-nav .panel-head h2 { font-size:1rem; }
.question-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin-bottom:13px; }
.question-num { min-height:33px; color:#d4dfd9; background:#202729; border:1px solid #384141; border-radius:6px; padding:0; font-size:.82rem; }
.question-num.answered { background:#263328; border-color:#3c4b41; }
.question-num.success { color:var(--mint); }
.question-num.current { border-color:#c2f39f; color:#d0f7b8; box-shadow:inset 0 0 0 1px #a9d790; }
.work-nav > .button { width:100%; }
.work-nav > p { margin:0; }
.result-summary { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px; margin-bottom:13px; }
.result-summary > div { display:grid; gap:4px; }
.result-summary strong { font-size:1.65rem; line-height:1.1; }
.result-summary div > span:last-child { color:var(--muted); font-size:.8rem; }
.result-head { display:flex; gap:7px; margin:14px 0; }
.answer-display { padding:9px 12px; background:#121818; border:1px solid #334040; border-radius:7px; margin-bottom:9px; }
.review-result { margin:14px 0; }
.review-result .panel-head { padding:0 0 9px; }
.mark-list > div { border-top:1px solid #343e3d; padding:8px 0; }
.mark-list div > strong { display:flex; justify-content:space-between; gap:8px; font-size:.86rem; }
.mark-list b { white-space:nowrap; }
.mark-list p { color:var(--muted); margin:4px 0 0; font-size:.85rem; }
.mark-list .comparison { color:#d5ebbe; }
.modal { max-width:min(450px, calc(100vw - 30px)); padding:20px; color:var(--ink); }
.modal h2 { margin:0 0 10px; font-size:1.45rem; }
.modal p { color:var(--muted); }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; }
dialog::backdrop { background:#07090bcc; }
.login-layout { min-height:100svh; display:grid; grid-template-columns:1.1fr 1fr; }
.login-poster { position:relative; isolation:isolate; overflow:hidden; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; background:#182720; border-right:1px solid #314239; }
.login-poster::before { background-image:linear-gradient(0deg,#101915f2,#0b171444 55%,#07111040), url("/city.webp"); background-position:center, 61% 53%; }
.login-brand { margin:37px; }
.poster-copy { padding:35px 37px 42px; }
.poster-copy h1 { font-size:clamp(4rem,9vw,8rem); margin:9px 0; letter-spacing:-.08em; line-height:.92; }
.poster-copy p { font-size:1.02rem; color:#d3e1d4; margin:16px 0 0; }
.login-pane { display:grid; place-content:center; padding:28px; }
.login-form { width:min(370px, 80vw); display:grid; gap:12px; }
.login-form h2 { font-size:1.9rem; letter-spacing:-.045em; margin:0; }
.login-form p { margin:0 0 8px; }
.role-selector { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:8px; }
.role-selector label { display:flex; align-items:center; justify-content:center; gap:6px; padding:9px 5px; position:relative; border-radius:8px; border:1px solid #3c4748; color:#c5d2cb; cursor:pointer; }
.role-selector label:has(:checked) { background:#233122; color:var(--mint); border-color:#526c50; }
.role-selector label:focus-within { outline:2px solid var(--mint); outline-offset:2px; }
.role-selector input { width:1px; height:1px; opacity:0; position:absolute; }
.login-button { margin-top:5px; justify-content:space-between; }
.login-mobile-brand { display:none; }
@media (max-width: 1180px) {
  .course-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { width:177px; padding-left:11px; padding-right:11px; }
  .workspace { padding-left:177px; }
  .topbar,.main { padding-left:19px; padding-right:19px; }
  .work-grid { grid-template-columns:minmax(0,1fr) minmax(155px,180px); }
  .section-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position:sticky; top:0; width:auto; padding:6px 9px; border-right:none; border-bottom:1px solid var(--line); overflow:auto; }
  .sidebar .brand,.sidebar-nav-label,.sidebar-end { display:none; }
  .sidebar nav { display:flex; gap:5px; }
  .nav-item { width:auto; padding:7px; gap:4px; min-height:36px; white-space:nowrap; font-size:.75rem; }
  .nav-item svg { width:14px; height:14px; }
  .workspace { padding-left:0; }
  .topbar { min-height:50px; }
  .button.mobile-exit { display:inline-flex; min-height:30px; padding:4px; }
  .top-profile { gap:6px; }
  .avatar { width:29px; height:29px; }
  .main { padding-top:15px; }
  .hero { min-height:230px; }
  .metric { padding:8px; gap:6px; }
  .metric-icon { width:27px; height:27px; }
  .metric-icon svg { width:14px; }
  .metric strong { font-size:1.17rem; }
  .metric div span { font-size:.68rem; line-height:1.18; margin-top:3px; }
  .work-grid { grid-template-columns:minmax(0,1fr); }
  .work-nav { position:static; grid-row:1; }
  .work-nav > .button { display:none; }
  .question-nav { display:flex; flex-wrap:wrap; margin-bottom:0; }
  .question-num { min-width:30px; padding:0 5px; min-height:29px; }
  .work-nav > p { display:none; }
}
@media (max-width: 500px) {
  .main,.topbar { padding-left:12px; padding-right:12px; }
  .metrics,.course-grid,.section-grid,.home-bottom { gap:8px; }
  .metric-icon { display:none; }
  .course-grid,.section-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-bottom { grid-template-columns:1fr; }
  .course-card { min-height:135px; }
  .hero::before { background-position:center, 59% 48%; }
  .hero-content { padding:23px 18px; }
  .exam-row { flex-wrap:wrap; gap:8px; }
  .exam-row .button { width:100%; }
  .history-row { grid-template-columns:32px minmax(0,1fr) auto 28px; padding:9px 7px; gap:5px; }
  .history-row .course-icon { width:31px; height:31px; }
  .history-row strong { font-size:.82rem; }
  .history-row small { font-size:.67rem; }
  .history-mark { font-size:.75rem; }
  .history-mark .subtle { display:block; font-size:.65rem; }
  .graph-group { grid-template-columns:36px 1fr; }
  .graph-group > div { grid-column:1 / -1; }
  .result-summary { align-items:flex-start; flex-direction:column; }
  .login-layout { grid-template-columns:1fr; grid-template-rows:minmax(190px, 31svh) auto; }
  .login-poster { border-right:none; border-bottom:1px solid #314239; }
  .login-brand { margin:14px; }
  .poster-copy { padding:9px 14px 15px; }
  .poster-copy h1 { font-size:3.2rem; }
  .poster-copy p { font-size:.8rem; margin:3px 0 0; }
  .login-pane { place-content:start center; padding:24px 15px; }
  .login-form { width:min(370px,calc(100vw - 30px)); }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { transition:none !important; scroll-behavior:auto !important; } }
