/* Reel Study hub: home, courses, course and module pages, progress and profile.
   The learning player keeps feed.css and question-ui.css; it never loads this file. */

.hub {
  --surface: #ffffff;
  --canvas: #f1f1f5;
  --ink: #131316;
  --ink-soft: #3c3c46;
  --muted: #6b6b77;
  --hairline: #e6e6ec;
  --row: #f4f4f7;
  --row-hover: #ebebf1;
  --butter-1: #fff6d3;
  --butter-2: #f8da6e;
  --lilac-1: #efecff;
  --lilac-2: #bfb5f8;
  --mint-1: #e3f6ed;
  --mint-2: #a5dcc4;
  --violet: #5a49d6;
  --violet-deep: #3a2bab;
  --violet-soft: #c9c1fb;
  --success: #16805a;
  --success-soft: #dcf2e8;
  --danger-soft: #fff1f3;
  --shadow: 0 22px 44px -24px rgba(36, 28, 92, .34), 0 2px 8px rgba(36, 28, 92, .05);
  --page-x: 20px;
  --nav-space: calc(108px + env(safe-area-inset-bottom));
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Resets carry zero class specificity through :where(), so every component rule below overrides them. */
:where(.hub) *, :where(.hub) *::before, :where(.hub) *::after { box-sizing: border-box; }
:where(.hub) :where(h1, h2, h3, p, dl, dd, figure) { margin: 0; }
:where(.hub) :where(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(.hub) a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(.hub) :where(button, input) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.hub) button { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(.hub) :where(img, svg) { display: block; max-width: 100%; }
:where(.hub) .i { width: 20px; height: 20px; flex: none; }
.hub [hidden] { display: none !important; }
.hub :focus { outline: none; }
.hub :focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 60; top: -120px; left: 12px; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; }
.skip-link:focus { top: calc(12px + env(safe-area-inset-top)); }

/* Shell: floating bottom bar on phones and tablets, quiet sidebar on desktop. */
.hub-app { min-height: 100vh; min-height: 100dvh; }
.hub-main {
  display: block; width: 100%; max-width: 760px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) max(var(--page-x), env(safe-area-inset-right)) var(--nav-space) max(var(--page-x), env(safe-area-inset-left));
}
.hub-nav { position: fixed; z-index: 40; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 420px); transform: translateX(-50%); }
.hub-nav > .hub-brand, .hub-nav-note { display: none; }
.hub-nav-list {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px;
  border-radius: 999px; background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: inset 0 0 0 1px rgba(19, 19, 22, .06), 0 16px 36px -16px rgba(36, 28, 92, .38), 0 2px 6px rgba(19, 19, 22, .06);
}
.hub-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.2; transition: background-color .2s ease, color .2s ease; }
.hub-nav-link .i { width: 22px; height: 22px; }
.hub-nav-link[aria-current="page"] { background: var(--ink); color: #fff; }
.hub-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.035em; }
.hub-brand img { width: 30px; height: 30px; }
.page { min-width: 0; }

/* Type */
.display { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.06; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.lede { margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 56ch; }
.kicker { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.4; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 40px 0 14px; }
.section-title { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.section-note { color: var(--muted); font-size: 13px; font-weight: 600; text-align: right; }
.text-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--ink-soft); font-size: 14px; font-weight: 600; white-space: nowrap; }
.text-link .i { width: 16px; height: 16px; }
.text-link:hover { color: var(--ink); }
.card-note { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Controls */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-size: 16px; font-weight: 600; line-height: 1.2; text-align: center; transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease; }
.pill .i { width: 18px; height: 18px; }
.pill:active { transform: scale(.98); }
.pill--ink { background: var(--ink); color: #fff; }
.pill--ink:hover { background: #2b2b33; }
.pill--soft { background: var(--row); color: var(--ink); }
.pill--soft:hover { background: var(--row-hover); }
.pill--outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hairline); }
.pill--outline:hover { box-shadow: inset 0 0 0 1.5px #cfcfd8; }
.pill--block { display: flex; width: 100%; }
.pill--sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.pill:disabled { opacity: .5; cursor: default; transform: none; }
.circle { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); transition: background-color .2s ease; }
.circle:hover { background: var(--row); }
.circle--glass { background: rgba(255, 255, 255, .64); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.circle--glass:hover { background: rgba(255, 255, 255, .85); }
.tag { display: inline-flex; align-items: center; gap: 7px; width: fit-content; min-height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.tag::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.tag--live::before { background: var(--success); }
.tag--progress::before { background: var(--violet); }
.tag--soon::before { background: #d6940e; }
.tag--muted { background: var(--row); color: var(--ink-soft); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(150deg, #f6f3ff, var(--lilac-2)); color: var(--violet-deep); font-size: 18px; font-weight: 700; }
.avatar .i { width: 22px; height: 22px; }
.avatar--lg { width: 84px; height: 84px; font-size: 34px; background: linear-gradient(150deg, #fff, #d9d2ff); box-shadow: 0 12px 24px -14px rgba(58, 43, 171, .55); }
.avatar--lg .i { width: 38px; height: 38px; }
.avatar-link { display: inline-flex; border-radius: 50%; }

.search { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--row); transition: background-color .2s ease, box-shadow .2s ease; }
.search:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.search > .i { color: var(--muted); }
.search-input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; -webkit-appearance: none; appearance: none; }
.search-input::placeholder { color: #85858f; opacity: 1; }
.search-input::-webkit-search-cancel-button, .search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search .search-input:focus-visible { outline: none; }
.search .circle { box-shadow: 0 1px 3px rgba(19, 19, 22, .1); }
.search-clear[hidden] { display: none; }

.chips { display: flex; gap: 8px; margin: 0 calc(-1 * var(--page-x)); padding: 2px var(--page-x); overflow-x: auto; scroll-padding-inline: var(--page-x); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--hairline); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.chip:hover { background: var(--row); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.chips--quiet .chip { padding: 0 15px; font-size: 13px; }
.chips--quiet .chip[aria-pressed="true"] { background: var(--lilac-1); color: var(--violet-deep); box-shadow: inset 0 0 0 1.5px var(--violet-soft); }

/* Course cards: ref-style tinted cards with dimensional art and a frosted call to action. */
.tone-butter { background: radial-gradient(120% 95% at 88% 6%, #fffcef 0%, rgba(255, 252, 239, 0) 52%), linear-gradient(160deg, var(--butter-1), var(--butter-2)); }
.tone-lilac { background: radial-gradient(120% 95% at 88% 6%, #fbfaff 0%, rgba(251, 250, 255, 0) 52%), linear-gradient(160deg, var(--lilac-1), var(--lilac-2)); }
.tone-mint { background: radial-gradient(120% 95% at 88% 6%, #f6fffa 0%, rgba(246, 255, 250, 0) 52%), linear-gradient(160deg, var(--mint-1), var(--mint-2)); }
.course-card { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 232px; padding: 22px 22px 16px; border-radius: 30px; overflow: hidden; color: var(--ink); transition: transform .25s ease, box-shadow .25s ease; }
.course-card-text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 62%; margin-bottom: 18px; }
.course-card-title { font-size: 27px; line-height: 1.04; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.course-card-sub { color: var(--ink-soft); font-size: 14px; font-weight: 500; line-height: 1.35; }
.course-card .tag { margin-top: 8px; }
.course-card .meter { width: 100%; max-width: 150px; margin-top: 6px; }
.course-card-art { position: absolute; z-index: 0; top: 6%; right: -5%; width: 54%; max-width: 250px; height: auto; pointer-events: none; filter: drop-shadow(0 18px 20px rgba(40, 30, 10, .14)); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.course-card-cta { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; min-height: 50px; margin-top: auto; border-radius: 999px; background: rgba(255, 255, 255, .44); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .75), 0 8px 20px -12px rgba(19, 19, 22, .28); font-size: 15px; font-weight: 600; }
.course-grid { display: grid; gap: 14px; }
.course-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 80%); gap: 14px; margin: 0 calc(-1 * var(--page-x)); padding: 4px var(--page-x) 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--page-x); scrollbar-width: none; }
.course-rail::-webkit-scrollbar { display: none; }
.course-rail > * { scroll-snap-align: start; }

/* Progress primitives */
.arc { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.arc-svg { width: 100%; height: auto; overflow: visible; }
.arc-seg { stroke: #fff; stroke-linecap: round; }
.arc-seg.is-part { stroke: var(--violet-soft); }
.arc-seg.is-done { stroke: var(--violet); }
.arc-center { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.arc-center strong { font-size: 46px; line-height: 1; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.arc-center span { max-width: 13ch; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.3; }
.arc--lg { max-width: 340px; }
.arc--lg .arc-center strong { font-size: 58px; }
.seg-bar { display: flex; gap: 3px; }
.seg { flex: 1 1 0; min-width: 2px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .78); }
.seg.is-part { background: rgba(90, 73, 214, .42); }
.seg.is-done { background: var(--ink); }
.seg-bar--plain .seg { background: var(--row-hover); }
.seg-bar--plain .seg.is-part { background: var(--violet-soft); }
.seg-bar--plain .seg.is-done { background: var(--violet); }
.meter { height: 6px; border-radius: 99px; background: rgba(19, 19, 22, .1); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.meter--violet { background: var(--row-hover); }
.meter--violet > span { background: var(--violet); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface); stroke-width: 4; }
.ring-value { fill: none; stroke: var(--violet); stroke-width: 4; stroke-linecap: round; }
.ring.is-complete .ring-value { stroke: var(--success); }
.ring-label { position: relative; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-label small { font-size: 8px; }
.ring-check { position: relative; width: 18px; height: 18px; color: var(--success); }

/* Notices and loading */
.notice { display: grid; justify-items: start; gap: 6px; padding: 22px; border-radius: 26px; background: var(--danger-soft); }
.notice--info { background: var(--row); }
.notice-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.notice-copy { color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.notice .pill { margin-top: 10px; }
.skeleton-stack { display: grid; gap: 14px; }
.skeleton { border-radius: 28px; background: linear-gradient(100deg, var(--row) 35%, #fafafc 50%, var(--row) 65%) 0 0 / 300% 100%; }
.skeleton--spotlight { height: 252px; }
.skeleton--arc { height: 270px; }
.skeleton--card { height: 232px; }
.skeleton--row { height: 76px; border-radius: 22px; }
.skeleton--facts { height: 160px; border-radius: 24px; }

/* Home */
.home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand avatar" "hello hello" "search search"; align-items: center; gap: 0 12px; }
.home-brand { grid-area: brand; justify-self: start; }
.home-avatar { grid-area: avatar; }
.home-hello { grid-area: hello; margin: 22px 0 18px; }
.home-search { grid-area: search; }
.hello-line { color: var(--ink-soft); font-size: 17px; font-weight: 600; }
.home-hello .display { margin-top: 4px; }
.home-grid { display: grid; gap: 16px; margin-top: 26px; }
.home-courses.has-mine .course-grid { grid-template-columns: minmax(0, 1fr); }
.home-foot { margin: 36px auto 0; max-width: 40ch; color: var(--muted); font-size: 13px; text-align: center; }
.home-foot a { text-decoration: underline; text-underline-offset: 3px; }

.spotlight { position: relative; display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: 16px 16px; padding: 14px; border-radius: 30px; background: radial-gradient(130% 120% at 100% 0%, #f8f6ff 0%, rgba(248, 246, 255, 0) 55%), linear-gradient(150deg, #e7e2ff, #c4baf8); }
.spotlight.tone-butter { background: radial-gradient(130% 120% at 100% 0%, #fffcef 0%, rgba(255, 252, 239, 0) 55%), linear-gradient(150deg, var(--butter-1), var(--butter-2)); }
.spot-poster { position: relative; display: block; align-self: start; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; background: #efe9dc; box-shadow: 0 14px 26px -16px rgba(36, 28, 92, .6); }
.spot-poster img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.spot-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(19, 19, 22, .6); color: #fff; transform: translate(-50%, -50%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.spot-play .i { width: 18px; height: 18px; margin-left: 2px; }
.spot-body { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.spot-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.spot-kicker { padding-top: 3px; color: var(--violet-deep); font-size: 13px; font-weight: 700; line-height: 1.3; }
.spotlight.tone-butter .spot-kicker { color: #7a5600; }
.spot-module { margin-top: 2px; color: var(--ink-soft); font-size: 13px; font-weight: 500; line-height: 1.35; }
.spot-title { margin-top: 8px; font-size: 21px; line-height: 1.14; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spot-meta { margin-top: 6px; color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.spot-body .seg-bar { margin-top: auto; padding-top: 14px; }
.spot-percent { margin-top: 8px; font-size: 13px; font-weight: 600; }
.spotlight > .pill { grid-column: 1 / -1; }
.spotlight--done { grid-template-columns: 1fr; padding: 22px; }

.progress-card { display: flex; flex-direction: column; padding: 18px 18px 18px; border-radius: 30px; background: var(--row); }
.progress-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.progress-card > .arc { margin: auto; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mini-stat { min-width: 0; padding: 12px 10px 12px 12px; border-radius: 18px; background: var(--surface); }
.mini-stat dt { color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.mini-stat dd { margin-top: 4px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mini-stat dd small { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.card-retry { align-self: flex-start; margin-top: 12px; }

/* Course overview */
.split { display: grid; gap: 0 56px; }
.split-aside, .split-main { min-width: 0; }
.course-hero { position: relative; display: grid; place-items: center; min-height: 272px; margin: calc(-14px - env(safe-area-inset-top)) calc(-1 * var(--page-x)) 0; padding: calc(62px + env(safe-area-inset-top)) 24px 22px; border-radius: 0 0 36px 36px; overflow: hidden; }
.course-hero-art { width: min(66%, 290px); height: auto; filter: drop-shadow(0 24px 28px rgba(40, 30, 10, .16)); }
.hero-back { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: var(--page-x); }
.course-intro { padding-top: 22px; }
.course-intro .display { margin-top: 6px; }
.course-sub { margin-top: 6px; color: var(--ink-soft); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.course-desc { margin-top: 12px; max-width: 58ch; color: var(--muted); font-size: 15.5px; }
.course-facts { display: grid; gap: 14px; margin-top: 22px; }
.availability { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.availability strong { color: var(--ink); }
.progress-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; }
.progress-line span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-block { display: grid; gap: 8px; }
.resume-note { color: var(--muted); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.stat-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
.stat-item { display: flex; align-items: center; min-width: 0; padding: 6px 8px; }
.stat-item + .stat-item { padding-left: 14px; border-left: 1px solid var(--hairline); }
.stat-item dd { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.stat-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--hairline); }
.stat-icon .i { width: 18px; height: 18px; }
.volume-title { margin: 22px 0 10px; color: var(--muted); font-size: 13px; font-weight: 600; }

.module-list { display: grid; gap: 10px; }
.module-row { border-radius: 22px; background: var(--row); }
.module-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 14px; border-radius: 22px; color: var(--ink); text-align: left; transition: background-color .2s ease; }
a.module-head:hover, button.module-head:hover { background: var(--row-hover); }
.module-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.module-row[data-state="in-production"] .module-num { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--hairline); }
.module-row[data-state="error"] .module-num { background: var(--surface); color: var(--ink-soft); }
.module-title { display: block; font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.module-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.module-row[data-state="in-production"] .module-title { color: var(--ink-soft); }
.module-chevron { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); }
.module-chevron .i { width: 16px; height: 16px; transition: transform .25s ease; }
.module-head[aria-expanded="true"] .module-chevron .i { transform: rotate(180deg); }
.module-panel { padding: 0 10px 12px; }
.module-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 12px; }
.module-panel .lesson-row { background: var(--surface); }
.module-panel .lesson-row:hover { background: #fbfbfd; }
.module-error-action { grid-column: 2 / -1; justify-self: start; }

/* Module detail */
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-crumb { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: 15px; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.detail-top-spacer { width: 44px; flex: none; }
.intro-card { margin-top: 18px; padding: 20px; border-radius: 28px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
.intro-card .tag { margin-bottom: 12px; }
.poster-fan { display: flex; justify-content: center; height: 140px; margin: 2px 0 18px; }
.poster-fan img { width: 78px; height: 138px; border: 3px solid #fff; border-radius: 18px; background: var(--row); object-fit: cover; box-shadow: 0 14px 24px -14px rgba(36, 28, 92, .55); }
.poster-fan img:nth-child(1) { transform: rotate(-9deg) translate(16px, 8px); }
.poster-fan img:nth-child(2) { position: relative; z-index: 1; }
.poster-fan img:nth-child(3) { transform: rotate(9deg) translate(-16px, 8px); }
.detail-title { margin-top: 6px; font-size: clamp(25px, 7vw, 32px); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; text-wrap: balance; }
.detail-desc { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.detail-facts { display: grid; gap: 14px; margin-top: 14px; }
.detail-extra { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.lesson-list { display: grid; gap: 10px; }
.lesson-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 20px; background: var(--row); transition: background-color .2s ease; }
.lesson-row:hover { background: var(--row-hover); }
.lesson-row.is-open, .lesson-row.is-open:hover { background: var(--row); }
.lesson-link { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "icon title time" "icon sub time"; align-items: center; gap: 2px 14px; min-height: 74px; padding: 13px 12px 13px 13px; border-radius: 20px; color: var(--ink); }
.lesson-row:not(:has(.lesson-toggle)) .lesson-link { padding-right: 16px; }
.lesson-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(150deg, #7b6cf2, var(--violet)); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.lesson-icon .i { width: 20px; height: 20px; }
.lesson-row.is-complete .lesson-icon { background: linear-gradient(150deg, #33a97b, var(--success)); }
.lesson-title { grid-area: title; align-self: end; font-size: 15.5px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.lesson-sub { grid-area: sub; align-self: start; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.lesson-row.is-started .lesson-sub { color: var(--violet-deep); }
.lesson-time { grid-area: time; align-self: end; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lesson-time .i { width: 14px; height: 14px; }
.lesson-toggle { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 8px; border-radius: 50%; background: var(--surface); color: var(--ink); }
.lesson-toggle .i { width: 18px; height: 18px; transition: transform .25s ease; }
.lesson-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
.lesson-panel { grid-column: 1 / -1; padding: 0 8px 8px; }
.reel-list { display: grid; gap: 2px; padding: 6px; border-radius: 16px; background: var(--surface); }
.reel-link { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; align-items: center; gap: 12px; min-height: 60px; padding: 6px 8px 6px 6px; border-radius: 12px; color: var(--ink); }
.reel-link:hover { background: var(--row); }
.reel-thumb { width: 36px; height: 54px; border-radius: 9px; overflow: hidden; background: var(--row-hover); }
.reel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.reel-thumb--icon { display: grid; place-items: center; height: 36px; border-radius: 11px; background: var(--lilac-1); color: var(--violet-deep); }
.reel-thumb--icon .i { width: 18px; height: 18px; }
.reel-title { display: block; font-size: 14px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.reel-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.reel-state { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--row); color: var(--ink-soft); }
.reel-state .i { width: 14px; height: 14px; }
.reel-state.is-done { background: var(--success-soft); color: var(--success); }

.challenge-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; align-items: center; gap: 14px; min-height: 80px; margin-top: 10px; padding: 14px; border-radius: 22px; color: var(--ink); background: linear-gradient(150deg, var(--butter-1), #fbe293); transition: filter .2s ease; }
.challenge-row:hover { filter: saturate(1.15); }
.challenge-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: #fde68a; }
.challenge-title { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.challenge-meta { display: block; margin-top: 2px; color: #5a4a1d; font-size: 13px; }
.challenge-go { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.challenge-go .i { width: 16px; height: 16px; }

.resource-list { display: grid; gap: 8px; }
.resource-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-height: 70px; padding: 12px 16px 12px 12px; border-radius: 20px; background: var(--row); color: var(--ink); transition: background-color .2s ease; }
.resource-row:hover { background: var(--row-hover); }
.resource-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); }
.resource-icon .i { width: 19px; height: 19px; }
.resource-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.resource-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.resource-go { width: 18px; height: 18px; color: var(--muted); }
.format-row { grid-template-columns: 44px minmax(0, 1fr); padding-right: 18px; }
.format-row:hover { background: var(--row); }
.aside-actions { display: grid; gap: 10px; margin-top: 14px; }
.resource-list--spaced { margin-top: 14px; }
.result-thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; overflow: hidden; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.result-thumb--module { background: var(--ink); color: #fff; }

.classic-card { margin-top: 12px; padding: 18px; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--hairline); }
.classic-card .progress-line { margin: 10px 0 8px; }

/* Courses and search */
.page-head .display { margin-top: 2px; }
.filters { display: grid; gap: 10px; margin-top: 16px; }
.result-count { margin: 18px 0 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.result-group { margin-top: 30px; }
.result-group .section-title { margin-bottom: 12px; font-size: 18px; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 34px 22px; border-radius: 28px; background: var(--row); text-align: center; }
.empty-state .notice-title { font-size: 18px; }
.empty-state p { max-width: 40ch; color: var(--muted); font-size: 14.5px; }
.empty-state .pill { margin-top: 8px; }

/* Progress */
.progress-hero { margin-top: 22px; padding: 24px 18px 22px; border-radius: 32px; background: radial-gradient(120% 100% at 50% 0%, #faf9ff 0%, rgba(250, 249, 255, 0) 60%), linear-gradient(170deg, var(--lilac-1), #d8d0fd); }
.hero-actions { display: flex; justify-content: center; margin-top: 16px; }
.progress-hero-note { margin-top: 14px; color: var(--ink-soft); font-size: 14px; text-align: center; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stat-tile { min-width: 0; padding: 16px; border-radius: 22px; background: var(--row); }
.stat-tile dt { color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.stat-tile dd { margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-tile dd small { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.stat-tile-note { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.module-progress { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px 14px 14px; border-radius: 22px; background: var(--row); color: var(--ink); transition: background-color .2s ease; }
.module-progress:hover { background: var(--row-hover); }
.module-progress .meter { margin: 8px 0 6px; }
.module-progress-meta { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }

/* Profile */
.profile-card { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 20px; border-radius: 30px; background: radial-gradient(120% 100% at 100% 0%, #fbfaff 0%, rgba(251, 250, 255, 0) 55%), linear-gradient(150deg, var(--lilac-1), var(--lilac-2)); }
.profile-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.profile-sub { margin-top: 4px; color: var(--ink-soft); font-size: 14px; }
.settings-section { margin-top: 34px; }
.settings-section .section-title { margin-bottom: 8px; }
.settings-copy { max-width: 60ch; color: var(--muted); font-size: 15px; line-height: 1.55; }
.settings-copy + .settings-copy { margin-top: 8px; }
.name-form { display: grid; gap: 12px; margin-top: 14px; }
.field-label { font-size: 14px; font-weight: 600; }
.text-input { width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--row); color: var(--ink); font-size: 16px; transition: background-color .2s ease, box-shadow .2s ease; }
.text-input.text-input:focus-visible { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.text-input:disabled { opacity: .6; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-status { min-height: 1.5em; color: var(--success); font-size: 13.5px; font-weight: 600; }
.form-status.is-muted { color: var(--muted); }
.storage-state { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 16px; border-radius: 20px; background: var(--row); font-size: 14px; line-height: 1.5; }
.storage-state .i { margin-top: 1px; color: var(--success); }
.storage-state.is-off .i { color: #b4233c; }
.signout-form { margin-top: 14px; }

/* Profile account panel: sync status, Clerk account settings, optional import of older browser progress. */
.name-fields { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
button.resource-row { width: 100%; text-align: left; }
.sync-card { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 4px; padding: 14px 14px 14px 18px; border-radius: 20px; background: var(--row); }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sync-card[data-tone="live"] .sync-dot { background: var(--success); }
.sync-card[data-tone="progress"] .sync-dot { background: var(--violet); }
.sync-card[data-tone="soon"] { background: var(--butter-1); }
.sync-card[data-tone="soon"] .sync-dot { background: #d6940e; }
.sync-card[data-tone="error"] { background: var(--danger-soft); }
.sync-card[data-tone="error"] .sync-dot { background: #b4233c; }
.sync-text { min-width: 0; }
.sync-title { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.sync-detail { margin-top: 2px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.sync-detail:empty { display: none; }
.import-card { display: grid; justify-items: start; gap: 8px; margin-top: 14px; padding: 18px; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--hairline); }
.import-card .settings-copy { font-size: 14px; }
.import-title { font-size: 15px; font-weight: 700; }
.profile-content[aria-busy="true"] .profile-sub { color: var(--muted); }
@media (max-width: 399px) {
  .sync-card { grid-template-columns: 10px minmax(0, 1fr); }
  .sync-card .pill { grid-column: 2; justify-self: start; }
}

/* Study path: a quiet chip on Home, or an honest preview card when the chosen path has no lessons yet. */
.tone-ink { background: var(--ink); color: #fff; }
.home-path { margin-top: 18px; }
.home-path:empty { display: none; }
.path-chip { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; min-height: 56px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--row); color: var(--ink); transition: background-color .2s ease; }
.path-chip:hover { background: var(--row-hover); }
.path-chip-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }
.path-chip-icon.tone-ink { color: #fff; }
.path-chip-text { min-width: 0; color: var(--ink-soft); font-size: 14px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.path-chip-text strong { margin-left: 4px; color: var(--ink); font-weight: 700; }
.path-chip-action { flex: none; color: var(--violet-deep); font-size: 14px; font-weight: 700; }
.path-chip-go { width: 18px; height: 18px; color: var(--muted); }
.path-card { position: relative; grid-column: 1 / -1; display: grid; justify-items: start; gap: 10px; padding: 18px 18px 20px; border-radius: 30px; overflow: hidden; }
.path-card-head { display: flex; align-items: center; gap: 12px; width: 100%; }
.path-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 16px; background: rgba(255, 255, 255, .72); color: var(--ink); }
.path-icon .i { width: 22px; height: 22px; }
.path-stage { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.path-change { display: inline-flex; flex: none; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .62); color: var(--ink); font-size: 14px; font-weight: 600; }
.path-change:hover { background: rgba(255, 255, 255, .85); }
.path-card .tag { margin-top: 4px; }
.path-title { font-size: clamp(28px, 8vw, 38px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; overflow-wrap: anywhere; }
.path-copy { max-width: 44ch; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.path-actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-top: 6px; }
.path-actions .pill { flex: 1 1 220px; }
.pill--frost { background: rgba(255, 255, 255, .62); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85); }
.pill--frost:hover { background: rgba(255, 255, 255, .85); }
.path-art { display: none; }

/* Onboarding: two short steps, native radios, and a call to action that stays within reach. */
.onboard { display: grid; min-height: 100vh; min-height: 100dvh; }
.onboard-art { display: none; }
.onboard-body { display: flex; flex-direction: column; width: 100%; max-width: 560px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.onboard-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 64px; }
.onboard-brand, .onboard-back { grid-column: 1; grid-row: 1; justify-self: start; }
.onboard-brand { font-size: 18px; }
.onboard-brand img { width: 26px; height: 26px; }
.onboard-dots { grid-column: 2; grid-row: 1; display: flex; gap: 6px; }
.onboard-dots span { width: 22px; height: 6px; border-radius: 99px; background: var(--row-hover); transition: background-color .3s ease, width .3s ease; }
.onboard-dots .is-on { width: 34px; background: var(--ink); }
.onboard-skip { grid-column: 3; grid-row: 1; justify-self: end; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--ink-soft); font-size: 15px; font-weight: 600; transition: background-color .2s ease; }
.onboard-skip:hover { background: var(--row); color: var(--ink); }
.onboard-step { display: flex; flex: 1; flex-direction: column; }
.onboard-hero { display: grid; place-items: center; height: 150px; margin: 6px 0 20px; border-radius: 28px; }
.onboard-hero img { width: auto; height: 132px; filter: drop-shadow(0 16px 20px rgba(40, 30, 10, .16)); }
.onboard-title { margin-top: 10px; font-size: clamp(28px, 7.6vw, 36px); line-height: 1.08; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.onboard-title:focus { outline: none; }
.onboard-lede { max-width: 42ch; margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.choice-list { display: grid; gap: 10px; min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.choice { position: relative; display: block; }
.choice-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.choice-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 26px; align-items: center; gap: 14px; min-height: 74px; padding: 14px 16px 14px 14px; border-radius: 22px; background: var(--row); box-shadow: inset 0 0 0 2px transparent; transition: background-color .18s ease, box-shadow .18s ease; }
.choice-card--plain { grid-template-columns: minmax(0, 1fr) auto 26px; min-height: 62px; padding-left: 20px; }
.choice-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--ink); }
.choice-icon.tone-ink { color: #fff; }
.choice-icon .i { width: 22px; height: 22px; }
.choice-text { min-width: 0; }
.choice-label { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.choice-hint { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.choice-card .tag { background: var(--surface); }
.choice-mark { grid-column: -2 / -1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px #c9c9d3; transition: background-color .18s ease, box-shadow .18s ease; }
.choice-mark::after { content: ""; width: 11px; height: 6px; margin-top: -2px; border-bottom: 2.2px solid #fff; border-left: 2.2px solid #fff; opacity: 0; transform: rotate(-45deg); }
.choice-input:checked + .choice-card { background: var(--lilac-1); box-shadow: inset 0 0 0 2px var(--violet); }
.choice-input:checked + .choice-card .choice-mark { background: var(--violet); box-shadow: none; }
.choice-input:checked + .choice-card .choice-mark::after { opacity: 1; }
.choice-input:focus-visible + .choice-card { outline: 3px solid var(--violet); outline-offset: 3px; }
.onboard-note { margin-top: 16px; padding: 14px 16px; border-radius: 18px; background: var(--butter-1); color: var(--ink); font-size: 14px; line-height: 1.45; }
.onboard-actions { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 20px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--surface) 70%, rgba(255, 255, 255, 0)); }
@media (hover: hover) {
  .choice:hover .choice-input:not(:checked) + .choice-card { background: var(--row-hover); }
}
@media (max-width: 899px) and (max-height: 740px) {
  .onboard-hero { display: none; }
}
@media (max-width: 359px) {
  .onboard-brand { gap: 8px; font-size: 16px; }
  .onboard-brand img { width: 24px; height: 24px; }
  .onboard-dots span { width: 16px; }
  .onboard-dots .is-on { width: 26px; }
  .choice-card { gap: 12px; padding-right: 12px; }
  .choice-card--plain { padding-left: 16px; }
}

/* Larger phones and tablets */
@media (min-width: 640px) {
  .hub { --page-x: 32px; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .spotlight { grid-template-columns: minmax(120px, 30%) minmax(0, 1fr); padding: 16px; }
  .spotlight > .pill { grid-column: 2; justify-self: start; }
  .course-hero { margin-left: 0; margin-right: 0; margin-top: 0; border-radius: 34px; padding-top: 64px; }
  .hero-back { top: 16px; left: 16px; }
  .path-card { padding: 24px 40% 26px 24px; }
  .path-art { position: absolute; top: 50%; right: 3%; display: block; width: 34%; max-width: 300px; height: auto; transform: translateY(-50%); pointer-events: none; filter: drop-shadow(0 18px 20px rgba(40, 30, 10, .14)); }
}

@media (min-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; }
  .spotlight > .pill { grid-column: 1 / -1; justify-self: stretch; }
  .spotlight { grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); }
  .onboard-page { background: var(--canvas); }
  .onboard { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); width: min(1080px, calc(100% - 64px)); min-height: min(720px, calc(100vh - 64px)); margin: 32px auto; border-radius: 32px; overflow: hidden; background: var(--surface); box-shadow: 0 1px 2px rgba(19, 19, 22, .04), 0 30px 80px -50px rgba(36, 28, 92, .35); }
  .onboard-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 48px; }
  .onboard-art img { width: min(100%, 380px); height: auto; filter: drop-shadow(0 26px 30px rgba(40, 30, 10, .18)); }
  .onboard-art p { max-width: 16ch; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; text-align: center; }
  .onboard-body { max-width: none; min-height: 0; padding: 18px 48px 0; }
  .onboard-hero { display: none; }
  .onboard-actions { padding-bottom: 36px; }
}

/* Desktop: sidebar plus a white sheet on a luminous grey canvas */
@media (min-width: 1024px) {
  .hub { --page-x: 0px; --nav-space: 72px; background: var(--canvas); }
  .hub-app { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; }
  .hub-nav { position: sticky; top: 0; left: auto; bottom: auto; width: auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 34px; padding: 30px 18px 28px 26px; transform: none; }
  .hub-nav > .hub-brand { display: inline-flex; padding-left: 6px; }
  .hub-nav-list { display: flex; flex-direction: column; gap: 6px; padding: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hub-nav-link { flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 52px; padding: 0 18px; color: var(--ink-soft); font-size: 15px; }
  .hub-nav-link:hover { background: rgba(19, 19, 22, .05); color: var(--ink); }
  .hub-nav-link[aria-current="page"], .hub-nav-link[aria-current="page"]:hover { background: var(--ink); color: #fff; }
  .hub-nav-note { display: block; margin-top: auto; padding: 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
  .hub-main { max-width: none; min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); margin: 16px 16px 16px 0; padding: 44px clamp(32px, 4.5vw, 72px) var(--nav-space); border-radius: 32px; background: var(--surface); box-shadow: 0 1px 2px rgba(19, 19, 22, .04); }
  .page { max-width: 1120px; margin: 0 auto; }
  .page--narrow { max-width: 760px; }
  .display { font-size: 44px; }
  .home-head { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px) auto; grid-template-areas: "hello search avatar"; align-items: end; gap: 24px; }
  .home-brand { display: none; }
  .home-hello { margin: 0; }
  .home-avatar { align-self: center; margin-bottom: 6px; }
  .home-search { align-self: end; }
  .home-grid { margin-top: 34px; gap: 20px; }
  .course-grid, .course-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-courses.has-mine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 20px; }
  .home-courses.has-mine .course-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips { margin: 0; padding: 2px 0; }
  .split { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
  .page--course .split-main { padding-top: 6px; }
  .page--course .split-main .section-head:first-child, .page--module .split-main .section-head:first-child { margin-top: 0; }
  .detail-top { margin-bottom: 8px; }
  .page--module .intro-card { margin-top: 10px; }
  .course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .course-card:hover .course-card-art { transform: translateY(-4px) rotate(-2deg); }
  .progress-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
  .progress-split .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
}

@media (max-width: 399px) {
  .hub { --page-x: 16px; }
  .lesson-link { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "icon title" "icon sub" "icon time"; gap: 2px 12px; }
  .lesson-icon { width: 40px; height: 40px; border-radius: 12px; }
  .lesson-time { align-self: start; margin-top: 3px; }
  .module-head { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; }
  .module-num { width: 40px; height: 40px; }
  .module-head .ring { display: none; }
  .course-card { padding: 20px 18px 14px; }
  .course-card-title { font-size: 25px; }
  .spotlight { gap: 14px 12px; }
  .spot-title { font-size: 19px; }
  .mini-stat { padding: 10px 8px; }
  .mini-stat dd { font-size: 17px; }
  .stat-item dd { font-size: 14px; gap: 8px; }
  .stat-icon { width: 34px; height: 34px; }
}

/* One orchestrated moment: the progress arc fills segment by segment. */
@keyframes arc-fill { from { stroke: #fff; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: no-preference) {
  .arc-seg.is-done, .arc-seg.is-part { animation: arc-fill .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 34ms + 180ms); }
  .skeleton { animation: shimmer 1.6s linear infinite; }
  .lesson-panel:not([hidden]), .module-panel:not([hidden]) { animation: panel-in .24s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .hub *, .hub *::before, .hub *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .hub-nav-link[aria-current="page"], .chip[aria-pressed="true"] { outline: 2px solid CanvasText; }
  .seg.is-done, .arc-seg.is-done { forced-color-adjust: none; }
}
