:root {
  color-scheme: dark;
  --font-family: Inter, Arial, Helvetica, sans-serif;
  --base-font-size: 16px;
  --shell-width: 1720px;
  --left-col-width: 320px;
  --right-col-width: 320px;
  --radius: 8px;
  --ink: #f1eadf;
  --paper: #0e1014;
  --panel: #171b22;
  --card: #12161d;
  --soft: #241f17;
  --muted: #9aa5b2;
  --line: #303744;
  --red: #ff6258;
  --yellow: #f0c84b;
  --blue: #79a8ff;
  --green: #55d096;
  --inverse: #0f1115;
  --header-bg: rgba(14, 16, 20, 0.94);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #121417;
  --paper: #f5f3ec;
  --panel: #ffffff;
  --card: #ffffff;
  --soft: #fff8dd;
  --muted: #66707b;
  --line: #d7d4c8;
  --red: #d93a2f;
  --yellow: #f0c84b;
  --blue: #1f6feb;
  --green: #1d8f67;
  --inverse: #ffffff;
  --header-bg: rgba(245, 243, 236, 0.94);
  --shadow: 0 8px 24px rgba(18, 20, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-family);
  font-size: var(--base-font-size);
  line-height: 1.45;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.header-inner,
.page-shell {
  width: min(var(--shell-width), calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-mark {
  padding: 3px 8px;
  color: var(--inverse);
  background: var(--ink);
}

.brand-dot {
  color: var(--red);
  font-size: 1.05rem;
}

.site-footer a,
.text-link {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.theme-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.page-shell {
  padding-block: 18px 34px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 14px;
}

.issue-title,
.issue-stats,
.feed-panel,
.rail-card,
.sources-section,
.rules-section article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.issue-title {
  padding: 18px 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.issue-title h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.issue-title p {
  max-width: 920px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
}

.issue-stats {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.issue-stats div {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.issue-stats div:last-child {
  border-bottom: 0;
}

.issue-stats span {
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1;
}

.issue-stats small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 750;
}

.control-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: #121417;
  background: var(--yellow);
}

.control-nav {
  display: flex;
  flex: 1 1 440px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.control-nav a {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(18, 20, 23, 0.38);
  border-radius: 999px;
  color: #121417;
  background: rgba(255, 255, 255, 0.34);
  font-size: 0.82rem;
  font-weight: 950;
  text-decoration: none;
}

.control-nav a:hover {
  border-color: #121417;
  background: #ffffff;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 900;
}

select {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: #ffffff;
  color: #121417;
  font: inherit;
  font-weight: 760;
}

input[type="range"] {
  width: 160px;
  accent-color: var(--red);
}

.snark-control output {
  min-width: 168px;
  color: #121417;
  font-weight: 800;
}

.content-layout {
  display: grid;
  grid-template-columns: var(--left-col-width) minmax(0, 1fr) var(--right-col-width);
  gap: 16px;
  align-items: start;
}

.feed-panel,
.sources-section {
  padding: 16px;
}

.panel-head,
.rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2,
.rail-head h2,
.rules-section h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.05;
}

.panel-counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lead-story {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--soft);
}

.lead-story img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
}

.lead-story h3 {
  margin: 5px 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  line-height: 1.02;
}

.lead-story p {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
}

.lead-story .lead-signature {
  margin-top: 8px;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 900;
}

.meta-line,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag,
.status-pill,
.source-type,
.module-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: #121417;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.news-list {
  display: grid;
  gap: 8px;
}

.news-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.news-card:hover {
  border-color: var(--ink);
}

.news-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.card-copy {
  min-width: 0;
}

.category {
  color: var(--red);
  font-weight: 950;
}

.news-card h3 {
  margin: 4px 0 4px;
  font-size: 1.05rem;
  line-height: 1.13;
}

.news-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.source-line {
  margin-top: 6px !important;
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700;
}

.admin-signature {
  margin-top: 5px !important;
  color: var(--red) !important;
  font-size: 0.78rem !important;
  font-weight: 900;
}

.score {
  justify-self: end;
  min-width: 56px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--inverse);
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.left-rail,
.right-rail {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 74px;
}

.rail-card {
  padding: 14px;
}

.rail-intro {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.module-list,
.event-list,
.discussion-list,
.source-list {
  display: grid;
  gap: 8px;
}

.contact-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--inverse);
  background: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
  text-decoration: none;
}

.contact-link::after {
  content: "↗";
  font-weight: 950;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.feedback-form {
  display: grid;
  gap: 8px;
}

.feedback-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 0.86rem;
}

.feedback-form input {
  min-height: 34px;
  padding: 0 9px;
}

.feedback-form textarea {
  min-height: 94px;
  padding: 8px 9px;
  resize: vertical;
}

.feedback-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.feedback-actions button {
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: #121417;
  background: var(--yellow);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.feedback-actions button:hover {
  background: var(--green);
}

.module-card,
.event-card,
.discussion-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.module-card {
  position: relative;
  padding: 12px 12px 12px 16px;
  overflow: hidden;
}

.module-image-link {
  display: block;
  margin: 0 0 10px;
  text-decoration: none;
}

.module-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.module-card.level-open::before {
  background: var(--green);
}

.module-card.level-warn::before {
  background: var(--yellow);
}

.module-card.level-closed::before {
  background: var(--red);
}

.module-card h3,
.event-card h3,
.source-card h3 {
  margin: 7px 0 5px;
  font-size: 0.98rem;
  line-height: 1.15;
}

.module-card p,
.event-card p,
.source-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
}

.module-updated,
.module-note,
.event-card time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.event-card {
  padding: 10px;
}

.event-card time {
  margin: 0 0 5px;
  color: var(--green);
  text-transform: uppercase;
}

.ring-rail {
  border-color: var(--red);
}

.discussion-card {
  padding: 10px;
  border-left: 4px solid var(--red);
}

.discussion-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.discussion-meta strong {
  padding: 2px 6px;
  border-radius: 999px;
  color: #121417;
  background: var(--yellow);
  white-space: nowrap;
}

.discussion-card h3 {
  margin: 7px 0 5px;
  font-size: 0.96rem;
  line-height: 1.14;
}

.discussion-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.discussion-source {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.sources-section,
.rules-section {
  margin-top: 16px;
}

.source-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-card {
  min-height: 142px;
  padding: 10px;
}

.source-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
  word-break: break-word;
}

.rules-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rules-section article {
  padding: 14px;
}

.rules-section p {
  margin: 8px 0 0;
  color: var(--ink);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 18px 20px;
  color: var(--inverse);
  background: var(--ink);
  font-weight: 760;
}

@media (max-width: 1180px) {
  .masthead,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .issue-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .issue-stats div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .issue-stats div:last-child {
    border-right: 0;
  }

  .left-rail,
  .right-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .header-inner,
  .page-shell {
    width: min(100% - 24px, var(--shell-width));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 0;
  }

  .issue-stats,
  .left-rail,
  .right-rail,
  .source-list,
  .rules-section {
    grid-template-columns: 1fr;
  }

  .news-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .news-card img {
    width: 56px;
    height: 56px;
  }

  .score {
    justify-self: start;
    grid-column: 2;
  }

  .lead-story {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .lead-story img {
    width: 84px;
    height: 84px;
  }
}

@media (max-width: 540px) {
  .control-band,
  .control-row {
    align-items: stretch;
    flex-direction: column;
  }

  select,
  input[type="range"],
  .snark-control output {
    width: 100%;
  }

  .lead-story {
    grid-template-columns: 1fr;
  }

  .lead-story img {
    width: 100%;
    height: 150px;
  }
}
