/* ==========================================================================
   SaasBahuList — app.css
   Design system v1: tokens, base, app shell, shared components.
   Dark is the default; light comes from [data-theme="light"] or the system.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #120A09;   --s1: #1B0F0D;   --s2: #251512;   --s3: #311C18;
  --line: #3E2621; --line2: #2C1A17;
  --tx: #FBEEDB;   --tx2: #CDB4A0;  --tx3: #A08575;
  --brand: #C62A20; --brand-press: #A3211A; --on-brand: #FDEBC8;
  --gold: #F4A21E;  --on-gold: #1E0C06;  --gold-ink: #F6B44A;
  --gold-soft: rgba(244,162,30,.14); --gold-line: rgba(244,162,30,.5);
  --star: #F4A21E; --cream: #FDEBC8;
  --ok: #7CC98A;   --ok-soft: rgba(124,201,138,.14);
  --teal: #6CC4D0; --teal-soft: rgba(108,196,208,.14);
  --ash: #B39A8E;  --ash-soft: rgba(179,154,142,.14);
  --danger: #FF7A6B; --danger-soft: rgba(255,122,107,.16);
  --scrim: rgba(10,4,3,.72);
  --glass: rgba(18,10,9,.74);
  --e1: 0 2px 8px rgba(0,0,0,.35);
  --e2: 0 10px 30px rgba(0,0,0,.5);
  --e3: 0 -12px 40px rgba(0,0,0,.6);
  color-scheme: dark;

  /* type */
  --disp: "Rozha One", Georgia, serif;
  --ui: "Mukta", "Noto Sans Devanagari", system-ui, sans-serif;
  --fs-display: 40px; --fs-h1: 32px; --fs-h2: 24px; --fs-h3: 18px;
  --fs-body-l: 18px;  --fs-body: 16px; --fs-label: 15px;
  --fs-small: 14px;   --fs-caption: 13px;

  /* space — 4-pt */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px; --sp-10: 64px;
  --gutter: 16px;

  /* shape */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px;
  --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;

  /* motion */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-4: 600ms;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-drama: cubic-bezier(.3, 1.6, .5, 1);

  /* app shell */
  --tap: 48px; --bar-h: 56px; --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh;
  --max: 1320px;
}

:root[data-theme="light"] {
  --bg: #FBF5EC;   --s1: #FFFDF9;   --s2: #F5EBDD;   --s3: #EEDFCB;
  --line: #E3D0B8; --line2: #EDE0CE;
  --tx: #2B1411;   --tx2: #6A4A41;  --tx3: #7A5A50;
  --brand: #AF1E18; --brand-press: #8E1712; --on-brand: #FFF4E2;
  --gold-ink: #9A5A00; --star: #C77700;
  --ok: #2F7A3E;  --ok-soft: rgba(47,122,62,.10);
  --teal: #1F6E7A; --teal-soft: rgba(31,110,122,.10);
  --ash: #7A5A50;  --ash-soft: rgba(122,90,80,.10);
  --danger: #B42318; --danger-soft: rgba(180,35,24,.10);
  --scrim: rgba(43,20,17,.5);
  --e1: 0 2px 8px rgba(80,30,10,.10);
  --e2: 0 10px 30px rgba(80,30,10,.16);
  --e3: 0 -12px 40px rgba(80,30,10,.18);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FBF5EC;   --s1: #FFFDF9;   --s2: #F5EBDD;   --s3: #EEDFCB;
    --line: #E3D0B8; --line2: #EDE0CE;
    --tx: #2B1411;   --tx2: #6A4A41;  --tx3: #7A5A50;
    --brand: #AF1E18; --brand-press: #8E1712; --on-brand: #FFF4E2;
    --gold-ink: #9A5A00; --star: #C77700;
    --ok: #2F7A3E;  --ok-soft: rgba(47,122,62,.10);
    --teal: #1F6E7A; --teal-soft: rgba(31,110,122,.10);
    --ash: #7A5A50;  --ash-soft: rgba(122,90,80,.10);
    --danger: #B42318; --danger-soft: rgba(180,35,24,.10);
    --scrim: rgba(43,20,17,.5);
    --e1: 0 2px 8px rgba(80,30,10,.10);
    --e2: 0 10px 30px rgba(80,30,10,.16);
    --e3: 0 -12px 40px rgba(80,30,10,.18);
    color-scheme: light;
  }
}

@media (min-width: 1024px) {
  :root { --fs-display: 56px; --fs-h1: 44px; --fs-h2: 30px; --fs-h3: 20px; --gutter: 32px; }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + var(--safe-t) + 8px); }
body {
  margin: 0;
  min-height: var(--app-h);
  background: var(--bg);
  color: var(--tx);
  font-family: var(--ui);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-soft); }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-md); background: var(--gold); color: var(--on-gold); font-weight: 700; }
.skip-link:focus { top: calc(var(--safe-t) + 8px); }

.clamp1, .clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; }
.clamp2 { -webkit-line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tap { transition: transform var(--dur-1) var(--ease), background-color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-2); }
.tap:active { transform: scale(.97); }
.row { transition: background-color var(--dur-1); }
.row:active { background: var(--s2); }
@media (hover: hover) {
  .row:hover { background: var(--s2); }
  .lift { transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2); }
  .lift:hover { transform: translateY(-3px); }
}

@keyframes sbl-spin { to { transform: rotate(360deg); } }
@keyframes sbl-pulse { 50% { opacity: .5; } }
@keyframes sbl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sbl-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sbl-sheet { from { transform: translateY(100%); } to { transform: none; } }
.spin { animation: sbl-spin 1.2s linear infinite; transform-origin: 50% 50%; }
.pulse { animation: sbl-pulse 1.2s ease-in-out infinite; }
.fade { animation: sbl-fade var(--dur-3) var(--ease) both; }
.rise { animation: sbl-rise var(--dur-3) var(--ease-out) both; }

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

/* ---------- 3. Type helpers ---------- */
.disp { font-family: var(--disp); font-weight: 400; letter-spacing: 0; }
.t-display { font-family: var(--disp); font-weight: 400; font-size: var(--fs-display); line-height: 1.1; }
.t-h1 { font-family: var(--disp); font-weight: 400; font-size: var(--fs-h1); line-height: 1.15; }
.t-h2 { font-family: var(--disp); font-weight: 400; font-size: var(--fs-h2); line-height: 1.15; }
.t-h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; }
.t-body-l { font-size: var(--fs-body-l); line-height: 1.55; }
.t-small { font-size: var(--fs-small); }
.t-caption { font-size: var(--fs-caption); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.meta { font-size: var(--fs-caption); color: var(--tx3); }
.muted { color: var(--tx2); }
.faint { color: var(--tx3); }
.gold { color: var(--gold-ink); }
.link { color: var(--gold-ink); font-weight: 600; }
.link-u { color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 4. Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: 100%; max-width: 760px; margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; }
.page { display: flex; flex-direction: column; gap: 30px; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 56px); min-height: 60vh; }
.page--flush { gap: 0; }
.page--tight { gap: 20px; }
.has-no-tabbar .page { padding-bottom: calc(var(--safe-b) + 32px); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-family: var(--disp); font-weight: 400; font-size: var(--fs-h2); line-height: 1.15; }
.section-head a, .section-head .section-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--gold-ink); white-space: nowrap; }
.section-sub { margin: -6px 0 8px; font-size: var(--fs-small); color: var(--tx3); }

.rail { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; padding-inline: var(--gutter); scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* ---------- 5. App shell: mobile top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) 4px 0;
  background: var(--bg);
  transition: background-color var(--dur-2), box-shadow var(--dur-2);
}
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--line2); }
.topbar--brand { padding-left: 14px; }
.topbar__brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 48px; }
.topbar__brand .wordmark { font-family: var(--disp); font-size: 23px; line-height: 1; }
.topbar__title { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title--disp { font-family: var(--disp); font-weight: 400; font-size: 26px; line-height: 1; }
.topbar__actions { display: flex; align-items: center; gap: 2px; }
/* Floats over a hero: transparent until scrolled */
.topbar--overlay { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(10,4,3,.6), rgba(10,4,3,0)); color: #FBEEDB; }
.topbar--overlay.is-scrolled { background: var(--bg); color: var(--tx); }
.topbar--overlay .icon-btn--glass { background: var(--glass); color: #FBEEDB; }
.topbar--overlay.is-scrolled .icon-btn--glass { background: transparent; color: var(--tx); }

/* ---------- 6. App shell: bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-end;
  height: calc(68px + var(--safe-b));
  padding: 0 4px var(--safe-b);
  background: var(--s1);
  border-top: 1px solid var(--line2);
}
.tabbar__item {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 64px; font-size: 13px; font-weight: 600; color: var(--tx3);
}
.tabbar__item[aria-current="page"] { color: var(--gold-ink); font-weight: 700; }
.tabbar__item[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.tabbar__item--center { height: 84px; margin-top: -20px; justify-content: flex-start; }
.tabbar__item--center::before { display: none; }
.tabbar__fab {
  width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #FDEBC8;
  box-shadow: 0 0 0 4px var(--s1), 0 0 0 6px var(--gold), 0 8px 18px rgba(0,0,0,.35);
}
.tabbar__item--center[aria-current="page"] .tabbar__fab { background: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 4px var(--s1), 0 0 0 6px var(--brand), 0 8px 18px rgba(0,0,0,.35); }

/* Tablet landscape (840–1023): the tab bar becomes an 80px left rail */
@media (min-width: 840px) and (max-width: 1023px) {
  body { padding-left: 80px; }
  .tabbar { top: 0; right: auto; width: 80px; height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; padding: calc(var(--safe-t) + 72px) 0 var(--safe-b); border-top: 0; border-right: 1px solid var(--line2); }
  .tabbar__item { flex: none; height: 72px; }
  .tabbar__item[aria-current="page"]::before { top: 50%; left: 0; width: 3px; height: 28px; border-radius: 0 3px 3px 0; transform: translateY(-50%); }
  .tabbar__item--center { height: 92px; margin-top: 0; justify-content: center; }
  .topbar--overlay { left: 80px; }
  .toasts { left: 80px; bottom: calc(var(--safe-b) + 24px); }
  .page { padding-bottom: calc(var(--safe-b) + 40px); }
}

/* ---------- 7. App shell: desktop header + footer ---------- */
.deskbar { display: none; }
.site-footer { display: none; }

@media (min-width: 1024px) {
  .topbar:not(.topbar--keep) { display: none; }
  .tabbar { display: none; }
  .page { padding-bottom: 0; }
  .deskbar { display: block; position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line2); }
  .deskbar__in { max-width: var(--max); margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; gap: 24px; }
  .deskbar__brand { display: flex; align-items: center; gap: 10px; flex: none; }
  .deskbar__brand .wordmark { font-family: var(--disp); font-size: 26px; line-height: 1; }
  .deskbar__nav { display: flex; gap: 4px; }
  .deskbar__nav a { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--tx2); transition: background-color var(--dur-1); }
  .deskbar__nav a:hover { background: var(--s2); }
  .deskbar__nav a[aria-current="page"] { color: var(--gold-ink); background: var(--gold-soft); font-weight: 700; }
  .deskbar__search { position: relative; flex: 0 1 380px; min-width: 220px; margin-left: auto; }
  .deskbar__search .search-field { height: 46px; }
  .deskbar__me { flex: none; }
  .deskbar__login { display: inline-flex; align-items: center; height: 46px; padding: 0 18px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font-weight: 700; }

  .site-footer { display: block; margin-top: 80px; border-top: 1px solid var(--line2); background: var(--s1); }
  .site-footer__in { max-width: var(--max); margin: 0 auto; padding: 40px 32px 32px; display: flex; flex-wrap: wrap; gap: 48px; }
  .site-footer__about { flex: 1 1 300px; }
  .site-footer__about p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--tx2); max-width: 340px; }
  .site-footer nav { flex: 0 1 180px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
  .site-footer nav .eyebrow { color: var(--tx3); margin-bottom: 4px; letter-spacing: .12em; }
  .site-footer nav a { color: var(--tx2); min-height: 32px; display: inline-flex; align-items: center; gap: 4px; }
  .site-footer nav a:hover { color: var(--tx); }
  .site-footer__legal { max-width: var(--max); margin: 0 auto; padding: 16px 32px 28px; border-top: 1px solid var(--line2); font-size: 14px; color: var(--tx3); }
}

/* ---------- 8. Logo ---------- */
.logo-mark { flex: none; }
.wordmark { font-family: var(--disp); }

/* ---------- 9. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-label); font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-1), border-color var(--dur-1), opacity var(--dur-2);
}
.btn:active { transform: scale(.97); }
.btn svg { flex: none; }
.btn--primary { min-height: 52px; background: var(--brand); color: var(--on-brand); font-size: 16px; font-weight: 700; }
.btn--primary:active { background: var(--brand-press); }
@media (hover: hover) { .btn--primary:hover { background: var(--brand-press); } }
.btn--gold { background: var(--gold); color: var(--on-gold); font-weight: 700; }
.btn--secondary { background: var(--s2); border-color: var(--line); }
@media (hover: hover) { .btn--secondary:hover { background: var(--s3); } }
.btn--outline { background: transparent; border-color: var(--line); }
.btn--tonal { background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; }
.btn--ghost { background: transparent; color: var(--gold-ink); }
.btn--danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); font-weight: 700; }
.btn--lg { min-height: 56px; font-size: 17px; font-weight: 700; }
.btn--sm { min-height: 44px; padding: 0 14px; border-radius: 12px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"]::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.4px solid currentColor; border-right-color: transparent; animation: sbl-spin .8s linear infinite; }

.icon-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-1);
}
.icon-btn:active { transform: scale(.94); background: var(--s2); }
.icon-btn--filled { background: var(--s2); }
.icon-btn--sm { width: 44px; height: 44px; }
.icon-btn--glass { background: var(--glass); color: #FBEEDB; }

/* ---------- 10. Chips, segmented controls, tabs ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--s2); color: var(--tx);
  font-size: var(--fs-label); font-weight: 600; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}
.chip:active { transform: scale(.97); }
.chip .chip__check { display: none; }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.is-on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.chip[aria-pressed="true"] .chip__check, .chip[aria-checked="true"] .chip__check, .chip.is-on .chip__check { display: inline-block; }
.chip__count { font-weight: 500; opacity: .75; }
.chip--ghost { background: transparent; }
.chip--link { border-color: transparent; background: transparent; color: var(--gold-ink); font-weight: 700; }
.chip-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--gold); color: var(--on-gold); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.chip-x { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px 0 12px; border-radius: var(--r-pill); background: var(--gold-soft); color: var(--gold-ink); font-size: 14px; font-weight: 600; }
.chip-x button { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--s2); border: 1px solid var(--line); }
.seg > a, .seg > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; color: var(--tx2); transition: background-color var(--dur-2), color var(--dur-2); }
.seg > [aria-selected="true"], .seg > [aria-pressed="true"], .seg > [aria-checked="true"], .seg > [aria-current="page"], .seg > [aria-current="true"], .seg > .is-on { background: var(--gold); color: var(--on-gold); font-weight: 700; }
.seg--icons > button { width: 40px; padding: 0; color: var(--tx3); }
.seg--icons > [aria-pressed="true"] { background: var(--s3); color: var(--gold-ink); }
.seg--block { display: flex; border-radius: var(--r-md); }
.seg--block > * { flex: 1; min-height: 44px; border-radius: 11px; }

.tabs { display: flex; border-bottom: 1px solid var(--line2); }
.tabs > [role="tab"], .tabs > a { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; font-size: 15px; font-weight: 600; color: var(--tx3); }
.tabs > [aria-selected="true"], .tabs > [aria-current="page"] { color: var(--tx); font-weight: 700; }
.tabs > [aria-selected="true"]::after, .tabs > [aria-current="page"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.tabs .tab-count { font-weight: 500; }

/* ---------- 11. Thumbnails & show cards ---------- */
.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--r-md); background: var(--ph, var(--s3));
}
.thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-3) var(--ease); }
.thumb > img.is-loaded { opacity: 1; }
.thumb--sm { border-radius: var(--r-sm); }
.thumb--shadow { box-shadow: var(--e1); }
.thumb__fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-family: var(--disp); font-size: 18px; line-height: 1.1; color: rgba(253,235,200,.85); }
.thumb.has-img .thumb__fallback { display: none; }
.badge-new { position: absolute; top: 8px; left: 8px; z-index: 1; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 700; line-height: 22px; letter-spacing: .02em; }
.thumb__mine { position: absolute; top: 8px; right: 8px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: var(--glass); color: #F4A21E; display: inline-flex; align-items: center; justify-content: center; }
.thumb__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 4px; background: rgba(255,255,255,.22); }
.thumb__bar > span { display: block; height: 100%; background: #F4A21E; }
.thumb__shade { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 64px; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.thumb__next { position: absolute; left: 10px; bottom: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--glass); color: #FBEEDB; font-size: 13px; font-weight: 700; }

.show-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.show-card__title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.show-card__meta { margin-top: -4px; font-size: 13px; line-height: 1.3; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-card__mine { font-size: 13px; font-weight: 700; color: var(--gold-ink); }
.rail .show-card { width: 196px; }
@media (min-width: 1024px) {
  .show-card { gap: 10px; }
  .show-card__title { font-size: 16px; }
  .show-card__meta { font-size: 14px; margin-top: -6px; }
}

.grid-shows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
@media (min-width: 600px) { .grid-shows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-shows { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 20px; } }

.cw-card { display: flex; flex-direction: column; gap: 10px; width: 264px; }
.cw-card__title { font-size: 16px; font-weight: 700; }
.cw-card__prog { font-size: 13px; color: var(--tx3); }

.show-row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px; margin: 0 -8px; border-radius: var(--r-md); }
.show-row .thumb { flex: none; width: 112px; border-radius: var(--r-sm); }
.show-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.show-row__title { font-size: 16px; font-weight: 700; }
.show-row__meta { font-size: 13px; color: var(--tx3); }
.show-row__extra { font-size: 13px; font-weight: 700; color: var(--gold-ink); }
.show-row__rank { flex: none; width: 26px; text-align: center; font-family: var(--disp); font-size: 30px; line-height: 1; color: var(--gold-ink); }
.show-row__chev { flex: none; color: var(--tx3); }

/* ---------- 12. Cast avatars ---------- */
.avatar {
  --size: 60px;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--av, linear-gradient(135deg,#3E2621,#251512)); color: #FDEBC8;
  font-family: var(--disp); font-size: calc(var(--size) * .38); line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(253,235,200,.22);
}
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.avatar__paisley { position: absolute; right: 12%; bottom: 6%; width: 27%; opacity: .2; }
.avatar--40 { --size: 40px; } .avatar--44 { --size: 44px; } .avatar--56 { --size: 56px; } .avatar--60 { --size: 60px; }
.avatar--76 { --size: 76px; } .avatar--80 { --size: 80px; } .avatar--96 { --size: 96px; } .avatar--112 { --size: 112px; }
.avatar--120 { --size: 120px; } .avatar--160 { --size: 160px; }
.avatar-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 8px; }
.avatar-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cast-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.cast-tile__name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.cast-tile__role { margin-top: -6px; font-size: 13px; color: var(--tx3); }
.rail .cast-tile { width: 84px; }

/* ---------- 13. Progress ---------- */
.progress { height: 4px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width var(--dur-4) var(--ease-out); }
.progress--lg { height: 8px; border-radius: var(--r-pill); }
.progress--done > span { background: var(--ok); }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.progress-head b { font-weight: 700; }

/* ---------- 14. Watch status ---------- */
.st-watching { --st: var(--gold-ink); --st-bg: var(--gold-soft); --st-bd: var(--gold-line); }
.st-watched { --st: var(--ok); --st-bg: var(--ok-soft); --st-bd: var(--ok-soft); }
.st-want_to_watch { --st: var(--teal); --st-bg: var(--teal-soft); --st-bd: var(--teal-soft); }
.st-dropped { --st: var(--ash); --st-bg: var(--ash-soft); --st-bd: var(--ash-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--st-bg); color: var(--st); font-size: 14px; font-weight: 600; }
.status-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--st-bd, transparent); background: var(--st-bg, var(--brand)); color: var(--st, var(--on-brand)); font-size: 17px; font-weight: 700; text-align: left; }
.status-btn__label { flex: 1; }
.status-btn__extra { font-size: 14px; font-weight: 600; opacity: .85; }

.option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 10px 14px; border-radius: 16px; background: var(--s2); border: 1.5px solid transparent; text-align: left; transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-1) var(--ease); }
.option:active { transform: scale(.98); }
.option__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--st-bg, var(--s3)); color: var(--st, var(--tx2)); display: inline-flex; align-items: center; justify-content: center; }
.option__body { flex: 1; min-width: 0; }
.option__title { display: block; font-size: 16px; font-weight: 700; }
.option__desc { display: block; font-size: 13px; color: var(--tx2); }
.option__radio { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--on-gold); }
.option__radio svg { opacity: 0; }
.option[aria-checked="true"] { background: var(--gold-soft); border-color: var(--gold-line); }
.option[aria-checked="true"] .option__radio { background: var(--gold); border-color: var(--gold); }
.option[aria-checked="true"] .option__radio svg { opacity: 1; }

/* ---------- 15. Ratings ---------- */
.rating-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); background: var(--s2); font-size: 14px; font-weight: 600; }
.rating-chip--new { background: transparent; border: 1px dashed var(--line); color: var(--tx2); }
.rating-chip .faint { font-weight: 500; }
.star-row { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; }
.star-input { display: flex; gap: 2px; }
.star-input button { position: relative; width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; }
.star-input .star { position: relative; width: 40px; height: 40px; }
.star-input .star svg { position: absolute; inset: 0; width: 40px; height: 40px; }
.star-input .star__fill { position: absolute; top: 0; left: 0; bottom: 0; width: 0; overflow: hidden; transition: width var(--dur-2) var(--ease); }
.star-input .star__fill svg { width: 40px; height: 40px; }

/* ---------- 16. Forms ---------- */
.label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--s2); color: var(--tx);
  font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.field::placeholder { color: var(--tx3); }
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.field[aria-invalid="true"] { border: 2px solid var(--danger); }
.field.is-ok { border: 2px solid var(--ok); }
textarea.field { min-height: 110px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
select.field { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A08575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field-wrap { display: flex; align-items: center; gap: 2px; min-height: 52px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--s2); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.field-wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.field-wrap input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--tx); font-size: 16px; outline: none; }
.field-wrap.is-ok { border: 2px solid var(--ok); }
.field-wrap.is-bad { border: 2px solid var(--danger); }
.help { display: flex; align-items: center; gap: 6px; min-height: 22px; margin-top: 6px; font-size: 14px; color: var(--tx3); }
.help--error { color: var(--danger); }
.help--ok { color: var(--ok); }

.search-field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 16px; border-radius: var(--r-pill); background: var(--s2); border: 1px solid var(--line); color: var(--tx3); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.search-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--tx); font-size: 16px; outline: none; }
.search-field input::placeholder { color: var(--tx3); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field kbd { font-family: var(--ui); font-size: 13px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--tx3); }
.search-field__clear { width: 36px; height: 36px; border-radius: 50%; background: var(--s3); display: inline-flex; align-items: center; justify-content: center; color: var(--tx); }

.otp { position: relative; display: flex; gap: 8px; }
.otp__box { flex: 1; height: 58px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--s2); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.otp__box.is-active { border: 2px solid var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.otp__box.is-active:empty::after { content: ""; width: 2px; height: 26px; background: var(--gold); animation: sbl-pulse 1s steps(2) infinite; }
.otp.is-error .otp__box { border: 2px solid var(--danger); box-shadow: none; }
.otp__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; letter-spacing: 40px; color: transparent; caret-color: transparent; }

.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: var(--r-pill); background: var(--s3); border: 1px solid var(--line); transition: background-color var(--dur-2); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--tx2); transition: transform var(--dur-2) var(--ease), background-color var(--dur-2); }
.switch[aria-checked="true"] { background: var(--gold); border-color: var(--gold); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-gold); }

/* ---------- 17. Cards & surfaces ---------- */
.card { background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r-lg); }
.card--pad { padding: 16px; }
.card--lg { border-radius: 24px; padding: 20px; }
.surface { background: var(--s2); border-radius: var(--r-md); }
.list-card { background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r-lg); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 16px; text-align: left; font-size: 16px; font-weight: 600; }
.list-item + .list-item { border-top: 1px solid var(--line2); }
.list-item__icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--s2); color: var(--tx2); display: inline-flex; align-items: center; justify-content: center; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__sub { display: block; font-size: 13px; font-weight: 500; color: var(--tx3); }
.list-item__end { flex: none; color: var(--tx3); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

.ext-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--s2); }
.ext-link__mark { flex: none; width: 36px; height: 36px; border-radius: 10px; color: #FDEBC8; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ext-link__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ext-link__title { font-size: 16px; font-weight: 700; }
.ext-link__sub { font-size: 13px; color: var(--tx3); }

.channel-tile { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line2); }
.channel-mark { flex: none; width: 44px; height: 44px; border-radius: 12px; color: #FDEBC8; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.channel-tile__name { font-size: 16px; font-weight: 700; }
.channel-tile__count { font-size: 13px; color: var(--tx3); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line2); }
.stat__num { display: block; font-family: var(--disp); font-size: 30px; line-height: 1.1; }
.stat__label { display: block; font-size: 14px; color: var(--tx2); }

/* ---------- 18. Motifs ---------- */
.toran {
  position: absolute; top: 0; left: 0; right: 0; height: 18px; pointer-events: none;
  background:
    conic-gradient(from -45deg at 50% 100%, var(--toran-a, #FDEBC8) 90deg, transparent 0) 0 4px / 40px 10px repeat-x,
    conic-gradient(from -45deg at 50% 100%, #F4A21E 90deg, transparent 0) 20px 4px / 40px 10px repeat-x,
    linear-gradient(#F4A21E, #F4A21E) 0 0 / 100% 3px no-repeat;
}
.toran--red { --toran-a: #C62A20; }
.toran-static { position: relative; display: block; height: 16px; }
.divider-paisley { display: flex; justify-content: center; margin: 8px 0; color: var(--gold); }

/* ---------- 19. Empty states & skeletons ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 8px; }
.empty__title { font-family: var(--disp); font-size: 26px; line-height: 1.15; }
.empty__text { font-size: 15px; line-height: 1.5; color: var(--tx2); max-width: 320px; }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.invite { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px dashed var(--line); background: var(--s2); }
.invite__text { flex: 1; font-size: 15px; line-height: 1.4; }

.skel { display: block; border-radius: 6px; background: var(--s3); animation: sbl-pulse 1.2s ease-in-out infinite; }
.skel--2 { background: var(--s2); }
.skel-card { display: flex; flex-direction: column; gap: 8px; }
.skel-card .skel:first-child { aspect-ratio: 16 / 9; border-radius: var(--r-md); }

/* ---------- 20. Bottom sheets ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; transition: opacity var(--dur-3) var(--ease); }
.sheet-scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  display: flex; flex-direction: column;
  max-height: 90dvh; margin: 0 auto; max-width: 560px;
  border-radius: 28px 28px 0 0; background: var(--s1); box-shadow: var(--e3), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(100%); transition: transform var(--dur-3) var(--ease-out);
  outline: none;
}
.sheet.is-open { transform: none; }
.sheet--tall { height: calc(100dvh - 72px - var(--safe-t)); }
.sheet__handle { display: flex; justify-content: center; padding: 10px 0 4px; cursor: grab; touch-action: none; }
.sheet__handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet__head { display: flex; align-items: center; gap: 8px; padding: 0 12px 6px 20px; }
.sheet__title { flex: 1; font-size: 21px; font-weight: 700; line-height: 1.25; }
.sheet__body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 8px 20px 16px; }
.sheet__foot { display: flex; gap: 10px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line2); background: var(--s1); }
@media (min-width: 1024px) {
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 520px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2); max-height: 86vh; box-shadow: var(--e2); }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet--tall { height: auto; }
  .sheet__handle { visibility: hidden; height: 12px; padding: 0; }
  .sheet__foot { border-radius: 0 0 24px 24px; }
}
body.sheet-open { overflow: hidden; }

/* ---------- 21. Toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.has-no-tabbar .toasts { bottom: calc(var(--safe-b) + 16px); }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px; min-height: 56px; padding: 8px 8px 8px 12px; border-radius: 16px; background: var(--s3); border: 1px solid var(--line); box-shadow: var(--e2); animation: sbl-rise var(--dur-3) var(--ease-out) both; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-2), transform var(--dur-2); }
.toast__icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: var(--on-gold); }
.toast--info .toast__icon { background: var(--gold-soft); color: var(--gold-ink); }
.toast--error .toast__icon { background: var(--danger-soft); color: var(--danger); }
.toast--muted .toast__icon { background: var(--s2); color: var(--tx2); }
.toast__msg { flex: 1; font-size: 15px; line-height: 1.35; }
.toast__action { min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--gold-ink); }

/* ---------- 22. Loader ---------- */
.loader { display: flex; justify-content: center; padding: 24px; }
.loader svg { width: 40px; height: 40px; }

/* ---------- 23. Long-form prose ---------- */
.prose { font-size: var(--fs-body-l); line-height: 1.65; color: var(--tx2); }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 32px; font-family: var(--disp); font-weight: 400; font-size: var(--fs-h2); line-height: 1.2; color: var(--tx); }
.prose h3 { margin-top: 24px; font-size: var(--fs-h3); font-weight: 700; color: var(--tx); }
.prose ul { padding-left: 22px; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--tx); }
