/* ==========================================================================
   Shuffler · interactive demo — shared base. Calm materials:
   - glass only on surfaces (sheets, lens, capsules); buttons and icons are flat
   - no specular rims that follow the pointer, no inner glows, no droplet knobs
   - sheet headers sit outside the scroll area (nothing scrolls under a title)
   Every colour, radius and font is a token; style.css sets them.
   ========================================================================== */

@property --a  { syntax: "<angle>";  inherits: false; initial-value: 0deg; }
@property --R  { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --a1 { syntax: "<color>";  inherits: true;  initial-value: #6b4dff; }
@property --a2 { syntax: "<color>";  inherits: true;  initial-value: #ff6ac1; }
@property --a3 { syntax: "<color>";  inherits: true;  initial-value: #36c9ff; }

:root {
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font);
  --font-num: var(--font);
  --w-display: 720;
  --w-title: 700;
  --w-strong: 600;
  --ls-display: -.035em;
  --ls-title: -.025em;
  --display-size: clamp(30px, 8.6vw, 64px);
  /* shape */
  --r-sheet: 32px;
  --r-group: 20px;
  --r-row-ic: 9px;
  --r-btn: 50%;
  --r-chip: 99px;
  --r-cta: 99px;
  --r-field: 16px;
  --r-frame: 32px;
  --r-media: 14px;
  --btn: 44px;
  --btn-sm: 36px;
  --rail: 48px;
  --rail-gap: 14px;
  --head-pad-x: 22px;
  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.25, 1.3, .4, 1);
  --spring-soft: cubic-bezier(.3, 1.1, .4, 1);
  --spring-d: 600ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* colour fallbacks (style.css overrides all of these) */
  --bg: #120d1a;
  --ink: #f4f0fa;
  --ink-2: rgb(244 240 250 / .64);
  --ink-3: rgb(244 240 250 / .4);
  --g-fill: rgb(30 22 44 / .55);
  --g-ink: var(--ink);
  --g-blur: 22px;
  --g-sat: 1.25;
  --g-shadow: 0 12px 32px -14px rgb(0 0 0 / .5);
  --rim-top: rgb(255 255 255 / .22);
  --rim-bot: rgb(255 255 255 / .06);
  --ov-fill: rgb(12 8 18 / .28);
  --ov-ink: #fff;
  --ov-line: rgb(255 255 255 / .14);
  --ov-blur: 18px;
  --rail-fill: var(--ov-fill);
  --rail-ink: var(--ov-ink);
  --rail-line: var(--ov-line);
  --desk-fill: var(--g-fill);
  --desk-ink: var(--ink);
  --desk-line: var(--rim-bot);
  --sheet-fill: rgb(24 18 34 / .86);
  --sheet-shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
  --row-fill: rgb(255 255 255 / .05);
  --row-press: rgb(255 255 255 / .1);
  --sep: rgb(255 255 255 / .08);
  --track: rgb(255 255 255 / .12);
  --seg-thumb: rgb(255 255 255 / .16);
  --seg-ink: var(--ink);
  --backdrop: rgb(4 2 10 / .42);
  --backdrop-comments: transparent;
  --accent: #cdbdff;
  --accent-fill: #8f6bff;
  --on-accent: #fff;
  --cta-bg: #d5c6ff;
  --cta-ink: #251b36;
  --cta-shadow: 0 14px 34px -14px rgb(143 107 255 / .6);
  --switch-on: #8f6bff;
  --knob: #fff;
  --knob-on: #fff;
  --knob-shadow: 0 1px 3px rgb(0 0 0 / .25);
  --heart: #ff5c8a;
  --tile-bg: rgb(205 189 255 / .14);
  --tile-ink: #cdbdff;
  --chip-bg: rgb(255 255 255 / .07);
  --chip-line: rgb(255 255 255 / .1);
  --amb-o: .55;
  --card-1: #2a1d4a;
  --card-2: #4a2f8a;
  --card-3: #7c5ad6;
  --card-ink: #fff;
  --card-ink-2: rgb(255 255 255 / .74);
  --card-surface: rgb(255 255 255 / .1);
  --card-line: rgb(255 255 255 / .22);
  --card-accent: #d5c6ff;
  --card-on-accent: #251b36;
  --focus: #cdbdff;
  --scrim-top: rgb(0 0 0 / .26);
  --scrim-bot: rgb(0 0 0 / .55);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ic { display: block; flex: none; }
:root:not(.vt-full) { view-transition-name: none; }

/* ==========================================================================
   MATERIALS
   ========================================================================== */
/* Glass surface: frosted fill + a calm, static hairline rim (brighter at the top edge). */
.glass {
  background: var(--g-fill);
  color: var(--g-ink);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  box-shadow: var(--g-shadow);
  isolation: isolate;
}
.glass.lg-on {
  -webkit-backdrop-filter: var(--lg) brightness(1.02);
  backdrop-filter: var(--lg) brightness(1.02);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, var(--rim-top), var(--rim-bot) 40%, var(--rim-bot));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Flat chrome over video: one fill, one hairline, a glyph. No glow, no rim highlight. */
.icon-btn, .src-mark, .yearchip, .hint, .toast, .pause-ind {
  background: var(--ov-fill);
  color: var(--ov-ink);
  box-shadow: inset 0 0 0 1px var(--ov-line);
  -webkit-backdrop-filter: blur(var(--ov-blur)) saturate(1.2);
  backdrop-filter: blur(var(--ov-blur)) saturate(1.2);
}
.icon-btn {
  width: var(--btn);
  height: var(--btn);
  padding: 0;
  border: 0;
  border-radius: var(--r-btn);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: scale .35s var(--spring), background-color .2s;
}
.icon-btn:active { scale: .92; }
.icon-btn.small { width: var(--btn-sm); height: var(--btn-sm); }

/* ==========================================================================
   AMBIENT (desktop + onboarding background)
   ========================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  opacity: var(--amb-o);
  transition: --a1 1.4s ease, --a2 1.4s ease, --a3 1.4s ease;
  pointer-events: none;
}
.ambient i {
  position: absolute;
  width: 80vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: amb 26s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { background: radial-gradient(closest-side, var(--a1), transparent); left: -20vmax; top: -25vmax; }
.ambient i:nth-child(2) { background: radial-gradient(closest-side, var(--a2), transparent); right: -25vmax; top: 10vmax; animation-duration: 31s; animation-direction: alternate-reverse; }
.ambient i:nth-child(3) { background: radial-gradient(closest-side, var(--a3), transparent); left: 10vmax; bottom: -40vmax; animation-duration: 23s; }
@keyframes amb { 50% { translate: 8vmax 6vmax; scale: 1.15; } 100% { translate: -6vmax 10vmax; scale: .95; } }

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
.onb {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  padding: calc(var(--safe-t) + 12px) 20px calc(var(--safe-b) + 24px);
  overflow: hidden;
}
/* the stage fills whatever height the copy leaves and sizes the orbit to it, so the two never overlap */
.onb-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  container-type: size;
}
.onb-stage > * {
  --size: min(92cqw, 100cqh, 540px);
  --radius: calc(var(--size) * .335);
  --cw: calc(var(--size) * .155);
}
.orbit { position: absolute; inset: 0; animation: spin 70s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.orb-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cw);
  aspect-ratio: 9 / 16;
  margin: calc(var(--cw) * -.889) 0 0 calc(var(--cw) * -.5);
  transform: rotate(var(--a)) translateX(var(--R)) rotate(calc(-1 * var(--a)));
  transition: --R 1s var(--spring) calc(var(--i) * 55ms), --a 1.25s var(--spring-soft), scale .6s var(--spring);
  z-index: 1;
}
.orb-card.is-moving { z-index: 3; scale: 1.12; }
.orbit.is-open .orb-card { --R: var(--radius); }
.orb-inner {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * var(--orb-r, .2));
  overflow: hidden;
  background: linear-gradient(160deg, var(--c1), var(--c2) 60%, var(--c3));
  box-shadow: 0 12px 26px -12px rgb(0 0 0 / .5);
  animation: spin 70s linear infinite reverse;
  transform: rotate(var(--tilt, 0deg));
  display: grid;
  place-items: center;
}
.orb-inner .emo { font-size: calc(var(--cw) * .5); line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.orb-inner .yr {
  position: absolute;
  left: 50%;
  bottom: 7%;
  translate: -50% 0;
  font: 700 calc(var(--cw) * .17)/1 var(--font-num);
  color: #fff;
  padding: .3em .55em;
  border-radius: 99px;
  background: rgb(0 0 0 / .22);
  letter-spacing: .02em;
}
.orb-inner .hrt { position: absolute; top: 7%; right: 8%; width: calc(var(--cw) * .2); color: #fff; }
.orb-inner .hrt svg { width: 100%; height: auto; fill: #fff; stroke: none; }

.lens {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--size) * .5);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: var(--lens-r, 50%);
  display: grid;
  place-items: center;
  z-index: 2;
  --g-fill: var(--lens-fill, rgb(255 255 255 / .06));
  --g-shadow: var(--lens-shadow, 0 30px 60px -24px rgb(0 0 0 / .5));
  --rim-top: var(--lens-rim, rgb(255 255 255 / .4));
  --rim-bot: rgb(255 255 255 / .1);
}
.lens-logo { display: block; width: 42%; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .25)); position: relative; z-index: 2; }
.lens-logo svg { width: 100%; height: auto; display: block; }
.ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--size) * .5);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: var(--lens-r, 50%);
  border: 1.5px solid var(--ripple, rgb(255 255 255 / .6));
  opacity: 0;
  pointer-events: none;
}

.onb-copy {
  width: min(100%, 440px);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}
.onb-kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 15px/1 var(--font);
  letter-spacing: -.01em;
  color: var(--ink-2);
}
.onb-mark svg { width: 24px; height: 24px; display: block; }
.onb h1 {
  margin: 0;
  font: var(--w-display) var(--display-size)/1.02 var(--font-display);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}
.onb h1 span { color: var(--accent); }
.onb-lead { margin: 0; color: var(--ink-2); font-size: 15.5px; text-wrap: pretty; max-width: 36ch; }
.onb-sources { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 11px;
  border-radius: var(--r-chip);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--chip-line);
}
.chip-ic svg { width: 16px; height: 16px; }
.cta {
  position: relative;
  width: min(100%, 360px);
  height: 56px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--r-cta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 650 17px/1 var(--font);
  letter-spacing: -.01em;
  cursor: pointer;
  background: var(--cta-bg);
  color: var(--cta-ink);
  box-shadow: var(--cta-shadow);
  transition: scale .4s var(--spring), filter .2s;
}
.cta:hover { filter: brightness(1.04); }
.cta:active { scale: .97; }
.onb-note { margin: 0; font-size: 12.5px; color: var(--ink-3); text-wrap: balance; }

.onb .lens, .onb .onb-copy > * { opacity: 0; }
.onb.is-in .lens { animation: lens-drop 1.1s var(--spring) .75s both; }
.onb.is-in .ripple { animation: ripple 1.2s var(--ease-out) 1.05s both; }
.onb.is-in .onb-copy > * { animation: rise .8s var(--ease-out) both; animation-delay: calc(1.05s + var(--d, 0) * 80ms); }
.onb-copy > :nth-child(2) { --d: 1; } .onb-copy > :nth-child(3) { --d: 2; } .onb-copy > :nth-child(4) { --d: 3; } .onb-copy > :nth-child(5) { --d: 4; } .onb-copy > :nth-child(6) { --d: 5; }
@keyframes lens-drop { 0% { opacity: 0; scale: .2; } 30% { opacity: 1; } 100% { opacity: 1; scale: 1; } }
@keyframes ripple { 0% { opacity: .8; scale: .9; } 100% { opacity: 0; scale: 1.8; } }
@keyframes rise { from { opacity: 0; translate: 0 18px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
.onb.is-in .lens-logo { animation: logo-pop .9s var(--spring) 1s both; }
@keyframes logo-pop { from { scale: 0; rotate: -20deg; } to { scale: 1; rotate: 0deg; } }

@media (min-width: 1000px) {
  .onb {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    max-width: 1240px;
    margin-inline: auto;
    gap: 40px;
    padding-inline: 48px;
  }
  .onb-stage > * { --size: min(100cqw, 82cqh, 600px); }
  .onb-copy { justify-items: start; text-align: left; width: min(100%, 500px); gap: 18px; }
  .onb-sources { justify-content: flex-start; }
  .onb-lead { font-size: 18px; }
}
@media (min-width: 1100px) { .onb { padding-left: 250px; } }
/* short phones (e.g. 320×568): tighter copy so the orbit keeps a useful size */
@media (max-width: 999px) and (max-height: 700px) {
  .onb { padding-top: calc(var(--safe-t) + 6px); padding-bottom: calc(var(--safe-b) + 14px); }
  .onb-copy { gap: 10px; }
  .onb h1 { font-size: min(var(--display-size), 6.2dvh); }
  .onb-lead { font-size: 14px; }
  .onb-sources { display: none; }
  .cta { height: 52px; margin-top: 2px; }
  .onb-note { font-size: 11.5px; }
}

/* ==========================================================================
   FEED
   ========================================================================== */
.feed {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  transition: translate .6s var(--spring-soft);
}
.frame { position: absolute; inset: 0; background: #000; overflow: hidden; }
.stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  will-change: transform;
  contain: strict;
}
.slide.is-incoming { z-index: 2; }
.slide.is-current { z-index: 1; }
.slide[data-kind="reel"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--scrim-top), transparent 16%),
    linear-gradient(to top, var(--scrim-bot), transparent 40%);
}
.feed.is-paused .ra * { animation-play-state: paused !important; }

.overlay { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.overlay > * { pointer-events: auto; }

/* ---------- top-right corner: what is playing + settings ---------- */
.corner {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  right: 12px;
  z-index: 6;
  display: flex;
  gap: 8px;
  align-items: center;
}
.src-mark {
  width: var(--btn);
  height: var(--btn);
  border-radius: var(--r-btn);
  display: grid;
  place-items: center;
  transition: opacity .25s ease;
}
.src-mark svg { width: var(--mark, 22px); height: var(--mark, 22px); }
.src-mark.is-hidden { opacity: 0; pointer-events: none; }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.small svg { width: 18px; height: 18px; }

/* ---------- meta ---------- */
.meta-wrap {
  position: absolute;
  left: 16px;
  right: calc(var(--rail) + 28px);
  bottom: calc(var(--safe-b) + 28px);
  display: grid;
  gap: 12px;
  justify-items: start;
}
.meta {
  width: 100%;
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / .35);
  display: grid;
  gap: 6px;
  justify-items: start;
}
/* quiet chip while one source is paused (HTTP 429) and the other keeps playing */
.pausechip {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 9px;
  border-radius: var(--r-chip);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
  background: var(--pc-fill, rgb(0 0 0 / .34));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
  -webkit-backdrop-filter: blur(var(--ov-blur));
  backdrop-filter: blur(var(--ov-blur));
}
.pc-ic svg { width: 14px; height: 14px; opacity: .85; }
.pausechip b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; }
.yearchip {
  margin: 0 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: var(--r-chip);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
  text-shadow: none;
}
.yc-ic svg { width: 13px; height: 13px; fill: currentColor; }
.yearchip { gap: 0; }
.yc-ic { margin-right: 6px; }
.yc-label { margin-right: .3em; }
.yc-year {
  position: relative;
  display: grid;
  height: 1.3em;
  overflow: hidden;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.yc-year b { grid-area: 1 / 1; font-weight: 750; line-height: 1.3; }
.author { margin: 0; font: 650 16px/1.2 var(--font); letter-spacing: -.01em; }
.caption {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.sound { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .9; max-width: 100%; }
.sound-ic svg { width: 13px; height: 13px; }
.sound-track { overflow: hidden; white-space: nowrap; mask: linear-gradient(90deg, #000 85%, transparent); max-width: 220px; }
.sound-track span { display: inline-block; padding-right: 2em; animation: marquee 9s linear infinite; }
@keyframes marquee { from { translate: 0 0; } to { translate: -50% 0; } }

.progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--safe-b) + 12px);
  height: 3px;
  border-radius: 9px;
  background: rgb(255 255 255 / .22);
  overflow: hidden;
}
.progress i { position: absolute; inset: 0; background: var(--progress, #fff); border-radius: inherit; transform-origin: 0 50%; scale: 0 1; }
.progress i.run { animation: prog 14s linear infinite; }
@keyframes prog { to { scale: 1 1; } }

/* ---------- action rail ---------- */
.rail {
  position: absolute;
  right: 10px;
  bottom: calc(var(--safe-b) + 30px);
  z-index: 5;
  display: grid;
  gap: var(--rail-gap);
  justify-items: center;
}
.rail-btn {
  width: var(--rail);
  height: var(--rail);
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rail-ic {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: grid;
  place-items: center;
  color: var(--rail-ink);
  background: var(--rail-fill);
  box-shadow: inset 0 0 0 1px var(--rail-line);
  -webkit-backdrop-filter: blur(var(--ov-blur)) saturate(1.2);
  backdrop-filter: blur(var(--ov-blur)) saturate(1.2);
  transition: scale .35s var(--spring), background-color .2s, color .2s;
}
.rail-ic svg { width: var(--rail-glyph, 25px); height: var(--rail-glyph, 25px); transition: scale .35s var(--spring); }
.rail-btn:active .rail-ic { scale: .9; }
.rail-btn[aria-pressed="true"] .ic-heart { fill: var(--heart); stroke: var(--heart); }
.rail-btn.pop .rail-ic svg { animation: heart-pop .5s var(--spring); }
@keyframes heart-pop { 0% { scale: 1; } 35% { scale: .72; } 100% { scale: 1; } }
#reshuffle.is-spinning svg { animation: reshuffle .7s var(--ease-out); }
@keyframes reshuffle { 40% { rotate: -14deg; scale: .85; } 100% { rotate: 0; scale: 1; } }

/* ---------- hint / toasts / burst / pause ---------- */
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 190px);
  translate: -50% 0;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: var(--r-chip);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13.5px/1 var(--font);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.hint svg { width: 17px; height: 17px; animation: nudge 1.4s var(--ease-out) infinite; }
@keyframes nudge { 0%, 100% { translate: 0 3px; } 50% { translate: 0 -4px; } }
.hint.show { animation: hint 3.6s var(--ease-out) both; }
@keyframes hint { 0% { opacity: 0; scale: .9; } 12%, 85% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .97; } }

.toasts {
  position: fixed;
  top: calc(var(--safe-t) + 66px);
  left: 50%;
  translate: -50% 0;
  z-index: 50;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 11px 18px;
  border-radius: var(--r-chip);
  font: 600 14px/1.25 var(--font);
  text-align: center;
  text-wrap: balance;
  animation: toast-in .5s var(--spring) both;
}
.toast.is-leaving { animation: toast-out .35s var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; translate: 0 -12px; scale: .92; } }
@keyframes toast-out { to { opacity: 0; translate: 0 -10px; scale: .95; } }

.burst { position: absolute; z-index: 7; width: 0; height: 0; pointer-events: none; }
.burst .big { position: absolute; width: 110px; height: 110px; left: -55px; top: -55px; color: var(--heart); filter: drop-shadow(0 8px 20px rgb(0 0 0 / .25)); }
.burst .big svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.burst .p { position: absolute; width: 18px; height: 18px; left: -9px; top: -9px; color: #fff; }
.burst .p svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }

.pause-ind {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: var(--r-btn);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.pause-ind svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }

.kbd-hint { display: none; }

/* ==========================================================================
   STATE CARDS (first load · waiting · error · all watched)
   They replace the video inside the frame; the corner keeps only settings.
   ========================================================================== */
.feed[data-card] .meta-wrap,
.feed[data-card] .rail,
.feed[data-card] .progress,
.feed[data-card] .hint { visibility: hidden; opacity: 0; }
.cardbg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(165deg, var(--card-1), var(--card-2) 58%, var(--card-3));
  background: linear-gradient(165deg in oklab, var(--card-1), var(--card-2) 58%, var(--card-3));
}
.cardbg i {
  position: absolute;
  width: 110%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: .55;
  animation: card-drift 18s ease-in-out infinite alternate;
}
.cardbg i:nth-child(1) { left: -40%; top: -25%; background: radial-gradient(closest-side, var(--card-3), transparent); }
.cardbg i:nth-child(2) { right: -50%; top: 30%; background: radial-gradient(closest-side, var(--card-1), transparent); animation-duration: 23s; animation-direction: alternate-reverse; }
.cardbg i:nth-child(3) { left: -10%; bottom: -55%; background: radial-gradient(closest-side, var(--card-2), transparent); animation-duration: 15s; }
@keyframes card-drift { 50% { translate: 8% 6%; scale: 1.1; } 100% { translate: -6% 8%; scale: .95; } }
.feed[data-card="error"] .cardbg { filter: saturate(.55); }
/* on a state card the settings button sits on the card, not on video */
.feed[data-card] .corner .icon-btn { background: var(--card-surface); color: var(--card-ink); box-shadow: inset 0 0 0 1px var(--card-line); }

.card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: calc(var(--safe-t) + 76px) 28px calc(var(--safe-b) + 48px);
  text-align: center;
  color: var(--card-ink);
}
.card-visual { margin-bottom: 14px; display: grid; place-items: center; }
.card-title {
  margin: 0;
  max-width: 20ch;
  font: var(--w-title) 25px/1.14 var(--font-display);
  letter-spacing: var(--ls-title);
  text-wrap: balance;
}
.card-body { margin: 0; max-width: 31ch; font-size: 15px; line-height: 1.45; color: var(--card-ink-2); text-wrap: pretty; }
.card .swap { animation: rise .6s var(--ease-out); }
.steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 6px;
  min-width: 232px;
  display: grid;
  gap: 2px;
  border-radius: calc(var(--r-group) - 2px);
  background: var(--card-surface);
  box-shadow: inset 0 0 0 1px var(--card-line);
  text-align: left;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 12px 0 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--card-ink);
  transition: opacity .3s ease;
}
.steps li[data-state="todo"] { opacity: .5; }
.step-dot {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--card-line);
  color: var(--card-on-accent);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.step-dot svg { width: 12px; height: 12px; opacity: 0; scale: .5; transition: opacity .25s, scale .4s var(--spring); }
.steps li[data-state="done"] .step-dot { background: var(--card-accent); box-shadow: none; }
.steps li[data-state="done"] .step-dot svg { opacity: 1; scale: 1; }
.steps li[data-state="active"] .step-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--card-accent);
  border-right-color: var(--card-accent);
  animation: spin .9s linear infinite;
}
.card-actions { display: grid; gap: 6px; width: min(100%, 300px); margin-top: 16px; }
.card-btn {
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-cta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: 650 16px/1 var(--font);
  letter-spacing: -.01em;
  cursor: pointer;
  transition: scale .35s var(--spring), background-color .2s, opacity .2s;
}
.card-btn svg { width: 18px; height: 18px; }
.card-btn:active { scale: .97; }
.card-btn.primary { background: var(--cta-bg); color: var(--cta-ink); box-shadow: var(--cta-shadow); }
.card-btn.ghost { height: 46px; background: transparent; color: var(--card-ink); font-weight: 600; font-size: 15px; }
.card-btn.ghost:hover { background: var(--card-surface); }
.card-btn.is-busy { opacity: .85; cursor: progress; }
.card-btn.is-busy svg { animation: spin .9s linear infinite; }

/* ==========================================================================
   DESKTOP FEED
   ========================================================================== */
@media (min-width: 900px) {
  .frame {
    position: relative;
    inset: auto;
    height: calc(100dvh - 48px);
    aspect-ratio: 9 / 16;
    width: round(down, calc((100dvh - 48px) * 9 / 16), 1px); /* whole pixels: no hairline of the black stage at the edge */
    border-radius: var(--r-frame);
    overflow: visible;
    background: transparent;
    box-shadow: 0 40px 90px -30px rgb(0 0 0 / .6);
  }
  .stage, .overlay { border-radius: var(--r-frame); overflow: hidden; }
  .corner { top: 14px; right: 14px; }
  .meta-wrap { right: 20px; bottom: 30px; }
  .rail { right: auto; left: calc(100% + 20px); bottom: 26px; }
  .rail-ic { --rail-fill: var(--desk-fill); --rail-ink: var(--desk-ink); --rail-line: var(--desk-line); }
  .card { padding: 72px 36px 48px; }
  .toasts { top: 24px; }
  .kbd-hint {
    position: fixed;
    right: 24px;
    bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--r-chip);
    font: 500 12.5px/1 var(--font);
    color: var(--ink-2);
    background: var(--chip-bg);
    box-shadow: inset 0 0 0 1px var(--chip-line);
  }
  .kbd-hint kbd {
    font: 600 11px/1 var(--font-num);
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: var(--row-fill);
    box-shadow: inset 0 0 0 1px var(--chip-line);
    color: var(--ink);
    margin-left: 4px;
  }
  /* a side sheet slides the video aside instead of covering it — it keeps playing */
  :root:has(.sheet[open]:not([data-closing])) .feed { translate: calc(-1 * clamp(0px, 800px - 50vw, 320px)) 0; }
  :root:has(.sheet[open]) .kbd-hint { opacity: 0; transition: opacity .2s; }
}

/* ==========================================================================
   SHEETS — <dialog> + @starting-style. Header is a fixed row, the body scrolls
   below it, so titles and close buttons never overlap list content.
   ========================================================================== */
.sheet {
  position: fixed;
  inset: auto 8px calc(8px + var(--safe-b)) 8px;
  width: auto;
  max-width: none;
  height: min(88dvh, 780px);
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-sheet);
  overflow: hidden;
  color: var(--ink);
  --g-fill: var(--sheet-fill);
  --g-ink: var(--ink);
  --g-shadow: var(--sheet-shadow);
  opacity: 0;
  translate: 0 104%;
  transition: translate .62s var(--spring-soft), opacity .3s ease, display .62s allow-discrete, overlay .62s allow-discrete;
}
.sheet::backdrop {
  background: var(--backdrop);
  opacity: 0;
  transition: opacity .35s ease, display .35s allow-discrete, overlay .35s allow-discrete;
}
.sheet.comments::backdrop { background: var(--backdrop-comments); }
.sheet[open]:not([data-closing]) {
  opacity: 1;
  translate: 0 0;
  @starting-style { opacity: 0; translate: 0 104%; }
}
.sheet[open]:not([data-closing])::backdrop {
  opacity: 1;
  @starting-style { opacity: 0; }
}
.sheet.vt-morph { transition: none; --g-fill: color-mix(in oklab, var(--bg) 96%, transparent); }
.vt-flat, .vt-flat.lg-on, .sheet.vt-morph, .sheet.vt-morph.lg-on { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.sheet-grab { position: absolute; top: 0; left: 0; right: 0; height: 20px; display: grid; place-items: center; z-index: 5; cursor: grab; touch-action: none; }
.sheet-grab i { width: 36px; height: 5px; border-radius: 9px; background: var(--ink-3); opacity: .7; }

.panes {
  display: grid;
  grid-template-columns: 100% 100%;
  height: 100%;
  transition: translate .6s var(--spring-soft);
}
.sheet.no-pane-anim .panes { transition: none; }
.sheet[data-pane="detail"] .panes { translate: -100% 0; }
.pane {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sheet:not([data-pane="detail"]) .pane-detail, .sheet[data-pane="detail"] .pane-main { visibility: hidden; transition: visibility 0s .6s; }
.sheet.no-pane-anim .pane { transition: none; }

.sheet-head {
  flex: none;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 24px 14px 10px var(--head-pad-x);
}
.sheet-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sep);
  opacity: 0;
  transition: opacity .2s ease;
}
.pane.is-scrolled > .sheet-head::after { opacity: 1; }
.head-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: var(--w-title) 24px/1.15 var(--font-display);
  letter-spacing: var(--ls-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
}
.pane-detail .sheet-head { padding-left: 14px; }
.pane-detail .head-title { font-size: clamp(16px, 4.7vw, 18px); text-align: center; letter-spacing: -.015em; }
.head-spacer { width: var(--btn-sm); flex: none; }
.sheet-head .icon-btn {
  background: var(--row-fill);
  color: var(--ink);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.sheet-head .icon-btn:hover { background: var(--row-press); }
.pane-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 16px calc(28px + var(--safe-b));
  scrollbar-width: none;
}
.pane-body::-webkit-scrollbar { display: none; }
.pane.is-scrolled > .pane-body { -webkit-mask: linear-gradient(to bottom, transparent, #000 10px); mask: linear-gradient(to bottom, transparent, #000 10px); }
.big-title { display: none; }

.group-title { margin: 20px 6px 8px; font: 600 13px/1 var(--font); color: var(--ink-2); letter-spacing: .01em; }
.pane-body > .group-title:first-of-type { margin-top: 8px; }
.group { border-radius: var(--r-group); background: var(--row-fill); overflow: hidden; }
.row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background-color .2s;
}
.row + .row { border-top: 1px solid var(--sep); }
button.row:hover { background: var(--row-press); }
button.row:active, label.row:active { background: var(--row-press); }
.row-ic {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--r-row-ic);
  display: grid;
  place-items: center;
  background: var(--tile-bg);
  color: var(--tile-ink);
}
.row-ic svg { width: 18px; height: 18px; }
.row-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.row-text b { font-weight: var(--w-strong); font-size: 16px; letter-spacing: -.01em; }
.row-text small { font-size: 13px; color: var(--ink-2); }
.row-value { color: var(--ink-2); font-size: 15px; }
.row-chev { color: var(--ink-3); }
.row-chev svg { width: 18px; height: 18px; }
.sheet-foot { margin: 22px 8px 0; text-align: center; font-size: 12px; color: var(--ink-3); text-wrap: balance; }

/* switch: flat track + solid knob (no droplet, no glow) */
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 99px;
  background: var(--track);
  cursor: pointer;
  transition: background-color .25s ease;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 99px;
  background: var(--knob);
  box-shadow: var(--knob-shadow);
  transition: translate .45s var(--spring), width .2s ease, background-color .25s;
}
.switch:checked { background: var(--switch-on); }
.switch:checked::before { translate: 20px 0; background: var(--knob-on); }
.switch:active::before { width: 30px; }
.switch:checked:active::before { translate: 16px 0; }

/* period: segmented control */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 10px;
  padding: 3px;
  border-radius: var(--r-seg, 99px);
  background: var(--track);
  isolation: isolate;
}
.seg button {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  background: none;
  border-radius: var(--r-seg, 99px);
  cursor: pointer;
  font: 600 clamp(12px, 3.6vw, 13.5px)/1 var(--font);
  letter-spacing: -.015em;
  color: var(--ink-2);
  transition: color .25s;
  white-space: nowrap;
}
@media (max-width: 360px) { .seg { margin: 8px 6px; } .seg button { letter-spacing: -.03em; } }
.seg button[aria-checked="true"] { color: var(--seg-ink); }
.seg-thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  height: 38px;
  width: calc((100% - 6px) / 4);
  border-radius: calc(var(--r-seg, 99px) - 2px);
  pointer-events: none;
  translate: calc(var(--i, 0) * 100%) 0;
  transition: translate .55s var(--spring);
  background: var(--seg-thumb);
  box-shadow: 0 1px 3px rgb(0 0 0 / .12);
}
.seg-hint { margin: 0 16px 13px; font-size: 13px; color: var(--ink-2); min-height: 1.3em; text-wrap: pretty; }
/* custom period: two big month cards and a dash — no "С/По" labels, full month names */
.range {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 10px;
  animation: rise .45s var(--ease-out);
}
.range-field {
  flex: 1;
  min-width: 0;
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 62px;
  align-content: center;
  padding: 10px 14px;
  border-radius: var(--r-field);
  background: var(--track);
  cursor: pointer;
  transition: background-color .2s;
}
.range-field:hover { background: var(--row-press); }
.rf-month { display: block; font: 650 16.5px/1.15 var(--font); color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-month::first-letter { text-transform: uppercase; }
.rf-year { font: 500 13.5px/1.1 var(--font-num); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.range-field input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.range-field:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.range-dash { flex: none; width: 12px; height: 2px; background: var(--ink-3); border-radius: 2px; }

.mini-seg { display: flex; gap: 4px; padding: 3px; border-radius: var(--r-seg, 99px); background: var(--track); }
.mini-seg button { width: 42px; height: 30px; border: 0; border-radius: calc(var(--r-seg, 99px) - 2px); background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: background-color .25s, color .25s; }
.mini-seg button svg { width: 17px; height: 17px; }
.mini-seg button[aria-checked="true"] { background: var(--seg-thumb); color: var(--seg-ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* language popover */
.lang-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  border: 0;
  border-radius: calc(var(--r-group) + 2px);
  min-width: 210px;
  color: var(--ink);
  background: var(--menu-fill, var(--sheet-fill));
  box-shadow: inset 0 0 0 1px var(--sep), 0 20px 50px -16px rgb(0 0 0 / .5);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  opacity: 0;
  scale: .8;
  transform-origin: 90% 0;
  transition: opacity .2s ease, scale .4s var(--spring), display .4s allow-discrete, overlay .4s allow-discrete;
}
.lang-menu:popover-open { opacity: 1; scale: 1; @starting-style { opacity: 0; scale: .8; } }
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(var(--r-group) - 6px);
  background: none;
  font-size: 15.5px;
  cursor: pointer;
}
.lang-menu button:hover { background: var(--row-fill); }
.lang-menu button svg { width: 18px; height: 18px; color: var(--accent); opacity: 0; }
.lang-menu button[aria-checked="true"] svg { opacity: 1; }

/* detail panes */
.detail { display: grid; gap: 14px; padding-top: 6px; }
.detail p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.detail .detail-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.detail .center { text-align: center; }
.field {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--r-field);
  background: var(--row-fill);
  box-shadow: inset 0 0 0 1px var(--sep);
  color: var(--ink);
  font: 400 15.5px/1.5 var(--font);
}
.field:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.attach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-field);
  background: var(--row-fill);
  box-shadow: inset 0 0 0 1px var(--sep);
}
.attach-ic { width: 40px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--tile-bg); color: var(--tile-ink); }
.attach-ic svg { width: 20px; height: 20px; }
.attach-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.attach-text b { font: 600 14.5px/1.2 var(--font-num); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-text small { font-size: 12.5px; color: var(--ink-2); }
.attach-ok { color: var(--ink-3); }
.attach-ok svg { width: 17px; height: 17px; }
.wide-btn {
  width: 100%;
  height: 54px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 16px;
}
.wide-btn svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-chip);
  background: var(--row-fill);
  box-shadow: inset 0 0 0 1px var(--sep);
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: background-color .25s, color .25s, scale .4s var(--spring);
}
.pick:active { scale: .96; }
.pick[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; }
.support-hero { display: grid; justify-items: center; gap: 10px; padding: 8px 0 4px; text-align: center; }
.support-hero svg.sh-logo { width: 72px; height: 72px; filter: drop-shadow(0 12px 22px rgb(0 0 0 / .22)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -5px; rotate: -3deg; } }
.support-hero h3 { margin: 0; font: var(--w-title) 22px/1.2 var(--font-display); letter-spacing: -.02em; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amounts .pick { height: 56px; border-radius: var(--r-field); font-size: 16px; font-family: var(--font-num); }

/* ==========================================================================
   COMMENTS — the video keeps playing above / beside the sheet
   ========================================================================== */
.comments { height: min(64dvh, 620px); }
.comments .sheet-head { min-height: 64px; padding-bottom: 6px; }
.comments .head-title { font-size: 19px; letter-spacing: -.015em; }
.comments .pane-body { padding: 6px 14px 16px 16px; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.c { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; gap: 0 11px; align-items: start; }
.c.is-reply { grid-template-columns: 26px minmax(0, 1fr) 40px; gap: 0 9px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--font); color: #fff; }
.is-reply .avatar { width: 26px; height: 26px; font-size: 11px; }
.c-main { min-width: 0; }
.c-pin { margin: 0 0 4px; display: flex; align-items: center; gap: 5px; font: 600 11.5px/1 var(--font); color: var(--ink-3); letter-spacing: .01em; }
.c-pin svg { width: 12px; height: 12px; }
.c-head { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13.5px; line-height: 1.2; }
.c-name { font-weight: 650; color: var(--ink); }
.c-badge { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: var(--tile-bg); color: var(--tile-ink); align-self: center; }
.c-time { color: var(--ink-3); font: 500 12.5px/1 var(--font); }
.c-text { margin: 3px 0 0; font-size: 15px; line-height: 1.38; color: var(--ink); text-wrap: pretty; overflow-wrap: anywhere; }
.c.is-pinned > .c-main > .c-text { font-weight: 500; }
.c-media {
  position: relative;
  width: min(180px, 70%);
  aspect-ratio: 4 / 3;
  margin-top: 8px;
  border-radius: var(--r-media);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--m1), var(--m2));
}
.c-media.c-photo { aspect-ratio: 3 / 4; width: min(132px, 55%); }
.c-media span { font-size: 46px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.c-gif span { animation: gif-bob 1.1s ease-in-out infinite; }
@keyframes gif-bob { 50% { translate: 0 -8%; rotate: -8deg; } }
.c-media b { position: absolute; left: 8px; bottom: 8px; padding: 3px 6px; border-radius: 6px; font: 700 10.5px/1 var(--font); letter-spacing: .04em; color: #fff; background: rgb(0 0 0 / .45); }
.c-actions { margin-top: 7px; display: flex; align-items: center; gap: 14px; }
.c-reply { padding: 2px 0; border: 0; background: none; font: 600 12.5px/1 var(--font); color: var(--ink-2); cursor: pointer; }
.c-reply:hover { color: var(--ink); }
.c-more { margin-top: 10px; padding: 4px 0; border: 0; background: none; display: flex; align-items: center; gap: 10px; font: 600 12.5px/1 var(--font); color: var(--ink-2); cursor: pointer; }
.c-more i { width: 24px; height: 1px; background: var(--ink-3); }
.c-more:hover { color: var(--ink); }
.c-replies { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; }
.c-replies .c { grid-template-columns: 26px minmax(0, 1fr) 34px; }
.c-like { display: grid; justify-items: center; gap: 3px; padding: 4px 0; border: 0; background: none; color: var(--ink-3); font: 500 11.5px/1 var(--font-num); cursor: pointer; }
.c-like svg { width: 15px; height: 15px; }
.c-like[aria-pressed="true"] { color: var(--heart); }
.c-like[aria-pressed="true"] svg { fill: currentColor; }
.c.is-skeleton { align-items: center; }
.sk { display: block; border-radius: 6px; background: var(--row-press); animation: sk 1.5s ease-in-out infinite; }
.avatar.sk { border-radius: 50%; }
.sk-line { height: 10px; margin: 5px 0; }
.sk-line:first-child { height: 9px; }
@keyframes sk { 50% { opacity: .45; } }
.composer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(12px + var(--safe-b)) 14px;
  border-top: 1px solid var(--sep);
}
.avatar.me { width: 34px; height: 34px; font-size: 12px; background: var(--tile-bg); color: var(--tile-ink); }
.composer-field {
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 6px 0 16px;
  border-radius: var(--r-chip);
  background: var(--row-fill);
  box-shadow: inset 0 0 0 1px var(--sep);
}
.composer-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--focus); }
.composer-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 15.5px; outline: none; }
.composer-field input::placeholder { color: var(--ink-3); }
.composer-emoji { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.composer-emoji svg, .composer-send svg { width: 20px; height: 20px; }
.composer-send {
  width: 46px;
  height: 46px;
  flex: none;
  border: 0;
  border-radius: var(--r-btn);
  display: grid;
  place-items: center;
  background: var(--accent-fill);
  color: var(--on-accent);
  cursor: pointer;
  transition: opacity .2s, scale .35s var(--spring);
}
.composer-send svg { width: 19px; height: 19px; }
.composer-send:disabled { background: var(--track); color: var(--ink-3); cursor: default; }
.composer-send:not(:disabled):active { scale: .92; }

@media (min-width: 900px) {
  .sheet {
    inset: 16px 16px 16px auto;
    width: 420px;
    height: auto;
    border-radius: var(--r-sheet);
    translate: 110% 0;
  }
  .sheet[open]:not([data-closing]) { @starting-style { opacity: 0; translate: 110% 0; } }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 18px; min-height: 68px; }
  .comments { height: auto; }
  .sheet::backdrop { background: var(--backdrop-desk, rgb(0 0 0 / .12)); }
  .sheet.comments::backdrop { background: transparent; }
}

/* View-transition morph: gear → settings sheet, onboarding lens → first-load card */
::view-transition-group(settings-morph),
::view-transition-group(lens) {
  animation-duration: var(--spring-d);
  animation-timing-function: var(--spring-soft);
}
::view-transition-old(settings-morph),
::view-transition-new(settings-morph) { height: 100%; width: 100%; }
::view-transition-old(settings-morph) { animation-duration: .18s; }
::view-transition-group(root) { animation-duration: .5s; }

/* ==========================================================================
   REDUCED MOTION — fades instead of travel, decorative loops stopped
   ========================================================================== */
:root[data-motion="reduced"] .ambient i,
:root[data-motion="reduced"] .orbit,
:root[data-motion="reduced"] .orb-inner,
:root[data-motion="reduced"] .sound-track span,
:root[data-motion="reduced"] .cardbg i,
:root[data-motion="reduced"] .hint svg,
:root[data-motion="reduced"] .c-gif span,
:root[data-motion="reduced"] .support-hero svg.sh-logo,
:root[data-motion="reduced"] .card-visual * { animation: none !important; }
:root[data-motion="reduced"] .steps li[data-state="active"] .step-dot::after { animation: none; border-color: var(--card-accent); opacity: .6; }
:root[data-motion="reduced"] .orb-card { transition: none; }
:root[data-motion="reduced"] .onb.is-in .lens,
:root[data-motion="reduced"] .onb.is-in .lens-logo,
:root[data-motion="reduced"] .onb.is-in .onb-copy > * { animation: fade .3s linear both; animation-delay: 0s; }
:root[data-motion="reduced"] .onb.is-in .ripple { animation: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
:root[data-motion="reduced"] .sheet { translate: 0 0; transition: opacity .15s linear, display .15s allow-discrete, overlay .15s allow-discrete; }
:root[data-motion="reduced"] .sheet[open]:not([data-closing]) { @starting-style { opacity: 0; translate: 0 0; } }
:root[data-motion="reduced"] .feed,
:root[data-motion="reduced"] .panes,
:root[data-motion="reduced"] .seg-thumb,
:root[data-motion="reduced"] .switch::before { transition-duration: .01s; }
:root[data-motion="reduced"] .progress i.run { animation: none; scale: .35 1; }
:root[data-motion="reduced"] .toast { animation-name: fade; }
:root[data-motion="reduced"] .sk { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
