/* SpoilerFeed — matches the feed-prototype design language */
:root {
  --bg: #0f0f0f;
  --surface: #1c1c1c;
  --surface-2: #242424;
  --border: #383838;
  --text: #f1f1f1;
  --text-2: #b9b9b9;
  --text-3: #8a8a8a;
  --accent: #ff4e45;
  --accent-soft: rgba(255, 78, 69, 0.12);
  --amber: #f5b544;
  --pill-bg: rgba(20, 8, 32, 0.92);
  --pill-border: #6d28d9;
  --pill-fg: #e9d5ff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner, #topbar {
  /* keep #topbar as the bar; inner layout via flex */
}
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 10px 20px;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.status { font-size: 12px; color: var(--text-3); }
.ghost-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.ghost-btn:hover { background: var(--surface-2); }

/* ---------- tabs (Feed / Watch Later) ---------- */
.tabs {
  display: flex; gap: 8px; padding: 10px 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 60;
}
.tab {
  background: transparent; border: none; color: var(--text-2);
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 4px; margin-right: 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- centered views (login / setup) ---------- */
.center-view {
  max-width: 560px; margin: 0 auto; padding: 72px 24px; text-align: center;
}
.center-view h1 { font-size: 36px; letter-spacing: -0.01em; margin: 0 0 12px; }
.lede { color: var(--text-2); font-size: 16px; line-height: 1.5; }
.fineprint { color: var(--text-3); font-size: 12px; margin-top: 18px; }
.primary-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 24px;
  padding: 13px 30px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 10px;
  font-family: inherit;
}
.primary-btn:hover { filter: brightness(1.1); }
.spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 4px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.google-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
  border-radius: 24px; padding: 12px 28px;
  font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 14px;
  font-family: inherit;
}
.google-btn:hover { background: #f6fafe; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.auth-error { color: #ff7b72; font-size: 14px; margin-top: 16px; }

/* ---------- demo mode (no-signup takeaways) ---------- */
.demo-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 28px auto 0; max-width: 480px;
  color: var(--text-3); font-size: 13px;
}
.demo-divider::before, .demo-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.demo-box { display: flex; gap: 8px; max-width: 480px; margin: 14px auto 0; }
.demo-box input {
  flex: 1; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit; min-width: 0;
}
.demo-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.demo-btn {
  padding: 12px 18px; border-radius: 12px; border: none;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.demo-btn:disabled { opacity: 0.6; cursor: wait; }
.demo-card {
  max-width: 560px; margin: 20px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; overflow: hidden;
}
.demo-card img { width: 100%; border-radius: 8px; margin-bottom: 12px; }
.demo-card h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.35; }
.demo-channel { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.demo-takeaways { margin: 0; padding-left: 20px; }
.demo-takeaways li { margin-bottom: 10px; font-size: 14px; line-height: 1.5; color: var(--text); }
.demo-verdict {
  margin: 14px 0 0; padding: 12px; border-radius: 8px;
  background: var(--surface-2); font-size: 14px; line-height: 1.5;
}
.demo-spoiler {
  margin: 14px 0 0; padding: 12px; border-radius: 8px;
  background: var(--surface-2); font-size: 15px; line-height: 1.5;
  border-left: 3px solid var(--accent);
}
.demo-spoiler strong {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent); margin-bottom: 4px;
}
/* Right-hand action sidebar next to the takeaways */
.summary-grid { display: flex; gap: 16px; align-items: flex-start; }
.summary-main { flex: 1; min-width: 0; }
.summary-side {
  flex: 0 0 148px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 8px;
}
.side-btn {
  padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; cursor: pointer;
  font-family: inherit; text-align: center; line-height: 1.3;
}
.side-btn:hover { border-color: var(--accent); color: var(--accent); }
.side-btn.accent {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.side-btn.accent:hover { filter: brightness(1.1); color: #fff; }
.ask-box { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ask-box input {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 16px; font-family: inherit; /* 16px stops iOS auto-zoom */
}
.ask-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ask-answer {
  font-size: 13px; line-height: 1.55; color: var(--text);
  background: var(--accent-soft); border-radius: 8px; padding: 10px 12px;
}
.ask-answer.hidden { display: none; }
.ask-thinking { color: var(--text-2); }
.ask-error { color: #ff8a80; }
/* ---------- channel search ---------- */
.search-wrap { position: relative; padding: 10px 16px 0; max-width: 720px; margin: 0 auto; }
.search-wrap.hidden { display: none; }
#channel-search {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 10px 16px; font-size: 16px; font-family: inherit; /* 16px stops iOS auto-zoom */
}
#channel-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.search-results {
  position: absolute; top: calc(100% - 2px); left: 16px; right: 16px; z-index: 70;
  background: rgba(28, 28, 28, 0.98); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.search-results.hidden { display: none; }
.search-result {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text); padding: 12px 16px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(255, 255, 255, 0.06); }
.search-no-result { padding: 12px 16px; color: var(--text-2); font-size: 13px; }
.channel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 4px; max-width: 1200px; margin: 0 auto; }
#channel-name { font-size: 18px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- subscriptions tab ---------- */
#subs-view { max-width: 720px; margin: 0 auto; padding: 14px 16px 40px; }
.sub-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 14px; text-align: left;
}
.sub-row:hover { border-color: var(--accent); }
.sub-rank { color: var(--text-3); font-size: 12px; width: 28px; flex: none; text-align: right; }
.sub-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-usage { color: var(--text-2); font-size: 12px; flex: none; }
.ai-links { display: flex; flex-direction: column; gap: 8px; }
.ai-links-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-2); text-align: center; margin-top: 4px;
}
@media (max-width: 600px) {
  .summary-grid { flex-direction: column; }
  .summary-side { flex: none; width: 100%; position: static; }
  .ai-links { flex-direction: row; flex-wrap: wrap; }
  .ai-links .side-btn { flex: 1 1 30%; }
  .ai-links-label { width: 100%; }
}
.demo-cta {
  display: inline-block; margin-top: 16px; color: var(--accent);
  font-weight: 700; font-size: 14px; text-decoration: none;
}
.demo-cta:hover { text-decoration: underline; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px 4px 4px;
}
.user-chip img { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }

/* ---------- setup card ---------- */
.setup-card {
  max-width: 560px; margin: 24px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.setup-card label { display: block; margin: 18px 0 6px; font-weight: 700; font-size: 14px; }
.setup-card label:first-child { margin-top: 0; }
.setup-card input {
  width: 100%; padding: 11px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-family: inherit;
}
.setup-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.setup-card .hint { font-size: 13px; color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.setup-card .hint code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--text); word-break: break-all;
}
.setup-card .google-btn { margin-top: 22px; width: 100%; justify-content: center; }

/* ---------- feed grid: borderless YouTube-style cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px 16px;
  padding: 24px 20px;
  max-width: 1440px;
  margin: 0 auto;
}
.card { min-width: 0; cursor: pointer; animation: rise 0.4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.thumb-wrap {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover .thumb-wrap { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); }
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover .thumb-wrap img { transform: scale(1.03); }
}
.thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), #141414);
  color: var(--text-3); font-size: 13px; text-align: center; padding: 12px;
}
.secrets-pill {
  position: absolute; left: 10px; bottom: 10px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-fg); font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.dur-badge {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.82); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  pointer-events: none; letter-spacing: 0.02em;
}
.pop-badge {
  position: absolute; left: 10px; top: 10px;
  background: rgba(20, 10, 0, 0.85); color: #ffb347;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
  pointer-events: none; letter-spacing: 0.02em;
  border: 1px solid rgba(255, 179, 71, 0.4);
}
.save-btn {
  position: absolute; right: 8px; top: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.65); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0 2px;
}
.save-btn:hover { background: rgba(0, 0, 0, 0.85); }
.save-btn.saved { color: #ffd166; border-color: rgba(255, 209, 102, 0.6); }
.disc-badge {
  position: absolute; left: 10px; top: 10px;
  background: rgba(10, 20, 40, 0.85); color: #7cc4ff;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
  pointer-events: none; letter-spacing: 0.02em;
  border: 1px solid rgba(124, 196, 255, 0.4);
}
.deep-badge {
  position: absolute; left: 10px; top: 10px;
  background: rgba(30, 10, 40, 0.85); color: #d0a2ff;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
  pointer-events: none; letter-spacing: 0.02em;
  border: 1px solid rgba(208, 162, 255, 0.4);
}
.more-btn {
  display: block; margin: 14px auto 4px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 9px 22px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.more-btn:hover:not(:disabled) { border-color: var(--text-3); background: var(--surface); }
.more-btn:disabled { opacity: 0.7; cursor: default; }
.more-note { text-align: center; color: var(--text-3); font-size: 13px; margin: 14px 0 4px; }
.card-meta { padding: 10px 2px 0; }
.card-title {
  margin: 0 0 5px; font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .card-title { color: var(--accent); }
.card-sub { font-size: 13px; color: var(--text-2); }
.card-sub .dot { margin: 0 6px; color: var(--text-3); }

/* ---------- floating 60% summary box ---------- */
#scrim {
  position: fixed; inset: 0; z-index: 90;
  background: transparent; /* click-away layer, no dimming */
}
#preview-box {
  position: fixed; z-index: 100;
  width: min(60vw, 760px);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: pop 0.18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
.close-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: 1px solid #444;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.close-btn:hover { background: #333; }
#preview-body { overflow-y: auto; padding: 0 0 8px; }
.preview-head { display: flex; gap: 12px; align-items: center; padding: 16px 48px 0 18px; }
.preview-thumb-wrap { width: 112px; flex: none; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.preview-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb-wrap .thumb-fallback { font-size: 11px; }
.preview-head-text { min-width: 0; }
.preview-head-text h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-head .preview-channel { color: var(--text-2); font-size: 12px; }
.preview-content { padding: 14px 22px 6px; }
.sum-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sum-tab {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 600;
  border-radius: 16px; padding: 7px 14px; cursor: pointer;
}
.sum-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.takeaways { list-style: none; margin: 0 0 14px; padding: 0; counter-reset: tk; }
.takeaways li {
  counter-increment: tk;
  position: relative;
  padding: 10px 12px 10px 44px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px; line-height: 1.5;
}
.takeaways li::before {
  content: counter(tk);
  position: absolute; left: 12px; top: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.verdict {
  margin: 4px 0 10px; padding: 10px 14px;
  font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  border-left: 3px solid var(--amber);
}
.verdict strong {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--amber); margin-bottom: 4px;
}
.spoiler {
  margin: 12px 0 4px; padding: 12px 14px;
  font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.spoiler strong {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent); margin-bottom: 4px;
}
.preview-loading, .preview-error { padding: 40px 24px; text-align: center; color: var(--text-2); }
.retry-btn {
  margin-top: 12px; background: var(--accent); color: #fff; border: none;
  border-radius: 20px; padding: 9px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.preview-footer {
  border-top: 1px solid var(--border);
  padding: 0;
  display: flex; justify-content: stretch;
}
.yt-badge {
  flex: 1; display: block; text-align: center; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--accent);
  padding: 12px; background: rgba(255, 78, 69, 0.06);
}
.yt-badge:hover { background: rgba(255, 78, 69, 0.14); }

.empty-state { text-align: center; padding: 80px 24px; color: var(--text-2); }
.empty-state h2 { color: var(--text); }

/* ---------- bottom loading indicator (progressive feed) ---------- */
.bottom-loader {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: rgba(28, 28, 28, 0.95); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
/* generic progress bar (video preview loading) */
.progress-track {
  height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.progress-track > div {
  height: 100%; width: 0%;
  background: var(--accent); border-radius: 3px;
  transition: width 0.4s ease;
}
.preview-progress-track { max-width: 320px; margin: 0 auto 14px; }
.preview-loading-msg { font-size: 13px; }
.spinner-small { width: 18px; height: 18px; border-width: 3px; margin: 0; flex: none; }

@media (max-width: 700px) {
  #preview-box { width: calc(100vw - 24px); }
  .grid { grid-template-columns: 1fr; padding: 16px; }
  .center-view h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, #preview-box { animation: none; }
  .card:hover .thumb-wrap { transform: none; box-shadow: none; }
}

/* ---------- Background-summary pending state ---------- */
.preview-pending { text-align: center; padding: 30px 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.preview-pending p { margin: 10px 0; }
.preview-pending strong { color: var(--text); font-size: 15px; }
.pp-spinner { width: 26px; height: 26px; margin: 0 auto 6px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: ppSpin 0.9s linear infinite; }
@keyframes ppSpin { to { transform: rotate(360deg); } }

/* ---------- Bottom toast notifications ---------- */
#toast-wrap { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 430px); pointer-events: none; }
.toast { pointer-events: auto; background: #262626; border: 1px solid var(--border); border-radius: 14px; padding: 12px 10px 12px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.55); font-size: 13px; line-height: 1.4; color: var(--text); animation: toastIn .28s cubic-bezier(.2,.9,.3,1.15); }
.toast-out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.toast-msg { flex: 1; }
.toast-x { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Topic filter chips (feed) ---------- */
#topic-chips, #format-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#topic-chips::-webkit-scrollbar, #format-chips::-webkit-scrollbar { display: none; }
#format-chips { padding-top: 2px; }
.topic-chip { flex-shrink: 0; background: #1e1e1e; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.topic-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
/* ---------- Feed mode chips (ranking recipe switcher) ---------- */
#mode-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#mode-chips::-webkit-scrollbar { display: none; }
.mode-chip { flex-shrink: 0; background: #26221f; border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mode-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- YouTube search ---------- */
.search-yt-row { border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; }

/* ---------- site footer ---------- */
#site-footer { text-align: center; padding: 28px 16px 40px; font-size: 13px; color: var(--muted); }
#site-footer a { color: var(--muted); text-decoration: none; margin: 0 4px; }
#site-footer a:hover { color: var(--accent); }

/* ---------- landing visibility for crawlers/no-JS (OAuth brand check) ---------- */
html.authed #login-view { display: none; }
html.authed #loading-view { display: block !important; }
.how-it-works { text-align: left; max-width: 420px; margin: 22px auto 26px; display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.how-it-works strong { color: var(--accent); }
.beta-note { color: var(--text-3); font-size: 12px; margin: 10px auto 0; max-width: 420px; line-height: 1.5; }

/* ---------- ready summaries: badge + persistent banner ---------- */
.ready-badge { background: var(--accent); color: #fff; border: none; border-radius: 16px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ready-banner { position: relative; background: var(--card); border: 1px solid var(--accent); border-radius: 14px; padding: 12px 40px 12px 14px; margin: 0 0 12px; }
.ready-banner-head { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.ready-banner-x { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 8px; }
.ready-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 14px; padding: 8px 4px; cursor: pointer; border-top: 1px solid var(--border); }
.ready-play { color: var(--accent); font-size: 12px; }
.ready-more { font-size: 12px; color: var(--muted); padding: 6px 4px 0; }

/* ---------- bookmarklet import ---------- */
.import-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 0 auto; max-width: 460px; text-align: left; }
.import-steps { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text); }
.import-steps li { margin-bottom: 2px; }
.bookmarklet-link { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 8px; text-decoration: none; cursor: grab; white-space: nowrap; }
.import-code-row { display: flex; gap: 8px; }
.import-code-row input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 16px; padding: 10px 12px; text-transform: uppercase; letter-spacing: 2px; text-align: center; font-family: monospace; }

/* ---------- screenshot import ---------- */
.import-hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.shot-btn { display: inline-block; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.import-status { font-size: 13px; color: var(--muted); margin: 8px 0 0; min-height: 18px; }
.import-status.import-ok { color: #4ade80; }
.import-status.import-err { color: #f87171; }

/* ---------- save-for-later in preview loading state ---------- */
.save-later-btn { display: inline-block; margin-top: 14px; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 20px; padding: 8px 18px; font-size: 14px; cursor: pointer; }
.save-later-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.save-later-btn:disabled { opacity: 0.6; cursor: default; }
.preview-loading-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.preview-loading-btns .save-later-btn { margin-top: 14px; }

/* ---------- minimized summary bar (top dock) ---------- */
.sum-dock {
  position: fixed; top: 0; left: 0; right: 0; z-index: 95;
  display: flex; gap: 8px; padding: 6px 10px; overflow-x: auto;
  background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.sum-dock::-webkit-scrollbar { display: none; }
body.dock-on { padding-top: 45px; }
body.dock-on #topbar, body.dock-on .tabs { top: 45px; }
.dock-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  max-width: 82vw; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer;
}
.dock-chip.failed { cursor: default; border-color: var(--accent); background: var(--accent-soft); }
.dock-chip.ready { border-color: #2f9e44; background: rgba(47, 158, 68, 0.16); }
.dock-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32vw; }
.dock-state { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.dock-chip.ready .dock-state { color: #69db7c; }
.dock-spin {
  width: 14px; height: 14px; flex: 0 0 auto;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
.dock-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.dock-btn:hover { border-color: var(--accent); }
.dock-x { background: none; border: none; color: var(--text-3); font-size: 14px; cursor: pointer; padding: 2px 4px; }

/* ---------- minimize CTA + dock prominence ---------- */
.minimize-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 22px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-top: 14px;
  box-shadow: 0 2px 12px rgba(255, 78, 69, 0.4);
  animation: min-glow 2s ease-in-out infinite;
}
@keyframes min-glow {
  0%, 100% { box-shadow: 0 2px 12px rgba(255, 78, 69, 0.4); }
  50% { box-shadow: 0 2px 20px rgba(255, 78, 69, 0.75); }
}
.preview-min-hint { font-size: 13px; color: var(--text-2); margin: 12px auto 0; max-width: 330px; }
body.dock-on { padding-top: 50px; }
body.dock-on #topbar, body.dock-on .tabs { top: 50px; }
.dock-chip.loading {
  border-color: var(--accent); background: var(--accent-soft);
  padding: 8px 14px; font-size: 14px;
  animation: dock-pulse 1.6s ease-in-out infinite;
}
@keyframes dock-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 78, 69, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 78, 69, 0.28); }
}
.dock-chip.pending { padding: 8px 14px; font-size: 14px; }
.dock-chip.failed { padding: 8px 14px; font-size: 14px; }
.dock-chip.ready {
  background: #2f9e44; border-color: #2f9e44; color: #fff; font-weight: 700;
  padding: 8px 14px; font-size: 14px;
  box-shadow: 0 0 16px rgba(47, 158, 68, 0.6);
}
.dock-chip.ready .dock-state { color: #e2f7e7; }
.dock-chip.ready .dock-x { color: #e2f7e7; }
.dock-chip.ready.just-ready { animation: dock-pop 0.45s ease-in-out 3; }
@keyframes dock-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ---------- not-interested dismiss button on cards ---------- */
.hide-btn {
  position: absolute; right: 50px; top: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.65); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.hide-btn:hover { background: rgba(0, 0, 0, 0.85); }

/* ---------- summary footer actions: save / email ---------- */
.sum-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.sum-action-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 20px; padding: 8px 18px; font-size: 14px; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.3; }
.sum-action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- shared summary landing (/?s=<id>) ---------- */
.shared-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.shared-brand { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.shared-brand span { color: var(--accent); }
.shared-thumb { width: 100%; border-radius: var(--radius); display: block; }
.shared-title { font-size: 22px; line-height: 1.3; margin: 14px 0 4px; }
.shared-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin: 20px 0 8px; }
.shared-note { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.shared-wall { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 20px 16px; text-align: center; margin-top: 18px; }
.shared-signin { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- feed log page ---------- */
.log-wrap { max-width: 820px; margin: 0 auto; padding: 20px 16px 60px; }
.log-h { margin: 0 0 4px; }
.log-sub { color: var(--text-2); font-size: 13px; margin: 0 0 12px; }
.log-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.log-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; background: var(--surface-2); }
.log-main { flex: 1; min-width: 0; }
.log-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.log-meta { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.log-count { font-size: 20px; font-weight: 700; flex: none; }
.log-status { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; min-width: 92px; text-align: right; flex: none; }

/* ---------- first-load progress bar (below the topics) ---------- */
.load-progress { margin: 14px 0 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.lp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
#lp-eta { color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.lp-track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
#lp-fill { height: 100%; width: 0%; border-radius: 6px; background: var(--amber); transition: width .25s ease; }
/* ---------- log page: topic groups + clickable rows ---------- */
.log-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 18px 0 2px; }
.log-row { cursor: pointer; }
.log-row:hover { background: var(--surface); }

/* ---------- boot progress panel (loading view) ---------- */
#bp-fill { height: 100%; width: 0%; border-radius: 6px; background: var(--amber); transition: width .25s ease; }
#bp-eta { color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.boot-panel { width: min(520px, 92vw); text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 20px; }
.boot-title { margin: 0 0 14px; font-size: 19px; }
.bp-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.bp-steps { list-style: none; margin: 16px 0 0; padding: 0; }
.bp-steps li { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; font-size: 14px; color: var(--text-2); }
.bp-steps li .bp-ic { width: 14px; text-align: center; flex: none; }
.bp-steps li.active { color: var(--text); font-weight: 600; }
.bp-steps li.done { color: var(--text); }
.bp-steps li.done .bp-ic { color: #2db58a; font-weight: 700; }

/* ---------- feed modes: criteria line + per-mode card pills ---------- */
.mode-desc { margin: 8px 2px 0; font-size: 13px; color: var(--text-2); }
.mode-badge-row { margin-top: 6px; }
.mode-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2.5px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.mb-top { color: #e8b93c; } .mb-popular { color: #ff7a45; } .mb-sleepers { color: #8ea2ff; }
.mb-micro { color: #3fce97; } .mb-fresh { color: #38c6d9; } .mb-recent { color: #6cb2f5; }
.mb-shuffle { color: #c792ea; } .mb-mix { color: #ff8a75; }

/* ---------- Your themes row (rotating niche filters) ---------- */
#theme-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; align-items: center; }
#theme-chips::-webkit-scrollbar { display: none; }
.theme-row-label { flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.theme-chip { border-style: dashed; }

/* language picker (i18n) */
.lang-picker { max-width: 132px; font-size: 13px; cursor: pointer; text-overflow: ellipsis; }

/* Latest Summaries horizontal strip (signed-out homepage) */
.offer-bar { margin: -52px 0 10px; text-align: center; font-size: 14px; font-weight: 600; padding: 9px 12px; border-radius: 10px; background: rgba(29, 158, 117, .13); border: 1px solid rgba(29, 158, 117, .38); }
.offer-link { color: #1d9e75; font-weight: 600; margin-left: 8px; }
.latest-wrap { text-align: left; width: 100vw; max-width: none; position: relative; left: 50%; transform: translateX(-50%); margin: 0 0 8px; }
#login-view { overflow-x: clip; }
.latest-head { padding: 0 20px; }
.latest-head h2 { font-size: 20px; margin: 0 0 10px; }
.latest-strip { overflow: hidden; padding: 2px 0 10px; }
.latest-track { display: flex; width: max-content; will-change: transform; }
.latest-set { display: flex; gap: 12px; padding-right: 12px; }
@keyframes latestScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.latest-strip { touch-action: pan-y; cursor: grab; }
.latest-strip:active { cursor: grabbing; }
.latest-card img { -webkit-user-drag: none; user-select: none; }
.latest-card { flex: 0 0 232px; text-decoration: none; color: inherit; background: #161616; border: 1px solid #333; border-radius: 12px; overflow: hidden; }
.latest-card img { display: block; width: 232px; height: 130px; object-fit: cover; background: #0f0f0f; }
.latest-card .lc-body { padding: 8px 10px 10px; }
.latest-card .lc-title { font-size: 14px; font-weight: 600; line-height: 1.35; min-height: 57px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest-card .lc-chan { font-size: 12px; color: #999; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Latest Summaries: pause + in-page summary popup */

.latest-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 300; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: 36px 14px; }
.latest-modal { position: relative; background: #131313; border: 1px solid #333; border-radius: 16px; max-width: 580px; width: 100%; padding: 22px; text-align: left; }
.latest-modal-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #333; background: rgba(20,20,20,.88); color: #eee; font-size: 15px; cursor: pointer; z-index: 2; }
