:root {
  color-scheme: dark;
  --bg: #07131f;
  --bg-deep: #050d16;
  --surface: #0c1d2b;
  --surface-2: #10283a;
  --line: rgba(192, 222, 238, 0.14);
  --line-strong: rgba(192, 222, 238, 0.24);
  --text: #f2f7f8;
  --muted: #9db1be;
  --teal: #3fd4c1;
  --teal-dark: #183d3e;
  --orange: #ffb45b;
  --blue: #65a9ff;
  --violet: #bd8cff;
  --green: #75d684;
  --red: #ff7c78;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -20%, rgba(63, 212, 193, 0.10), transparent 36rem),
    var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 "DM Sans", system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 38px 26px 28px;
  display: flex; flex-direction: column; border-right: 1px solid var(--line);
  background: rgba(5, 13, 22, 0.68); backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 13px; align-items: center; color: var(--text); text-decoration: none; font: 800 .89rem/1.05 "Manrope", sans-serif; letter-spacing: .11em; }
.brand-mark { position: relative; width: 34px; height: 34px; border: 2px solid var(--teal); border-radius: 10px; flex: 0 0 auto; }
.brand-mark i, .brand-mark b { position: absolute; display: block; background: var(--teal); border-radius: 5px; }
.brand-mark i { width: 17px; height: 4px; top: 13px; left: 7px; }
.brand-mark b { height: 17px; width: 4px; left: 13px; top: 7px; }
.nav-list { margin-top: 70px; display: grid; gap: 8px; }
.nav-item {
  width: 100%; display: flex; gap: 13px; align-items: center; padding: 12px 14px;
  border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; text-align: left;
}
.nav-item span { font-size: .72rem; letter-spacing: .08em; color: #68808e; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--text); border-color: var(--line); background: rgba(63, 212, 193, .08); }
.nav-item.active span { color: var(--teal); }
.sidebar-foot { margin-top: auto; width: 100%; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; }
.sidebar-foot .sidebar-foot-label, .sidebar-foot small { display: block; margin: 0; color: var(--muted); }
.sidebar-foot .sidebar-foot-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-foot strong { display: block; margin-top: 5px; font: 800 1.35rem "Manrope"; color: var(--teal); }
.assignment-switcher { transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.assignment-switcher:hover { transform: translateY(-1px); border-color: rgba(63,212,193,.38); background: rgba(63,212,193,.055); }

main { padding: 0 5vw 70px; min-width: 0; }
.environment-banner {
  min-height: 54px; margin: 0 -5vw; padding: 10px 5vw; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid rgba(255,180,91,.36); background: linear-gradient(90deg, rgba(97,49,16,.92), rgba(77,35,24,.82)); color: #ffe5bf;
}
.environment-banner > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px 16px; }
.environment-banner strong { font: 800 .73rem "Manrope"; letter-spacing: .11em; color: var(--orange); }
.environment-banner span { font-size: .78rem; }
.environment-actions { display: flex; gap: 9px; align-items: center; }
.environment-actions a, .environment-actions button { min-height: 32px; padding: 0 11px; border: 1px solid rgba(255,214,159,.34); border-radius: 8px; background: rgba(0,0,0,.14); color: #fff0d8; font-size: .72rem; text-decoration: none; }
.environment-actions a { display: inline-flex; align-items: center; }
.topbar { min-height: 132px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: #78909d; font: 700 .72rem/1.2 "Manrope"; letter-spacing: .12em; }
.eyebrow.accent { color: var(--teal); }
.eyebrow.orange { color: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 800 clamp(1.8rem, 3vw, 2.6rem)/1.1 "Manrope"; }
h2 { margin-bottom: 10px; font: 800 clamp(1.7rem, 3vw, 2.55rem)/1.13 "Manrope"; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font: 700 1.22rem/1.25 "Manrope"; }
.top-stats { display: flex; align-items: center; gap: 30px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.connection-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,180,91,.08); }
.connection-status.connected::before { background: var(--teal); box-shadow: 0 0 0 4px rgba(63,212,193,.08); }
.top-stats > div:not(.xp-pill) { display: grid; gap: 1px; }
.top-stats span { color: var(--muted); font-size: .76rem; }
.top-stats strong { font-size: .92rem; }
.xp-pill { padding: 10px 14px; border: 1px solid rgba(63, 212, 193, .35); border-radius: 12px; background: rgba(63, 212, 193, .1); color: var(--teal); font-weight: 700; }
.xp-pill span { color: var(--teal); font-size: 1rem; }
.mobile-assignment-switcher { display: none; }

.view { display: none; padding-top: 46px; animation: fade .24s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }
.welcome-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.welcome-row h2 { max-width: 720px; margin-bottom: 0; }
.day-progress { display: flex; align-items: center; gap: 10px; }
.day-progress p { margin: 0; color: var(--muted); font-size: .82rem; }
.ring { --p: 0deg; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) var(--p), rgba(255,255,255,.08) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 5px; background: var(--bg); border-radius: inherit; }
.ring span { position: relative; font-weight: 700; font-size: .73rem; }

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 12px; margin-bottom: 22px; }
.daily-fact { min-height: 310px; display: grid; grid-template-rows: auto 1fr auto auto; gap: 15px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(12,29,43,.64); }
.fact-teal { border-color: rgba(63,212,193,.2); background: linear-gradient(145deg, rgba(20,61,62,.48), rgba(12,29,43,.7)); }
.fact-blue { border-color: rgba(101,169,255,.23); background: linear-gradient(145deg, rgba(25,51,82,.56), rgba(12,29,43,.72)); }
.fact-orange { border-color: rgba(255,180,91,.22); background: linear-gradient(145deg, rgba(66,43,24,.48), rgba(12,29,43,.7)); }
.fact-violet { border-color: rgba(189,140,255,.22); background: linear-gradient(145deg, rgba(54,37,74,.46), rgba(12,29,43,.72)); }
.fact-card-head { display: flex; gap: 12px; align-items: center; }
.fact-card-head > div { min-width: 0; }
.fact-card-head .eyebrow { margin-bottom: 2px; color: var(--teal); }
.fact-blue .fact-card-head .eyebrow { color: var(--blue); }
.fact-orange .fact-card-head .eyebrow { color: var(--orange); }
.fact-violet .fact-card-head .eyebrow { color: var(--violet); }
.fact-card-head small { display: block; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.fact-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(63,212,193,.32); border-radius: 12px; color: var(--teal); background: rgba(63,212,193,.07); font-size: 1.2rem; }
.fact-blue .fact-icon { color: var(--blue); border-color: rgba(101,169,255,.32); background: rgba(101,169,255,.07); }
.fact-orange .fact-icon { color: var(--orange); border-color: rgba(255,180,91,.3); background: rgba(255,180,91,.06); }
.fact-violet .fact-icon { color: var(--violet); border-color: rgba(189,140,255,.3); background: rgba(189,140,255,.06); }
.fact-card-body h3 { margin-bottom: 8px; font-size: 1rem; }
.daily-fact p:not(.eyebrow) { margin: 0; color: #d4e0e4; font-size: .87rem; line-height: 1.48; }
.fact-details { display: flex; flex-wrap: wrap; gap: 5px; }
.fact-details span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .62rem; }
.fact-card-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: #758b97; font-size: .61rem; }
.fact-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.daily-fact a { color: var(--muted); text-underline-offset: 3px; }
.fact-loading { min-height: 104px; grid-column: 1 / -1; display: grid; place-items: center; }

.mission-card { position: relative; min-height: 245px; display: grid; grid-template-columns: 56px minmax(0, 1fr) 220px; overflow: hidden; border: 1px solid rgba(63, 212, 193, .25); border-radius: 22px; background: linear-gradient(120deg, rgba(22, 66, 69, .9), rgba(11, 31, 45, .95) 62%); box-shadow: var(--shadow); }
.mission-card::after { content: ""; position: absolute; width: 300px; height: 300px; right: -120px; top: -130px; border: 1px solid rgba(63, 212, 193, .16); border-radius: 50%; box-shadow: 0 0 0 45px rgba(63,212,193,.025), 0 0 0 90px rgba(63,212,193,.018); }
.mission-rail { padding-top: 31px; border-right: 1px solid rgba(255,255,255,.08); text-align: center; }
.mission-rail span { writing-mode: vertical-rl; color: var(--teal); font: 700 .7rem "Manrope"; letter-spacing: .2em; }
.mission-main { align-self: center; padding: 34px 5vw 34px 34px; position: relative; z-index: 1; }
.mission-main h3 { max-width: 650px; font-size: clamp(1.55rem, 2.5vw, 2.25rem); letter-spacing: -.025em; }
.mission-main > p { max-width: 650px; color: #bdd0d8; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: #c4d1d7; font-size: .73rem; font-weight: 600; }
.chip.teal { color: var(--teal); border-color: rgba(63,212,193,.3); background: rgba(63,212,193,.08); }
.orange-chip { color: var(--orange); border-color: rgba(255,180,91,.35); background: rgba(255,180,91,.08); }
.mission-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; color: #99b1bb; font-size: .8rem; }
.mission-meta span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 9px 3px 0; border-radius: 50%; background: var(--teal); }
.mission-action { align-self: end; padding: 34px; position: relative; z-index: 1; }
.route-preview { display: flex; align-items: center; margin: 0 0 18px 4px; }
.route-preview i { width: 13px; height: 13px; border: 2px solid #50717a; border-radius: 50%; }
.route-preview i.current { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px rgba(63,212,193,.12); }
.route-preview i + i::before { content: ""; display: block; width: 26px; height: 1px; margin: 4px 0 0 -28px; background: #50717a; transform: translateX(-1px); }
.route-preview i + i { margin-left: 26px; }
.primary-button, .secondary-button { min-height: 46px; border-radius: 11px; padding: 0 18px; font-weight: 700; transition: transform .18s ease, filter .18s ease; }
.primary-button { width: 100%; border: 0; background: var(--teal); color: #05211f; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.035); color: var(--text); }
.orange-button { background: var(--orange); color: #2d1c07; width: auto; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); gap: 22px; margin-top: 22px; }
.panel { border: 1px solid var(--line); border-radius: 18px; padding: 25px; background: rgba(12, 29, 43, .72); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.panel-head h3 { margin: 0; }
.panel-head > span { color: var(--muted); font-size: .78rem; }
.route-list { margin-top: 22px; display: grid; }
.route-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.route-item:first-child { border-top: 0; }
.route-index { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); font-size: .72rem; }
.route-item.current .route-index { color: var(--teal); border-color: rgba(63,212,193,.4); background: rgba(63,212,193,.08); }
.route-copy strong { display: block; font-size: .92rem; }
.route-copy span { color: var(--muted); font-size: .78rem; }
.route-status { color: var(--muted); font-size: .74rem; }
.longterm-panel { background: linear-gradient(145deg, rgba(40,30,24,.72), rgba(12,29,43,.8) 60%); border-color: rgba(255,180,91,.2); }
.type-badge { min-width: 43px; padding: 7px 9px; border: 1px solid rgba(255,180,91,.25); border-radius: 8px; color: var(--orange) !important; text-align: center; }
.longterm-sub { margin: 18px 0 26px; color: var(--muted); }
.goal-meter-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .79rem; }
.goal-meter-head strong { color: var(--text); }
.progress-track { height: 7px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 99px; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--orange); border-radius: inherit; transition: width .4s ease; }
.goal-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 27px 0; }
.goal-stats div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.09); }
.goal-stats strong, .goal-stats span { display: block; }
.goal-stats strong { color: var(--orange); }
.goal-stats span { margin-top: 2px; color: var(--muted); font-size: .7rem; }

.game-panel { margin-top: 22px; padding: 25px; border: 1px solid rgba(101,169,255,.2); border-radius: 18px; background: linear-gradient(130deg, rgba(17,43,64,.86), rgba(12,29,43,.68)); }
.game-head { align-items: center; }
.game-grid { display: grid; grid-template-columns: .9fr .8fr 1.3fr; gap: 13px; margin-top: 22px; }
.level-card, .weekly-card, .badge-card { min-height: 170px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3,13,22,.28); }
.level-card { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 18px; align-items: center; }
.level-orbit { width: 76px; height: 76px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(101,169,255,.44); border-radius: 50%; background: radial-gradient(circle, rgba(101,169,255,.14), transparent 68%); box-shadow: 0 0 0 7px rgba(101,169,255,.035); }
.level-orbit span, .level-orbit strong { display: block; line-height: 1; }
.level-orbit span { color: var(--muted); font: 700 .58rem "Manrope"; letter-spacing: .12em; }
.level-orbit strong { margin-top: 3px; color: var(--blue); font: 800 1.65rem "Manrope"; }
.level-copy h3, .weekly-card h3 { margin-bottom: 12px; }
.level-copy small, .weekly-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .68rem; }
.teal-track i, #weekly-goal-bar { background: linear-gradient(90deg, var(--blue), var(--teal)); }
.weekly-card p:not(.eyebrow) { min-height: 44px; margin-bottom: 16px; color: var(--muted); font-size: .77rem; }
.badge-shelf { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.badge { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.badge > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.04); color: #708590; font: 800 .63rem "Manrope"; }
.badge strong, .badge small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge strong { color: #91a4ae; font-size: .7rem; }
.badge small { color: #687d88; font-size: .6rem; }
.badge.unlocked { border-color: rgba(63,212,193,.26); background: rgba(63,212,193,.045); }
.badge.unlocked > span { color: var(--teal); background: rgba(63,212,193,.1); }
.badge.unlocked strong { color: var(--text); }

.news-panel { margin-top: 22px; }
.news-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 21px; }
.news-item { min-height: 154px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.1); }
.news-item > a { display: block; color: var(--text); font: 700 .87rem/1.35 "Manrope"; text-decoration: none; }
.news-item > a:hover { color: var(--teal); }
.news-item p { margin: 10px 0 7px; color: var(--teal); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; }
.news-item span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .72rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.news-placeholder { grid-column: 1 / -1; margin: 0; color: var(--muted); }

.section-intro { max-width: 780px; margin-bottom: 34px; }
.section-intro > p:last-child { color: var(--muted); font-size: 1.05rem; }
.goals-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 22px; }
.goal-hero { padding: clamp(26px,4vw,46px); border: 1px solid rgba(255,180,91,.22); border-radius: 22px; background: linear-gradient(140deg, rgba(77,50,23,.38), rgba(12,29,43,.82) 55%); }
.goal-hero h3 { max-width: 740px; font-size: clamp(1.6rem,3vw,2.4rem); }
.goal-hero > p { color: var(--muted); }
.region-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 28px 0; }
.region { min-height: 66px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.region span { font-size: .66rem; color: #6f8590; }
.region.ready { border-color: rgba(255,180,91,.4); color: var(--text); background: rgba(255,180,91,.06); }
.region.done { border-color: rgba(117,214,132,.3); color: #ccebd2; background: rgba(117,214,132,.06); }
.system-panel ol { list-style: none; padding: 0; margin: 25px 0 0; }
.system-panel li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.system-panel li > span { color: var(--teal); font: 700 .72rem "Manrope"; }
.system-panel li strong { font-size: .91rem; }
.system-panel li p { margin: 2px 0 0; color: var(--muted); font-size: .79rem; }

.module-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.module-type { min-height: 230px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(12,29,43,.68); position: relative; overflow: hidden; }
.module-type::after { content: attr(data-code); position: absolute; right: -4px; bottom: -28px; color: rgba(255,255,255,.035); font: 800 8rem/1 "Manrope"; }
.module-code { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 11px; color: var(--module-color); background: color-mix(in srgb, var(--module-color) 12%, transparent); border: 1px solid color-mix(in srgb, var(--module-color) 32%, transparent); font-weight: 800; }
.module-type p { color: var(--muted); font-size: .86rem; }
.module-type small { position: relative; z-index: 1; display: block; margin-top: 18px; color: var(--module-color); font-size: .72rem; }

.profile-management { margin-top: 28px; border-color: rgba(63,212,193,.22); }
.assignment-panel { margin-top: 28px; border-color: rgba(255,180,91,.22); background: linear-gradient(140deg, rgba(66,43,24,.25), rgba(12,29,43,.72) 58%); }
.assignment-panel .secondary-button { margin-top: 20px; }
.assignment-topic-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.assignment-topic-list span { min-height: 72px; display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: #cbd8dc; font-size: .78rem; }
.assignment-topic-list b { color: var(--orange); font: 700 .68rem "Manrope"; }
.assignment-history-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 18px; }
.assignment-history-inline p { margin: 0 5px 0 0; color: var(--muted); font-size: .69rem; }
.assignment-history-inline button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: #bfd0d6; font-size: .68rem; }
.assignment-history-inline button:hover { border-color: rgba(255,180,91,.35); color: var(--orange); }
.management-copy { max-width: 760px; margin: 16px 0 23px; color: var(--muted); }
.profile-list { display: grid; gap: 8px; }
.profile-row { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(210px,.7fr) auto; gap: 18px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.1); }
.profile-row.active-profile { border-color: rgba(63,212,193,.35); background: rgba(63,212,193,.045); }
.profile-row > div:first-child { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 3px 10px; align-items: center; }
.profile-row > div:first-child small { grid-column: 2; color: var(--muted); }
.profile-type { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .62rem; }
.profile-type.test { color: var(--orange); border-color: rgba(255,180,91,.3); }
.profile-type.regression { color: var(--violet); border-color: rgba(189,140,255,.3); }
.profile-type.production { color: var(--teal); border-color: rgba(63,212,193,.3); }
.profile-numbers { display: flex; gap: 20px; color: var(--muted); font-size: .68rem; }
.profile-numbers strong { color: var(--text); }
.profile-row > a { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font-size: .69rem; text-decoration: none; }
.management-forms { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.management-form { display: grid; gap: 12px; align-content: start; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.11); }
.management-form label { display: grid; gap: 6px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.management-form input, .management-form select { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: var(--bg-deep); color: var(--text); }
.management-form input:focus, .management-form select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63,212,193,.08); }
.management-form .secondary-button { width: 100%; }
.form-status { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .72rem; }
.confirmation-field { color: var(--orange) !important; }

dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.56); }
dialog::backdrop { background: rgba(1,7,12,.76); backdrop-filter: blur(7px); }
.dialog-shell { position: relative; padding: clamp(28px,5vw,48px); }
.close-button { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--text); font-size: 1.35rem; }
.dialog-step { color: var(--teal); font: 700 .73rem "Manrope"; letter-spacing: .1em; }
.dialog-shell h2 { margin-top: 14px; }
.dialog-copy { color: #c3d1d7; font-size: 1.04rem; }
.media-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.learning-media { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.12); }
.media-frame { height: 235px; display: grid; place-items: center; overflow: hidden; background: #eef1ec; }
.media-frame img { width: 100%; height: 100%; object-fit: contain; }
.learning-media figcaption { min-height: 78px; padding: 11px 12px; color: var(--muted); font-size: .68rem; line-height: 1.42; }
.learning-media figcaption a { display: block; margin-top: 6px; color: var(--teal); text-underline-offset: 2px; }
.wide-gallery .media-frame { height: 265px; }
.note { margin: 26px 0; padding: 16px 18px; border-left: 3px solid var(--teal); background: rgba(63,212,193,.07); color: #cfe5e2; }
.answers { display: grid; gap: 10px; margin: 25px 0; }
.answer { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; }
.answer.selected { border-color: var(--teal); background: rgba(63,212,193,.08); }
.answer.correct { border-color: rgba(117,214,132,.55); background: rgba(117,214,132,.1); color: #dff5e3; }
.answer.wrong { border-color: rgba(255,124,120,.48); background: rgba(255,124,120,.08); color: #ffd4d2; }
.feedback { display: none; padding: 14px 16px; margin-bottom: 18px; border-radius: 10px; background: rgba(63,212,193,.08); color: #ccece8; }
.feedback.show { display: block; }
.recall-input { width: 100%; min-height: 92px; resize: vertical; margin: 18px 0; padding: 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--bg-deep); color: var(--text); }
.solution { display: none; margin: 0 0 18px; padding: 15px; border: 1px solid rgba(255,180,91,.25); border-radius: 10px; color: #ffe0b8; }
.solution.show { display: block; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.dialog-actions .primary-button { width: auto; min-width: 170px; }
.dialog-progress { height: 5px; margin: 24px 0 30px; border-radius: 99px; background: rgba(255,255,255,.08); }
.dialog-progress i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.completion { text-align: center; padding: 20px 0; }
.completion-mark { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 22px; border: 1px solid rgba(63,212,193,.38); border-radius: 50%; background: rgba(63,212,193,.1); color: var(--teal); font-size: 2rem; }
.saving-state .completion-mark { animation: pulse-save 1s ease-in-out infinite alternate; }
.error-mark { color: var(--red); border-color: rgba(255,124,120,.38); background: rgba(255,124,120,.08); }
@keyframes pulse-save { to { transform: scale(1.06); filter: brightness(1.25); } }
.auth-shell { width: min(520px, 100%); }
.auth-shell > .primary-button { margin-top: 14px; }
.auth-form { display: grid; gap: 15px; margin-top: 26px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.auth-form input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; background: var(--bg-deep); color: var(--text); }
.auth-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63,212,193,.09); }
.auth-error { min-height: 1.35em; color: var(--red); font-size: .82rem; }
.assignment-dialog-shell { width: min(760px, 100%); }
.assignment-previous { margin: 24px 0 12px; }
.assignment-previous > div { display: flex; flex-wrap: wrap; gap: 7px; }
.assignment-previous button { display: inline-flex; gap: 7px; align-items: center; padding: 7px 10px; border: 1px solid rgba(255,180,91,.25); border-radius: 999px; background: rgba(255,180,91,.045); color: var(--text); }
.assignment-previous button strong { color: var(--orange); font-size: .72rem; }
.assignment-previous button span { color: var(--muted); font-size: .7rem; }
.assignment-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 20px; }
.assignment-option { min-height: 118px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.12); color: var(--text); text-align: left; }
.assignment-option:hover { border-color: rgba(63,212,193,.32); background: rgba(63,212,193,.035); }
.assignment-option.current { border-color: rgba(63,212,193,.34); background: rgba(63,212,193,.06); cursor: default; }
.assignment-option-code { width: 46px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--teal); font: 800 .67rem "Manrope"; }
.assignment-option strong, .assignment-option small { display: block; }
.assignment-option strong { margin-bottom: 5px; font-size: .85rem; }
.assignment-option small { color: var(--muted); font-size: .67rem; line-height: 1.4; }
.assignment-option i { color: var(--muted); font-size: .61rem; font-style: normal; }
.focus-checklist { display: grid; gap: 9px; margin: 25px 0; }
.focus-checklist div { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.focus-checklist span { color: var(--orange); font: 700 .7rem "Manrope"; }
.focus-checklist p { margin: 0; }
.region-plan { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 24px 0; }
.region-plan div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.region-plan div:first-child { color: var(--orange); border-color: rgba(255,180,91,.35); background: rgba(255,180,91,.06); }
.bone-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 24px 0 13px; }
.bone-summary div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.1); }
.bone-summary strong, .bone-summary span { display: block; }
.bone-summary strong { color: var(--orange); font: 800 1.45rem "Manrope"; }
.bone-summary span { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.bone-plan-progress { position: relative; height: 23px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.bone-plan-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--orange),var(--teal)); }
.bone-plan-progress span { position: absolute; inset: 0; display: grid; place-items: center; color: #f4fafb; font: 700 .62rem "Manrope"; letter-spacing: .05em; }
.bone-gallery { margin-bottom: 18px; }
.bone-road { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 18px 0 24px; }
.bone-region { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 4px 10px; align-items: center; min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.1); color: var(--text); text-align: left; }
.bone-region:not(:disabled):hover { border-color: rgba(255,180,91,.38); transform: translateY(-1px); }
.bone-region:disabled { opacity: .42; cursor: not-allowed; }
.bone-region-code { grid-row: 1 / span 2; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); font: 800 .64rem "Manrope"; }
.bone-region strong, .bone-region small, .bone-region em { display: block; }
.bone-region strong { font-size: .78rem; }
.bone-region small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
.bone-region em { grid-column: 2; color: #8198a3; font-size: .61rem; font-style: normal; }
.bone-region.current { border-color: rgba(255,180,91,.38); background: rgba(255,180,91,.055); }
.bone-region.current .bone-region-code { color: var(--orange); border-color: rgba(255,180,91,.38); }
.bone-region.review { border-color: rgba(101,169,255,.26); }
.bone-region.mastered { border-color: rgba(117,214,132,.3); background: rgba(117,214,132,.04); }
.bone-region.mastered .bone-region-code { color: var(--green); border-color: rgba(117,214,132,.35); }
.bone-note small { display: block; margin-top: 10px; color: var(--muted); font-size: .64rem; }
.bone-note a { color: var(--teal); }
.bone-question-hint { margin-bottom: 4px; color: var(--muted); font-size: .85rem; }
.bone-feedback { display: none; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.12); }
.bone-feedback.show { display: block; }
.bone-feedback.correct { border-color: rgba(117,214,132,.32); }
.bone-feedback.wrong { border-color: rgba(255,124,120,.3); }
.bone-feedback strong, .bone-feedback span, .bone-feedback small { display: block; }
.bone-feedback strong { margin: 5px 0 9px; color: var(--orange); font: 800 1.25rem "Manrope"; }
.bone-feedback span { color: #c8d6db; font-size: .83rem; }
.bone-feedback span b { color: var(--teal); font-size: 1rem; }
.bone-feedback small { margin: 10px 0 17px; color: var(--muted); line-height: 1.45; }
.bone-feedback .primary-button { width: 100%; }
.bone-result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.bone-result-actions .primary-button, .bone-result-actions .secondary-button { width: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; padding: 11px 16px; border: 1px solid rgba(63,212,193,.35); border-radius: 10px; background: #102e32; color: #d8f4f0; transition: .22s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.celebration-layer { position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.celebration-layer i { --x: 0; --y: -40vh; --r: 180deg; --delay: 0s; position: absolute; left: 50%; bottom: 18%; width: 9px; height: 14px; border-radius: 2px; animation: celebrate 1.5s cubic-bezier(.2,.7,.2,1) var(--delay) both; }
@keyframes celebrate { from { transform: translate(0,0) rotate(0); opacity: 1; } to { transform: translate(var(--x),var(--y)) rotate(var(--r)); opacity: 0; } }
.mobile-nav { display: none; }

.training-intro { margin-bottom: 28px; }
.hours-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(12,29,43,.72); }
.hours-strip div { min-height: 105px; padding: 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.hours-strip div:first-child { border-left: 0; }
.hours-strip strong { color: var(--teal); font: 800 1.65rem "Manrope"; }
.hours-strip span { color: var(--muted); font-size: .8rem; }
.phase-list { display: grid; gap: 11px; }
.phase { display: grid; grid-template-columns: 105px minmax(0,1fr) auto; gap: 24px; align-items: center; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: rgba(12,29,43,.56); }
.phase.current-phase { border-color: rgba(63,212,193,.28); background: linear-gradient(100deg, rgba(23,65,67,.55), rgba(12,29,43,.7)); }
.phase-number { color: var(--teal); font: 800 .77rem "Manrope"; letter-spacing: .08em; }
.phase-copy h3 { margin-bottom: 6px; }
.phase-copy p:last-child { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.phase-status { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; }
.current-phase .phase-status { color: var(--teal); border-color: rgba(63,212,193,.3); }
.curriculum-panel { margin-top: 22px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: rgba(12,29,43,.72); }
.curriculum-head { margin-bottom: 18px; }
.curriculum-group { border-top: 1px solid var(--line); }
.curriculum-group summary { list-style: none; min-height: 74px; display: grid; grid-template-columns: 42px minmax(0,1fr) 22px; gap: 14px; align-items: center; cursor: pointer; }
.curriculum-group summary::-webkit-details-marker { display: none; }
.curriculum-group summary div { display: flex; flex-direction: column; }
.curriculum-group summary strong { font-size: .93rem; }
.curriculum-group summary small { color: var(--muted); }
.curriculum-group summary i { color: var(--muted); font-style: normal; font-size: 1.2rem; transition: transform .2s ease; }
.curriculum-group[open] summary i { transform: rotate(45deg); color: var(--teal); }
.curriculum-number { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--teal); font-weight: 700; }
.curriculum-modules { padding: 0 0 18px 56px; display: grid; gap: 6px; }
.curriculum-modules > div { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.025); }
.curriculum-modules span { color: var(--teal); font-size: .72rem; }
.curriculum-modules p { margin: 0; font-size: .84rem; }
.curriculum-modules small { color: var(--muted); }

@media (max-width: 1040px) {
  .dashboard-grid, .goals-layout { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .badge-card { grid-column: 1 / -1; }
  .news-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .module-grid { grid-template-columns: repeat(2,1fr); }
  .mission-card { grid-template-columns: 48px minmax(0,1fr); }
  .mission-action { grid-column: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 34px 30px; }
  .mission-action .primary-button { width: auto; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .top-stats { gap: 15px; }
  .profile-context, .connection-status { display: none; }
}
@media (max-width: 760px) {
  body { padding-bottom: 70px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  main { padding: 0 18px 42px; }
  .environment-banner { margin: 0 -18px; padding: 10px 18px; align-items: flex-start; }
  .environment-banner span { display: none; }
  .environment-actions { flex-wrap: wrap; justify-content: flex-end; }
  .topbar { min-height: 104px; }
  .top-stats > div:not(.xp-pill) { display: none; }
  .connection-status { display: none; }
  .mobile-assignment-switcher { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(63,212,193,.22); border-radius: 11px; background: rgba(63,212,193,.045); color: var(--text); text-align: left; }
  .mobile-assignment-switcher span, .mobile-assignment-switcher i { color: var(--muted); font-size: .65rem; font-style: normal; }
  .mobile-assignment-switcher strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
  .view { padding-top: 30px; }
  .welcome-row { align-items: center; }
  .welcome-row h2 { font-size: 1.65rem; max-width: 260px; }
  .day-progress p { display: none; }
  .fact-grid { grid-template-columns: 1fr; }
  .daily-fact { min-height: 0; }
  .mission-card { grid-template-columns: 1fr; min-height: 0; }
  .mission-rail { display: none; }
  .mission-main { padding: 27px 23px 22px; }
  .mission-main h3 { font-size: 1.65rem; }
  .mission-action { grid-column: 1; padding: 0 23px 24px; }
  .route-preview { display: none; }
  .mission-action .primary-button { width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .game-grid, .management-forms { grid-template-columns: 1fr; }
  .badge-card { grid-column: auto; }
  .news-list { grid-template-columns: 1fr; }
  .panel { padding: 21px; }
  .goal-stats { grid-template-columns: repeat(3,1fr); }
  .goal-stats div { padding: 9px; }
  .region-grid { grid-template-columns: repeat(2,1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .assignment-topic-list, .assignment-options { grid-template-columns: 1fr; }
  .profile-row { grid-template-columns: 1fr auto; }
  .profile-numbers { grid-column: 1; }
  .profile-row > a { grid-column: 2; grid-row: 1 / span 2; }
  .media-gallery { grid-template-columns: 1fr; }
  .media-frame, .wide-gallery .media-frame { height: min(58vw, 300px); }
  .module-type { min-height: 200px; }
  .hours-strip { grid-template-columns: repeat(2,1fr); }
  .hours-strip div:nth-child(odd) { border-left: 0; }
  .hours-strip div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .phase { grid-template-columns: 1fr auto; gap: 12px; }
  .phase-copy { grid-column: 1 / -1; }
  .curriculum-panel { padding: 20px; }
  .curriculum-modules { padding-left: 0; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); background: rgba(5,13,22,.94); backdrop-filter: blur(16px); }
  .mobile-nav button { min-height: 62px; border: 0; background: transparent; color: var(--muted); }
  .mobile-nav button.active { color: var(--teal); }
}
@media (max-width: 440px) {
  .topbar h1 { font-size: 1.55rem; }
  .topbar .eyebrow { font-size: .62rem; }
  .xp-pill { padding: 8px 10px; }
  .goal-stats { grid-template-columns: 1fr; }
  .environment-banner { display: block; }
  .environment-actions { margin-top: 7px; justify-content: flex-start; }
  .daily-fact { padding: 16px; }
  .fact-icon { width: 34px; height: 34px; }
  .fact-card-foot { display: grid; }
  .game-panel { padding: 18px; }
  .game-head { display: block; }
  .game-head > span { display: block; margin-top: 4px; }
  .level-card { grid-template-columns: 64px minmax(0,1fr); padding: 15px; }
  .level-orbit { width: 62px; height: 62px; }
  .badge-shelf { grid-template-columns: 1fr; }
  .profile-row { grid-template-columns: 1fr; }
  .profile-row > a, .profile-numbers { grid-column: 1; grid-row: auto; }
  .goal-stats div { display: flex; justify-content: space-between; align-items: center; }
  .region-grid, .region-plan, .bone-road { grid-template-columns: 1fr; }
  .bone-summary { grid-template-columns: 1fr; }
  .bone-summary div { display: flex; align-items: center; justify-content: space-between; }
  .bone-summary span { margin: 0; text-align: right; }
  .bone-result-actions { display: grid; }
  .bone-result-actions .primary-button, .bone-result-actions .secondary-button { width: 100%; }
  .route-item { grid-template-columns: 34px minmax(0, 1fr); }
  .route-status { grid-column: 2; }
  .hours-strip { grid-template-columns: 1fr; }
  .hours-strip div, .hours-strip div:nth-child(odd) { border-left: 0; border-top: 1px solid var(--line); }
  .hours-strip div:first-child { border-top: 0; }
  .curriculum-modules > div { grid-template-columns: 36px minmax(0,1fr); }
  .curriculum-modules small { grid-column: 2; }
  .mobile-nav button { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
