/* Scroll Up
   Layout: a full-bleed vertical feed; controls float over the video in dark glass;
   idea cards are real index cards (white stock, blue rules, red header line) laid on a night-sky desk.
   One bold moment per screen: the index card in the feed, the altimeter on the You tab. */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }

:root {
  --night: #0B1120;        /* pre-dawn sky, the base */
  --night-2: #121A2D;      /* raised surfaces */
  --night-3: #1A2439;      /* inputs, segments */
  --night-4: #26324D;      /* selected, tracks */
  --frost: #ECF1FB;        /* main text */
  --haze: #9AA6C2;         /* secondary text */
  --mist: #6F7B97;         /* tertiary text */
  --line: rgba(160, 182, 228, 0.15);
  --dawn: #FFC46B;         /* the accent: first light */
  --dawn-2: #FF8A4C;       /* deeper sunrise, gradients only */
  --on-dawn: #2A1700;
  --stock: #FFFEFA;        /* index card */
  --rule: #C3D7EE;         /* card rules */
  --margin-red: #E1625D;   /* card header line */
  --card-ink: #1A2131;
  --card-ink-2: #4B5568;
  --ok: #5ED6A0;
  --bad: #FF7E7E;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;

  --tabbar-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --gutter-l: max(16px, var(--safe-l));
  --gutter-r: max(16px, var(--safe-r));
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--night);
  color: var(--frost);
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { position: fixed; inset: 0; overflow: hidden; }
#app { position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--dawn); outline-offset: 2px; border-radius: 6px; }
.i { display: block; flex: none; }

/* ───────────── Views ───────────── */
.view { position: absolute; inset: 0; }
.view-page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--night);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
}
.view-sub { z-index: 6; }

/* ───────────── Feed ───────────── */
.view-feed { background: #000; overflow: hidden; }

.player-layer {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden; background: #000;
  opacity: 0; transition: opacity .16s linear;
  pointer-events: none;
}
.player-layer.visible { opacity: 1; }
.player-layer.tap-through { z-index: 6; pointer-events: auto; }
.player-frame { position: absolute; }
.player-frame iframe, .player-frame > div { width: 100%; height: 100%; border: 0; display: block; }

.feed-scroller {
  position: absolute; inset: 0; z-index: 2;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-scroller::-webkit-scrollbar { display: none; }
.view-feed.tap-through .feed-scroller { pointer-events: none; }

.slide {
  position: relative;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.gesture { position: absolute; inset: 0; }

/* Topic strip */
.feed-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  padding: calc(var(--safe-t) + 6px) 0 14px;
  background: linear-gradient(to bottom, rgba(3, 6, 14, .5), rgba(3, 6, 14, 0));
  pointer-events: none;
}
.topic-strip {
  display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
  pointer-events: auto;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.topic-strip::-webkit-scrollbar { display: none; }
.topic-chip {
  flex: none; position: relative;
  padding: 9px 10px 11px;
  font-size: 15.5px; font-weight: 600; letter-spacing: .005em;
  color: rgba(236, 241, 251, .62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  transition: color .15s;
}
.topic-chip[aria-pressed="true"] { color: #fff; }
.topic-chip[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px;
  height: 3px; border-radius: 3px; background: var(--dawn);
}
.feed-listbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 10px) var(--gutter-r) 14px var(--gutter-l);
  background: linear-gradient(to bottom, rgba(3, 6, 14, .6), rgba(3, 6, 14, 0));
}
.listbar-title { font-weight: 700; font-size: 16px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.listbar-exit { padding: 7px 14px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-weight: 600; font-size: 14px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Video slide */
.slide-video { background: transparent; }
.slide-media { position: absolute; inset: 0; background: #05070D; }
.slide-video.live .slide-media { opacity: 0; transition: opacity .14s linear .05s; }
.thumb-blur {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.15) brightness(.5);
  transform: translateZ(0);
}
.slide-media .thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .25s;
}
.slide-media .thumb.loaded { opacity: 1; }
.loading-ring {
  position: absolute; left: 50%; top: 50%;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22);
  border-top-color: rgba(255, 255, 255, .9);
  opacity: 0;
  animation: spin .9s linear infinite;
  transition: opacity .2s;
}
.slide-video.is-active:not(.live):not(.errored) .loading-ring { opacity: 1; transition-delay: .5s; }
.loading-ring.big { position: static; margin: 0 auto 20px; opacity: 1; width: 44px; height: 44px; }
@keyframes spin { to { transform: rotate(360deg); } }

.slide-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .38) 0, rgba(0, 0, 0, 0) 20%),
    linear-gradient(to top, rgba(0, 0, 0, .74) 0, rgba(0, 0, 0, .3) 30%, rgba(0, 0, 0, 0) 52%);
}
.slide-meta {
  position: absolute;
  left: var(--gutter-l); right: 86px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.v-channel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
.topic-tag {
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: color-mix(in srgb, var(--ink) 40%, #fff);
  background: rgba(8, 12, 24, .45);
  border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent);
  padding: 2px 8px; border-radius: 99px;
  text-shadow: none;
}
.v-title {
  margin: 8px 0 0;
  font-size: 16px; line-height: 1.38; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.v-title.pending { min-height: 1.4em; }
.v-facts { margin-top: 6px; font-size: 13px; color: rgba(236, 241, 251, .7); font-variant-numeric: tabular-nums; }
.v-facts:empty { display: none; }
.slide-note {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(10, 14, 26, .82);
  font-size: 14px; text-align: center;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.slide-note.show { opacity: 1; }

/* Action rail */
.rail {
  position: absolute; z-index: 3;
  right: max(6px, var(--safe-r));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.rail-btn {
  width: 62px; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}
.rail-btn .i { width: 30px; height: 30px; transition: transform .12s var(--ease); }
.rail-btn:active .i { transform: scale(.86); }
.rail-label { font-size: 11.5px; font-weight: 600; }
.rail-btn[aria-pressed="true"], .rail-btn.on { color: var(--dawn); }

/* Cards lay their actions out in a row under the card */
.slide-idea .rail, .slide-live .rail {
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  flex-direction: row; justify-content: center; gap: 22px;
}
.slide-idea .rail-btn, .slide-live .rail-btn { filter: none; color: var(--haze); }
.slide-idea .rail-btn[aria-pressed="true"], .slide-idea .rail-btn.on,
.slide-live .rail-btn[aria-pressed="true"], .slide-live .rail-btn.on { color: var(--dawn); }
.slide-idea .rail-btn .i, .slide-live .rail-btn .i { width: 26px; height: 26px; }

.feed-progress {
  position: absolute; left: 0; right: 0; z-index: 5;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  height: 2px; background: rgba(255, 255, 255, .16);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.feed-progress.on { opacity: 1; }
.feed-progress-fill { height: 100%; background: var(--dawn); transform-origin: 0 50%; transform: scaleX(0); }

.save-burst {
  position: absolute; z-index: 4; pointer-events: none;
  color: var(--dawn);
  transform: translate(-50%, -50%) scale(.4);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .45));
  animation: burst .85s var(--ease) forwards;
}
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-12deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.1) rotate(0); opacity: 1; }
  60% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -110%) scale(.9); opacity: 0; }
}
.flash-icon {
  position: absolute; left: 50%; top: 46%; z-index: 4; pointer-events: none;
  width: 92px; height: 92px; margin: -46px 0 0 -46px;
  display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, .38); color: #fff;
  animation: flash .65s ease-out forwards;
}
.flash-icon .i { width: 44px; height: 44px; }
@keyframes flash { 0% { opacity: 0; transform: scale(.7); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

.sound-chip {
  position: absolute; z-index: 5;
  left: 50%; transform: translateX(-50%);
  top: calc(var(--safe-t) + 62px);
  z-index: 9;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 12px; border-radius: 99px;
  background: rgba(255, 255, 255, .92); color: #0B1120;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.tap-hint {
  position: absolute; z-index: 9;
  left: 50%; top: calc(var(--safe-t) + 62px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 14px; border-radius: 99px;
  background: rgba(255, 255, 255, .94); color: #0B1120;
  font-size: 14.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
  pointer-events: none;
  animation: pop .25s var(--ease);
}
.tap-hint-x { pointer-events: auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(11, 17, 32, .08); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ───────────── Index cards ───────────── */
.slide-idea, .slide-recall, .slide-notice {
  background:
    radial-gradient(110% 70% at 50% 108%, color-mix(in srgb, var(--dawn-2) 16%, transparent) 0%, transparent 60%),
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--ink, #3A4A70) 30%, transparent) 0%, transparent 62%),
    var(--night);
}
.card-stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: calc(var(--safe-t) + 60px) var(--gutter-r) calc(var(--tabbar-h) + var(--safe-b) + 78px) var(--gutter-l);
  pointer-events: none;
}
.slide-recall .card-stage { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.index-card {
  pointer-events: auto;
  position: relative;
  width: min(100%, 460px);
  max-height: 100%;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--stock);
  color: var(--card-ink);
  border-radius: 4px;
  padding: 16px 22px 18px;
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .7), 0 6px 14px rgba(0, 0, 0, .3);
  transform: rotate(-.7deg);
}
.slide:nth-child(even) .index-card { transform: rotate(.5deg); }
.ic-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13px; font-weight: 700;
}
.ic-topic { color: var(--ink); }
.ic-kind { color: var(--card-ink-2); font-weight: 600; }
.ic-title {
  margin: 8px -22px 0;
  padding: 0 22px 9px;
  border-bottom: 2px solid var(--margin-red);
  font-family: var(--font-read); font-weight: 600;
  font-size: clamp(24px, 6.6vw, 30px); line-height: 1.12;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.ic-lines {
  --lh: 29px;
  margin: 0 -22px;
  padding: 7px 22px 0;
  min-height: calc(var(--lh) * 3);
  line-height: var(--lh);
  background-image: repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px), var(--rule) var(--lh));
  background-position: 0 1px;
  overflow: hidden;
}
.ic-body { margin: 0; font-family: var(--font-read); font-size: 19px; font-weight: 400; }
.ic-tip { margin: var(--lh) 0 0; font-family: var(--font-read); font-style: italic; font-size: 18px; color: var(--card-ink-2); }
.ic-tip-label { font-family: var(--font-ui); font-style: normal; font-weight: 700; font-size: 13px; color: var(--ink); margin-right: 2px; }
.ic-link {
  align-self: flex-start;
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--ink) 80%, #000);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.index-card.tight .ic-title { font-size: clamp(21px, 5.8vw, 25px); }
.index-card.tight .ic-lines { --lh: 26px; }
.index-card.tight .ic-body { font-size: 17px; }
.index-card.tight .ic-tip { font-size: 16px; }
.index-card.tight .recall-choice { padding: 9px 12px; font-size: 16px; }
.index-card.tighter .ic-title { font-size: 20px; }
.index-card.tighter .ic-lines { --lh: 23px; }
.index-card.tighter .ic-body { font-size: 15.5px; }
.index-card.tighter .ic-tip { font-size: 15px; }
.index-card.tighter .recall-choice { padding: 8px 12px; font-size: 15px; }
.index-card.tighter .recall-choices { gap: 6px; margin-top: 12px; }
.index-card.compact { transform: none; box-shadow: none; border: 1px solid rgba(0, 0, 0, .06); }
.index-card.compact .ic-title { font-size: 23px; }
.index-card.compact .ic-body { font-size: 17px; }
.index-card.compact .ic-lines { --lh: 26px; }

/* Recall */
.index-card.recall .ic-lines { color: var(--card-ink-2); }
.recall-choices { display: grid; gap: 8px; margin-top: 16px; }
.recall-choice {
  text-align: left;
  padding: 11px 14px; border-radius: 10px;
  background: #F1F4FA; border: 1px solid #D9E2EF;
  font-family: var(--font-read); font-size: 17px; font-weight: 600; color: var(--card-ink);
  transition: background .15s, border-color .15s;
}
.recall-choice:active { background: #E5EBF5; }
.recall-choice.right { background: #E2F6EC; border-color: #6CC79A; color: #135C38; }
.recall-choice.wrong { background: #FDE8E7; border-color: #E79A96; color: #8A2621; }
.recall-choice:disabled { cursor: default; }
.recall-result { margin: 12px 0 0; font-size: 14.5px; font-weight: 600; }
.recall-result.right { color: #1B7A4B; }
.recall-result.wrong { color: #A3322C; }

/* Live cards */
.slide-live { background: var(--night); }
.live-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.live-photo { position: relative; margin: 0; flex: 1 1 auto; min-height: 26%; overflow: hidden; background: var(--night-2); }
.live-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11, 17, 32, .45) 0, transparent 26%, transparent 55%, var(--night) 100%); }
.live-photo figcaption { position: absolute; right: var(--gutter-r); bottom: 44px; z-index: 1; font-size: 11px; color: rgba(255, 255, 255, .58); max-width: 70%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-photo.no-photo { display: none; }
.live-body {
  position: relative; z-index: 1; flex: none;
  margin-top: -36px;
  padding: 0 var(--gutter-r) calc(var(--tabbar-h) + var(--safe-b) + 76px) var(--gutter-l);
  display: flex; flex-direction: column;
}
.live-wrap.no-image .live-body { margin-top: auto; padding-top: calc(var(--safe-t) + 80px); }
.live-kicker { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--dawn); }
.live-title {
  margin: 0 0 10px;
  font-family: var(--font-read); font-weight: 600;
  font-size: clamp(22px, 6vw, 28px); line-height: 1.16;
  text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.live-text {
  margin: 0 0 12px;
  font-family: var(--font-read); font-size: 18px; line-height: 1.5; color: #CFD7E8;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-height: 800px) { .live-text { -webkit-line-clamp: 6; } }
.live-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--dawn); text-decoration: none; }

/* Notices */
.notice-stage {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: calc(var(--safe-t) + 60px) 28px calc(var(--tabbar-h) + var(--safe-b) + 40px);
  pointer-events: none;
}
.notice { pointer-events: auto; max-width: 340px; text-align: center; }
.notice-ico { color: var(--dawn); display: grid; place-items: center; margin-bottom: 14px; }
.notice-title { margin: 0 0 10px; font-family: var(--font-read); font-weight: 600; font-size: 28px; line-height: 1.15; }
.notice-text { margin: 0 0 20px; color: var(--haze); font-size: 16px; line-height: 1.5; }
.notice .btn-row { justify-content: center; }
.welcome-mark { display: grid; place-items: center; margin-bottom: 18px; }
.welcome-mark svg { border-radius: 22px; box-shadow: 0 18px 40px -10px rgba(255, 138, 76, .35); }
.swipe-cue { display: grid; place-items: center; color: var(--dawn); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(6px); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }

/* ───────────── Tab bar ───────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 var(--gutter-r) var(--safe-b) var(--gutter-l);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(9, 13, 25, .9);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
          backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
body[data-view="feed"] .tabbar { background: rgba(3, 5, 10, .62); border-top-color: rgba(255, 255, 255, .07); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mist); font-size: 11px; font-weight: 600; }
.tab .i { width: 25px; height: 25px; }
.tab[aria-current="page"] { color: var(--frost); }
.tab[aria-current="page"] .tab-ico { color: var(--dawn); }

/* ───────────── Pages ───────────── */
.page-head { padding: calc(var(--safe-t) + 18px) var(--gutter-r) 8px var(--gutter-l); }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.page-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 800;
  font-size: 44px; line-height: .95; letter-spacing: .01em;
}
.page-title.small { font-family: var(--font-ui); font-size: 20px; font-weight: 700; letter-spacing: 0; line-height: 1.2; }
.page-sub { margin: 6px 0 0; color: var(--haze); font-size: 14px; }
.page-actions { display: flex; gap: 4px; margin-top: 2px; }
.page-body { padding: 8px var(--gutter-r) 0 var(--gutter-l); }
.sub-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 8px) var(--gutter-r) 10px max(6px, var(--safe-l));
  background: rgba(11, 17, 32, .985);
  border-bottom: 1px solid var(--line);
}
.sub-head-text { flex: 1; min-width: 0; }
.sub-head-text .page-sub { margin-top: 0; font-size: 13px; }
.back-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--frost); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--frost); }
.icon-btn:active, .back-btn:active { background: var(--night-3); }
.icon-btn.small { width: 36px; height: 36px; color: var(--haze); }
.section-title { margin: 0; font-size: 17px; font-weight: 700; }

/* Buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  font-size: 15.5px; font-weight: 700;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--dawn); color: var(--on-dawn); }
.btn-quiet { background: var(--night-3); color: var(--frost); }
.btn-danger { background: color-mix(in srgb, var(--bad) 22%, var(--night-3)); color: #FFD9D7; }
.btn-small { min-height: 38px; padding: 8px 14px; font-size: 14.5px; border-radius: 10px; }
.btn-wide { width: 100%; min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 2px; font-size: 14.5px; font-weight: 600; color: var(--haze); }
.link-btn.danger { color: var(--bad); }

.field {
  width: 100%;
  padding: 12px 14px; border-radius: 12px;
  background: var(--night-3); border: 1px solid var(--line);
  color: var(--frost); font-size: 16px;
}
.field:focus { border-color: color-mix(in srgb, var(--dawn) 70%, transparent); }
.field::placeholder { color: var(--mist); }
textarea.field { resize: vertical; line-height: 1.45; min-height: 64px; }
.field.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--haze) 50%), linear-gradient(135deg, var(--haze) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field-label { display: block; margin: 14px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--haze); }
.field-label:first-child { margin-top: 0; }
.field-hint { margin: 6px 0 0; font-size: 13px; color: var(--mist); line-height: 1.45; }
.field-with-btn { display: flex; gap: 8px; align-items: center; }
.field-with-btn .field { flex: 1; min-width: 0; }

.search-wrap { position: relative; margin: 12px 0 4px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mist); }
.search-input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px;
  background: var(--night-3); border: 1px solid transparent; color: var(--frost); font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.search-input:focus { border-color: var(--line); }
.search-input::placeholder { color: var(--mist); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 10px calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 2px var(--gutter-r) 2px var(--gutter-l); }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 99px;
  background: var(--night-2); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--haze);
}
.chip[aria-selected="true"] { background: var(--frost); color: var(--night); border-color: var(--frost); }
.chip-count { font-variant-numeric: tabular-nums; font-weight: 700; opacity: .7; }
.chip-add { color: var(--dawn); border-style: dashed; }

.segmented { display: flex; padding: 3px; gap: 2px; margin-top: 12px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.segmented.small { margin-top: 10px; }
.seg { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--haze); white-space: nowrap; }
.seg[aria-selected="true"], .seg[aria-checked="true"] { background: var(--night-4); color: var(--frost); }

/* ───────────── Stash ───────────── */
.stash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
@media (min-width: 620px) { .stash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .stash-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; text-align: left; border-radius: 14px; overflow: hidden; background: var(--night-2); border: 1px solid var(--line); }
.tile:active { transform: scale(.985); }
.tile-media { position: relative; aspect-ratio: 9 / 15; background: #05070D; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-video .tile-media img { transform: scale(1.12); }
.tile-media-wide { aspect-ratio: 16 / 10; }
.tile-media-none { display: grid; place-items: center; color: var(--mist); }
.tile-play { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; }
.tile-text { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px 11px; min-width: 0; }
.tile-title { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-src { font-size: 12px; color: var(--haze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-note-dot { position: absolute; top: 8px; left: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--dawn); box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.tile-idea { background: transparent; border: 0; overflow: visible; }
.mini-card {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 100%; aspect-ratio: 9 / 15;
  padding: 12px 12px 10px; border-radius: 4px;
  background: var(--stock);
  color: var(--card-ink); overflow: hidden;
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .6);
}
.mini-topic { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.mini-title { font-family: var(--font-read); font-weight: 600; font-size: 18px; line-height: 1.15; padding-bottom: 6px; border-bottom: 1.5px solid var(--margin-red); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.mini-body {
  margin: 0 -12px; padding: 1px 12px 0;
  font-family: var(--font-read); font-size: 14px; line-height: 22px; color: var(--card-ink-2);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 21px, var(--rule) 21px, var(--rule) 22px);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical;
}

.view-stash.is-empty .search-wrap, .view-stash.is-empty .collections-row, .view-stash.is-empty .segmented { display: none; }
.empty-state { padding: 48px 12px; text-align: center; max-width: 420px; margin: 0 auto; }
.empty-ico { color: var(--dawn); display: grid; place-items: center; margin-bottom: 12px; }
.empty-title { margin: 0 0 8px; font-family: var(--font-read); font-weight: 600; font-size: 26px; }
.empty-text { margin: 0 0 20px; color: var(--haze); line-height: 1.5; }
.empty-small { color: var(--haze); font-size: 14.5px; line-height: 1.5; margin: 8px 0 14px; }

/* Detail sheet */
.detail { display: flex; flex-direction: column; }
.detail-preview { margin: 0 calc(-1 * var(--gutter-r)) 14px calc(-1 * var(--gutter-l)); }
.detail-preview.video, .detail-preview.link { display: grid; place-items: center; background: #05070D; }
.detail-preview.video { padding: 4px 0 6px; background: radial-gradient(60% 80% at 50% 50%, #1A2439, #05070D); }
.detail-preview.video img { height: 38vh; width: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7); }
.detail-preview.link img { width: 100%; max-height: 34vh; object-fit: cover; }
.detail-preview.idea { padding: 4px var(--gutter-r) 4px var(--gutter-l); }
.detail-title { margin: 0; font-family: var(--font-read); font-weight: 600; font-size: 22px; line-height: 1.2; }
.detail-src { margin: 6px 0 0; color: var(--haze); font-size: 13.5px; }
.detail-cols { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--dawn); font-size: 13.5px; font-weight: 600; }
.detail-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 8px; margin: 16px 0 6px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--night-3); font-size: 12.5px; font-weight: 600; color: var(--frost); }
.action-primary { background: var(--dawn); color: var(--on-dawn); }
.detail-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.note-field { min-height: 84px; }

.collection-pick { display: flex; flex-direction: column; gap: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--night-3); text-align: left; font-weight: 600; }
.pick-row .pick-name { flex: 1; }
.pick-row[aria-pressed="true"] { background: color-mix(in srgb, var(--dawn) 16%, var(--night-3)); }
.pick-check { color: var(--dawn); }
.pick-new { color: var(--dawn); background: transparent; border: 1px dashed var(--line); }
.add-form .btn-row .btn { flex: 1; }

/* ───────────── You ───────────── */
.me-top { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.alt-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px;
  padding: 18px 16px 18px 18px; border-radius: 20px;
  background:
    radial-gradient(140% 90% at 0% 120%, color-mix(in srgb, var(--dawn-2) 26%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, #16213A, #0E1628);
  border: 1px solid var(--line);
}
.alt-main { display: flex; flex-direction: column; min-width: 0; }
.alt-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--haze); }
.alt-value { margin: 2px 0 0; display: flex; align-items: baseline; gap: 4px; }
.alt-num { font-family: var(--font-display); font-weight: 800; font-size: 78px; line-height: .9; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.alt-unit { font-family: var(--font-display); font-weight: 800; font-size: 32px; color: var(--dawn); }
.alt-passed { margin: 8px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--frost); }
.alt-next { margin-top: auto; padding-top: 14px; }
.alt-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.alt-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--dawn-2), var(--dawn)); }
.alt-next-text { margin: 8px 0 0; font-size: 13px; color: var(--haze); }
.altimeter { position: relative; margin: 14px 0 14px; min-height: 168px; }
.alt-rail { position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
.alt-rail-fill { position: absolute; left: 6px; bottom: 0; width: 2px; border-radius: 2px; background: linear-gradient(to top, var(--dawn-2), var(--dawn)); }
.alt-mark { position: absolute; left: 0; right: 0; transform: translateY(-50%); display: grid; grid-template-columns: 14px 1fr; column-gap: 6px; align-items: baseline; }
.alt-tick { width: 14px; height: 2px; background: rgba(255, 255, 255, .35); align-self: center; }
.alt-name { font-size: 11.5px; font-weight: 600; color: var(--haze); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alt-m { grid-column: 2; font-size: 11px; color: var(--mist); font-variant-numeric: tabular-nums; }
.alt-mark.passed .alt-name { color: var(--frost); }
.alt-mark.passed .alt-tick { background: var(--dawn); }
.alt-you { position: absolute; left: 0; transform: translateY(-50%); }
.alt-you-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--dawn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dawn) 30%, transparent), 0 0 18px var(--dawn); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 13px; border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--haze); line-height: 1.3; }

.me-week { margin-top: 22px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; }
.week-total { font-size: 13.5px; color: var(--haze); font-variant-numeric: tabular-nums; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 132px; margin-top: 12px; padding: 12px 12px 8px; border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); }
.week-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 0; }
.week-n { font-size: 11.5px; color: var(--haze); font-variant-numeric: tabular-nums; height: 14px; }
.week-bar { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--night-4); min-height: 3px; }
.week-col.today .week-bar { background: linear-gradient(to top, var(--dawn-2), var(--dawn)); }
.week-day { font-size: 12px; color: var(--mist); font-weight: 600; }
.week-col.today .week-day { color: var(--frost); }

.history { margin-top: 26px; }
.day-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; margin: 14px calc(-1 * var(--gutter-r)) 4px calc(-1 * var(--gutter-l)); padding: calc(var(--safe-t) * 0 + 8px) var(--gutter-r) 8px var(--gutter-l); font-size: 13.5px; font-weight: 700; color: var(--haze); background: rgba(11, 17, 32, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.day-count { font-weight: 600; color: var(--mist); font-variant-numeric: tabular-nums; }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 0; text-align: left; border-bottom: 1px solid var(--line); }
.hist-media { flex: none; width: 46px; height: 62px; border-radius: 8px; overflow: hidden; background: var(--night-3); }
.hist-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-idea { display: grid; place-items: center; background: var(--stock); color: var(--ink, #556); }
.hist-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hist-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-src { font-size: 12.5px; color: var(--haze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-saved { color: var(--dawn); flex: none; }
.more-btn { display: flex; margin: 18px auto 0; }

/* ───────────── Settings ───────────── */
.settings { padding-top: 6px; }
.set-section { margin-top: 20px; }
.set-title { margin: 0 0 8px 4px; font-size: 13.5px; font-weight: 700; color: var(--haze); }
.set-group { border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); overflow: hidden; }
.set-row {
  position: relative;
  width: 100%; min-height: 54px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-label { font-size: 15.5px; font-weight: 600; }
.set-help { font-size: 13px; color: var(--haze); line-height: 1.4; }
.set-value { color: var(--haze); font-size: 14.5px; }
.set-chev { color: var(--mist); }
.set-ico { color: var(--haze); }
.set-ico.ok { color: var(--ok); }
.set-action.danger, .set-action.danger .set-ico { color: var(--bad); }
.set-nav:active, .set-action:active { background: var(--night-3); }
.setting-block { padding: 14px; border-bottom: 1px solid var(--line); }
.setting-label { margin: 0; font-size: 15.5px; font-weight: 600; }
.setting-help { margin: 4px 0 0; font-size: 13px; color: var(--haze); line-height: 1.45; }
.key-status { margin: 0; font-size: 13.5px; color: var(--haze); line-height: 1.45; min-height: 1em; }
.key-help summary { cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--dawn); padding: 4px 0; }
.key-help ol, .install-steps { margin: 8px 0 4px; padding-left: 20px; color: var(--frost); font-size: 14px; line-height: 1.5; }
.key-help li, .install-steps li { margin-bottom: 6px; }
.inline-ico { display: inline-block; vertical-align: -3px; }
.inline-ico .i { display: inline-block; }
.about { padding: 14px; font-size: 14px; line-height: 1.55; color: var(--haze); }
.about p { margin: 0 0 10px; }
.about-small { font-size: 12.5px; color: var(--mist); }
.range { width: 100%; accent-color: var(--dawn); }
.range-head { display: flex; justify-content: space-between; align-items: baseline; }
.range-out { color: var(--haze); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Health check */
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.health-row { display: flex; gap: 12px; align-items: flex-start; }
.health-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.health-ico.ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.health-ico.bad { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }
.health-text { display: flex; flex-direction: column; gap: 2px; }
.health-label { font-weight: 700; }
.health-detail { color: var(--haze); font-size: 14px; line-height: 1.4; }
.loading-ring.small { position: static; margin: 0; width: 22px; height: 22px; border-width: 2.5px; opacity: 1; }

/* Switch */
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch {
  flex: none; position: relative; width: 50px; height: 30px; border-radius: 99px;
  background: var(--night-4); transition: background .18s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .18s var(--ease);
}
.switch-input:checked + .switch { background: var(--dawn); }
.switch-input:checked + .switch::after { transform: translateX(20px); }
.switch-input:focus-visible + .switch { outline: 2px solid var(--dawn); outline-offset: 2px; }
.switch-wrap { display: flex; cursor: pointer; }

.topic-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pick-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--night-3); border: 1.5px solid transparent;
  font-size: 14.5px; font-weight: 700; color: var(--haze); text-align: left;
}
.pick-chip[aria-pressed="true"] {
  color: var(--frost);
  background: color-mix(in srgb, var(--ink) 22%, var(--night-3));
  border-color: color-mix(in srgb, var(--ink) 70%, #fff 0%);
}
.pick-chip.big { padding: 12px 14px; border-radius: 14px; }
.pick-blurb { font-size: 12.5px; font-weight: 500; color: var(--haze); }
.pick-chip[aria-pressed="true"] .pick-blurb { color: color-mix(in srgb, var(--frost) 75%, transparent); }

/* Channels */
.channels-help { margin: 4px 4px 4px; }
.channel-list .set-title { margin-top: 20px; }
.channel-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); }
.channel-row:last-child { border-bottom: 0; }
.ch-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  color: color-mix(in srgb, var(--ink) 30%, #fff);
  background: color-mix(in srgb, var(--ink) 34%, var(--night-3));
}
.ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.ch-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { display: flex; gap: 8px; font-size: 12.5px; color: var(--mist); white-space: nowrap; overflow: hidden; }
.ch-status.ok { color: var(--ok); }
.ch-status.warn { color: #F1B868; }
.ch-handle { overflow: hidden; text-overflow: ellipsis; }

/* ───────────── Sheets, menus, toasts ───────────── */
.sheet-root { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, .55); opacity: 0; transition: opacity .22s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86%;
  display: flex; flex-direction: column;
  background: var(--night-2);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .4);
  transform: translateY(100%);
  transition: transform .26s var(--ease);
  max-width: 640px; margin: 0 auto;
}
.sheet-tall { max-height: 92%; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: translateY(0); }
.sheet-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px var(--gutter-r) 8px var(--gutter-l); touch-action: none; }
.sheet-grip { position: absolute; left: 50%; top: 6px; width: 38px; height: 5px; margin-left: -19px; border-radius: 5px; background: rgba(255, 255, 255, .2); }
.sheet-title { flex: 1; min-width: 0; margin: 6px 0 0; font-size: 17px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-close { margin: 2px -6px 0 0; color: var(--haze); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px var(--gutter-r) calc(var(--safe-b) + 22px) var(--gutter-l); }
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--night-3); }
.menu-ico { color: var(--haze); }
.menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-label { font-size: 16px; font-weight: 600; }
.menu-hint { font-size: 13px; color: var(--haze); }
.menu-item.danger, .menu-item.danger .menu-ico { color: var(--bad); }
.confirm-msg { margin: 0; color: var(--haze); line-height: 1.5; }

.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px 12px 16px; border-radius: 14px;
  background: #F4F6FB; color: #101727;
  font-size: 14.5px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
body[data-view="feed"] .toast { bottom: auto; top: calc(var(--safe-t) + 58px); transform: translate(-50%, -16px); }
body[data-view="feed"] .toast.show { transform: translate(-50%, 0); }
.toast-action { flex: none; padding: 6px 10px; border-radius: 9px; background: #101727; color: var(--dawn); font-weight: 700; font-size: 14px; }
.toast-celebrate { background: linear-gradient(120deg, #FFE1A8, #FFC46B); color: var(--on-dawn); }
.toast-error { background: #FFE3E1; color: #6B1611; }

/* ───────────── Onboarding ───────────── */
.onboard {
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(90% 55% at 50% 112%, rgba(255, 138, 76, .42) 0%, rgba(255, 196, 107, .14) 38%, transparent 70%),
    var(--night);
  transition: opacity .3s;
}
.onboard.leaving { opacity: 0; }
.ob-step {
  min-height: 100%;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 520px; margin: 0 auto;
  padding: calc(var(--safe-t) + 36px) var(--gutter-r) calc(var(--safe-b) + 24px) var(--gutter-l);
  animation: rise .4s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ob-welcome { justify-content: space-between; }
.ob-hero { padding-top: 6vh; }
.ob-logo svg { border-radius: 26px; box-shadow: 0 22px 50px -14px rgba(255, 138, 76, .45); }
.ob-wordmark { margin: 22px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 66px; line-height: .9; letter-spacing: .005em; }
.ob-lede { margin: 14px 0 0; font-family: var(--font-read); font-size: 21px; line-height: 1.45; color: #D8DFEE; max-width: 26em; }
.ob-points, .ob-gestures { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ob-points li, .ob-gestures li { display: flex; gap: 14px; align-items: flex-start; font-size: 15.5px; line-height: 1.45; color: var(--frost); }
.ob-gestures strong { font-weight: 700; }
.ob-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--night-3); color: var(--dawn); }
.ob-head { display: flex; flex-direction: column; gap: 6px; }
.ob-count { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--dawn); }
.ob-title { margin: 0; font-family: var(--font-read); font-weight: 600; font-size: 32px; line-height: 1.12; text-wrap: balance; }
.ob-sub { margin: 4px 0 0; color: var(--haze); line-height: 1.5; }
.ob-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-topics .pick-chip { width: 100%; }
.ob-foot {
  margin: auto calc(-1 * var(--gutter-r)) calc(-1 * (var(--safe-b) + 24px)) calc(-1 * var(--gutter-l));
  padding: 28px var(--gutter-r) calc(var(--safe-b) + 18px) var(--gutter-l);
  position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--night) 62%, rgba(11, 17, 32, 0));
}
.ob-welcome .ob-foot, .ob-step:not(:has(.ob-topics)) .ob-foot { background: none; }
.ob-install { padding: 14px 16px; border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--haze); }
.ob-install p { margin: 0; }
.ob-install-title { color: var(--frost); font-weight: 700; margin-bottom: 4px !important; }

/* Hidden helper player used to find Shorts */
.yt-scout { position: fixed; left: 0; bottom: 0; width: 200px; height: 200px; opacity: 0; pointer-events: none; z-index: -1; overflow: hidden; }

/* Wider screens: keep the feed phone-shaped */
@media (min-width: 700px) {
  .view-feed { background: #000; }
  .slide-meta { right: 96px; }
}

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