/* Back with Facts – design system, from the prototype (docs/design-reference). Phone-first. */
:root {
  --bg: #F6FAF8;
  --surface: #FFFFFF;
  --text: #16302B;
  --muted: #3D5A53;
  --soft-text: #24483F;
  --line: #DDE9E4;
  --line-soft: #E8F0EC;
  --teal: #0E7C6B;
  --teal-link: #0B6E60;
  --teal-dark: #084F45;
  --teal-tint: #E6F4EF;
  --teal-line: #CFE6DD;
  --for: #2F6FDB;
  --for-text: #1F4FA8;
  --for-tint: #F3F7FF;
  --for-chip: #EEF3FF;
  --against: #F2A93B;
  --against-text: #A04A0E;
  --against-tint: #FFF6EA;
  --yellow: #FFC857;
  --amber-tint: #FFF4DD;
  --amber-text: #6B4200;
  --neutral-chip: #F1F5F3;
  --error: #B3261E;
  --error-tint: #FDECEA;
  --radius-card: 20px;
  --radius-inner: 16px;
  --heading: 'Space Grotesk', system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: var(--teal-link); }
a:hover { color: var(--teal-dark); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--heading); letter-spacing: -0.02em; line-height: 1.15; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header & promise bar */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 720px) { .wrap { padding-left: 24px; padding-right: 24px; } }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--teal); display: flex; align-items: center; justify-content: center; }
.brand-name { font-family: var(--heading); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-name span { color: var(--teal); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1 1 auto; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 10px 0; }
.main-nav a[aria-current="page"] { color: var(--text); font-weight: 700; border-bottom: 3px solid var(--teal); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.promise { background: var(--teal-tint); border-bottom: 1px solid var(--teal-line); }
.promise-inner { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding-top: 10px; padding-bottom: 10px; font-size: 14px; color: var(--soft-text); }
.promise-inner strong { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-teal { background: var(--teal); } .dot-orange { background: var(--against); } .dot-blue { background: var(--for); }

/* ---------- layout */
main { padding-top: 24px; padding-bottom: 64px; }
@media (min-width: 720px) { main { padding-top: 32px; } }
.stack { display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 720px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
@media (min-width: 720px) { .card { padding: 28px; } }
.card-accent { border: 2px solid var(--teal); }
.page-title { font-size: 30px; margin: 0 0 8px; }
@media (min-width: 720px) { .page-title { font-size: 36px; } }
.lede { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.section-title { font-size: 22px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- buttons & pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--teal); color: #FFFFFF; }
.btn-primary:hover { background: var(--teal-dark); color: #FFFFFF; }
.btn-ghost { background: var(--surface); color: var(--teal-link); border-color: var(--teal-line); }
.btn-plain { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 500; }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.tag-topic { background: var(--for-chip); color: var(--for-text); }
.tag-type { background: var(--amber-tint); color: #7A4B00; }
.tag-meta { background: var(--neutral-chip); color: var(--muted); font-weight: 500; }
.tag-tier2 { background: #FDEBD3; color: #7A3A00; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field legend { font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid #C5D9D1; border-radius: 12px; background: var(--surface); }
textarea { min-height: 110px; resize: vertical; }
.field-error input, .field-error textarea, .field-error select { border-color: var(--error); }
.error-text { color: var(--error); font-size: 14px; font-weight: 600; margin: 0; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-bottom: 16px; }
.alert-error { background: var(--error-tint); color: #7A1A14; }
.alert-info { background: var(--teal-tint); color: var(--soft-text); }
.alert-amber { background: var(--amber-tint); color: var(--amber-text); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pill-option { position: relative; }
.pill-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill-option span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); }
.pill-option input:checked + span { background: var(--text); color: #FFFFFF; border-color: var(--text); }
.pill-option input:checked + span.for { background: var(--for); border-color: var(--for); }
.pill-option input:checked + span.against { background: var(--against); border-color: var(--against); color: var(--text); }
.pill-option input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.source-rows { display: flex; flex-direction: column; gap: 10px; }
.source-row { display: grid; grid-template-columns: 1fr; gap: 8px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px; }
@media (min-width: 720px) { .source-row { grid-template-columns: 1.2fr 1fr; } }
.counter { font-size: 13px; color: var(--muted); text-align: right; }

/* ---------- evidence balance */
.balance { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 18px; }
.balance-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.balance-head h2 { font-family: var(--body); font-size: 15px; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.balance-track { position: relative; height: 18px; border-radius: 999px; display: flex; }
.balance-track .l { flex: 1; background: var(--for); border-radius: 999px 0 0 999px; }
.balance-track .r { flex: 1; background: var(--against); border-radius: 0 999px 999px 0; }
.balance-track.empty { border: 2px dashed #B9D8CC; background: #EEF4F1; }
.balance-track.empty .l, .balance-track.empty .r { background: transparent; }
.balance-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.balance-note { margin: 14px 0 0; background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* ---------- discussion & post cards */
.disc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
@media (min-width: 720px) { .post { padding: 22px; } }
.post.faded { opacity: 0.78; }
.post-opening { border-color: var(--teal-line); box-shadow: 0 1px 0 var(--teal-line); }
.replies { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; padding-left: 12px; border-left: 3px solid var(--line-soft); }
@media (min-width: 720px) { .replies { padding-left: 22px; } }
.post-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.author { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #FFFFFF; flex: none; }
.author-name { font-weight: 700; }
.author-meta { font-size: 13px; color: var(--muted); }
.side-for { color: var(--for-text); } .side-against { color: var(--against-text); } .side-middle { color: var(--teal-link); }
.score { text-align: center; min-width: 84px; border-radius: 14px; padding: 8px 12px; }
.score-num { font-family: var(--heading); font-size: 26px; font-weight: 700; line-height: 1; }
.score-band { font-size: 12px; font-weight: 600; }
.score-pending { background: var(--neutral-chip); color: var(--muted); }
.score-pending .score-num { font-size: 15px; font-family: var(--body); padding: 4px 0; }
.score-strong { background: var(--teal); color: #FFFFFF; }
.score-some { background: var(--teal-tint); color: var(--teal-dark); }
.score-weak { background: var(--amber-tint); color: var(--amber-text); }
.score-opinion { background: var(--neutral-chip); color: var(--muted); }
.post-text { margin: 14px 0 12px; font-size: 17px; white-space: pre-line; overflow-wrap: anywhere; }
.just { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.just-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.just-text { margin: 0 0 10px; font-size: 15px; color: var(--soft-text); white-space: pre-line; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--neutral-chip); border-radius: 10px; padding: 6px 10px; font-size: 13px; text-decoration: none; color: var(--text); max-width: 100%; }
.chip .dot { margin: 0; background: #9DB3AB; }
.chip-note { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.opinion-note { background: var(--amber-tint); color: var(--amber-text); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 10px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }

/* ---------- thread list */
.thread-list { display: flex; flex-direction: column; gap: 14px; list-style: none; padding: 0; margin: 0; }
.thread-item a.title { font-family: var(--heading); font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.thread-item a.title:hover { color: var(--teal-link); }
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 8px; }
.empty { text-align: center; padding: 40px 20px; }

/* ---------- prose pages */
.prose h2 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { font-size: 17px; }
.bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.bands div { border-radius: 14px; padding: 14px; text-align: center; font-weight: 600; }
table.plain { width: 100%; border-collapse: collapse; font-size: 15px; }
table.plain th, table.plain td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }

/* ---------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.footer-inner a { color: var(--muted); }

/* "See the working" (Stage 2) */
.working { margin-top: 12px; }
.working > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; border: 1px solid #CFE6DD; color: var(--teal-link); font-weight: 600; }
.working > summary::-webkit-details-marker { display: none; }
.working[open] > summary { margin-bottom: 12px; }
.working-body { background: #F6FAF8; border: 1px dashed #B9D8CC; border-radius: 14px; padding: 16px; }
.working-title { font-weight: 700; margin-bottom: 8px; }
.working-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* "Add your view" at the top of a thread, so people don't have to scroll to the form at the bottom */
.thread-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.thread-head .page-title { margin: 0; flex: 1 1 320px; }
.add-view-top { flex: 0 0 auto; margin-top: 2px; }
@media (max-width: 480px) { .add-view-top { width: 100%; } }

/* ---------- evidence slider and true-or-false meter (Stage 3) */
.balance-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.side-name { font-weight: 700; }
.side-name.side-for { color: var(--for-text); }
.side-name.side-against { color: var(--against-text); }
.balance-track .marker, .truth-track .marker { position: absolute; top: -6px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
  background: #FFFFFF; border: 4px solid var(--text, #16302B); box-sizing: border-box; }
.verdict { border-radius: 16px; padding: 20px; background: #F2FAF6; border: 1px solid #CFE6DD; }
.verdict-b { background: #FFF8EC; border-color: #F5DDB3; }
.verdict-even { background: var(--bg); border-color: var(--line); }
.verdict-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 16px; }
.verdict-title { flex: 1 1 240px; }
.verdict-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.verdict-text { font-family: var(--heading, 'Space Grotesk', sans-serif); font-size: 28px; font-weight: 700; line-height: 1.2; color: #0B5A4E; }
.verdict-b .verdict-text { color: #8A3F0B; }
.verdict-even .verdict-text { color: var(--text, #16302B); }
.verdict-confidence { text-align: center; border-radius: 14px; padding: 8px 14px; background: #FFFFFF; border: 1px solid var(--line); }
.verdict-confidence-value { font-family: var(--heading, 'Space Grotesk', sans-serif); font-size: 22px; font-weight: 700; }
.truth-track { position: relative; height: 18px; display: flex; gap: 4px; }
.truth-track .f { flex: 1; background: var(--against); border-radius: 999px 0 0 999px; }
.truth-track .m { flex: 1; background: #D5DED9; }
.truth-track .t { flex: 1; background: #3FB39C; border-radius: 0 999px 999px 0; }

/* ---------- key-points summary (Stage 3) */
.points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.point-from { color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.point-from:hover { text-decoration: underline; }
.points-sides { display: flex; flex-wrap: wrap; gap: 16px; }
.points-side { flex: 1 1 260px; border-radius: 16px; padding: 18px; }
.points-side h3 { margin: 0 0 10px; font-size: 16px; }
.points-for { background: var(--for-tint); } .points-for h3 { color: var(--for-text); }
.points-against { background: var(--against-tint); } .points-against h3 { color: var(--against-text); }
.common-ground { margin-top: 16px; background: var(--neutral-chip); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* ---------- score history and challenges (Stage 3) */
.history { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.history-reason { color: var(--muted); margin-top: 2px; }
.working-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- thread layout: the thread on the left, what the evidence shows on the right (Stage 3) */
/* Phones: question, then the findings, then the thread, then the extras. */
.t-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "findings" "main" "extras"; }
.t-head { grid-area: head; }
.t-main { grid-area: main; }
.t-side { display: contents; }
.t-findings { grid-area: findings; gap: 20px; }
.t-extras { grid-area: extras; gap: 20px; }
@media (min-width: 960px) {
  .t-layout { gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "head side" "main side"; align-items: start; }
  .t-side { display: flex; flex-direction: column; gap: 20px; grid-area: side; }
}
.t-meter .balance { background: var(--surface); border-radius: 20px; }
.t-meter .verdict-text { font-size: 24px; }
.t-findings .points-side { flex-basis: 100%; }
.card-side { padding: 22px; }
.side-title { font-family: var(--heading); font-size: 18px; margin: 0 0 4px; }
.side-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.score-guide { display: flex; flex-direction: column; gap: 8px; font-size: 14px; margin-top: 8px; }
.score-guide > div { display: flex; align-items: center; gap: 10px; }
.sg { font-weight: 700; border-radius: 8px; padding: 2px 10px; min-width: 52px; text-align: center; }
.sg-strong { background: #D8F0E7; color: #0B5A4E; } .sg-some { background: #E8F0FD; color: #1F4FA8; }
.sg-weak { background: #FFF0D6; color: #7A4B00; } .sg-opinion { background: #EEF1F0; color: var(--muted); }
.similar { display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.similar-link { text-decoration: none; color: var(--text); display: block; }
.similar-link:hover .similar-title { text-decoration: underline; }
.similar-title { display: block; font-weight: 600; }
.similar-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.landed { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.landed-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-weight: 600; }
.landed-bar { height: 10px; background: #EEF1F0; border-radius: 999px; overflow: hidden; }
.landed-fill { height: 10px; border-radius: 999px; }
.landed-changed_mind { background: var(--teal); } .landed-learned_something { background: var(--for); } .landed-view_unchanged { background: #8FA6A0; }

/* ---------- "I'm done here" */
.done-row { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; font-size: 14px; color: var(--muted); }
.done-totals strong { color: var(--text); }
.done-btn { border-color: var(--text); }
.done-form { margin-top: 16px; border: 2px solid var(--teal); border-radius: 16px; padding: 20px; }
.done-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; border: 0; padding: 0; }
.done-choice { display: flex; flex-direction: column; gap: 4px; min-height: 88px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; position: relative; }
.done-choice input { position: absolute; opacity: 0; }
.done-choice:has(input:checked) { border: 2px solid var(--teal); background: #F2FAF6; }
.done-choice:has(input:focus-visible) { outline: 3px solid #FFC857; outline-offset: 2px; }
.done-choice-label { font-weight: 700; font-size: 15px; }
.done-choice-hint { color: var(--muted); font-size: 13px; }
.done-thanks { margin-top: 16px; background: #E6F4EF; border-radius: 16px; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; font-size: 15px; color: #0B4A41; }
.done-thanks > div { flex: 1 1 280px; }
.exit-note { font-size: 13px; color: var(--muted); background: var(--neutral-chip); border-radius: 10px; padding: 6px 10px; margin: -4px 0 10px; display: inline-block; }

/* ---------- "This has been debated before" and settled threads (Stage 3) */
.debated-before { background: var(--for-tint); border: 2px solid var(--for); border-radius: 18px; padding: 20px; margin: 0 0 8px; }
.debated-before .match { background: #FFFFFF; border-color: #C9D9F7; }
.debated-before .match-top { box-shadow: 0 2px 10px rgba(47, 111, 219, 0.15); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 0.08em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.matches { display: flex; flex-direction: column; gap: 12px; }
.match { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.match-top { background: #F3F7FF; border-color: #C9D9F7; }
.match-body { flex: 1 1 300px; }
.match-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.match-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.match-note { margin: 10px 0 0; font-size: 14px; color: #24483F; background: #FFFFFF; border-radius: 10px; padding: 8px 12px; }
.tag-close { background: var(--for); color: #FFFFFF; }
.tag-related { background: var(--for-chip); color: var(--for-text); }
.tag-settled { background: #E6ECEA; color: #24483F; }
.settled-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; background: #EEF3F1; border: 1px solid #CFDCD7; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; font-size: 15px; }
.settled-banner > div { flex: 1 1 320px; }

/* ---------- debates list: search, filters, type colours and mini meters */
.tag-values { background: var(--for-chip); color: var(--for-text); }
.tag-fact { background: #DDF2EA; color: #0B5A4E; }
.tag-topic { background: var(--neutral-chip); color: var(--muted); text-decoration: none; }
a.tag-topic:hover { text-decoration: underline; }
.thread-item { border-left-width: 5px; }
.item-values { background: #FAFCFF; border-left-color: var(--for); }
.item-fact { background: #F7FCFA; border-left-color: #3FB39C; }
.thread-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.thread-item-head .tags { flex: 1 1 280px; }
.mini-meter { flex: 0 0 170px; }
.mini-track { position: relative; height: 10px; display: flex; gap: 2px; }
.mini-track span:not(.mini-marker) { flex: 1; }
.mini-values .l { background: var(--for); border-radius: 999px 0 0 999px; }
.mini-values .r { background: var(--against); border-radius: 0 999px 999px 0; }
.mini-fact .f { background: var(--against); border-radius: 999px 0 0 999px; }
.mini-fact .m { background: #D5DED9; }
.mini-fact .t { background: #3FB39C; border-radius: 0 999px 999px 0; }
.mini-empty .mini-track span:not(.mini-marker) { background: #E6ECEA; }
.mini-marker { position: absolute; top: -4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--text); box-sizing: border-box; }
.mini-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; text-align: right; }
.list-filters { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.list-filters .search-field { margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row select { min-height: 44px; border: 1px solid #CFE6DD; border-radius: 999px; padding: 0 14px; background: #FFFFFF; font: inherit; font-size: 14px; color: var(--text); }
@media (max-width: 520px) { .mini-meter { flex-basis: 100%; } .mini-label { text-align: left; } }
.filter-row select { width: auto; flex: 0 1 auto; padding-right: 34px; }
@media (max-width: 520px) { .filter-row select { flex: 1 1 100%; } }
.t-findings .card { padding: 22px; }
.t-findings .section-title { font-family: var(--heading); font-size: 18px; }
.t-findings .lede { font-size: 14px; margin-bottom: 14px; }
.balance-why { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.challenge-sources { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.challenge-source { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.challenge-source:has(input:checked) { border: 2px solid var(--teal); background: #F2FAF6; }
.challenge-source input { margin-top: 4px; }

/* Stage 4: rewording helper, kindness nudge and blocked-post message (Rules.dc.html) */
.helper { background: var(--amber-tint); border: 1px solid #F5DDA8; border-radius: 18px; padding: 18px; margin-bottom: 18px; color: var(--text); }
.helper-blocked { background: var(--error-tint); border-color: #F4C7C2; }
.helper-quote { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; font-size: 16px; }
.helper-tips { margin-top: 14px; font-size: 15px; }
.helper-tips ul { margin: 6px 0 8px; padding-left: 20px; }
.stack-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.guarded-banner { background: var(--for-tint); border: 1px solid #D6E2FA; color: var(--for-text); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin-bottom: 14px; }

/* Stage 4: admin area (plain on purpose) */
.admin-nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; font-weight: 600; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; font-size: 15px; margin-bottom: 18px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin-h3 { font-size: 17px; margin: 12px 0 6px; }
.admin-pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; overflow-x: auto; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-big { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; }
.qr { max-width: 220px; margin: 8px 0; background: #fff; padding: 6px; border-radius: 10px; }
.setup-key { font-size: 15px; word-break: break-all; }

/* Stage 4: Our rules (Rules.dc.html) */
.rules { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding: 12px 0 40px; }
.kicker { display: inline-block; background: var(--teal-tint); color: #0B5A4E; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; }
.rules-title { font-size: clamp(30px, 6vw, 40px); line-height: 1.1; margin: 0 0 14px; }
.rules-lede { font-size: 18px; max-width: 720px; margin: 0; }
.rules h2 { font-family: 'Space Grotesk', sans-serif; }
.tier-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-wrap: wrap; gap: 20px; }
.tier-icon { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.tier-icon-1 { background: var(--teal); } .tier-icon-2 { background: var(--for); } .tier-icon-3 { background: #B85A14; }
.tier-body { flex: 1 1 520px; min-width: 0; }
.tier-body h2 { font-size: 26px; margin: 0 0 8px; }
.tier-body p { margin: 0 0 14px; color: var(--soft-text); }
.tier-body ul { margin: 0 0 16px; padding-left: 20px; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.tier-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tier-kicker-1 { color: #0B5A4E; } .tier-kicker-2 { color: var(--for-text); } .tier-kicker-3 { color: var(--against-text); }
.tier-label { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.tier-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-examples span { background: var(--neutral-chip); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.rewrites { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.rewrite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--for-tint); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.rewrite-from { flex: 1 1 200px; color: var(--muted); text-decoration: line-through; }
.rewrite-to { flex: 2 1 280px; font-weight: 600; }
.poster-sees { background: var(--against-tint); border: 1px solid #F5DDB3; border-radius: 14px; padding: 16px; }
.poster-sees p { font-size: 15px; margin: 0 0 8px; color: var(--text); }
.demo { background: var(--surface); border: 2px solid var(--for); border-radius: 20px; padding: 22px; }
.demo h2 { font-size: 22px; margin: 0 0 4px; }
.demo-post { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin: 14px 0; font-size: 17px; }
.demo-helper { background: var(--for-tint); border-radius: 14px; padding: 16px; }
.demo-helper p { font-size: 15px; margin: 0 0 10px; }
.demo-helper-title { font-weight: 700; color: var(--for-text); margin-bottom: 6px; }
.demo-suggestion { background: var(--surface); border: 1px solid #C9D8F5; border-radius: 12px; padding: 12px 14px; font-weight: 600; margin-bottom: 14px; }
.demo-choice { display: inline-block; margin: 0 8px 8px 0; vertical-align: top; }
.demo-choice[open] { display: block; }
.demo-choice summary { list-style: none; }
.demo-choice summary::-webkit-details-marker { display: none; }
.demo-result { border-radius: 14px; padding: 14px 16px; margin-top: 10px; font-size: 15px; }
.demo-result p { margin: 6px 0 0; }
.demo-accepted { background: #EAF7F2; color: #0B5A4E; }
.demo-tips { background: #FFF8EC; }
.demo-tips ul { margin: 6px 0 0; padding-left: 20px; }
.btn-blue { background: var(--for); color: #fff; }
.rules-pair { display: flex; flex-wrap: wrap; gap: 18px; }
.rules-pair > .card { flex: 1 1 300px; }
.rules-pair h2, .rules > .card h2 { font-size: 20px; margin: 0 0 10px; }
.rules-pair ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.examples { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.example-text { margin: 6px 0 2px; font-weight: 600; }
.tier-tag-1 { background: var(--teal-tint); color: #0B5A4E; } .tier-tag-2 { background: var(--for-chip); color: var(--for-text); } .tier-tag-3 { background: var(--against-tint); color: var(--against-text); }
/* The helper on real posts follows the prototype: blue for rewording, amber for the blocked message */
.helper { background: var(--for-tint); border-color: #C9D8F5; }
.helper-blocked { background: var(--against-tint); border-color: #F5DDB3; }

/* Home intro: what the site is for, at a glance (signed-out visitors) */
.intro { display: flex; flex-direction: column; gap: 18px; margin-bottom: 8px; }
.intro-top { display: grid; gap: 20px; align-items: center; }
@media (min-width: 860px) { .intro-top { grid-template-columns: 1.1fr 1fr; gap: 32px; } }
.intro-title { font-family: var(--heading); font-size: clamp(34px, 7vw, 52px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 14px; }
.intro-title span { color: var(--teal); }
.intro-lede { font-size: 19px; color: var(--soft-text); margin: 0 0 18px; max-width: 34em; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-example { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 24px rgba(22, 48, 43, 0.06); }
.intro-example figcaption { font-size: 16px; }
.intro-post { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; background: var(--bg); }
.intro-post.faded { opacity: 0.75; }
.intro-post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.intro-post-head .score { min-width: 76px; padding: 6px 10px; }
.intro-post-head .score-num { font-size: 22px; }
.intro-post-text { margin: 6px 0 8px; font-size: 15px; }
.intro-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .intro-steps { grid-template-columns: repeat(3, 1fr); } }
.intro-step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.intro-step p { margin: 4px 0 0; font-size: 15px; color: var(--soft-text); }
.intro-step-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-family: var(--heading); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Phones: logo and sign-in on one row, the menu on one scrollable row beneath, so the page starts sooner */
@media (max-width: 719px) {
  .header-inner { gap: 6px 12px; padding-top: 10px; padding-bottom: 4px; }
  .brand { order: 1; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 19px; }
  .header-actions { order: 2; margin-left: auto; flex-wrap: nowrap; }
  .header-actions .small.muted { display: none; }
  .header-actions .btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }
  .main-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; font-size: 15px; padding: 8px 0; }
  .promise-inner { font-size: 13px; gap: 4px 14px; padding-top: 8px; padding-bottom: 8px; }
}

/* Text pages (About, How scoring works, Funding, Privacy) share Our rules' width */
.page-wide { max-width: 960px; margin: 0 auto; }
.rules .prose > :first-child { margin-top: 0; }
