:root {
  --bg: #f6f3ea;
  --text: #111;
  --muted: #666;
  --line: #111;
  --link: #0000cc;
  --visited: #777;
  --card: #fffdf7;
  --shadow: rgba(0, 0, 0, 0.08);
}

body.dark {
  --bg: #111;
  --text: #eee;
  --muted: #aaa;
  --line: #eee;
  --link: #9db7ff;
  --visited: #888;
  --card: #1a1a1a;
  --shadow: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 18px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.masthead {
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 6px solid var(--line);
  border-bottom: 6px solid var(--line);
  text-align: center;
}

h1 {
  margin: 0;
  font-family: Arial Black, Helvetica, sans-serif;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.9;
}

h2 {
  margin: 0 0 8px;
  border-bottom: 2px solid var(--line);
  font-size: 17px;
  text-transform: uppercase;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

input,
button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
}

input {
  min-width: min(100%, 320px);
  padding: 8px 10px;
}

button {
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: bold;
}

button:hover,
button:focus-visible {
  box-shadow: 0 2px 8px var(--shadow);
}

.top {
  margin-bottom: 22px;
  padding: 12px;
  border: 3px solid var(--line);
  background: var(--card);
}

.top h2 {
  text-align: center;
}

.story-list {
  columns: 2 280px;
  column-gap: 28px;
}

.layout {
  display: block;
}

.grid {
  columns: 4 220px;
  column-gap: 28px;
}

.category {
  break-inside: avoid;
  margin-bottom: 28px;
}

.item {
  break-inside: avoid;
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.25;
}

.item-row {
  display: flex;
  align-items: flex-start;
}

.item-copy {
  min-width: 0;
}

.item.read {
  opacity: 0.45;
}

.item.hidden {
  display: none;
}

a {
  color: var(--link);
  font-weight: bold;
  text-decoration: none;
}

a:visited {
  color: var(--visited);
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.favicon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

.thumbnail {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 27px;
  margin-right: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.box {
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}

.box p {
  margin: 8px 0;
}

.jet-links-footer {
  margin-top: 24px;
  font-size: 13px;
}

.manual-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual-links a {
  display: inline-block;
}

footer {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 850px) {
  .manual-links {
    gap: 8px 12px;
  }
}
