/* Morning Fold app. Mobile first: base styles are for a phone, wider
   screens get more room via min-width queries.

   Look: a light reading app. White page, navy ink, one warm accent (the
   sun from the logo) used sparingly. Titles and UI in Instrument Sans,
   summaries in Newsreader for long-form readability. Light is the default;
   html[data-theme=dark] switches the tokens. */
/* Fonts are served from here, not Google Fonts: no third-party requests
   (GDPR) and no layout shift waiting on another host. OFL licences in fonts/. */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(/static/fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(/static/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/newsreader-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/newsreader-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #FFFFFF;
  --soft: #F3F4F8;      /* chips, inputs, hover */
  --raise: #FFFFFF;     /* menus, dialogs */
  --ink: #12152A;       /* titles, UI */
  --body: #2B2F45;      /* summaries */
  --muted: #5F6580;     /* meta; 5.9:1 on white */
  --rule: #E7E9F0;
  --sun: #F2A93B;
  --sun-ink: #3A2500;
  --focus: #3D63DD;
  --err: #B42318;
  --ok: #0F7B4F;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --bar: 64px;
  --top: 60px;
  color-scheme: light;
}
html[data-theme="dark"] {
  /* Neutral graphite, no blue cast. */
  --bg: #141414;
  --soft: #222222;
  --raise: #1C1C1C;
  --ink: #F2F2F2;
  --body: #D4D4D4;
  --muted: #A1A1A1;     /* 7:1 on the background */
  --rule: #2B2B2B;
  --sun: #F6B84E;
  --focus: #8EA9FF;
  --err: #FDA29B;
  --ok: #6CE0A8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom));
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; gap: 10px; height: var(--top); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.015em; text-decoration: none; margin-right: auto; }
.brand svg { width: 26px; height: 26px; }
.brand .ink { fill: var(--ink); }
.top-nav { display: none; gap: 4px; margin-right: 8px; }
.top-nav a, .top-nav .link { text-decoration: none; font-weight: 500; font-size: 15px; color: var(--muted); background: none; border: 0; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.top-nav a:hover, .top-nav .link:hover { color: var(--ink); background: var(--soft); }
.top-nav [aria-current] { color: var(--ink); background: var(--soft); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
.login-link { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink); padding: 7px 10px; border-radius: 999px; }
.login-link:hover { background: var(--soft); }
.signin { display: none; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; padding: 8px 16px; text-decoration: none; cursor: pointer; }

/* Page heading */
.masthead { padding: 28px 0 6px; }
.kicker { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.kicker::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); margin-right: 8px; vertical-align: 1px; }
h1 { font-weight: 650; font-size: 32px; line-height: 1.08; letter-spacing: -0.028em; margin: 0 0 8px; text-wrap: balance; }
.dateline { color: var(--muted); font-size: 15px; margin: 0; text-wrap: pretty; }

/* Previous / next day */
.days { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 0; }
.days a { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 500; text-decoration: none; }
.days a[rel="next"] { padding: 7px 8px 7px 12px; }
/* Phone: previous / next are icon buttons so the current day fits. */
.days .day-lbl { display: none; }
.days a[rel="prev"], .days a[rel="next"] { width: 34px; height: 34px; padding: 0; justify-content: center; }
.days-mid { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.days a.to-today { padding: 7px 14px; background: var(--ink); color: var(--bg); }
.days a.to-archive { width: 34px; height: 34px; padding: 0; justify-content: center; }
.days a.to-archive svg { width: 18px; height: 18px; stroke-width: 1.8; }
.days a.to-today:hover { background: color-mix(in srgb, var(--ink) 86%, var(--sun)); }
.day-pick label { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.day-pick label:hover { background: color-mix(in srgb, var(--ink) 9%, var(--soft)); }
.day-pick svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* The native date input covers the icon invisibly: tapping it opens the
   phone's own date picker. */
.day-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.day-pick input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.day-pick noscript button { margin-left: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.days a:hover { background: color-mix(in srgb, var(--ink) 9%, var(--soft)); }
.days svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Topics: one scrollable row on a phone, a side rail on a laptop */
/* Phone: days and topics stay in one sticky bar under the header. */
.brief-bar { position: sticky; top: var(--top); z-index: 5; margin: 0 -20px; padding: 10px 20px 0; background: var(--bg); }
.brief-bar.stuck { border-bottom: 1px solid var(--rule); }
.brief-bar .days { margin: 0; }
.topics { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-padding: 0 20px; padding: 10px 20px 12px; margin: 0 -20px; }
/* A soft fade on the edge that has more topics behind it. */
.topics.more-right, .filters.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.topics.more-left, .filters.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.topics.more-left.more-right, .filters.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.topics::-webkit-scrollbar { display: none; }
.topics a { flex: none; display: flex; align-items: baseline; gap: 6px; text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 14px; border-radius: 999px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.topics a span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.topics a:hover { background: color-mix(in srgb, var(--ink) 9%, var(--soft)); }
.topics a[aria-current] { background: var(--ink); color: var(--bg); }
.topics a[aria-current] span { color: inherit; opacity: .65; }
/* On a phone: For you, Top, Following and a button that opens every topic in a sheet. */
.topics .topic-link, .topics .n-wide { display: none; }
.topics-btn { flex: none; display: flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; font-weight: 500; padding: 7px 10px 7px 14px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink); white-space: nowrap; cursor: pointer; }
.topics-btn span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.topics-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topics-btn[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.topics-btn[aria-current] span { color: inherit; opacity: .65; }
.topic-sheet h2 { margin-bottom: 16px; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 60vh; overflow-y: auto; }
.topic-grid a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 13px 14px; border-radius: 14px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.topic-grid a span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.topic-grid a[aria-current] { background: var(--ink); color: var(--bg); }
.topic-grid a[aria-current] span { color: inherit; opacity: .65; }
.nudge { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--sun) 16%, var(--bg)); font-size: 15px; }
.nudge a { font-weight: 600; }

/* Stories */
.sort-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.sort-note a { color: var(--ink); font-weight: 500; margin-left: 4px; }
.stories { list-style: none; margin: 0; padding: 0; }
.story { padding: 22px 0 18px; border-top: 1px solid var(--rule); }
.story:first-child { border-top: 0; padding-top: 10px; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 14px; color: var(--muted); }
.tag { font-weight: 600; color: var(--ink); }
.covered { color: var(--ink); }
.covered::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); margin-right: 6px; vertical-align: 1px; }
.story h2, .story h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.014em; margin: 6px 0 8px; font-weight: 600; text-wrap: pretty; }
.story h2 a, .story h3 a { text-decoration: none; }
.story h2 a:hover, .story h3 a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--sun); }
.summary { font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--body); margin: 0 0 12px; text-wrap: pretty; }
.foot-row { display: flex; align-items: center; gap: 12px; }
.src { flex: 1; margin: 0; font-size: 14px; color: var(--muted); }
.src a { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent); text-underline-offset: 3px; }
.src a:hover { color: var(--ink); }
.votes { display: flex; gap: 2px; }
.votes button { width: 44px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.votes button:hover { background: var(--soft); }
.votes svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }
.votes button[aria-pressed="true"] { background: var(--ink); }
.votes button[aria-pressed="true"] svg { stroke: var(--bg); fill: var(--bg); }

.more { padding: 24px 0 8px; text-align: center; }
.more-btn { display: inline-block; width: 100%; max-width: 360px; padding: 14px 18px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.more-btn:hover { background: var(--ink); color: var(--bg); }

.empty { padding: 40px 0; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 0 0 6px; }

/* Search */
.search-box { position: relative; display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; padding: 6px 6px 6px 46px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--bg); }
.search-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.search-box > svg { position: absolute; left: 16px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input[type=search] { flex: 1; min-width: 0; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; padding: 10px 0; }
.search-box input:focus { outline: none; }
.search-go { flex: none; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; padding: 10px 18px; cursor: pointer; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 8px; border: 0; min-width: 0; }
.filters::-webkit-scrollbar { display: none; }
.filters label { position: relative; flex: none; }
.filters input { position: absolute; opacity: 0; pointer-events: none; }
.filters span { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 500; padding: 7px 13px; border-radius: 999px; background: var(--soft); cursor: pointer; user-select: none; }
.filters span:hover { background: color-mix(in srgb, var(--ink) 9%, var(--soft)); }
.filters input:checked + span { background: var(--ink); color: var(--bg); }
.filters input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
/* Topics are chips (pick any); the time is one segmented switch (pick one),
   so the two never read as one group. */
.filter-label { margin: 4px 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.when-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.when-row .filter-label { margin: 0; }
.filters.when { display: inline-flex; gap: 0; margin: 0; padding: 3px; border-radius: 999px; background: var(--soft); overflow: visible; }
.filters.when span { background: transparent; padding: 6px 14px; color: var(--muted); }
.filters.when span:hover { background: transparent; color: var(--ink); }
.filters.when input:checked + span { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent); }
/* The box, the filters and the results heading stay put; only results scroll. */
.search-sticky { position: sticky; top: var(--top); z-index: 5; margin: 0 -20px; padding: 0 20px; background: var(--bg); }
.search-sticky.stuck { border-bottom: 1px solid var(--rule); }
.search-sticky .search-box { margin-top: 12px; }
.results-head { padding: 10px 0 12px; }
.results-head h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-head q { quotes: "\201C" "\201D"; }
.results-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.results-head .clear { margin-left: 10px; color: var(--ink); font-weight: 500; }
/* While a search runs: a panel in place of the results, ready to show progress later. */
.searching { margin: 26px 0; padding: 22px 22px 20px; border-radius: 20px; background: var(--soft); }
.searching-title { margin: 14px 0 4px; font-size: 18px; font-weight: 600; }
.searching-detail { margin: 0; color: var(--muted); font-size: 15px; }
.searching-bar { height: 4px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.searching-bar span { display: block; width: 35%; height: 100%; border-radius: 99px; background: var(--sun); }
@media (prefers-reduced-motion: no-preference) {
  .searching-bar span { animation: sweep 1.1s ease-in-out infinite; }
  @keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
}
.search-page .stories .story:first-child { padding-top: 14px; }
.search-page .src { margin-top: -2px; }
.search-gate { margin: 22px 0; padding: 24px 22px; border-radius: 20px; background: var(--soft); }
.search-gate h2 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; }
.search-gate p { margin: 0 0 16px; color: var(--body); }
.search-gate .gate-buttons { max-width: 360px; }

/* Sources page */
.src-groups { border-top: 1px solid var(--rule); }
.src-group { border-bottom: 1px solid var(--rule); }
.src-group summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; padding: 16px 4px; cursor: pointer; list-style: none; }
.src-group summary::-webkit-details-marker { display: none; }
.src-group summary:hover h3 { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 4px; }
.src-group summary h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.src-group .src-sum { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.src-group summary svg { align-self: center; width: 20px; height: 20px; margin-left: auto; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.src-group[open] summary svg { transform: rotate(180deg); }
.src-group ul { list-style: none; margin: 0 0 12px; padding: 0 4px; }
.src-group li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.src-group li a { font-weight: 500; text-decoration: none; }
.src-group li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.src-group small { color: var(--muted); font-size: 14px; }
.src-add { padding: 28px 0; border-top: 1px solid var(--rule); }
.src-add h2 { margin: 0 0 6px; font-size: 19px; font-weight: 600; }
.src-add p { color: var(--muted); margin: 0 0 16px; }

/* Your sources */
.src-mine { margin: 8px 0 28px; padding: 22px 22px 24px; border-radius: 20px; background: var(--soft); }
.src-mine h2 { margin: 0 0 10px; font-size: 21px; font-weight: 650; letter-spacing: -0.015em; }
.src-mine h2 span { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 4px; }
.src-mine ul { list-style: none; margin: 0 0 16px; padding: 0; }
.src-mine li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.src-mine li:first-child { border-top: 0; }
.src-mine-main { display: grid; gap: 2px; min-width: 0; }
.src-mine-main a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.src-mine small { color: var(--muted); font-size: 14px; }
.src-err { color: var(--err); }
.src-mine-actions { display: flex; align-items: center; gap: 4px; }
.src-mine-actions form { margin: 0; }
.link-btn { border: 0; background: none; padding: 8px 10px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.link-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.link-btn.danger { color: var(--err); }
.src-tag { font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 10px; border: 1.5px solid var(--rule); border-radius: 999px; }
.src-mine .more-btn { background: var(--bg); width: auto; }
.src-mine .more-btn:hover { background: var(--ink); color: var(--bg); }
.muted { color: var(--muted); }
.library-head { margin: 8px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.015em; }
.src-preview { margin: 4px 0 24px; padding: 20px 22px; border-radius: 20px; background: var(--soft); }
.src-preview h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.src-preview-url { margin: 2px 0 14px; font-size: 14px; overflow-wrap: anywhere; }
.src-preview-url a { color: var(--muted); }
.src-preview h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.src-preview ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-family: var(--serif); font-size: 17px; }
.src-preview li a { text-decoration: none; }
.src-preview li a:hover { text-decoration: underline; }
.src-preview small { font-family: var(--sans); color: var(--muted); font-size: 13px; }
.form input[name=url] { font: inherit; font-size: 17px; padding: 13px 14px; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); width: 100%; }
.form input[name=url]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
/* A busy button: spinner and what is happening, until the next page loads. */
.primary-btn[disabled] { cursor: progress; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: color-mix(in srgb, var(--ink) 82%, var(--bg)); }
.primary-btn[disabled]::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--bg) 35%, transparent); border-top-color: var(--bg); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .primary-btn[disabled]::before { animation-duration: 2.4s; } }

.foot { display: flex; flex-direction: column; gap: 8px; padding: 32px 20px 28px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 24px; }

/* Bottom navigation, phones only */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--rule); }
.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
.bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.bottom-nav [aria-current] { color: var(--ink); }
.bottom-nav [aria-current] svg { stroke-width: 2.2; }

/* Sign-up prompt: a sheet from the bottom on a phone */
dialog { border: 0; padding: 0; border-radius: 22px 22px 0 0; width: 100%; max-width: 100%; margin: auto auto 0; background: var(--raise); color: var(--ink); }
dialog::backdrop { background: rgba(10, 12, 24, .4); backdrop-filter: blur(2px); }
.gate { position: relative; padding: 28px 22px calc(22px + env(safe-area-inset-bottom)); }
.gate-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--soft); font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.gate h2 { margin: 0 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.gate-why { margin: 0 0 14px; font-family: var(--serif); font-size: 18px; color: var(--body); }
.gate-perks { margin: 0 0 18px; padding: 0; list-style: none; color: var(--muted); font-size: 15px; display: grid; gap: 6px; }
.gate-perks li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); margin-right: 10px; vertical-align: 2px; }
.gate-buttons { display: grid; gap: 8px; }
.gate-buttons a.primary { display: block; text-align: center; padding: 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; }
.gate-buttons > :first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gate-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.gate-note a { color: var(--ink); font-weight: 500; }

/* Account menu */
.usermenu { position: relative; }
/* Language menu in the header: a globe and the language code. */
.langmenu { position: relative; }
.langmenu summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; cursor: pointer; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover, .langmenu[open] summary { background: var(--soft); color: var(--ink); }
.langmenu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.langmenu-panel { min-width: 180px; margin: 0; }
.langmenu-panel button[aria-current] { font-weight: 600; }
.langmenu-panel button[aria-current]::after { content: "✓"; float: right; color: var(--muted); }
.usermenu summary { list-style: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 600; text-transform: uppercase; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-panel { position: absolute; right: 0; top: 46px; min-width: 240px; background: var(--raise); border: 1px solid var(--rule); border-radius: 16px; padding: 8px; display: grid; box-shadow: 0 18px 40px -18px rgba(10, 12, 24, .35); }
.usermenu-panel p { margin: 0; padding: 8px 10px 10px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.usermenu-panel a, .usermenu-panel button { display: block; width: 100%; text-align: left; font-size: 15px; text-decoration: none; background: none; border: 0; padding: 10px; border-radius: 10px; cursor: pointer; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--soft); }

/* Forms */
.form-page { max-width: 440px; padding: 36px 0 28px; }
.form-page.wide { max-width: 580px; }
.form-page .lead { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 7px; font-weight: 500; font-size: 15px; }
.form input[type=email], .form input[type=password], .form textarea { font: inherit; font-size: 17px; padding: 13px 14px; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); width: 100%; }
.form textarea { resize: vertical; line-height: 1.5; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.form small, .opt { color: var(--muted); font-weight: 400; font-size: 14px; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { font-weight: 500; font-size: 15px; margin-bottom: 10px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; font-size: 15px; font-weight: 500; padding: 9px 15px; border-radius: 999px; background: var(--soft); cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.primary-btn { padding: 15px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px; cursor: pointer; }
.primary-btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--sun)); }
.outline-btn { justify-self: start; border: 1.5px solid var(--rule); background: transparent; color: var(--ink); border-radius: 999px; padding: 11px 18px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.outline-btn:hover { border-color: var(--ink); }
.form-error { color: var(--err); background: color-mix(in srgb, var(--err) 10%, var(--bg)); padding: 12px 14px; border-radius: 12px; }
.form-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--bg)); padding: 12px 14px; border-radius: 12px; }
.form-alt { margin-top: 20px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.form-alt a { color: var(--ink); font-weight: 500; }

/* Sign in with Google / GitHub */
.oauth-buttons { display: grid; gap: 8px; margin-bottom: 4px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--bg); color: var(--ink); font-weight: 600; text-decoration: none; }
.oauth-btn:hover { border-color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

/* Tablet and up */
@media (min-width: 760px) {
  body { padding-bottom: 0; font-size: 17px; }
  .wrap { padding: 0 28px; }
  .top-nav { display: flex; }
  .signin { display: inline-block; }
  .bottom-nav { display: none; }
  h1 { font-size: 46px; }
  .masthead { padding: 48px 0 10px; }
  .brief-bar { margin: 0 -28px; padding: 12px 28px 0; }
  .days .day-lbl { display: inline; }
  .days a[rel="prev"], .days a[rel="next"] { width: auto; height: auto; }
  .days a[rel="prev"] { padding: 7px 12px 7px 8px; }
  .days a[rel="next"] { padding: 7px 8px 7px 12px; }
  .topics { margin: 0 -28px; padding: 12px 28px 14px; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none !important; mask-image: none !important; }
  .topics .topic-link { display: flex; }
  .topics .n-wide { display: inline; }
  .topics-btn { display: none; }
  .story { padding: 26px 0 22px; }
  .story h2, .story h3 { font-size: 23px; }
  .summary { font-size: 19px; }
  .filters { margin: 0; padding: 2px 0 8px; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none !important; mask-image: none !important; }
  .search-sticky { margin: 0 -28px; padding: 0 28px; }
  .results-head h2 { font-size: 22px; white-space: normal; }
  .foot { flex-direction: row; justify-content: space-between; padding: 36px 28px 44px; }
  dialog { border-radius: 22px; max-width: 460px; margin: auto; }
}

/* Laptop: topics become a sticky rail beside the stories */
@media (min-width: 1080px) {
  .wrap { max-width: 1080px; }
  .brief-grid { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 0 56px; align-items: start; }
  .brief-grid .masthead { grid-column: 1 / -1; }
  /* The left rail holds the day navigation and the topics, and stays put. */
  .brief-grid .brief-bar { grid-column: 1; grid-row: 2; position: sticky; top: calc(var(--top) + 20px); margin: 18px 0 0; padding: 0; background: transparent; border: 0; }
  .brief-grid .days { flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
  .brief-grid .days a[rel="prev"] { order: 1; }
  .brief-grid .days a[rel="next"] { order: 2; margin-left: auto; }
  .brief-grid .days-mid { order: 3; flex-basis: 100%; margin: 0; }
  .brief-grid .day-pick { flex: 1; }
  .brief-grid .day-pick label { width: 100%; }
  .brief-grid .topics { flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 0; background: transparent; }
  .brief-grid .topics a { justify-content: space-between; padding: 9px 14px; border-radius: 10px; background: transparent; }
  .brief-grid .topics a:hover { background: var(--soft); }
  .brief-grid .topics a[aria-current] { background: var(--ink); }
  .brief-grid .stories { margin-top: 12px; }
  .brief-grid .sort-note { margin-top: 18px; }
  /* Everything right of the rail sits in one cell, so the rail's height
     never stretches the gaps between the main column's blocks. */
  .brief-grid .brief-main { grid-column: 2; grid-row: 2; }
  .brief-grid .more { text-align: left; }
  .page-col { max-width: 720px; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise 200ms cubic-bezier(.2, .8, .2, 1); }
  @keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
  .topics a, .votes button, .icon-btn, .more-btn, .oauth-btn, .primary-btn { transition: background-color 120ms, color 120ms, border-color 120ms; }
}

/* Tags: firms and products a story is about. Quiet text links under the
   summary; ones the reader follows get the accent dot. */
.story-tags { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -4px 0 12px; font-size: 14px; }
.story-tags a { color: var(--muted); text-decoration: none; font-weight: 500; }
.story-tags a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.story-tags a.on { color: var(--ink); font-weight: 600; }
.story-tags a.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); margin-right: 5px; vertical-align: 2px; }

.tag-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tag-head .dateline { margin-bottom: 0; }
.follow-btn { flex: none; display: inline-flex; align-items: center; white-space: nowrap; margin-top: 6px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; cursor: pointer; }
.follow-btn:hover { opacity: 0.88; }
.follow-btn.on { background: var(--soft); color: var(--ink); }
.follow-btn.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); margin-right: 7px; }
.follow-btn.on:hover { opacity: 1; background: color-mix(in srgb, var(--ink) 12%, transparent); }

.tag-section { margin: 8px 0 32px; }
.tag-section h2 { margin: 0 0 10px; font-size: 21px; font-weight: 650; letter-spacing: -0.015em; }
.tag-section h2 span { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 4px; }
.tag-list { list-style: none; margin: 0; padding: 0; }
.tag-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.tag-list li:first-child { border-top: 0; }
.tag-list a { font-weight: 600; text-decoration: none; }
.tag-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag-list form { margin: 0; }
.tag-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud form { margin: 0; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; }
.tag-pill small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tag-pill .plus { color: var(--muted); font-weight: 600; width: 10px; text-align: center; }
.tag-pill:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.tag-pill.on { background: var(--ink); color: var(--bg); }
.tag-pill.on small, .tag-pill.on .plus { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.tag-page .stories { margin-top: 20px; }
.tag-search { margin: 0 0 20px; }
.tag-row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.tag-row-main small { color: var(--muted); font-size: 14px; }
.tag-ahead { margin-top: 12px; padding: 16px 18px; border-radius: 16px; background: var(--soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tag-ahead p { margin: 0; flex: 1 1 260px; }
.tag-ahead form { margin: 0; }
.tag-ahead .follow-btn { margin-top: 0; }
/* Within Following: one chip per followed tag that has stories. */
.tag-filter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 20px 6px; margin: 0 -20px 4px; }
.tag-filter::-webkit-scrollbar { display: none; }
.tag-filter a { flex: none; display: flex; align-items: baseline; gap: 5px; text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); white-space: nowrap; }
.tag-filter a span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tag-filter a:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.tag-filter a[aria-current] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.tag-filter a[aria-current] span { color: inherit; opacity: .65; }
.tag-filter.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tag-filter.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.tag-filter.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
@media (min-width: 760px) { .tag-filter { flex-wrap: wrap; overflow: visible; margin: 0 0 4px; padding: 4px 0 6px; } }

/* Morning e-mail settings, below the interests form. */
.mail-settings { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--top) + 16px); }
.mail-settings h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.015em; }
.mail-settings .form-ok, .mail-settings .form-error { margin: 0 0 16px; }
.form label.switch, .form label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
.switch input, .check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.switch span { line-height: 1.4; }
.switch strong { font-weight: 600; overflow-wrap: anywhere; }
.mail-when { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.form .mail-when label:first-child { display: flex; align-items: center; gap: 10px; }
.mail-when select { font: inherit; font-size: 16px; padding: 9px 12px; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--ink); }
.mail-try { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; margin-left: -10px; }
.mail-try form { margin: 0; }
.mail-try a.link-btn { text-decoration: none; display: inline-block; }

/* Under the brief: an offer of the morning e-mail. */
.mail-offer { margin: 28px 0 0; padding: 16px 18px; border-radius: 16px; background: var(--soft); font-size: 15px; }
.mail-offer a { font-weight: 600; }

/* Footer status line: what the site holds right now. */
.foot { flex-wrap: wrap; }
.foot-stats { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding-top: 14px; border-top: 1px dashed var(--rule); font-size: 13px; font-variant-numeric: tabular-nums; }
.foot-stats strong { color: var(--ink); font-weight: 600; }
.foot-stats a { text-decoration: none; }
.foot-stats a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-fresh { display: inline-flex; align-items: center; gap: 7px; }
.foot-fresh .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
@media (min-width: 760px) { .foot-fresh { margin-left: auto; } }
.settings-h { margin: 18px 0 6px; font-size: 24px; letter-spacing: -0.015em; }
.switch-note { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; font-size: 14px; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.settings-nav a { font-size: 14px; font-weight: 500; text-decoration: none; padding: 7px 13px; border-radius: 999px; background: var(--soft); }
.settings-nav a:hover { background: color-mix(in srgb, var(--ink) 9%, var(--soft)); }
.settings-h { scroll-margin-top: calc(var(--top) + 16px); }
#reading { scroll-margin-top: calc(var(--top) + 16px); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Long-form text pages (privacy). */
.prose { max-width: 680px; padding-bottom: 32px; }
.prose h2 { font-size: 21px; letter-spacing: -0.012em; margin: 32px 0 8px; }
.prose p, .prose li { font-size: 16px; line-height: 1.65; color: var(--body); }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin: 4px 0; }
.prose code { font-size: 14px; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; margin: 8px 0 12px; }
.data-table th { text-align: left; font-weight: 600; color: var(--ink); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
.data-table td { vertical-align: top; color: var(--body); padding: 10px 10px 10px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 600px) {
  .data-table thead { display: none; }
  .data-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .data-table td { display: block; padding: 2px 0; border: 0; }
  .data-table td:first-child { font-weight: 600; color: var(--ink); }
}
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
/* Language picker: a quiet select with a globe, in the footer links. */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.lang-switch label { display: inline-flex; align-items: center; gap: 5px; color: inherit; cursor: pointer; }
.lang-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-switch select { font: inherit; color: inherit; background: transparent; border: 0; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); cursor: pointer; }
.lang-switch select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.lang-go[hidden] { display: none; }
.lang-go { font: inherit; font-size: 13px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.lang-form { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.lang-form select { font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); }
.danger-zone h2 { color: var(--err); }
.danger-btn { justify-self: start; padding: 12px 20px; border: 1.5px solid var(--err); border-radius: 999px; background: transparent; color: var(--err); font-weight: 600; font-size: 15px; cursor: pointer; }
.danger-btn:hover { background: color-mix(in srgb, var(--err) 10%, transparent); }
#delete { scroll-margin-top: calc(var(--top) + 16px); }

/* Admin stats. */
.admin { max-width: 900px; }
/* Admin: users. */
.users-table { margin-top: 18px; }
.users-table td { font-size: 15px; }
.users-table tr.is-blocked td:first-child { text-decoration: line-through; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; margin: 0 4px 2px 0; border-radius: 999px; background: var(--soft); color: var(--muted); text-transform: none; }
.badge-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge-err { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.user-actions { white-space: nowrap; text-align: right; }
.user-actions form { display: inline; }
@media (max-width: 600px) { .user-actions { text-align: left; } }
.kpis { display: grid; gap: 16px; margin: 8px 0 28px; }
.kpi-group h2, .admin-sec h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.admin-sec h2 .muted { font-weight: 400; margin-left: 6px; }
.kpi-group dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.kpi-group dl > div { background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.kpi-group dt { font-size: 13px; color: var(--muted); }
.kpi-group dd { margin: 2px 0 0; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.admin-sec { margin: 0 0 32px; }
.legend { font-size: 13px; display: flex; align-items: center; gap: 6px; margin: -4px 0 8px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.sw.all { background: color-mix(in srgb, var(--ink) 22%, var(--bg)); margin-left: 0; }
.sw.mem { background: var(--sun); }
.days-table .num, .rank .num { text-align: right; font-variant-numeric: tabular-nums; }
.days-table td, .days-table th { padding: 6px 10px 6px 0; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar { flex: 1; height: 10px; background: transparent; }
.bar-all { display: block; height: 100%; background: color-mix(in srgb, var(--ink) 22%, var(--bg)); border-radius: 3px; overflow: hidden; }
.bar-mem { display: block; height: 100%; background: var(--sun); }
.rank { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.rank li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.rank li span:first-child { overflow-wrap: anywhere; }
.small { font-size: 13px; }
@media (min-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-group dl { grid-template-columns: repeat(2, 1fr); }
  .admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) { .days-table thead { display: table-header-group; } .days-table tr { display: table-row; } .days-table td { display: table-cell; } .days-table td:first-child { font-weight: 400; } }
.days-table td:first-child, .days-table th { white-space: nowrap; } .days-table { font-size: 13px; }

/* Explains a wait under a busy button (data-busy-note). */
.busy-note { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; }
.busy-note::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); margin-right: 8px; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) { .busy-note::before { animation: busy-pulse 1.2s ease-in-out infinite; } }
@keyframes busy-pulse { 50% { opacity: .3; } }
.oauth-btn.busy { opacity: .7; pointer-events: none; }

/* Save for later: a bookmark next to the votes, filled in the accent once saved. */
.votes .save-btn { margin-right: 6px; }
.votes .save-btn[aria-pressed="true"] { background: transparent; }
.votes .save-btn[aria-pressed="true"] svg { stroke: var(--sun); fill: var(--sun); }
.votes .save-btn[aria-pressed="true"]:hover { background: var(--soft); }

/* Landing: what visitors see around today's brief on the front page. */
.h1 { font-weight: 650; font-size: 32px; line-height: 1.08; letter-spacing: -0.028em; margin: 0 0 8px; text-wrap: balance; }
.hero { padding: 40px 0 28px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.hero h1 { font-size: 40px; line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; max-width: 14ch; margin: 0 0 16px; }
.hero-lead { font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--body); max-width: 34em; margin: 0 0 24px; text-wrap: pretty; }
.hero-cta { display: grid; gap: 8px; max-width: 360px; }
.hero-cta .primary-btn { display: block; text-align: center; text-decoration: none; }
.hero-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.hero-note a { color: var(--ink); font-weight: 500; }
.landing { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 8px; }
.land-sec { padding: 32px 0 8px; scroll-margin-top: calc(var(--top) + 16px); }
.land-sec h2, .land-final h2 { font-size: 26px; line-height: 1.15; letter-spacing: -0.022em; margin: 0 0 18px; text-wrap: balance; }
.land-sec h3 { font-size: 17px; margin: 0 0 6px; letter-spacing: -0.01em; }
.land-sec p { margin: 0; color: var(--body); font-size: 16px; line-height: 1.6; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--ink); font-weight: 650; font-size: 15px; display: grid; place-items: center; }
.compare { display: grid; gap: 22px; }
.compare > div { border-top: 2px solid var(--rule); padding-top: 14px; }
.compare h3 { color: var(--muted); }
.compare .ours { border-top-color: var(--sun); }
.compare .ours h3 { color: var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); max-width: 680px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 22px; font-weight: 400; color: var(--muted); transition: transform 150ms; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; max-width: 60ch; }
.faq a { color: var(--ink); font-weight: 500; }
.land-final { padding: 44px 0 16px; }
.land-final h2 { max-width: 18ch; }
@media (min-width: 760px) {
  .h1 { font-size: 46px; }
  .hero { padding: 64px 0 40px; }
  .hero h1 { font-size: 64px; }
  .hero-lead { font-size: 22px; }
  .hero-cta { grid-template-columns: auto auto auto; max-width: none; justify-content: start; }
  .hero-cta .primary-btn, .hero-cta .oauth-btn { padding: 13px 22px; }
  .steps, .compare { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .land-sec { padding-top: 48px; }
  .land-sec h2, .land-final h2 { font-size: 34px; }
}
@media (min-width: 1080px) {
  .brief-grid .hero { grid-column: 1 / -1; grid-row: 1; }
  .brief-grid.with-hero .masthead { grid-row: 2; }
  .brief-grid.with-hero .brief-bar, .brief-grid.with-hero .brief-main { grid-row: 3; }
}

/* Landing features: text beside a small example of the thing itself. */
.feature { display: grid; gap: 22px; }
.feature-text p + p { margin-top: 12px; }
.feature-demo { margin: 0; }
.feature-demo figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.demo-card { border: 1px solid var(--rule); border-radius: 16px; padding: 18px 20px; background: var(--bg); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent); }
.demo-meta { margin: 0 0 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.demo-meta strong { color: var(--ink); font-weight: 600; }
.demo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.land-sec .demo-title { margin: 0 0 6px; font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.land-sec .demo-summary { margin: 0 0 8px; font-family: var(--serif); font-size: 17px; line-height: 1.55; color: var(--body); }
.land-sec .demo-src { margin: 0; font-size: 13px; color: var(--muted); }
.demo-search { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 16px; color: var(--ink); background: var(--bg); }
.demo-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.demo-results { list-style: none; margin: 10px 0 0; padding: 4px 16px; border: 1px solid var(--rule); border-radius: 16px; }
.demo-results li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.demo-results li:last-child { border-bottom: 0; }
.demo-results span { font-weight: 600; font-size: 15px; line-height: 1.35; }
.demo-results small { font-size: 13px; color: var(--muted); }
@media (min-width: 760px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .feature:nth-child(even) .feature-text { order: 2; }
}
@media (max-width: 759px) { .demo-search { border-radius: 18px; font-size: 15px; } }
.land-claim { margin: 22px 0 0; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--body); }
.land-sec .feature-try { margin-top: 16px; font-weight: 500; } .feature-try a { color: var(--ink); }

/* Share button and its "copied" toast. */
.votes .share-btn svg { fill: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bar) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 50; box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 25%, transparent); }
@media (min-width: 760px) { .toast { bottom: 32px; } }

/* The shareable story page. */
.story-page { max-width: 680px; }
.story-page h1 { font-size: 34px; line-height: 1.12; }
.story-summary { font-family: var(--serif); font-size: 21px; line-height: 1.55; color: var(--body); margin: 8px 0 14px; text-wrap: pretty; }
.story-actions { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; }
.read-btn { display: inline-block; text-decoration: none; padding: 13px 22px; }
.story-actions .votes { margin-left: auto; }
.also { margin: 26px 0 0; }
.also h2, .story-more h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }
.also ul, .story-more ul { list-style: none; margin: 0; padding: 0; }
.also li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--rule); }
.also li a { font-weight: 600; text-decoration: none; }
.also li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.also li span { font-size: 14px; color: var(--muted); }
.story-pitch { margin: 36px 0 0; padding: 26px 24px; border-radius: 20px; background: var(--soft); }
.story-pitch .pitch-from { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.story-pitch h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.story-pitch p { margin: 0 0 18px; color: var(--body); }
.story-more { margin: 36px 0 24px; }
.story-more li { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; gap: 4px; }
.story-more .meta { margin: 0; }
.story-more li a { font-weight: 600; font-size: 17px; line-height: 1.3; text-decoration: none; }
.story-more li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.story-more small { color: var(--muted); font-size: 13px; }
@media (min-width: 760px) { .story-page h1 { font-size: 44px; } }

/* Add to home screen: menu/footer entries appear only where it can be done. */
.usermenu-panel [hidden], .foot-links [hidden] { display: none; }
.link-like { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.install-help h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.015em; padding-right: 32px; }
.install-help ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 16px; line-height: 1.5; }
.install-help svg { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip span small { font-size: 12px; opacity: .6; margin-left: 2px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; flex: none; }
html[data-theme="dark"] .brand-mark { box-shadow: 0 0 0 1px #2B2B2B; }

/* Archive: topics by day */
.grid-pager { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.grid-pager a { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 500; font-size: 15px; text-decoration: none; }
.grid-pager a[rel="next"] { margin-left: auto; padding: 7px 10px 7px 14px; }
.grid-pager svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.grid-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; -webkit-overflow-scrolling: touch; }
.topic-grid-table { border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; min-width: 100%; }
.topic-grid-table th, .topic-grid-table td { padding: 0; text-align: center; font-size: 14px; }
.topic-grid-table td { width: 50px; min-width: 44px; height: 36px; border-radius: 8px; color: var(--muted); }
.topic-grid-table td .g-link { display: grid; place-items: center; height: 36px; border-radius: 8px; color: inherit; font-weight: 600; text-decoration: none; }
.topic-grid-table td .g-link:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.topic-grid-table button.g-link { width: 100%; margin: 0; padding: 0; border: 0; background: none; font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
.topic-grid-table .g-topic button.g-link { width: auto; text-align: left; font-weight: 500; color: var(--ink); }
.topic-grid-table .g-day button.g-link { width: 100%; padding: 4px 2px; }
.topic-grid-table td > span { color: color-mix(in srgb, var(--muted) 50%, transparent); }
.topic-grid-table .heat1 { background: color-mix(in srgb, var(--sun) 14%, var(--bg)); color: var(--ink); }
.topic-grid-table .heat2 { background: color-mix(in srgb, var(--sun) 32%, var(--bg)); color: var(--ink); }
.topic-grid-table .heat3 { background: color-mix(in srgb, var(--sun) 58%, var(--bg)); color: var(--sun-ink); }
.topic-grid-table .heat4 { background: var(--sun); color: var(--sun-ink); }
.topic-grid-table .g-topic { position: sticky; left: 0; z-index: 1; background: var(--bg); text-align: left; font-weight: 500; white-space: nowrap; padding-right: 10px; box-shadow: -20px 0 0 var(--bg); }
.topic-grid-table tbody .g-topic .g-link { color: var(--ink); text-decoration: none; }
.topic-grid-table tbody .g-topic .g-link:hover { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.topic-grid-table tr.is-mine .g-topic .g-link::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--sun); vertical-align: middle; }
.topic-grid-table tr.g-gap td { height: 6px; }
.topic-grid-table thead th { padding-bottom: 4px; vertical-align: bottom; }
.topic-grid-table .g-day .g-link { display: grid; gap: 1px; padding: 4px 2px; border-radius: 8px; color: var(--muted); text-decoration: none; line-height: 1.2; }
.topic-grid-table .g-day .g-link:hover { background: var(--soft); color: var(--ink); }
.topic-grid-table .g-wd { font-size: 12px; }
.topic-grid-table .g-date { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.topic-grid-table .g-day.is-today .g-wd { color: var(--ink); font-weight: 600; }
.topic-grid-table .g-sum { color: var(--muted); font-weight: 500; padding-left: 8px; min-width: 52px; text-align: right; }
.topic-grid-table thead .g-sum { font-size: 12px; font-weight: 400; vertical-align: bottom; }
.topic-grid-table tfoot > * > * { border-top: 10px solid transparent; background-clip: padding-box; }
.topic-grid-table tfoot td .g-link { font-weight: 500; }
.topic-grid-table tfoot .g-topic { color: var(--muted); font-weight: 500; }
.grid-note { margin: 12px 0 32px; font-size: 14px; color: var(--muted); }
@media (min-width: 900px) { .grid-scroll { margin: 0; padding: 0 0 4px; } }

/* One topic across days */
.topic-day { margin-top: 26px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 16px; font-weight: 600; }
.day-head a { color: var(--ink); text-decoration: none; }
.day-head a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.day-head span { color: var(--muted); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.day-more { margin: 8px 0 0; font-size: 15px; }
.day-more a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; text-decoration-color: var(--sun); }
.topic-page .masthead .kicker a { color: var(--muted); text-underline-offset: 3px; }
/* Landing: a live slice of the archive grid */
.demo-grid { display: block; overflow: hidden; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 16px; background: var(--bg); text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent); transition: border-color .15s; }
.demo-grid:hover { border-color: var(--ink); }
.demo-grid table { width: 100%; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.demo-grid th, .demo-grid td { padding: 0; font-size: 13px; text-align: center; }
.demo-grid thead th { padding-bottom: 4px; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.demo-grid thead th span { display: block; font-weight: 400; color: var(--muted); }
.demo-grid tbody th { width: 34%; text-align: left; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.demo-grid thead th:first-child { width: 34%; }
.demo-grid td { height: 30px; border-radius: 7px; font-weight: 600; color: color-mix(in srgb, var(--muted) 50%, transparent); }
.demo-grid .heat1 { background: color-mix(in srgb, var(--sun) 14%, var(--bg)); color: var(--ink); }
.demo-grid .heat2 { background: color-mix(in srgb, var(--sun) 32%, var(--bg)); color: var(--ink); }
.demo-grid .heat3 { background: color-mix(in srgb, var(--sun) 58%, var(--bg)); color: var(--sun-ink); }
.demo-grid .heat4 { background: var(--sun); color: var(--sun-ink); }

/* Support page */
.support-page { max-width: 1000px; }
.support-lead { font-size: 17px; line-height: 1.55; max-width: 62ch; }
.support-layout { display: grid; gap: 36px; padding: 18px 0 40px; }
.support-page h2 { font-size: 20px; margin: 0 0 14px; letter-spacing: -0.012em; }
.support-page h3 { font-size: 15px; margin: 26px 0 8px; }
.support-costs { margin: 0; display: grid; gap: 18px; }
.support-costs > div { padding-left: 16px; border-left: 3px solid var(--sun); }
.support-costs dt { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.support-costs dd { margin: 0; color: var(--body); line-height: 1.55; }
.support-give { align-self: start; padding: 22px; border: 1px solid var(--rule); border-radius: 20px; background: var(--raise); }
.give-form { display: grid; gap: 16px; }
.give-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.give-form legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.give-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--soft); }
.give-seg label, .give-presets label { position: relative; cursor: pointer; }
.give-seg input, .give-presets input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.give-seg span { display: block; padding: 9px 12px; border-radius: 999px; text-align: center; font-weight: 600; font-size: 15px; color: var(--muted); }
.give-seg input:checked + span { background: var(--ink); color: var(--bg); }
.give-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.give-presets span { display: block; padding: 12px 4px; border: 1.5px solid var(--rule); border-radius: 12px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.give-presets input:checked + span { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 18%, var(--bg)); color: var(--ink); }
.give-seg input:focus-visible + span, .give-presets input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.give-custom { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.give-input { display: flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--bg); }
.give-input:focus-within { border-color: var(--ink); }
.give-input input { flex: 1; min-width: 0; padding: 12px 14px; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.give-input b { padding: 0 14px; color: var(--muted); font-weight: 500; }
.give-cur { margin: 10px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.give-cur a { padding: 3px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.give-cur a[aria-current] { background: var(--soft); color: var(--ink); font-weight: 600; }
.give-go { width: 100%; }
.give-note, .give-off { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.give-canceled { margin: 0 0 14px; }
.support-facts { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; color: var(--body); line-height: 1.5; }
.support-facts a, .give-off a { color: var(--ink); text-underline-offset: 3px; }
.support-thanks { padding: 10px 0 40px; display: grid; gap: 18px; }
.support-thanks a:not(.more-btn) { color: var(--ink); }
@media (min-width: 860px) { .support-layout { grid-template-columns: 1.1fr 1fr; gap: 48px; } }
@media (prefers-reduced-motion: reduce) { .src-group summary svg { transition: none; } }
.library-head + .src-groups { margin-top: 12px; }
