:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --card: #fdfcf8;
  --ink: #161e20;
  --muted: #565f60;
  --line: #dbddd3;
  --accent: #28544a;
  --pale: #e8eee6;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #41776a; outline-offset: 3px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.masthead { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; gap: 9px; align-items: center; text-decoration: none; font: bold 26px/1 var(--serif); letter-spacing: -.04em; }
.brand img { border-radius: 7px; }
.top-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
.quiet, .primary { border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 650; }
.quiet:hover { background: var(--pale); }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #193f36; }
.intro { padding: 45px 0 39px; }
.edition { text-transform: uppercase; letter-spacing: .115em; font-size: .72rem; font-weight: 700; color: var(--accent); margin: 0 0 17px; }
h1 { font: 500 clamp(3.45rem, 9.2vw, 7.8rem)/.86 var(--serif); letter-spacing: -.083em; margin: 0; }
h1 em { color: var(--accent); font-weight: 400; }
.tagline { margin: 25px 0 0; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 10px 0; }
.filters { display: flex; gap: 4px; }
.filters button { padding: 9px 14px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 650; font-size: .9rem; }
.filters button:hover, .filters button[aria-pressed=true] { background: var(--pale); color: var(--accent); }
.search input { width: 240px; max-width: 100%; min-height: 39px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--ink); font-size: .87rem; }
.feed-heading { margin: 23px 0 14px; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; }
.feed-heading h2, .dialog-heading h2 { margin: 0; font: 500 1.65rem/1.15 var(--serif); letter-spacing: -.045em; }
#status { margin: 0; color: var(--muted); font-size: .78rem; }
.feed-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.article-count { margin: 0; color: var(--ink); font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.article-count:empty { display: none; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: var(--accent); font-size: .78rem; font-weight: 650; text-decoration: underline; text-underline-offset: .14em; }
.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line); gap: 1px; }
.entries:empty { display: none; }
.story { min-width: 0; min-height: 158px; display: flex; flex-direction: column; gap: 10px; padding: 19px; background: var(--card); }
.story:first-child:nth-last-child(n+2) { grid-column: span 2; background: #edf0e7; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 700; font-size: .73rem; color: var(--accent); }
.story-meta span:last-child { text-transform: uppercase; font-size: .64rem; letter-spacing: .08em; color: var(--muted); }
.story h3 { font: 500 1.4rem/1.14 var(--serif); letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
.story:first-child h3 { font-size: clamp(1.5rem, 3.2vw, 2.35rem); }
.story a { text-decoration-thickness: 1px; text-underline-offset: .16em; text-decoration-color: transparent; }
.story a:hover, .story a:focus-visible { text-decoration-color: currentColor; }
.story time { color: var(--muted); font-size: .75rem; }
.thumbnail { display: block; width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 5px; background: var(--pale); }
.story:first-child .thumbnail { aspect-ratio: 16 / 6; }
.story-footer { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: auto; }
.genre { font-size: .72rem; color: var(--accent); font-weight: 650; }
.genre-controls { display: flex; gap: 4px; margin-left: auto; }
.genre-controls button { border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; color: var(--accent); font-size: .73rem; font-weight: 650; background: var(--card); }
.genre-controls button:hover { background: var(--pale); }
.genre-controls button[aria-pressed=true] { color: white; border-color: var(--accent); background: var(--accent); }
.story .genre-controls button:focus-visible { outline-offset: 1px; }
.more { display: block; margin: 20px auto 0; }
.empty { grid-column: 1 / -1; margin: 0; padding: 26px; background: var(--card); }
footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-top: 44px; padding: 15px 0 25px; font-size: .78rem; color: var(--muted); }
footer p { margin: 0; }
footer span { font: bold .98rem var(--serif); }
dialog { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; width: min(calc(100% - 26px), 550px); max-height: min(86dvh, 730px); padding: 22px; }
dialog::backdrop { background: #0c1a1799; }
dialog p { color: var(--muted); margin: 9px 0 15px; font-size: .9rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.close { border: 0; background: transparent; color: var(--ink); border-radius: 3px; padding: 0 6px; font-size: 1.55rem; line-height: 1; }
fieldset { border: 0; margin: 12px 0 0; padding: 0; }
legend { font: bold 1.06rem var(--serif); padding: 0 0 6px; }
.source { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.source label { display: flex; flex: 1; gap: 9px; cursor: pointer; align-items: center; font-size: .9rem; font-weight: 650; }
.source input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.source small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.source a { font-size: .74rem; color: var(--muted); }
.source-action { font-size: .73rem; padding: 5px 8px; color: var(--accent); }
.source-removed { justify-content: space-between; font-size: .88rem; }
.topics-list { padding: 0; margin: 0; list-style: none; }
.topics-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding: 8px 0; font-size: .89rem; }
.topics-list li strong { margin-right: auto; }
.dialog-actions { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 38px); }
  .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 490px) {
  .masthead { min-height: 63px; }
  .brand { font-size: 1.24rem; gap: 6px; }
  .brand img { width: 26px; height: 26px; }
  .top-actions { gap: 6px; }
  .top-actions button { padding: 8px; font-size: .73rem; }
  .intro { padding: 38px 0 29px; }
  .tagline { font-size: .88rem; margin-top: 19px; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .search input { width: 100%; font-size: 1rem; }
  .entries { grid-template-columns: minmax(0, 1fr); }
  .story, .story:first-child:nth-last-child(n+2) { min-height: 0; grid-column: auto; padding: 15px; }
  .story:first-child .thumbnail { aspect-ratio: 16 / 8; }
}
