/* Buyer pages (library, watch) and the dashboard. Same tokens as /index.html. */
:root {
  --bg: #FFFFFF; --mist: #F4F6FA; --mist-2: #E9EDF4;
  --ink: #0F172A; --ink-2: #1E293B; --slate: #475569; --slate-2: #5B6678;
  --line: #E2E8F0; --line-2: #CBD5E1;
  --accent: #2E5BFF; --accent-deep: #1E44E0; --accent-soft: #EEF2FF; --accent-ink: #1D3FD0;
  --good: #0F7B4A; --good-soft: #E7F6EE; --warn: #9A5B00; --warn-soft: #FFF4E0; --bad: #B42318; --bad-soft: #FEECEB;
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(15,23,42,.05);
  --sh-2: 0 1px 2px rgba(15,23,42,.04), 0 10px 28px -14px rgba(15,23,42,.16);
  --sh-cover: 0 1px 2px rgba(15,23,42,.06), 0 18px 40px -24px rgba(15,23,42,.35);
  --ease: cubic-bezier(.2,.7,.2,1);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --display: Anton, Impact, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.top { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 650; text-decoration: none; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand span { color: var(--slate-2); font-weight: 450; }
.top nav { display: flex; gap: 18px; align-items: center; font-size: 15px; flex: none; }
.top nav a { color: var(--slate); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 380px) { .brand span { display: none; } }

/* Type */
h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.12; letter-spacing: -.025em; font-weight: 650; }
h2 { font-size: 20px; letter-spacing: -.015em; font-weight: 620; line-height: 1.25; }
h3 { font-size: 17px; letter-spacing: -.01em; font-weight: 620; line-height: 1.3; }
.lede { color: var(--slate); font-size: 17px; margin-top: 10px; max-width: 620px; }
.muted { color: var(--slate-2); }
.small { font-size: 14px; }
.label { display: block; font-size: 14px; color: var(--slate); font-weight: 500; margin-bottom: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn:hover { background: var(--accent-deep); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: var(--mist); color: var(--ink); }
.btn-ghost:hover { background: var(--mist-2); }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-line:hover { background: var(--mist); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 550; cursor: pointer; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }

/* Surfaces */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.field { width: 100%; min-height: 48px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px; background: #fff; font-size: 16px; }
textarea.field { padding: 12px 14px; min-height: 120px; line-height: 1.5; resize: vertical; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.notice { border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; margin-top: 20px; }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--accent-soft); color: var(--accent-ink); }
.notice a { color: inherit; font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 550; white-space: nowrap; background: var(--mist); color: var(--slate); }
.chip.out { background: var(--good-soft); color: var(--good); }
.chip.dated { background: var(--accent-soft); color: var(--accent-ink); }
.chip.done { background: var(--ink); color: #fff; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

/* Tabs (segmented) */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--mist); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; cursor: pointer; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 550; color: var(--slate); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.tabs button .n { color: var(--slate-2); font-weight: 450; margin-left: 4px; }

/* Lesson covers: one stable style per chapter, same look as the store */
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; padding: 10px 9%; box-shadow: var(--sh-cover); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.cover .cv-k { position: relative; z-index: 1; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cover .cv-t { position: relative; z-index: 1; margin-top: 6px; padding-bottom: .1em; font-size: 16px; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover .cv-mark { position: absolute; right: -4%; bottom: -12%; width: 40%; height: auto; fill: none; stroke: currentColor; stroke-width: 1; opacity: .14; }
.cover.sm { border-radius: 12px; padding: 8px 8%; }
.cover.sm .cv-k { font-size: 8.5px; }
.cover.sm .cv-t { font-size: 12.5px; -webkit-line-clamp: 2; }
.cv-serif .cv-t { font-family: var(--serif); font-size: 19px; line-height: 1.04; }
.cover.sm.cv-serif .cv-t { font-size: 15px; }
.cv-display .cv-t { font-family: var(--display); letter-spacing: .01em; }
@media (min-width: 720px) { .cover .cv-t { font-size: 18px; } .cv-serif .cv-t { font-size: 23px; } .cover.sm .cv-t { font-size: 16px; -webkit-line-clamp: 3; } .cover.sm.cv-serif .cv-t { font-size: 20px; } }
.cv-a { background: radial-gradient(60% 80% at 15% 20%, #ff9a5c 0, transparent 60%), radial-gradient(55% 75% at 90% 85%, #3b82f6 0, transparent 60%), radial-gradient(50% 60% at 85% 10%, #f472b6 0, transparent 55%), #fdf3e7; color: #1c1917; }
.cv-b { background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.07) 0 2px, transparent 2px 14px), #3f4a2a; color: #f5f0dc; }
.cv-c { background: repeating-linear-gradient(0deg, rgba(120,90,40,.05) 0 1px, transparent 1px 4px), #efe8da; color: #d4381e; }
.cv-d { background: radial-gradient(70% 90% at 50% 120%, #f97316 0, transparent 60%), linear-gradient(160deg, #111827, #1e1b4b); color: #fff; }
.cv-e { background: radial-gradient(60% 70% at 50% 40%, rgba(147,197,253,.35) 0, transparent 70%), linear-gradient(180deg, #0b1d3a, #13315c); color: #e0ecff; }
.cv-f { background: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(160deg, #0f4c4c, #0a2e33); color: #e6fffb; }
.cv-g { background: radial-gradient(60% 80% at 80% 20%, #c4b5fd 0, transparent 60%), radial-gradient(60% 80% at 10% 90%, #fbcfe8 0, transparent 60%), #ede9fe; color: #1e1b4b; }
.cv-h { background: radial-gradient(rgba(120,80,30,.12) 1px, transparent 1.5px) 0 0 / 12px 12px, #f3e9d8; color: #5b3a1a; }
.cv-i { background: radial-gradient(50% 70% at 50% 50%, rgba(190,242,100,.12) 0, transparent 70%), #0b0b0c; color: #d9f99d; }
.cv-j { background: repeating-linear-gradient(90deg, rgba(20,83,45,.05) 0 1px, transparent 1px 6px), #e7f5ec; color: #14532d; }

/* Thumbnail cover (chapter lists, strips): no chapter label, tiny title */
.cover.th { border-radius: 9px; padding: 5px 8%; box-shadow: 0 1px 2px rgba(15,23,42,.1), 0 6px 14px -8px rgba(15,23,42,.35); }
.cover.th .cv-k { display: none; }
.cover.th .cv-t { margin-top: 0; font-size: 9.5px; line-height: 1.1; -webkit-line-clamp: 3; }
.cover.th.cv-serif .cv-t { font-size: 12px; line-height: 1.02; }
.cover.th .cv-mark { width: 46%; opacity: .16; }

/* Hero cover: chapter top left, big title bottom left, play button in the middle */
.cover.xl { aspect-ratio: 16 / 9; border-radius: var(--r-lg); align-items: flex-start; justify-content: flex-end; text-align: left; padding: 0 6% 5.5%; }
.cover.xl .cv-k { position: absolute; top: 7%; left: 6%; right: 6%; font-size: 10.5px; }
.cover.xl .cv-t { margin: 0; max-width: 80%; font-size: 21px; line-height: 1.12; -webkit-line-clamp: 2; }
.cover.xl.cv-serif .cv-t { font-size: 25px; line-height: 1.04; }
.cover.xl .cv-mark { width: 34%; bottom: -10%; }
@media (min-width: 520px) { .cover.xl .cv-t { font-size: 30px; } .cover.xl.cv-serif .cv-t { font-size: 36px; } .cover.xl .cv-k { font-size: 11.5px; } }
@media (min-width: 720px) { .cover.xl .cv-t { font-size: 44px; } .cover.xl.cv-serif .cv-t { font-size: 54px; } .cover.xl .cv-k { font-size: 12px; } }

/* Play button: white circle, cobalt triangle */
.play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(15,23,42,.12), 0 10px 26px -8px rgba(15,23,42,.45); transition: transform .3s var(--ease); }
.play svg { width: 42%; height: 42%; margin-left: 8%; fill: var(--accent); }
@media (min-width: 520px) { .play:not(.sm) { width: 68px; height: 68px; margin: -34px 0 0 -34px; } }
@media (min-width: 720px) { .play:not(.sm) { width: 88px; height: 88px; margin: -44px 0 0 -44px; } }
.play.sm { left: auto; top: auto; right: 10px; bottom: 10px; width: 34px; height: 34px; margin: 0; box-shadow: 0 1px 2px rgba(15,23,42,.12), 0 6px 14px -6px rgba(15,23,42,.4); }
.reserved { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink); font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; box-shadow: 0 6px 18px -8px rgba(15,23,42,.4); }

/* Small pills and status text */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--mist); color: var(--slate); }
.pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pill.agent { background: var(--ink); color: #fff; }
.lt-m .pill { height: 22px; padding: 0 9px; font-size: 12px; }
.st.out { color: var(--good); font-weight: 550; }

/* One quiet line for news (payment received, still processing) */
.note-line { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--slate); }
.note-line b { color: var(--ink); font-weight: 600; }
.note-line .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.note-line.info .dot { background: var(--accent-soft); color: var(--accent-ink); }
.note-line .dot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.note-line + .note-line { margin-top: 8px; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--slate-2); font-size: 14px; }
.foot a { color: var(--slate); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
