@font-face { font-family: Hanken; src: url("/assets/HankenGrotesk-VariableFont_wght-a5831626.ttf") format('truetype'); font-weight: 100 900; font-display: swap; }
/* Nobi brand tokens: Night, Morning and Day Green, warm Sand surfaces, one Focus orange. */
:root {
  --night: #2e4447; --morning: #37928b; --day: #e0e5da; --day-50: rgba(224, 229, 218, .5); --day-25: rgba(224, 229, 218, .25);
  --sand: #faf6ee; --clay: #f6f0ef; --terracotta: #e9e3e0; --focus: #e86826; --danger: #e4585b;
  --ink: #2e4447; --text: #5a6763; --muted: #7f8a86; --line: #e6e2d8; --paper: var(--sand); --card: #fff;
  --green: var(--morning); --orange: var(--focus); --sage: var(--day);
  --curve: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='900' viewBox='0 0 1440 900' fill='none' stroke='%232e4447' stroke-opacity='.32' stroke-width='1.2'%3E%3Cpath d='M-80 560C220 1010 700 740 1010 520S1440 250 1540 190'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 Hanken, "Hanken Grotesk", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 46px; font-weight: 300; letter-spacing: -.4px; line-height: 1.08; margin: 8px 0 12px; }
h2 { font-size: 26px; font-weight: 600; line-height: 1.25; letter-spacing: -.3px; }
h3 { font-size: 19px; font-weight: 700; line-height: 1.35; }
h4 { font-weight: 700; }
p { color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, input[type=submit] { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; padding: 12px; background: white; z-index: 10; }
.nav-label, .eyebrow, .feature-kicker, .path-row small { font-size: 14px; font-weight: 700; letter-spacing: .1px; color: var(--morning); text-transform: none; }

/* Shell */
.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 28px 24px 32px; }
.brand img { width: 86px; height: 40px; object-fit: contain; }
.brand span { font-size: 23px; font-weight: 400; border-left: 1px solid var(--line); padding-left: 13px; padding-bottom: 6px; line-height: 20px; }
.nav-label { padding: 13px 27px; font-size: 12px; color: var(--muted); }
.main-nav { display: grid; gap: 6px; padding: 0 15px; }
.main-nav a { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 14px; color: var(--text); font-weight: 600; }
.main-nav a > span:first-child { font-size: 22px; width: 24px; text-align: center; line-height: 1; color: var(--muted); }
.main-nav a:hover { background: var(--day-25); }
.main-nav .active { background: var(--day-50); color: var(--night); }
.main-nav .active > span:first-child { color: var(--morning); }
.sidebar-note { margin: 60px 26px 30px; padding-top: 23px; border-top: 1px solid var(--line); font-size: 14px; }
.sidebar-note > span { font-size: 28px; color: var(--morning); }
.sidebar-note strong { display: block; margin-top: 6px; }
.sidebar-note p { color: var(--muted); margin-top: 6px; line-height: 1.7; }
.profile-link { display: flex; align-items: center; gap: 10px; padding: 18px 23px; margin-top: auto; border-top: 1px solid var(--line); }
.profile-link strong { font-size: 14px; }
.profile-link small { display: block; color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--day); color: var(--night); font-weight: 700; }
.admin-link { padding: 0 24px 18px; font-size: 13px; color: var(--morning); font-weight: 600; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 42px; border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 22px; font-weight: 600; }
.top-stats { display: flex; align-items: center; gap: 12px; }
.stat-chip { display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--night); background: var(--clay); white-space: nowrap; }
.stat-chip.xp { background: var(--day); }
.flame { width: 16px; height: 18px; color: var(--focus); flex-shrink: 0; }
.top-stats .avatar { width: 42px; height: 42px; }
.top-stats .avatar-link { display: block; border-radius: 50%; }
.avatar-image { display: block; object-fit: cover; padding: 0; background: var(--day); }
.avatar-large { width: 96px; height: 96px; font-size: 40px; }
.person-header { display: flex; align-items: center; gap: 26px; margin-bottom: 30px; }
.person-header h1 { margin: 6px 0; }
.person-header p { color: var(--text); margin: 4px 0; }
.profile-stats.four { grid-template-columns: repeat(4, 1fr); }
.track-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 12px; }
.track-list li { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; }
.track-list li > div { flex: 1; min-width: 0; }
.track-list small { display: block; color: var(--muted); margin-top: 2px; }
.track-list progress { width: 100%; margin-top: 10px; }
.track-list .unit-icon { background: var(--day); }
.track-completed { font-size: 14px; color: var(--muted); margin-top: 12px; }
.rank-person { display: flex; align-items: center; gap: 16px; color: var(--ink); min-width: 0; }
.rank-person:hover strong { text-decoration: underline; }
.rankings .avatar { display: grid; width: 44px; height: 44px; background: var(--card); border: 1px solid var(--line); }
.celebration { position: relative; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.celebration-card { max-width: 720px; margin: 0 auto; }
.celebration-icon { background: var(--morning); color: #fff; font-size: 44px; }
.celebration-stats { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 26px 0 8px; }
.celebration-stats article { min-width: 130px; padding: 16px 22px; border-radius: 18px; background: var(--day-50); }
.celebration-stats strong { display: block; font-size: 34px; font-weight: 300; color: var(--night); line-height: 1.1; }
.celebration-stats span { font-size: 13px; color: var(--muted); }
.celebration-also { font-size: 15px; color: var(--text); }
.completion-actions button.text-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.workspace { position: relative; width: 100%; max-width: 1500px; margin: 0 auto; padding: 44px 42px 70px; }
.page-heading { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-heading p:not(.eyebrow) { font-size: 18px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: var(--day-50); color: var(--night); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Buttons and links */
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 50px; background: var(--night); color: #fff; border: 1px solid var(--night); border-radius: 999px; padding: 12px 26px; font-size: 16px; line-height: 1.3; font-weight: 600; text-align: center; transition: background .16s, color .16s, border-color .16s; }
.button:hover { background: var(--morning); border-color: var(--morning); color: #fff; }
.button-light { background: var(--day); border-color: var(--day); color: var(--night); }
.button-light:hover { background: #fff; border-color: #fff; color: var(--night); }
.button-soft { background: var(--day-50); border-color: var(--day); color: var(--night); }
.button-soft:hover { background: var(--day); border-color: var(--day); color: var(--night); }
.google-button { background: var(--day); color: var(--night); border-color: var(--day); gap: 12px; }
.google-button:hover { background: var(--night); border-color: var(--night); color: #fff; }
.google-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.google-mark svg { width: 15px; height: 15px; }
.text-link { color: var(--morning); font-size: 15px; font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 36px 0 20px; }
.section-heading h2 { font-size: 34px; font-weight: 300; letter-spacing: -.3px; }
.section-heading p { font-size: 16px; margin-top: 6px; }

/* Home */
.learning-plan-banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); margin-bottom: 28px; }
.learning-plan-banner strong { font-size: 17px; }
.learning-plan-banner small { display: block; color: var(--muted); font-size: 13px; }
.learning-plan-banner a { margin-left: auto; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 28px; }
.dashboard-grid > * { min-width: 0; }
.main-column { min-width: 0; overflow-x: clip; }
.feature-card { position: relative; overflow: hidden; border-radius: 24px; padding: 40px; min-height: 300px; background: var(--night); color: #fff; }
.feature-text { position: relative; z-index: 1; max-width: 76%; }
.feature-kicker { color: var(--day); }
.feature-card h2 { font-size: 40px; line-height: 1.12; margin: 14px 0 12px; font-weight: 300; letter-spacing: -.3px; color: #fff; }
.feature-card p:not(.feature-kicker) { color: rgba(255, 255, 255, .78); font-size: 16px; margin-bottom: 26px; }
.lamp-art { position: absolute; width: 240px; height: 240px; object-fit: contain; right: 10px; bottom: -40px; filter: brightness(0) invert(1); opacity: .22; }
.feature-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--day); margin-top: 22px; }
.unit-list { display: grid; gap: 26px; }
.path-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.path-unit { display: flex; align-items: center; gap: 22px; background: var(--day); padding: 34px 36px; }
.unit-icon { width: 58px; height: 58px; flex-shrink: 0; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--night); font-size: 24px; }
.path-unit h3 { font-size: 24px; margin: 4px 0 6px; }
.path-unit p:last-child { font-size: 16px; }
.unit-number { margin-left: auto; color: rgba(255, 255, 255, .9); font-size: 64px; font-weight: 300; line-height: 1; }
.lesson-path { padding: 26px 36px 30px; }
.path-row { position: relative; display: flex; align-items: center; gap: 26px; min-height: 124px; }
.path-row-1 { margin-left: 52px; }
.path-row-2 { margin-left: 104px; }
.path-node { width: 90px; height: 90px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 24px; }
.path-node.current span { font-size: 20px !important; padding-left: 4px; }
.path-node.current { background: var(--night); border-color: var(--night); color: #fff; }
.path-node.done { background: var(--morning); border-color: var(--morning); color: #fff; }
.path-node.locked { background: var(--clay); border-color: var(--clay); color: var(--muted); }
.path-node.locked .fa-lock { font-size: 0.8em; opacity: 0.75; }
.path-node:hover:not(.locked) { filter: brightness(1.08); }
.path-row small { display: block; font-size: 15px; }
.path-row h4 { font-size: 22px; margin: 3px 0 6px; }
.path-row span:not(.path-node) { font-size: 15px; color: var(--muted); }
.path-node span { color: inherit !important; font-size: inherit !important; }
.right-rail { display: grid; gap: 22px; }
.rail-card { min-width: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--card); padding: 30px; }
.rail-card h3 { font-size: 22px; }
.rail-card h3 > span[aria-hidden] { float: right; color: var(--muted); font-weight: 300; }
.rail-card p { font-size: 16px; margin: 10px 0; }
.rail-card small { display: block; font-size: 14px; color: var(--muted); margin-top: 12px; }
.rail-card .text-link { display: inline-block; margin-top: 12px; }
.big-number { font-size: 56px; font-weight: 300; line-height: 1; margin-right: 8px; vertical-align: -6px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; display: block; appearance: none; background: var(--day); accent-color: var(--morning); }
progress::-webkit-progress-bar { background: var(--day); }
progress::-webkit-progress-value { background: var(--morning); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--morning); border-radius: 8px; }
.week-days { display: flex; justify-content: space-between; gap: 6px; margin: 22px 0 18px; }
.week-days > div { flex: 1; min-width: 0; display: grid; gap: 10px; justify-items: center; }
.week-days span { color: var(--muted); font-size: 12px; font-weight: 700; }
.week-days i { display: grid; place-items: center; width: 100%; max-width: 40px; aspect-ratio: 1 / 1; border-radius: 50%; background: #fff; border: 1px solid #cdd3cf; color: transparent; font-style: normal; font-size: 15px; }
.week-days i.filled { background: var(--morning); border-color: var(--morning); color: #fff; }
.week-days i.rest { background: transparent; border-style: dashed; border-color: #dfe3e0; }
.week-days i.partial { border: 1.5px dashed var(--morning); }
.rail-card .rail-callout { padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.soft-card { background: var(--day); border-color: var(--day); }
.reminder-nudge .button { margin-top: 10px; }
.reminder-nudge small .text-link { text-decoration: underline; text-underline-offset: 4px; }
.demo-banner, .notice { background: var(--day-50); border: 1px solid var(--day); border-radius: 14px; padding: 14px 18px; font-size: 14px; margin-bottom: 24px; color: var(--text); }
.notice.alert { background: #fbeee5; border-color: #f0cfba; color: #8a4a23; }
.notice .notice-action { margin-left: 10px; padding: 6px 14px; font-size: 13px; vertical-align: middle; }
.notice .notice-note { margin-left: 8px; font-size: 12px; opacity: .8; }
.notice.manager-start { background: var(--day-50); border-color: var(--day); }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.feature-actions form { margin: 0; }
.feature-card .start-anyway { color: inherit; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.lesson-path .start-anyway { color: var(--morning); font-weight: 700; }
.track-preview-banner { border: 1.5px dashed var(--morning); }
.track-preview-banner form { margin: 0 0 0 auto; }
.connection-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; background: var(--day-50); border: 1px solid var(--day); border-radius: 14px; padding: 12px 18px; font-size: 14px; margin-bottom: 24px; color: var(--night); font-weight: 600; }
.connection-banner[hidden] { display: none; }
.connection-banner .text-link { font-size: 14px; }
.offline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.offline-actions button.text-link, .offline-discard { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--morning); font-weight: 700; }
.offline-progress { font-weight: 600; color: var(--night); margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.offline-list-title { font-size: 22px; margin: 30px 0 14px; }
.offline-hub .footnote { margin-top: 26px; }
.offline-result .completion-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; margin-top: 26px; }

/* Tracks, practice, library */
.track-grid, .badge-grid, .source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.track-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; align-items: start; }
.track-card .unit-icon, .review-card .unit-icon, .learning-plan-banner .unit-icon { background: var(--day); }
.track-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; margin-bottom: 26px; }
.track-card h2 { margin: 10px 0; }
.track-card > p:not(.eyebrow) { font-size: 15px; padding-bottom: 24px; }
.track-progress { display: flex; justify-content: space-between; width: 100%; gap: 8px; font-size: 13px; margin: auto 0 10px; color: var(--muted); }
.track-card form, .track-card .button { width: 100%; }
.track-card form { margin-top: 24px; }
.footnote { font-size: 13px; color: var(--muted); margin-top: 26px; }
.empty-state { text-align: center; border: 1px dashed var(--line); border-radius: 22px; padding: 56px 25px; background: var(--card); }
.empty-state > span { display: block; color: var(--morning); font-size: 50px; margin-bottom: 14px; }
.empty-state p { margin: 12px auto 24px; max-width: 480px; }
.practice-callout { padding: 30px 34px; background: var(--day); border-radius: 22px; margin-bottom: 26px; }
.practice-callout h2 { font-size: 30px; font-weight: 300; }
.practice-callout p { margin-top: 10px; max-width: 720px; }
.review-list { display: grid; gap: 14px; }
.review-card { display: flex; align-items: center; gap: 22px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.review-card > div { flex: 1; }
.review-card .eyebrow { margin-bottom: 6px; }
.review-card small { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.review-card > .button { white-space: nowrap; }
.segmented { display: inline-flex; padding: 5px; border-radius: 999px; gap: 4px; margin-bottom: 28px; background: var(--day); }
.segmented a { padding: 12px 26px; font-size: 16px; font-weight: 700; border-radius: 999px; color: var(--night); }
.segmented .selected { background: #fff; box-shadow: 0 1px 3px #2e444718; }
.leaderboard-card { max-width: 1000px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; }
.league-heading { position: relative; overflow: hidden; text-align: center; background: var(--night); color: #fff; padding: 56px 32px 50px; }
.league-badge { position: relative; display: grid; place-items: center; width: 116px; height: 116px; margin: 0 auto 30px; border-radius: 50%; background: var(--day); color: var(--night); }
.league-badge svg { width: 40px; height: 40px; }
.league-heading h2 { position: relative; font-size: 38px; font-weight: 300; color: #fff; letter-spacing: -.2px; }
.league-heading p { position: relative; color: var(--day); font-size: 17px; margin: 12px 0 0; }
.leaderboard-card .empty-state { border: 0; }
.rankings { padding: 22px 26px; margin: 0; list-style: none; display: grid; gap: 4px; }
.rankings li { display: flex; align-items: center; gap: 22px; border-radius: 16px; padding: 22px 26px; font-size: 20px; }
.rankings .is-you { background: var(--day); }
.rank { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--clay); color: var(--night); font-weight: 700; font-size: 17px; }
.is-you .rank { background: var(--morning); color: #fff; }
.rank-xp { margin-left: auto; font-size: 20px; font-weight: 400; white-space: nowrap; color: var(--text); }
.search-form { display: flex; gap: 12px; max-width: 760px; margin-bottom: 24px; }
.search-form input[type=search] { width: 100%; min-width: 0; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 12px 20px; }
.results-count { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.source-card { border: 1px solid var(--line); border-radius: 18px; background: var(--card); padding: 24px; transition: border-color .16s; }
.source-card:hover { border-color: var(--morning); }
.source-kind { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--day); color: var(--night); }
.source-card h3 { margin: 14px 0 8px; }
.source-card p { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 20px; }
.source-document { max-width: 900px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 40px; margin-top: 24px; }
.source-document h1 { font-size: 36px; }
.source-path { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; padding: 12px 0 23px; border-bottom: 1px solid var(--line); }
.source-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.8; margin-top: 28px; color: var(--text); }
.prose { white-space: normal; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 24px; font-weight: 600; letter-spacing: -.2px; margin: 36px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 26px; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 0; }
.prose a { color: var(--morning); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote { margin: 0 0 18px; padding: 4px 18px; border-left: 3px solid var(--morning); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose img { max-width: 100%; border-radius: 12px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--day-50); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--day-50); padding: 16px; border-radius: 12px; overflow-x: auto; margin: 0 0 18px; }
.prose pre code { background: none; padding: 0; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 18px 0 24px; font-size: 14px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-size: 12px; font-weight: 700; color: var(--night); background: var(--day-50); }

/* Profile */
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.profile-stats article { background: var(--card); padding: 28px; border: 1px solid var(--line); border-radius: 20px; }
.profile-stats strong { display: block; color: var(--night); font-size: 48px; font-weight: 300; line-height: 1.1; }
.profile-stats span { font-size: 14px; color: var(--muted); }
.badge-card { text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 20px; padding: 26px; }
.badge-symbol { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--clay); margin: 0 auto 18px; font-size: 30px; color: var(--muted); }
.badge-card.earned { background: var(--day); border: 1px solid var(--day); }
.badge-card.earned .badge-symbol { background: #fff; color: var(--morning); }
.badge-card p { margin: 8px 0; font-size: 14px; }
.badge-card small { font-size: 12px; color: var(--muted); }
.account-card { background: var(--card); padding: 30px; border: 1px solid var(--line); border-radius: 22px; margin-top: 30px; }
.account-card h2 { font-size: 24px; }
.account-card p { color: var(--text); margin: 12px 0; font-size: 15px; }
.account-card form { margin-top: 22px; }

/* Lessons */
.lesson-container { max-width: 760px; margin: 0 auto; }
.lesson-heading { margin: 25px 0; }
.lesson-heading h1 { font-size: 38px; }
.lesson-heading p:not(.eyebrow) { font-size: 17px; }
.lesson-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 21px; }
.lesson-progress span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lesson-step { border: 1px solid var(--line); border-radius: 24px; padding: 40px; background: var(--card); margin-bottom: 18px; }
.lesson-step:focus { outline: none; }
.card-illustration { display: grid; place-items: center; width: 80px; height: 80px; margin-bottom: 26px; background: var(--day); color: var(--night); border-radius: 50%; font-size: 40px; }
.teaching-card h2 { margin: 12px 0 20px; font-size: 34px; font-weight: 300; letter-spacing: -.3px; }
.card-body { font-size: 19px; line-height: 1.65; color: var(--ink); }
.takeaway { display: flex; align-items: center; gap: 15px; padding: 20px; background: var(--day-50); border: 1px solid var(--day); border-radius: 16px; margin-top: 28px; }
.takeaway > span { font-size: 26px; color: var(--morning); }
.takeaway p { font-size: 16px; color: var(--night); font-weight: 600; }
fieldset { padding: 0; margin: 12px 0 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 25px; font-size: 25px; line-height: 1.35; font-weight: 600; letter-spacing: -.3px; }
.answer-options { display: grid; gap: 12px; }
.answer-option { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; cursor: pointer; color: var(--ink); }
.answer-option:hover { background: var(--day-25); }
.answer-option:has(input:checked) { background: var(--day-50); border-color: var(--morning); }
.answer-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.answer-option input { accent-color: var(--morning); width: 18px; height: 18px; flex-shrink: 0; }
.answer-letter { display: none; }
.card-photo, .question-photo { margin: 0 0 22px; }
.card-photo img, .question-photo img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 18px; background: var(--day-25); }
.card-photo figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.feedback-photo { margin: 0 0 14px; }
.feedback-photo img { display: block; width: auto; max-width: 100%; max-height: 180px; height: auto; border-radius: 12px; background: var(--day-25); }
.answer-option.with-photo { align-items: center; }
.option-photo { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; background: var(--day-25); border: 1px solid var(--line); flex-shrink: 0; }
.question-kind { margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.flag-links { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.flag-photo { display: block; max-width: 160px; max-height: 120px; border-radius: 10px; margin: 8px 0; background: var(--day-25); }
.reminder-last { font-size: 14px; color: var(--muted); }
.preview-banner { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: var(--day-50); border: 1px solid var(--morning); font-size: 14px; }
.preview-banner strong { display: block; color: var(--night); }
.preview-banner a { color: var(--morning); }
.question-hint { color: var(--muted); font-size: 14px; margin-top: 22px; }
.answer-feedback { margin-top: 22px; padding: 20px 22px; border-radius: 16px; background: var(--day-50); border: 1px solid var(--day); }
.answer-feedback .eyebrow { margin: 0 0 6px; }
.answer-feedback .feedback-summary { margin: 0 0 10px; font-weight: 600; color: var(--night); }
.answer-feedback .explanation { margin: 0; color: var(--ink); line-height: 1.7; }
.is-wrong .answer-feedback { background: #fdf1ea; border-color: #f3c9ae; }
.is-wrong .answer-feedback .eyebrow { color: var(--focus); }
.is-checked .answer-option { cursor: default; }
.is-checked .answer-option:hover { background: inherit; }
.is-checked .answer-option.option-correct { background: var(--day-50); border-color: var(--morning); box-shadow: inset 0 0 0 1px var(--morning); }
.is-checked .answer-option.option-missed { background: #fdf1ea; border-color: var(--focus); text-decoration: line-through; text-decoration-color: var(--focus); }
.is-checked .answer-option:has(input:checked):not(.option-correct):not(.option-missed) { background: var(--day-25); border-color: var(--line); }
.option-mark { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--morning); white-space: nowrap; }
.ack-hint { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--day); font-weight: 600; color: var(--night); font-variant-numeric: tabular-nums; }
/* Checked answers are disabled, and browsers swallow clicks on disabled inputs; let a tap on the dot reach the label. */
.is-checked .answer-option input { pointer-events: none; }
.is-checked .answer-option.option-pending { opacity: .7; }
.is-checked .answer-option.option-tappable { cursor: pointer; animation: ack-pulse 1.4s ease-in-out infinite; }
.is-checked .answer-option.option-tappable:hover, .is-checked .answer-option.option-tappable:focus-visible { background: var(--day); }
.is-checked .answer-option.option-acknowledged { background: var(--morning); border-color: var(--morning); color: #fff; }
.is-checked .answer-option.option-acknowledged .option-mark { color: #fff; }
@keyframes ack-pulse { 0%, 100% { box-shadow: inset 0 0 0 1px var(--morning), 0 0 0 0 rgba(55, 146, 139, .35); } 50% { box-shadow: inset 0 0 0 1px var(--morning), 0 0 0 8px rgba(55, 146, 139, 0); } }
.option-missed .option-mark { color: var(--focus); }
.answer-error { color: var(--danger); font-size: 14px; margin-top: 16px; }
.lesson-actions { display: flex; justify-content: flex-end; gap: 13px; margin-top: 24px; }
.lesson-actions > button:first-child { margin-right: auto; }
.lesson-actions > button[hidden] + button { margin-left: auto; }
.lesson-sources { margin-top: 29px; color: var(--muted); font-size: 13px; }
.lesson-sources summary { cursor: pointer; padding: 8px 0; }
.lesson-sources li { margin: 7px 0; }
.lesson-sources a { text-decoration: underline; }
.completion-card { text-align: center; padding: 22px 25px 32px; }
.completion-spark { display: inline-grid; place-items: center; width: 100px; height: 100px; background: var(--day); color: var(--night); border-radius: 50%; font-size: 52px; margin-bottom: 23px; animation: spark-in .45s ease-out; }
.completion-card h1 { font-size: 40px; }
.completion-card > p:not(.eyebrow) { font-size: 17px; }
.reward-pill { display: inline-block; color: var(--night); background: var(--day); border-radius: 999px; padding: 12px 28px; font-weight: 300; font-size: 32px; margin: 24px 0 18px; }
.completion-note { font-size: 15px; max-width: 500px; margin: 0 auto; }
.streak-progress { color: var(--morning); font-weight: 700; font-size: 15px; margin: -6px 0 16px; }
.answer-review { display: grid; gap: 18px; }
.feedback-card { padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.feedback-card.incorrect .eyebrow { color: var(--focus); }
.feedback-card h3 { margin: 10px 0 15px; font-size: 21px; }
.feedback-card p:not(.eyebrow) { font-size: 15px; margin-top: 9px; color: var(--text); }
.feedback-card .explanation { padding-top: 15px; border-top: 1px solid var(--line); color: var(--ink) !important; line-height: 1.7; }
.completion-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 29px 0; }
.deeper-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px 30px; margin-top: 26px; }
.deeper-card h3 { font-size: 22px; margin: 6px 0 16px; }
.deeper-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.deeper-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--day-25); transition: border-color .16s, background .16s; }
.deeper-list a:hover { border-color: var(--morning); background: var(--day-50); }
.deeper-list strong { font-size: 16px; color: var(--night); }
.deeper-list .source-kind { flex-shrink: 0; }
.deeper-list .doc-link-mark { margin-left: auto; color: var(--morning); font-weight: 700; }
.doc-links { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.doc-link { color: var(--morning); font-weight: 700; }
.doc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.answer-feedback .doc-links { margin-top: 8px; }

/* Sign in */
.sign-in-shell { position: relative; min-height: 100dvh; padding: 60px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sand); }
.sign-in-shell { overflow: hidden; }
.sign-in-shell::before { content: ""; position: absolute; inset: 0; background: var(--curve) no-repeat center / cover; pointer-events: none; }
.sign-in-shell::after { content: ""; position: absolute; right: -40px; top: 50%; width: 520px; height: 324px; transform: translateY(-62%); background: url("/brand/nobi_lamp_outline.svg") no-repeat center / contain; opacity: .38; pointer-events: none; }
.sign-in-card { position: relative; width: min(100%, 550px); text-align: center; background: var(--card); padding: 24px 44px 34px; border: 1px solid var(--line); border-radius: 26px; }
.sign-in-card .brand { justify-content: center; padding: 18px 0 24px; }
.spark-orbit { display: inline-grid; place-items: center; width: 86px; height: 86px; background: var(--day); border-radius: 50%; color: var(--night); font-size: 44px; margin: 14px 0 28px; }
.sign-in-card h1 { font-size: 44px; margin: 13px 0 22px; }
.sign-in-card > p:not(.eyebrow) { line-height: 1.7; font-size: 16px; }
.sign-in-card form { margin: 24px 0 13px; }
.sign-in-card .button { width: 100%; }
.sign-in-card small { font-size: 12px; color: var(--muted); }
.sign-in-card .notice { margin: 25px 0 0; }
.sign-in-promises { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 22px; font-size: 12px; color: var(--muted); }
turbo-frame { display: block; }
.turbo-progress-bar { background-color: var(--morning); height: 3px; }
@keyframes spark-in { from { transform: scale(.7) rotate(-15deg); opacity: .2; } to { transform: scale(1) rotate(0); opacity: 1; } }

/* Flags */
.flag-link { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.flag-link:hover { color: var(--morning); }
.flag-row { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.flag-row .flag-link { margin-top: 0; }
.flag-card { max-width: 720px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 36px; margin-top: 24px; }
.flag-card h1 { font-size: 36px; }
.flag-card .flag-intro { margin: 4px 0 22px; }
.flag-subject { margin: 0 0 24px; padding: 18px 20px; border-left: 3px solid var(--morning); background: var(--day-25); border-radius: 0 14px 14px 0; font-size: 14px; }
.flag-subject small { display: block; font-size: 13px; font-weight: 700; color: var(--morning); margin-bottom: 6px; }
.flag-subject strong { display: block; font-size: 16px; margin-bottom: 8px; }
.flag-subject p { margin: 6px 0; color: var(--text); }
.flag-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.flag-form textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); resize: vertical; }
.flag-form .lesson-actions { margin-top: 18px; }
.flag-history .flag-item { padding: 18px 0 6px; border-top: 1px solid var(--line); }
.flag-item header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flag-status { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #fbeee5; color: #8a4a23; white-space: nowrap; }
.flag-status.checked { background: var(--day); color: var(--night); }
.account-card .flag-message { color: var(--ink); font-style: italic; }
.account-card .flag-reply { background: var(--day-50); padding: 12px 16px; border-radius: 12px; color: var(--ink); }
.flag-item small { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.flag-item small .text-link { font-size: 13px; margin-left: 4px; }

/* Install and reminders */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 6; display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px #2e444726; }
.install-banner--app { bottom: calc(86px + env(safe-area-inset-bottom)); }
.install-banner img { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.install-text strong { display: block; font-size: 15px; margin-bottom: 3px; }
.install-text p { color: var(--text); }
.install-text p strong { display: inline; font-size: inherit; margin: 0; color: var(--ink); }
.install-share { display: inline-block; font-size: 15px; color: var(--morning); }
.install-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex-shrink: 0; }
.install-banner .button { min-height: 42px; padding: 8px 20px; font-size: 14px; }
.install-dismiss { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.install-inline { margin-top: 18px; }
.install-inline p { margin: 0; }
.reminder-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.account-card .reminder-status { color: var(--morning); font-weight: 700; }
.account-card .reminder-hint { color: #8a4a23; }
.reminder-time-form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.reminder-time-form label { font-size: 15px; font-weight: 700; }
.reminder-time-form select { font-size: 15px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.reminder-prompt-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--clay); flex-shrink: 0; }
.reminder-prompt-icon .flame { width: 20px; height: 22px; }
.reminder-prompt .reminder-status { color: var(--morning); font-weight: 700; margin-top: 4px; }

/* Responsive */
@media (min-width: 768px) { .install-banner, .install-banner--app { left: auto; right: 24px; bottom: 24px; max-width: 430px; } }
@media (min-width: 1550px) { .workspace { padding-top: 52px; } .feature-card { min-height: 325px; } }
@media (max-width: 1250px) {
 .app-shell { grid-template-columns: 218px minmax(0, 1fr); } .workspace { padding: 30px 28px 60px; } .topbar { padding: 0 28px; } .dashboard-grid { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; } .track-grid, .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .feature-card { padding: 30px; } .path-unit { padding: 26px 28px; } .lesson-path { padding: 22px 28px 26px; } .rail-card { padding: 24px; } }
@media (max-width: 1050px) { .dashboard-grid { grid-template-columns: 1fr; } .right-rail { grid-template-columns: 1fr 1fr; } .feature-text { max-width: 80%; } .badge-grid { grid-template-columns: 1fr 1fr; } .review-card { flex-wrap: wrap; } .review-card > div { min-width: 60%; } .review-card > .button { margin-left: 80px; } }
@media (max-width: 767px) {
  .profile-stats, .profile-stats.four { grid-template-columns: 1fr 1fr; }
  .person-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .celebration-stats article { min-width: 100px; padding: 12px 16px; }

  .app-shell { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; top: auto; bottom: 0; height: auto; width: 100%; z-index: 5; border-right: 0; border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); overflow: visible; }
  .sidebar > :not(.main-nav) { display: none; }
  .main-nav { display: flex; justify-content: space-around; padding: 0; gap: 2px; }
  .main-nav a { display: flex; flex-direction: column; gap: 4px; padding: 8px 5px; border-radius: 12px; flex: 1 1 0; min-width: 0; font-size: 10px; }
  .main-nav a > span:first-child { font-size: 22px; }
  .topbar { height: 66px; padding: 0 16px; gap: 10px; }
  .topbar-title { font-size: 16px; }
  .top-stats { gap: 8px; }
  .stat-chip { padding: 8px 12px; font-size: 13px; gap: 6px; }
  .top-stats .avatar { width: 34px; height: 34px; font-size: 13px; }
  .workspace { padding: 26px 18px 40px; }
  h1 { font-size: 36px; letter-spacing: -.3px; }
  h2 { font-size: 23px; }
  .page-heading { margin-bottom: 24px; }
  .page-heading p:not(.eyebrow) { font-size: 15px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 28px; }
  .section-heading .text-link { font-size: 13px; min-width: 71px; text-align: right; }
  .feature-card { padding: 26px 23px; border-radius: 20px; min-height: auto; }
  .feature-text { max-width: 100%; }
  .feature-card h2 { font-size: 32px; }
  .lamp-art { width: 165px; height: 165px; right: -38px; opacity: .15; }
  .feature-meta { gap: 10px; font-size: 12px; }
  .path-unit { padding: 22px 18px; gap: 14px; }
  .unit-icon { width: 48px; height: 48px; font-size: 20px; }
  .path-unit h3 { font-size: 19px; }
  .path-unit p:last-child { font-size: 14px; }
  .unit-number { display: none; }
  .lesson-path { padding: 18px 18px 22px; }
  .path-row { gap: 16px; min-height: 100px; }
  .path-node { width: 62px; height: 62px; font-size: 19px; }
  .path-row-1 { margin-left: 22px; }
  .path-row-2 { margin-left: 44px; }
  .path-row h4 { font-size: 17px; }
  .path-row small, .path-row span:not(.path-node) { font-size: 13px; }
  .right-rail, .track-grid, .source-grid { grid-template-columns: 1fr; }
  .rail-card { padding: 22px; }
  .rail-card h3 { font-size: 20px; }
  .big-number { font-size: 44px; }
  .week-days i { max-width: 36px; }
  .track-card { padding: 23px; }
  .review-card { padding: 20px; gap: 15px; }
  .review-card > .unit-icon { display: none; }
  .review-card > .button { margin-left: 0; }
  .review-card h3 { font-size: 16px; }
  .practice-callout { padding: 24px; }
  .practice-callout h2 { font-size: 26px; }
  .segmented { display: flex; }
  .segmented a { flex: 1 1 auto; padding: 10px 12px; font-size: 14px; text-align: center; white-space: nowrap; }
  .league-heading { padding: 40px 22px 34px; }
  .league-badge { width: 88px; height: 88px; margin-bottom: 22px; }
  .league-heading h2 { font-size: 28px; }
  .league-heading p { font-size: 14px; }
  .rankings { padding: 10px; }
  .rankings li { gap: 14px; padding: 16px 14px; font-size: 16px; }
  .rank { width: 36px; height: 36px; font-size: 14px; }
  .rank-xp { font-size: 15px; }
  .search-form { gap: 7px; }
  .search-form .button { padding: 11px 16px; }
  .search-form input { font-size: 14px; }
  .source-document { padding: 24px; }
  .source-document h1 { font-size: 30px; }
  .source-body { font-size: 15px; }
  .profile-stats { gap: 9px; }
  .profile-stats article { padding: 16px 13px; }
  .profile-stats strong { font-size: 32px; }
  .profile-stats span { font-size: 11px; }
  .badge-grid { gap: 12px; }
  .badge-card { padding: 22px 13px; }
  .badge-card h3 { font-size: 16px; }
  .badge-card p { font-size: 12px; }
  .badge-card small { font-size: 10px; }
  .lesson-heading h1 { font-size: 30px; }
  .lesson-step { padding: 24px; border-radius: 20px; }
  .teaching-card h2 { font-size: 28px; }
  .card-body { font-size: 17px; }
  .card-illustration { width: 64px; height: 64px; font-size: 32px; }
  legend { font-size: 22px; }
  .answer-option { padding: 14px 13px; gap: 11px; font-size: 15px; }
  .takeaway { padding: 16px; gap: 10px; }
  .takeaway p { font-size: 14px; }
  .lesson-actions .button { padding: 11px 18px; font-size: 14px; }
  .completion-card { padding: 17px 8px 26px; }
  .completion-card h1 { font-size: 32px; }
  .reward-pill { font-size: 26px; }
  .feedback-card { padding: 22px; }
  .sign-in-shell { padding: 28px 17px; }
  .sign-in-shell::after { width: 300px; height: 187px; right: -90px; top: auto; bottom: -30px; transform: none; opacity: .3; }
  .sign-in-card { padding: 22px 25px 28px; }
  .sign-in-card h1 { font-size: 36px; }
  .flag-card { padding: 22px; }
  .flag-card h1 { font-size: 28px; }
  .learning-plan-banner { flex-wrap: wrap; }
  .learning-plan-banner a { margin-left: 74px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.sidebar .brand { padding-left: 20px; padding-right: 18px; gap: 10px; }
.sidebar .brand img { width: 72px; }
.sidebar .brand span { font-size: 20px; padding-left: 10px; }

.scope-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.scope-list li { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--day-25); }
.scope-list strong { font-size: 14px; }
.scope-list span { font-size: 14px; color: var(--text); }
.oauth-consent .lesson-actions form { display: inline; }
.round-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 4px; font-size: 14px; }
.round-status strong { color: var(--morning); }
.practice-callout .practice-start { margin-top: 18px; }
.lesson-actions .round-stop { order: -1; margin-right: auto; align-self: center; }
.lesson-form .flag-links { margin-top: 18px; }
.flag-inline { margin-top: 14px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.flag-inline h3 { margin: 2px 0 6px; }
.flag-inline .flag-inline-intro { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.flag-inline .notice { margin: 0; }
.lesson-form .flag-links .flag-link { margin-top: 0; }
/* On a phone the lesson gets the whole screen: no top bar, back link, title or hook; the unit name and progress bar stay. */
@media (max-width: 767px) {
  body:has(.lesson-form) .topbar { display: none; }
  body:has(.lesson-form) .workspace { padding-top: 14px; }
  .lesson-container:has(.lesson-form) .lesson-back { display: none; }
  .lesson-container:has(.lesson-form) .round-status { margin-top: 0; }
  .lesson-container:has(.lesson-form) .lesson-heading { margin: 0 0 12px; }
  .lesson-container:has(.lesson-form) .lesson-heading h1, .lesson-container:has(.lesson-form) .lesson-heading p:not(.eyebrow) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
}
.track-requires { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.track-requires .fa-lock { margin-right: 6px; font-size: 12px; }
.rank-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rank-streak { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.rank-streak .flame { width: 13px; height: 13px; }
.rank-days { display: inline-flex; align-items: center; gap: 6px; }
.rank-days .flame { width: 18px; height: 18px; }
.time-zone-form { margin-top: 14px; }
.time-zone-form select { max-width: 100%; }
.time-zone-note { font-size: 14px; color: var(--muted); }

/* Celebrations after a submission: the XP run and the Night takeover (celebrate_controller.js). */
.stat-roll { display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; vertical-align: bottom; }
.stat-roll > span { display: block; transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); }
.stat-roll.up > span { transform: translateY(-1.25em); }
.stat-roll i { display: block; font-style: normal; }
.stat-chip { transition: background-color .3s; }
.stat-chip.flash-streak { background: #fde3d1; }
.stat-chip.flash-xp { background: #bfe0d8; }
.celebrate-xp-token, .celebrate-sparkle, .celebrate-spark { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; }
.celebrate-xp-token { white-space: nowrap; background: var(--morning); color: #fff; font-weight: 800; font-size: 15px; border-radius: 999px; padding: 7px 14px; box-shadow: 0 0 0 4px rgba(55, 146, 139, .18), 0 8px 18px -8px rgba(46, 68, 71, .6); }
.celebrate-xp-token b { margin-right: 4px; }
.celebrate-sparkle { color: var(--morning); font-size: 13px; line-height: 1; }
.celebrate-spark { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #f6b544; }
.celebrate-spark.mint { background: var(--morning); }
.celebrate-takeover { position: fixed; inset: 0; z-index: 70; background: var(--night); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; clip-path: circle(0px at 50% 60%); }
.celebrate-takeover.open { clip-path: none; }
.celebrate-takeover canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.celebrate-takeover > :not(canvas) { position: relative; }
.celebrate-flame { width: 120px; height: 144px; transform: scale(0); filter: drop-shadow(0 0 28px rgba(246, 181, 68, .5)); }
.celebrate-takeover.open .celebrate-flame { transform: none; }
.celebrate-flame svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 90%; animation: celebrate-flicker .22s ease-in-out infinite alternate; }
.celebrate-number { font-size: 120px; font-weight: 300; line-height: 1; letter-spacing: -3px; }
.celebrate-number .stat-roll { height: 1.05em; line-height: 1.05em; }
.celebrate-number .stat-roll > span { transition-duration: .65s; }
.celebrate-number .stat-roll.up > span { transform: translateY(-1.05em); }
.celebrate-what { color: #f6b544; font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.celebrate-bye { color: #d7e0dc; font-size: 17px; }
.celebrate-keep { margin-top: 22px; border: 0; border-radius: 999px; background: #fff; color: var(--night); font-weight: 700; font-size: 16px; padding: 14px 34px; }
.celebrate-keep:focus-visible { outline: 3px solid #f6b544; outline-offset: 4px; }
@keyframes celebrate-flicker { from { transform: scale(1, 1) skewX(-2deg); } to { transform: scale(.96, 1.06) skewX(2deg); } }
@media (max-width: 767px) { .celebrate-flame { width: 92px; height: 110px; } .celebrate-number { font-size: 84px; } .celebrate-what { font-size: 17px; } .celebrate-bye { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .celebrate-flame svg { animation: none; } .stat-roll > span { transition: none; } }

/* Agreed flags: the thank-you on the home page, the hint on the flag form, the profile tally. */
.flag-thanks { margin-bottom: 22px; background: var(--card); border: 1px solid #cfe5dc; border-radius: 22px; padding: 22px 26px; display: grid; gap: 10px; box-shadow: 0 14px 28px -24px rgba(46, 68, 71, .5); }
.flag-thanks .eyebrow { color: var(--morning); }
.flag-thanks h2 { font-size: 22px; }
.flag-thanks-reply { background: #f6f7f3; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.flag-thanks-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flag-thanks .reward-pill { margin: 0; font-size: 24px; padding: 8px 20px; }
.flag-reward-hint { display: flex; align-items: center; gap: 10px; margin-top: 14px; background: #eef6f2; border: 1px solid #cfe5dc; border-radius: 14px; padding: 10px 14px; font-size: 14px; color: #2c6a47; font-weight: 600; }
.flag-reward-hint strong { background: var(--morning); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; white-space: nowrap; }
.flag-status.agreed { background: #dcefe3; color: #2c6a47; }
.flag-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.flag-tally div { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; }
.flag-tally strong { font-size: 24px; font-weight: 300; }
.flag-tally span { font-size: 12px; font-weight: 700; color: var(--muted); }
@media (max-width: 767px) { .flag-thanks { padding: 18px; } .flag-thanks h2 { font-size: 19px; } }

/* Today's goal: the streak goal as a ring of four, with the XP earned today below. */
.today-goal { display: grid; gap: 14px; }
.today-goal h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.today-goal h3 small { display: inline; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.today-goal p { margin: 0; }
.today-goal.secured { border-color: #f3cdb3; background: linear-gradient(180deg, #fff8f2, var(--card) 60%); }
.today-goal.secured h3 small { color: var(--focus); }
.goal-ring-row { display: flex; align-items: center; gap: 16px; }
.goal-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.streak-ring-arcs { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring-flame { position: absolute; inset: 0; display: grid; place-items: center; }
.goal-ring-flame .flame { width: 28px; height: 34px; color: #d8dcd6; }
.goal-ring-flame.lit .flame { color: var(--focus); }
.goal-ring-text strong { display: block; font-size: 34px; font-weight: 300; line-height: 1; }
.goal-ring-text strong small { display: inline; margin: 0; font-size: 16px; font-weight: 400; color: var(--muted); }
.goal-ring-text span { display: block; margin-top: 4px; font-size: 14px; color: var(--text); }
.goal-ring-text span.secured { color: var(--focus); font-weight: 700; }
.goal-xp { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.goal-xp span { font-size: 14px; font-weight: 600; color: var(--muted); }
.goal-xp strong { font-size: 26px; font-weight: 300; }
.goal-xp em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--morning); }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.video-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; color: inherit; }
a.video-card:hover { border-color: var(--morning); }
.video-poster { position: relative; aspect-ratio: 16 / 9; background: var(--night); overflow: hidden; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-play, .video-lock { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--night); font-size: 20px; padding-left: 4px; }
.video-lock { padding-left: 0; font-size: 18px; }
.video-duration { position: absolute; right: 12px; bottom: 12px; padding: 3px 9px; border-radius: 8px; background: rgba(46, 68, 71, .85); color: white; font-size: 13px; font-weight: 600; }
.video-progress { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--focus); }
.video-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; align-items: start; }
.video-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.video-card.done .video-status { background: var(--morning); color: white; }
.video-card.locked { background: var(--clay); color: var(--muted); }
.video-card.locked .video-poster { filter: grayscale(1); opacity: .45; }
.video-card.locked h3 { color: var(--muted); }
.video-locked-note { font-size: 14px; font-weight: 600; color: var(--muted); }
.video-locked-note .fa-lock { font-size: .85em; margin-right: 4px; }
.back-row { margin-bottom: 18px; }
.video-stage { max-width: 860px; margin-top: 22px; }
.video-player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 18px; display: block; }
.video-watch-bar { height: 6px; border-radius: 999px; background: var(--day-50); margin: 14px 0 10px; overflow: hidden; }
.video-watch-bar span { display: block; height: 100%; background: var(--morning); transition: width .4s ease; }
.video-watch-status { font-weight: 600; }
.video-next { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.video-description { max-width: 860px; margin-top: 26px; }
.video-description p + p { margin-top: 10px; }
.track-videos { padding: 20px 22px; display: grid; gap: 10px; }
.track-video-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; color: inherit; }
a.track-video-row:hover { background: var(--day-25); }
.track-video-row .path-node { width: 46px; height: 46px; flex: none; font-size: 15px; }
.track-video-row strong { display: block; }
.track-video-row small { color: var(--muted); font-weight: 600; }
@media (max-width: 1050px) { .video-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .video-grid { grid-template-columns: 1fr; } .video-player { border-radius: 12px; } }
