/* ==========================================================================
   Skillvard — design system
   Warm paper neutrals · ink primary · one accent · editorial serif display
   ========================================================================== */

:root {
  --bg: #fbfaf7;
  --bg-sunken: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --surface-hover: #f2efe8;
  --border: #e9e6de;
  --border-strong: #d8d3c8;
  --text: #1a1814;
  --text-2: #5a564d;
  --text-3: #8d887d;
  --ink: #1a1814;
  --ink-fg: #fbfaf7;
  --accent: #e2531f;
  --accent-hover: #cc4716;
  --accent-soft: #fdebe2;
  --accent-text: #b13f12;
  --success: #2f7d4f;
  --success-soft: #e4f2e8;
  --warning: #a86a06;
  --warning-soft: #fbf0d9;
  --danger: #c2362b;
  --danger-soft: #fbe8e5;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --shadow-xs: 0 1px 2px rgba(26, 24, 20, .05);
  --shadow-sm: 0 1px 2px rgba(26, 24, 20, .04), 0 2px 6px rgba(26, 24, 20, .04);
  --shadow-md: 0 2px 4px rgba(26, 24, 20, .04), 0 12px 32px rgba(26, 24, 20, .08);
  --shadow-lg: 0 24px 64px rgba(26, 24, 20, .18);
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0d; --bg-sunken: #0b0b0a; --surface: #171714; --surface-2: #1c1c19; --surface-hover: #23231f;
    --border: #2a2a25; --border-strong: #3a3a33; --text: #f3f1ea; --text-2: #b8b4a9; --text-3: #7f7b71;
    --ink: #f3f1ea; --ink-fg: #121210; --accent: #ff7a45; --accent-hover: #ff8d5e; --accent-soft: #33190f; --accent-text: #ff9a70;
    --success: #5fbf86; --success-soft: #142a1d; --warning: #e5ad4c; --warning-soft: #2c220f; --danger: #f0776c; --danger-soft: #35140f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 12px 32px rgba(0,0,0,.4); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0d; --bg-sunken: #0b0b0a; --surface: #171714; --surface-2: #1c1c19; --surface-hover: #23231f;
  --border: #2a2a25; --border-strong: #3a3a33; --text: #f3f1ea; --text-2: #b8b4a9; --text-3: #7f7b71;
  --ink: #f3f1ea; --ink-fg: #121210; --accent: #ff7a45; --accent-hover: #ff8d5e; --accent-soft: #33190f; --accent-text: #ff9a70;
  --success: #5fbf86; --success-soft: #142a1d; --warning: #e5ad4c; --warning-soft: #2c220f; --danger: #f0776c; --danger-soft: #35140f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 12px 32px rgba(0,0,0,.4); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-text); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
p { margin: 0; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.025em; }
.display em, .title-xl em { font-style: italic; color: var(--accent); }
.title-xl { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.02em; }
.title-lg { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.title-md { font-size: 16px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.lead { font-size: 17px; color: var(--text-2); line-height: 1.6; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.xs { width: 14px; height: 14px; }
.icon.lg { width: 22px; height: 22px; }
.icon.filled { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--border); border: 0; margin: 20px 0; }
.dot-sep::before { content: "·"; margin: 0 6px; color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; user-select: none;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn-lg { --h: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--accent-text); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; font-weight: 500; }
.back-link:hover { color: var(--text); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-size: 13px; font-weight: 500; color: var(--text); }
.label .opt { color: var(--text-3); font-weight: 400; }
.hint { font-size: 12.5px; color: var(--text-3); }
.input, .textarea, .select {
  width: 100%; height: 40px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: var(--shadow-xs); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover, .select:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.textarea.mono { font-family: var(--mono); font-size: 13px; }
.select { appearance: none; padding-right: 36px; 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='%238d887d' stroke-width='2' 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 10px center; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* OTP */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input {
  width: 100%; aspect-ratio: 1 / 1.15; text-align: center; font: 500 24px var(--mono);
  border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs);
}
.otp input:focus { border-color: var(--accent); box-shadow: var(--focus); }
.otp.error input { border-color: var(--danger); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Dropzone */
.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 40px; height: 40px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); flex: none; }
.dropzone .dz-title { font-weight: 500; font-size: 14px; }
.dropzone .dz-sub { font-size: 12.5px; color: var(--text-3); }
.dropzone.has-file { border-style: solid; background: var(--surface); }
.dropzone.has-file .dz-icon { background: var(--success-soft); color: var(--success); border-color: transparent; }
.dropzone .dz-actions { position: relative; z-index: 1; }
.dz-progress { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; display: none; }
.dz-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.dropzone.uploading .dz-progress { display: block; }

/* ---------- Badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.ink { background: var(--ink); color: var(--ink-fg); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.card-body { padding: 24px; }
.card-foot { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (max-width: 640px) { .card-pad, .card-body { padding: 18px; } .card-head, .card-foot { padding: 14px 18px; } }

/* Generated cover art */
.art { position: relative; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.art > svg, .art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Course card */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.course-card .art { border-bottom: 1px solid var(--border); }
.course-card .cc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-card .cc-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
.course-card .cc-summary { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card .cc-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-3); margin-top: auto; padding-top: 10px; }
.course-card .cc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card .cc-progress { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.art-badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; z-index: 1; }
.art-badges .badge { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-color: transparent; color: var(--text); }

/* Progress */
.bar { height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.done > span { background: var(--success); }
.bar.lg { height: 8px; }
.ring { transform: rotate(-90deg); }
.ring .track { stroke: var(--border); }
.ring .val { stroke: var(--accent); transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }

/* ---------- Public layout ---------- */
.pub-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.pub-header.scrolled { border-bottom-color: var(--border); }
.pub-header .inner { height: 64px; display: flex; align-items: center; gap: 24px; }
.pub-nav { display: flex; gap: 4px; }
.pub-nav a { padding: 6px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; font-size: 14px; }
.pub-nav a:hover { color: var(--text); background: var(--surface-hover); }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 880px; }
@media (max-width: 640px) { .container { padding: 0 16px; } .pub-nav { display: none; } }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo-mark .bg { fill: var(--ink); }
.logo-mark .fg { fill: var(--accent); }
.logo-mark .fg2 { fill: var(--ink-fg); }

.hero { padding: 72px 0 56px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero .lead { max-width: 480px; margin-top: 20px; }
.hero-form { display: flex; gap: 8px; margin-top: 32px; max-width: 460px; }
.hero-form .input { height: 46px; border-radius: 12px; font-size: 15px; }
.hero-note { margin-top: 12px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
@media (max-width: 920px) { .hero { grid-template-columns: 1fr; padding: 40px 0 32px; gap: 40px; } }
@media (max-width: 480px) { .hero-form { flex-direction: column; } }

.mock { position: relative; aspect-ratio: 1 / .92; }
.mock .m-card { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.mock .m-main { inset: 0 10% 14% 0; }
.mock .m-main .art { aspect-ratio: auto; height: 58%; }
.mock .m-main .m-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.mock .m-side { right: 0; bottom: 0; width: 56%; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.mock .m-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); font-size: 13px; }
.mock .m-row.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.mock .m-check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--border-strong); }
.mock .m-check.done { background: var(--success); border-color: var(--success); color: #fff; }
.mock .m-pill { position: absolute; top: 8%; right: 0; background: var(--ink); color: var(--ink-fg); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
@media (max-width: 920px) { .mock { max-width: 520px; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature { padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.feature + .feature { border-left: 1px solid var(--border); }
.feature .f-icon { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); color: var(--accent); margin-bottom: 6px; }
@media (max-width: 800px) { .features { grid-template-columns: 1fr; } .feature + .feature { border-left: 0; border-top: 1px solid var(--border); } .feature { padding: 24px 0; } }

.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.toolbar .input-icon { width: 300px; max-width: 100%; }

.pub-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; margin-top: 40px; }
.pub-footer .inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 13px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--bg-sunken); padding: 16px 12px;
}
.sidebar .logo { padding: 4px 8px 20px; }
.side-label { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 16px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s; }
.side-link:hover { background: var(--surface-hover); color: var(--text); }
.side-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.side-link.active .icon { color: var(--accent); }
.side-link .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 2px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.theme-seg button { height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); border: 1px solid transparent; transition: .12s; }
.user-chip:hover { background: var(--surface); border-color: var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff; flex: none; letter-spacing: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; }
.page { padding: 36px 40px 64px; max-width: 1200px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .sub { color: var(--text-2); margin-top: 6px; }
.scrim { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); background: var(--bg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,15,13,.4); z-index: 50; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
  .page { padding: 24px 16px 48px; }
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab { position: relative; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-weight: 500; font-size: 14px; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }
.tab .count { font-size: 12px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat .s-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 13px; font-weight: 500; }
.stat .s-val { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .s-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-3); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .thumb { width: 64px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); flex: none; }
.table .right { text-align: right; }
.cell-title { font-weight: 500; color: var(--text); }
.mini-bar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.mini-bar .bar { flex: 1; height: 5px; }

/* ---------- Dashboard ---------- */
.resume { display: grid; grid-template-columns: 340px 1fr; overflow: hidden; }
.resume .art { aspect-ratio: auto; min-height: 220px; height: 100%; }
.resume .r-body { padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.resume .next { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.resume .next .n-icon { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--accent); flex: none; }
@media (max-width: 860px) { .resume { grid-template-columns: 1fr; } .resume .art { min-height: 0; aspect-ratio: 16/7; } .resume .r-body { padding: 20px; } }

.list-card { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background .12s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .li-thumb { width: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex: none; }

/* ---------- Course detail ---------- */
.course-head { background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.course-head .inner { display: grid; grid-template-columns: 1fr 360px; gap: 48px; padding: 32px 0 40px; }
.course-head .meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-2); font-size: 13.5px; margin-top: 20px; }
.course-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.course-layout { display: grid; grid-template-columns: 1fr 360px; gap: 48px; padding: 40px 0 64px; }
.enroll-card { position: sticky; top: 88px; overflow: hidden; }
.enroll-card .ec-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.includes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.includes li { display: flex; align-items: center; gap: 10px; }
.includes .icon { color: var(--text-3); }
@media (max-width: 960px) {
  .course-head .inner, .course-layout { grid-template-columns: 1fr; gap: 28px; }
  .enroll-card { position: static; }
  .course-layout { padding-top: 24px; }
}
.app .course-head .inner, .app .course-layout { padding-left: 40px; padding-right: 40px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 960px) { .app .course-head .inner, .app .course-layout { padding-left: 16px; padding-right: 16px; } }

.curriculum { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.curriculum .c-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.lesson-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.lesson-item:last-child { border-bottom: 0; }
a.lesson-item:hover { background: var(--surface-2); }
.l-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-3); border: 1.5px solid var(--border-strong); flex: none; font-variant-numeric: tabular-nums; }
.l-num.done { background: var(--success); border-color: var(--success); color: #fff; }
.l-num.current { border-color: var(--accent); color: var(--accent); }
.l-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }

/* ---------- Player (focus mode) ---------- */
.focus { min-height: 100vh; display: flex; flex-direction: column; }
.focus-bar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); }
.focus-bar .fb-title { font-weight: 600; font-size: 14.5px; }
.focus-bar .fb-sep { width: 1px; height: 24px; background: var(--border); }
.player { flex: 1; display: grid; grid-template-columns: 320px 1fr; }
.player.collapsed { grid-template-columns: 0 1fr; }
.player.collapsed .outline { visibility: hidden; }
.outline { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-sunken); padding: 16px 12px; }
.outline .o-head { padding: 4px 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.o-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: var(--r); color: var(--text-2); font-size: 13.5px; transition: background .12s; }
.o-item:hover { background: var(--surface-hover); color: var(--text); }
.o-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 9px; }
.o-item .l-num { width: 24px; height: 24px; font-size: 11px; margin-top: 1px; }
.o-item .o-meta { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.lesson-main { min-width: 0; padding: 32px 40px 80px; }
.lesson-col { max-width: 760px; margin: 0 auto; }
.video-frame { border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--shadow-md); margin: 0 auto 32px; max-width: 1000px; }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.resource { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); margin-top: 32px; }
.resource .r-icon { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.pager a.next { text-align: right; grid-column: 2; }
.pager .p-label { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.pager a.next .p-label { justify-content: flex-end; }
.pager .p-title { font-weight: 500; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager a.next { grid-column: auto; } }
@media (max-width: 960px) {
  .player, .player.collapsed { grid-template-columns: 1fr; }
  .outline { position: fixed; left: 0; top: 60px; bottom: 0; width: 300px; height: auto; z-index: 40; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); background: var(--bg); visibility: visible !important; }
  .player.mobile-open .outline { transform: none; }
  .lesson-main { padding: 20px 16px 64px; }
  .focus-bar .hide-sm { display: none; }
}

/* Prose */
.prose { font-size: 16px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -0.015em; margin-top: 1.6em; line-height: 1.2; }
.prose h3 { font-size: 19px; margin-top: 1.5em; }
.prose h4 { font-size: 16px; margin-top: 1.4em; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--text-3); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
.prose pre { background: var(--ink); color: var(--ink-fg); padding: 18px 20px; border-radius: var(--r-lg); overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent); font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--text); }
.prose img { border-radius: var(--r-lg); border: 1px solid var(--border); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2em 0; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-form { display: flex; flex-direction: column; padding: 28px 32px; }
.auth-form .af-inner { width: 100%; max-width: 380px; margin: auto; padding: 40px 0; }
.auth-side { position: relative; background: var(--ink); color: var(--ink-fg); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.auth-side .art { position: absolute; inset: 0; aspect-ratio: auto; opacity: .95; }
.auth-side .as-content { position: relative; z-index: 1; max-width: 440px; }
.auth-side .as-quote { font-family: var(--serif); font-size: 34px; line-height: 1.15; letter-spacing: -0.015em; }
.auth-side .as-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; opacity: .85; }
.auth-side .as-list div { display: flex; align-items: center; gap: 10px; }
.auth-side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,15,13,.85), rgba(15,15,13,.15) 60%, transparent); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 20px 16px; } }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(15, 15, 13, .45); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal { width: min(480px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.modal .m-body { padding: 24px; }
.modal .m-title { font-size: 17px; font-weight: 600; }
.modal .m-desc { color: var(--text-2); margin-top: 6px; font-size: 14px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal .m-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; }
.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.sheet[open] { display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.sheet .s-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.sheet .s-body { flex: 1; overflow-y: auto; padding: 24px; }
.sheet .s-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 14px; background: var(--ink); color: var(--ink-fg); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; max-width: min(420px, calc(100vw - 40px)); pointer-events: auto; animation: toast-in .25s cubic-bezier(.2,.8,.2,1); }
.toast.out { animation: toast-out .2s forwards; }
.toast .t-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--success); color: #fff; }
.toast.error .t-icon { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; align-items: stretch; } }

/* Empty, skeleton */
.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .e-art { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); margin-bottom: 8px; }
.empty .e-title { font-size: 16px; font-weight: 600; }
.empty .e-desc { color: var(--text-2); max-width: 360px; font-size: 14px; }
.empty .btn { margin-top: 12px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s ease infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }

/* Lesson editor list */
.lesson-edit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.lesson-edit:last-child { border-bottom: 0; }
.lesson-edit:hover { background: var(--surface-2); }
.lesson-edit .le-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .12s; }
.lesson-edit:hover .le-actions { opacity: 1; }
@media (hover: none) { .lesson-edit .le-actions { opacity: 1; } }

/* Certificate */
.cert-wrap { padding: 32px 16px 64px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.certificate { width: min(960px, 100%); aspect-ratio: 1.414; background: #fdfbf6; color: #1a1814; position: relative; padding: clamp(28px, 6%, 64px); display: flex; flex-direction: column; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 30px 60px -20px rgba(26,24,20,.25); }
.certificate::before { content: ""; position: absolute; inset: clamp(10px, 2%, 18px); border: 1px solid #d9d2bf; pointer-events: none; }
.certificate .c-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #8d887d; }
.certificate .c-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.certificate .c-label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #8d887d; }
.certificate .c-name { font-family: var(--serif); font-size: clamp(36px, 7vw, 76px); line-height: 1; letter-spacing: -0.02em; }
.certificate .c-course { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 3.2vw, 32px); color: #b13f12; }
.certificate .c-foot { display: grid; grid-template-columns: 1fr 1fr auto; gap: 32px; align-items: end; font-size: 13px; }
.certificate .c-line { border-top: 1px solid #1a1814; padding-top: 8px; color: #5a564d; }
.certificate .c-line b { display: block; color: #1a1814; font-weight: 500; }
.certificate .seal { width: 84px; height: 84px; }
@media (max-width: 640px) { .certificate { aspect-ratio: auto; min-height: 480px; } .certificate .c-foot { grid-template-columns: 1fr; gap: 16px; } .certificate .seal { display: none; } }
@media print {
  @page { size: landscape; margin: 0; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .cert-wrap { padding: 0; }
  .certificate { box-shadow: none; width: 100%; }
}

/* Celebrate */
.celebrate { text-align: center; padding: 32px 28px 28px; }
.celebrate .trophy { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }

.fade-in { animation: fade .3s ease backwards; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 640px) { .hide-sm { display: none !important; } }
.clip { overflow: hidden; }

/* ==========================================================================
   v3: storefront, commerce, affiliates, admin, mobile
   ========================================================================== */
.mono { font-family: var(--mono); font-size: .92em; }
.s-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); flex: none; }
.f-icon { width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); color: var(--accent); margin-bottom: 6px; }
@media (max-width: 480px) { .hide-xs { display: none !important; } }
.spinner-lg { width: 22px; height: 22px; border: 2.5px solid var(--text-3); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* Prices */
.price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .p-now { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price .p-was { color: var(--text-3); font-size: 13px; }
.price .p-off { color: var(--success); font-size: 12.5px; font-weight: 600; }
.price.lg .p-now { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.price.lg .p-was { font-size: 15px; }
.price.lg .p-off { font-size: 13px; }
.badge.sale { background: var(--success); color: #fff; border-color: transparent; }
.art-badges .badge.sale { background: var(--success); color: #fff; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cc-cta { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); transition: .2s; }
.course-card:hover .cc-cta { background: var(--ink); color: var(--ink-fg); transform: translateX(2px); }
.course-card .cc-meta { margin-top: 6px; padding-top: 0; }

/* Storefront home */
.hero-v2 { padding: 64px 0 48px; background: radial-gradient(900px 420px at 85% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-2); font-size: 13.5px; }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust .icon { color: var(--success); }
.spotlight { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-md); transition: transform .25s, box-shadow .25s; transform: rotate(.6deg); }
.spotlight:hover { transform: rotate(0) translateY(-3px); box-shadow: var(--shadow-lg); }
.spotlight .sp-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.spotlight .sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.empty-spot { aspect-ratio: 4/3; position: relative; }
.empty-spot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .hero-v2 { padding: 36px 0 24px; } .spotlight { transform: none; } }
.band { background: var(--bg-sunken); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.steps li { display: flex; gap: 14px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.step-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ink); color: var(--ink-fg); font-weight: 600; font-family: var(--serif); font-size: 18px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.earn-band { background: var(--ink); color: var(--ink-fg); border-radius: var(--r-xl); padding: clamp(28px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
.earn-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid color-mix(in srgb, var(--accent) 60%, transparent); opacity: .5; pointer-events: none; }
.earn-band > * { position: relative; z-index: 1; }
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 4px; font-weight: 500; font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-3); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .prose { padding: 0 4px 18px; }
.narrow-col { max-width: 760px; }
.chip-sep { width: 1px; background: var(--border); margin: 4px 6px; }
.toolbar .select { height: 40px; }

/* Public header/footer */
.pub-nav a { white-space: nowrap; }
.pub-footer .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 28px; }
.pub-footer .foot-grid a { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.pub-footer .foot-grid a:hover { color: var(--text); }
.pub-footer .foot-grid .logo { padding: 0; }
.foot-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
@media (max-width: 760px) { .pub-footer .foot-grid { grid-template-columns: 1fr 1fr; } .pub-footer .foot-grid > :first-child { grid-column: span 2; } }

/* Course sales page */
.outcomes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.outcomes li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); }
.outcomes .icon { color: var(--success); margin-top: 2px; }
@media (max-width: 640px) { .outcomes { grid-template-columns: 1fr; } }
.coupon-box summary { cursor: pointer; list-style: none; font-size: 13.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.coupon-box summary::-webkit-details-marker { display: none; }
.coupon-box summary:hover { color: var(--text); }
.coupon-box .input { height: 38px; font-family: var(--mono); }
.applied { margin-top: 8px; font-size: 13px; color: var(--success); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.applied .link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; color: var(--text-3); }
.buybar { display: none; }
@media (max-width: 960px) {
  .buybar { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,.06); }
  .buybar .btn { height: 44px; padding: 0 22px; }
  .app .buybar { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .course-layout { padding-bottom: 96px; }
}

/* App shell: mobile tab bar */
.side-nav { overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.tabbar { display: none; }
@media (max-width: 960px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--border); }
  .tb-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--text-3); background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tb-item.active { color: var(--text); }
  .tb-item.active .icon { color: var(--accent); }
  .app .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-bar .logo { padding: 0 4px; }
  .mobile-bar .avatar { width: 30px; height: 30px; font-size: 11.5px; }
}

/* Player */
.video-frame { position: relative; --plyr-color-main: var(--accent); --plyr-video-background: #000; --plyr-menu-radius: 10px; --plyr-font-family: var(--sans); }
.video-frame .plyr { border-radius: var(--r-lg); }
.video-loading, .video-processing { aspect-ratio: 16/9; display: grid; place-items: center; align-content: center; gap: 8px; background: #111; color: #cfcac0; text-align: center; padding: 24px; }
.video-processing .icon { color: #8d887d; }
.watermark { position: absolute; z-index: 5; pointer-events: none; color: rgba(255,255,255,.16); font-size: 12px; font-weight: 500; transition: left 2s, top 2s; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.preview-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-text); margin: 0 auto 20px; max-width: 1000px; font-size: 14px; flex-wrap: wrap; }
.o-item.locked { opacity: .55; cursor: not-allowed; }
.o-item.locked:hover { background: transparent; color: var(--text-2); }
@media (max-width: 640px) { .video-frame { margin-left: -16px; margin-right: -16px; border-radius: 0; } .video-frame .plyr { border-radius: 0; } }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-col span { display: block; width: 100%; background: color-mix(in srgb, var(--accent) 75%, transparent); border-radius: 3px 3px 0 0; min-height: 2px; transition: background .15s; }
.bar-col:hover span { background: var(--accent); }
.grid-2-1 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .grid-2-1 { grid-template-columns: 1fr; } }

/* Affiliates */
.aff-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: end; }
.aff-hero .title-xl em { font-style: italic; color: var(--accent); }
.aff-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.aff-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.aff-stats .s-val { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
@media (max-width: 860px) { .aff-hero { grid-template-columns: 1fr; } }
.balance-card { display: grid; grid-template-columns: 1fr 1.4fr; overflow: hidden; }
.bc-main { padding: 24px; background: var(--ink); color: var(--ink-fg); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.bc-main .text-3, .bc-main .xs { color: color-mix(in srgb, var(--ink-fg) 65%, transparent); }
.bc-amt { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.bc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.bc-grid > div { padding: 18px 22px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.bc-grid > div:nth-child(n+3) { border-bottom: 0; }
@media (max-width: 760px) { .balance-card { grid-template-columns: 1fr; } .bc-grid > div { border-left: 0; } .bc-grid > div:nth-child(odd) { border-right: 1px solid var(--border); } }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; min-width: 0; font-size: 13px; }
.coupon-chip { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-2); }

/* Admin */
.attention { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.att-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.att-item:hover { filter: brightness(.97); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-prefix .input { padding-left: 28px; }
.l-type.danger { color: var(--danger); }
.steps-sm { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; font-size: 14px; }
.steps-sm > div { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.steps-sm ol { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
.steps-sm li + li { margin-top: 4px; }
@media (max-width: 700px) { .steps-sm { grid-template-columns: 1fr; } }
.code-block { background: var(--ink); color: var(--ink-fg); padding: 14px 16px; border-radius: var(--r); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.table td .badge + .badge { margin-left: 4px; }
@media (max-width: 640px) { .table th, .table td { padding: 10px 12px; } .page-head .row.wrap { width: 100%; } }
.pub-footer .foot-grid a.logo { display: inline-flex; }
.course-head .inner.container, .course-layout.container { padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .course-head .inner.container, .course-layout.container { padding-left: 16px; padding-right: 16px; } }
