/* Reel review page: phone-first cards with two thumb-sized decision buttons, light and dark. */
:root {
  --bg: #f4f3f0;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --text: #17171a;
  --muted: #6b6a70;
  --line: #e2e0da;
  --accent: #5b4bff;
  --yes: #13804b;
  --yes-soft: #e3f4ea;
  --no: #b3261e;
  --no-soft: #fbe9e7;
  --radius: 20px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 6%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e11;
    --surface: #18181c;
    --surface-2: #222228;
    --text: #f1f0f4;
    --muted: #9a99a3;
    --line: #2c2c33;
    --accent: #8f84ff;
    --yes: #3ccf86;
    --yes-soft: #12301f;
    --no: #ff7a6e;
    --no-soft: #3a1714;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- top bar ---------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  padding: calc(env(safe-area-inset-top) + 12px) var(--gutter) 12px;
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 640px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #ff6fb5); }
.status {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yes); box-shadow: 0 0 0 3px var(--yes-soft); }
.status.is-bad .status-dot { background: var(--no); box-shadow: 0 0 0 3px var(--no-soft); }
.filters {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin: 12px auto 0; max-width: 640px;
  background: var(--surface-2); border-radius: 14px;
}
.filter {
  height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.filter[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.filter .count { font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.7; }

/* --- list and cards --------------------------------------------------- */
main { max-width: 640px; margin: 0 auto; padding: var(--gutter) var(--gutter) calc(env(safe-area-inset-bottom) + 110px); display: grid; gap: var(--gutter); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--gutter); display: grid; gap: 14px; transition: opacity .25s, transform .25s;
}
.card.is-leaving { opacity: 0; transform: translateX(var(--leave, 0)) scale(.98); }
.card-head { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: stretch; }
.thumb {
  width: 96px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--surface-2); position: relative; display: block;
}
.thumb { color: var(--muted); }
.thumb-icon { position: absolute; inset: 0; margin: auto; width: 32px; height: 32px; opacity: 0.5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .length {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgb(0 0 0 / 65%); color: #fff; font-variant-numeric: tabular-nums;
}
.head-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; min-width: 0; white-space: nowrap; }
.meta b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.meta span { flex: none; }
.title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.score { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.score-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.score-num { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.block { display: grid; gap: 6px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.block p { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.clamp.is-open { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.head-text .chips { gap: 4px; }
.head-text .chip { font-size: 12px; padding: 3px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; }
.suggestion { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 15px; }
.suggestion b { color: var(--accent); }
details { border-top: 1px solid var(--line); padding-top: 6px; }
.more:empty { display: none; }
.more { margin-top: -4px; }
details + details { border-top: 0; padding-top: 0; }
summary { font-size: 14px; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 18px; font-weight: 400; }
details[open] summary::after { content: "–"; }
.flow, .transcript { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.flow { padding-left: 18px; }
.transcript { white-space: pre-wrap; font: 13px/1.5 ui-monospace, "Cascadia Code", Menlo, monospace; max-height: 260px; overflow: auto; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; }
.source { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  height: 60px; border-radius: 16px; border: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; }
.btn-no { background: var(--no-soft); color: var(--no); }
.btn-yes { background: var(--yes); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-yes { color: #07210f; } }
.decided { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 14px; border-radius: 14px; font-weight: 600; }
.decided.is-yes { background: var(--yes-soft); color: var(--yes); }
.decided.is-no { background: var(--no-soft); color: var(--no); }
.decided small { display: block; font-size: 13px; font-weight: 500; opacity: 0.85; }
.decided { min-height: 56px; padding-block: 8px; }
.decided button { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text); }

/* --- toast ------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); transform: translate(-50%, calc(100% + 48px)); visibility: hidden;
  width: min(608px, calc(100% - 2 * var(--gutter))); background: var(--text); color: var(--bg); border-radius: 18px; padding: 12px;
  display: grid; gap: 10px; transition: transform .25s, visibility .25s; z-index: 10; box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
}
.toast.is-open { transform: translate(-50%, 0); visibility: visible; }
.toast-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding-left: 6px; font-weight: 600; }
.toast-row button { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-weight: 700; }
.reasons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.reasons button { height: 40px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); font-size: 14px; font-weight: 600; }
.reasons button[aria-pressed="true"] { background: var(--bg); color: var(--text); }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty b { color: var(--text); font-size: 18px; }

/* --- add link ---------------------------------------------------------- */
.add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.add input { height: 48px; min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface); color: var(--text); font: inherit; }
.add button { height: 48px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; }

/* --- login ------------------------------------------------------------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); }
.login form { width: min(360px, 100%); display: grid; gap: 12px; text-align: center; }
.login input { height: 52px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface); color: var(--text); font: inherit; }
.login button { height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; }
.login .error { color: var(--no); min-height: 1.4em; font-size: 14px; }
.login .brand { justify-content: center; font-size: 24px; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.list { display: grid; gap: var(--gutter); }
