* { box-sizing: border-box; }
:root {
  --paper: #eee8dc;
  --ink: #201e1a;
  --muted: #6c675e;
  --line: #bdb5a7;
  --accent: #a52f2a;
  --green: #42634e;
}
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(50, 43, 32, .12) .45px, transparent .65px);
  background-size: 4px 4px;
  font-family: 'Source Sans 3', Georgia, serif;
}
.masthead, main, footer { max-width: 1220px; margin: auto; padding-left: 32px; padding-right: 32px; }
.masthead { display: flex; flex-direction: column; align-items: center; gap: 13px; height: auto; padding-top: 18px; padding-bottom: 15px; border-bottom: 3px double var(--ink); }
.brand { display: flex; align-items: baseline; gap: 9px; color: var(--ink); font: 700 54px/1 'Libre Baskerville', Georgia, serif; }
.brand-mark { color: var(--accent); font: italic 400 17px/1 'Libre Baskerville', Georgia, serif; }
.header-meta, .kicker, .refresh-meta, footer { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 9px; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
#header-updated { color: var(--accent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.slash { color: var(--line); }
#suggestion-button { margin-left: auto; border: 1px solid var(--accent); padding: 7px 9px; color: var(--accent); background: transparent; font: 500 9px 'DM Mono', monospace; text-transform: uppercase; cursor: pointer; }
#suggestion-button:hover:not(:disabled) { color: var(--paper); background: var(--accent); }
#suggestion-button:disabled { opacity: .6; cursor: not-allowed; }
#suggestion-full { flex-basis: 100%; color: var(--accent); text-align: right; }
.intro { display: flex; justify-content: space-between; align-items: end; padding: 23px 0 17px; border-bottom: 3px double var(--ink); }
.kicker { margin: 0 0 7px; color: var(--accent); font-weight: 500; }
.kicker span { margin-left: 8px; color: var(--muted); }
h1 { margin: 0; font: 700 39px/1.08 'Libre Baskerville', Georgia, serif; }
h1 em { color: var(--accent); font-weight: 400; }
.intro-note { max-width: 270px; padding-bottom: 6px; color: var(--muted); font: 9px 'DM Mono', monospace; letter-spacing: .04em; text-align: right; }
.generation-tabs { display: flex; gap: 30px; margin: 24px 0 0; border-bottom: 1px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.generation-tabs::-webkit-scrollbar { display: none; }
.generation-tab { position: relative; border: 0; padding: 0 0 11px; color: var(--muted); background: transparent; font: 700 13px 'Source Sans 3', sans-serif; cursor: pointer; white-space: nowrap; }
.generation-tab.active { color: var(--ink); }
.generation-tab.active::after { content: ''; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--accent); }
.advertise-tab { align-self: flex-start; margin-left: auto; padding: 0 0 11px; color: var(--accent); font: 500 10px 'DM Mono', monospace; text-decoration: none; white-space: nowrap; }
.advertise-tab:hover { text-decoration: underline; text-underline-offset: 4px; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 52px; border-bottom: 2px solid var(--ink); }
.filter-group { display: flex; min-width: 0; height: 50px; align-items: center; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.filter-group::-webkit-scrollbar { display: none; }
.filter, #refresh-button { flex: 0 0 auto; border: 0; padding: 0; color: var(--muted); background: transparent; font: 500 10px 'DM Mono', monospace; text-transform: uppercase; cursor: pointer; }
.filter.active { position: relative; color: var(--accent); }
.filter.active::after { content: ''; position: absolute; right: 0; bottom: -17px; left: 0; height: 2px; background: var(--accent); }
.refresh-meta { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 12px; color: var(--muted); }
.sponsor-slot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; margin: 18px 0; }
.sponsor-slot[hidden] { display: none; }
.sponsor-unit { position: relative; min-width: 0; border-block: 1px solid var(--line); }
.sponsor-label { display: block; padding-top: 9px; color: var(--muted); font: 9px 'DM Mono', monospace; text-transform: uppercase; }
.sponsor-unit a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 0 13px; color: var(--ink); text-decoration: none; }
.sponsor-unit a:hover strong { color: var(--accent); }
.sponsor-banner img { display: block; width: 132px; max-height: 68px; object-fit: contain; }
.sponsor-copy { display: grid; gap: 4px; min-width: 0; }
.sponsor-copy strong { font: 700 16px/1.3 'Libre Baskerville', Georgia, serif; }
.sponsor-copy > span { color: var(--muted); font-size: 13px; }
.sponsor-arrow { color: var(--accent); }
#refresh-countdown { color: var(--accent); white-space: nowrap; }
#refresh-button { color: var(--accent); font: 26px Georgia, serif; line-height: 1; transition: transform .3s ease; }
#refresh-button:disabled { opacity: .45; cursor: wait; }
#refresh-button:hover { transform: rotate(90deg); }
.news-list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 0; }
.story { display: grid; grid-column: span 4; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; gap: 11px 8px; min-width: 0; padding: 22px 22px 24px; border-bottom: 1px solid var(--line); animation: rise .45s both; }
.story:first-child { grid-column: span 8; padding-left: 0; padding-right: 28px; }
.story:nth-child(2) { grid-column: span 4; padding-right: 0; padding-left: 28px; border-left: 1px solid var(--line); }
.story:nth-child(3n + 3) { padding-left: 0; }
.story:nth-child(3n + 4) { border-inline: 1px solid var(--line); }
.story:nth-child(3n + 5) { padding-right: 0; }
.story:first-child::before { grid-column: 1 / -1; color: var(--accent); content: 'LEAD STORY'; font: 500 9px 'DM Mono', monospace; letter-spacing: .08em; }
.story-time { align-self: start; color: var(--muted); font: 10px/1.55 'DM Mono', monospace; }
.story-time span { color: var(--accent); font-size: 9px; }
.story-copy { grid-column: 1 / -1; min-width: 0; }
.story-title { display: block; margin: 0 0 9px; color: var(--ink); font: 700 18px/1.28 'Libre Baskerville', Georgia, serif; text-decoration: none; }
.story:first-child .story-title { max-width: 760px; font-size: 30px; line-height: 1.17; }
.story-title:hover { color: var(--accent); }
.story-title.visited, .story-title:visited { color: #71524b; }
.story-title.visited:hover { color: var(--accent); }
.story-desc { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.story:first-child .story-desc { max-width: 720px; font-size: 15px; line-height: 1.55; -webkit-line-clamp: 7; }
.story-source { align-self: end; color: var(--accent); font: 9px 'DM Mono', monospace; letter-spacing: .02em; text-align: right; text-transform: uppercase; }
.story-arrow { align-self: end; color: var(--accent); font-size: 16px; }
.empty-state { padding: 75px 0; color: var(--muted); text-align: center; }
.empty-line { display: block; width: 40px; height: 2px; margin: auto auto 18px; background: var(--accent); }
.empty-state p { margin: 0 0 7px; color: var(--ink); font: 700 20px 'Libre Baskerville', Georgia, serif; }
.empty-state small { font-size: 12px; }
.generation-empty { padding: 90px 0; color: var(--muted); text-align: center; }
.generation-empty p { margin: 0 0 8px; color: var(--ink); font: 700 21px 'Libre Baskerville', Georgia, serif; }
.generation-empty small { font-size: 12px; }
#suggestion-status { font: 11px 'DM Mono', monospace; }
footer { display: flex; justify-content: space-between; padding-top: 22px; padding-bottom: 30px; border-top: 3px double var(--ink); color: var(--muted); }
footer strong { color: var(--ink); font-weight: 400; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 950px) {
  .filter-group { width: 100%; }
  .refresh-meta { min-width: 0; justify-content: flex-end; flex-wrap: wrap; }
  .news-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .story, .story:first-child, .story:nth-child(2) { grid-column: span 3; padding: 20px 18px 22px; border-inline: 0; }
  .story:first-child { grid-column: span 6; padding-left: 0; padding-right: 0; }
  .story:nth-child(2n + 3) { padding-left: 0; }
  .story:nth-child(2n + 4) { padding-right: 0; padding-left: 18px; border-left: 1px solid var(--line); }
  .story:nth-child(2) { padding-left: 0; }
  .story:first-child .story-title { font-size: 26px; }
}
@media (max-width: 700px) {
  .masthead, main, footer { padding-left: 18px; padding-right: 18px; }
  .masthead { gap: 10px; padding-top: 16px; }
  .brand { font-size: 42px; }
  .header-meta { gap: 6px; font-size: 8px; }
  .intro { display: block; padding: 18px 0 14px; }
  h1 { font-size: 31px; }
  .intro-note { margin-top: 7px; padding: 0; font-size: 8px; text-align: left; }
  .generation-tabs { gap: 22px; margin-top: 19px; }
  .generation-tab { font-size: 12px; }
  .advertise-tab { margin-left: 0; padding-bottom: 10px; }
  .toolbar { display: block; padding: 0 0 8px; }
  .filter-group { width: 100%; height: 45px; gap: 16px; }
  .filter.active::after { bottom: -13px; }
  .refresh-meta { justify-content: flex-end; font-size: 8px; }
  .news-list { grid-template-columns: 1fr; column-gap: 0; }
  .story, .story:first-child, .story:nth-child(2) { grid-column: 1; padding: 16px 0; border-right: 0; }
  .story-copy { grid-column: 1 / -1; }
  .story-title { font-size: 17px; }
  .story:first-child .story-title { font-size: 24px; }
  .story-desc { -webkit-line-clamp: 3; }
}
@media print {
  body { background: #fff; }
  .header-meta, .generation-tabs, .toolbar, .story-arrow { display: none; }
  .masthead, main, footer { max-width: none; padding-left: 0; padding-right: 0; }
  .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story { break-inside: avoid; }
}
