* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 24px 18px; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-elevated) 94%, transparent); border-right: 1px solid var(--border); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 13px 7px 13px 7px; background: var(--accent); color: var(--accent-ink); font: 800 15px/1 "DM Mono", monospace; box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 26%, transparent); }
.brand strong { display: block; font-size: 19px; letter-spacing: -0.03em; }
.brand small { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 9px; }
.main-nav { display: grid; gap: 6px; }
.main-nav a { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 700; transition: .2s ease; }
.main-nav a span { width: 20px; text-align: center; font-family: "DM Mono", monospace; }
.main-nav a:hover { background: var(--surface); color: var(--text); }
.main-nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.sidebar-level { margin-top: auto; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.level-head, .metric-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.level-head strong { font-size: 13px; }
.level-head span { color: var(--accent); font: 500 12px "DM Mono", monospace; }
.progress-track { height: 7px; margin: 12px 0 8px; overflow: hidden; border-radius: 99px; background: var(--bg); }
.progress-track > i { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--accent); box-shadow: none; transition: width .4s ease; }
.metric-line { color: var(--faint); font-size: 11px; }
.sidebar-note { display: flex; gap: 10px; align-items: center; padding: 18px 8px 0; color: var(--muted); }
.sidebar-note strong, .sidebar-note small { display: block; font-size: 10px; }
.sidebar-note small { color: var(--faint); margin-top: 2px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 12%, transparent); }

.content-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 72px; padding: 0 clamp(24px, 5vw, 64px); display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 87%, transparent); backdrop-filter: blur(18px); }
.topbar-title small, .eyebrow { display: block; margin-bottom: 4px; color: var(--accent); font: 500 10px/1.3 "DM Mono", monospace; letter-spacing: .12em; }
.topbar-title strong { font-size: 13px; }
.resource-pills { display: flex; align-items: center; gap: 9px; }
.resource-pill { display: flex; gap: 6px; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 600 12px "DM Mono", monospace; }
.resource-pill.fire { color: var(--orange); }.resource-pill.coin { color: #ffd46b; }.resource-pill.xp { color: var(--cyan); }
.mobile-brand, .mobile-nav { display: none; }
main { width: min(1180px, 100%); margin: 0 auto; padding: clamp(28px, 5vw, 64px); }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1, .hero-copy h1 { margin: 6px 0 10px; max-width: 760px; font-size: clamp(32px, 5vw, 58px); line-height: .98; letter-spacing: -.055em; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); }
.page-head p, .hero-copy > p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.7; }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: clamp(28px, 5vw, 60px); padding: clamp(28px, 5vw, 58px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.hero::after { content: "{ }"; position: absolute; right: -10px; bottom: -45px; color: color-mix(in srgb, var(--accent) 7%, transparent); font: 800 190px/1 "DM Mono", monospace; transform: rotate(-8deg); pointer-events: none; }
.hero-copy, .hero-panel { position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid var(--border-bright); border-radius: 11px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 800; font-size: 13px; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); border-color: var(--accent); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.ghost { background: transparent; }
.button.danger { color: var(--danger); }.button.full { width: 100%; }.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.hero-panel { align-self: stretch; display: grid; align-content: center; gap: 14px; padding: 23px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 72%, transparent); }
.orbit-visual { width: 150px; aspect-ratio: 1; margin: 0 auto 10px; display: grid; place-items: center; border: 1px solid var(--border-bright); border-radius: 50%; position: relative; }
.orbit-visual::before, .orbit-visual::after { content: ""; position: absolute; inset: 17px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 50%; transform: rotate(24deg); }
.orbit-visual::after { inset: 41px; border-style: solid; background: var(--accent); box-shadow: 0 0 35px color-mix(in srgb, var(--accent) 35%, transparent); }
.orbit-visual span { position: absolute; top: 4px; right: 22px; width: 13px; height: 13px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.hero-panel .metric-line { font-size: 12px; color: var(--muted); }

.section { margin-top: 42px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: clamp(21px, 3vw, 29px); letter-spacing: -.035em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card, .card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-card { padding: 20px; }
.stat-card span { color: var(--muted); font-size: 12px; }.stat-card strong { display: block; margin: 6px 0 3px; font: 700 clamp(22px, 3vw, 30px) "DM Mono", monospace; }.stat-card small { color: var(--faint); }
.stat-card.accent strong { color: var(--accent); }.stat-card.cyan strong { color: var(--cyan); }.stat-card.orange strong { color: var(--orange); }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 18px; }
.resume-card { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 17px; padding: 22px; }
.resume-index { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 15px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font: 700 15px "DM Mono", monospace; }
.resume-card h3 { margin: 2px 0 6px; font-size: 17px; }.resume-card p { margin: 0; color: var(--muted); font-size: 13px; }
.daily-card { padding: 22px; background: var(--surface); }
.daily-card h3 { margin: 9px 0 7px; }.daily-card p { margin: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.language-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.language-card { position: relative; min-height: 150px; padding: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.language-card.active { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--surface); }
.language-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 10px; background: var(--surface-3); color: var(--muted); font: 700 12px "DM Mono", monospace; }
.language-card.active .language-icon { background: var(--accent); color: var(--accent-ink); }
.language-card h3 { margin: 0 0 6px; font-size: 15px; }.language-card p { margin: 0; color: var(--faint); font-size: 11px; line-height: 1.5; }
.tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font: 700 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.language-card .tag { position: absolute; right: 12px; top: 12px; }.tag.active { background: var(--accent); color: var(--accent-ink); }

.level-tabs, .filter-row { display: flex; gap: 9px; flex-wrap: wrap; }
.filter-row { margin-bottom: 22px; }
.filter-chip { min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-weight: 700; font-size: 12px; }
.filter-chip.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module-card { position: relative; display: flex; flex-direction: column; min-height: 278px; padding: 22px; overflow: hidden; }
.module-card::before { content: attr(data-number); position: absolute; right: 12px; top: -20px; color: color-mix(in srgb, var(--text) 4%, transparent); font: 800 96px "DM Mono", monospace; }
.module-card > * { position: relative; }.module-card .module-kicker { color: var(--cyan); font: 500 10px "DM Mono", monospace; letter-spacing: .1em; }.module-card h3 { margin: 14px 0 9px; font-size: 20px; }.module-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }.module-meta { display: flex; gap: 8px; margin-top: 15px; }.module-card .progress-track { margin-top: auto; }.module-card .metric-line { margin-bottom: 14px; }

.trail { position: relative; max-width: 820px; margin: 0 auto; padding-left: 55px; }
.trail::before { content: ""; position: absolute; left: 22px; top: 24px; bottom: 24px; width: 2px; background: var(--border-bright); opacity: .4; }
.trail-level { margin: 36px 0 17px; display: flex; align-items: center; gap: 12px; }.trail-level:first-child { margin-top: 0; }.trail-level h2 { margin: 0; font-size: 23px; }.trail-level p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.trail-module { position: relative; margin-bottom: 15px; padding: 19px; display: grid; grid-template-columns: 1fr auto; gap: 15px; }
.trail-module::before { content: ""; position: absolute; left: -41px; top: 23px; width: 16px; height: 16px; border: 3px solid var(--bg); border-radius: 50%; background: var(--border-bright); box-shadow: 0 0 0 2px var(--border-bright); }.trail-module.complete::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent); }.trail-module.current { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }.trail-module h3 { margin: 0 0 5px; font-size: 17px; }.trail-module p { margin: 0; color: var(--muted); font-size: 12px; }.trail-lessons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }.lesson-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; }.lesson-pill.done { color: var(--success); }.lesson-pill:hover { color: var(--accent); }

.lesson-layout { max-width: 850px; margin: 0 auto; }.lesson-main { min-width: 0; }.lesson-breadcrumbs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; color: var(--faint); font-size: 11px; }.lesson-breadcrumbs a:hover { color: var(--accent); }
.lesson-title { margin: 0 0 12px; font-size: clamp(31px, 5vw, 52px); line-height: 1; letter-spacing: -.05em; }.lesson-summary { margin: 0 0 25px; color: var(--muted); line-height: 1.65; font-size: 16px; }.lesson-meta { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 24px; color: var(--muted); font: 500 11px "DM Mono", monospace; }
.lesson-drawer { margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }.lesson-drawer summary { min-height: 56px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 800; font-size: 13px; }.lesson-drawer summary small { color: var(--muted); font-weight: 500; }.lesson-drawer[open] summary { border-bottom: 1px solid var(--border); }.lesson-drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px; }.lesson-drawer-grid nav { display: grid; align-content: start; gap: 5px; }.lesson-drawer-grid a, .lesson-drawer-grid button { min-height: 34px; display: flex; align-items: center; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 12px; }.lesson-drawer-grid a:hover, .lesson-drawer-grid button:hover, .lesson-drawer-grid a.current { background: var(--surface-2); color: var(--text); }.lesson-drawer-grid a.done { color: var(--success); }
.lesson-block { margin-bottom: 18px; padding: clamp(21px, 4vw, 32px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }.lesson-block h2 { margin: 0 0 13px; font-size: 21px; }.lesson-block h3 { margin: 0 0 9px; }.lesson-block p { margin: 0; color: var(--muted); line-height: 1.75; }.lesson-block p + p { margin-top: 12px; }
.code-shell { margin-top: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--code); }.code-head { min-height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid var(--border); color: var(--faint); font: 500 10px "DM Mono", monospace; }.code-dots { display: flex; gap: 5px; }.code-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-bright); }.code-shell pre { margin: 0; padding: 18px; overflow: auto; color: #d9e4f2; font: 13px/1.75 "DM Mono", monospace; tab-size: 4; }.code-shell code .kw, .editor-highlight { color: var(--violet); }.code-shell code .str { color: var(--accent); }.code-shell code .fn { color: var(--cyan); }
.practice-callout { border-left: 3px solid var(--cyan); background: color-mix(in srgb, var(--cyan) 6%, var(--surface)); }.practice-callout h2 { color: var(--cyan); }
.quiz-card { background: var(--surface); }.quiz-card .quiz-reward { color: var(--orange); font: 500 11px "DM Mono", monospace; }.quiz-options { display: grid; gap: 9px; margin-top: 18px; }.quiz-option { min-height: 48px; padding: 12px 15px; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); color: var(--text); cursor: pointer; }.quiz-option span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--muted); font: 500 11px "DM Mono", monospace; }.quiz-option:hover { border-color: var(--violet); }.quiz-option.correct { border-color: var(--success); background: color-mix(in srgb, var(--success) 9%, var(--bg-elevated)); }.quiz-option.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--bg-elevated)); }.quiz-option:disabled { cursor: default; }.feedback { display: none; margin-top: 14px; padding: 13px; border-radius: 10px; color: var(--text) !important; font-size: 13px; }.feedback.visible { display: block; }.feedback.success { background: color-mix(in srgb, var(--success) 13%, transparent); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); }.feedback.error { background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.editor { width: 100%; min-height: 220px; resize: vertical; padding: 18px; border: 0; outline: 0; background: var(--code); color: #e0e9f4; font: 13px/1.7 "DM Mono", monospace; tab-size: 4; }.editor:focus { box-shadow: inset 0 0 0 2px var(--accent); }.challenge-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-top: 1px solid var(--border); }.challenge-actions small { color: var(--faint); }.challenge-result { margin-top: 12px; }
.outline-card { padding: 20px; }.outline-card h3 { margin: 0 0 13px; font-size: 15px; }.outline-list { display: grid; gap: 4px; }.outline-list a { display: grid; grid-template-columns: 24px 1fr; gap: 8px; min-height: 36px; align-items: center; padding: 5px 7px; border-radius: 8px; color: var(--muted); font-size: 11px; }.outline-list a:hover, .outline-list a.current { background: var(--surface-2); color: var(--text); }.outline-list a.done span { color: var(--success); }
.lesson-progress { padding: 20px; }.lesson-progress h3 { margin: 0 0 5px; font-size: 14px; }.lesson-progress p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.practice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }.practice-card { padding: 22px; }.practice-card h3 { margin: 10px 0 7px; }.practice-card p { min-height: 42px; margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.6; }.practice-card .metric-line { margin-top: 12px; }
.store-balance { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border: 1px solid color-mix(in srgb, var(--orange) 40%, var(--border)); border-radius: var(--radius); background: color-mix(in srgb, var(--orange) 8%, var(--surface)); }.store-balance strong { color: #ffd46b; font: 700 21px "DM Mono", monospace; }.store-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }.store-card { padding: 22px; }.store-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 16px; background: var(--surface-2); font-size: 26px; }.store-card h3 { margin: 0 0 7px; }.store-card p { min-height: 44px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }.store-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.price { color: #ffd46b; font: 700 13px "DM Mono", monospace; }
.achievement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }.achievement { min-height: 138px; padding: 18px; display: grid; grid-template-columns: 42px 1fr; align-content: center; gap: 13px; opacity: .48; filter: grayscale(.8); }.achievement.unlocked { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }.achievement-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 22px; }.achievement h3 { margin: 1px 0 5px; font-size: 14px; }.achievement p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.profile-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 26px; }.avatar { width: 78px; height: 78px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 24px 13px 24px 13px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); font: 700 25px "DM Mono", monospace; }.profile-hero h2 { margin: 0 0 5px; }.profile-hero p { margin: 0; color: var(--muted); font-size: 13px; }.profile-numbers { display: flex; gap: 24px; }.profile-numbers div { text-align: center; }.profile-numbers strong { display: block; font: 700 24px "DM Mono", monospace; }.profile-numbers small { color: var(--muted); }
.empty-state { padding: 42px 20px; text-align: center; border: 1px dashed var(--border-bright); border-radius: var(--radius); color: var(--muted); }.empty-state strong { display: block; margin-bottom: 7px; color: var(--text); }

.pace-onboarding { margin-bottom: 22px; padding: clamp(24px, 4vw, 38px); border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border)); border-radius: var(--radius-lg); background: var(--surface); }.pace-onboarding h2 { margin: 7px 0 8px; font-size: clamp(25px, 4vw, 38px); }.pace-onboarding > p { margin: 0 0 20px; color: var(--muted); }.pace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 15px; }.pace-card { min-height: 170px; padding: 20px; display: grid; align-content: start; gap: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); color: var(--text); cursor: pointer; }.pace-card:hover, .pace-card.recommended { border-color: var(--accent); }.pace-card strong { font-size: 18px; }.pace-card small { color: var(--muted); line-height: 1.55; }.pace-card em { color: var(--accent); font: normal 600 10px "DM Mono", monospace; }.pace-icon { font-size: 25px; }.pace-status { margin-bottom: 16px; padding: 11px 15px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; }.pace-status a { color: var(--accent); font-weight: 800; }
.pace-settings { padding: 23px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }.pace-settings h2 { margin: 5px 0; }.pace-settings p { margin: 0; color: var(--muted); }.pace-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.diagnostic-form { display: grid; gap: 14px; }.diagnostic-question { padding: 22px; }.diagnostic-question legend { padding: 0 8px; font-weight: 800; }.diagnostic-question legend span { width: 29px; height: 29px; display: inline-grid; place-items: center; margin-right: 10px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }.diagnostic-question label { margin-top: 13px; padding: 13px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); cursor: pointer; }.diagnostic-question label:has(input:checked) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); }.diagnostic-result { margin-top: 20px; padding: 26px; }.diagnostic-result h2 { margin: 6px 0; }
.term-card, .analogy-card, .result-box, .validation-note { margin-top: 17px; padding: 16px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); }.term-card { border-left: 3px solid var(--accent); }.analogy-card { border-left: 3px solid var(--violet); }.analogy-card small { display: block; margin-top: 9px; color: var(--faint); line-height: 1.55; }.text-chunk { margin-top: 22px; }.text-chunk h3 { font-size: 16px; }.learning-steps, .compact-list { padding-left: 23px; color: var(--muted); line-height: 1.7; }.learning-steps li, .compact-list li { margin: 9px 0; padding-left: 5px; }.subhead { margin-top: 25px !important; font-size: 15px; }.symbol-list { display: grid; gap: 8px; }.symbol-list div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px; border-radius: 9px; background: var(--bg-elevated); }.symbol-list dt { color: var(--accent); font: 600 12px "DM Mono", monospace; }.symbol-list dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }.line-notes { display: grid; gap: 9px; }.line-notes article { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }.line-notes code { display: block; margin-bottom: 6px; color: var(--cyan); white-space: pre-wrap; }.line-notes p { font-size: 12px; }.prediction-card { border-color: color-mix(in srgb, var(--orange) 45%, var(--border)); }.prediction-card details, .hint-stack details { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-elevated); }.prediction-card summary, .hint-stack summary { color: var(--accent); cursor: pointer; font-weight: 800; font-size: 12px; }.mistake-grid { display: grid; gap: 12px; }.mistake-grid article { padding: 16px; border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--danger) 4%, var(--bg-elevated)); }.mistake-grid code { display: inline-block; margin: 4px 0 8px; color: var(--danger); }.mistake-grid p { font-size: 12px; }.recall-block { border-left: 3px solid var(--violet); }.conclusion-block { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }.fast-summary { border-left: 3px solid var(--orange); }
.quiz-explanations { display: none; margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--bg-elevated); }.quiz-explanations.visible { display: grid; gap: 7px; }.quiz-explanations p { margin: 0; font-size: 12px; line-height: 1.55; }.recovery-panel { margin-top: 15px; padding: 17px; border: 1px solid var(--orange); border-radius: 12px; background: color-mix(in srgb, var(--orange) 7%, var(--bg-elevated)); }.recovery-options { display: flex; gap: 8px; flex-wrap: wrap; margin: 13px 0; }.success-text { color: var(--success); }.error-text { color: var(--danger); }.validation-note { border-left: 3px solid var(--orange); }.validation-note p { margin-top: 6px; font-size: 12px; }.hint-stack { margin: 14px 0; }

.toast-region { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: grid; gap: 9px; }.toast { width: min(360px, calc(100vw - 44px)); padding: 14px 16px; border: 1px solid var(--border-bright); border-radius: 12px; background: var(--surface-2); box-shadow: var(--shadow); animation: toast-in .25s ease both; font-size: 13px; }.toast strong { color: var(--accent); }.toast.error strong { color: var(--danger); }
.celebration { width: min(440px, calc(100vw - 32px)); padding: 32px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.6); text-align: center; }.celebration::backdrop { background: rgba(2,7,15,.75); backdrop-filter: blur(5px); }.dialog-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--surface-2); cursor: pointer; }.celebration-icon { display: block; font-size: 48px; margin-bottom: 12px; }.celebration h2 { margin: 4px 0 9px; font-size: 30px; }.celebration p { color: var(--muted); line-height: 1.55; }.reward-row { display: flex; justify-content: center; gap: 10px; margin: 22px 0; }.reward-chip { padding: 9px 13px; border-radius: 10px; background: var(--bg-elevated); color: var(--accent); font: 700 13px "DM Mono", monospace; }.confetti::before, .confetti::after { content: "✦  ▪  ✧  ●  ✦  ▪"; position: absolute; left: 0; right: 0; top: 12px; color: var(--accent); letter-spacing: 22px; opacity: .5; transform: rotate(-5deg); }.confetti::after { top: auto; bottom: 12px; color: var(--violet); transform: rotate(4deg); }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

@media (max-width: 1040px) {
  :root { --sidebar: 206px; }
  .main-nav a { padding-inline: 10px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; }.hero-panel { grid-template-columns: 150px 1fr; }.orbit-visual { grid-row: span 3; margin: 0; }
  .module-grid, .store-grid { grid-template-columns: repeat(2, 1fr); }.language-strip { grid-template-columns: repeat(3, 1fr); }
  .lesson-layout { grid-template-columns: 1fr; }.outline-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }.content-shell { margin-left: 0; padding-bottom: 72px; }
  .topbar { min-height: 64px; padding: 0 16px; }.topbar-title { display: none; }.mobile-brand { display: flex; align-items: center; gap: 9px; }.mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px 6px 10px 6px; }.resource-pill { padding: 0 8px; }.resource-pill.xp { display: none; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 30; height: 68px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-elevated) 94%, transparent); backdrop-filter: blur(18px); }.mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); }.mobile-nav a span { font-family: "DM Mono", monospace; }.mobile-nav a small { font-size: 9px; }.mobile-nav a.active { color: var(--accent); }
  main { padding: 26px 16px; }.hero { padding: 27px 22px; }.hero-panel { grid-template-columns: 1fr; }.orbit-visual { grid-row: auto; margin: auto; width: 125px; }.hero-copy h1 { font-size: 42px; }.page-head { align-items: start; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }.two-columns, .practice-grid { grid-template-columns: 1fr; }.module-grid, .store-grid, .achievement-grid { grid-template-columns: 1fr; }.language-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 5px; }.language-card { min-width: 190px; scroll-snap-align: start; }
  .resume-card { grid-template-columns: 48px 1fr; }.resume-card .button { grid-column: 1 / -1; }.trail { padding-left: 42px; }.trail::before { left: 15px; }.trail-module::before { left: -35px; }.trail-module { grid-template-columns: 1fr; }
  .outline-list { grid-template-columns: 1fr; }.lesson-drawer summary { align-items: flex-start; flex-direction: column; justify-content: center; }.lesson-drawer-grid { grid-template-columns: 1fr; }.lesson-block { padding: 21px 18px; }.challenge-actions { align-items: stretch; flex-direction: column; }.challenge-actions .button { width: 100%; }
  .profile-hero { grid-template-columns: auto 1fr; }.profile-numbers { grid-column: 1 / -1; justify-content: space-around; padding-top: 18px; border-top: 1px solid var(--border); }.toast-region { right: 12px; bottom: 82px; }.toast { width: calc(100vw - 24px); }
  .pace-grid { grid-template-columns: 1fr; }.pace-settings { align-items: stretch; flex-direction: column; }.pace-actions { justify-content: flex-start; }.pace-status { align-items: flex-start; flex-direction: column; }.symbol-list div { grid-template-columns: 70px 1fr; }
}

@media (max-width: 430px) {
  .resource-pill { font-size: 10px; }.hero-copy h1 { font-size: 36px; }.hero-actions .button { width: 100%; }.stats-grid { gap: 10px; }.stat-card { padding: 15px; }.section { margin-top: 34px; }.lesson-title { font-size: 36px; }.quiz-option { grid-template-columns: 24px 1fr; padding: 10px; }.store-card-foot { align-items: stretch; flex-direction: column; }.store-card-foot .button { width: 100%; }
}

/* Sprint 4 · instalação, continuidade e diagnóstico */
.topbar-end { display: flex; align-items: center; gap: 10px; }
.pwa-actions:empty { display: none; }
.button.compact { min-height: 34px; padding-inline: 12px; font-size: 11px; }
.app-notices { position: sticky; top: 72px; z-index: 14; }
.app-update-notice { padding: 10px clamp(16px, 5vw, 64px); display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--surface-2) 96%, transparent); }
.app-update-notice div { margin-right: auto; }
.app-update-notice strong, .app-update-notice span { display: block; }
.app-update-notice span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.resume-actions { display: grid; justify-items: stretch; gap: 8px; text-align: center; }
.resume-actions .text-link { font-size: 10px; }
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.system-panel { min-width: 0; padding: clamp(20px, 3vw, 28px); }
.system-panel h2 { margin: 7px 0 9px; font-size: 22px; }
.system-panel > p { margin: 0; color: var(--muted); line-height: 1.65; }
.system-panel > p + p { margin-top: 10px; }
.system-diagnostics { margin: 20px 0; display: grid; }
.system-diagnostics div { min-height: 44px; padding: 9px 0; display: grid; grid-template-columns: minmax(135px, .8fr) 1.2fr; gap: 14px; align-items: center; border-top: 1px solid var(--border); }
.system-diagnostics dt { color: var(--muted); font-size: 11px; }
.system-diagnostics dd { margin: 0; overflow-wrap: anywhere; font: 600 11px/1.5 "DM Mono", monospace; }
.runtime-resource-list { margin: 17px 0 0; padding: 0; list-style: none; }
.runtime-resource-list li { min-height: 34px; padding: 6px 0; display: grid; grid-template-columns: 22px 1fr; align-items: center; border-top: 1px solid var(--border); color: var(--muted); font: 500 11px "DM Mono", monospace; }
.runtime-resource-list li.pass, .runtime-resource-list li.pass span { color: var(--success); }
.system-meta { color: var(--faint) !important; font-size: 11px; }
.system-action-status { min-height: 24px; margin-top: 16px !important; color: var(--accent) !important; font-weight: 700; }
.import-report { margin-top: 17px; padding: 14px; border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--success) 6%, var(--bg-elevated)); }
.import-report p { margin: 5px 0; color: var(--muted); font-size: 12px; }
.import-report ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.lab-file-tab, .lab-file-actions button { min-height: 44px; }

@media (max-width: 760px) {
  .app-notices { top: 64px; }
  .app-update-notice { align-items: stretch; flex-wrap: wrap; padding: 10px 12px; }
  .app-update-notice div { width: 100%; }
  .system-grid { grid-template-columns: 1fr; }
  .topbar-end { margin-left: auto; }
  .pwa-actions .button { min-height: 38px; padding-inline: 9px; }
}

@media (max-width: 430px) {
  .system-diagnostics div { grid-template-columns: 1fr; gap: 3px; }
  .system-panel .hero-actions .button { width: 100%; }
  .resume-actions { grid-column: 1 / -1; width: 100%; }
  .resume-actions .button { width: 100%; }
  .topbar-end .resource-pills:not([hidden]) { display: none; }
}

@media (max-width: 340px) {
  main { padding-inline: 12px; }
  .mobile-brand strong { font-size: 14px; }
  .mobile-brand .brand-mark { width: 31px; height: 31px; }
  .pwa-actions .button { max-width: 102px; padding-inline: 7px; font-size: 9px; }
  .lab-file-actions { flex-wrap: wrap; }
  .lab-file-actions button { flex: 1 1 auto; }
  .app-update-notice .button { flex: 1; }
}

/* Sprint 3 · laboratório Python */
.lab-page-head { align-items: center; }
.lab-honesty, .lab-security-note { margin: 0 0 24px; padding: 17px 20px; border: 1px solid color-mix(in srgb, var(--orange) 42%, var(--border)); border-left: 3px solid var(--orange); border-radius: 12px; background: color-mix(in srgb, var(--orange) 5%, var(--surface)); }
.lab-honesty p, .lab-security-note p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.lab-project-list { border-top: 1px solid var(--border); }
.lab-project-row { min-height: 160px; padding: 25px 0; display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 24px; border-bottom: 1px solid var(--border); }
.lab-project-number { color: var(--accent); font: 700 26px "DM Mono", monospace; }
.lab-project-row h2 { margin: 5px 0 6px; font-size: 23px; }
.lab-project-row p { margin: 0; color: var(--muted); line-height: 1.55; }
.stage-dots { display: flex; gap: 6px; margin-top: 15px; }
.stage-dots i { width: 26px; height: 4px; border-radius: 4px; background: var(--border-bright); }
.stage-dots i.done { background: var(--success); }
.lab-loading { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; }
.lab-loading .pulse-dot { width: 12px; height: 12px; }
.lab-loading p { margin: 0; color: var(--muted); }
.lab-workspace { width: min(1280px, 100%); margin: 0 auto; }
.lab-workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.lab-workspace-head h1 { margin: 6px 0 9px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; }
.lab-workspace-head p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.65; }
.lab-stage-nav { display: flex; gap: 8px; flex: 0 0 auto; }
.lab-concepts { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
.lab-concepts span { padding: 5px 9px; border-radius: 7px; background: var(--surface-2); color: var(--cyan); font: 600 10px "DM Mono", monospace; }
.lab-editor-panel { overflow: hidden; border: 1px solid var(--border-bright); border-radius: var(--radius); background: var(--code); box-shadow: var(--shadow); }
.lab-files-bar { min-height: 48px; padding: 7px 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.lab-tabs { min-width: 0; display: flex; gap: 5px; overflow-x: auto; }
.lab-file-tab, .lab-file-actions button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 11px "DM Mono", monospace; white-space: nowrap; }
.lab-file-tab.active { background: var(--code); color: var(--accent); }
.lab-file-actions { display: flex; flex: 0 0 auto; }
.lab-file-actions button { border-radius: 7px; font-family: inherit; }
.lab-file-actions button:hover { background: var(--surface-2); color: var(--text); }
.editor-label { display: block; padding: 10px 16px 0; color: var(--faint); font-size: 10px; }
.editor-label strong { color: var(--text); }
.lab-code-editor { width: 100%; min-height: 430px; resize: vertical; padding: 16px; border: 0; outline: 0; background: var(--code); color: #e2ebf5; font: 13px/1.68 "DM Mono", Consolas, monospace; tab-size: 4; }
.lab-code-editor:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 65%, transparent); }
.lab-editor-meta { min-height: 46px; padding: 8px 13px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--border); background: var(--bg-elevated); color: var(--faint); font-size: 10px; }
.lab-editor-meta label { display: flex; align-items: center; gap: 7px; }
.lab-editor-meta select { min-height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.lab-io-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lab-stdin, .lab-console, .lab-tests { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.lab-stdin label, .lab-output-head { min-height: 43px; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.lab-stdin label span, .lab-output-head span { color: var(--faint); font-size: 10px; }
.lab-stdin textarea { width: 100%; min-height: 145px; resize: vertical; padding: 14px; border: 0; outline: 0; background: var(--code); color: var(--text); font: 12px/1.6 "DM Mono", monospace; }
.lab-console pre { min-height: 145px; max-height: 260px; margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--code); color: var(--success); font: 12px/1.6 "DM Mono", monospace; }
.error-console pre { color: var(--danger); }
.lab-tests ol { min-height: 145px; margin: 0; padding: 12px; list-style: none; }
.lab-tests li { padding: 8px; display: grid; grid-template-columns: 20px 1fr; gap: 6px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.lab-tests li:last-child { border: 0; }
.lab-tests li span { color: var(--faint); }
.lab-tests li small { grid-column: 2; color: var(--faint); }
.lab-tests li.pass, .lab-tests li.pass span { color: var(--success); }
.lab-tests li.fail, .lab-tests li.fail span { color: var(--danger); }
.lab-runbar { margin: 14px 0 0; padding: 10px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; border: 1px solid var(--border-bright); border-radius: 13px; background: var(--bg-elevated); box-shadow: var(--shadow); }
.lab-runtime-badge { margin-left: auto; color: var(--faint); font: 500 10px "DM Mono", monospace; }
.lab-tools { margin-bottom: 18px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.lab-tools > div { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lab-tools h2 { margin: 0 0 7px; font-size: 18px; }
.lab-tools p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.lab-tools .hero-actions { margin-top: 16px; }
.lab-history { margin-top: 16px; display: grid; gap: 8px; }
.lab-history article { padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); }
.lab-history strong, .lab-history small { display: block; }
.lab-history small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.lab-history .empty-state { padding: 20px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lab-action-dialog { width: min(460px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border-bright); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lab-action-dialog::backdrop { background: rgba(2, 7, 15, .78); backdrop-filter: blur(4px); }
.lab-action-dialog form { padding: 25px; }
.lab-action-dialog h2 { margin: 7px 0 8px; }
.lab-action-dialog p { margin: 0 0 17px; color: var(--muted); line-height: 1.55; }
.lab-action-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.lab-action-dialog input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-bright); border-radius: 9px; background: var(--code); color: var(--text); }
.lab-action-dialog .hero-actions { justify-content: flex-end; }

@media (max-width: 1040px) {
  .lab-workspace-head { align-items: start; flex-direction: column; }
  .lab-io-grid { grid-template-columns: 1fr; }
  .lab-code-editor { min-height: 380px; }
}

@media (max-width: 760px) {
  .lab-project-row { grid-template-columns: 44px 1fr; gap: 14px; }
  .lab-project-row .button { grid-column: 2; justify-self: start; }
  .lab-files-bar { align-items: stretch; flex-direction: column; padding-bottom: 7px; }
  .lab-file-actions { justify-content: flex-start; }
  .lab-file-tab { border-radius: 8px; }
  .lab-code-editor { min-height: 330px; }
  .lab-tools { grid-template-columns: 1fr; }
  .lab-runtime-badge { width: 100%; margin-left: 0; }
  .lab-editor-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 430px) {
  .lab-project-row { grid-template-columns: 1fr; }
  .lab-project-row .button { grid-column: 1; width: 100%; }
  .lab-project-number { font-size: 18px; }
  .lab-stage-nav { width: 100%; }
  .lab-stage-nav .button { flex: 1; }
  .lab-runbar .button { flex: 1 1 42%; }
  .lab-runtime-badge { margin-left: 0; }
  .lab-file-actions button { padding-inline: 8px; }
  .lab-code-editor { min-height: 300px; font-size: 12px; }
}

/* Sprint 5 · publicação educacional brasileira + bancada de programação */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6efe2;
  --bg-elevated: #fbf5ea;
  --surface: #fffaf0;
  --surface-2: #f0e4d3;
  --surface-3: #e6d6c0;
  --border: #d8c5a8;
  --border-bright: #b69365;
  --text: #2d1b13;
  --muted: #665044;
  --faint: #8c745f;
  --accent: #edae00;
  --accent-ink: #261307;
  --cyan: #68733d;
  --violet: #9b4a27;
  --orange: #d85117;
  --danger: #a13b27;
  --success: #5f7238;
  --code: #211610;
  --code-text: #f8ead2;
  --paper-highlight: #fffdf7;
  --shadow: 0 14px 34px rgba(74, 43, 22, .12);
  --radius-sm: 3px;
  --radius: 7px;
  --radius-lg: 11px;
  --sidebar: 278px;
  --display-font: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --display-weight: 700;
  --display-tracking: -.025em;
  font-family: "Trebuchet MS", Aptos, Candara, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120f;
  --bg-elevated: #1d1712;
  --surface: #251b14;
  --surface-2: #302218;
  --surface-3: #3a291c;
  --border: #4a3725;
  --border-bright: #795a39;
  --text: #f7ead7;
  --muted: #d0bda5;
  --faint: #9e876d;
  --accent: #f2b211;
  --accent-ink: #241204;
  --cyan: #a4aa61;
  --violet: #c5794c;
  --orange: #ff6828;
  --danger: #ff8b70;
  --success: #9ab36d;
  --code: #120d0a;
  --code-text: #f6e7cf;
  --paper-highlight: #2a1f18;
  --shadow: 0 18px 42px rgba(0, 0, 0, .3);
  --display-font: "Bahnschrift Condensed", "Arial Narrow", "Aptos Narrow", "Franklin Gothic Medium", sans-serif;
  --display-weight: 520;
  --display-tracking: -.012em;
}

html[data-cosmetic-theme="ocean"] { --accent: #8f963e; --cyan: #d18f22; }
html[data-theme="dark"][data-cosmetic-theme="ocean"] { --accent: #b1b75d; --cyan: #e2a23b; }
html[data-cosmetic-theme="sunset"] { --accent: #d85b22; --orange: #b54325; }
html[data-theme="dark"][data-cosmetic-theme="sunset"] { --accent: #ef7740; --orange: #ff9a55; }

body {
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
  font-size: 15px;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='1' cy='2' r='.45' fill='%238c745f' fill-opacity='.24'/%3E%3Ccircle cx='6' cy='5' r='.35' fill='%238c745f' fill-opacity='.18'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body::before { opacity: .08; }
h1, h2, h3, .lesson-title, .hero-copy h1, .page-head h1 {
  font-family: var(--display-font);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}
html[data-theme="dark"] :is(h2, h3) { line-height: 1.12; }
html[data-theme="dark"] :is(.lesson-title, .hero-copy h1, .page-head h1, .lab-workspace-head h1) { line-height: 1; }
code, pre, textarea, .eyebrow, .module-kicker, .lesson-meta { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
:focus-visible { outline-color: var(--orange); outline-width: 3px; outline-offset: 3px; }

.sidebar {
  width: var(--sidebar);
  padding: 0 18px 22px;
  background: color-mix(in srgb, var(--bg-elevated) 96%, var(--surface));
  border-right-color: var(--border);
  backdrop-filter: none;
  transition: width .2s ease;
}
.brand { min-height: 80px; padding: 0 10px; gap: 10px; border-bottom: 1px solid var(--border); }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 21px; letter-spacing: -.045em; }
.brand small { margin-top: 2px; color: var(--faint); font-size: 8px; letter-spacing: .11em; }
.orbit-logo { width: 48px; height: 48px; flex: 0 0 auto; fill: none; stroke: var(--text); stroke-width: 1.8; }
.orbit-logo > circle:first-child { fill: var(--orange); stroke: var(--orange); }
.orbit-logo .orbit-node { fill: var(--accent); stroke: var(--text); stroke-width: 1.2; }
.sidebar-toggle {
  position: fixed;
  z-index: 31;
  top: 96px;
  left: calc(var(--sidebar) - 17px);
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(74, 43, 22, .12);
  transition: left .2s ease;
}
.main-nav { margin-top: 18px; gap: 2px; }
.main-nav a { min-height: 42px; padding-inline: 11px; border: 0; border-left: 3px solid transparent; border-radius: 0; color: var(--muted); font-size: 13px; }
.main-nav a:hover { background: var(--surface-2); }
.main-nav a.active { border-left-color: var(--orange); background: var(--surface-2); color: var(--text); }
.sidebar-level { border-radius: 0; background: var(--surface); box-shadow: none; }
.sidebar-note { border-top: 1px solid var(--border); }
.progress-track { height: 5px; border-radius: 0; background: color-mix(in srgb, var(--border) 55%, transparent); }
.progress-track > i { border-radius: 0; background: var(--accent); box-shadow: none; }
.pulse-dot { background: var(--success); box-shadow: none; }

.content-shell { margin-left: var(--sidebar); transition: margin-left .2s ease; }
.topbar {
  min-height: 64px;
  padding-inline: clamp(22px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 97%, var(--surface));
  border-bottom-color: var(--border);
  backdrop-filter: none;
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title small { margin: 0; color: var(--orange); font-size: 10px; }
.topbar-title strong { font-size: 13px; }
.lesson-streak { color: var(--text); font-size: 12px; white-space: nowrap; }
.resource-pill { min-height: 31px; border-radius: 3px; background: transparent; }
.resource-pill.fire, .resource-pill.coin, .resource-pill.xp { color: var(--text); }
.theme-switcher { position: relative; }
.theme-switcher summary {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-switcher summary::-webkit-details-marker { display: none; }
.theme-switcher[open] summary { border-color: var(--orange); }
.theme-switcher fieldset {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  right: 0;
  width: 190px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.theme-switcher legend { padding: 0 5px; color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.theme-switcher label { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 8px; cursor: pointer; }
.theme-switcher label:hover, .theme-switcher label:has(input:checked) { background: var(--surface-2); color: var(--orange); }
.theme-switcher input { accent-color: var(--orange); }

main { width: min(1160px, 100%); padding: clamp(32px, 5vw, 58px); }
.page-head { padding-bottom: 22px; border-bottom: 2px solid var(--text); }
.page-head h1, .hero-copy h1 { font-size: clamp(40px, 6vw, 70px); line-height: .94; }
.page-head p, .hero-copy > p { color: var(--muted); font-size: 16px; }
.eyebrow, .topbar-title small { color: var(--orange); font-weight: 800; letter-spacing: .09em; }
.section-head { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.section-head h2 { font-size: clamp(25px, 3.2vw, 36px); }
.text-link { color: var(--orange); }

.button {
  min-height: 42px;
  border-radius: 4px;
  background: transparent;
  border-color: var(--border-bright);
  box-shadow: none;
  font-weight: 800;
}
.button:hover { transform: none; background: var(--surface-2); border-color: var(--orange); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--orange)); }
.button.ghost { background: transparent; }
.tag, .filter-chip { border-radius: 3px; }
.filter-chip { background: transparent; }
.filter-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.hero {
  border-radius: 2px;
  background: var(--surface);
  box-shadow: none;
  border-top: 4px solid var(--orange);
}
.hero::after { color: color-mix(in srgb, var(--orange) 8%, transparent); }
.hero-panel { border-radius: 0; background: var(--bg-elevated); }
.orbit-visual::before, .orbit-visual::after { border-color: var(--accent); background: transparent; box-shadow: none; }
.orbit-visual::after { inset: 48px; background: var(--orange); border: 0; }
.orbit-visual span { background: var(--cyan); box-shadow: none; }
.stat-card, .card { border-radius: 5px; background: var(--surface); box-shadow: none; }
.stat-card { border-top: 3px solid var(--border-bright); }
.stat-card.accent { border-top-color: var(--accent); }
.stat-card.orange { border-top-color: var(--orange); }
.stat-card.cyan { border-top-color: var(--cyan); }
.daily-card, .language-card.active, .pace-onboarding, .quiz-card { background: var(--surface); }
.resume-index, .language-icon, .store-icon, .achievement-icon, .avatar { border-radius: 4px; }
.module-card { border-radius: 0; border-width: 0 0 1px; background: transparent; }
.module-card::before { color: color-mix(in srgb, var(--orange) 10%, transparent); }
.module-card .module-kicker { color: var(--orange); }
.trail::before { background: var(--border-bright); }
.trail-module { border-radius: 0; border-width: 0 0 1px; background: transparent; }
.lesson-pill { border-radius: 2px; }

/* Aula: navegação editorial à esquerda, leitura ampla e sem painel direito */
.lesson-route .main-nav,
.lesson-route .sidebar-level,
.lesson-route .sidebar-note { display: none; }
.lesson-sidebar-slot { display: none; min-height: 0; flex: 1; overflow: hidden auto; padding-top: 26px; }
.lesson-route .lesson-sidebar-slot { display: block; }
.lesson-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--orange); text-transform: uppercase; }
.lesson-side-head span { font-size: 12px; font-weight: 900; letter-spacing: .07em; }
.lesson-side-head strong { color: var(--muted); font: 600 11px Consolas, monospace; }
.lesson-sidebar-slot > .progress-track { margin: 16px 0 24px; }
.lesson-sidebar-slot nav { display: grid; gap: 2px; }
.lesson-sidebar-slot nav a {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  gap: 10px;
  margin-inline: -18px;
  padding: 7px 16px 7px 18px;
  border-left: 4px solid transparent;
  color: var(--muted);
}
.lesson-sidebar-slot nav a span { color: var(--text); font: 500 11px Consolas, monospace; }
.lesson-sidebar-slot nav a b { font-size: 12px; line-height: 1.3; }
.lesson-sidebar-slot nav a i { color: var(--border-bright); font-style: normal; text-align: center; }
.lesson-sidebar-slot nav a:hover { background: var(--surface-2); color: var(--text); }
.lesson-sidebar-slot nav a.current { border-left-color: var(--orange); background: var(--surface-2); color: var(--text); }
.lesson-sidebar-slot nav a.done i { color: var(--success); }
.side-orbit { position: relative; width: 190px; height: 150px; margin: 38px auto -20px; border: 1px dashed color-mix(in srgb, var(--accent) 58%, transparent); border-radius: 50%; transform: rotate(-12deg); }
.side-orbit::before { content: ""; position: absolute; inset: 24px -14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 50%; }
.side-orbit i { position: absolute; left: 54px; top: 50px; width: 58px; height: 58px; border-radius: 50%; background: var(--orange); }
.side-orbit b, .side-orbit span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.side-orbit b { right: 10px; top: 47px; }
.side-orbit span { left: 14px; bottom: 22px; background: var(--text); }

.lesson-route main { width: min(1100px, 100%); padding-top: 46px; }
.lesson-layout { max-width: 900px; margin: 0; }
.lesson-breadcrumbs { margin-bottom: 22px; color: var(--faint); font-size: 11px; }
.lesson-title { max-width: 930px; margin: 10px 0 16px; font-size: clamp(48px, 6.5vw, 76px); line-height: .94; letter-spacing: -.025em; }
.lesson-summary { max-width: 800px; margin-bottom: 18px; color: var(--text); font-size: 18px; line-height: 1.55; }
.lesson-meta { padding-bottom: 20px; border-bottom: 1px solid var(--border); color: var(--muted); }
.lesson-drawer { border-radius: 0; background: var(--surface); }
@media (min-width: 761px) { .lesson-route .lesson-drawer { display: none; } }
.lesson-block {
  margin: 0;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.lesson-block h2 { margin-bottom: 14px; font-size: clamp(25px, 3vw, 34px); }
.lesson-block h3 { font-family: "Trebuchet MS", Aptos, sans-serif; letter-spacing: -.02em; }
.lesson-block p { color: var(--muted); font-size: 15px; line-height: 1.72; }
.recall-block, .practice-callout, .fast-summary { margin-top: 18px; padding-inline: 22px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.practice-callout { border-left-color: var(--olive, var(--cyan)); }
.practice-callout h2 { color: var(--text); }
.term-card, .analogy-card, .result-box, .validation-note {
  border-radius: 3px;
  background: var(--surface);
}
.term-card { border-left-color: var(--orange); }
.analogy-card { padding: 20px 24px; border-left: 5px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.analogy-card strong { display: block; margin-bottom: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.symbol-list div, .line-notes article, .prediction-card details, .hint-stack details, .mistake-grid article { border-radius: 2px; background: var(--surface); }
.line-notes article { border-left: 3px solid var(--border-bright); }
.prediction-card { border-bottom-color: var(--border); }
.code-shell { border-radius: 5px; border-color: #5b4635; background: var(--code); box-shadow: 0 8px 20px rgba(31, 19, 12, .16); }
.code-head { border-bottom-color: #4b382b; color: #c3a98d; }
.code-dots i:nth-child(1) { background: #e95c3f; }
.code-dots i:nth-child(2) { background: #e9ad1d; }
.code-dots i:nth-child(3) { background: #7f9a50; }
.code-shell pre { color: var(--code-text); }
.code-shell code .kw, .editor-highlight { color: #ff7c45; }
.code-shell code .str { color: #d9e071; }
.code-shell code .fn { color: #edb71f; }
.quiz-card { padding: 28px 0; }
.quiz-card .quiz-reward { color: var(--orange); }
.quiz-options { gap: 0; border: 1px solid var(--border); }
.quiz-option { min-height: 45px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.quiz-option:last-child { border-bottom: 0; }
.quiz-option span { border: 1px solid var(--border-bright); border-radius: 50%; background: transparent; }
.quiz-option:hover { background: var(--surface-2); border-color: var(--border); }
.feedback, .quiz-explanations, .recovery-panel { border-radius: 3px; }
.editor { color: var(--code-text); }
.conclusion-block { border-bottom: 0; }

/* Demais superfícies adaptadas, sem repetir mecanicamente a aula */
.pace-onboarding { border-radius: 2px; border-left: 5px solid var(--accent); }
.pace-card { border-radius: 3px; background: var(--surface); }
.diagnostic-question, .diagnostic-question label { border-radius: 3px; }
.profile-hero { border-top: 4px solid var(--orange); }
.store-balance { border-radius: 3px; background: var(--surface); }
.store-balance strong, .price { color: var(--orange); }
.store-card { border-top: 3px solid var(--border-bright); }
.achievement { border-radius: 3px; }
.system-grid { gap: 20px; }
.system-panel { border-radius: 3px; border-top: 3px solid var(--border-bright); }
.system-diagnostics div { border-top-color: var(--border); }
.app-update-notice { background: var(--surface); backdrop-filter: none; }
.toast, .celebration, .lab-action-dialog { border-radius: 4px; background: var(--surface); }
.celebration::backdrop, .lab-action-dialog::backdrop { background: rgba(31, 20, 12, .78); backdrop-filter: none; }

.lab-honesty, .lab-security-note { border-radius: 3px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.lab-project-row { border-bottom-color: var(--border); }
.lab-project-number { color: var(--orange); }
.lab-concepts span { border-radius: 2px; background: var(--surface-2); color: var(--cyan); }
.lab-editor-panel { border-radius: 4px; box-shadow: 0 14px 34px rgba(29, 17, 10, .2); }
.lab-files-bar, .lab-editor-meta, .lab-runbar { background: var(--bg-elevated); }
.lab-file-tab, .lab-file-actions button { border-radius: 2px 2px 0 0; }
.lab-file-tab.active { color: var(--accent); }
.lab-code-editor { color: var(--code-text); }
.lab-stdin, .lab-console, .lab-tests, .lab-runbar, .lab-tools > div { border-radius: 3px; }
.lab-tools > div { background: var(--surface); }

body.sidebar-collapsed { --sidebar: 72px; }
.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .brand > span,
.sidebar-collapsed .lesson-sidebar-slot,
.sidebar-collapsed .sidebar-level,
.sidebar-collapsed .sidebar-note { display: none; }
.sidebar-collapsed .main-nav a { justify-content: center; padding: 0; font-size: 0; }
.sidebar-collapsed .main-nav a span { font-size: 14px; }
.sidebar-collapsed .orbit-logo { width: 42px; }

@media (max-width: 1040px) {
  :root { --sidebar: 228px; }
  .lesson-sidebar-slot nav a { grid-template-columns: 24px 1fr 14px; gap: 6px; }
  .lesson-sidebar-slot nav a b { font-size: 11px; }
  .lesson-title { font-size: clamp(46px, 6vw, 64px); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar-toggle { display: none; }
  .content-shell { margin-left: 0; }
  .topbar { min-height: 60px; padding-inline: 13px; }
  .mobile-brand { gap: 6px; }
  .mobile-brand .orbit-logo { width: 36px; height: 36px; }
  .mobile-brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
  .theme-switcher summary { width: 36px; height: 36px; }
  .resource-pills .lesson-streak { display: none; }
  main, .lesson-route main { padding: 28px 16px 92px; }
  .lesson-layout { max-width: none; }
  .lesson-title { font-size: clamp(42px, 13vw, 58px); }
  .lesson-summary { font-size: 16px; }
  .lesson-block { padding-block: 24px; }
  .lesson-drawer { display: block; }
  .mobile-nav { background: var(--bg-elevated); backdrop-filter: none; }
  .mobile-nav a.active { color: var(--orange); }
  .hero { border-radius: 0; }
  .page-head h1, .hero-copy h1 { font-size: clamp(40px, 13vw, 58px); }
}

@media (max-width: 430px) {
  .topbar-end { gap: 5px; }
  .pwa-actions .button { max-width: 94px; }
  .theme-switcher fieldset { right: -4px; }
  .lesson-title { font-size: 42px; }
  .lesson-block h2 { font-size: 27px; }
  .term-card, .analogy-card, .result-box, .validation-note { padding: 14px; }
  .quiz-option { grid-template-columns: 25px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar-toggle, .content-shell { transition: none !important; }
}

/* 5.0.4 · leitura editorial mais leve no tema escuro */
html[data-theme="dark"] :is(h1, h2, h3, .lesson-title, .hero-copy h1, .page-head h1) {
  letter-spacing: var(--display-tracking);
}
html[data-theme="dark"] :is(h2, h3) { line-height: 1.12; }
html[data-theme="dark"] :is(.lesson-title, .hero-copy h1, .page-head h1, .lab-workspace-head h1) { line-height: 1; }
