/* bestsis5ever: shared styles
   Palette: deep forest green on warm off-white (light), soft sage on
   near-black green (dark). Type: Lora for headings, DM Sans for text. */

@font-face { font-family: "Lora"; src: url("../fonts/lora-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --text: #17201b;
  --text-muted: #5d6862;
  --border: #dfe1d9;
  --accent: #1f5a42;
  --accent-contrast: #ffffff;
  --ink: #1b4a36;
  --ink-contrast: #ffffff;
  --focus: #2b6cb0;
  --ok-bg: #e5f1e9;
  --ok-text: #1b5631;
  --err-bg: #fbeaea;
  --err-text: #8a1f1f;
  --shadow: 0 1px 2px rgba(18, 38, 28, 0.04), 0 6px 20px rgba(18, 38, 28, 0.06);
  --radius: 10px;
  --serif: "Lora", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1613;
    --surface: #151e1a;
    --surface-2: #1b2621;
    --text: #e6ece8;
    --text-muted: #9caaa2;
    --border: #2b3833;
    --accent: #84c7a3;
    --accent-contrast: #0f1613;
    --ink: #84c7a3;
    --ink-contrast: #0f1613;
    --focus: #8fc1f2;
    --ok-bg: #18301f;
    --ok-text: #a6dcb1;
    --err-bg: #3a1f1f;
    --err-text: #f2b4b4;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1613;
  --surface: #151e1a;
  --surface-2: #1b2621;
  --text: #e6ece8;
  --text-muted: #9caaa2;
  --border: #2b3833;
  --accent: #84c7a3;
  --accent-contrast: #0f1613;
  --ink: #84c7a3;
  --ink-contrast: #0f1613;
  --focus: #8fc1f2;
  --ok-bg: #18301f;
  --ok-text: #a6dcb1;
  --err-bg: #3a1f1f;
  --err-text: #f2b4b4;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--ink-contrast);
  padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { top: 8px; }

/* Side margins: at least 16px, more on phones with rounded corners/notches. */
.wrap, .wrap-narrow {
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 1040px; }
.wrap-narrow { max-width: 680px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* Header ---------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 60px;
}
.logo {
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text); text-decoration: none; font-size: 0.95rem;
  padding: 8px 10px; border-radius: 6px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); }

.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 1.1rem;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 520px) {
  .nav a.hide-sm { display: none; }
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px; padding: 28px 0 40px;
  color: var(--text-muted); font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }

/* Buttons and forms ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--ink-contrast);
  border: 1px solid var(--ink); border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 12px 20px; cursor: pointer; text-decoration: none;
  min-height: 46px;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); opacity: 1; }
.btn-danger { background: transparent; color: var(--err-text); border-color: var(--err-text); }
.btn-small { padding: 8px 14px; min-height: 38px; font-size: 0.92rem; }

label { font-weight: 600; }

input[type="email"], input[type="date"] {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; min-height: 46px; width: 100%;
}
input[type="date"] { width: auto; }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 6px; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

.region-checks {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
@media (max-width: 420px) { .region-checks { grid-template-columns: 1fr; } }

.check {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; background: var(--surface); cursor: pointer;
  font-weight: 500; min-height: 46px;
}
.check:hover { background: var(--surface-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }

.select-all { font-size: 0.9rem; margin-top: 8px; }
.linklike {
  background: none; border: 0; padding: 0; color: var(--accent);
  font: inherit; text-decoration: underline; cursor: pointer;
}

.notice {
  border-radius: 8px; padding: 12px 14px; margin: 14px 0 0;
  font-size: 0.95rem;
}
.notice:empty { display: none; }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.err { background: var(--err-bg); color: var(--err-text); }

.fine { font-size: 0.85rem; color: var(--text-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
}
@media (max-width: 480px) { .card { padding: 18px; } }

/* Landing ---------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px; align-items: start; padding: 56px 0 24px;
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; } }

.eyebrow {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 18px; }
.lede { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 22px; max-width: 34em; }

.turnstile-slot { min-height: 70px; margin-bottom: 14px; }

.section { padding: 40px 0 8px; }
.section h2 { font-size: 1.7rem; margin: 0 0 18px; }

/* News page -------------------------------------------------------------- */

.news-head { padding: 28px 0 0; }
.news-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 4px; }
.news-head p { margin: 0; color: var(--text-muted); }

.tabs-bar {
  position: sticky; top: 60px; z-index: 10;
  background: var(--bg); padding: 14px 0 10px; margin-top: 16px;
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.tab {
  flex: none; font: inherit; font-size: 0.95rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; min-height: 40px;
}
.tab:hover { border-color: var(--accent); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px;
}
.toolbar label { font-weight: 600; font-size: 0.92rem; }
.toolbar input[type="date"] { min-height: 38px; padding: 6px 10px; }

.day { padding-top: 28px; scroll-margin-top: 190px; }
.day-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 4px;
}
.day-head h2 { margin: 0; font-size: 1.35rem; }
.day-head .badge {
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}

.stories { list-style: none; padding: 0; margin: 0; }
.story {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.story .num {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  color: var(--accent); line-height: 1.2;
}
.story h3 { margin: 0 0 4px; font-size: 1.2rem; }
.story h3 a { color: var(--text); text-decoration: none; }
.story h3 a:hover { text-decoration: underline; }
.story .meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.story .meta strong { color: var(--accent); font-weight: 600; }
.story p { margin: 0 0 6px; font-family: var(--serif); font-size: 1.02rem; color: var(--text); }

.feed-status { text-align: center; color: var(--text-muted); padding: 28px 0; }
.spinner {
  display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 8px;
  border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.empty {
  text-align: center; padding: 40px 16px; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius); margin-top: 24px;
}

.cta-strip {
  margin-top: 36px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.cta-strip p { margin: 0; }

/* Simple pages ----------------------------------------------------------- */

.page { padding-top: 40px; } /* top only: keeps the side margins */
.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 12px; }
.page h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.page p, .page li { color: var(--text); }
.page .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.page hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.btn-block { width: 100%; }

/* Local preview server only (npm run preview) */
.test-banner {
  background: #fff3c4; color: #5c4400; text-align: center;
  font-size: 0.9rem; padding: 8px 16px; border-bottom: 1px solid #e8d48a;
}
.test-banner a { color: #5c4400; font-weight: 600; }

/* Outlet pills ----------------------------------------------------------- */

.outlets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.outlets-label { font-size: 0.82rem; color: var(--text-muted); margin-right: 2px; }
.pill {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
a.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-plain { cursor: default; font-weight: 500; color: var(--text-muted); }
.pill-more { background: var(--surface-2); color: var(--text-muted); font-weight: 500; }
.pill-more:hover { color: var(--text); }

/* "Updated today at ..." */
.updated { font-size: 0.85rem; color: var(--text-muted); margin: 6px 0 0; }
.updated::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: 1px;
}

/* Loading placeholders --------------------------------------------------- */

.skeleton .story { border-bottom-color: var(--border); }
.bone {
  display: block; border-radius: 6px; height: 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.bone-num { width: 18px; height: 24px; }
.bone-title { height: 20px; width: 90%; }
.bone-line { width: 100%; }
.bone.short { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .bone { animation: none; } }

/* Landing page preview --------------------------------------------------- */

/* Homepage: region picker under the header ------------------------------ */

.region-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.region-bar-inner {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.region-bar-inner::-webkit-scrollbar { display: none; }
.region-chip {
  flex: none; font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 7px 14px; min-height: 38px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.region-chip:hover { border-color: var(--accent); }
.region-chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-contrast); border-color: var(--ink); }

.stories.compact .story { padding: 14px 0; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.stories.compact .story:last-child { border-bottom: 0; }
.stories.compact .story h3 { font-size: 1.05rem; }
.stories.compact .story .num { font-size: 1.25rem; }
.stories.compact .outlets { margin-top: 6px; }
.preview-empty { list-style: none; padding: 18px 0; color: var(--text-muted); }

/* ======================================================================
   Homepage v2: signup left, email-style preview right, then steps,
   "Follow your curiosity." and sources.
   ====================================================================== */

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "signup preview";
  align-items: start; gap: 48px; padding: 36px 0 48px;
}
.hero-signup { grid-area: signup; min-width: 0; }
.hero-preview { grid-area: preview; min-width: 0; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "signup" "preview"; gap: 36px; padding-top: 28px; }
}
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); margin: 0 0 12px; }
.hero .lede { font-size: 1.08rem; margin-bottom: 24px; }

/* Regions: "Your regions" on the left, a "Select all" checkbox on the right */
.regions-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.regions-title { font-weight: 600; }
.select-all {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 0.92rem; font-weight: 500; color: var(--text-muted); cursor: pointer;
}
.select-all input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.signup-fine { text-align: center; margin-top: 14px; }

/* Email preview */
.preview-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preview-label-row .eyebrow { margin: 0; }
.edition-tag {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; white-space: nowrap;
}
.email-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.email-top {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 22px; border-bottom: 1px solid var(--border);
}
.email-body { padding: 20px 24px 18px; }
@media (max-width: 480px) { .email-body { padding: 18px 16px 14px; } .email-top { padding: 10px 16px; } }
.email-brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; margin: 0 0 10px; }
.email-brand span { color: var(--accent); }
.email-greeting { font-size: 1.45rem; font-weight: 400; margin: 0 0 4px; }
.email-intro { color: var(--text-muted); margin: 0 0 16px; font-size: 0.95rem; }
.email-region {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.email-region-name { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.email-region .updated { margin: 0; font-size: 0.8rem; }
.email-stories { list-style: none; margin: 0; padding: 0; }
.email-story { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.email-num { font-family: var(--serif); font-size: 1.35rem; color: var(--accent); line-height: 1.2; }
.email-story h3 { font-size: 1.08rem; font-weight: 500; line-height: 1.35; margin: 0 0 4px; }
.email-story h3 a { color: var(--text); text-decoration: none; }
.email-story h3 a:hover { text-decoration: underline; }
.email-outlets { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.email-outlets a { color: var(--text-muted); text-decoration: none; }
.email-outlets a:hover { color: var(--accent); text-decoration: underline; }
.email-more { text-align: center; margin: 14px 0 0; font-weight: 600; }
.email-more a { text-decoration: none; }
.email-skeleton { margin: 8px 0 0; }
.preview-note { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 12px 0 0; }

/* Steps band (full-width background without page overflow) */
.steps-band {
  background: var(--surface-2);
  box-shadow: 0 0 0 100vmax var(--surface-2);
  clip-path: inset(0 -100vmax);
  padding: 48px 0;
}
.band-label { display: flex; align-items: center; gap: 16px; margin: 0 0 28px; font-family: var(--sans); }
.band-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.steps-new { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 760px) { .steps-new { grid-template-columns: 1fr; gap: 24px; } }
.step-mark { display: flex; align-items: center; gap: 10px; color: var(--accent); margin-bottom: 14px; }
.step-mark svg { width: 28px; height: 28px; }
.step-mark span { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.steps-new h3 { font-size: 1.55rem; margin: 0 0 8px; }
.steps-new p { margin: 0; color: var(--text-muted); }

/* Follow your curiosity */
.curiosity { padding: 56px 0 24px; }
.curiosity .eyebrow { margin-bottom: 8px; }
.curiosity-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 16px; }
.curiosity-head h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 0; }
.arrow-link { font-weight: 600; text-decoration: none; }
.arrow-link:hover { text-decoration: underline; }
.region-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
@media (max-width: 680px) { .region-list { grid-template-columns: 1fr; } }
.region-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
  font-family: var(--serif); font-size: 1.45rem; color: var(--text); text-decoration: none;
}
.region-list a:hover { color: var(--accent); }
.region-list .arrow { font-family: var(--sans); font-size: 1.1rem; color: var(--text-muted); }

/* Sources strip */
.sources {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px 48px; align-items: center;
  border-top: 1px solid var(--border); margin-top: 48px; padding: 40px 0 8px;
}
@media (max-width: 860px) { .sources { grid-template-columns: 1fr; } }
.sources h2 { margin: 0 0 8px; font-family: var(--sans); }
.sources p { margin: 0; color: var(--text-muted); }
.source-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: flex-start; }
.source-names li { font-family: var(--serif); font-size: 1.2rem; color: var(--text-muted); white-space: nowrap; }

/* Outlet names link to the outlets, without underlines */
.source-names a { color: inherit; text-decoration: none; }
.source-names a:hover, .source-names a:focus-visible { color: var(--accent); }

/* News page: all-regions view */
.stories.no-rank .story { grid-template-columns: minmax(0, 1fr); }
.stories.no-rank .num { display: none; }
.region-tag {
  display: inline-flex; align-items: center; margin-bottom: 6px;
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--accent); font: inherit; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.region-tag:hover { border-color: var(--accent); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--ink-contrast); border-color: var(--ink); }

/* Story footer: outlet pills + share button */
.story-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 8px; }
.story-foot .outlets { margin-top: 0; }
.share-btn {
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 4px 12px; min-height: 32px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.share-btn::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='m16 6-4-4-4 4'/%3E%3Cpath d='M12 2v13'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='m16 6-4-4-4 4'/%3E%3Cpath d='M12 2v13'/%3E%3C/svg%3E") center / contain no-repeat;
}
.share-btn:hover { color: var(--accent); border-color: var(--border); }

/* Read markers: stories this browser has opened look quieter */
.story.is-read h3 a, .email-story.is-read h3 a { color: var(--text-muted); }
.story.is-read .num, .email-story.is-read .email-num { opacity: 0.5; }
.read-label {
  display: inline-block; margin: 0 6px 6px 0; padding: 2px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
}
.story.is-read .region-tag { opacity: 0.7; }

/* Owner stats page */
.stats-login { max-width: 420px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 8px; }
@media (max-width: 640px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-tile .k { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-tile .v { font-family: var(--serif); font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 0.92rem; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.spark span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.85; }
.spark-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.runs { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.runs th, .runs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.runs td.num { font-variant-numeric: tabular-nums; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status-pill.sent { background: var(--ok-bg); color: var(--ok-text); }
.status-pill.failed { background: var(--err-bg); color: var(--err-text); }
.status-pill.running { background: var(--surface-2); color: var(--text-muted); }

/* Suggest a feature */
.suggest-card { margin-top: 20px; }
textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px;
  width: 100%; resize: vertical; min-height: 140px; line-height: 1.5;
}
textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.counter { text-align: right; margin: 4px 0 0; }
.optional { font-weight: 400; color: var(--text-muted); }
.idea-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin-top: 48px; padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.idea-strip h2 { margin: 0 0 4px; font-size: 1.6rem; }
.idea-strip p { margin: 0; color: var(--text-muted); }

/* Ideas on the stats page */
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.idea { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.idea-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.85rem; color: var(--text-muted); }
.idea-meta .btn { margin-left: auto; }
.idea-empty { color: var(--text-muted); }

/* Project board (board.html) */
.board-page { padding-top: 32px; }
.board-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; border-bottom: 2px solid var(--ink); padding-bottom: 18px; }
.board-head h1 { margin: 0 0 4px; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.board-head .fine { margin: 0; }
.board-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.board-count { padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--text-muted); }
.board-count strong { font-size: 1.05rem; }
.board-count.done { background: var(--ok-bg); color: var(--ok-text); }
.board-hint { display: none; color: var(--text-muted); font-size: 0.85rem; margin: 14px 0 0; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; margin-top: 20px; }
.board-col { background: var(--surface-2); border-radius: 12px; padding: 12px; min-width: 0; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; }
.board-col-head h2 { margin: 0; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.board-col .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex: none; }
.board-col.done .dot { background: var(--accent); }
.board-col.doing .dot { background: #c08a2e; }
.board-col-head .n { font-size: 0.8rem; color: var(--text-muted); }
.board-order { font-size: 0.78rem; color: var(--text-muted); margin: 0 4px 8px; }
.board-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.board-card summary { list-style: none; }
.board-card summary::-webkit-details-marker { display: none; }
.board-card h3 { margin: 0; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.board-card p { margin: 4px 0 0; font-size: 0.88rem; color: var(--text-muted); }
.board-tag { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.board-tag.new { background: var(--ok-bg); color: var(--ok-text); }
.board-tag.idea { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.board-divider { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin: 14px 4px 8px; }
.board-foot { margin-top: 16px; }
/* Phones: columns stay side by side; titles only, tap for details */
@media (max-width: 700px) {
  .board-hint { display: block; }
  .board-counts { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .board-count { border-radius: 10px; font-size: 0.72rem; padding: 8px; display: flex; flex-direction: column; }
  .kanban { gap: 6px; margin-top: 12px; }
  .board-col { padding: 8px 5px; border-radius: 10px; }
  .board-col-head { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 2px 4px; }
  .board-col-head h2 { font-size: 0.6rem; letter-spacing: 0.05em; gap: 5px; }
  .board-order { display: none; }
  .board-cards { gap: 5px; }
  .board-card { padding: 7px; border-radius: 7px; }
  .board-card summary { cursor: pointer; }
  .board-card[open] { border-color: var(--accent); }
  .board-card h3 { font-size: 0.74rem; gap: 4px; overflow-wrap: anywhere; }
  .board-card p { font-size: 0.72rem; }
  .board-tag { font-size: 0.52rem; padding: 1px 5px; letter-spacing: 0.04em; }
  .board-divider { font-size: 0.6rem; margin: 10px 2px 6px; }
}

/* Listen: button in each day's header, player bar, highlighted story */
.day-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.listen-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px 4px 10px; min-height: 32px; cursor: pointer;
}
.listen-btn::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.listen-btn:hover { border-color: var(--accent); }
.story.is-speaking { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; padding-right: 8px; border-radius: 6px; }
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(18, 38, 28, 0.08);
}
.player-info { flex: 1; min-width: 0; }
.player-title { margin: 0; font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { margin: 0; font-size: 0.78rem; color: var(--text-muted); }
.player-controls { display: flex; align-items: center; gap: 4px; flex: none; }
.player-btn {
  font: inherit; font-size: 1rem; line-height: 1; min-width: 40px; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.player-btn:disabled { opacity: 0.35; cursor: default; }
.player-btn.play { background: var(--ink); color: var(--ink-contrast); border-color: var(--ink); }
.player-btn.speed { font-size: 0.8rem; font-weight: 600; }
body.has-player { padding-bottom: 84px; }
@media (max-width: 480px) {
  .player { flex-direction: column; align-items: stretch; gap: 8px; }
  .player-controls { justify-content: space-between; }
  body.has-player { padding-bottom: 128px; }
}

/* Voice panel: sits just above the player bar */
.voice-panel {
  position: fixed; z-index: 31;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(18, 38, 28, 0.18); padding: 18px 18px 16px;
}
.voice-panel h2 { margin: 0 36px 6px 0; font-size: 1.25rem; }
.voice-x {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.voice-panel p { margin: 0 0 10px; font-size: 0.92rem; }
.voice-select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; min-height: 44px; margin-bottom: 14px;
}
.voice-more { font-weight: 600; }
.voice-steps { margin: 0 0 10px; padding-left: 20px; font-size: 0.9rem; display: grid; gap: 4px; }
.voice-note { color: var(--text-muted); font-size: 0.82rem !important; }
.voice-done { width: 100%; margin-top: 4px; }
.player-btn.voice { font-size: 0.8rem; font-weight: 600; padding: 0 12px; }
@media (max-width: 480px) {
  .voice-panel { left: 12px; right: 12px; width: auto; bottom: calc(124px + env(safe-area-inset-bottom, 0px)); max-height: calc(100vh - 150px - env(safe-area-inset-bottom, 0px)); }
}

/* What's new pop-up */
body.wn-open { overflow: hidden; }
.wn-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 20, 15, 0.45);
}
.wn-dialog {
  position: relative; width: min(480px, 100%); max-height: 100%; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(10, 20, 15, 0.25); padding: 24px 22px 20px;
}
.wn-dialog:focus { outline: none; }
.wn-dialog .eyebrow { margin: 0 0 4px; }
.wn-dialog h2 { margin: 0 40px 14px 0; font-size: 1.5rem; }
.wn-x {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.wn-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.wn-list li { padding-left: 16px; border-left: 3px solid var(--accent); }
.wn-list h3 { margin: 0 0 2px; font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.wn-list p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* Arriving from the email's Listen link */
.listen-btn.listen-cue { border-color: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: listen-pulse 1.6s ease-out infinite; }
@keyframes listen-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 90, 66, 0.45); } 100% { box-shadow: 0 0 0 12px rgba(31, 90, 66, 0); } }
@media (prefers-reduced-motion: reduce) { .listen-btn.listen-cue { animation: none; box-shadow: 0 0 0 3px var(--accent); } }
.listen-hint { margin: 8px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--accent); }
