/* TutorPlus kit: tokens, base, components, app shell. Flat colour, 1px hairlines, whitespace.
   No gradients, no shadows. Every page loads this file. Read KIT.md before adding styles. */

@font-face { font-family: "Switzer"; src: url("../fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------------ 1. Tokens */
:root {
  --ink: #0D0D11; --paper: #FFFFFF; --bone: #F4F3EF; --line: #E6E5E0; --line-strong: #CFCEC7;
  --text: #0D0D11; --text-2: #5B5B66; --text-3: #8C8C96;
  --cobalt: #0047FF; --cobalt-deep: #0033B8; --cobalt-tint: #E8EEFF;
  --star: #FFB300; --ok: #12A150; --warn: #F2A900; --danger: #E5341A;
  --ok-tint: #E4F5EA; --ok-text: #0B7A3B; --warn-tint: #FFF4D6; --warn-text: #8A5D00; --danger-tint: #FDE9E5; --danger-text: #B42410;

  /* cover colours (data keys) */
  --c-cobalt: #0047FF; --c-ink: #0D0D11; --c-coral: #FF5A3C; --c-sun: #FFC42E; --c-mint: #2FE0A2;
  --c-violet: #6A4DFF; --c-rose: #FF8AD0; --c-sky: #7BC8FF; --c-lime: #C8F031; --c-bone: #E9E8E2;

  --font: "Switzer", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 48px; --s9: 64px; --s10: 96px;

  /* radii */
  --r-card: 16px; --r-cover: 12px; --r-btn: 10px; --r-ctl: 10px; --r-panel: 8px; --r-pill: 999px;

  /* layout */
  --wrap: 1240px; --wrap-narrow: 820px; --gutter: 32px; --section: 96px; --nav-h: 72px;
  --admin-bar: var(--wp-admin--admin-bar--height, 0px);

  /* density (marketing default, .is-app overrides) */
  --fs-body: 17px; --lh-body: 1.55; --fs-meta: 13px;
  --btn-h: 48px; --btn-h-sm: 38px; --btn-h-lg: 52px; --btn-fs: 15px; --btn-px: 20px;
  --ctl-h: 48px; --ctl-fs: 16px; --row-h: 56px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 2px solid var(--cobalt);
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --section: 56px; --nav-h: 60px; --fs-body: 16px; }
}
body.is-app {
  --fs-body: 14px; --lh-body: 1.5; --fs-meta: 12px;
  --btn-h: 36px; --btn-h-sm: 30px; --btn-h-lg: 44px; --btn-fs: 13px; --btn-px: 14px;
  --ctl-h: 36px; --ctl-fs: 14px; --row-h: 44px;
  --r-btn: 6px; --r-ctl: 6px; --r-card: 8px;
}
@media (max-width: 760px) {
  /* phones: tap targets stay 44px even in app surfaces */
  body.is-app { --btn-h: 44px; --btn-h-sm: 36px; --ctl-h: 44px; --ctl-fs: 16px; --row-h: 52px; --fs-body: 15px; }
}

/* ------------------------------------------------------------------ 2. Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--text); font-family: var(--font);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video, canvas, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-deep); }
:focus { outline: none; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
::selection { background: var(--cobalt-tint); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
code, kbd, pre, samp { font-family: var(--mono); font-size: .9em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------------ 3. Type scale */
.display { font-size: clamp(40px, 6vw, 88px); line-height: 1.0; font-weight: 700; letter-spacing: -0.04em; }
.h1, h1 { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; }
.h2, h2 { font-size: clamp(28px, 3.1vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.h3, h3 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.h4, h4 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--text-2); }
.eyebrow { display: block; font-size: 12px; line-height: 1.4; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.meta { font-size: var(--fs-meta); line-height: 1.45; color: var(--text-3); }
.small { font-size: 14px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); } .text-cobalt { color: var(--cobalt); }
.text-ok { color: var(--ok-text); } .text-danger { color: var(--danger-text); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.balance { text-wrap: balance; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link { color: var(--cobalt); font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link:hover { text-decoration-color: currentColor; }
.link-quiet { color: inherit; } .link-quiet:hover { color: var(--cobalt); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--cobalt); }
.link-arrow svg { transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }
/* app page title */
body.is-app h1, .page-title { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
body.is-app h2 { font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
body.is-app h3 { font-size: 14px; line-height: 1.4; font-weight: 600; letter-spacing: 0; }

/* prose: output of tt_md() / TTKit.md() */
.prose { font-size: var(--fs-body); line-height: 1.65; color: var(--text); max-width: 72ch; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1em; }
.prose h1, .prose h2 { font-size: 1.5em; line-height: 1.2; margin-top: 1.6em; letter-spacing: -0.02em; font-weight: 700; }
.prose h3 { font-size: 1.2em; margin-top: 1.4em; font-weight: 600; }
.prose h4 { font-size: 1.05em; margin-top: 1.2em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px; }
.prose code { background: var(--bone); padding: .1em .35em; border-radius: 4px; font-size: .88em; }
.prose pre { background: var(--bone); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { border-left: 3px solid var(--cobalt); padding-left: 16px; color: var(--text-2); }
.prose strong { font-weight: 600; }

/* ------------------------------------------------------------------ 4. Layout */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: 100%; max-width: calc(var(--wrap-narrow) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section-tight { padding-block: calc(var(--section) * .6); }
.section-bone { background: var(--bone); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s7); }
.section-head > div { display: grid; gap: 10px; max-width: 760px; }
.section-head .lead { margin-top: 4px; }
@media (max-width: 760px) { .section-head { flex-direction: column; align-items: flex-start; margin-bottom: var(--s5); gap: var(--s3); } }

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.stack-4 { --gap: 4px; } .stack-8 { --gap: 8px; } .stack-12 { --gap: 12px; } .stack-16 { --gap: 16px; } .stack-24 { --gap: 24px; } .stack-32 { --gap: 32px; } .stack-48 { --gap: 48px; }
.hstack { display: flex; align-items: center; gap: var(--gap, 12px); min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
/* course grid: 4 up at 1240, 3, 2, then 1 */
.grid-courses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
@media (max-width: 1180px) { .grid-courses { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } }
@media (max-width: 560px) { .grid-courses { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
/* horizontal rail of cards (inside a .wrap; never the page) */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 72px) / 4); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (max-width: 1080px) { .rail { grid-auto-columns: calc((100% - 24px) / 2.3); } }
@media (max-width: 560px) { .rail { grid-auto-columns: 78%; gap: 16px; } }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.center { text-align: center; } .w-full { width: 100%; }
@media (max-width: 760px) { .hide-phone { display: none !important; } }
@media (min-width: 761px) { .show-phone { display: none !important; } }

.panel { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); padding: var(--panel-pad, 24px); }
body.is-app .panel { --panel-pad: 16px; border-radius: var(--r-panel); }
.panel-bone { background: var(--bone); border-color: transparent; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* ------------------------------------------------------------------ 5. Icons */
.icon { width: var(--i, 20px); height: var(--i, 20px); stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-16 { --i: 16px; } .icon-18 { --i: 18px; } .icon-24 { --i: 24px; }

/* ------------------------------------------------------------------ 6. Buttons */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 var(--btn-px); border-radius: var(--r-btn); border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font-size: var(--btn-fs); font-weight: 600; line-height: 1; letter-spacing: -0.005em;
  white-space: nowrap; text-decoration: none; user-select: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { color: var(--fg); }
.btn .icon { --i: 18px; }
.btn-primary { --bg: var(--cobalt); --fg: #fff; --bd: var(--cobalt); }
.btn-primary:hover { --bg: var(--cobalt-deep); --bd: var(--cobalt-deep); }
.btn-secondary { --bg: var(--paper); --fg: var(--ink); --bd: var(--line-strong); }
.btn-secondary:hover { --bg: var(--bone); --bd: var(--line-strong); }
.btn-ghost { --bg: transparent; --fg: var(--ink); --bd: transparent; }
.btn-ghost:hover { --bg: var(--bone); }
.btn-danger { --bg: var(--danger); --fg: #fff; --bd: var(--danger); }
.btn-danger:hover { --bg: #C42810; --bd: #C42810; }
.btn-danger-ghost { --bg: transparent; --fg: var(--danger-text); --bd: transparent; }
.btn-danger-ghost:hover { --bg: var(--danger-tint); }
.btn-ink { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn-ink:hover { --bg: #26262E; --bd: #26262E; }
.btn-on-ink { --bg: transparent; --fg: #fff; --bd: rgba(255,255,255,.28); }
.btn-on-ink:hover { --bg: rgba(255,255,255,.08); }
.btn-sm { height: var(--btn-h-sm); padding: 0 12px; font-size: calc(var(--btn-fs) - 1px); }
.btn-lg { height: var(--btn-h-lg); padding: 0 26px; font-size: calc(var(--btn-fs) + 1px); }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-icon.btn-sm { width: var(--btn-h-sm); }
.btn:focus-visible { outline: var(--focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid var(--fg); border-right-color: transparent; animation: tt-spin .7s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media (max-width: 760px) { .btn-row-stack { flex-direction: column; align-items: stretch; } .btn-row-stack .btn { width: 100%; } }

/* ------------------------------------------------------------------ 7. Form controls */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 600; color: var(--text); }
body.is-app .label { font-size: 13px; }
.label-opt { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.hint { font-size: 13px; color: var(--text-3); line-height: 1.45; }
.field-error { font-size: 13px; color: var(--danger-text); font-weight: 500; }
.input, .select, .textarea {
  display: block; width: 100%; min-width: 0; height: var(--ctl-h); padding: 0 14px; font-size: var(--ctl-fs);
  background: var(--paper); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  transition: border-color .15s var(--ease), background-color .15s var(--ease); appearance: none; -webkit-appearance: none;
}
body.is-app .input, body.is-app .select, body.is-app .textarea { padding: 0 10px; }
.textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
body.is-app .textarea { padding: 8px 10px; }
.textarea.mono { font-family: var(--mono); font-size: 13px; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: #B5B4AC; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--cobalt); outline: 1px solid var(--cobalt); outline-offset: 0; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bone); color: var(--text-3); cursor: not-allowed; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .input[aria-invalid="true"] { border-color: var(--danger); }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B5B66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; --i: 18px; }
.input-group > .input { padding-left: 42px; }
.input-group .input-affix { position: absolute; right: 6px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); background: var(--bone); color: var(--text-2); font-size: var(--ctl-fs); }
.input-prefix > .input { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }

/* checkbox + radio */
.check, .radio { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; line-height: 1.4; min-height: 24px; }
body.is-app .check, body.is-app .radio { font-size: 14px; }
.check input, .radio input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 0; margin-top: 1px;
  border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; display: grid; place-content: center;
  transition: background-color .12s, border-color .12s;
}
.check input { border-radius: 5px; }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--text-3); }
.check input:checked { background: var(--cobalt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--cobalt); }
.radio input:checked { border: 6px solid var(--cobalt); }
.check input:disabled, .radio input:disabled { opacity: .45; cursor: not-allowed; }
.check input:focus-visible, .radio input:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* switch: <label class="switch"><input type="checkbox" role="switch"><span>Label</span></label> */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; min-height: 28px; }
body.is-app .switch { font-size: 14px; }
.switch input {
  appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 24px; margin: 0; flex: 0 0 auto;
  border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background-color .18s var(--ease);
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked { background: var(--cobalt); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.switch input:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ 8. Chips, tags, badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
body.is-app .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.chip:hover { background: var(--bone); color: var(--text); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--cobalt-tint); border-color: var(--cobalt); color: var(--cobalt); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip .chip-count { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 400; }
.chip .icon { --i: 16px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
  background: var(--bone); color: var(--text-2);
}
.tag-sample { background: transparent; color: var(--text-3); border: 1px dashed var(--line-strong); font-weight: 500; height: 20px; padding: 0 6px; }
.tag-preview { background: var(--cobalt-tint); color: var(--cobalt); }
.tag-free { background: var(--ok-tint); color: var(--ok-text); }
.tag-level { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.tag-new { background: var(--c-lime); color: var(--ink); }
.tag-ink { background: var(--ink); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bone); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-tint); color: var(--ok-text); }
.badge-warn { background: var(--warn-tint); color: var(--warn-text); }
.badge-danger { background: var(--danger-tint); color: var(--danger-text); }
.badge-cobalt { background: var(--cobalt-tint); color: var(--cobalt); }
.badge-plain::before { display: none; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cobalt); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 9. Avatar, stars */
.avatar {
  --size: 40px; --bg: var(--cobalt);
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--bg); color: #fff; font-size: calc(var(--size) * .38); font-weight: 600; letter-spacing: -0.01em; line-height: 1; overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-c-cobalt { --bg: var(--c-cobalt); } .avatar-c-ink { --bg: var(--c-ink); } .avatar-c-violet { --bg: var(--c-violet); }
.avatar-c-coral { --bg: #E8492B; } .avatar-c-deep { --bg: var(--cobalt-deep); } .avatar-c-green { --bg: #0B7A3B; }

.stars { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1; color: var(--text-2); white-space: nowrap; }
.stars-avg { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stars-row { position: relative; display: inline-block; line-height: 0; }
.stars-row svg { width: var(--star-size, 14px); height: var(--star-size, 14px); display: inline-block; }
.stars-base { display: flex; gap: 2px; color: var(--line-strong); }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; display: flex; gap: 2px; color: var(--star); white-space: nowrap; }
.stars-base svg, .stars-fill svg { fill: currentColor; flex: 0 0 auto; }
.stars-count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.stars-sm { --star-size: 12px; font-size: 13px; }
.stars-lg { --star-size: 20px; font-size: 16px; gap: 8px; }
.stars-none { color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------------ 10. Course card */
.ccard { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; color: var(--text); }
.ccard-cover { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-cover); overflow: hidden; background: var(--c-bone); }
.ccard-cover > svg, .ccard-cover > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s var(--ease); }
.ccard-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ccard-title { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-title a { color: inherit; }
.ccard-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-cover); }
.ccard-by { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-rating { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.ccard-price { display: flex; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ccard:hover .ccard-title { color: var(--cobalt); }
.ccard:hover .ccard-cover > svg, .ccard:hover .ccard-cover > img { transform: scale(1.025); }
.ccard:focus-within .ccard-title a:focus-visible { outline: none; }
.ccard:focus-within:has(a:focus-visible) .ccard-cover { outline: var(--focus); outline-offset: 3px; }
/* row layout (lists on phones, search suggestions, my learning) */
.ccard.is-row { flex-direction: row; gap: 14px; align-items: flex-start; }
.ccard.is-row .ccard-cover { flex: 0 0 132px; width: 132px; border-radius: 8px; }
.ccard.is-row .ccard-title { font-size: 15px; }
.ccard.is-row .ccard-by { font-size: 13px; }
.ccard.is-row .ccard-price { font-size: 15px; }
@media (max-width: 560px) { .grid-courses.as-rows-phone .ccard { flex-direction: row; gap: 14px; } .grid-courses.as-rows-phone .ccard-cover { flex: 0 0 120px; width: 120px; border-radius: 8px; } .grid-courses.as-rows-phone .ccard-title { font-size: 15px; } }

/* poster placeholder (inline SVG generated by the kit when tt_cover_svg() is missing) */
.poster { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ 11. Instructor card */
.icard { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); transition: border-color .15s; min-width: 0; }
.icard:hover { border-color: var(--line-strong); }
.icard-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.icard-name { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.icard-name a { color: var(--text); }
.icard-name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.icard:hover .icard-name a { color: var(--cobalt); }
.icard-headline { font-size: 14px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.icard-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); padding-top: 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.icard-stats strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ 12. Reviews */
.reviews { display: flex; flex-direction: column; }
.review { display: grid; gap: 10px; padding-block: 24px; border-top: 1px solid var(--line); min-width: 0; }
.reviews > .review:first-child { border-top: 0; padding-top: 0; }
.review-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.review-who { display: grid; gap: 2px; min-width: 0; }
.review-name { font-size: 15px; font-weight: 600; }
.review-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.review-body { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.review-course { font-size: 13px; color: var(--text-3); }
.review-reply { margin-top: 6px; margin-left: 24px; padding: 14px 16px; background: var(--bone); border-radius: var(--r-panel); display: grid; gap: 6px; }
.review-reply-who { font-size: 13px; font-weight: 600; }
.review-reply p { font-size: 14px; line-height: 1.55; white-space: pre-line; color: var(--text); }
body.is-app .review { padding-block: 16px; }
body.is-app .review-body { font-size: 14px; }
/* rating summary + histogram */
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.rating-big { display: grid; gap: 6px; justify-items: start; }
.rating-big .n { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.histo { display: grid; gap: 6px; }
.histo-row { display: grid; grid-template-columns: 34px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.histo-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.histo-bar > span { display: block; height: 100%; background: var(--star); }
@media (max-width: 560px) { .rating-summary { grid-template-columns: 1fr; gap: 16px; } }

/* ------------------------------------------------------------------ 13. Tabs */
.tabs-list { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs-list::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 2px; margin-bottom: -1px;
  font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
body.is-app .tab { height: 40px; font-size: 13px; }
body.is-app .tabs-list { gap: 20px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"], .tab.is-active { color: var(--text); border-bottom-color: var(--cobalt); font-weight: 600; }
.tab:disabled { opacity: .45; cursor: not-allowed; }
.tab .count { background: var(--bone); color: var(--text-2); }
.tab-panel { padding-top: 24px; }
body.is-app .tab-panel { padding-top: 16px; }
/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bone); border-radius: 10px; }
.seg > button, .seg > a { height: 34px; padding: 0 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; }
body.is-app .seg { border-radius: 8px; } body.is-app .seg > button, body.is-app .seg > a { height: 28px; font-size: 13px; padding: 0 10px; border-radius: 6px; }
.seg > [aria-selected="true"], .seg > .is-active { background: var(--paper); color: var(--text); font-weight: 600; outline: 1px solid var(--line); }

/* ------------------------------------------------------------------ 14. Dialog (native <dialog>), menu, toast */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-card);
  background: var(--paper); color: var(--text); overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: tt-pop .18s var(--ease); }
.dialog-wide { width: min(800px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(13, 13, 17, .46); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 14px 24px; }
.dialog-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
body.is-app .dialog-title { font-size: 17px; }
.dialog-body { padding: 4px 24px 24px; overflow-y: auto; color: var(--text-2); font-size: 15px; line-height: 1.55; }
body.is-app .dialog-body { font-size: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--paper); }
@keyframes tt-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes tt-sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 760px) {
  .dialog, .dialog-wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0 0; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .dialog[open] { animation: tt-sheet .24s var(--ease); }
  .dialog-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
  .dialog-head { position: relative; padding-top: 24px; }
  .dialog-foot { flex-direction: column-reverse; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .dialog-foot .btn { width: 100%; }
}

.menu {
  position: fixed; z-index: 120; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px; background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 12px; animation: tt-pop .14s var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
body.is-app .menu-item { min-height: 34px; font-size: 13px; border-radius: 6px; padding: 0 10px; }
.menu-item:hover, .menu-item:focus-visible, .menu-item.is-focus { background: var(--bone); color: var(--text); outline: none; }
.menu-item .icon { --i: 18px; color: var(--text-2); }
.menu-item.is-danger { color: var(--danger-text); }
.menu-item.is-danger .icon { color: currentColor; }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--line); margin: 6px -6px; }
.menu-head { padding: 10px 12px 8px; display: grid; gap: 2px; }
.menu-head strong { font-size: 14px; font-weight: 600; }
.menu-head span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
/* phones: menus open as an action sheet */
.menu.is-sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); animation: tt-sheet .22s var(--ease); }
.menu.is-sheet .menu-item { min-height: 52px; font-size: 16px; }
.menu-scrim { position: fixed; inset: 0; z-index: 119; background: rgba(13, 13, 17, .46); }

.toasts { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 500; line-height: 1.4; pointer-events: auto; animation: tt-pop .18s var(--ease);
}
.toast .icon { --i: 18px; }
.toast-ok .icon { color: var(--c-mint); } .toast-error .icon { color: #FF8A73; } .toast-info .icon { color: var(--c-sky); }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
body.has-tabbar .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------------ 15. Table, rows */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); }
.table { width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
body.is-app .table { font-size: 13px; }
.table th { height: 36px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-3); background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 44px; padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFAF8; }
.table tr.is-selected td { background: var(--cobalt-tint); }
.table .num, .table th.num { text-align: right; }
.table .cell-main { font-weight: 500; color: var(--text); }
.table .cell-sub { display: block; font-size: 12px; color: var(--text-3); }
@media (max-width: 760px) { .table-wrap > .table { min-width: 600px; } }
.table-wrap > .table th:first-child, .table-wrap > .table td:first-child { padding-left: 16px; }

.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.rows.no-top { border-top: 0; }
.row-item {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: var(--row-h); padding: 10px 0;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0;
}
a.row-item:hover, button.row-item:hover { color: var(--text); background: #FAFAF8; }
button.row-item { width: 100%; text-align: left; }
.rows.inset .row-item { padding-inline: 14px; }
.row-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: var(--fs-meta); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.row-chev { color: var(--text-3); --i: 18px; }
.row-item.is-active { background: var(--cobalt-tint); }

/* ------------------------------------------------------------------ 16. Empty, skeleton, progress, pagination, breadcrumb, notes */
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 24px; background: var(--bone); border-radius: var(--r-card); }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--text-2); }
.empty-icon .icon { --i: 24px; }
.empty-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.empty-body { font-size: 15px; color: var(--text-2); max-width: 420px; line-height: 1.55; }
.empty .btn { margin-top: 8px; }
body.is-app .empty { padding: 40px 20px; border-radius: var(--r-panel); }
body.is-app .empty-title { font-size: 15px; } body.is-app .empty-body { font-size: 13px; }

.skel { display: block; background: var(--bone); border-radius: 6px; animation: tt-pulse 1.4s ease-in-out infinite; }
.skel-line { height: 12px; margin: 6px 0; }
.skel-title { height: 20px; width: 70%; }
.skel-cover { aspect-ratio: 16 / 10; border-radius: var(--r-cover); }
.skel-disc { width: 40px; height: 40px; border-radius: 50%; }
@keyframes tt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.progress { position: relative; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--cobalt); border-radius: inherit; transition: width .4s var(--ease); }
.progress-lg { height: 8px; border-radius: 4px; }
.progress.is-done > span { background: var(--ok); }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-meta); color: var(--text-2); margin-bottom: 6px; font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span, .pager button { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.pager a:hover, .pager button:hover { background: var(--bone); color: var(--text); }
.pager [aria-current="page"] { background: var(--cobalt-tint); color: var(--cobalt); font-weight: 600; }
.pager .pager-gap { color: var(--text-3); min-width: 24px; }
.pager .is-disabled { color: var(--text-3); pointer-events: none; opacity: .5; }
body.is-app .pager a, body.is-app .pager span, body.is-app .pager button { min-width: 32px; height: 32px; font-size: 13px; border-radius: 6px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--cobalt); }
.crumbs .icon { --i: 14px; color: var(--line-strong); }
.crumbs [aria-current="page"] { color: var(--text-3); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--text-2); }
.back-link:hover { color: var(--cobalt); }
.back-link .icon { --i: 18px; margin-left: -4px; }
body.is-app .back-link { font-size: 13px; min-height: 32px; }

.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-panel); background: var(--bone); color: var(--text); font-size: 14px; line-height: 1.5; }
.note .icon { --i: 18px; margin-top: 1px; color: var(--text-2); }
.note-info { background: var(--cobalt-tint); } .note-info .icon { color: var(--cobalt); }
.note-ok { background: var(--ok-tint); } .note-ok .icon { color: var(--ok-text); }
.note-warn { background: var(--warn-tint); } .note-warn .icon { color: var(--warn-text); }
.note-danger { background: var(--danger-tint); } .note-danger .icon { color: var(--danger-text); }

.stat { display: grid; gap: 4px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-3); }
body:not(.is-app) .stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-panel); }
.stats > .stat { padding: 16px; border-left: 1px solid var(--line); }
.stats > .stat:first-child { border-left: 0; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats > .stat:nth-child(odd) { border-left: 0; } .stats > .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* ------------------------------------------------------------------ 17. Marketing nav */
.mnav { position: sticky; top: var(--admin-bar); z-index: 90; background: var(--paper); border-bottom: 1px solid var(--line); }
.mnav-bar { display: flex; align-items: center; gap: 20px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; color: var(--ink); flex: 0 0 auto; }
.brand:hover { color: var(--ink); }
.brand svg { height: 26px; width: auto; }
.brand-mark svg { height: 28px; width: 28px; }
.mnav-cat { gap: 6px; }
.mnav-cat[aria-expanded="true"] { --bg: var(--bone); }
.mnav-cat[aria-expanded="true"] .icon { transform: rotate(180deg); }
.mnav-cat .icon { transition: transform .2s var(--ease); --i: 16px; }
.mnav-search { position: relative; flex: 1 1 auto; max-width: 520px; min-width: 0; }
.mnav-search .input { height: 44px; background: var(--bone); border-color: transparent; border-radius: var(--r-pill); font-size: 15px; }
.mnav-search .input:hover { border-color: var(--line-strong); }
.mnav-search .input:focus { background: var(--paper); }
.mnav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.mnav-link { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; }
.mnav-link:hover { background: var(--bone); color: var(--text); }
.mnav-link[aria-current="page"] { color: var(--cobalt); }
.mnav-avatar { border-radius: 50%; padding: 2px; margin-left: 6px; }
.mnav-avatar:hover .avatar { outline: 2px solid var(--line-strong); outline-offset: 1px; }
.mnav-mobile { display: none; margin-left: auto; gap: 4px; align-items: center; }
.mnav-mobile .btn-icon { width: 44px; height: 44px; }
@media (max-width: 1080px) { .mnav-teach { display: none; } }
@media (max-width: 900px) {
  .mnav-cat, .mnav-search, .mnav-links { display: none; }
  .mnav-mobile { display: flex; }
}

/* category flyout */
.flyout { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); animation: tt-drop .18s var(--ease); max-height: calc(100vh - var(--nav-h) - var(--admin-bar)); overflow-y: auto; }
@keyframes tt-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flyout-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 32px; padding-block: 32px 40px; }
.flyout-col { display: grid; align-content: start; gap: 4px; }
.flyout-parent { font-size: 15px; font-weight: 600; color: var(--text); padding: 6px 0; letter-spacing: -0.01em; }
.flyout-parent:hover { color: var(--cobalt); }
.flyout-child { font-size: 14px; color: var(--text-2); padding: 5px 0; }
.flyout-child:hover { color: var(--cobalt); }
.flyout-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--line); }

/* search suggestions */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 95; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px; max-height: 70vh; overflow-y: auto; }
.suggest-group + .suggest-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.suggest-label { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.suggest-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 15px; color: var(--text); }
.suggest-item .icon { color: var(--text-3); --i: 18px; }
.suggest-item:hover, .suggest-item.is-focus { background: var(--bone); color: var(--text); }
.suggest-empty { padding: 12px 10px; font-size: 14px; color: var(--text-3); }

/* phone menu sheet */
.msheet { position: fixed; inset: 0; z-index: 150; background: var(--paper); display: flex; flex-direction: column; animation: tt-sheet .26s var(--ease); }
.msheet-head { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.msheet-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 24px; }
.msheet-search .input { height: 48px; background: var(--bone); border-color: transparent; border-radius: 12px; }
.msheet-account { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msheet-user { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.msheet-user strong { display: block; font-size: 16px; font-weight: 600; }
.msheet-user span { font-size: 13px; color: var(--text-3); }
.msheet-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.msheet-list > a, .msheet-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 16px; font-weight: 500; color: var(--text); border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
.msheet-list summary::-webkit-details-marker { display: none; }
.msheet-list .icon { color: var(--text-3); --i: 18px; transition: transform .2s var(--ease); }
.msheet-list details[open] summary .icon { transform: rotate(90deg); }
.msheet-list details > div { display: flex; flex-direction: column; padding: 4px 0 12px 12px; border-bottom: 1px solid var(--line); }
.msheet-list details > div a { display: flex; align-items: center; min-height: 44px; font-size: 15px; color: var(--text-2); }
.msheet-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
body.sheet-open { overflow: hidden; }

/* ------------------------------------------------------------------ 18. Footer band */
.demo-line { background: var(--bone); border-top: 1px solid var(--line); }
.demo-line .wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-block: 10px; font-size: 13px; color: var(--text-2); }
.fband { background: var(--ink); color: #fff; }
.fband a { color: #B9B9C2; }
.fband a:hover { color: #fff; }
.fband-top { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 40px; padding-block: 72px 56px; }
.fband-brand { display: grid; gap: 16px; align-content: start; max-width: 320px; }
.fband-brand .brand { color: #fff; }
.fband-brand .brand svg { height: 28px; }
.fband-brand p { color: #9C9CA6; font-size: 15px; line-height: 1.55; }
.fband-col { display: grid; gap: 10px; align-content: start; }
.fband-col h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8C8C96; margin-bottom: 6px; line-height: 1.4; }
.fband-col a { font-size: 15px; }
.fband-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 24px 32px; border-top: 1px solid #26262E; font-size: 13px; color: #8C8C96; }
.fband-legal nav { display: flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 900px) { .fband-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fband-brand { grid-column: 1 / -1; } }
@media (max-width: 760px) { .fband-top { padding-block: 48px 40px; gap: 32px 24px; } .fband-col a { min-height: 32px; display: flex; align-items: center; } }

/* ------------------------------------------------------------------ 19. App shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - var(--admin-bar)); }
.shell-side {
  position: sticky; top: var(--admin-bar); height: calc(100vh - var(--admin-bar)); display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; border-right: 1px solid var(--line); background: #FAFAF8; overflow-y: auto;
}
.shell-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 16px; }
.shell-brand .brand svg { height: 22px; }
.shell-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin: 0 4px 12px; background: var(--bone); border-radius: 8px; }
.shell-switch a { display: grid; place-items: center; height: 28px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.shell-switch a:hover { color: var(--text); }
.shell-switch a.is-active { background: var(--paper); color: var(--text); outline: 1px solid var(--line); }
.shell-group { padding: 14px 10px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.shell-nav { display: flex; flex-direction: column; gap: 2px; }
.shell-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.shell-link .icon { --i: 18px; color: var(--text-3); }
.shell-link:hover { background: var(--bone); color: var(--text); }
.shell-link[aria-current="page"] { background: var(--cobalt-tint); color: var(--cobalt); font-weight: 600; }
.shell-link[aria-current="page"] .icon { color: var(--cobalt); }
.shell-link .count { margin-left: auto; }
.shell-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.shell-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; }
.shell-user:hover { background: var(--bone); }
.shell-user .avatar { --size: 28px; }
.shell-user > span:not(.avatar) { display: block; min-width: 0; }
.shell-user strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-user > span:not(.avatar) > span { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.shell-top { display: none; }
.titleband { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 32px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.titleband-text { display: grid; gap: 4px; min-width: 0; }
.titleband-sub { font-size: 13px; color: var(--text-2); }
.titleband-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.titleband .back-link { margin-bottom: 2px; }
.titleband + .tabs-list, .titleband-tabs { padding: 0 32px; }
.shell-body { padding: 24px 32px 64px; width: 100%; max-width: 1180px; }
.shell-body.is-wide { max-width: none; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { display: block; }
  .shell-side { display: none; }
  .shell-top {
    position: sticky; top: var(--admin-bar); z-index: 80; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 56px; padding: 0 8px 0 16px; background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .shell-top .brand svg { height: 22px; }
  .titleband { flex-direction: column; align-items: stretch; padding: 16px var(--gutter) 16px; border-bottom: 0; }
  .titleband h1, .titleband .page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
  .titleband-actions { flex-wrap: wrap; }
  .titleband + .tabs-list, .titleband-tabs { padding: 0 var(--gutter); }
  .shell-body { padding: 16px var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 85; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 60px; font-size: 12px; font-weight: 500; color: var(--text-3); }
  .tabbar a .icon { --i: 22px; }
  .tabbar a[aria-current="page"] { color: var(--cobalt); font-weight: 600; }
  .sticky-action { position: fixed; z-index: 84; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: 12px var(--gutter); background: var(--paper); border-top: 1px solid var(--line); }
}
@media (min-width: 901px) { .sticky-action { display: contents; } }
/* marketing pages: sticky primary action on phones (course page enroll bar) */
@media (max-width: 760px) {
  .sticky-cta { position: fixed; z-index: 84; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .sticky-cta .btn { flex: 1 1 auto; }
  body.has-sticky-cta { padding-bottom: 80px; }
}
@media (min-width: 761px) { .sticky-cta { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
