/* ---------- Tokens ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6760;
  --line: #e4e0d7;
  --accent: #0b5cad;
  --seg-off: #e9e5dc;
  --ok: #2b8a3e;
  --warn: #c77700;
  --bad: #c92a2a;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Headlines: Trade Gothic where available (installed, or licensed web-font files added in /fonts; see README),
     otherwise Archivo, a free grotesque with a similar feel. */
  --headline: "Trade Gothic Next", "Trade Gothic LT Std", "Trade Gothic", Archivo, "Helvetica Neue", Arial, sans-serif;
  /* Story meta lines, outlet names and summaries. */
  --meta: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131312;
    --surface: #1c1c1a;
    --text: #ecebe7;
    --muted: #a19d94;
    --line: #2f2e2b;
    --accent: #74b3f0;
    --seg-off: #2c2b28;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131312; --surface: #1c1c1a; --text: #ecebe7; --muted: #a19d94;
  --line: #2f2e2b; --accent: #74b3f0; --seg-off: #2c2b28; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--headline); line-height: 1.2; margin: 0; letter-spacing: -0.005em; }

/* Story meta (category · outlets · owners · time), outlet names and summaries, on cards and story pages. */
.story-meta, .story-summary, .story-foot, .matched-from, .near-label,
.story-header > p, .headline-meta, .headline > p, .also-ran, .shared-note, .closest { font-family: var(--meta); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: auto; height: 28px; flex: none; color: var(--text); }
.nav { display: flex; gap: 18px; font-size: 14px; font-weight: 500; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Intro + toolbar ---------- */
.intro { padding: 32px 0 16px; }
.intro > h1, .intro > .lede { max-width: 720px; }
.intro h1 { font-size: clamp(26px, 4vw, 36px); }
.lede { color: var(--muted); font-size: 16px; margin: 10px 0 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-top: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { padding: 10px 12px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.owner-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; }
/* Owner picker: a dropdown of owner checkboxes. */
.owner-picker { position: relative; }
.owner-picker summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.owner-picker summary::-webkit-details-marker { display: none; }
.owner-picker summary::after { content: "▾"; color: var(--muted); font-size: 12px; }
.owner-picker[open] summary { border-color: var(--text); }
.owner-picker-value { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.owner-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 250px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.owner-option { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.owner-option:hover { background: var(--bg); }
.owner-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--text); }
.owner-option .chip { color: var(--text); font-size: 13.5px; }
.owner-menu-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; }
.owner-menu-actions:not(:has(a, button)) { display: none; }
.owner-menu-actions button { font: inherit; font-weight: 500; color: var(--surface); background: var(--text); border: 0; border-radius: 7px; padding: 6px 14px; cursor: pointer; }
.legend-item.chosen { outline: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 2px 9px; margin: -2px -9px; }
.legend-item.chosen .chip { color: var(--text); font-weight: 600; }
.local-only { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.local-only input { width: 15px; height: 15px; margin: 0; accent-color: var(--text); }
.owner-filter select, .owner-filter button {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 14px 0 4px; }
.legend-item:hover { text-decoration: none; }
.legend-item:hover .chip { color: var(--text); }
.status-line { margin: 10px 0 14px; }

/* ---------- Search ---------- */
.search { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.search input:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.search button { font: inherit; font-size: 14px; font-weight: 500; color: var(--surface); background: var(--text); border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.search .clear { font-size: 14px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
mark { background: #ffe58f; color: inherit; border-radius: 2px; padding: 0 1px; }
:root[data-theme="dark"] mark { background: #6b5a12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark { background: #6b5a12; } }
.matched-from { margin: 2px 0 0; }

/* ---------- Near me ---------- */
.near { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; }
.near-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.near-status .pin { margin-right: -4px; }
.near-status .near-action { font-size: 13px; }
.near-msg { flex-basis: 100%; margin: 0; }

/* ---------- Area map (choose your area: click a state, then an area) ---------- */
.area-map { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-family: var(--meta); }
.area-map-canvas { position: relative; }
.area-map svg { display: block; width: 100%; aspect-ratio: 1000 / 922; max-height: 380px; margin: 0 auto; --u: 1; }
.area-map svg g[hidden] { display: none; } /* SVG ignores the hidden attribute by itself */
.area-map .state { fill: var(--seg-off); stroke: var(--surface); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: round;
  cursor: pointer; transition: fill .15s, opacity .25s; }
.area-map .state:hover { fill: color-mix(in srgb, var(--accent) 35%, var(--seg-off)); }
.area-map .state.current { fill: color-mix(in srgb, var(--accent) 22%, var(--seg-off)); }
.area-map .state.empty { cursor: default; }
.area-map .state.empty:hover { fill: var(--seg-off); }
.area-map.zoomed .state { opacity: .4; }
.area-map.zoomed .state.active { opacity: 1; fill: color-mix(in srgb, var(--accent) 14%, var(--seg-off)); cursor: default; }
.area-map .state-label { font: 600 calc(13px * var(--u)) var(--headline); fill: var(--muted); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.area-map.zoomed .state-label { display: none; }
.act-callout { cursor: pointer; }
.act-callout line { stroke: var(--muted); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.act-callout circle { fill: var(--seg-off); stroke: var(--muted); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.act-callout:hover circle { fill: color-mix(in srgb, var(--accent) 35%, var(--seg-off)); }
.act-callout text { font: 600 calc(12px * var(--u)) var(--headline); fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.area-map.zoomed .act-callout { display: none; }
.region-dot circle { r: calc(6px * var(--u)); fill: var(--accent); stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; cursor: pointer; transition: r .12s; }
.region-dot:hover circle, .region-dot:focus circle, .region-dot.hover circle { r: calc(9px * var(--u)); }
.region-dot.current circle { fill: var(--ok); }
.region-dot:focus { outline: none; }
.region-dot:focus-visible circle { stroke: var(--text); }
.area-map-tip { position: absolute; transform: translate(-50%, calc(-100% - 8px)); margin: 0; padding: 3px 8px; border-radius: 6px;
  background: var(--text); color: var(--surface); font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.area-panel h3 { font-size: 17px; margin: 0 0 4px; }
.area-panel > p { margin: 0 0 10px; }
.state-list, .region-list { list-style: none; margin: 0; padding: 0; }
.state-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.state-button { width: 100%; display: flex; justify-content: space-between; gap: 6px; text-align: left; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.state-button:hover:not(:disabled) { border-color: var(--accent); }
.state-button.current { border-color: var(--accent); }
.state-button:disabled { opacity: .5; cursor: default; }
a.state-button { text-decoration: none; }
a.state-button:hover { text-decoration: none; }
a.state-button .muted { font-size: 12px; text-align: right; }
.map-back { font: inherit; font-size: 13.5px; color: var(--accent); background: none; border: 0; padding: 0; margin: 0 0 6px; cursor: pointer; }
.region-list { max-height: 300px; overflow-y: auto; columns: 2; column-gap: 12px; }
.region-list li { break-inside: avoid; }
.region-list a { display: block; padding: 3px 6px; border-radius: 6px; font-size: 13.5px; }
.region-list a.hover, .region-list a:hover { background: var(--bg); }
.region-list a.current { font-weight: 600; color: var(--ok); }
.area-noscript summary { cursor: pointer; padding: 4px 0; }
@media (max-width: 720px) {
  .area-map { grid-template-columns: 1fr; }
  .area-map svg { max-height: 320px; }
}
.near-msg:empty { display: none; }
.near-label { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ok); }
.near-label.state { color: var(--muted); font-weight: 500; }

/* ---------- Owner profiles ---------- */
.owner-link:hover { text-decoration: none; }
.owner-link:hover .chip { color: var(--text); text-decoration: underline; }
.profile-header { padding: 8px 0 4px; }
.profile-header h1 { display: flex; align-items: center; gap: 12px; font-size: clamp(26px, 4vw, 36px); }
.profile-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); flex: none; }
.profile-h { font-size: 18px; margin: 28px 0 10px; }
.profile-h.small-h { font-size: 15px; }
.profile-about { max-width: 720px; }
.profile-quote { margin: 0 0 12px; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); font-family: var(--serif, Georgia, serif); font-size: 18px; line-height: 1.5; }
.profile-quote p { margin: 0 0 6px; }
.profile-quote footer { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.profile-stats { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 24px 0 4px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-stats > div { display: flex; flex-direction: column; }
.profile-stats .stat { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.profile-window { flex-basis: 100%; margin: 0; }
.profile-outlets { max-width: 900px; }
.profile-inactive { margin: 0; padding-left: 18px; font-size: 14px; }

/* ---------- Categories ---------- */
.categories { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 0; }
.cat { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--muted); background: var(--surface); }
.cat:hover { color: var(--text); text-decoration: none; }
.cat.active { color: var(--surface); background: var(--text); border-color: var(--text); }
.cat .count { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 2px; }
.categories.subs { padding-top: 8px; }
.cat.sub { font-size: 13px; padding: 3px 10px; }
.cat-label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0; }
a.cat-label:hover { color: var(--text); text-decoration: none; }

/* ---------- Owner chip ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; font-family: var(--sans); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- Coverage strip ---------- */
.coverage { display: flex; gap: 3px; margin: 12px 0 10px; }
.seg { height: 6px; flex: 1; border-radius: 3px; }
.seg.on { background: var(--c); }
.seg.off { background: var(--seg-off); }

/* ---------- Featured space (breaking + most written about) ---------- */
.featured { margin: 22px 0 6px; padding: 16px 18px 18px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--text); border-radius: var(--radius); }
.featured-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.featured-sub { font-family: var(--meta); font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.breaking-label { display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--bad); border-radius: 4px; padding: 2px 7px; vertical-align: 2px; }
.breaking { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; padding: 10px 12px; margin: 0 0 12px;
  border-left: 4px solid var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); border-radius: 6px; }
.breaking-headline { font-size: 20px; margin: 0; }
.breaking-headline a, .featured-headline a { color: var(--text); }
.breaking-meta { grid-column: 2; margin: 0; font-family: var(--meta); font-size: 12.5px; color: var(--muted); }
.featured-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
/* The rank number is the featured stories' visual (no photos: see About). Underlined in the lead outlet's owner colour. */
.featured-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.featured-card.hero { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; gap: 26px; padding: 4px 0 14px; border-top: 0; }
.featured-rank { font-family: var(--headline); font-size: 84px; font-weight: 700; line-height: .82; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  color: var(--text); padding-bottom: 8px; border-bottom: 5px solid var(--c, var(--line)); align-self: flex-start; }
.featured-card.hero .featured-rank { font-size: 170px; line-height: .8; padding-bottom: 12px; border-bottom-width: 8px; }
.featured-body { min-width: 0; flex: 1; }
.featured-meta { margin: 0 0 4px; font-family: var(--meta); font-size: 12px; color: var(--muted); }
.featured-meta .breaking-label { margin-right: 4px; }
.featured-headline { font-size: 16px; }
.featured-card.hero .featured-headline { font-size: 28px; line-height: 1.15; }
.featured-card .coverage { margin: 8px 0 6px; }
@media (max-width: 900px) { .featured-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .featured-list { grid-template-columns: 1fr; }
  .featured-card.hero .featured-headline { font-size: 22px; }
  .featured-card.hero { gap: 16px; }
  .featured-card.hero .featured-rank { font-size: 96px; border-bottom-width: 6px; }
  .featured-card:not(.hero) { flex-direction: row; gap: 14px; }
  .featured-rank { font-size: 56px; }
  .breaking { grid-template-columns: 1fr; }
  .breaking-meta { grid-column: 1; }
}

/* ---------- Story cards ---------- */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.story { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.story-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.story-title { font-size: 19px; }
.story-title a { color: var(--text); }
.story-summary { color: var(--muted); font-size: 14px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.compare { font-size: 13px; font-weight: 600; white-space: nowrap; }
.foot-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
/* Paywall marker: amber outline pill with a padlock. */
.paywall { display: inline-flex; align-items: center; gap: 3px; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--warn); border: 1px solid currentColor; border-radius: 99px; padding: 0 6px 0 5px; line-height: 16px; white-space: nowrap; vertical-align: 1px; }
.paywall svg { flex: none; }
.paywall-summary { margin: 6px 0 0; }
.paywall-summary .muted { display: block; margin-top: 2px; }

.empty { text-align: center; padding: 64px 16px; }
.empty h1, .empty h2 { margin-bottom: 8px; }

/* ---------- Story detail ---------- */
.crumb { margin: 20px 0 0; font-size: 14px; }
.story-header { padding: 16px 0 20px; max-width: 820px; }
.story-header h1 { font-size: clamp(24px, 3.5vw, 32px); margin-bottom: 10px; }
.story-header .coverage .seg { height: 8px; }
.not-covered { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; margin: 6px 0 0; }

.owner-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.owner-col { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.owner-col h2 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.owner-col h2 .chip { font-size: 14px; color: var(--text); font-weight: 600; }
.headline { padding: 12px 0; border-top: 1px solid var(--line); }
.headline:first-of-type { border-top: 0; }
.headline-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.headline-meta .source { font-weight: 600; color: var(--text); }
.headline-meta .location { font-weight: 400; color: var(--muted); }
.headline-meta .location::before { content: "· "; }
/* A headline several outlets of one owner ran (network stories): the other outlets as compact rows. */
.closest { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--ok); }
.also-ran { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.also-ran li { padding: 4px 0; border-top: 1px dashed var(--line); }
.also-ran li a { font-weight: 600; }
.shared-note { margin: 8px 0 0; }
.more-outlets { margin-top: 4px; font-size: 13px; }
.more-outlets summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 2px 0; }
.headline h3 { font-size: 17px; margin: 4px 0; }
.headline h3 a { color: var(--text); }
.headline p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Sources ---------- */
.owners { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; padding-top: 8px; }
.owner-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 16px; min-width: 0; }
.owner-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.owner-card h2 .chip { font-size: 16px; color: var(--text); font-weight: 600; }
.owner-card > p { margin: 6px 0; }
.share { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.share-bar { flex: 1; height: 8px; background: var(--seg-off); border-radius: 4px; overflow: hidden; }
.share-bar span { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.share-num { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; white-space: nowrap; }

.feeds { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.feeds th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 6px 4px 0; }
.feeds td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.feeds .num { text-align: right; font-variant-numeric: tabular-nums; }
.ownership-summary { margin-top: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ownership-summary p { margin: 0; }
.ownership-summary .review-title { margin-top: 6px; font-weight: 600; color: var(--warn); }
.review-list { margin: 4px 0 0; padding-left: 18px; }
.feeds tr.disabled td { color: var(--muted); }
.feeds tr.note-row td { font-size: 12px; color: var(--muted); padding-top: 0; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: currentColor; }
.badge.warn { color: var(--warn); border-color: currentColor; }
.badge.bad { color: var(--bad); border-color: currentColor; }
.badge.check { padding: 1px 6px; }

/* ---------- About ---------- */
.prose { max-width: 680px; padding-top: 32px; }
.prose h1 { font-size: 32px; margin-bottom: 16px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose li { margin: 4px 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0; background: var(--surface); }

@media (max-width: 420px) {
  .stories, .owner-columns, .owners { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
}

/* ---------- Filter transitions ----------
   Moving between front-page views (filters, tabs, search) is a normal page load. With the View
   Transitions API the browser animates between the two pages: each story card is named after its
   story (_StoryCard.cshtml), so a card on both pages slides to its new position, cards that drop out
   fade away and new ones fade in. Browsers without support just change the page as before. */
@view-transition { navigation: auto; }

.story { view-transition-class: story-card; }

::view-transition-group(*.story-card) {
  animation-duration: .42s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}
/* A card leaving the list, or arriving in it. */
::view-transition-old(*.story-card):only-child { animation: story-leave .22s ease-in both; }
::view-transition-new(*.story-card):only-child { animation: story-enter .32s .08s ease-out both; }
/* Everything else (counts, tabs) cross-fades quickly. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@keyframes story-leave { to { opacity: 0; transform: scale(.96); } }
@keyframes story-enter { from { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Welcome (landing) page ---------- */
.button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; text-decoration: none; }
.button:hover { border-color: var(--text); text-decoration: none; }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.primary:hover { opacity: .88; }
.welcome-hero { padding: 56px 0 28px; max-width: 860px; }
.welcome-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.welcome-hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -.015em; }
.welcome-lede { font-size: 18px; line-height: 1.55; color: var(--muted); margin: 18px 0 24px; max-width: 700px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 36px 0 0; }
.welcome-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.welcome-stats dt { font-family: var(--meta); font-size: 12.5px; color: var(--muted); }
.welcome-stats dd { margin: 4px 0 0; font-family: var(--headline); font-size: 30px; font-weight: 700; }
.welcome-section { padding: 36px 0; border-top: 1px solid var(--line); }
.welcome-section > h2 { font-size: 26px; margin-bottom: 8px; max-width: 760px; }
.welcome-section > p { max-width: 700px; margin: 0 0 16px; }
.welcome-share { display: flex; gap: 3px; height: 26px; margin: 18px 0 12px; }
.welcome-share span { flex-basis: 0; min-width: 6px; background: var(--c); border-radius: 4px; }
.welcome-share-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
.welcome-steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.welcome-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.welcome-steps li::before { content: counter(step); display: block; font-family: var(--headline); font-size: 32px; font-weight: 700; color: var(--muted); line-height: 1; margin-bottom: 10px; }
.welcome-steps h3, .welcome-features h3 { font-size: 18px; margin-bottom: 6px; }
.welcome-steps p, .welcome-features p, .welcome-privacy { font-family: var(--meta); font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.welcome-example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.welcome-example h2 { font-size: 26px; margin-bottom: 8px; }
.welcome-example p { margin: 0 0 16px; }
.welcome-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 28px; margin-top: 16px; }
.welcome-privacy { padding-left: 18px; }
.welcome-privacy li { margin: 6px 0; }
.welcome-cta { padding: 44px 0 20px; border-top: 1px solid var(--line); text-align: center; }
.welcome-cta h2 { font-size: 30px; margin-bottom: 18px; }
.welcome-cta p { margin-top: 16px; }
@media (max-width: 820px) {
  .welcome-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-steps, .welcome-features { grid-template-columns: 1fr; }
  .welcome-example { grid-template-columns: 1fr; }
}

/* ---------- Who owns what: long outlet lists fold after ten (sources-more.js) ---------- */
.js .feeds[data-collapsible]:not(.expanded) tr.extra { display: none; }
html:not(.js) .js-only { display: none; }
.show-more-outlets { margin-top: 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.show-more-outlets:hover { text-decoration: underline; }

/* ---------- Owners we can't read (News Corp): shown as "not tracked", striped grey ---------- */
.seg.untracked, .untracked-swatch {
  background: repeating-linear-gradient(135deg, var(--seg-off) 0 3px, color-mix(in srgb, var(--muted) 45%, transparent) 3px 5px);
}
.untracked-swatch { display: inline-block; flex: none; width: 14px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.legend-item.untracked { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.legend-item.untracked a { margin-left: 6px; font-size: 12px; }
.untracked-note { display: flex; align-items: baseline; gap: 4px; margin: 10px 0 0; font-family: var(--meta); font-size: 13.5px; color: var(--muted); max-width: 760px; }
.untracked-note strong { color: var(--text); font-weight: 600; }
.welcome-share-legend .untracked { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.untracked-caveat { margin: 12px 0 0; max-width: 700px; }

/* ---------- Accounts, pricing and admin ---------- */
.nav-cta { color: var(--text) !important; font-weight: 600; }
.auth { max-width: 440px; margin: 40px auto; }
.auth.wide { max-width: 640px; }
.auth h1 { font-size: 30px; margin-bottom: 6px; }
.form { display: grid; gap: 14px; margin: 22px 0 16px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.field input { font: inherit; font-size: 15px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.field input:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.field-error, .form-errors { color: var(--bad); font-size: 13px; font-weight: 400; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors:empty, .validation-summary-valid { display: none; }
.form .button { justify-self: start; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 8px; padding: 10px 14px; margin: 14px 0; }
.notice.ok { border-left-color: var(--ok); }
.notice.bad { border-left-color: var(--bad); }
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.account-card h2 { font-size: 20px; margin-bottom: 10px; }
.account-card .welcome-actions { margin-top: 14px; }
.account-card form { margin: 0; }

.pricing { margin: 36px 0; }
.pricing h1 { font-size: 36px; margin-bottom: 10px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 26px 0 18px; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; display: grid; gap: 6px; align-content: start; }
.plan.best { border: 2px solid var(--text); }
.plan h2 { font-size: 19px; }
.plan-price { font-family: var(--headline); font-size: 40px; font-weight: 700; margin: 4px 0 0; }
.plan-badge { position: absolute; top: -11px; left: 18px; margin: 0; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.plan .button, .plan form { margin-top: 10px; justify-self: start; }

.admin { margin: 30px 0; }
.admin h1 { margin-bottom: 14px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 10px; font-size: 13px; }
.admin-filters a { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.admin-filters a.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.admin-table-wrap { overflow-x: auto; }
.admin-table td { vertical-align: top; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions form { display: flex; gap: 4px; margin: 0; }
.admin-actions input { width: 64px; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.admin-actions .button { font-size: 12px; padding: 4px 8px; }

/* ---------- Freemium: subscriber features ---------- */
.premium-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.notice.locked, .account-card.locked { border-left: 4px solid var(--warn); }
.pricing-features { margin: 18px 0 8px; padding-left: 20px; }
.pricing-features li { margin: 6px 0; }
.gaps { margin: 36px 0; }
.gaps h1 { font-size: 36px; margin-bottom: 10px; }
.gaps-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.gaps-list li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 12px 16px; }
.gaps-list p { margin: 4px 0 0; }
.gaps-owner { display: flex; align-items: center; gap: 8px; color: var(--text); }
.gaps-owner:hover { text-decoration: none; }
.gaps-count { margin-left: auto; font-family: var(--headline); font-size: 18px; font-weight: 700; }
.archive { margin: 30px 0; }
.archive h2 { font-size: 20px; margin-bottom: 4px; }
.archive-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.archive-list li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.archive-list a { color: var(--text); font-weight: 600; }
