/* css/tokens.css */
/* Design tokens — see DESIGN.md. Nothing here is app-specific. */

:root {
  /* Colors */
  --color-fresh-grass: #8ed462;
  --color-cream-paper: #f5f1e4;
  --color-ink-black: #2c2e2a;
  --color-pure-white: #ffffff;
  --color-sandstone: #e0dbce;
  --color-stone-gray: #80827f;
  --color-hairline-mist: #d5d5d4;
  --color-sky-pop: #2ba0ff;
  --color-coral-pop: #ff705d;
  --color-sunshine-pop: #f5e211;

  /* Typography */
  --font-inter: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-micro: 14px;
  --text-body-sm: 15px;
  --text-body: 17px;
  --text-body-lg: 18px;
  --text-subheading: 20px;

  /* Radius */
  --radius-small: 10px;
  --radius-mid: 20px;
  --radius-card: 32px;
  --radius-full: 50px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.2s;
  --dur-mid: 0.28s;

  /* Layers */
  --z-sheet: 40;
  --z-toast: 60;
}

/* css/base.css */
/* Reset, page canvas and shared primitives used by more than one component. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  font-family: var(--font-inter);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* The app shell is exactly one viewport tall; the page scrolls only to reach
   the content below it, and stops being scrollable once cards are queued. */
body.is-compact { overflow: hidden; }

button, input { font-family: inherit; }
button { cursor: pointer; }

/* Components toggle visibility with the `hidden` attribute; flex/grid display
   would otherwise win over the UA rule. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--color-ink-black);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Shared primitives ---------- */

.scroll-y {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-sandstone) transparent;
}
.scroll-y::-webkit-scrollbar { width: 8px; }
.scroll-y::-webkit-scrollbar-thumb {
  background: var(--color-sandstone);
  border-radius: var(--radius-full);
}

.scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

.ghost-btn {
  padding: 6px 16px;
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-stone-gray);
  font-size: var(--text-body-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.ghost-btn:hover { border-color: var(--color-ink-black); color: var(--color-ink-black); }

.spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* css/layout.css */
/* App shell: a single non-scrolling column where only the queue scrolls.
   `body.is-compact` is set once the queue has cards — the marketing rows
   collapse so the list gets the height instead. */

.shell {
  height: 100dvh;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shell > * { flex: none; }
.shell > .queue { flex: 1 1 auto; min-height: 0; }

@media (max-width: 620px) {
  .shell { padding: 12px 14px 14px; gap: 12px; }
}

/* css/components/nav.css */
/* Floating pill navigation. */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-pure-white);
  border-radius: var(--radius-full);
  /* Logical, not left/right: the whole bar mirrors under dir="rtl". */
  padding: 8px;
  padding-inline-start: 20px;
}

.nav-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-fresh-grass);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-mark svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: var(--color-ink-black);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-name {
  font-size: var(--text-body);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-right { display: flex; align-items: center; gap: 8px; flex: none; }

.nav-link {
  font-size: var(--text-body-sm);
  color: var(--color-ink-black);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.nav-link:hover { background: var(--color-cream-paper); }

/* The other nav action is the language switcher — see components/lang.css.
   The "1000+ supported sites" button that used to sit here moved out entirely;
   the rail's own chip already opens that sheet. */

@media (max-width: 620px) {
  .nav { padding: 6px; padding-inline-start: 16px; }
  .nav-name { font-size: var(--text-body-sm); }
  .nav-link { padding: 6px 8px; }
}

/* css/components/lang.css */
/* Language switcher in the nav. The pill borrows the shape the sites button
   used to have; the menu is the one floating surface outside the sheet. */

.lang { position: relative; flex: none; }

.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px 10px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm); font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-fast);
}
.lang-btn:hover { background: var(--color-sandstone); }
.lang-btn > svg { width: 16px; height: 16px; flex: none; }

.lang-code { letter-spacing: 0.02em; }

.lang-caret { display: flex; width: 12px; height: 12px; color: var(--color-stone-gray); }
.lang-caret svg { width: 100%; height: 100%; transition: transform var(--dur-fast); }
.lang.is-open .lang-caret svg { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  /* Hangs off the nav's inline end, so it flips sides on its own in Arabic. */
  inset-inline-end: 0;
  z-index: var(--z-sheet);
  min-width: 210px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  list-style: none;
  background: var(--color-pure-white);
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-mid);
  box-shadow: 0 12px 32px rgb(44 46 42 / 0.12);
}

.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-small);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm);
  text-decoration: none;
  transition: background var(--dur-fast);
}
.lang-menu a:hover { background: var(--color-cream-paper); }

.lang-name { flex: 1; min-width: 0; }
.lang-tick { color: var(--color-fresh-grass); font-weight: 500; opacity: 0; }
.lang-menu a.is-active { font-weight: 500; }
.lang-menu a.is-active .lang-tick { opacity: 1; }

@media (max-width: 620px) {
  .lang-btn { padding: 9px 12px 9px 13px; }
  .lang-menu { min-width: 190px; }
}

/* css/components/hero.css */
/* Headline block. Shrinks out of the way once the queue is in use. */

.hero { padding: 22px 4px 0; }
.hero h1 {
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 500; line-height: 0.95; letter-spacing: -0.06em;
  transition: font-size 0.3s var(--ease-out);
}
.hero p {
  margin-top: 14px;
  font-size: var(--text-body-lg); line-height: 1.5;
  color: var(--color-stone-gray);
  max-width: 44ch;
}
.hero strong { color: var(--color-ink-black); font-weight: 500; }

body.is-compact .hero { padding: 2px 4px 0; }
body.is-compact .hero h1 { font-size: clamp(24px, 4vw, 30px); }
body.is-compact .hero p { display: none; }

@media (max-width: 620px) {
  .hero { padding: 14px 4px 0; }
  .hero p { font-size: var(--text-body); margin-top: 10px; }
}

@media (max-height: 700px) {
  .hero { padding: 10px 4px 0; }
  .hero h1 { font-size: clamp(28px, 5vw, 40px); }
  .hero p { display: none; }
}

/* css/components/platforms.css */
/* Always-visible proof of what this tool accepts. This is the answer to
   "what can I even paste here?" — it must never live behind a menu. */

.platforms { display: flex; flex-direction: column; gap: 8px; }

.platforms-label {
  padding: 0 6px;
  font-size: var(--text-body-sm);
  color: var(--color-stone-gray);
}

.rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Also worn by <a> now that each chip opens the platform's own homepage,
   hence the link reset — no underline, no browser default link color. */
.chip-site {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--color-pure-white);
  color: inherit;
  text-decoration: none;
  font-size: var(--text-body-sm);
  white-space: nowrap;
  transition: color var(--dur-fast);
}
/* Color, not underline, is the hover affordance — the brand dot's own color,
   already carried per-chip via the inline --brand custom property. */
.chip-site:hover { color: var(--brand, var(--color-ink-black)); }
.chip-icon {
  width: 18px; height: 18px; border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.chip-more {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--color-ink-black);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-ink-black);
  font-size: var(--text-body-sm); font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.chip-more:hover { background: var(--color-ink-black); color: var(--color-pure-white); }

body.is-compact .platforms { display: none; }

/* One scrollable row on phones — wrapping would eat four rows of height. */
@media (max-width: 620px) {
  .rail {
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .rail > * { flex: none; }
}

@media (max-height: 700px) {
  .platforms-label { display: none; }
}

/* css/components/composer.css */
/* URL input, rotating hint and the global quality switch. */

.composer {
  background: var(--color-pure-white);
  border-radius: var(--radius-card);
  padding: 12px 12px 14px;
}

.composer-row { display: flex; align-items: center; gap: 10px; }

.composer-field { position: relative; flex: 1; min-width: 0; }

.composer-field input {
  width: 100%;
  border: none; outline: none; background: transparent;
  color: var(--color-ink-black);
  font-size: var(--text-body-lg); line-height: 1.5;
  padding-block: 10px;
  padding-inline: 14px 6px;
}
.composer-field input:disabled { cursor: not-allowed; }
/* The rotating hint replaces the native placeholder so it can cross-fade. */
.composer-field input::placeholder { color: transparent; }

.composer-hint {
  position: absolute;
  inset: 0;
  display: flex; align-items: center;
  /* 15px, not 14px: the overlay has to line up with the input's text origin,
     which sits one pixel in from its padding edge. Mirrors with the input. */
  padding-inline: 15px 6px;
  font-size: var(--text-body-lg); line-height: 1.5;
  color: var(--color-stone-gray);
  pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* Kept in step with FADE in hint-rotator.js — the text must swap while the
     overlay is fully transparent, never mid-fade. */
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.composer-hint.is-out { opacity: 0; transform: translateY(-6px); }

.add-btn {
  flex: none;
  width: 48px; height: 48px;
  border: none; border-radius: 50%;
  background: var(--color-coral-pop);
  color: var(--color-pure-white);
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--dur-fast), transform 0.1s;
}
.add-btn svg { width: 20px; height: 20px; }
.add-btn:hover:not(:disabled) { opacity: 0.88; }
.add-btn:active:not(:disabled) { transform: scale(0.95); }
.add-btn:disabled {
  background: var(--color-sandstone);
  color: var(--color-stone-gray);
  cursor: not-allowed;
}

.quality-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 0 4px;
  flex-wrap: wrap;
}
.quality-label { font-size: var(--text-body-sm); color: var(--color-stone-gray); }

.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--color-cream-paper);
  border-radius: var(--radius-full);
}
.seg button {
  padding: 7px 16px;
  border: none; border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-stone-gray);
  font-size: var(--text-body-sm); font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.seg button.is-active { background: var(--color-fresh-grass); color: var(--color-ink-black); }
.seg button:not(.is-active):hover { color: var(--color-ink-black); }

/* The rules of the house, stated once, in plain sight. */
.composer-terms {
  margin-top: 10px;
  padding: 0 8px;
  font-size: var(--text-body-sm); line-height: 1.5;
  color: var(--color-stone-gray);
}
.composer-terms b { font-weight: 500; color: var(--color-ink-black); }

/* Once the queue is in use the rules have been read — give the height back. */
body.is-compact .composer-terms { display: none; }

@media (max-width: 620px) {
  .composer { border-radius: 26px; }
  .composer-field input, .composer-hint { font-size: var(--text-body); }
  .quality-label { display: none; }
}

@media (max-height: 700px) {
  .composer-terms { display: none; }
}

/* css/components/queue.css */
/* The batch: header line, scroll area and the empty state. */

.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 8px;
}
.queue-count { font-size: var(--text-body-sm); color: var(--color-stone-gray); }

.queue { min-height: 0; }

.empty {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  text-align: center; padding: 16px;
}
.empty-title {
  font-size: var(--text-body-lg); font-weight: 500;
  color: var(--color-ink-black);
}
.empty p {
  font-size: var(--text-body-sm); line-height: 1.5;
  color: var(--color-stone-gray);
  max-width: 42ch;
}

/* css/components/card.css */
/* One queued link, in every state: parsing / ready / queued / downloading /
   done / error / playlist. */

.card {
  display: flex; gap: 14px;
  background: var(--color-pure-white);
  border-radius: var(--radius-card);
  padding: 12px;
  margin-bottom: 10px;
  animation: slideUp 0.35s var(--ease-out);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card.is-flash { animation: flash 0.9s ease; }
@keyframes flash {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--color-fresh-grass); }
  30% { box-shadow: inset 0 0 0 2.5px var(--color-fresh-grass); }
}

.card.is-bad { box-shadow: inset 0 0 0 1.5px var(--color-coral-pop); }

/* ---------- Thumbnail ---------- */

.card-thumb {
  width: 116px; min-width: 116px; height: 76px;
  border-radius: var(--radius-mid);
  overflow: hidden;
  background: var(--color-sandstone);
  flex-shrink: 0;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.no-thumb {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-stone-gray);
  background: var(--color-cream-paper);
}
.no-thumb svg { width: 24px; height: 24px; }
.no-thumb.is-bad { color: var(--color-coral-pop); }

.card-thumb.is-loading, .skeleton-line {
  background: var(--color-sandstone);
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton-line { height: 13px; border-radius: var(--radius-small); margin-bottom: 9px; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.short { width: 32%; height: 11px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- Body ---------- */

.card-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.card-title {
  font-size: var(--text-body); font-weight: 500;
  line-height: 1.25; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-meta, .card-url {
  margin-top: 3px;
  font-size: var(--text-body-sm); color: var(--color-stone-gray);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-err {
  margin-top: 3px;
  font-size: var(--text-body-sm); line-height: 1.4;
  color: var(--color-coral-pop);
}
.card-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.q-chip {
  padding: 6px 13px;
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-stone-gray);
  font-size: var(--text-micro);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.q-chip.is-active {
  border-color: var(--color-ink-black);
  background: var(--color-ink-black);
  color: var(--color-pure-white);
}
.q-chip:hover:not(.is-active) { border-color: var(--color-stone-gray); }

.card-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--text-body-sm); color: var(--color-stone-gray);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.prog {
  width: 100%; height: 6px;
  background: var(--color-sandstone);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}
.prog i {
  display: block; width: 38%; height: 100%;
  background: var(--color-fresh-grass);
  border-radius: var(--radius-full);
  animation: indet 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
/* translateX is physical, so the bar would crawl backwards in Arabic — the one
   piece of motion on the page that dir="rtl" cannot mirror on its own. */
@keyframes indet {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}
@keyframes indet-rtl {
  0% { transform: translateX(110%); }
  100% { transform: translateX(-300%); }
}
[dir="rtl"] .prog i { animation-name: indet-rtl; }

/* Determinate variant: a TikTok transload (services/transloads.py) reports a
   real 0–100, so the bar fills to an actual width instead of crawling. Width
   comes in as an inline style per update; this just turns off the crawl and
   gives the fill something to animate toward. */
.prog.is-determinate i {
  width: 0;
  animation: none;
  transition: width 300ms ease-out;
}
/* `width` always grows from the bar's start edge regardless of language
   direction, which reads backwards in Arabic — flipping the whole track
   (it holds nothing but the fill) fixes that without touching the JS. */
[dir="rtl"] .prog.is-determinate { transform: scaleX(-1); }

/* Sits under the buttons, so unlike .card-meta it has to wrap. */
.card-note {
  margin-top: 8px;
  font-size: var(--text-micro); line-height: 1.5;
  color: var(--color-stone-gray);
}

/* Also worn by <a> now that video downloads are plain links, hence the reset. */
.card-btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  padding: 8px 16px;
  border: none; border-radius: var(--radius-full);
  background: var(--color-ink-black);
  color: var(--color-pure-white);
  font-size: var(--text-body-sm); font-weight: 500;
  transition: opacity var(--dur-fast);
}
.card-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-fresh-grass); }
.card-btn:hover { opacity: 0.85; }
.card-btn.is-done { background: var(--color-fresh-grass); color: var(--color-ink-black); }
.card-btn.is-done .dot { background: var(--color-ink-black); }

/* ---------- Side ---------- */

.card-side { flex: none; display: flex; align-items: flex-start; }
.remove-btn {
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: var(--color-cream-paper);
  color: var(--color-stone-gray);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.remove-btn:hover { background: var(--color-coral-pop); color: var(--color-pure-white); }
.remove-btn svg { width: 14px; height: 14px; }

@media (max-width: 620px) {
  .card { border-radius: 26px; }
  .card-thumb { width: 92px; min-width: 92px; height: 62px; }
  .card-title { font-size: 16px; }
}

/* css/components/action-bar.css */
/* Single bottom action for the whole batch. */

.action-bar { display: flex; gap: 10px; }

.main-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 24px;
  border: none; border-radius: var(--radius-full);
  background: var(--color-ink-black);
  color: var(--color-pure-white);
  font-size: var(--text-body); font-weight: 500;
  transition: opacity var(--dur-fast);
}
.main-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-fresh-grass); }
.main-btn:hover:not(:disabled) { opacity: 0.85; }
.main-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.main-btn.is-secondary {
  background: var(--color-pure-white);
  color: var(--color-ink-black);
}
.main-btn.is-secondary .dot { background: var(--color-coral-pop); }

/* css/components/sheet.css */
/* Full catalogue of supported sites — the deep list behind the rail.
   Native <dialog>, so Esc and focus handling come for free. */

.sheet {
  width: min(600px, calc(100vw - 32px));
  max-height: min(80dvh, 720px);
  /* The global reset drops the UA's `margin: auto`, which is what centers a
     modal dialog in its top layer. */
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-card);
  background: var(--color-pure-white);
  color: var(--color-ink-black);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(44, 46, 42, 0.4); }

.sheet-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 22px 22px 14px;
}
.sheet-head h2 {
  font-size: var(--text-subheading); font-weight: 500;
  line-height: 1.25; letter-spacing: -0.01em;
}
.sheet-head p {
  margin-top: 4px;
  font-size: var(--text-body-sm); line-height: 1.45;
  color: var(--color-stone-gray);
}
.sheet-close {
  flex: none;
  width: 34px; height: 34px;
  margin-inline-start: auto;
  border: none; border-radius: 50%;
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast);
}
.sheet-close:hover { background: var(--color-sandstone); }
.sheet-close svg { width: 14px; height: 14px; }

.sheet-search { padding: 0 22px 14px; }
.sheet-search input {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-full);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm);
  outline: none;
}
.sheet-search input:focus { border-color: var(--color-ink-black); }
.sheet-search input::placeholder { color: var(--color-stone-gray); }

.sheet-body { padding: 0 22px 22px; }

.sheet-group { margin-bottom: 18px; }
.sheet-group[hidden] + .sheet-group { margin-top: 0; }
.sheet-group h3 {
  margin-bottom: 10px;
  font-size: var(--text-body-sm); font-weight: 400;
  color: var(--color-stone-gray);
}
.sheet-sites { display: flex; flex-wrap: wrap; gap: 6px; }
/* Each site links to its own homepage (components/sheet.js) — reset the <a>
   defaults so it still reads as a plain pill, not a link: no underline, no
   browser link color. Hover carries the affordance as a color shift instead. */
.sheet-sites a {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-hairline-mist);
  color: inherit;
  text-decoration: none;
  font-size: var(--text-body-sm);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.sheet-sites a:hover { color: var(--color-fresh-grass); border-color: var(--color-fresh-grass); }

.sheet-empty {
  padding: 6px 0 14px;
  font-size: var(--text-body-sm); line-height: 1.5;
  color: var(--color-stone-gray);
}

.sheet-band {
  background: var(--color-sunshine-pop);
  border-radius: var(--radius-mid);
  padding: 14px 18px;
  font-size: var(--text-body); line-height: 1.35; letter-spacing: -0.01em;
}

.sheet-rules { margin-top: 16px; }
.sheet-rules h3 {
  margin-bottom: 8px;
  font-size: var(--text-body-sm); color: var(--color-stone-gray);
}
.sheet-rules li {
  list-style: none;
  display: flex; gap: 10px;
  padding: 5px 0;
  font-size: var(--text-body-sm); line-height: 1.45;
}
.sheet-rules li::before {
  content: "";
  flex: none;
  width: 7px; height: 7px; margin-top: 7px;
  border-radius: 50%;
  background: var(--color-fresh-grass);
}
.sheet-rules li.is-no::before { background: var(--color-coral-pop); }

@media (max-width: 620px) {
  .sheet { border-radius: 26px; max-height: 86dvh; }
  .sheet-head { padding: 18px 18px 12px; }
  .sheet-search { padding: 0 18px 12px; }
  .sheet-body { padding: 0 18px 18px; }
}

/* css/components/toast.css */
/* Transient message, one at a time. */

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: var(--z-toast);
  max-width: calc(100vw - 40px);
  padding: 14px 22px;
  border-radius: var(--radius-full);
  background: var(--color-ink-black);
  color: var(--color-pure-white);
  font-size: var(--text-body-sm); line-height: 1.4;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Clear the batch action bar, which only exists once cards are queued. */
body.is-compact .toast { bottom: 92px; }

/* css/components/seo.css */
/* Below-the-fold content. Present for readers and crawlers when the queue is
   idle; gone the moment the page becomes a working tool. */

.seo {
  border-top: 1px solid var(--color-hairline-mist);
  padding: 56px 20px 40px;
}

.seo-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

/* /privacy /terms /about use a real <h1> for their page title (accessibility/
   SEO heading order) — same visual treatment as the .seo-block <h2>s used
   everywhere else, this is the only place an <h1> lives inside .seo-block. */
.seo-block h1,
.seo-block h2 {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 500; line-height: 1.2; letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.seo-block h3 {
  margin-top: 22px;
  font-size: var(--text-body); font-weight: 500;
  line-height: 1.35; letter-spacing: -0.01em;
}
.seo-block p {
  margin-top: 6px;
  font-size: var(--text-body); line-height: 1.6;
  color: var(--color-stone-gray);
}
.seo-block b { color: var(--color-ink-black); font-weight: 500; }
.seo-block a {
  color: var(--color-ink-black);
  text-decoration: none;
  border-bottom: 1px solid var(--color-stone-gray);
}
.seo-block a:hover { border-bottom-color: var(--color-ink-black); }
/* /privacy /terms /about 这类纯文字页用得到普通列表——.steps 那套编号圆章
   是给"如何使用"三步走用的，语义上不该套在政策条款的列举上。 */
.seo-block ul, .seo-block ol {
  margin-top: 6px;
  padding-inline-start: 22px;
  font-size: var(--text-body); line-height: 1.6;
  color: var(--color-stone-gray);
}
.seo-block li + li { margin-top: 4px; }

.steps {
  counter-reset: step;
  display: flex; flex-direction: column; gap: 14px;
  list-style: none;
}
.steps li {
  position: relative;
  padding-block: 18px;
  padding-inline: 62px 22px;    /* the wide side holds the number badge */
  background: var(--color-pure-white);
  border-radius: var(--radius-mid);
  font-size: var(--text-body); line-height: 1.55;
  color: var(--color-stone-gray);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 18px; top: 17px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-fresh-grass);
  color: var(--color-ink-black);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-body-sm); font-weight: 500;
}
.steps b { display: block; color: var(--color-ink-black); }

.seo-sites { line-height: 1.7 !important; }

.seo-foot {
  border-top: 1px solid var(--color-hairline-mist);
  padding-top: 26px;
}
.seo-foot p {
  font-size: var(--text-body-sm); line-height: 1.6;
  color: var(--color-stone-gray);
}
.seo-foot-brand {
  font-size: var(--text-subheading) !important;
  font-weight: 500;
  color: var(--color-ink-black) !important;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.seo-foot-note { margin-top: 12px; font-size: var(--text-micro) !important; }
.seo-foot a { color: var(--color-ink-black); text-decoration: underline; }

/* Anchor for the "how it works" cue in the empty state. Filled with the brand
   accent so it reads as a real affordance, not another muted caption. */
.scroll-cue {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--color-fresh-grass);
  border-radius: var(--radius-full);
  background: var(--color-fresh-grass);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm); font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.scroll-cue:hover { background: var(--color-ink-black); border-color: var(--color-ink-black); color: var(--color-pure-white); }

/* Using the tool beats reading about it: once cards exist the page is an app
   again, one viewport tall with no stray scroll. */
body.is-compact .seo { display: none; }

@media (max-width: 620px) {
  .seo { padding: 40px 16px 32px; }
  .seo-inner { gap: 36px; }
  .steps li { padding-block: 16px; padding-inline: 56px 18px; }
}
