:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --bg-top: rgba(255, 255, 255, 0.84);
  --bg-bottom: rgba(246, 247, 243, 0.94);
  --grid-line: rgba(23, 111, 95, 0.05);
  --panel: #ffffff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-hover: #fbfdfb;
  --panel-soft: #eef3ef;
  --ink: #17211e;
  --muted: #64716b;
  --line: #d9e0d9;
  --green: #176f5f;
  --blue: #245f9f;
  --amber: #a76813;
  --red: #a64036;
  --violet: #6b568f;
  --shadow: 0 10px 26px rgba(25, 37, 32, 0.06);
  --brand-bg: #e7f0eb;
  --brand-border: #2e7569;
  --input-border: #c7d1c9;
  --focus-ring: rgba(23, 111, 95, 0.14);
  --button-border: #b7c2bb;
  --chip-bg: #fbfcfa;
  --chip-border: #c8d4cc;
  --chip-active-bg: #e8f3ef;
  --source-bg: #edf1f6;
  --metric-bg: #fbfcfa;
  --metric-border: #d5ddd6;
  --post-text: #34403b;
  --section-line: #edf1ed;
  --judgement-bg: #f1f8f5;
  --judgement-border: #bad0c6;
  --meta-dot: #a0aaa4;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1110;
  --bg-top: rgba(16, 23, 22, 0.96);
  --bg-bottom: rgba(8, 11, 12, 0.98);
  --grid-line: rgba(76, 197, 167, 0.06);
  --panel: #111a18;
  --surface: rgba(17, 25, 24, 0.95);
  --surface-strong: rgba(18, 27, 26, 0.98);
  --surface-hover: #15211f;
  --panel-soft: #15231f;
  --ink: #e8f0ed;
  --muted: #95a39d;
  --line: #293835;
  --green: #4cc5a7;
  --blue: #78aee8;
  --amber: #d5a04a;
  --red: #e07d73;
  --violet: #b49ad9;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  --brand-bg: #132420;
  --brand-border: #376f64;
  --input-border: #31413d;
  --focus-ring: rgba(76, 197, 167, 0.16);
  --button-border: #374a45;
  --chip-bg: #121d1b;
  --chip-border: #33443f;
  --chip-active-bg: #13312b;
  --source-bg: #162437;
  --metric-bg: #121d1b;
  --metric-border: #33443f;
  --post-text: #cad5d1;
  --section-line: #24332f;
  --judgement-bg: #13241f;
  --judgement-border: #315b52;
  --meta-dot: #64756f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom)),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 88px);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.not-found-shell {
  display: grid;
  gap: 14px;
  max-width: 620px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 120px 24px;
  align-content: center;
}

.not-found-shell h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.not-found-shell p {
  margin: 0;
  color: var(--muted);
}

.not-found-shell .text-link {
  width: fit-content;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: var(--brand-bg);
}

.brand-mark span {
  width: 24px;
  height: 24px;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 5px var(--brand-bg),
    inset 0 0 0 7px rgba(36, 95, 159, 0.6);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.05;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
}

h3 {
  font-size: 17px;
  line-height: 1.35;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.text-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.text-button.muted {
  width: 100%;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 920px);
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 28px 28px;
}

.control-rail,
.main-feed {
  min-width: 0;
}

.control-rail,
.feed-header,
.article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-rail {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 16px;
}

.rail-section + .rail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rail-section label,
.rail-section h2 {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
}

.rail-section input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

.rail-section input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chip-grid {
  display: grid;
  gap: 8px;
}

.chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.chip.active {
  border-color: var(--green);
  background: var(--chip-active-bg);
  color: var(--green);
}

.feed-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
  padding: 16px 18px;
}

.feed-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-card {
  display: block;
  padding: 16px;
  box-shadow: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: var(--green);
  background: var(--surface-hover);
}

.article-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.article-main {
  min-width: 0;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.source-pill,
.verdict-pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.source-pill {
  background: var(--source-bg);
  color: var(--blue);
}

.verdict-pill {
  color: #ffffff;
}

.verdict-Adopt {
  background: var(--green);
}

.verdict-Watch {
  background: var(--blue);
}

.verdict-Experiment {
  background: var(--violet);
}

.verdict-Avoid {
  background: var(--red);
}

.verdict-Ignore {
  background: #69736d;
}

.article-card h3 {
  margin-bottom: 8px;
}

.article-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.comparison-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.metric-pill {
  border: 1px solid var(--metric-border);
  background: var(--metric-bg);
  color: var(--muted);
}

.impact-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.impact-gauge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 54%, transparent 55%),
    conic-gradient(var(--green) var(--impact), var(--section-line) 0);
  box-shadow: inset 0 0 0 1px var(--metric-border);
}

.impact-gauge span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.news-post {
  padding: 16px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.back-link {
  min-height: 30px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.post-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.post-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.post-title-line h3 {
  font-size: 21px;
  line-height: 1.35;
}

.post-title-line a {
  color: var(--ink);
  text-decoration: none;
}

.post-title-line a:hover {
  color: var(--green);
  text-decoration: underline;
}

.post-domain {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.post-meta,
.post-verdict-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--meta-dot);
}

.post-verdict-row {
  margin-top: 10px;
}

.post-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--section-line);
}

.post-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.post-section h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.post-section p,
.post-section li {
  color: var(--post-text);
  font-size: 15px;
  line-height: 1.72;
}

.post-section ul {
  margin: 0;
  padding-left: 18px;
}

.post-section li + li {
  margin-top: 5px;
}

.source-materials {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.source-materials li {
  padding: 10px;
  border: 1px solid var(--metric-border);
  border-radius: 8px;
  background: var(--metric-bg);
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: var(--meta-dot);
}

.source-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--source-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.source-materials a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.source-materials a:hover {
  color: var(--green);
  text-decoration: underline;
}

.source-materials p {
  margin-top: 6px;
}

.source-url {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.judgement-box {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--judgement-border);
  border-radius: 8px;
  background: var(--judgement-bg);
}

.judgement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.judgement-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--metric-border);
  border-radius: 8px;
  background: var(--metric-bg);
}

.judgement-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.judgement-grid dd {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.ad-slot {
  padding: 12px;
  border: 1px dashed var(--button-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, var(--amber) 14%);
}

.ad-slot span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-bottom: 7px;
  padding: 0 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 75%, var(--amber) 25%);
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.ad-slot p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.feed-ad {
  box-shadow: none;
}

.section-title {
  margin-bottom: 14px;
}

.matrix-list {
  display: grid;
  gap: 12px;
}

.matrix-item {
  display: grid;
  gap: 6px;
}

.matrix-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.matrix-head span:last-child {
  color: var(--muted);
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--section-line);
}

.bar span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.sponsor-label {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f1e4c8;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer {
  padding: 8px 28px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.static-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 24px;
}

.trust-page {
  display: grid;
  gap: 24px;
}

.trust-page header {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--section-line);
}

.trust-page header p,
.trust-page section p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.72;
}

.trust-page section {
  display: grid;
  gap: 10px;
}

.trust-page h1 {
  color: var(--ink);
  font-size: 34px;
  line-height: 1.16;
}

.trust-page h2 {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 16px;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .control-rail {
    position: static;
  }

  .feed-header {
    align-items: start;
    flex-direction: column;
  }

  .feed-meta {
    text-align: left;
  }

  .article-card {
    padding: 17px;
  }

  .article-card p {
    font-size: 15px;
    line-height: 1.62;
  }

  .news-post {
    padding: 18px;
    overflow-wrap: anywhere;
  }

  .post-title-line {
    display: block;
  }

  .post-title-line h3 {
    font-size: 20px;
    line-height: 1.42;
  }

  .post-domain {
    display: inline-block;
    margin-top: 6px;
  }

  .post-section {
    padding: 16px 0;
  }

  .post-section h4 {
    margin-bottom: 10px;
    font-size: 15px;
  }

  .post-section p,
  .post-section li {
    font-size: 15px;
    line-height: 1.76;
  }

  .source-materials li {
    padding: 12px;
  }

  .site-footer {
    padding: 6px 16px 22px;
  }

  .judgement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {
  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: 17px;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .text-button {
    justify-content: center;
    width: 100%;
  }

  .workspace {
    padding: 10px;
  }

  .feed-header,
  .control-rail,
  .article-card,
  .news-post {
    box-shadow: none;
  }

  .post-meta span + span::before {
    content: none;
    margin-right: 0;
  }

  .judgement-grid {
    grid-template-columns: 1fr;
  }
}
