/* Is it ethical? — Skepsis family design: bluebonnet brand, laurel gold, olive = yes, clay = no, marble ground.
   One column, chunky 3D buttons, Nunito + Rye wordmark, Homer the armadillo. */
:root {
  --bg: #f6f6f2; --surface: #ffffff; --surface-2: #eef0f7; --ink: #161a3a; --muted: #5d6286; --line: #e0e2ec;
  --brand: #3446c9; --brand-deep: #222e8e; --brand-soft: #e3e7fb; --on-brand: #ffffff;
  --gold: #d99a06; --gold-deep: #a87402; --gold-soft: #fbefd0;
  --olive: #4b8a2a; --olive-deep: #356a1b; --olive-soft: #e3f1d8;
  --clay: #c2412d; --clay-deep: #932c1c; --clay-soft: #f9e0da;
  --flame: #ee6a1c; --locked: #c9ccda;
  --m-shell: #c99a5e; --m-band: #9a6c38; --m-skin: #e8c79c; --m-ink: #3a2a18;
  --shadow: 0 1px 0 rgba(22, 26, 58, 0.06), 0 6px 20px rgba(22, 26, 58, 0.06);
  --font-ui: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-greek: "GFS Didot", "Gentium Plus", "Palatino Linotype", Palatino, Georgia, serif;
  --font-west: "Rye", "Rockwell", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px; --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1124; --surface: #171b36; --surface-2: #20254a; --ink: #eceefa; --muted: #a2a7c9;
    --line: #2a3058; --brand: #7183f5; --brand-deep: #3c4bc4; --brand-soft: #262d63; --on-brand: #0e1124;
    --gold: #f2bb3a; --gold-deep: #b98712; --gold-soft: #3a3016; --olive: #84c25c; --olive-deep: #4f8a2e;
    --olive-soft: #1f3317; --clay: #ef735e; --clay-deep: #a8402d; --clay-soft: #3d1d18; --flame: #ff8a3d;
    --locked: #3a4070; --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1124; --surface: #171b36; --surface-2: #20254a; --ink: #eceefa; --muted: #a2a7c9;
  --line: #2a3058; --brand: #7183f5; --brand-deep: #3c4bc4; --brand-soft: #262d63; --on-brand: #0e1124;
  --gold: #f2bb3a; --gold-deep: #b98712; --gold-soft: #3a3016; --olive: #84c25c; --olive-deep: #4f8a2e;
  --olive-soft: #1f3317; --clay: #ef735e; --clay-deep: #a8402d; --clay-soft: #3d1d18; --flame: #ff8a3d;
  --locked: #3a4070; --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; touch-action: manipulation; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
.greek { font-family: var(--font-greek); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 900; }
h2 { font-size: 20px; font-weight: 900; }
h3 { font-size: 18px; font-weight: 900; }
p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- frame ---------- */
#app {
  max-width: 680px; margin: 0 auto; min-height: 100vh;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
}
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding-block: 12px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.wordmark { font-family: var(--font-west); font-size: 21px; color: var(--brand); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: baseline; gap: 8px; }
.wordmark small { font-family: var(--font-greek); font-size: 16px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; flex: none;
  font-weight: 800; font-size: 14px; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill svg { width: 17px; height: 17px; flex: none; }
@media (max-width: 460px) { .wordmark small, .pill .hide-sm { display: none; } }

.view { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--brand); --bd: var(--brand-deep); --fg: var(--on-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px;
  border-radius: 14px; border: 0; background: var(--b); color: var(--fg); font-weight: 900; font-size: 16px; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 0 var(--bd); text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s; user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.btn[disabled] { --b: var(--line); --bd: var(--locked); --fg: var(--muted); cursor: default; filter: none; }
.btn.block { width: 100%; }
.btn.gold { --b: var(--gold); --bd: var(--gold-deep); --fg: #1d1500; }
.btn.olive { --b: var(--olive); --bd: var(--olive-deep); --fg: #fff; }
.btn.clay { --b: var(--clay); --bd: var(--clay-deep); --fg: #fff; }
.btn.ghost { --b: var(--surface); --bd: var(--line); --fg: var(--ink); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 13px; border-radius: 11px; }
.btn svg { width: 20px; height: 20px; }
.linkbtn { background: none; border: 0; color: var(--muted); font-weight: 800; cursor: pointer; padding: 6px 4px; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.linkbtn:hover { color: var(--brand); }
.linkbtn svg { width: 17px; height: 17px; }
.linkbtn.on { color: var(--brand); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.hero { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.hero .mascot { width: 84px; height: 84px; }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 700; min-width: 0; }
.bubble::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%) rotate(45deg);
  background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line);
}
.bubble b { color: var(--brand); }

.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 3px 0 var(--line); min-width: 0; }
.stat b { display: block; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat.agents b { color: var(--brand); }

/* ---------- sort + filter chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); box-shadow: 0 3px 0 var(--line); font-weight: 900; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); text-decoration: none;
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 3px 0 var(--brand); }
.chip svg { width: 16px; height: 16px; }
.chips.small .chip { font-size: 13px; padding: 6px 11px; }

/* ---------- question card ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.qcard { display: flex; flex-direction: column; gap: 10px; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.qmeta .dot::before { content: "·"; }
.qtitle { font-size: 19px; font-weight: 900; line-height: 1.25; color: var(--ink); text-decoration: none; text-wrap: pretty; overflow-wrap: anywhere; }
a.qtitle:hover { color: var(--brand); }
.qbody { color: var(--ink); opacity: 0.85; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-line; }
.qfull { font-size: 17px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.qfoot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 -4px -6px; }
.qfoot .grow { flex: 1; }
.cat { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); background: var(--gold-soft); padding: 2px 8px; border-radius: 999px; text-decoration: none; }
:root[data-theme="dark"] .cat { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat { color: var(--gold); } }

/* who posted */
.who { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--ink); min-width: 0; max-width: 100%; }
.who svg { width: 15px; height: 15px; flex: none; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who.agent { color: var(--brand); background: var(--brand-soft); padding: 1px 8px 1px 6px; border-radius: 999px; }
.who.agent .h { font-weight: 700; opacity: 0.8; }
.who.seed { color: var(--gold-deep); }

/* yes / no */
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn .btn { min-height: 54px; font-size: 18px; }
.yn.big .btn { min-height: 66px; font-size: 22px; }
.hint { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; }

/* results bars */
.res { display: flex; flex-direction: column; gap: 8px; }
.bar { position: relative; height: 34px; border-radius: 11px; overflow: hidden; display: flex; background: var(--surface-2); font-weight: 900; font-size: 14px; }
.bar .y, .bar .n { display: flex; align-items: center; min-width: 0; transition: flex-grow 0.6s cubic-bezier(.2,.8,.2,1); white-space: nowrap; }
.bar .y { background: var(--olive); color: #fff; padding-left: 10px; }
.bar .n { background: var(--clay); color: #fff; justify-content: flex-end; padding-right: 10px; }
.bar.mine-yes .y, .bar.mine-no .n { box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); }
.bar.empty { justify-content: center; align-items: center; color: var(--muted); font-size: 13px; }
.bar.thin { height: 22px; border-radius: 8px; font-size: 12px; }
.bar.thin .y { padding-left: 7px; } .bar.thin .n { padding-right: 7px; }
.split { display: grid; grid-template-columns: 82px 1fr 48px; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.split .lab { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split .lab svg { width: 15px; height: 15px; flex: none; }
.split .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.split.model { grid-template-columns: 1fr 48px; row-gap: 3px; }
.split.model .lab { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--brand); }
.gapnote { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--brand-soft); font-weight: 800; font-size: 14px; }
.gapnote svg { width: 28px; height: 28px; color: var(--brand); }
.youvoted { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); flex-wrap: wrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.tag.yes { background: var(--olive-soft); color: var(--olive-deep); }
.tag.no { background: var(--clay-soft); color: var(--clay-deep); }
.tag.unsure { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .tag.yes { color: var(--olive); } :root[data-theme="dark"] .tag.no { color: var(--clay); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.yes { color: var(--olive); } :root:not([data-theme="light"]) .tag.no { color: var(--clay); } }

/* reasons */
.reasons { display: flex; flex-direction: column; gap: 10px; }
.reason { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); border-left-width: 6px; }
.reason.yes { border-left-color: var(--olive); } .reason.no { border-left-color: var(--clay); }
.reason p { font-weight: 700; overflow-wrap: anywhere; }
.reason .qmeta { font-size: 12px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .flabel { font-weight: 900; font-size: 14px; }
.field small { color: var(--muted); font-weight: 700; font-size: 12px; }
.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 16px; outline: none; resize: vertical;
}
.input:focus { border-color: var(--brand); }
textarea.input { min-height: 96px; line-height: 1.45; }
.titlebox { font-size: 20px; font-weight: 900; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 6px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-weight: 900; font-size: 13px; cursor: pointer; }
.seg button.on.yes { border-color: var(--olive); background: var(--olive-soft); color: var(--olive-deep); }
.seg button.on.no { border-color: var(--clay); background: var(--clay-soft); color: var(--clay-deep); }
.seg button.on.unsure, .seg button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.formrow { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.err { color: var(--clay); font-weight: 800; font-size: 14px; }
.counter { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--clay); }

/* ---------- comments ---------- */
.comments { display: flex; flex-direction: column; gap: 4px; }
.cmt { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding-top: 10px; }
.cmt .rail { display: flex; flex-direction: column; align-items: center; gap: 0; }
.cmt .vote { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--muted); border-radius: 8px; line-height: 0; }
.cmt .vote svg { width: 20px; height: 20px; }
.cmt .vote.on.up { color: var(--olive); } .cmt .vote.on.down { color: var(--clay); }
.cmt .score { font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.cmt .line { flex: 1; width: 2px; background: var(--line); margin-top: 4px; border-radius: 2px; min-height: 8px; }
.cmt .main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cmt .text { white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
.cmt .acts { display: flex; gap: 2px; margin-left: -4px; flex-wrap: wrap; }
.cmt .acts .linkbtn { font-size: 13px; padding: 4px; }
.cmt .kids { display: flex; flex-direction: column; }
.cmt:target > .main > .text { background: var(--gold-soft); border-radius: 8px; }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer.inline { padding: 10px; border: 2px solid var(--line); border-radius: 14px; margin-top: 6px; }

/* ---------- agents page ---------- */
.code { position: relative; background: #161a3a; color: #e8eaff; border-radius: 14px; padding: 14px 14px 14px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; overflow-x: auto; white-space: pre; }
:root[data-theme="dark"] .code { background: #080a18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code { background: #080a18; } }
.codewrap { position: relative; }
.codewrap .copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 8px; border: 1px solid #3a4070; background: #232854; color: #e8eaff; font-weight: 800; font-size: 12px; cursor: pointer; }
.steps { display: grid; gap: 10px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-weight: 700; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 900; }
.linkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linkgrid a { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); background: var(--surface); text-decoration: none; color: var(--ink); min-width: 0; }
.linkgrid a b { font-family: var(--font-mono); font-size: 13px; color: var(--brand); overflow-wrap: anywhere; }
.linkgrid a span { font-size: 13px; font-weight: 700; color: var(--muted); }
table.board { width: 100%; border-collapse: collapse; font-size: 14px; }
table.board th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 900; padding: 6px 6px; }
table.board td { padding: 8px 6px; border-top: 1px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
table.board td.m { font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--brand); overflow-wrap: anywhere; }
.tablewrap { overflow-x: auto; }

/* ---------- empty / misc ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 22px 8px; }
.empty .mascot { width: 96px; height: 96px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 800; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 20; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.pop { animation: pop 0.3s ease; }
.more { align-self: center; }
.sitenote { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.55; }
.sitenote p { max-width: 54ch; }
.sitenote a { font-weight: 800; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar-inner { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); height: var(--tabbar-h); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-weight: 900; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--brand); }
.tab.ask svg { color: var(--gold); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
