:root {
  --ink: #15201e;
  --ink-soft: #53605d;
  --paper: #f5f3ed;
  --surface: #ffffff;
  --surface-muted: #eceee9;
  --line: #d8ddd7;
  --jade-950: #092d2a;
  --jade-900: #0c3935;
  --jade-800: #14524b;
  --jade-700: #1c685f;
  --jade-100: #dcebe6;
  --jade-50: #edf5f2;
  --red: #b23a32;
  --red-dark: #8c2924;
  --amber: #9d6412;
  --shadow-sm: 0 1px 2px rgb(18 39 34 / 8%);
  --shadow-md: 0 12px 35px rgb(18 39 34 / 9%);
  --radius: 8px;
  --radius-lg: 14px;
  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--red-dark);
  border-radius: 5px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #de8b25;
  outline-offset: 3px;
}

.site-header {
  color: white;
  background: var(--jade-950);
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: white;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 40%);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: -0.04em;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.15;
}

.brand-subtitle {
  margin-top: 2px;
  color: #bed2cd;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d7e5e1;
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #6ec29b;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(110 194 155 / 14%);
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-secondary {
  color: white;
  background: transparent;
  border-color: rgb(255 255 255 / 38%);
}

.button-secondary:hover {
  background: rgb(255 255 255 / 9%);
  border-color: rgb(255 255 255 / 65%);
}

.button-primary {
  color: white;
  background: var(--jade-800);
}

.button-primary:hover {
  background: var(--jade-900);
}

.button-reset {
  align-self: end;
  color: var(--jade-800);
  background: transparent;
  border-color: var(--line);
}

.button-reset:hover {
  background: var(--jade-50);
  border-color: var(--jade-700);
}

.hero {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 83% 25%, rgb(41 114 103 / 55%) 0, transparent 29%),
    linear-gradient(120deg, var(--jade-950), #0e403b 68%, #154a44);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(90deg, transparent 49.9%, rgb(255 255 255 / 10%) 50%, transparent 50.1%);
  background-size: 92px 100%;
}

.hero-grid {
  position: relative;
  z-index: 1;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  align-items: center;
  gap: 80px;
  padding-block: 66px 88px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #a9cbc3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  margin-inline: 5px;
  color: var(--red);
}

.eyebrow-dark {
  margin-bottom: 7px;
  color: var(--jade-700);
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.16;
}

h1 {
  max-width: 680px;
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 68px);
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: #d2e2de;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.58;
}

.update-line {
  margin: 24px 0 0;
  color: #afcbc5;
  font-size: 13px;
  font-weight: 650;
}

.update-line .stale {
  margin-left: 8px;
  padding: 3px 7px;
  color: #ffe0a8;
  background: rgb(157 100 18 / 30%);
  border: 1px solid rgb(255 224 168 / 32%);
  border-radius: 99px;
}

.lens-card {
  padding: 25px 26px 27px;
  background: rgb(255 255 255 / 7%);
  border-top: 3px solid var(--red);
  border-right: 1px solid rgb(255 255 255 / 16%);
  border-bottom: 1px solid rgb(255 255 255 / 16%);
  border-left: 1px solid rgb(255 255 255 / 16%);
  backdrop-filter: blur(3px);
}

.lens-label {
  margin: 0 0 11px;
  color: #a9cbc3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lens-card h2 {
  margin-bottom: 12px;
  font-size: 25px;
}

.lens-card p:last-child {
  margin: 0;
  color: #c8ddd8;
  font-size: 14px;
}

.dashboard-shell {
  position: relative;
  z-index: 2;
  margin-top: -42px;
  padding-bottom: 72px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.metric-card {
  min-width: 0;
  padding: 23px 26px 22px;
}

.metric-card + .metric-card {
  border-left: 1px solid var(--line);
}

.metric-label,
.metric-note {
  display: block;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  min-height: 45px;
  margin: 7px 0 1px;
  color: var(--jade-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
}

.metric-value-small {
  display: flex;
  align-items: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
}

.metric-note {
  color: #69736f;
  font-size: 12px;
}

.notice {
  margin-top: 22px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  color: #583b0c;
  background: #fff5df;
  border: 1px solid #e9cb8c;
  border-radius: var(--radius);
}

.notice-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--amber);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
}

.notice p {
  margin: 2px 0 0;
  font-size: 14px;
}

.ranking-section {
  margin-top: 51px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(31px, 4vw, 42px);
  letter-spacing: -0.025em;
}

.result-count {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(145px, 0.65fr)) auto;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin: 0 0 6px;
  color: #4b5754;
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  color: var(--ink);
  background: white;
  border: 1px solid #bac3be;
  border-radius: 5px;
}

.field select {
  padding: 0 34px 0 11px;
}

.search-control {
  position: relative;
}

.search-control svg {
  position: absolute;
  top: 12px;
  left: 12px;
  color: #697470;
  pointer-events: none;
}

.field .search-control input {
  padding: 0 12px 0 40px;
}

.field input:hover,
.field select:hover {
  border-color: var(--jade-700);
}

.ranking-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ranked-news;
}

.news-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 23px;
  margin-bottom: 15px;
  padding: 26px 28px 25px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--jade-800);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.news-card:hover {
  border-color: #aab9b3;
  border-left-color: var(--red);
  box-shadow: 0 7px 25px rgb(18 39 34 / 8%);
  transform: translateY(-1px);
}

.rank-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.rank-number {
  color: #697570;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.score-ring {
  --score-color: var(--jade-700);
  --score-angle: 0deg;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--score-color) var(--score-angle), #e3e8e4 var(--score-angle));
  border-radius: 50%;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: white;
  border-radius: 50%;
}

.score-number {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.score-scale {
  margin-top: -3px;
  color: #7b8581;
  font-size: 10px;
  font-weight: 700;
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  margin-bottom: 10px;
  color: #65716d;
  font-size: 12px;
  font-weight: 650;
}

.lane-label {
  padding: 3px 7px;
  color: var(--jade-900);
  background: var(--jade-100);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.priority-label {
  color: var(--red-dark);
}

.card-title {
  margin-bottom: 11px;
  font-size: clamp(22px, 2.5vw, 29px);
  letter-spacing: -0.015em;
}

.card-title a {
  color: var(--ink);
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.card-title a:hover {
  color: var(--jade-700);
  text-decoration-color: currentColor;
}

.card-summary {
  max-width: 920px;
  margin: 0 0 15px;
  color: #46514e;
  font-size: 15px;
  line-height: 1.65;
}

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

.tag {
  padding: 4px 8px;
  color: #46534f;
  background: #f0f2ef;
  border: 1px solid #e0e4df;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 650;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #e5e8e4;
}

.source-row {
  color: #65716d;
  font-size: 12px;
}

.source-row strong {
  color: #46514e;
}

.source-chip::before {
  content: "";
  width: 4px;
  height: 4px;
  display: inline-block;
  margin: 0 7px 2px 1px;
  background: var(--red);
  border-radius: 50%;
}

.analysis-details {
  margin-top: 15px;
  border-top: 1px solid #e5e8e4;
}

.analysis-details > summary {
  width: fit-content;
  margin-top: 13px;
  color: var(--jade-700);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.analysis-details > summary:hover {
  color: var(--red-dark);
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr);
  gap: 30px;
  margin-top: 17px;
  padding: 19px;
  background: #f6f7f5;
  border-radius: 5px;
}

.details-heading {
  margin: 0 0 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.reason-list,
.coverage-list {
  margin: 0;
  padding-left: 18px;
  color: #46514e;
  font-size: 13px;
}

.reason-list li + li,
.coverage-list li + li {
  margin-top: 7px;
}

.coverage-list a {
  color: var(--jade-700);
  font-weight: 650;
  text-underline-offset: 2px;
}

.coverage-date {
  color: #77817d;
  white-space: nowrap;
}

.score-breakdown {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 14px;
  color: #46514e;
  font-size: 12px;
}

.score-breakdown dt,
.score-breakdown dd {
  margin: 0;
}

.score-breakdown dd {
  font-weight: 800;
}

.state-panel {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed #b8c0bc;
  border-radius: var(--radius);
}

.state-panel p {
  margin: 6px 0 16px;
  color: var(--ink-soft);
}

.state-error {
  color: #6d2420;
  background: #fff7f5;
  border-color: #d7a9a5;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--jade-100);
  border-top-color: var(--jade-700);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.site-footer {
  padding: 38px 0;
  color: #c4d5d1;
  background: var(--jade-950);
  border-top: 4px solid var(--red-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 70px;
}

.site-footer strong {
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.site-footer p {
  margin: 6px 0 0;
  font-size: 13px;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr minmax(260px, 0.65fr);
    gap: 35px;
  }

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

  .metric-card:nth-child(3) {
    border-left: 0;
  }

  .metric-card:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .filter-bar {
    grid-template-columns: 1.4fr repeat(2, 1fr);
  }

  .field:last-of-type {
    grid-column: 1 / 2;
  }

  .button-reset {
    align-self: end;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-subtitle,
  .local-badge {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .button-secondary {
    padding-inline: 10px;
    font-size: 12px;
  }

  .hero-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-block: 48px 75px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 57px);
  }

  .lens-card {
    max-width: none;
  }

  .dashboard-shell {
    margin-top: -31px;
  }

  .metric-card {
    padding: 19px 17px;
  }

  .metric-value {
    font-size: 29px;
  }

  .metric-value-small {
    font-size: 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .field-search {
    grid-column: 1 / -1;
  }

  .field:last-of-type {
    grid-column: auto;
  }

  .button-reset {
    width: 100%;
  }

  .news-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 21px 19px;
  }

  .rank-column {
    align-items: center;
    flex-direction: row;
  }

  .score-ring {
    width: 52px;
    height: 52px;
  }

  .score-ring::after {
    inset: 4px;
  }

  .score-number {
    font-size: 18px;
  }

  .score-scale {
    margin: 0;
  }

  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .details-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 23px;
  }
}

@media (max-width: 460px) {
  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .metric-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .metric-card + .metric-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .field-search,
  .field:last-of-type {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .filter-bar,
  .site-footer,
  .button,
  .analysis-details {
    display: none !important;
  }

  .hero {
    color: var(--ink);
    background: white;
  }

  .hero-copy,
  .update-line,
  .eyebrow {
    color: var(--ink-soft);
  }

  .hero-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    padding-block: 20px;
  }

  .lens-card {
    display: none;
  }

  .dashboard-shell {
    margin-top: 0;
  }

  .news-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
