/* ==========================================================================
   SIGNAL // FEED — style.css
   Instrument-panel editorial. Zero border-radius. Hairlines. Mono kickers.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Square chrome (scoped: chrome stays square, cards are rounded) ---------- */
.btn-q,
.tabs,
.tab,
.reader-bar {
  border-radius: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- No accidental text selection on taps ---------- */
.item,
.item .title,
.item .meta,
.item .js-open,
.lead,
.lead-title {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.reader-bar,
.reader-bar * {
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Theme tokens ---------- */
:root {
  --bg: #0b0e14;
  --panel: #161a22;
  --panel2: #1e2430;
  --line: #262d3a;
  --ink: #e8edf5;
  --mute: #8a94a6;
  --accent: #4f8cff;
  --accent-ink: #ffffff;
  --head-bg: rgba(11, 14, 20, 0.84);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --hair: 1px;
  --row-h: 76px;
  --thumb-w: 112px;
  --thumb-h: 76px;

  /* image placeholder (empty/failed thumbnails) */
  --ph-bg: #161a22;
  --ph-line: #262d3a;
  --ph-ink: #8a94a6;

  /* popchat ui.css overrides */
  --bg-2: #10131a;
  --surface: #161a22;
  --text: #e8edf5;
  --muted: #8a94a6;
  --accent-2: #4f8cff;
  --radius: 0px;

  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #0b0e14;
  --panel: #161a22;
  --panel2: #1e2430;
  --line: #262d3a;
  --ink: #e8edf5;
  --mute: #8a94a6;
  --accent: #4f8cff;
  --accent-ink: #ffffff;
  --head-bg: rgba(11, 14, 20, 0.84);
  --ph-bg: #161a22;
  --ph-line: #262d3a;
  --ph-ink: #8a94a6;
  --bg-2: #10131a;
  --surface: #161a22;
  --text: #e8edf5;
  --muted: #8a94a6;
  --accent-2: #4f8cff;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel2: #eef1f5;
  --line: #dfe3ea;
  --ink: #16181d;
  --mute: #5c6470;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --head-bg: rgba(246, 247, 249, 0.86);
  --ph-bg: #eef1f5;
  --ph-line: #dfe3ea;
  --ph-ink: #5c6470;
  --bg-2: #eef1f5;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5c6470;
  --accent-2: #2563eb;
  color-scheme: light;
}

/* ---------- Palette overrides (full palettes, both themes) ---------- */
html[data-palette="olive"] {
  --bg: #1c1e17; --panel: #23261d; --panel2: #2b2f22; --line: #3a3f2c;
  --ink: #e6e8da; --mute: #a2a892; --accent: #8f9a5b; --accent-ink: #14160f;
}
html[data-theme="light"][data-palette="olive"] {
  --bg: #f4f5ec; --panel: #eaecdf; --panel2: #e0e3d2; --line: #cfd3bf;
  --ink: #1d2116; --mute: #616853; --accent: #6b7539; --accent-ink: #f7f8ef;
}
html[data-palette="fde"] {
  --bg: #201b14; --panel: #272118; --panel2: #302819; --line: #413727;
  --ink: #ede4d4; --mute: #b0a288; --accent: #b08447; --accent-ink: #17120c;
}
html[data-theme="light"][data-palette="fde"] {
  --bg: #f7f1e6; --panel: #efe7d8; --panel2: #e7ddc9; --line: #d5c8b0;
  --ink: #241d13; --mute: #6e6350; --accent: #8a6330; --accent-ink: #faf5ec;
}
html[data-palette="nv"] {
  --bg: #0b0d0b; --panel: #121512; --panel2: #171b17; --line: #262d26;
  --ink: #d6e3d6; --mute: #8b9a8b; --accent: #7fe08a; --accent-ink: #05110a;
}
html[data-theme="light"][data-palette="nv"] {
  --bg: #f3f6f3; --panel: #e9eee9; --panel2: #dfe6df; --line: #c9d2c9;
  --ink: #10150f; --mute: #5b655a; --accent: #2f7f42; --accent-ink: #f5faf5;
}
html[data-palette="reddot"] {
  --bg: #0c0c0d; --panel: #141416; --panel2: #1a1a1d; --line: #2b2b30;
  --ink: #e7e7ea; --mute: #9a9aa2; --accent: #ff3b30; --accent-ink: #150404;
}
html[data-theme="light"][data-palette="reddot"] {
  --bg: #f7f7f8; --panel: #ececef; --panel2: #e2e2e6; --line: #d0d0d6;
  --ink: #131316; --mute: #5f5f68; --accent: #d92b20; --accent-ink: #fff6f5;
}
html[data-palette="phosphor"] {
  --bg: #050805; --panel: #0a100a; --panel2: #0e160e; --line: #1d2a1d;
  --ink: #9dffb0; --mute: #5fa06c; --accent: #35ff6a; --accent-ink: #041505;
}
html[data-theme="light"][data-palette="phosphor"] {
  --bg: #f2fdf4; --panel: #e6f8ea; --panel2: #d9f2df; --line: #bde4c6;
  --ink: #0b2a12; --mute: #4a7a55; --accent: #128a2e; --accent-ink: #f2fdf4;
}
html[data-palette="amber"] {
  --bg: #0a0703; --panel: #120c05; --panel2: #171008; --line: #2e2110;
  --ink: #ffcc7a; --mute: #b08a4d; --accent: #ffb000; --accent-ink: #160d00;
}
html[data-theme="light"][data-palette="amber"] {
  --bg: #fdf6e8; --panel: #f8edd6; --panel2: #f1e3c6; --line: #e0cda7;
  --ink: #2a1e08; --mute: #7a633c; --accent: #b87400; --accent-ink: #fdf6e8;
}
html[data-palette="solarized"] {
  --bg: #002b36; --panel: #073642; --panel2: #0b4150; --line: #14505f;
  --ink: #eee8d5; --mute: #93a1a1; --accent: #b58900; --accent-ink: #002b36;
}
html[data-theme="light"][data-palette="solarized"] {
  --bg: #fdf6e3; --panel: #f5eedb; --panel2: #eee7d5; --line: #d9d2bf;
  --ink: #073642; --mute: #657b83; --accent: #cb4b16; --accent-ink: #fdf6e3;
}
html[data-palette="nord"] {
  --bg: #2e3440; --panel: #343b48; --panel2: #3b4252; --line: #4c566a;
  --ink: #eceff4; --mute: #a4aebf; --accent: #88c0d0; --accent-ink: #1a1f27;
}
html[data-theme="light"][data-palette="nord"] {
  --bg: #eceff4; --panel: #e2e6ee; --panel2: #d8dee9; --line: #c2cad8;
  --ink: #2e3440; --mute: #5e6a7d; --accent: #5e81ac; --accent-ink: #eceff4;
}
html[data-palette="gruvbox"] {
  --bg: #1d2021; --panel: #282828; --panel2: #32302f; --line: #504945;
  --ink: #ebdbb2; --mute: #a89984; --accent: #fabd2f; --accent-ink: #1d2021;
}
html[data-theme="light"][data-palette="gruvbox"] {
  --bg: #fbf1c7; --panel: #f2e5bc; --panel2: #ebdbb2; --line: #d5c4a1;
  --ink: #3c3836; --mute: #7c6f64; --accent: #b57614; --accent-ink: #fbf1c7;
}
html[data-palette="nsa"] {
  --bg: #060a14; --panel: #0b1220; --panel2: #101a2c; --line: #1e2c45;
  --ink: #d6e2f5; --mute: #8296b5; --accent: #4c8dff; --accent-ink: #04101f;
}
html[data-theme="light"][data-palette="nsa"] {
  --bg: #f2f5fb; --panel: #e8eef8; --panel2: #dde6f4; --line: #c6d3e8;
  --ink: #0d1626; --mute: #55657f; --accent: #1f5fd0; --accent-ink: #f2f5fb;
}
html[data-palette="daylight"] {
  --bg: #0b0f14; --panel: #11161d; --panel2: #171d26; --line: #263040;
  --ink: #eef2f7; --mute: #98a6b8; --accent: #0b5fff; --accent-ink: #ffffff;
}
html[data-theme="light"][data-palette="daylight"] {
  --bg: #ffffff; --panel: #f4f6f9; --panel2: #eaeef4; --line: #d6dce5;
  --ink: #10151c; --mute: #5b6673; --accent: #0b5fff; --accent-ink: #ffffff;
}
html[data-palette="linen"] {
  --bg: #1a1611; --panel: #221d16; --panel2: #2a241b; --line: #3b3327;
  --ink: #efe6d6; --mute: #a99a83; --accent: #c99a5b; --accent-ink: #1a1611;
}
html[data-theme="light"][data-palette="linen"] {
  --bg: #f7f2e8; --panel: #f1eadb; --panel2: #e9e0cd; --line: #d8cbb3;
  --ink: #241f17; --mute: #6d6353; --accent: #9a6b2f; --accent-ink: #fdf8ef;
}

/* ---------- Accent overrides (win over palette accents) ---------- */
html[data-accent="teal"] { --accent: #14b8a6; --accent-ink: #04201d; }
html[data-accent="neon"] { --accent: #2f9bff; --accent-ink: #02121f; }
html[data-accent="amber"] { --accent: #ffb000; --accent-ink: #160d00; }
html[data-accent="green"] { --accent: #35d94b; --accent-ink: #041505; }
html[data-accent="ultraviolet"] { --accent: #a06bff; --accent-ink: #12041f; }
html[data-accent="cyberpunk"] { --accent: #ff2d95; --accent-ink: #1a0210; --accent-2: #22d3ee; }
html[data-accent="alert"] { --accent: #ff3b30; --accent-ink: #150404; }
html[data-accent="ember"] { --accent: #ff6a1f; --accent-ink: #1a0800; }
html[data-accent="ice"] { --accent: #9fe8ff; --accent-ink: #04202b; }
html[data-accent="mono"] { --accent: #ffffff; --accent-ink: #000000; }
html[data-theme="light"][data-accent="mono"] { --accent: #000000; --accent-ink: #ffffff; }

html[data-accent] .hdr {
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
}

/* dark default when nothing has been resolved yet */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f5f5f2;
    --panel: #ffffff;
    --panel2: #ecece7;
    --line: #d8d8d2;
    --ink: #101214;
    --mute: #6b7076;
    --accent: #b35400;
    --accent-ink: #ffffff;
    --head-bg: rgba(245, 245, 242, 0.86);
    --ph-bg: #e9e9e3;
    --ph-line: #d8d8d2;
    --ph-ink: #8d939b;
    color-scheme: light;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #0b0c0e;
    --panel: #121417;
    --panel2: #191c21;
    --line: #23262b;
    --ink: #e8eaec;
    --mute: #8d939b;
    --accent: #ffa028;
    --accent-ink: #0b0c0e;
    --head-bg: rgba(11, 12, 14, 0.84);
    --ph-bg: #121417;
    --ph-line: #23262b;
    --ph-ink: #8d939b;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  transition: background-color 140ms linear, color 140ms linear;
}

h1, h2, h3, h4, p, figure, blockquote {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* page column */
.app {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
header,
.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
  background: var(--bg);
  border-bottom: var(--hair) solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* ---------- Sticky filter bar ---------- */
.stickybar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0 12px;
  min-height: 44px;
}
.stickybar > button { align-self: center; min-width: 36px; font-size: 20px; }
.stickybar > .subs { grid-column: 1 / -1; }
.stickybar .tabs::-webkit-scrollbar {
  display: none;
}
.stickybar .tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: stretch;
  min-height: 44px;
}

header > :first-child,
.hdr > :first-child {
  margin-right: auto;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.brand b,
.brand strong {
  font-weight: 700;
  color: var(--accent);
}

.brand .sub {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--mute);
}

/* ---------- Square buttons ---------- */
.btn-q {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 11px;
  margin: 0;
  background: transparent;
  color: var(--ink);
  border: var(--hair) solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

.btn-q:hover {
  background: var(--panel2);
  border-color: var(--mute);
  color: var(--ink);
}

.btn-q:active {
  background: var(--panel);
}

.btn-q:disabled,
.btn-q[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.btn-q .dotmark {
  width: 5px;
  height: 5px;
  background: var(--accent);
  display: inline-block;
}
dc5|
/* ---------- Visual style picker ---------- */
select#style-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 34px;
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) calc(50% - 1px), calc(100% - 9px) calc(50% - 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

select#style-select:hover {
  background-color: var(--panel2);
}

select#style-select option {
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0.08em;
}
dc5|

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: var(--hair) solid var(--line);
  margin: 0;
  padding: 0;
  background: transparent;
}

.tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tab {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 14px 11px;
  margin: 0 0 -1px 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 120ms linear, border-color 120ms linear;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.tab .count {
  font-size: 9px;
  color: var(--mute);
  letter-spacing: 0.08em;
}

/* ---------- Chips (subreddits, filters) ---------- */
.chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  margin: 0;
  background: transparent;
  border: var(--hair) solid var(--line);
  color: var(--mute);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color 120ms linear, border-color 120ms linear, background-color 120ms linear;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--mute);
}

.chip[aria-selected="true"],
.chip.is-on,
.chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.chiprow,
.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: var(--hair) solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.chiprow::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;
}

/* ---------- Stamps / kickers / numerals / tags ---------- */
.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  line-height: 1.5;
  white-space: nowrap;
}

.stamp b {
  font-weight: 700;
  color: var(--ink);
}

.idx {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1;
  user-select: none;
}

.tag-read {
  display: inline-block;
  padding: 1px 5px;
  border: var(--hair) solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  flex: 0 0 auto;
}

/* ---------- Generic open button (headlines) ---------- */
.js-open {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 120ms linear;
}

.js-open:hover {
  color: var(--accent);
}

/* ---------- SOURCE / DISCUSS links ---------- */
.links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 8px;
  border: var(--hair) solid var(--line);
  background: transparent;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: color 120ms linear, border-color 120ms linear, background-color 120ms linear;
}

.links a:hover {
  color: var(--ink);
  border-color: var(--mute);
  background: var(--panel2);
}

.links a:first-child:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Lead card ---------- */
.lead {
  position: relative;
  display: block;
  margin: 18px 0 6px;
  padding: 18px;
  background: var(--panel);
  border: var(--hair) solid var(--line);
  min-height: 0;
  overflow: visible;
  transition: border-color 120ms linear;
}

.lead:empty {
  display: none;
}

.lead .stamp {
  margin-bottom: 8px;
}

.lead-title {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: clamp(19px, 2.6vw, 27px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.lead .js-open.lead-title:hover,
.lead-title:hover {
  color: var(--accent);
}

.lead .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.lead .links {
  margin-top: 12px;
}

.lead .links a {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 9.5px;
}

/* lead photo box (fixed footprint, placeholder texture) */
.lead .lead-media,
.lead .media,
.lead figure,
.lead .lead-photo,
.lead .thumb {
  position: relative;
  display: block;
  width: 100%;
  min-height: 170px;
  max-height: 300px;
  margin: 0 0 14px;
  overflow: hidden;
  background: var(--panel2) url('assets/art/placeholder.png') center / cover no-repeat;
  border: var(--hair) solid var(--line);
  border-radius: 0;
}

.lead img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity 160ms linear;
  border-radius: 0;
}

.lead img.is-loaded {
  opacity: 1;
}

.lead-body,
.lead .body {
  min-width: 0;
}

@media (min-width: 800px) {
  .lead {
    min-height: 232px;
    padding-right: 376px;
  }

  .lead .lead-media,
  .lead .media,
  .lead figure,
  .lead .lead-photo,
  .lead .thumb,
  .lead > img {
    position: absolute;
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: 340px;
    height: auto;
    max-height: none;
    min-height: 0;
    margin: 0;
  }
}

/* ---------- Feed rows ---------- */
#feed {
  display: block;
  margin: 0;
  padding: 0;
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
  margin: 0 0 14px;
  background: var(--panel);
  border: var(--hair) solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: background-color 120ms linear, opacity 160ms linear;
}

.item:hover {
  background: var(--panel);
}

.item .idx {
  grid-column: 1;
  align-self: center;
}

.item .thumb,
.item .item-thumb {
  grid-column: 2;
  position: relative;
  width: 112px;
  height: 76px;
  min-width: 112px;
  overflow: hidden;
  background: var(--panel2) url('assets/art/placeholder.png') center / cover no-repeat;
  display: block;
  flex: 0 0 auto;
  border-radius: 0;
}

.item .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity 160ms linear;
  border-radius: 0;
}

.item .thumb img.is-loaded {
  opacity: 1;
}

/* story photos always paint: no fade-from-zero, no blend, no black fill */
.item .thumb img,
.lead .thumb img,
.lead img {
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
  background: transparent;
  border-radius: 0;
}

.item .body,
.item .item-main,
.item .main {
  grid-column: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item .title,
.item .js-open {
  grid-column: 3;
  min-width: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.item .meta .stamp {
  font-size: 9.5px;
}

.item .domain,
.item .srcname {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.item .links {
  grid-column: 4;
  justify-self: end;
  justify-content: flex-end;
}

.item.is-read {
  opacity: 0.4;
}

.item.is-read:hover {
  opacity: 0.65;
}

.item.is-read .thumb img {
  filter: saturate(0.35);
}

/* ---------- Skeletons ---------- */
.skel {
  position: relative;
  display: block;
  min-height: 76px;
  margin: 0;
  padding: 8px 4px;
  border-bottom: var(--hair) solid var(--line);
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--panel) 0%,
    var(--panel2) 42%,
    var(--panel) 84%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: skelShimmer 1.2s linear infinite;
}

.skel::before {
  content: "";
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 112px;
  height: 60px;
  background: var(--panel2);
  opacity: 0.6;
}

.skel::after {
  content: "";
  position: absolute;
  left: 168px;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  background: var(--panel2);
  opacity: 0.6;
}

@keyframes skelShimmer {
  0% {
    background-position: 140% 0;
  }
  100% {
    background-position: -140% 0;
  }
}

/* ---------- Magazine grid: .pub-row layouts ---------- */
.pub-row {
  display: grid;
  gap: 0;
  border-bottom: var(--hair) solid var(--line);
  background: transparent;
}

/* cells: square, no borders/shadows — hairline separators only */
.pub-row .item {
  border-bottom: none;
  background: transparent;
}

/* ---- hero-left / hero-right: image-dominant feature beside a stacked pair ---- */
.pub-hero-left,
.pub-hero-right {
  grid-template-columns: minmax(0, 58%) minmax(0, 42%);
}

.pub-row .item--feature {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 16px;
  min-height: 240px;
}

.pub-row .item--feature .thumb,
.pub-row .item--feature .item-thumb {
  order: -1;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 12px;
}

.pub-row .item--feature .idx {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 2;
  padding: 1px 6px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}

.pub-row .item--feature .title,
.pub-row .item--feature .js-open {
  font-size: 19px;
  -webkit-line-clamp: 3;
}

.pub-row .pub-stack {
  display: grid;
  grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
  border-left: var(--hair) solid var(--line);
}

.pub-row .pub-stack .item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 10px 14px;
  border-bottom: var(--hair) solid var(--line);
}

.pub-row .pub-stack .item:last-child {
  border-bottom: none;
}

.pub-row .pub-stack .item .thumb,
.pub-row .pub-stack .item .item-thumb {
  grid-column: 1;
  grid-row: 1;
  width: 84px;
  min-width: 84px;
  height: 64px;
}

.pub-row .pub-stack .item .idx {
  display: none;
}

.pub-row .pub-stack .item .body,
.pub-row .pub-stack .item .item-main,
.pub-row .pub-stack .item .main,
.pub-row .pub-stack .item .title,
.pub-row .pub-stack .item .js-open {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.pub-row .pub-stack .item .title,
.pub-row .pub-stack .item .js-open {
  font-size: 13px;
  -webkit-line-clamp: 3;
}

.pub-row .pub-stack .item .links {
  display: none;
}

/* ---- split / trio: 2-up / 3-up cards ---- */
.pub-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pub-trio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pub-split .item,
.pub-trio .item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 16px;
  min-height: 200px;
}

.pub-split .item + .item,
.pub-trio .item + .item {
  border-left: var(--hair) solid var(--line);
}

.pub-split .item .thumb,
.pub-split .item .item-thumb,
.pub-trio .item .thumb,
.pub-trio .item .item-thumb {
  order: -1;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 10px;
}

.pub-split .item .idx,
.pub-trio .item .idx {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 2;
  padding: 1px 6px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}

/* ---- banner: wide headline-only row with muted abstract art strip ---- */
.pub-banner {
  grid-template-columns: minmax(0, 1fr) 220px;
}

.pub-row .item--banner {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  padding: 10px 16px;
}

.pub-row .item--banner .title,
.pub-row .item--banner .js-open {
  font-size: 16px;
  -webkit-line-clamp: 2;
}

.pub-row .item--banner .thumb,
.pub-row .item--banner .item-thumb {
  grid-column: 2;
  grid-row: 1;
  width: 220px;
  min-width: 0;
  height: 64px;
  opacity: 0.55;
  filter: saturate(0.4);
}

.pub-row .item--banner .idx {
  grid-column: 1;
  grid-row: 1;
}

.pub-row .item--banner .item-main,
.pub-row .item--banner .main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-row .item--banner .body:has(.title),
.pub-row .item--banner .item-main {
  margin-left: 28px;
}

/* hide empty meta rows (zero scores) */
.pub-row .meta-empty,
.meta-empty {
  display: none;
}

/* ---- <= 560px: single column lead-style rows, 2-up stays 2-up ---- */
@media (max-width: 560px) {
  .pub-hero-left,
  .pub-hero-right {
    grid-template-columns: minmax(0, 1fr);
  }

  .pub-row .pub-stack {
    border-left: none;
    border-top: var(--hair) solid var(--line);
  }

  .pub-row .item--feature {
    min-height: 0;
    padding: 12px 14px;
  }

  .pub-trio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pub-trio .item:last-child {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .pub-trio .item:last-child .thumb,
  .pub-trio .item:last-child .item-thumb {
    grid-column: 1;
    grid-row: 1;
    order: 0;
    width: 84px;
    min-width: 84px;
    height: 64px;
    margin: 0;
  }

  .pub-trio .item:last-child .item-main,
  .pub-trio .item:last-child .main {
    grid-column: 2;
    grid-row: 1;
  }

  .pub-trio .item:last-child .body,
  .pub-trio .item:last-child .title,
  .pub-trio .item:last-child .js-open {
    grid-column: 2;
    grid-row: 1;
  }

  .pub-trio .item:last-child .idx {
    position: static;
    grid-column: 2;
    grid-row: 2;
  }

  .pub-banner {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .pub-row .item--banner .thumb,
  .pub-row .item--banner .item-thumb {
    width: 96px;
    height: 60px;
  }
}

/* ---------- Reader overlay ---------- */
#reader,
.reader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: var(--bg);
  color: var(--ink);
  padding: 0;
  margin: 0;
}

#reader[hidden],
.reader[hidden] {
  display: none !important;
}

.reader-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--panel);
  border-bottom: var(--hair) solid var(--line);
  overflow: hidden;
}

.reader-bar > * {
  flex: 0 0 auto;
}

#reader-title,
.reader-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46vw;
  margin: 0;
}

#reader-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

#reader-close,
.reader-bar .btn-q,
.reader-bar button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  border: var(--hair) solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

#reader-close:hover,
.reader-bar .btn-q:hover,
.reader-bar button:hover {
  background: var(--panel2);
  border-color: var(--mute);
}

#reader .reader-bar a,
.reader .reader-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: var(--hair) solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

#reader .reader-bar a:hover {
  background: var(--panel2);
  border-color: var(--mute);
}

.reader-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: block;
}

.reader-frame,
#reader-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

#reader-blocked,
.reader-blocked {
  position: absolute;
  inset: auto 12px 12px 12px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 2;
  margin: 0 auto;
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 16px;
  background: var(--panel);
  border: var(--hair) solid var(--line);
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  text-align: center;
}

#reader-blocked[hidden] {
  display: none !important;
}

/* ---------- Add-source modal ---------- */
#src-modal,
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

#src-modal[hidden],
.modal[hidden] {
  display: none !important;
}

#src-modal .panel,
#src-modal .modal-panel,
#src-modal .card,
#src-modal > div:not(.backdrop):not(.scrim) {
  position: relative;
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 18px;
  background: var(--panel);
  border: var(--hair) solid var(--line);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

#src-modal h2,
#src-modal h3,
#src-modal .title,
#src-modal .stamp:first-child {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 10px;
}

#src-modal p,
#src-modal .muted {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--mute);
  line-height: 1.6;
  margin: 0 0 12px;
  text-transform: none;
}

#src-url {
  display: block;
  width: 100%;
  padding: 11px 12px;
  margin: 0 0 6px;
  background: var(--bg);
  border: var(--hair) solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 120ms linear, background-color 120ms linear;
}

#src-url::placeholder {
  color: var(--mute);
  opacity: 0.8;
}

#src-url:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel2);
}

#src-error {
  display: block;
  min-height: 16px;
  margin: 4px 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.5;
}

#src-error:empty {
  min-height: 0;
  margin: 4px 0 6px;
}

#src-submit,
#src-cancel {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  margin: 0 6px 0 0;
  background: transparent;
  border: var(--hair) solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

#src-submit:hover,
#src-cancel:hover {
  background: var(--panel2);
  border-color: var(--mute);
}

#src-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

#src-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.08);
}

#src-list {
  display: block;
  margin: 16px 0 0;
  padding: 0;
  border-top: var(--hair) solid var(--line);
  list-style: none;
}

#src-list:empty {
  display: none;
}

#src-list li,
#src-list > div,
#src-list > .row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: var(--hair) solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  list-style: none;
}

#src-list li > span:first-child,
#src-list > div > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#src-list button,
#src-list .btn-q {
  appearance: none;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
  background: transparent;
  border: var(--hair) solid var(--line);
  color: var(--mute);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: color 120ms linear, border-color 120ms linear;
}

#src-list button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Toast ---------- */
#toast,
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 80;
  transform: translate(-50%, 10px);
  max-width: min(440px, calc(100vw - 28px));
  padding: 10px 14px;
  background: var(--panel);
  border: var(--hair) solid var(--line);
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear, transform 120ms linear;
}

#toast.is-on,
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Scrollbars (subtle, square) ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mute);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .lead {
    padding: 14px;
    margin-top: 14px;
  }

  .lead .lead-media,
  .lead .media,
  .lead figure,
  .lead .lead-photo,
  .lead .thumb {
    min-height: 150px;
    max-height: 220px;
  }

  .item {
    gap: 10px;
  }

  .item .domain,
  .item .srcname {
    max-width: 150px;
  }

  #reader-meta {
    max-width: 130px;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 0 12px;
  }

  header,
  .hdr {
    gap: 6px;
  }

  .brand {
    font-size: 11px;
    letter-spacing: 0.18em;
  }

  .btn-q {
    min-height: 32px;
    padding: 7px 9px;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .tab {
    padding: 12px 11px 10px;
    font-size: 9.5px;
    letter-spacing: 0.12em;
  }

  .item {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 64px;
    padding: 8px 2px;
  }

  .item .idx {
    display: none;
  }

  .item .thumb,
  .item .item-thumb {
    grid-column: 1;
    width: 84px;
    height: 64px;
    min-width: 84px;
  }

  .item .body,
  .item .item-main,
  .item .main,
  .item .title,
  .item .js-open {
    grid-column: 2;
  }

  .item .title,
  .item .js-open {
    font-size: 13.5px;
    line-height: 1.28;
    -webkit-line-clamp: 3;
  }

  .item .links {
    grid-column: 3;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .item .links a {
    min-height: 24px;
    padding: 4px 6px;
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .item .meta .stamp,
  .item .domain,
  .item .srcname {
    font-size: 8.5px;
  }

  .skel::before {
    left: 8px;
    width: 84px;
    height: 48px;
  }

  .skel::after {
    left: 102px;
    right: 10px;
  }

  .reader-bar .stamp,
  #reader-meta {
    display: none;
  }

  #reader-title,
  .reader-head h2 {
    font-size: 13px;
    max-width: 40vw;
  }

  .reader-acts .btn-q,
  #reader-close {
    padding: 6px 8px;
    font-size: 11px;
    min-height: 32px;
    letter-spacing: 0.08em;
  }

  .reader-bar {
    gap: 6px;
    padding: 6px 8px;
    padding-top: calc(6px + env(safe-area-inset-top));
  }

  #src-modal,
  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  #src-modal .panel,
  #src-modal .modal-panel,
  #src-modal .card,
  #src-modal > div:not(.backdrop):not(.scrim) {
    width: 100%;
    padding: 14px;
    max-height: calc(100vh - 32px);
  }

  .lead-title {
    font-size: 18px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .skel {
    animation: none !important;
    background: var(--panel2);
  }

  .item .thumb img,
  .lead img,
  .item,
  #toast {
    transition: none !important;
  }
}

/* ==========================================================================
   THEME STYLES (data-style) — messenger | opsroom | paper
   ========================================================================== */

/* ----- messenger: current default look (soft dark, roomy) ----- */
:root[data-style='messenger'] {
  --panel: rgba(18, 20, 23, 0.92);
  --panel2: rgba(25, 28, 33, 0.92);
}
:root[data-style='messenger'] {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(255, 160, 40, 0.05), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(74, 158, 255, 0.05), transparent 60%),
    var(--bg);
}
:root[data-theme='light'][data-style='messenger'] {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel2: #f2f2ef;
  --line: #e0e0da;
  --ink: #101214;
  --mute: #6b7076;
  --head-bg: rgba(250, 250, 250, 0.88);
  background:
    radial-gradient(1100px 640px at 12% -10%, rgba(255, 160, 40, 0.07), transparent 60%),
    radial-gradient(900px 560px at 100% 110%, rgba(74, 158, 255, 0.06), transparent 60%),
    var(--bg);
}

/* ----- opsroom: dark glass + HUD green ----- */
:root[data-style='opsroom'] {
  --panel: rgba(14, 18, 15, 0.78);
  --panel2: rgba(20, 26, 21, 0.82);
  --line: 1px solid rgba(57, 211, 83, 0.18);
  --accent: #39d353;
  --accent-ink: #04140a;
  --ink: #d9efe0;
  --mute: #7ea98c;
  background:
    repeating-linear-gradient(0deg, rgba(57, 211, 83, 0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(57, 211, 83, 0.03) 0 1px, transparent 1px 56px),
    var(--bg);
}
:root[data-style='opsroom'] .item,
:root[data-style='opsroom'] .hdr,
:root[data-style='opsroom'] .reader-bar {
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
:root[data-style='opsroom'] .stamp,
:root[data-style='opsroom'] .tab {
  letter-spacing: 0.14em;
}
:root[data-style='opsroom'] .hdr {
  position: relative;
}
:root[data-style='opsroom'] .hdr::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg,
    rgba(57, 211, 83, 0.45) 0 1px, transparent 1px 10px,
    rgba(57, 211, 83, 0.22) 10px 11px, transparent 11px 60px);
  opacity: 0.7;
  pointer-events: none;
}
:root[data-theme='light'][data-style='opsroom'] {
  --panel: rgba(240, 246, 241, 0.85);
  --panel2: rgba(228, 238, 231, 0.9);
  --line: 1px solid rgba(24, 122, 45, 0.28);
  --accent: #1c9a37;
  --accent-ink: #f2faf4;
  --ink: #0e1a12;
  --mute: #4f6b58;
  --head-bg: rgba(240, 246, 241, 0.9);
}

/* ----- paper: newspaper ----- */
:root[data-style='paper'] {
  --bg: #fdfaf4;
  --panel: #ffffff;
  --panel2: #f6f1e7;
  --line: 1px solid #1a1a1a;
  --ink: #1a1a1a;
  --mute: #5b5852;
  --accent: #1a1a1a;
  --accent-ink: #fdfaf4;
  --head-bg: rgba(253, 250, 244, 0.92);
  --font-head: Georgia, 'Times New Roman', serif;
}
:root[data-style='paper'] .lead-title,
:root[data-style='paper'] .item-title,
:root[data-style='paper'] .brand-title {
  font-family: var(--font-head, Georgia, 'Times New Roman', serif);
  letter-spacing: 0;
}
:root[data-style='paper'] .chip {
  text-transform: uppercase;
  font-variant: small-caps;
  letter-spacing: 0.08em;
}
:root[data-theme='dark'][data-style='paper'] {
  --bg: #141414;
  --panel: #1c1c1c;
  --panel2: #242424;
  --line: 1px solid #e8e2d6;
  --ink: #e8e2d6;
  --mute: #a39a89;
  --accent: #e8e2d6;
  --accent-ink: #141414;
  --head-bg: rgba(20, 20, 20, 0.92);
}

/* ---------- Smooth theme swaps ---------- */
html,
.item,
.hdr,
.reader-bar {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

/* ==========================================================================
   PALETTES (data-palette) — 12 named + default = 13
   Dark values in plain blocks; light companions below each pair's group.
   ========================================================================== */

/* olive drab */
:root[data-palette='olive'] {
  --bg: #3b4028; --panel: #4a5034; --panel2: #565c3e; --line: #6b724c;
  --ink: #eef0e2; --mute: #aeb494; --accent: #a3b56a; --accent-ink: #23260f;
}
:root[data-theme='light'][data-palette='olive'] {
  --bg: #eceadd; --panel: #e2e2cf; --panel2: #d8d8c2; --line: #c3c3ab;
  --ink: #24271a; --mute: #5f644a; --accent: #6d7c3a; --accent-ink: #f2f4e6;
}

/* flat dark earth */
:root[data-palette='fde'] {
  --bg: #4a443a; --panel: #5a5346; --panel2: #665e4f; --line: #7b725f;
  --ink: #f0e9dc; --mute: #b8ac97; --accent: #d8a855; --accent-ink: #2a2013;
}
:root[data-theme='light'][data-palette='fde'] {
  --bg: #ede8df; --panel: #e3dcce; --panel2: #d9d1c0; --line: #c4bba6;
  --ink: #2b261e; --mute: #6b6252; --accent: #96682b; --accent-ink: #f6f1e7;
}

/* matte black — NV green */
:root[data-palette='nv'] {
  --bg: #0b0f0c; --panel: #121813; --panel2: #18201a; --line: #26332a;
  --ink: #d5e8d9; --mute: #86a08b; --accent: #33ff66; --accent-ink: #04140a;
}
:root[data-theme='light'][data-palette='nv'] {
  --bg: #eef4ef; --panel: #e1ebe3; --panel2: #d3e2d7; --line: #bcd0c1;
  --ink: #0e1710; --mute: #52655a; --accent: #0f7f34; --accent-ink: #f0faf3;
}

/* matte black — red dot */
:root[data-palette='reddot'] {
  --bg: #0d0d0d; --panel: #151515; --panel2: #1c1c1c; --line: #2c2c2c;
  --ink: #e9e9ec; --mute: #9c9ca4; --accent: #ff3b30; --accent-ink: #150404;
}
:root[data-theme='light'][data-palette='reddot'] {
  --bg: #f6f6f7; --panel: #ebebec; --panel2: #e1e1e3; --line: #cfcfd4;
  --ink: #141416; --mute: #61616a; --accent: #d92b20; --accent-ink: #fff5f4;
}

/* phosphor green */
:root[data-palette='phosphor'] {
  --bg: #000a02; --panel: #04140a; --panel2: #071c0f; --line: #133220;
  --ink: #b8ffc8; --mute: #6aa87a; --accent: #00ff41; --accent-ink: #00190a;
}
:root[data-theme='light'][data-palette='phosphor'] {
  --bg: #eefbee; --panel: #def5e1; --panel2: #cfecd4; --line: #b3dcb9;
  --ink: #06230e; --mute: #3f7a4d; --accent: #0c8c2a; --accent-ink: #eefbee;
}

/* amber terminal */
:root[data-palette='amber'] {
  --bg: #0a0600; --panel: #130c04; --panel2: #1a1108; --line: #33230e;
  --ink: #ffd089; --mute: #b08a4d; --accent: #ffb000; --accent-ink: #160d00;
}
:root[data-theme='light'][data-palette='amber'] {
  --bg: #fdf4e2; --panel: #f6e8cd; --panel2: #eedcbd; --line: #dcc293;
  --ink: #2a1c05; --mute: #7a633c; --accent: #b87400; --accent-ink: #fdf4e2;
}

/* solarized */
:root[data-palette='solarized'] {
  --bg: #002b36; --panel: #073642; --panel2: #0b4150; --line: #14505f;
  --ink: #eee8d5; --mute: #93a1a1; --accent: #b58900; --accent-ink: #002b36;
}
:root[data-theme='light'][data-palette='solarized'] {
  --bg: #fdf6e3; --panel: #f5eedb; --panel2: #eee7d5; --line: #d9d2bf;
  --ink: #073642; --mute: #657b83; --accent: #b58900; --accent-ink: #fdf6e3;
}

/* nord */
:root[data-palette='nord'] {
  --bg: #2e3440; --panel: #3b4252; --panel2: #434c5e; --line: #4c566a;
  --ink: #eceff4; --mute: #a4aebf; --accent: #88c0d0; --accent-ink: #1a1f27;
}
:root[data-theme='light'][data-palette='nord'] {
  --bg: #eceff4; --panel: #e2e6ee; --panel2: #d8dee9; --line: #c2cad8;
  --ink: #2e3440; --mute: #5e6a7d; --accent: #5e81ac; --accent-ink: #eceff4;
}

/* gruvbox */
:root[data-palette='gruvbox'] {
  --bg: #282828; --panel: #3c3836; --panel2: #464340; --line: #504945;
  --ink: #ebdbb2; --mute: #a89984; --accent: #fabd2f; --accent-ink: #282828;
}
:root[data-theme='light'][data-palette='gruvbox'] {
  --bg: #fbf1c7; --panel: #f2e5bc; --panel2: #ebdbb2; --line: #d5c4a1;
  --ink: #3c3836; --mute: #7c6f64; --accent: #b57614; --accent-ink: #fbf1c7;
}

/* midnight blue — NSA */
:root[data-palette='nsa'] {
  --bg: #0a1128; --panel: #101a3d; --panel2: #16224b; --line: #243363;
  --ink: #c8d4f0; --mute: #7e8fb8; --accent: #4a9eff; --accent-ink: #04101f;
}
:root[data-theme='light'][data-palette='nsa'] {
  --bg: #f1f4fb; --panel: #e6ecf8; --panel2: #dbe3f4; --line: #c2d0ea;
  --ink: #0d1626; --mute: #52628a; --accent: #1f6fd0; --accent-ink: #f1f4fb;
}

/* daylight — crisp light */
:root[data-palette='daylight'] {
  --bg: #0e1722; --panel: #15202e; --panel2: #1b2938; --line: #29394c;
  --ink: #eef2f7; --mute: #98a6b8; --accent: #0a66c2; --accent-ink: #ffffff;
}
:root[data-theme='light'][data-palette='daylight'] {
  --bg: #f4f7fa; --panel: #ffffff; --panel2: #e9eef5; --line: #d5dee8;
  --ink: #10151c; --mute: #5b6673; --accent: #0a66c2; --accent-ink: #ffffff;
}

/* linen — warm light */
:root[data-palette='linen'] {
  --bg: #1c1814; --panel: #2a241c; --panel2: #332b22; --line: #42382a;
  --ink: #efe6d6; --mute: #a99a83; --accent: #c99a5b; --accent-ink: #1c1814;
}
:root[data-theme='light'][data-palette='linen'] {
  --bg: #f7f1e6; --panel: #fffaf0; --panel2: #f0e8d8; --line: #d9cdb5;
  --ink: #3d3529; --mute: #72675a; --accent: #8b5e34; --accent-ink: #fdf8ef;
}

/* ==========================================================================
   ACCENTS (data-accent) — override palette accents, always last
   ========================================================================== */
:root[data-accent='teal'] { --accent: #14b8a6; --accent-ink: #ffffff; }
:root[data-accent='fluorblue'] { --accent: #00e5ff; --accent-ink: #000000; }
:root[data-accent='amber'] { --accent: #ffb000; --accent-ink: #000000; }
:root[data-accent='green'] { --accent: #22c55e; --accent-ink: #000000; }
:root[data-accent='ultraviolet'] { --accent: #7c3aed; --accent-ink: #ffffff; }
:root[data-accent='cyber'] { --accent: #ff2ec4; --accent-ink: #ffffff; }
:root[data-accent='cyber'] .brand-mark:last-child { color: #00e5ff; }
:root[data-accent='redalert'] { --accent: #ff3b30; --accent-ink: #ffffff; }
:root[data-accent='ember'] { --accent: #ff6b1a; --accent-ink: #000000; }
:root[data-accent='ice'] { --accent: #7dd3fc; --accent-ink: #000000; }
:root[data-accent='mono'] { --accent: var(--ink); --accent-ink: var(--bg); }

/* ==========================================================================
   STYLE VARIANTS (data-style) — layered over BOTH color modes, tokens only
   ========================================================================== */

/* ---------- 1) OPS ROOM: glass panels + HUD ticks + grid backdrop ---------- */
html[data-style='opsroom'] body {
  background-image:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--line) 30%, transparent) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 30%, transparent) 0 1px, transparent 1px 96px);
  background-attachment: fixed;
}
html[data-style='opsroom'] .item,
html[data-style='opsroom'] .lead,
html[data-style='opsroom'] .tabs,
html[data-style='opsroom'] .reader {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
html[data-style='opsroom'] .item::before,
html[data-style='opsroom'] .item::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0.6;
}
html[data-style='opsroom'] .item::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}
html[data-style='opsroom'] .item::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}
html[data-style='opsroom'] .stamp,
html[data-style='opsroom'] .tab,
html[data-style='opsroom'] .meta {
  letter-spacing: 0.08em;
}

/* ---------- 2) PAPER OF RECORD: newspaper type + hairlines, both modes ---------- */
html[data-style='paper'] .lead-title,
html[data-style='paper'] .item .title,
html[data-style='paper'] .brand-title {
  font-family: Georgia, Charter, serif;
}
html[data-style='paper'] .lead-title {
  font-weight: 700;
  line-height: 1.08;
}
html[data-style='paper'] .item {
  border-top: 1px solid var(--line);
  box-shadow: none;
}
html[data-style='paper'] .tab[aria-selected='true'] {
  box-shadow: none;
  background: transparent;
  border-bottom: 2px solid var(--ink);
}
html[data-style='paper'] .links a,
html[data-style='paper'] .tag-read {
  color: var(--ink);
}
html[data-style='paper'] .links a:hover {
  color: var(--accent);
}
html[data-style='paper'] .item .title {
  color: var(--ink);
}
html[data-theme='dark'][data-style='paper'] .item .title {
  color: #ffffff;
}
html[data-theme='light'][data-style='paper'] .item .title {
  color: #0a0a0a;
}

/* ---------- 3) MESSENGER (default): soft, roomy, bubbles ---------- */
html[data-style='messenger'] .item,
html[data-style='messenger'] .lead {
  border-radius: 14px;
  background: var(--panel);
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 16px 18px;
}
html[data-theme='dark'][data-style='messenger'] .item,
html[data-theme='dark'][data-style='messenger'] .lead {
  box-shadow: inset 0 0 0 1px var(--line);
}
html[data-style='messenger'] .feed-list,
html[data-style='messenger'] .lead-wrap,
html[data-style='messenger'] .list-wrap {
  gap: 14px;
}
html[data-style='messenger'] .lead-title {
  font-size: clamp(28px, 5vw, 44px);
}
html[data-style='messenger'] .thumb {
  border-radius: 10px;
}
html[data-style='messenger'] .btn-q {
  border-radius: 10px;
}

/* --- owner tuning: breathing room + center column --- */
.main { max-width: 960px; margin: 0 auto; }
article, .pub-split .item, .pub-trio .item { margin: .5rem; }
.pub-row, .pub-row .pub-stack, .pub-row .pub-stack .item { border-bottom: none; border-left: none; }
section#lead { border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
.pub-row .pub-stack .item { grid-template-columns: 180px minmax(0, 1fr); }
@media (min-width: 561px) {
  .pub-row .pub-stack .item .thumb, .pub-row .pub-stack .item .item-thumb { grid-column: 1; grid-row: 1; width: 180px; min-width: 180px; height: 141px; }
  .pub-row .item--banner .thumb, .pub-row .item--banner .item-thumb { height: 135px; }
}

/* --- wide screens (>=1100px): centered max-width column, compact carded feed --- */
@media (min-width: 1100px) {
  .main {
    max-width: 1100px;
    margin: 0 auto;
  }

  /* rows read as real cards: panel background, soft edge + shadow, real gaps */
  article,
  .pub-split .item,
  .pub-trio .item {
    margin: 0 0 0.625rem;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  }

  .pub-row {
    gap: 0.625rem;
    margin-bottom: 0.625rem;
  }

  .pub-row .item,
  .pub-row .pub-stack .item {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  }

  .pub-row .pub-stack {
    grid-template-rows: none;
    grid-auto-rows: min-content;
  }

  .pub-row .pub-stack .item + .item {
    margin-top: 0.625rem;
  }

  /* compact thumbs so more cards fit per row */
  .pub-row .pub-stack .item {
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 8px 12px;
  }

  .pub-row .pub-stack .item .thumb,
  .pub-row .pub-stack .item .item-thumb {
    width: 110px;
    min-width: 110px;
    height: 74px;
  }

  .pub-row .item--feature .thumb,
  .pub-row .item--feature .item-thumb {
    margin: 0 0 8px;
  }

  .pub-row .item--feature .title,
  .pub-row .item--feature .js-open {
    font-size: 17px;
  }

  .pub-split .item,
  .pub-trio .item {
    padding: 10px 12px;
    min-height: 0;
  }

  .pub-split .item + .item,
  .pub-trio .item + .item {
    border-left: none;
  }

  .pub-banner {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .pub-row .item--banner .thumb,
  .pub-row .item--banner .item-thumb {
    width: 150px;
    height: 74px;
  }

  .pub-row .item--banner .title,
  .pub-row .item--banner .js-open {
    font-size: 14px;
  }

  /* skeleton thumbs follow the compact rhythm */
  .skel::before {
    left: 36px;
    width: 110px;
  }

  .skel::after {
    left: 156px;
  }
}
