/* frontpage.faith: one stylesheet, colour tokens only (dark mode later = redefine tokens). */
@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #faf7f1;
  --card: #ffffff;
  --ink: #1e2330;
  --muted: #585c68;
  --line: #e7e1d5;
  --edge: #8a8170;
  --gold: #7d5412;
  --gold-soft: #f4ecdd;
  --navy: #23324f;
  --navy-ink: #ffffff;
  --gold-on-navy: #d9a84e;
  --danger: #9b2c2c;
  --ok: #2f6b3a;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--navy); }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }
.phone-only, .icon-btn.phone-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--navy-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header and topic strip ---------- */
.testbar { background: var(--gold-soft); color: var(--ink); font-size: 13px; text-align: center; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
/* Header: the brand block, search box and buttons are all 40px tall and share one vertical center. */
.bar { --hdr: 40px; max-width: 1024px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; height: var(--hdr); }
.brand .mark { width: var(--hdr); height: var(--hdr); flex-shrink: 0; }
/* Logo motion: the steeple lifts like an upvote and the cross glints (front page load, and on hover/focus). */
.mark .mark-steeple { transform-box: fill-box; transform-origin: 50% 100%; }
.mark .mark-rays { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .mark.play .mark-steeple { animation: mark-lift 1s ease-in-out 0.3s both; }
  .mark.play .mark-rays { animation: mark-glint 1s ease-out 0.3s both; }
  .mark.play .mark-cross { animation: mark-cross 1s ease-out 0.3s both; }
  /* Hover/focus use their own names so they also replay on the front page. */
  .brand:hover .mark-steeple, .brand:focus-visible .mark-steeple { animation: mark-lift-h 1s ease-in-out both; }
  .brand:hover .mark-rays, .brand:focus-visible .mark-rays { animation: mark-glint-h 1s ease-out both; }
  .brand:hover .mark-cross, .brand:focus-visible .mark-cross { animation: mark-cross-h 1s ease-out both; }
}
@keyframes mark-lift { 0% { transform: none; } 12% { transform: translateY(1.5px) scaleY(0.95); } 42%, 56% { transform: translateY(-6px); } 86% { transform: translateY(1px); } 100% { transform: none; } }
@keyframes mark-lift-h { 0% { transform: none; } 12% { transform: translateY(1.5px) scaleY(0.95); } 42%, 56% { transform: translateY(-6px); } 86% { transform: translateY(1px); } 100% { transform: none; } }
@keyframes mark-glint { 0%, 36% { opacity: 0; } 58% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes mark-glint-h { 0%, 36% { opacity: 0; } 58% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes mark-cross { 0%, 36% { fill: #d9a84e; } 58% { fill: #f6dc9a; } 82%, 100% { fill: #d9a84e; } }
@keyframes mark-cross-h { 0%, 36% { fill: #d9a84e; } 58% { fill: #f6dc9a; } 82%, 100% { fill: #d9a84e; } }
.brand-text { display: flex; flex-direction: column; justify-content: center; }
.wordmark { display: block; font: 600 22px/22px var(--serif); letter-spacing: -0.01em; }
.wordmark span { color: var(--gold); }
.tagline { display: block; font: 12px/16px var(--sans); color: var(--muted); margin-top: 2px; white-space: nowrap; }
.search { flex: 0 1 240px; min-width: 120px; display: none; margin-left: auto; }
.bar .search input { width: 100%; min-height: 0; height: var(--hdr); padding: 0 12px; font-size: 14px; }
.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bar .btn.small { min-height: 0; height: var(--hdr); white-space: nowrap; flex-shrink: 0; }
.bar .name-btn { display: inline-block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; line-height: calc(var(--hdr) - 2px); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card); color: var(--navy); text-decoration: none; font-size: 20px; line-height: 1; }
.search-toggle summary { list-style: none; cursor: pointer; }
.search-toggle summary::-webkit-details-marker { display: none; }
.search-toggle[open] .search-drop { display: block; }
.search-drop { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px; }
.search-drop input { width: 100%; }

.topics { border-top: 1px solid var(--line); }
.topics ul { max-width: 1024px; margin: 0 auto; padding: 0 8px; list-style: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; align-items: center; }
.topics li { flex-shrink: 0; }
.topics a, .topics summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.topics a[aria-current='page'] { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.topics a:hover { color: var(--ink); }
.topics .divider { display: block; width: 1px; height: 20px; background: var(--edge); margin: 0 6px; }
.trad-menu { position: relative; }
.trad-menu summary { list-style: none; border: 1px solid var(--edge); border-radius: 999px; min-height: 32px; margin-left: 6px; color: var(--ink); }
.trad-menu summary::-webkit-details-marker { display: none; }
.trad-menu ul { display: block; position: fixed; z-index: 30; background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 4px; box-shadow: 0 6px 24px rgba(30, 35, 48, 0.12); min-width: 180px; overflow: visible; }
.trad-menu ul a { display: flex; border: 0; }

/* ---------- Page frame ---------- */
.page { max-width: 1024px; margin: 0 auto; padding: 0 0 48px; display: grid; grid-template-columns: 1fr; gap: 24px; }
.main { min-width: 0; }
.rail { display: none; }
.narrow { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.prose { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; font-size: 16px; line-height: 1.65; }
.prose h1, .narrow h1, .page-title { font: 600 28px/1.2 var(--serif); margin: 8px 0 16px; }
.prose h2 { font: 600 20px/1.3 var(--serif); margin: 28px 0 8px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.list-head h1 { font: 600 24px/1.2 var(--serif); margin: 0; }
h2.page-title { font-size: 20px; margin: 28px 0 8px; }
h1 .badge { font-family: var(--sans); vertical-align: middle; }
.narrow ul:not(.checks) li { padding: 5px 0; }
.narrow .card + .card, .narrow form + .card, .narrow .card + form { margin-top: 16px; }
.home-intro { margin: 0; padding: 12px 16px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.card-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 !important; font-size: 14px; }
.list-intro { padding: 0 16px 8px; color: var(--muted); font-size: 14px; margin: 0; }
.toggle { display: flex; gap: 4px; font-size: 14px; flex-shrink: 0; }
.toggle a { white-space: nowrap; padding: 6px 10px; min-height: 40px; display: inline-flex; align-items: center; border-radius: var(--radius); text-decoration: none; color: var(--muted); }
.toggle a[aria-current='page'] { background: var(--gold-soft); color: var(--ink); font-weight: 600; }

/* ---------- Story list ---------- */
.stories { list-style: none; margin: 0; padding: 0; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.story:last-child { border-bottom: 0; }
.rank { display: none; width: 28px; text-align: right; color: var(--muted); font-size: 13px; padding-top: 12px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.vote { flex-shrink: 0; }
.vote button, .vote .vote-static { width: 44px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card); color: var(--navy); cursor: pointer; font: 600 12px/1 var(--sans); padding: 0; }
.vote button:hover { border-color: var(--navy); }
.vote .tri { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid currentColor; }
.vote button[aria-pressed='true'], .vote .vote-static.voted { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }
.vote button[disabled] { cursor: default; }
.story-body { min-width: 0; flex: 1; }
.story-title { font: 500 17px/1.35 var(--serif); margin: 2px 0 0; }
.story-title a { color: var(--ink); text-decoration: none; }
.story-title a:hover { text-decoration: underline; color: var(--ink); }
.story-title a:visited { color: #4b4f5c; }
.brief { margin: 3px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 0; align-items: center; }
.meta a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 28px; }
.meta a:hover { color: var(--ink); text-decoration: underline; }
.meta .topic { color: var(--gold); font-weight: 500; }
.meta a.disc { color: var(--navy); font-weight: 600; }
/* Each separator belongs to the item after it, so a line never ends on a dangling dot. */
.meta > * + *::before { content: '·'; content: '·' / ''; margin-right: 6px; color: var(--muted); font-weight: 400; display: inline-block; text-decoration: none; }
.meta .hide-phone { display: none; }
.more-line { font-size: 12px; color: var(--muted); margin: 2px 0 0; display: flex; flex-wrap: wrap; column-gap: 6px; align-items: center; }
.more-line-label { font-weight: 600; color: var(--ink); }
.more-line a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 28px; }
.more-line a:hover { color: var(--ink); text-decoration: underline; }
.more-line > a + a::before { content: '·'; content: '·' / ''; margin-right: 6px; color: var(--muted); display: inline-block; text-decoration: none; }
.badge { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; line-height: 20px; }

.sponsor-row { background: var(--gold-soft); padding-left: 64px; }
.sponsor-row.has-img { padding-left: 12px; }
.sponsor-row .sp-label { font-size: 12px; font-weight: 600; color: var(--gold); }
.sponsor-row img { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; }
.sponsor-row .sp-title { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0; font: 600 16px/1.3 var(--sans); color: var(--ink); text-decoration: none; }
.sponsor-row .sp-title:hover { text-decoration: underline; }

.cards-row > :only-child { grid-column: 1 / -1; }
.cards-row { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.ad-box { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; background: var(--paper); }
.ad-label { font-size: 12px; color: var(--muted); align-self: stretch; text-align: center; margin-bottom: 4px; }
.ad-frame { width: 300px; height: 250px; max-width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px; }
.ad-frame.house { height: auto; min-height: 0; padding: 16px; }
/* A real ad fills the standard 300 × 250 unit exactly: no padding or border eating into it. */
.ad-frame:not(.house) { padding: 0; border: 0; overflow: hidden; }
.ad-frame img { display: block; }
.ad-frame h3 { font: 600 20px/1.3 var(--serif); margin: 0 0 8px; }
.ad-frame p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.more { display: flex; gap: 12px; padding: 16px; }
.empty { padding: 32px 16px; text-align: center; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty h2 { font: 600 20px/1.3 var(--serif); margin: 0 0 6px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font: 600 17px/1.3 var(--serif); margin: 0 0 6px; }
.card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.card.navy { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }
.card.navy p { color: #dfe3ec; }
.card.navy h2 { color: var(--navy-ink); }
.card.navy label { color: var(--navy-ink); }
.card ol { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.card .err { color: #ffd9d9; }

/* ---------- Forms and buttons ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; margin: 2px 0 0; }
input[type='text'], input[type='email'], input[type='url'], input[type='search'], input[type='number'], select, textarea {
  width: 100%; font: 15px/1.4 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 9px 10px; min-height: 42px;
}
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--navy); background: var(--navy); color: var(--navy-ink); font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #1a263d; color: var(--navy-ink); }
.btn.secondary { background: var(--card); color: var(--navy); border-color: var(--edge); }
.btn.secondary:hover { border-color: var(--navy); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.gold { background: var(--gold-on-navy); border-color: var(--gold-on-navy); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0 4px; color: var(--muted); font: 12px var(--sans); cursor: pointer; min-height: 40px; min-width: 40px; text-decoration: underline; }
.linkbtn:hover { color: var(--ink); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
form.card > fieldset > label:first-child { margin-top: 0; }
legend { padding: 0; font-weight: 600; font-size: 14px; }
form + .hint { margin-top: 16px; }
.checks-below { margin-top: 16px; }
.card.navy :focus-visible { outline-color: var(--gold-on-navy); }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); margin: 12px 0; font-size: 14px; }
.notice.ok { border-color: #9cc7a4; background: #eef7ef; }
.notice.warn { border-color: #e0c78f; background: var(--gold-soft); }
.notice.err { border-color: #e2a3a3; background: #fbeeee; color: var(--danger); }
.field-err { color: var(--danger); font-size: 13px; margin-top: 4px; }
.choices { display: grid; gap: 10px; margin: 16px 0; }
.choices .btn { justify-content: flex-start; }

/* ---------- Discussion ---------- */
.story-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 16px; display: flex; gap: 12px; }
.story-head h1 { font: 600 24px/1.25 var(--serif); margin: 0; }
.story-head h1 a { color: var(--ink); text-decoration: none; }
.brief-full { font-size: 15px; margin: 10px 0 2px; }
.brief-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.also { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.thread-wrap { padding: 16px; }
.thread-title { font: 600 20px/1.3 var(--serif); margin: 8px 0 12px; }
.comment-box, .thread-wrap > .card, .thread-wrap > .notice { margin-bottom: 20px; }
.c-body { max-width: 68ch; }
details.flag summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; font-size: 12px; color: var(--muted); text-decoration: underline; }
details.flag summary::-webkit-details-marker { display: none; }
.row-btns details.flag[open] { flex-basis: 100%; }
.comment-box textarea { margin-top: 4px; }
.comments { list-style: none; margin: 0; padding: 0; }
.comments .comments { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.comment { padding: 10px 0 4px; }
.c-head { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.c-head a { color: var(--muted); }
.c-head .author { color: var(--ink); font-weight: 600; text-decoration: none; }
.c-body { font-size: 15px; margin: 4px 0; overflow-wrap: anywhere; }
.c-body p { margin: 0 0 8px; }
.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 12px; }
.c-actions details summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; text-decoration: underline; color: var(--muted); }
.c-actions details summary::-webkit-details-marker { display: none; }
.c-actions details[open] { flex-basis: 100%; }
.c-vote { border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card); color: var(--navy); min-width: 40px; min-height: 40px; padding: 0 8px; cursor: pointer; font: 600 12px var(--sans); display: inline-flex; align-items: center; gap: 4px; }
.c-vote[aria-pressed='true'] { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }
.c-note { font-size: 12px; color: var(--gold); font-weight: 600; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- Steward / admin ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 16px; }
.tabs a { white-space: nowrap; padding: 10px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; min-height: 40px; }
.tabs a[aria-current='page'] { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.qcard .kind { font-size: 12px; font-weight: 700; color: var(--gold); }
.qcard h3 { font: 600 17px/1.3 var(--serif); margin: 4px 0; }
.qcard blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); }
.qcard .note { font-size: 13px; color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
table.data th, table.data td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.checks { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; }
.checks li { padding: 2px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--edge); margin-right: 6px; vertical-align: middle; }
.dot.pass { background: var(--ok); border-color: var(--ok); }
.dot.concern { background: #c7922c; border-color: #c7922c; }
.dot.fail { background: var(--danger); border-color: var(--danger); }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 8px 0 16px; }
.stat-row strong { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 16px 40px; font-size: 13px; color: var(--muted); }
.site-footer nav { max-width: 1024px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; }
.site-footer a { color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
.site-footer p { text-align: center; margin: 8px 0 0; }

/* ---------- Popover (visitor vote check) ---------- */
.pop { position: fixed; inset: auto 16px 16px 16px; max-width: 360px; margin: 0 auto; z-index: 50; background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(30, 35, 48, 0.2); padding: 16px; }
.pop[hidden] { display: none; }
.pop p { margin: 0 0 10px; font-size: 14px; }

/* ---------- Tablet: 640 to 1023 ---------- */
@media (min-width: 640px) {
  .page { padding: 0 16px 48px; }
  .stories, .empty, .story-head { border: 1px solid var(--line); border-radius: var(--radius); }
  .list-head, .list-intro { padding-left: 0; padding-right: 0; }
  .rank { display: block; }
  .meta .hide-phone { display: inline-flex; }
  .cards-row { grid-template-columns: 1fr 1fr; }
  .sponsor-row { padding-left: 100px; }
  .sponsor-row.has-img { padding-left: 48px; }
  .more { padding: 16px 0; }
  .thread-wrap { padding: 16px 0; }
  .story-head { margin-top: 16px; }
  /* Line the top of the list up with the top of the rail. */
  .main > .stories:first-child, .main > h1.sr-only + .stories, .main > .home-intro + .stories { margin-top: 16px; }
  /* Single-column forms in the page grid line up with the brand instead of floating in the middle. */
  .page > .main.narrow { margin: 0; max-width: 640px; padding-left: 0; padding-right: 0; }
}
@media (min-width: 768px) {
  .search { display: block; }
  .search + .actions { margin-left: 0; }
  .search-toggle { display: none; }
}
/* ---------- Desktop: 1024 and up ---------- */
@media (min-width: 1024px) {
  .page { grid-template-columns: minmax(0, 1fr) 300px; }
  .rail { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
  .rail .ad-box { border: 0; padding: 0; background: none; }
  .rail .ad-frame { width: 300px; height: 250px; }
  .rail .ad-frame.house { height: auto; }
  .in-list-cards { display: none; }
  .page.no-rail { grid-template-columns: 1fr; }
  .home-intro { display: none; }
  .page.no-rail .main { max-width: 712px; }
}
@media (max-width: 639px) {
  .bar { gap: 8px; padding: 8px 12px; }
  .brand { gap: 8px; }
  .brand .mark { width: 36px; height: 36px; }
  .wordmark { font-size: 19px; line-height: 20px; }
  .tagline { display: none; }
  .bar .name-btn { max-width: 10ch; }
  .search-drop { padding: 8px 12px; }
  .search-drop input { min-height: 0; height: 40px; }
  .comments .comments .comments .comments { padding-left: 0; border-left: 0; margin-left: 0; }
  .hide-phone { display: none; }
  .phone-only, .icon-btn.phone-only { display: inline-flex; }
  /* One meta line on phone: the domain gives way, and the discussion link is a full-size tap target on the right. */
  .stories .meta { flex-wrap: nowrap; white-space: nowrap; margin: -4px 0 -8px; }
  .stories .meta .dom { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .stories .meta .topic, .stories .meta .when { flex-shrink: 0; }
  .stories .meta a.disc { margin-left: auto; min-height: 44px; padding-left: 12px; flex-shrink: 0; }
  .stories .meta a.disc::before, .stories .meta > .hide-phone:first-child + *::before { content: none; }
  /* The More: line stays on one line on phone; outlets that do not fit are cut, and the story page lists them all. */
  .stories .more-line { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; margin-top: 6px; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .stories .more-line a { min-height: 32px; flex-shrink: 0; }
  /* Topic strip: the tradition filter comes first after Top and New, and a fade on the right says the strip scrolls. */
  .topics { position: relative; }
  .topics::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 28px; background: linear-gradient(to right, rgba(250, 247, 241, 0), var(--paper)); pointer-events: none; }
  .topics > ul > li { order: 3; }
  .topics > ul > li:nth-child(-n+3) { order: 0; }
  .topics > ul > li.trad-li { order: 1; }
  .topics > ul { padding-right: 28px; }
  .trad-menu summary { margin-left: 0; margin-right: 6px; }
  /* 44px tap targets on phone. */
  .bar { --hdr: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .topics a, .topics summary, .toggle a, .c-vote, .linkbtn, .c-actions details summary, .site-footer a, .tabs a, details.flag summary { min-height: 44px; }
  .trad-menu summary { min-height: 34px; }
}
/* The smallest phones: the wordmark alone carries the brand, so nothing scrolls sideways. */
@media (max-width: 374px) {
  .brand .mark { display: none; }
  .bar .btn.small { padding: 0 10px; }
}
@media (max-width: 331px) {
  .ad-box { padding-left: 0; padding-right: 0; }
}
.how-link { margin-top: 8px !important; }
