:root {
  --ink: #102f35;
  --ink-soft: #3e575c;
  --teal: #0a6265;
  --teal-dark: #06484c;
  --teal-light: #dceeea;
  --amber: #e2a42c;
  --amber-light: #fff3d7;
  --paper: #f4f2ec;
  --panel: #fffefa;
  --line: #c9d6d3;
  --muted: #617478;
  --danger: #8b3024;
  --danger-bg: #fff0ec;
  --focus: #f0b235;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 0, rgba(177, 218, 206, .52) 0, transparent 31rem),
    linear-gradient(180deg, #f7f6f2 0, var(--paper) 34rem);
}
a { color: var(--teal); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, a.button-link { min-height: 44px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}
.skip-link:focus { transform: none; }

.site-header {
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 245, .94);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 850; }
.brand strong { font-family: Georgia, serif; font-size: 1.18rem; }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); margin-left: auto; }
.site-header nav a { color: var(--ink); font-size: .9rem; font-weight: 750; text-decoration: none; }
.site-header nav a:hover { color: var(--teal); text-decoration: underline; }
.unofficial { padding: 7px 11px; border: 1px solid #b9c9c6; border-radius: 999px; color: var(--ink-soft); font-size: .76rem; font-weight: 750; white-space: nowrap; }

main { width: min(1240px, calc(100% - 32px)); margin: 26px auto 60px; }
.panel {
  background: var(--panel);
  border: 1px solid #d5dedb;
  border-radius: 20px;
  padding: clamp(22px, 3vw, 38px);
  box-shadow: 0 13px 34px rgba(8, 45, 53, .055);
  margin-bottom: 22px;
}
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 350px); gap: 36px; align-items: end; padding-block: clamp(32px, 5vw, 62px); }
h1, h2 { font-family: Georgia, serif; margin: 0; letter-spacing: -.026em; }
h1 { max-width: 820px; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.65rem, 2.7vw, 2.45rem); line-height: 1.08; }
h3 { margin: 0 0 8px; font-size: 1rem; }
p { line-height: 1.55; }
.eyebrow { margin: 0 0 9px; color: var(--teal); font-size: .76rem; letter-spacing: .14em; font-weight: 850; text-transform: uppercase; }
.lede { max-width: 790px; color: var(--ink-soft); font-size: clamp(1rem, 1.7vw, 1.16rem); margin: 22px 0 0; }
.hero-meta { display: grid; gap: 12px; align-content: end; }
.hero-meta > a { font-weight: 760; }
.release-badge { border: 1px solid #a7cbc5; border-radius: 14px; padding: 13px 15px; color: var(--teal-dark); background: #edf7f4; font-size: .86rem; line-height: 1.45; }

.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.task-card { min-width: 0; display: flex; flex-direction: column; }
.task-card h2 { font-size: 1.75rem; }
.task-card > p:not(.step) { color: var(--muted); flex: 1; }
.step { margin: 0 0 20px; color: var(--amber); font-family: Georgia, serif; font-size: 2rem; font-weight: 800; }
.stacked-form { display: grid; gap: 8px; margin-top: 12px; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.member-results { display: grid; gap: 8px; margin-top: 14px; }
.member-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #e2e8e6; }
.member-result span { min-width: 0; }
.member-result strong, .member-result small { display: block; }
.member-result small { color: var(--muted); margin-top: 2px; }
.member-result button { padding: 8px 12px; white-space: nowrap; }
.member-result-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.internal-link { color: var(--teal); font-weight: 760; }

.vote-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.vote-detail-list > div { display: grid; grid-template-columns: minmax(110px, .35fr) 1fr; gap: 12px; padding: 13px 0; border-top: 1px solid #e2e8e6; }
.vote-detail-list dt { color: var(--muted); font-size: .72rem; font-weight: 820; letter-spacing: .05em; text-transform: uppercase; }
.vote-detail-list dd { margin: 0; overflow-wrap: anywhere; }

label { display: grid; gap: 7px; color: #50666a; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 820; }
select, input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #adbfbc;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 620;
}
select[multiple] { min-height: 112px; }
small { text-transform: none; letter-spacing: 0; }
label small { color: var(--muted); font-weight: 500; }
button, .button-link {
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 10px 17px;
  color: #fff;
  background: var(--teal);
  font-weight: 780;
  cursor: pointer;
}
.button-link { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; text-decoration: none; }
button:hover, .button-link:hover { background: var(--teal-dark); }
button:disabled { opacity: .46; cursor: default; }
.secondary-button, .share-actions button, .pagination button { background: #fff; color: var(--teal); }
.secondary-button:hover, .share-actions button:hover, .pagination button:hover { background: var(--teal-light); }
.link-button { border: 0; min-height: auto; background: transparent; color: var(--teal); padding: 6px 0; text-decoration: underline; }
.link-button:hover { background: transparent; color: var(--teal-dark); }

.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.quiet { color: var(--muted); margin: 8px 0 0; }
.grid { display: grid; gap: 16px; }
.pair-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
.compare-button { min-width: 140px; }
.filters { grid-template-columns: 1fr 1fr 2fr; align-items: start; }
.divider { height: 1px; background: var(--line); margin: 26px 0; }
.active-filters { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.empty-state { text-align: center; color: var(--muted); border-style: dashed; }

.share-actions, .modes { display: flex; gap: 8px; flex-wrap: wrap; }
.download-ready { align-self: center; font-weight: 760; }
.metrics { display: grid; grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 20px 17px; border-radius: 14px; background: var(--teal-dark); color: #fff; min-height: 136px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.metric.primary { background: var(--amber); color: var(--ink); }
.metric strong { font-family: Georgia, serif; font-size: clamp(1.75rem, 3vw, 2.8rem); }
.metric > span { font-size: .7rem; letter-spacing: .075em; text-transform: uppercase; font-weight: 820; }
.metric small { color: #d3e7e4; font-size: .76rem; line-height: 1.35; }
.metric.primary small { color: #4e493e; }
.summary-note, .selection-note { color: var(--muted); line-height: 1.5; }
.summary-note { margin: 20px 0 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 14px 13px; text-align: left; border-bottom: 1px solid #e4e9e7; vertical-align: top; }
th { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #5c7074; background: #f7faf8; }
td { font-size: .88rem; line-height: 1.45; }
td.question { min-width: 340px; }
.vote { white-space: nowrap; font-weight: 760; }
.result { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: .74rem; font-weight: 820; background: #e4f1ec; color: #12613f; }
.result.no { background: #f8e4df; color: #943a2c; }
.official-link { display: inline-block; font-weight: 780; white-space: nowrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.pagination span { min-width: 150px; text-align: center; color: var(--muted); font-size: .9rem; }
.error { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px; margin-bottom: 14px; border: 1px solid #f0c8be; border-radius: 10px; background: var(--danger-bg); color: var(--danger); }
.startup-error { width: min(1240px, calc(100% - 32px)); margin: 0 auto 22px; }

.methodology { display: grid; grid-template-columns: minmax(220px, .75fr) 2fr; gap: clamp(28px, 5vw, 72px); }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.method-grid p { color: var(--ink-soft); font-size: .92rem; }
code { padding: 2px 5px; border-radius: 4px; background: #eef2f0; color: var(--ink); }

footer { padding: 28px 18px 36px; text-align: center; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
footer p { margin: 5px auto; max-width: 900px; }
footer details { margin: 10px auto 0; max-width: 860px; }
footer output { display: block; margin-top: 6px; font-family: ui-monospace, monospace; }

@media (max-width: 1050px) {
  .site-header nav { display: none; }
  .unofficial { margin-left: auto; }
  .start-grid { grid-template-columns: 1fr 1fr; }
  .start-grid > :last-child { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric.primary { grid-column: span 2; }
  .methodology { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { position: static; }
  .site-header .brand strong { font-size: 1.05rem; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .start-grid { grid-template-columns: 1fr; }
  .start-grid > :last-child { grid-column: auto; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .pair-grid, .filters { grid-template-columns: 1fr; }
  .compare-button { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric.primary { grid-column: 1 / -1; }
  .share-actions > * { flex: 1 1 140px; text-align: center; }
  .method-grid { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 520px) {
  main { width: min(100% - 18px, 1240px); margin-top: 10px; }
  .site-header { min-height: 64px; padding: 10px 12px; gap: 8px; }
  .brand span { width: 38px; height: 38px; }
  .brand { gap: 8px; min-width: 0; }
  .site-header .brand strong { font-size: .96rem; }
  .unofficial { font-size: 0; padding: 6px 8px; }
  .unofficial::after { content: "Neoficialu"; font-size: .66rem; }
  .panel { border-radius: 14px; padding: 18px; margin-bottom: 14px; }
  h1 { font-size: 2.35rem; }
  h2 { font-size: 1.7rem; }
  .input-action { grid-template-columns: 1fr; }
  .input-action button { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 120px; padding: 15px 12px; }
  .metric strong { font-size: 1.8rem; }
  .evidence-heading .modes { display: grid; grid-template-columns: repeat(3, 1fr); }
  .evidence-heading .modes button { padding-inline: 7px; font-size: .8rem; }
  .pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pagination span { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
  .error { align-items: stretch; flex-direction: column; }
  .vote-detail-list { grid-template-columns: 1fr; }

  .table-wrap { overflow: visible; border: 0; }
  .responsive-table { min-width: 0; display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
  .responsive-table td { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 10px; padding: 11px 12px; border-bottom: 1px solid #e5ebe9; min-width: 0; overflow-wrap: anywhere; }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .65rem; font-weight: 820; letter-spacing: .05em; text-transform: uppercase; }
  .responsive-table td.question { min-width: 0; }
  .comparison-table td.vote { grid-template-columns: minmax(0, 1fr) auto; white-space: normal; }
  .comparison-table td.vote::before { min-width: 0; overflow-wrap: anywhere; }
  .responsive-table .empty-cell { display: block; text-align: center; }
  .responsive-table .empty-cell::before { content: none; }
}
