/* Neutrals from animations.dev's light theme (its warm gray scale, read from the site's CSS), on
   shadcn's token structure (ui.shadcn.com/docs/theming). The tones are Notion's text colors with
   their soft backgrounds. */
:root {
  --bg: #fdfdfc;      /* gray-100: the page */
  --panel: #f9f9f8;   /* gray-200: panels */
  --card: #ffffff;    /* cards and popovers */
  --panel-2: #f1f0ef; /* gray-300: chips, like their "Get" button */
  --panel-3: #e9e9e7; /* gray-400 */
  --border: #e9e9e7;  /* gray-400: hairlines */
  --ring: #cfceca;    /* gray-700 */
  --text: #21201c;    /* gray-1200 */
  --muted: #63635e;   /* secondary text: their gray-1000 is too light for body text (3.8:1) */
  --faint: #82827c;   /* gray-1000: metadata */
  --true: #448361;
  --true-bg: #edf3ec;
  --false: #d44c47;
  --false-bg: #fdebec;
  --misleading: #d9730d;
  --misleading-bg: #fbecdd;
  --unverifiable: #d9730d;
  --unverifiable-bg: #fbecdd;
  --contested: #337ea9;
  --contested-bg: #e7f3f8;
  --value: #9065b0;
  --value-bg: #f4f0f7;
  /* Stances use hues the verdicts don't, so a disagreeing take never reads as a red "false". */
  --radius: 14px;
  --shadow-sm: 0 2px 2px #0000000a;
  --shadow: 0 0 0 1px #00000014, 0 1px 1px #00000005, 0 4px 8px -4px #0000000a, 0 16px 24px -8px #0000000f;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif; /* everything, the wordmark included */
  --brand: var(--font);
  /* Motion: short, a strong ease-out, transform and opacity only, exits faster than entrances. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* or `display: flex` on a class would override it */
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  display: flex;
  flex-direction: column; /* header, then main takes the rest */
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
.primary, .secondary, .icon-btn, .actions button, .pushback-form button, .toast .row button, .source-chip {
  transition: transform 120ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out), filter .2s;
}
.primary:active, .secondary:active, .icon-btn:active, .actions button:active,
.pushback-form button:active, .toast .row button:active, .source-chip:active { transform: scale(.97); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 22px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
h1 { font: 700 19px/1.15 var(--brand); text-transform: uppercase; letter-spacing: -.005em; margin: 0; }
.controls { display: flex; gap: 8px; flex: none; }
/* Buttons take the shape of animations.dev's "Notify me" (.buy-button): a top-lit gradient, an inset
   highlight, a hairline ring in a darker shade, a soft 2px drop, a hint of text shadow, and a
   brightness lift on hover. Ours are dark, red while recording, and light for Clear. */
.primary, .secondary {
  display: inline-flex; align-items: center; gap: 8px; border: none;
  height: 40px; padding: 0 16px; border-radius: 10px; font-size: 15px; font-weight: 500; white-space: nowrap;
}
.primary {
  color: #fff; text-shadow: 0 .5px #0000007a;
  background: linear-gradient(#4a4944 0%, #21201c 100%);
  box-shadow: inset 0 0 1px 1px #ffffff24, 0 0 0 1px #00000014, 0 2px 2px #0000000a, 0 0 0 1px #21201c;
}
.primary:hover { filter: brightness(118%); }
.primary .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--false); }
.primary.running {
  text-shadow: 0 .5px #4200007a;
  background: linear-gradient(#e2625d 0%, #c8403b 100%);
  box-shadow: inset 0 0 1px 1px #ffffff2e, 0 0 0 1px #00000014, 0 2px 2px #0000000a, 0 0 0 1px #c13c37;
}
.primary.running:hover { filter: brightness(105%); }
.primary.running .dot { background: #fff; animation: pulse 1.2s infinite; }
.secondary {
  color: var(--text); text-shadow: 0 .5px #ffffff7a;
  background: linear-gradient(#ffffff 0%, #f4f3f1 100%);
  box-shadow: inset 0 0 1px 1px #ffffff24, 0 0 0 1px #00000014, 0 2px 2px #0000000a;
}
.secondary:hover { filter: brightness(98%); }
.pane-head .secondary { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; } /* the small size, like .buy-button-small */
.status { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); color: var(--muted); background: var(--card);
}
.pill.warn { color: var(--misleading); background: var(--misleading-bg); border-color: transparent; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.icon-btn:hover { background: var(--panel-2); }


/* ---------- layout ---------- */
/* Two panels: the transcript, quieter, and the context, which leads. */
main {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 1.25fr); gap: 24px;
  width: 100%; max-width: 1360px; margin: 0 auto;
  padding: 32px 40px;
}
.pane {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  min-height: 62px; padding: 12px 24px; border-bottom: 1px solid var(--border); /* both panels line up, Start or not */
}
h2 { margin: 0; font-size: 16px; font-weight: 500; color: var(--text); letter-spacing: -.005em; }

/* ---------- transcript: quieter than the context; it stays on the latest words ---------- */
.transcript { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.empty { color: var(--muted); max-width: 480px; margin: 72px auto; text-align: center; font-size: 15px; line-height: 1.6; }
.empty-title { color: var(--text); font-size: 18px; font-weight: 500; }
.muted { color: var(--faint); }
.bubble { margin: 0 0 18px; animation: rise 250ms var(--ease-out); }
.bubble-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.speaker-name { border: none; background: none; padding: 0; font-weight: 500; font-size: 12.5px; }
.speaker-name:hover { text-decoration: underline; }
.time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.bubble-text { margin: 0; font-size: 15px; line-height: 1.65; color: var(--muted); }

/* Highlights are soft tints only, like Notion's: no colored underlines, so nothing reads as an alarm. */
mark.claim-mark {
  color: var(--text); cursor: pointer; border-radius: 4px; padding: 1px 2px;
  background: transparent; transition: background-color .4s var(--ease-out);
}
mark.m-checking { animation: shimmer 1.4s ease-in-out infinite; }
mark.m-true { background: var(--true-bg); }
mark.m-false { background: var(--false-bg); }
mark.m-misleading { background: var(--misleading-bg); }
mark.m-unverifiable { background: var(--unverifiable-bg); }
mark.m-contested { background: var(--contested-bg); }
mark.m-value { background: var(--value-bg); }
mark.provisional { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(55, 53, 47, .05) 6px 12px); }
mark.flash { animation: flash 1s ease-out 2; }

.caption {
  padding: 0 28px 14px; font-size: 14px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.caption-speaker { font-weight: 500; margin-right: 8px; color: var(--text); }
.caption-speaker::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--false); margin-right: 8px; vertical-align: middle; animation: pulse 1.2s infinite;
}
.caption-text { font-style: italic; }

/* ---------- context pane ---------- */
.stats { display: flex; gap: 20px; flex-wrap: wrap; padding: 18px 24px 0; font-size: 13px; } /* colored text, no pills */
.stats b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; } /* the count is the data: full contrast; its label carries the color */
.cards { flex: 1; overflow-y: auto; padding: 18px 24px 32px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- a card: the words that were said, then what to make of them ---------- */
.card {
  --tone: var(--faint);
  --tone-bg: var(--panel-2);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px 18px; box-shadow: var(--shadow-sm);
  animation: deal 320ms var(--ease-out);
}
.card.v-true { --tone: var(--true); --tone-bg: var(--true-bg); }
.card.v-false { --tone: var(--false); --tone-bg: var(--false-bg); }
.card.v-misleading { --tone: var(--misleading); --tone-bg: var(--misleading-bg); }
.card.v-unverifiable { --tone: var(--unverifiable); --tone-bg: var(--unverifiable-bg); }
.card.k-contested { --tone: var(--contested); --tone-bg: var(--contested-bg); }
.card.k-value { --tone: var(--value); --tone-bg: var(--value-bg); }
.card.provisional { border-style: dashed; }
.card { transition: box-shadow 200ms var(--ease-out); }
.card.focus { box-shadow: 0 0 0 2px var(--ring); } /* found from the transcript: a neutral ring, never red */
.badge.changed { animation: badge 320ms var(--ease-out); }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.speaker-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.card-speaker { color: var(--text); font-weight: 500; }
.card-quote { margin: 12px 0 16px; font-size: 18px; line-height: 1.45; letter-spacing: -.005em; color: var(--text); cursor: pointer; }
.verdict-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 1px 8px 1px 5px; border-radius: 6px; font-size: 12.5px; font-weight: 500;
  color: var(--tone); background: var(--tone-bg);
}
.ico { display: inline-flex; flex: none; }
.ico svg { width: 14px; height: 14px; display: block; }
.card.checking .badge .ico {
  width: 11px; height: 11px; border-radius: 50%; align-self: center;
  border: 1.5px solid var(--faint); border-top-color: var(--text); animation: spin .8s linear infinite;
}
.verdict-text { flex: 1 1 220px; font-size: 15px; line-height: 1.55; color: var(--text); }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions { display: flex; gap: 4px; margin-left: auto; }
.actions button, .pushback-form button {
  border: 1px solid transparent; background: none; color: var(--muted);
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px;
}
.actions button:hover, .pushback-form button:hover { background: var(--panel-2); color: var(--text); }
.pushback-form { flex-basis: 100%; display: grid; gap: 6px; animation: rise 200ms var(--ease-out); }
.pushback-form textarea {
  width: 100%; min-height: 56px; resize: vertical; border-radius: 10px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--border); outline: none;
}
.pushback-form textarea:focus { border-color: var(--ring); }
.pushback-form .row { display: flex; gap: 6px; justify-content: flex-end; }
.pushback-form button[type="submit"] { background: var(--text); color: var(--card); }
.pushback-note {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 14px;
  background: var(--panel-2); animation: rise 250ms var(--ease-out);
}
.pushback-note .you { color: var(--muted); font-style: italic; }
.pushback-note .change { font-weight: 500; margin: 4px 0; }
.working { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin: 14px 0 0; }
.working::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--faint); border-top-color: var(--text); animation: spin .8s linear infinite;
}

/* sources: one quiet chip; the details on hover */
.sources { position: relative; display: inline-flex; vertical-align: 1px; }
.source-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 0 7px; border-radius: 6px; text-decoration: none; line-height: 1.6;
  background: var(--panel-2); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text);
}
.source-chip .more { color: var(--muted); }
.source-chip:hover { background: var(--panel-3); }
.source-pop {
  position: fixed; z-index: 30; width: 340px; display: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.source-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* a bridge for the pointer */
.source-pop.below::before { top: -10px; }
.source-pop.above::before { top: auto; bottom: -10px; }
.sources.open .source-pop { display: block; animation: pop 160ms var(--ease-out); }
.source-pop.below { transform-origin: top left; }
.source-pop.above { transform-origin: bottom left; }
.pop-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted);
}
.pop-head button { border: none; background: none; color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
.pop-head button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.pop-head button:disabled { opacity: .35; cursor: default; }
.pop-icons { display: flex; margin-left: auto; }
.pop-icons img { width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--card); margin-left: -5px; }
.pop-body { display: block; padding: 16px 18px 18px; text-decoration: none; }
.pop-site { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pop-site img { width: 18px; height: 18px; border-radius: 50%; }
.pop-title { margin: 8px 0 6px; font-size: 15px; font-weight: 500; color: var(--text); line-height: 1.35; }
.pop-body:hover .pop-title { text-decoration: underline; }
.pop-snippet {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.pop-date { margin-top: 6px; font-size: 12px; color: var(--faint); }

/* perspectives: other people, in their own words */
/* A take is one row, like a list on animations.dev: who, where they stand, a one-line summary and
   the source. Clicked, it opens to their exact words and the page they come from. */
.takes { display: grid; margin-top: 12px; }
.take {
  position: relative; cursor: pointer; overflow: hidden;
  animation: rise 250ms var(--ease-out) both; transition: opacity 200ms var(--ease-out);
}
.takes.has-open .take:not(.open) { opacity: .4; } /* the others recede while one is open */
.take::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px solid var(--border); }
.take:last-of-type::after { display: none; }
.take-row { display: flex; align-items: center; gap: 14px; }
.take-text { flex: 1; min-width: 0; padding: 12px 0; }
.take-title { display: flex; align-items: center; gap: 8px; }
.take-row .sources { flex: none; transition: opacity 120ms var(--ease-out), visibility 120ms; }
.take.open .take-row .sources { opacity: 0; visibility: hidden; } /* open, the evidence below shows the source */
.person { font-weight: 500; font-size: 14px; }
.stance {
  font-size: 12px; font-weight: 500;
  padding: 1px 8px; border-radius: 6px; color: var(--tone); background: var(--tone-bg);
}
.s-disagrees .stance::before { content: "\21C4  "; }
.s-agrees .stance::before { content: "=  "; }
.s-complicates .stance::before { content: "\2248  "; }
.take-summary { margin: 2px 0 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.take.open .take-summary { white-space: normal; }
.take-details { display: none; padding: 0 0 16px; }
.take.open .take-details { display: block; }
.take-quote { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--text); }
.take-evidence { padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); }
.evidence-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-decoration: none; font-size: 13px; }
.evidence-site { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.evidence-site img { width: 16px; height: 16px; border-radius: 50%; }
.evidence-title { color: var(--text); font-weight: 500; }
.evidence-link:hover .evidence-title { text-decoration: underline; }
.evidence-date { color: var(--faint); font-variant-numeric: tabular-nums; }
.evidence-snippet {
  margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.more-takes {
  justify-self: start; margin-top: 10px; border: none; background: none; padding: 3px 0;
  font-size: 13px; color: var(--muted);
}
.more-takes:hover { color: var(--text); }
.no-takes { font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }

/* ---------- common ground recap ---------- */
.recap {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: rgba(253, 253, 252, .82); backdrop-filter: blur(10px);
  animation: fade 200ms var(--ease-out);
}
.recap-panel {
  width: min(1280px, 100%); max-height: 100%; overflow: auto; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 36px 40px 40px;
  animation: rise 250ms var(--ease-out);
}
.recap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.recap-head h2 { font: 700 30px/1.1 var(--brand); text-transform: uppercase; letter-spacing: -.005em; color: var(--text); }
.recap-sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.recap-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 20px; }
.recap-col { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.recap-col.settled { --col: var(--true); }
.recap-col.open { --col: var(--contested); }
.recap-col.values { --col: var(--value); }
.recap-col h3 { margin: 0; font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.recap-col h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--col); }
.recap-note { margin: 4px 0 18px; color: var(--muted); font-size: 13px; }
.recap-col ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.recap-col li { animation: rise 300ms var(--ease-out) both; font-size: 14.5px; line-height: 1.45; }
.recap-col li .who { font-weight: 500; font-size: 12.5px; }
.recap-col li .tag { font-size: 12px; font-weight: 500; margin-right: 6px; padding: 1px 6px; border-radius: 6px; }
.recap-col li .fix { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.recap-col li .voices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.recap-col li .voice { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--contested-bg); color: var(--contested); }
.recap-empty { color: var(--faint); font-size: 13.5px; }
.recap-col li .tag { display: inline-flex; align-items: center; gap: 4px; vertical-align: 1px; }
.tag.v-true { color: var(--true); background: var(--true-bg); }
.tag.v-false { color: var(--false); background: var(--false-bg); }
.tag.v-misleading { color: var(--misleading); background: var(--misleading-bg); }
.tag.v-unverifiable { color: var(--unverifiable); background: var(--unverifiable-bg); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 20px; right: 20px; display: grid; gap: 10px; z-index: 50; max-width: 420px; }
.toast {
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px;
  background: var(--card); border: 1px solid var(--border); animation: drop 200ms var(--ease-out);
}
.toast.error { color: var(--false); background: var(--false-bg); border-color: transparent; }
.toast.notice { color: var(--misleading); background: var(--misleading-bg); border-color: transparent; }
.suggest-title { font-weight: 500; }
.toast .evidence { color: var(--muted); font-style: italic; margin: 2px 0 8px; }
.toast .row { display: flex; gap: 6px; justify-content: flex-end; }
.toast .row button { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 3px 12px; }

/* ---------- presentation mode (P) ---------- */
body.present { font-size: 17px; }
body.present .bubble-text { font-size: 18px; }
body.present .card-quote { font-size: 21px; }
body.present .caption { bottom: 0; font-size: 18px; }

/* ---------- animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes deal { from { opacity: 0; transform: translateY(-14px) scale(1.015); } } /* a new card set down on top */
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes badge { from { opacity: .4; transform: scale(.85); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 50% { background-color: var(--panel-3); } }
@keyframes flash { 50% { filter: brightness(.92); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  body { overflow: auto; height: auto; display: block; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
  .status { margin-left: 0; }
  .controls { margin-left: auto; }
  main { grid-template-columns: 1fr; padding: 20px 16px; gap: 20px; }
  .transcript-pane { height: 55vh; }
  .claims-pane { height: auto; }
  .card { padding: 18px 18px 14px; }
  .claims-pane { min-height: 50vh; }
  .cards { overflow: visible; }
  .source-pop { width: min(340px, calc(100vw - 32px)); }
  .recap { padding: 10px; }
  .recap-grid { grid-template-columns: 1fr; }
}
