/* ════════════════════════════════════════════════════════════
   dailybrief — neon edition
   ════════════════════════════════════════════════════════════ */

:root {
  /* User-controlled text size multiplier — wired to the S/M/L/XL
     buttons in the settings popover and persisted to localStorage. */
  --text-scale: 1;

  /* base */
  --bg-0:      #05060a;
  --bg-1:      #0b0d18;
  --bg-2:      #131628;
  --panel:     #11142440;     /* translucent over neon glow bg */
  --panel-2:   #1a1f3540;
  --line:      #2a2f4d;
  --line-2:    #3a4170;
  --text:      #ffffff;
  --text-2:    #d9def0;
  --muted:     #8b95b8;
  --dim:       #5a6285;

  /* NEON palette */
  --neon-cyan:    #00e1ff;
  --neon-mag:     #ff2bd6;
  --neon-lime:    #b6ff3c;
  --neon-yellow:  #ffe600;
  --neon-pink:    #ff5be8;
  --neon-violet:  #b388ff;
  --neon-orange:  #ff9a3c;
  --neon-red:     #ff4d6d;

  /* category colors (neon) */
  --c-world:   var(--neon-cyan);
  --c-econ:    var(--neon-lime);
  --c-biz:     var(--neon-yellow);
  --c-tech:    var(--neon-violet);
  --c-ai:      var(--neon-mag);
  --c-crypto:  var(--neon-orange);
  --c-science: var(--neon-cyan);
  --c-geo:     var(--neon-red);
  --c-opinion: var(--neon-violet);
  --c-korea:   var(--neon-pink);
  --c-kent:    var(--neon-pink);
  --c-whale:   var(--neon-lime);
  --c-trade:   var(--neon-yellow);
  --c-video:   var(--neon-pink);

  --up:   var(--neon-lime);
  --down: var(--neon-red);

  /* fonts
     ─── English ─────────────────────────────────────────────
     Bricolage Grotesque is a 2023 variable font by Mathieu Triay with
     opsz/wdth/wght axes — it gets dramatic and bold at display sizes,
     compact and readable at body sizes. Much punchier than Fraunces.
     DM Serif Display is reserved for the hero drop-cap accent. */
  --display: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --accent-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --kr:      "Pretendard Variable", Pretendard, "Apple SD Gothic Neo",
             "Noto Sans KR", "Malgun Gothic", -apple-system, sans-serif;
  --mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --glow-cyan:   0 0 22px rgba(0,225,255,0.45);
  --glow-mag:    0 0 22px rgba(255,43,214,0.45);
  --glow-lime:   0 0 22px rgba(182,255,60,0.45);
  --glow-yellow: 0 0 22px rgba(255,230,0,0.45);
}

* { box-sizing: border-box; }

/* Kill the default iOS / Android tap-highlight gray flash on every
   clickable element AND on the photos inside cards. The user explicitly
   does not want any pre-click colour shift / tint on the photo. */
a, button, .art, .art *, .strip-item, .chip, .art .img {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}
/* Belt + braces: never put a colour filter / mix on the photo. */
.art .img,
.art:hover .img,
.art:active .img,
.art:focus .img,
.art:focus-within .img,
.reader-img {
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  background-blend-mode: normal !important;
  opacity: 1 !important;
}
.art, .art:hover, .art:active, .art:focus, .art:focus-within {
  outline: none;
}

html, body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  background:
    radial-gradient(900px 600px at 12% -5%,  rgba(255, 43, 214, 0.13), transparent 60%),
    radial-gradient(900px 600px at 88% 5%,   rgba(0, 225, 255, 0.10),  transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(182, 255, 60, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  min-height: 100vh;
  /* Kill horizontal scroll caused by overflowing marquee strips or
     fixed-width children — on mobile, this was making the page look
     like a chunk of content was missing on one edge. */
  overflow-x: hidden;
  max-width: 100vw;
}

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

/* ── Language-aware typography ─────────────────────────────
   :lang() lets us tune the same CSS rules per content language.
   Korean uses Pretendard's `palt` (proportional alt widths) for
   tighter horizontal rhythm, and a slightly smaller heading scale
   because Hangul glyphs are visually denser than Latin at the same px.
   English uses Bricolage Grotesque with optical sizing + width axis
   for dramatic display weights.
*/
:lang(ko), [lang="ko"] {
  font-family: var(--kr);
  font-feature-settings: "palt" 1, "vpal" 1, "kern" 1, "ss03" 1;
  word-break: keep-all;
  line-height: 1.36;
  letter-spacing: -0.3px;
}
:lang(en), [lang="en"] {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
}

/* All headlines get auto-balanced wrapping (Chrome 114+ / Safari 17.4+).
   This makes "최태원, 내달 TSMC회장과 회동…엔비디아 포함" wrap evenly
   instead of leaving a sad lonely word on the last line. */
.h, h1, h2, h3 {
  text-wrap: balance;
}

/* ── Masthead — brand on left, date pill pinned to far right ──── */
.masthead {
  display: grid !important;
  grid-template-columns: 1fr auto;   /* brand fills left, date stays right */
  align-items: center;
  column-gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  grid-column: 1 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
/* Right cluster — gear button + date pill, sits in grid col 2. */
.masthead > .actions {
  grid-column: 2 !important;
  justify-self: end !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Gear — small neon square that matches the date pill on the left */
#settings-btn {
  background: linear-gradient(135deg, rgba(0,225,255,0.10), rgba(122,162,255,0.05));
  border: 1px solid rgba(0,225,255,0.35);
  color: var(--neon-cyan);
  width: 22px;
  height: 22px;
  border-radius: 5px;     /* square w/ tiny rounded corners */
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 8px rgba(0,225,255,0.5);
  transition: transform 0.25s, box-shadow 0.15s;
}
#settings-btn:hover {
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(0,225,255,0.45);
}

/* ── Settings popover ─────────────────────────────────────── */
.settings-pop {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 60;
  width: 340px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: rgba(11,13,24,0.97);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55), 0 0 30px rgba(0,225,255,0.08);
  backdrop-filter: blur(12px);
  animation: fadein 140ms ease-out;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.settings-pop::-webkit-scrollbar { width: 6px; }
.settings-pop::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
@media (max-width: 480px) {
  .settings-pop { width: calc(100vw - 24px); right: 12px; }
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  letter-spacing: 0.4px;
  padding: 4px 0;
}
.settings-toggle input[type=checkbox] {
  appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.settings-toggle input[type=checkbox]:checked {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0,225,255,0.5);
}
.settings-toggle input[type=checkbox]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #001722;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}

.settings-hint {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.6px;
  font-weight: 600;
  text-transform: none;
}

.settings-actions-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.settings-mini {
  flex: 1 1 auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-width: 70px;
}
.settings-mini:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}
.settings-mini[data-src-action="premium"]:hover {
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
}

.settings-search {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  outline: none;
  width: 100%;
}
.settings-search:focus { border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0,225,255,0.3); }

.src-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  padding-right: 4px;
}
.src-list::-webkit-scrollbar { width: 4px; }
.src-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

.src-cat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.src-cat-head {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 800;
  padding: 4px 0 2px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 4px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.src-cat-head .src-cat-n { color: var(--neon-cyan); }
.src-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--sans);
}
.src-item:hover { background: rgba(255,255,255,0.04); }
.src-item input[type=checkbox] {
  appearance: none;
  width: 12px; height: 12px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.src-item input[type=checkbox]:checked {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
}
.src-item input[type=checkbox]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: #001722; font-weight: 900; font-size: 10px; line-height: 1;
}
.src-item .src-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-item .src-star { color: var(--neon-yellow); font-size: 10px; }
.src-item.lang-ko .src-name { font-family: var(--kr); }
.src-item.disabled .src-name { color: var(--dim); text-decoration: line-through; }
.settings-pop.hidden { display: none; }

/* Section wrapper — groups related rows under a small title with a
   hairline divider above. Three sections: Display, Feed, Account. */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.settings-section-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wdth" 95;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--text);
  margin-bottom: 2px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--text-2);
  font-weight: 800;
  text-transform: uppercase;
}
.settings-hint {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 2px;
}
.settings-segs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.settings-segs .seg {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
}
.settings-segs .seg:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.settings-segs .seg.active {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: #001722;
  box-shadow: 0 0 14px rgba(0,225,255,0.5);
}
.settings-action {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: left;
}
.settings-action:hover {
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
  box-shadow: var(--glow-yellow);
}
.settings-account {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 5-segment rows (refresh rate uses this). */
.settings-segs.settings-segs-5,
#refresh-segs { grid-template-columns: repeat(5, 1fr); }

/* Interest row needs more vertical room — switch to a column layout. */
.settings-row.settings-row-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.interest {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: left;
  transition: border-color 120ms, color 120ms, background 120ms, box-shadow 120ms;
}
.interest:hover {
  border-color: var(--neon-mag);
  color: var(--neon-mag);
}
.interest.active {
  background: linear-gradient(135deg, rgba(255,43,214,0.18), rgba(255,43,214,0.06));
  border-color: var(--neon-mag);
  color: var(--text);
  box-shadow: 0 0 12px rgba(255,43,214,0.30);
}
.interest.active::after { content: " ✓"; color: var(--neon-mag); }
@media (max-width: 480px) {
  .interest-grid { grid-template-columns: repeat(2, 1fr); }
}
.brand .logo {
  color: var(--neon-yellow);
  font-size: 24px;
  line-height: 1;
  text-shadow: var(--glow-yellow);
}
.brand .name {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 64, "wdth" 96;
  font-size: 28px;
  letter-spacing: -1.5px;
  background: linear-gradient(90deg, #ffffff, var(--neon-cyan), var(--neon-mag));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Date — neon square chip that matches the gear button next to it. */
.date {
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(255,230,0,0.10), rgba(255,154,60,0.06));
  border: 1px solid rgba(255,230,0,0.35);
  border-radius: 5px;   /* same corner radius as #settings-btn */
  color: var(--neon-yellow);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,230,0,0.45);
  white-space: nowrap;
  height: 22px;        /* line up with the 22px gear */
  display: inline-flex;
  align-items: center;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Push the date pill away from the refresh button so they don't read
   as one combined chunk. */
.actions .date { margin-left: 12px; }

/* Account glyph — small square button that mirrors #settings-btn so
   the header stays balanced. Same 22×22 square, same 5px corner radius,
   same icon-button rhythm. Status is conveyed by the icon glyph + the
   color tone of the button, not by chips or labels. */
.account-chip {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(0,225,255,0.10), rgba(122,162,255,0.05));
  border: 1px solid rgba(0,225,255,0.35);
  color: var(--neon-cyan);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(0,225,255,0.5);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}
.account-chip:hover {
  box-shadow: 0 0 16px rgba(0,225,255,0.45);
  transform: translateY(-1px);
}
/* Anonymous: dim it down so the "active" account states pop visually. */
.account-chip.account-anon {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.22);
  color: var(--muted);
  text-shadow: none;
}
.account-chip.account-anon:hover {
  border-color: rgba(0,225,255,0.45);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,225,255,0.30);
}
/* Logged-in regular user: keep the cyan icon-button styling (matches ⚙). */
.account-chip.account-user { /* uses the base styling */ }
/* Admin: amber tone — clearly distinguishable from a plain user without
   extra chrome. */
.account-chip.account-admin {
  background: linear-gradient(135deg, rgba(246,192,96,0.14), rgba(246,192,96,0.04));
  border-color: rgba(246,192,96,0.50);
  color: #f6c060;
  text-shadow: 0 0 8px rgba(246,192,96,0.50);
}
.account-chip.account-admin:hover {
  box-shadow: 0 0 14px rgba(246,192,96,0.40);
}
.actions button {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  min-width: 32px;
  font-weight: 700;
}
.actions button:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan); }

/* ── Mobile (≤ 768px) — just tighten the spacing, layout stays row ── */
@media (max-width: 768px) {
  .masthead { padding: 10px 12px; gap: 8px; }
  .brand .logo { font-size: 20px; }
  .brand .name {
    font-size: 20px;
    /* Truncate cleanly if room runs out instead of pushing actions off */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .actions { gap: 6px; }
  .actions .date { margin-left: 8px; }
  .actions button { padding: 5px 9px; min-width: 28px; font-size: 13px; }
  .date { padding: 3px 8px; font-size: 9.5px; letter-spacing: 0.8px; }
  .actions {
    display: flex !important;
    width: 100% !important;
    gap: 6px;
  }
  .actions input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .actions button { flex: 0 0 auto; }

  /* Match the side padding on every other top-level horizontal band
     so left and right edges of all the bars line up exactly. */
  .tape-track,
  .strip-track,
  .headline,
  .chips,
  .main-col {
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Chip nav on phone: cap at exactly 2 visible rows. flex-wrap leaves
     gaps when the next chip can't fit on the current row (K-연예 is the
     widest; AI / 한국 leave the largest tail-gaps). Rather than shrink
     fonts more, clamp the container with max-height and put a small
     ▾ toggle on the right edge of line 2 — tap it and the rest unfurl.
     Tighter padding + gap so the visible rows pack densely. */
  .chips {
    gap: 2px;
    padding: 4px 36px 4px 10px;       /* right pad reserves space for ▾ */
    max-height: 50px;                 /* ≈ 2 chip rows + container pad */
    overflow: hidden;
    transition: max-height 220ms ease-out;
  }
  .chips.expanded { max-height: 260px; }
  .chip { padding: 1px 6px; font-size: 9.5px; gap: 2px; letter-spacing: 0.1px; }
  .chip .ct { min-width: 12px; padding: 0 3px; font-size: 9px; }

  /* ▾ toggle — pinned bottom-right of the chips container. Stays
     visible whether collapsed or expanded; its glyph flips on toggle. */
  .chip-toggle:not([hidden]) { display: inline-flex; }
  .chip-toggle {
    position: absolute;
    right: 6px;
    bottom: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 999px;
    background: rgba(11,13,24,0.92);
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease-out, border-color 120ms, color 120ms;
  }
  .chip-toggle:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,225,255,0.35);
  }
  .chips.expanded .chip-toggle { transform: rotate(180deg); }

  /* The headline (top-of-day brief) was 17px italic — too big on a
     phone. Shrink so it doesn't wrap into 4 lines. */
  .headline { font-size: 14px; padding-top: 12px; padding-bottom: 12px; }

  /* Sticky stack on phone is just masthead + chips. Tape is hidden
     when empty (and scrolls away when populated), so we don't have
     to budget for it.
       masthead ≈ 46px
       chips    ≈ 50-100px (depends on expanded state)
     Bump main-col padding-top so the first card's TOP border + glow
     never tucks under the chips bar, and scroll-margin so chip
     filter jumps land the card cleanly below the stack. */
  .chips { top: 46px; }
  .main-col { padding-top: 22px; }
  .art { scroll-margin-top: 110px; }
  /* Extra space above the very first card so its 22px outer glow has
     room to breathe before the sticky chips border. */
  #paper > .art:first-child,
  #paper-noimg > .art:first-child { margin-top: 6px; }

  /* The price tape and the three flow strips were inheriting desktop
     padding (24px) but now share the same 12px. Same with the chip
     scroll gutter. */
  /* Mobile tape — definitive overlap fix. Earlier passes didn't
     fully kill the visible bite the tape was taking out of the
     WHALES strip on portrait phones. The remaining causes were
     subpixel-level:
       (a) iOS Safari sticky + inner transform (marquee animation)
           occasionally bleeds 1-2px past the parent's overflow:hidden
           clip when the layer isn't its own compositing layer.
       (b) `border-bottom: 1px solid` lives ON the box edge, so when
           the browser rounds the box's bottom to the nearest device
           pixel and the strip below rounds the OTHER way, you get a
           half-pixel overlap.
     Defenses, in order:
       1. transform: translateZ(0) → forces a fresh GPU layer so the
          sticky+marquee combo composites cleanly.
       2. contain: paint → strict clip, nothing renders past the box.
       3. box-shadow inset replaces border-bottom → never paints
          outside the box.
       4. margin-bottom: 2px → guaranteed pixel gap so even if all of
          the above somehow fail there's clear separation.  */
  .tape {
    font-size: 11px;
    backdrop-filter: none;
    background: var(--bg-1);
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 var(--line);
    z-index: 1;
    transform: translateZ(0);
    contain: paint;
    margin-bottom: 2px;
  }
  /* Strips get their own z-index so the natural document flow is
     preserved; once the tape stickies, the strip slides cleanly
     underneath instead of being half-covered. */
  .strip {
    position: relative;
    z-index: 2;
    /* Opaque strip background so even an edge-case overlap with the
       tape can't visually bleed into the strip. */
    background: var(--bg-1);
  }
  /* Match track dimensions exactly between tape and strips so all
     four horizontal bands have the same height — the user reported
     the stock row sitting taller than the rest, which is what made
     the overlap visually obvious. */
  .tape-track, .strip-track {
    padding: 4px 12px;
    font-size: 11px;
  }

  /* Main column padding too — same edge alignment as everything above */
  .main-col {
    padding-top: 12px;
    padding-bottom: 30px;
  }
  /* In #paper grid, force single-column at this size so cards stretch
     edge-to-edge instead of squishing in a 12-col template. */
  #paper {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Tape ─────────────────────────────────────────────────── */
.tape {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,230,0,0.05), transparent);
  overflow: hidden;
  /* Not sticky — let it scroll away naturally so the chips bar can
     dock directly under the masthead. Avoids the gap when tape is
     empty AND the stacking math required pixel-perfect sticky tops. */
  backdrop-filter: blur(8px);
}
/* Hide the strip entirely when there's nothing to render. Otherwise the
   border + gradient strip read as random leftover chrome at the top. */
.tape:empty { display: none; }
.tape-track {
  display: flex;
  gap: 22px;
  padding: 5px 16px;
  white-space: nowrap;
  animation: marquee 30s linear infinite;   /* was 110s — 3.7× faster */
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tick { display: inline-flex; align-items: center; gap: 7px; }
.tick .lbl { color: var(--text-2); font-weight: 700; letter-spacing: 0.4px; }
.tick .px  { color: var(--text); font-weight: 500; }
.tick .ch.up    { color: var(--up); font-weight: 700; text-shadow: 0 0 8px rgba(182,255,60,0.55); }
.tick .ch.down  { color: var(--down); font-weight: 700; text-shadow: 0 0 8px rgba(255,77,109,0.55); }

/* ── Headline ─────────────────────────────────────────────── */
.headline {
  padding: 10px 18px;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wdth" 95;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: linear-gradient(90deg, rgba(0,225,255,0.06), transparent 80%);
  letter-spacing: -0.3px;
}
.headline[lang="ko"] { font-family: var(--kr); font-weight: 600; letter-spacing: -0.4px; }
.headline:empty { display: none; }
.headline::before {
  content: "✦ TODAY";
  display: inline-block;
  font-family: var(--mono);
  color: var(--neon-yellow);
  font-weight: 700;
  font-size: 10.5px;
  font-style: normal;
  letter-spacing: 2px;
  margin-right: 12px;
  vertical-align: 2px;
  text-shadow: var(--glow-yellow);
}

/* ── Chips ────────────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 4px;
  padding: 5px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: rgba(5,6,10,0.85);
  backdrop-filter: blur(10px);
  /* Chips dock right under the masthead. Desktop masthead measures
     ~50px; phone is ~46px (overridden in the mobile media query). */
  position: sticky;
  top: 50px;
  z-index: 19;
}
.chip {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.15s;
  text-transform: uppercase;
  line-height: 1.25;
}
/* Counter pill retired — chips show just a glyph + label now.
   Rule kept as display:none in case a stale browser cache renders
   the old HTML that included <span class="ct">. */
.chip .ct { display: none !important; }
.chip .ct:empty { display: none; }
.chip.active .ct { background: rgba(0,0,0,0.18); color: inherit; opacity: 0.65; }
.chip:hover { border-color: var(--text-2); color: var(--text); }

/* Desktop: chips never need the clamp + toggle. */
.chip-toggle { display: none; }
.chip.active {
  background: var(--text);
  color: var(--bg-0);
  border-color: var(--text);
  box-shadow: 0 0 24px rgba(255,255,255,0.3);
}
/* Inactive per-category chips now wear a faint neon tint so the whole
   chip row glows even before you tap anything. User wanted "neon on the
   top list too." */
.chip.cat-world   { color: color-mix(in srgb, var(--c-world)   70%, white); border-color: color-mix(in srgb, var(--c-world)   45%, transparent); }
.chip.cat-econ    { color: color-mix(in srgb, var(--c-econ)    70%, white); border-color: color-mix(in srgb, var(--c-econ)    45%, transparent); }
.chip.cat-biz     { color: color-mix(in srgb, var(--c-biz)     70%, white); border-color: color-mix(in srgb, var(--c-biz)     45%, transparent); }
.chip.cat-tech    { color: color-mix(in srgb, var(--c-tech)    70%, white); border-color: color-mix(in srgb, var(--c-tech)    45%, transparent); }
.chip.cat-ai      { color: color-mix(in srgb, var(--c-ai)      70%, white); border-color: color-mix(in srgb, var(--c-ai)      45%, transparent); }
.chip.cat-crypto  { color: color-mix(in srgb, var(--c-crypto)  70%, white); border-color: color-mix(in srgb, var(--c-crypto)  45%, transparent); }
.chip.cat-science { color: color-mix(in srgb, var(--c-science) 70%, white); border-color: color-mix(in srgb, var(--c-science) 45%, transparent); }
.chip.cat-geo     { color: color-mix(in srgb, var(--c-geo)     70%, white); border-color: color-mix(in srgb, var(--c-geo)     45%, transparent); }
.chip.cat-opinion { color: color-mix(in srgb, var(--c-opinion) 70%, white); border-color: color-mix(in srgb, var(--c-opinion) 45%, transparent); }
.chip.cat-korea   { color: color-mix(in srgb, var(--c-korea)   70%, white); border-color: color-mix(in srgb, var(--c-korea)   45%, transparent); }
.chip.cat-kent    { color: color-mix(in srgb, var(--c-kent)    70%, white); border-color: color-mix(in srgb, var(--c-kent)    45%, transparent); }
/* Premium chip: gold/yellow with a soft glow so it reads as the
   exclusive view. */
.chip.cat-premium {
  color: var(--neon-yellow);
  border-color: rgba(255,230,0,0.55);
  text-shadow: 0 0 10px rgba(255,230,0,0.45);
  letter-spacing: 0.8px;
}
.chip.cat-premium.active {
  background: var(--neon-yellow);
  color: #1a1305;
  border-color: var(--neon-yellow);
  box-shadow: 0 0 28px rgba(255,230,0,0.55);
}
.chip.active .ct { color: var(--bg-0); opacity: 0.5; }
.chip.cat-world.active   { background: var(--c-world);   border-color: var(--c-world);   color: #001722; box-shadow: 0 0 24px rgba(0,225,255,0.5); }
.chip.cat-econ.active    { background: var(--c-econ);    border-color: var(--c-econ);    color: #0b1a00; box-shadow: 0 0 24px rgba(182,255,60,0.45); }
.chip.cat-biz.active     { background: var(--c-biz);     border-color: var(--c-biz);     color: #1a1305; box-shadow: 0 0 24px rgba(255,230,0,0.45); }
.chip.cat-tech.active    { background: var(--c-tech);    border-color: var(--c-tech);    color: #170433; box-shadow: 0 0 24px rgba(179,136,255,0.45); }
.chip.cat-ai.active      { background: var(--c-ai);      border-color: var(--c-ai);      color: #2a0024; box-shadow: 0 0 24px rgba(255,43,214,0.5); }
.chip.cat-crypto.active  { background: var(--c-crypto);  border-color: var(--c-crypto);  color: #2a1500; box-shadow: 0 0 24px rgba(255,154,60,0.5); }
.chip.cat-science.active { background: var(--c-science); border-color: var(--c-science); color: #001722; box-shadow: 0 0 24px rgba(0,225,255,0.45); }
.chip.cat-geo.active     { background: var(--c-geo);     border-color: var(--c-geo);     color: #2a0008; box-shadow: 0 0 24px rgba(255,77,109,0.45); }
.chip.cat-opinion.active { background: var(--c-opinion); border-color: var(--c-opinion); color: #170433; box-shadow: 0 0 24px rgba(179,136,255,0.45); }
.chip.cat-korea.active   { background: var(--c-korea);   border-color: var(--c-korea);   color: #2a001b; box-shadow: 0 0 24px rgba(255,91,232,0.5); }
.chip.cat-kent.active    { background: var(--c-kent);    border-color: var(--c-kent);    color: #2a001b; box-shadow: 0 0 24px rgba(255,91,232,0.5); }

/* ── Layout: main column ──────────────────────────────────── */
.main-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  /* Bumped top-padding so the very first card's outer glow doesn't
     touch the sticky chips bar above it. */
  padding: 24px 18px 22px;
  max-width: 1800px;
  margin: 0 auto;
}
/* Desktop: a touch more separation between chips and the hero card.
   Mobile override happens in the @media block above. */
#paper > .art:first-child,
#paper-noimg > .art:first-child { margin-top: 8px; }

/* Whale / insider-trade / video strips were retired with the
   right rail. Only the .tape marquee at the top remains. */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Position-based card accent (cycles a 6-color palette) ────────
   Every card in the grid picks a hue based on its slot, not its
   source. Gives the wall visual rhythm + helps the eye track where
   it is in the page. The border + glow stack with the base .art
   styling. Hero (first card) is always magenta to anchor the page. */
:root {
  --acc-1: 255, 43, 214;    /* magenta  */
  --acc-2: 0, 225, 255;     /* cyan     */
  --acc-3: 246, 192, 96;    /* amber    */
  --acc-4: 158, 119, 255;   /* violet   */
  --acc-5: 74, 222, 128;    /* green    */
  --acc-6: 255, 122, 105;   /* coral    */
}
#paper .art:nth-child(6n+1) { --acc: var(--acc-1); }
#paper .art:nth-child(6n+2) { --acc: var(--acc-2); }
#paper .art:nth-child(6n+3) { --acc: var(--acc-3); }
#paper .art:nth-child(6n+4) { --acc: var(--acc-4); }
#paper .art:nth-child(6n+5) { --acc: var(--acc-5); }
#paper .art:nth-child(6n+6) { --acc: var(--acc-6); }
#paper-noimg .art:nth-child(3n+1) { --acc: var(--acc-2); }
#paper-noimg .art:nth-child(3n+2) { --acc: var(--acc-5); }
#paper-noimg .art:nth-child(3n)   { --acc: var(--acc-3); }

/* Apply the position color over the base subtle magenta border so
   the rhythm pops while the "soothing" base is preserved. */
.art {
  border-color: rgba(var(--acc, var(--acc-1)), 0.42) !important;
  box-shadow:
    0 0 0 1px rgba(var(--acc, var(--acc-1)), 0.14),
    0 0 22px rgba(var(--acc, var(--acc-1)), 0.18),
    0 10px 28px rgba(0,0,0,0.40) !important;
}
.art:hover {
  border-color: rgba(var(--acc, var(--acc-1)), 0.78) !important;
  box-shadow:
    0 0 0 1px rgba(var(--acc, var(--acc-1)), 0.28),
    0 0 30px rgba(var(--acc, var(--acc-1)), 0.32),
    0 14px 36px rgba(0,0,0,0.55) !important;
  transform: translateY(-2px);
}
.art .meta .tag { background: rgba(var(--acc, var(--acc-1)), 0.18); color: rgba(var(--acc, var(--acc-1)), 1); }

/* Translated cards keep the magenta override for the "has translation"
   signal — overrides the position-cycling color so the affordance
   still reads clearly. */
.art.has-ko { --acc: var(--acc-1); }
.art.has-ko {
  border-color: rgba(255,43,214,0.68) !important;
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.36),
    0 0 28px rgba(255,43,214,0.32),
    0 10px 28px rgba(0,0,0,0.40) !important;
}

/* ── No-image cards: float layout — each card sizes to its own
       content; no grid row-stretching pulling neighbors taller. ── */
#paper-noimg {
  display: flow-root;        /* establishes BFC, contains the floats */
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
#paper-noimg:empty { display: none; }
#paper-noimg::before {
  content: "MORE 더보기";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
#paper-noimg > .art {
  float: left;
  width: calc((100% - 24px) / 4);   /* 4 per row, 8px gutters × 3 */
  margin: 0 8px 8px 0;
}
#paper-noimg > .art:nth-child(4n) { margin-right: 0; }

@media (max-width: 1400px) {
  #paper-noimg > .art { width: calc((100% - 16px) / 3); margin-right: 8px; }
  #paper-noimg > .art:nth-child(4n) { margin-right: 8px; }
  #paper-noimg > .art:nth-child(3n) { margin-right: 0; }
}
@media (max-width: 900px) {
  #paper-noimg > .art { width: calc((100% - 8px) / 2); }
  #paper-noimg > .art:nth-child(3n) { margin-right: 8px; }
  #paper-noimg > .art:nth-child(2n) { margin-right: 0; }
}
@media (max-width: 600px) {
  #paper-noimg > .art { width: 100%; margin-right: 0; }
}

/* ── Paper grid ───────────────────────────────────────────── */
#paper {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 8px;
  /* Don't stretch cards to row height — a short card stays short.
     This eliminates the empty band between title and body when the
     article had a thin/missing dek. */
  align-items: start;
}

/* Spans by tier (image cards only — text-only cards are floated in
   #paper-noimg and don't participate in this grid).
   All non-hero tiers span 6 so the grid is a uniform 2-per-row band
   below the hero — no orphan boxes left over in the last row. */
.tier-hero       { grid-column: span 12; }
.tier-feature    { grid-column: span 6;  }
.tier-large      { grid-column: span 6;  }
.tier-medium     { grid-column: span 6;  }
.tier-small      { grid-column: span 6;  }

@media (max-width: 800px) {
  .tier-hero, .tier-feature, .tier-large, .tier-medium, .tier-small {
    grid-column: span 12;
  }
}

/* ── Article cards (base) ─────────────────────────────────── */
.art {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005)),
    rgba(11, 13, 24, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  backdrop-filter: blur(6px);
  animation: fadein 0.4s ease-out both;
}
/* Surgical re-renders (e.g. card-level translate toggle) opt out of
   the first-paint fade so the swap feels instant, not flashy. */
.art.no-fade { animation: none; }

/* Don't let the headline balloon to fill empty card space — that
   was the root cause of the giant title-to-body gap when an article
   had little or no body. Cards now size to their actual content. */
.art > .h { flex: 0 0 auto; }

/* User wants ONLY the photo zoom on hover/tap — no card lift, no
   highlight overlay, no accent-bar growth. */

/* ── Card border + soft glow ────────────────────────────────────
   Every card gets a gentle magenta-tinted boundary + outer glow.
   The user said it's "soothing" — gives the wall a consistent
   premium feel without screaming. Applied universally now that the
   translated-only affordance is gone. */
.art {
  border-color: rgba(255,43,214,0.32);
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.12),
    0 0 18px rgba(255,43,214,0.12);
}
.art:hover {
  border-color: rgba(255,43,214,0.55);
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.22),
    0 0 26px rgba(255,43,214,0.22);
}

/* Image wrapper — positioning context for the × delete button + the
   ✦한 toggle badge. Inherits sizing from the inner .img so existing
   tier rules (.tier-hero .img { aspect-ratio: 21/9 ... }) still drive
   the layout. */
.art .img-wrap {
  position: relative;
  display: block;
  width: 100%;
  border-radius: inherit;
  overflow: hidden;
}

/* Cards with a stored Korean translation get a richer border + a
   stronger inner glow so they pop slightly from the rest of the
   wall. When .ko-on is also set (user toggled to KR view), the glow
   intensifies further as live feedback. */
.art.has-ko {
  border-color: rgba(255,43,214,0.62);
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.30),
    0 0 26px rgba(255,43,214,0.28);
}
.art.has-ko:hover {
  border-color: rgba(255,43,214,0.85);
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.42),
    0 0 32px rgba(255,43,214,0.38);
}
.art.has-ko.ko-on {
  border-color: var(--neon-mag);
  box-shadow:
    0 0 0 1px rgba(255,43,214,0.50),
    0 0 36px rgba(255,43,214,0.45);
}

/* ✦한 toggle badge — tiny pill on the image's top-right corner.
   Subtle at rest, lights up when active. Click flips the card
   preview between source and translation inline (no modal). */
.ko-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  background: rgba(11,13,24,0.78);
  border: 1px solid rgba(255,43,214,0.55);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: 0.8px;
  line-height: 1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-transform: uppercase;
  transition: background 120ms, border-color 120ms, box-shadow 120ms, transform 60ms;
}
.ko-badge:hover {
  border-color: var(--neon-mag);
  box-shadow: 0 0 12px rgba(255,43,214,0.40);
}
.ko-badge:active { transform: scale(0.94); }
.ko-badge .kb-glyph {
  color: var(--neon-mag);
  font-size: 10px;
  text-shadow: 0 0 8px rgba(255,43,214,0.55);
}
.ko-badge .kb-text[lang="ko"] { font-family: var(--kr); }
/* Active (showing KR) — filled magenta. */
.art.ko-on .ko-badge {
  background: var(--neon-mag);
  border-color: var(--neon-mag);
  color: #1a0014;
}
.art.ko-on .ko-badge .kb-glyph { color: #1a0014; text-shadow: none; }
/* When the card has no image (text-only tier) the badge falls back
   into the meta line via .ko-badge-inline. */
.ko-badge.ko-badge-inline {
  position: static;
  margin-left: 4px;
  height: 18px;
  padding: 2px 7px;
  font-size: 8.5px;
}

/* Delete affordances are admin-only. Hidden by default — JS adds
   body[data-is-admin="1"] after /api/auth/whoami confirms the user.
   The backend /api/article/delete also requires admin, so even if
   someone removes this CSS rule the destructive action won't fire
   for non-admins. */
body:not([data-is-admin="1"]) .card-delete,
body:not([data-is-admin="1"]) .reader-delete {
  display: none !important;
}

/* × delete button on every card — sits at the top-left of the image
   wrap (opposite corner from the ✦한 badge so they never collide). On
   text-only cards (.card-delete-inline) it pins to the card's top-right
   corner instead. Faint at rest, pops on hover so the affordance is
   discoverable but doesn't compete with the headline for attention. */
.card-delete {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(11,13,24,0.62);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: rgba(255,255,255,0.72);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    border-color 120ms,
    color 120ms,
    background 120ms,
    box-shadow 120ms;
}
.art:hover .card-delete,
.card-delete:focus-visible {
  opacity: 1;
  transform: scale(1);
}
.card-delete:hover {
  background: rgba(80,8,22,0.85);
  border-color: var(--down);
  color: var(--down);
  box-shadow: 0 0 14px rgba(255,71,87,0.45);
}
.card-delete:active { transform: scale(0.92); }
.card-delete.card-delete-inline {
  top: 6px;
  right: 6px;
  left: auto;
  width: 22px;
  height: 22px;
  font-size: 14px;
}
/* Mobile / touch: always show — no :hover, finger needs an obvious target. */
@media (hover: none), (max-width: 768px) {
  .card-delete { opacity: 0.85; transform: scale(1); }
}

/* Vanish animation when a card is removed via the delete flow. */
.art.art-vanish {
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease, max-height 260ms ease;
  opacity: 0;
  transform: scale(0.96);
  max-height: 0;
  overflow: hidden;
}

/* ── Delete-with-reason modal ────────────────────────────────────
   Reuses the .reader / .reader-backdrop scaffolding from the reader
   modal so the open/close behavior is identical (Esc, backdrop tap),
   but the inner card has its own footprint — smaller, centered,
   reason-list-shaped. */
#delete-modal .delete-card {
  position: relative;
  margin: auto;
  max-width: 460px;
  width: calc(100% - 24px);
  background: var(--bg-2, #11131f);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,43,214,0.18) inset;
  color: var(--text);
  font-family: var(--sans);
}
#delete-modal .reader-close {
  position: absolute;
  top: 10px;
  right: 10px;
}
#delete-modal .delete-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 72, "wdth" 96;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.4px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
#delete-modal .delete-headline {
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wdth" 95;
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-2);
  margin: 2px 0 18px;
  /* clamp to two lines so a huge headline can't push the picker
     below the fold on phones */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#delete-modal .delete-headline[lang="ko"],
#delete-modal .delete-headline:lang(ko) {
  font-family: var(--kr);
  font-variation-settings: normal;
}
#delete-modal .delete-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
#delete-modal .delete-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#delete-modal .del-reason {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 140ms, border-color 140ms, transform 60ms;
}
#delete-modal .del-reason:hover {
  background: rgba(255,71,87,0.10);
  border-color: var(--down);
}
#delete-modal .del-reason:hover .dr-tag {
  color: #ffd5da;
}
#delete-modal .del-reason:active { transform: scale(0.995); }
#delete-modal .dr-tag {
  flex: 0 0 110px;
  /* Display face for the option label — Bricolage Grotesque set at
     a narrower opsz so the picker reads like a proper editorial menu
     instead of a tag list. Title case, not all-caps. */
  font-family: var(--display);
  font-variation-settings: "opsz" 18, "wdth" 95;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.1px;
  color: var(--down);
  transition: color 140ms;
}
#delete-modal .dr-text {
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--muted);
}
#delete-modal .delete-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
#delete-modal .del-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-2);
  padding: 8px 18px;
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
}
#delete-modal .del-cancel:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.04);
}
@media (max-width: 500px) {
  #delete-modal .delete-title { font-size: 20px; }
  #delete-modal .dr-tag { flex-basis: 92px; font-size: 13.5px; }
  #delete-modal .dr-text { font-size: 12px; }
}

/* Inline error surface inside the delete modal — only appears when
   the server rejects the delete (auth, network, etc.). The old flow
   silently dropped failures so the user never knew their delete
   didn't land. */
#delete-modal .delete-error {
  display: none;
  margin-top: 12px;
  padding: 9px 12px;
  background: rgba(255,71,87,0.10);
  border: 1px solid var(--down);
  border-radius: 8px;
  color: var(--down);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  line-height: 1.35;
}
#delete-modal .delete-error.visible { display: block; }

/* Mid-submission state — fade the picker so the user can't fire the
   request twice + the active row gets a spinner-ish stripe. */
#delete-modal .delete-reasons.submitting { opacity: 0.55; pointer-events: none; }
#delete-modal .del-reason.submitting-active {
  background: rgba(255,71,87,0.15);
  border-color: var(--down);
}

/* category accent bar (static — no grow on hover) */
.art::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--line-2);
}

.art.cat-world   { --c: var(--c-world); }
.art.cat-econ    { --c: var(--c-econ); }
.art.cat-biz     { --c: var(--c-biz); }
.art.cat-tech    { --c: var(--c-tech); }
.art.cat-ai      { --c: var(--c-ai); }
.art.cat-crypto  { --c: var(--c-crypto); }
.art.cat-science { --c: var(--c-science); }
.art.cat-geo     { --c: var(--c-geo); }
.art.cat-opinion { --c: var(--c-opinion); }
.art.cat-korea   { --c: var(--c-korea); }
.art.cat-kent    { --c: var(--c-kent); }
.art.cat-whale   { --c: var(--c-whale); }
.art.cat-trade   { --c: var(--c-trade); }
.art.cat-video   { --c: var(--c-video); }

/* ── Change-password modal ────────────────────────────────────
   Uses the existing .reader.hidden / .reader-backdrop / .reader
   scaffolding for centered overlay + close behaviour. .pw-card is
   the inner sheet — matches the editorial polish of #delete-modal
   so the two destructive-ish surfaces feel like the same family. */
#pw-modal .pw-card {
  position: relative;
  margin: auto;
  max-width: 420px;
  width: calc(100% - 24px);
  background: var(--bg-2, #11131f);
  border: 1px solid rgba(255,43,214,0.32);
  border-radius: 14px;
  padding: 26px 26px 22px;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.55),
    0 0 24px rgba(255,43,214,0.18),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  color: var(--text);
  font-family: var(--sans);
}
#pw-modal .reader-close { position: absolute; top: 10px; right: 10px; }
#pw-modal .pw-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 72, "wdth" 96;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.4px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
#pw-modal .pw-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
#pw-modal .pw-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 5px;
}
#pw-modal .pw-input {
  width: 100%;
  background: var(--bg-1, #0b0d18);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  transition: border-color 140ms, box-shadow 140ms;
}
#pw-modal .pw-input:focus {
  outline: none;
  border-color: rgba(255,43,214,0.55);
  box-shadow: 0 0 0 2px rgba(255,43,214,0.18);
}
#pw-modal .pw-msg {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  min-height: 16px;
}
#pw-modal .pw-msg.err { color: var(--down); }
#pw-modal .pw-msg.ok  { color: var(--up, #4ade80); }
#pw-modal .pw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
#pw-modal .pw-cancel,
#pw-modal .pw-submit {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms;
}
#pw-modal .pw-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-2);
}
#pw-modal .pw-cancel:hover {
  border-color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
#pw-modal .pw-submit {
  background: linear-gradient(135deg, rgba(255,43,214,0.85), rgba(255,43,214,0.55));
  border: 1px solid rgba(255,43,214,0.65);
  color: #1a0014;
  font-weight: 800;
}
#pw-modal .pw-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 14px rgba(255,43,214,0.35);
}
#pw-modal .pw-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.art::before { background: var(--c, var(--line-2)); }

/* ── Meta line ────────────────────────────────────────────── */
.art .meta {
  /* Stays on ONE line — never wrap, never steal vertical space.
     Source name truncates with ellipsis if it would push the row wider. */
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.2;
}
.art .meta > * { flex-shrink: 0; }
.art .meta .src {
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.art .meta .src { color: var(--text-2); }
/* `.when` chip retired from cards — date lives in the reader modal
   now. Keep the rule as a no-op so any cached HTML still renders. */
.art .meta .when { display: none; }
.art .meta .lang {
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9.5px;
  border: 1px solid var(--line-2);
}
.art .meta .lang-ko { color: var(--c-korea); border-color: rgba(255,91,232,0.45); }
.art .meta .lang-en { color: var(--c-world); border-color: rgba(0,225,255,0.45); }
.art .meta .tag {
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 800;
  background: color-mix(in srgb, var(--c, var(--text-2)) 18%, transparent);
  color: var(--c, var(--text-2));
  letter-spacing: 0.6px;
}
.art .meta .score-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-yellow);
  letter-spacing: 0.5px;
  padding-left: 4px;
}
.art .meta .premium-pip {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 1px 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,230,0,0.22), rgba(255,154,60,0.12));
  border: 1px solid rgba(255,230,0,0.45);
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255,230,0,0.45);
}

/* ── Image (responsive, with bottom gradient + category badge) ── */
.art .img {
  /* Layered background:
     1. inline `background-image: url('…')` set by JS (top, covers when loaded)
     2. category-color gradient fallback below — if the publisher's CDN
        404s or stalls, this is what the user sees instead of an empty box. */
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.5s ease-out;
  /* No saturate/contrast filter — show the publisher's photo at its
     real colors. The user explicitly preferred unmodified images. */
}
/* No neon backdrop on the image. The publisher's photo is shown as-is
   on a plain dark fallback if it ever fails to load. The user requested
   zero color shift on photos — keep this neutral. */
.art .img::before { content: none; }
/* No vignette / overlay on .art .img — user requirement: show the
   publisher's photo at its real colors, unmodified, full stop. */
.art:hover .img {
  transform: scale(1.04);
}

/* ── Headline typography ──────────────────────────────────── */
.art .h {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 96;
  letter-spacing: -0.6px;
  color: var(--text);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
  font-optical-sizing: auto;
  /* Centre titles inside the card so the layout reads as a series of
     centred posters rather than left-aligned columns. */
  text-align: center;
}
.art .h[lang="ko"] {
  font-family: var(--kr);
  font-weight: 800;
  font-variation-settings: normal;
  letter-spacing: -0.3px;   /* slightly looser so Pretendard doesn't crush left */
  line-height: 1.32;        /* a touch more breathing room for Hangul */
  font-feature-settings: "palt" 1, "vpal" 1, "kern" 1;
}
/* Body snippet — keep it centered to match the title rhythm. */
.art .dek { text-align: center; }
.art .meta { justify-content: center; }
/* dek = body snippet — make it always-visible and pretty.
   Slightly bumped from 12.5 → 13.5 base so the body is comfortable
   reading on desktop; per-tier overrides below tune it further. */
.art .dek {
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  opacity: 0.92;
}
.art .dek[lang="ko"] { font-family: var(--kr); }
.art .why {
  font-family: var(--accent-serif);
  font-style: italic;
  color: var(--neon-yellow);
  font-size: 13px;
  line-height: 1.35;
  border-left: 2px solid var(--neon-yellow);
  padding-left: 8px;
  margin-top: 2px;
  text-shadow: 0 0 14px rgba(255,230,0,0.25);
}
.art .why[lang="ko"] { font-family: var(--kr); font-style: normal; font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   Tier layouts — each tier is its own composition.
   No tier sets min-height: cards size to their actual content so the
   grid packs densely (short story → small box, long story → big box).
   Every tier shows the body snippet (dek) where there's room.
   ════════════════════════════════════════════════════════════ */

/* ── HERO — image covers the TOP HALF (full width), text below ── */
.tier-hero {
  padding: 0;                  /* image flush with card edges */
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0,225,255,0.07), rgba(255,43,214,0.07)),
    rgba(11,13,24,0.85);
  box-shadow: 0 10px 50px rgba(0,0,0,0.35);
  gap: 0;
  /* default flex-column from .art → image on top */
}
.tier-hero::before { display: none; }
.tier-hero .img {
  width: 100%;
  aspect-ratio: 21/9;          /* cinematic, ~50% of the card */
  min-height: 420px;
  border-radius: 0;            /* image fills to the card edge */
}
.tier-hero .body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 18px;
}
@media (max-width: 900px) {
  .tier-hero .img { min-height: 240px; aspect-ratio: 16/9; }
}
.tier-hero .body { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.tier-hero .h {
  font-size: calc(clamp(36px, 4vw, 54px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 96;
  line-height: 0.98;
  letter-spacing: -2px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-hero .h[lang="ko"] {
  font-size: calc(clamp(28px, 3.1vw, 42px) * var(--text-scale, 1));
  line-height: 1.15;
  letter-spacing: -1.6px;
}
/* English hero gets a high-contrast DM Serif drop cap. */
.tier-hero .h[lang="en"]::first-letter {
  font-family: var(--accent-serif);
  font-style: italic;
  color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
  font-weight: 400;
  padding-right: 4px;
}
.tier-hero .dek { font-size: 15px; -webkit-line-clamp: 8; }
.tier-hero .why { font-size: 14.5px; }
@media (max-width: 900px) {
  .tier-hero { grid-template-columns: 1fr; }
}

/* ── FEATURE — image ON TOP, full card width, big and dominant ── */
.tier-feature {
  padding: 10px 12px;
  /* default flex-column from .art puts image on top */
}
.tier-feature .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 280px;
  border-radius: 11px;
}
.tier-feature .h {
  font-size: calc(clamp(24px, 2.1vw, 32px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 72, "wdth" 90;
  line-height: 1.08;
  letter-spacing: -0.8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-feature .h[lang="ko"] {
  font-size: calc(clamp(21px, 1.85vw, 26px) * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: -0.8px;
}
.tier-feature .dek { -webkit-line-clamp: 9; font-size: 14px; line-height: 1.55; }

/* ── LARGE — image ON TOP, full card width ──────────────── */
.tier-large {
  padding: 9px 11px;
}
.tier-large .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 220px;
  border-radius: 10px;
}
.tier-large .h {
  font-size: calc(clamp(22px, 1.9vw, 28px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 60, "wdth" 92;
  line-height: 1.12;
  letter-spacing: -0.6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-large .h[lang="ko"] { font-size: calc(clamp(19px, 1.7vw, 23px) * var(--text-scale, 1)); }
.tier-large .dek { -webkit-line-clamp: 8; font-size: 13.5px; line-height: 1.5; }

/* ── MEDIUM — image ON TOP, full card width ─────────────── */
.tier-medium {
  padding: 9px 11px;
  /* default flex-column from .art puts image on top */
}
.tier-medium .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 170px;
  border-radius: 9px;
}
.tier-medium .h {
  font-size: calc(clamp(20px, 1.55vw, 26px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 90;
  line-height: 1.12;
  letter-spacing: -0.55px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-medium .h[lang="ko"] {
  font-size: calc(clamp(17.5px, 1.4vw, 22px) * var(--text-scale, 1));
  letter-spacing: -0.8px;
}
.tier-medium .dek { -webkit-line-clamp: 8; font-size: 13px; line-height: 1.5; }

/* ── SMALL — image ON TOP, dominates card height ──────── */
.tier-small {
  padding: 8px 10px;
  /* default flex-column from .art */
}
.tier-small .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 150px;
  border-radius: 8px;
}
.tier-small .h {
  font-size: calc(clamp(18px, 1.4vw, 22px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 36, "wdth" 88;
  line-height: 1.14;
  letter-spacing: -0.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-small .h[lang="ko"] {
  font-size: calc(clamp(16px, 1.25vw, 19px) * var(--text-scale, 1));
  letter-spacing: -0.7px;
}
.tier-small .dek { -webkit-line-clamp: 7; font-size: 12.5px; line-height: 1.5; }

/* ── HEADLINE — NO image, big bold display title + dek snippet
       Box shrinks to content (no min-height). */
.tier-headline {
  padding: 10px 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c, var(--text-2)) 8%, transparent), transparent 40%),
    rgba(11,13,24,0.82);
}
.tier-headline .h {
  font-family: var(--display);
  font-size: calc(clamp(24px, 2.3vw, 34px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 88, "wdth" 85;
  line-height: 1.02;
  letter-spacing: -1.2px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 0 22px color-mix(in srgb, var(--c, var(--text)) 22%, transparent);
}
.tier-headline .h[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  font-weight: 900;
  font-size: calc(clamp(22px, 2vw, 28px) * var(--text-scale, 1));
  letter-spacing: -1px;
  line-height: 1.18;
}
.tier-headline .dek {
  font-size: 13px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── FLASH — no image, smaller, still bold, with one-line dek ── */
.tier-flash {
  padding: 8px 10px;
}
.tier-flash .h {
  font-family: var(--display);
  font-size: calc(clamp(19px, 1.7vw, 24px) * var(--text-scale, 1));
  font-weight: 800;
  font-variation-settings: "opsz" 44, "wdth" 86;
  line-height: 1.12;
  letter-spacing: -0.6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-flash .h[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  font-weight: 800;
  font-size: calc(clamp(17px, 1.5vw, 21px) * var(--text-scale, 1));
  line-height: 1.22;
  letter-spacing: -0.8px;
}
.tier-flash .dek {
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-flash .meta { font-size: 9.5px; }

/* ── Sparkline row ────────────────────────────────────────── */
.spark-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.spark {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.spark .sym { font-weight: 800; color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,225,255,0.4); }
.spark svg { display: block; }
.spark .ch.up   { color: var(--up); font-weight: 700; }
.spark .ch.down { color: var(--down); font-weight: 700; }
.spark svg polyline {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: draw 1s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Right rail (legacy — no longer rendered) ───────────────
   The whales / trades / videos content lives in the horizontal
   marquee strips at the top now. These rules stay in place purely
   so older snapshots don't visually explode. */
#rail { display: none !important; }
.LEGACY_RAIL {
  position: sticky;
  top: 160px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-bottom: 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
#rail::-webkit-scrollbar { width: 6px; }
#rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

@media (max-width: 1080px) {
  #rail { position: static; max-height: none; }
}

.rail-section {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005)),
    rgba(11,13,24,0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.rail-head .dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--neon-lime);
  box-shadow: 0 0 12px var(--neon-lime);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.55; transform: scale(1.4); }
}
.rail-whales .rail-head { color: var(--neon-lime); text-shadow: 0 0 12px rgba(182,255,60,0.4); }
.rail-trades .rail-head { color: var(--neon-yellow); text-shadow: 0 0 12px rgba(255,230,0,0.4); }
.rail-trades .rail-head .dot { background: var(--neon-yellow); box-shadow: 0 0 12px var(--neon-yellow); }
.rail-videos .rail-head { color: var(--neon-pink); text-shadow: 0 0 12px rgba(255,91,232,0.4); }
.rail-videos .rail-head .dot { background: var(--neon-pink); box-shadow: 0 0 12px var(--neon-pink); }

.rail-body { display: flex; flex-direction: column; }

/* Whale row */
.w-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.w-row:first-child { border-top: 0; }
.w-row .amt {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--neon-lime);
  letter-spacing: -0.3px;
  text-shadow: 0 0 12px rgba(182,255,60,0.35);
  font-variant-numeric: tabular-nums;
}
.w-row .asset {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0,225,255,0.3);
}
.w-row .flow {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 11.5px;
}
.w-row .when {
  font-family: var(--mono);
  color: var(--dim);
  font-size: 10px;
}

/* Trade row */
.t-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.t-row:first-child { border-top: 0; }
.t-row .who {
  font-family: var(--kr), var(--sans);
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.t-row .action {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.t-row .action.BUY  { background: rgba(182,255,60,0.18);  color: var(--up); }
.t-row .action.SELL { background: rgba(255,77,109,0.18); color: var(--down); }
.t-row .ticker {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255,230,0,0.3);
}
.t-row .meta-line {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex; gap: 10px;
}

/* Video row */
.v-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.v-row:first-child { border-top: 0; }
.v-row .thumb {
  width: 90px;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  border-radius: 5px;
  /* no filter — photo unmodified */
}
.v-row .meta-block { display: flex; flex-direction: column; gap: 3px; }
.v-row .title { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); }
.v-row .ch { font-family: var(--mono); font-size: 10px; color: var(--neon-pink); letter-spacing: 0.4px; }

/* ── Pager ────────────────────────────────────────────────── */
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 50px;
  flex-wrap: wrap;
}
.pager button {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 40px;
  transition: all 0.12s;
}
.pager button:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
/* Numeric page buttons — 5-window slider. The active page lights up in
   amber so the user can spot their place inside the window at a glance. */
.pager .pg-num {
  min-width: 38px;
  font-variant-numeric: tabular-nums;
}
.pager .pg-num.pg-active {
  background: var(--neon-yellow);
  border-color: var(--neon-yellow);
  color: #1a1305;
  box-shadow: var(--glow-yellow);
  cursor: default;
}
.pager .pg-num.pg-active:hover {
  filter: brightness(1.05);
  color: #1a1305;
}
.pager .pg-arrow { letter-spacing: 0.6px; }
.pager .pg-dots {
  align-self: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 0 4px;
  user-select: none;
}
.pager button:disabled { opacity: 0.3; cursor: default; box-shadow: none; }
.pager .label { color: var(--muted); font-family: var(--mono); font-size: 12px; align-self: center; margin: 0 6px; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.8px;
}
.muted { color: var(--muted); }

/* ── Fade-in ──────────────────────────────────────────────── */
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reader modal ─────────────────────────────────────────── */
.reader.hidden { display: none; }
.reader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  animation: fadein 0.18s ease-out;
}
.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(10px);
}
.reader-card {
  position: relative;
  width: min(820px, calc(100vw - 32px));
  /* Was 92vh — left only ~4vh top breathing room which made the
     close button feel pinned to the viewport edge. 86vh keeps content
     full-height while pushing the card ~7vh below the top with the
     same 'place-items: center' parent. */
  max-height: 86vh;
  background:
    /* Inner magenta wash at the rim — gives the body a soft glow that
       fades into the dark center, matching the card border style. */
    radial-gradient(120% 80% at 50% 0%, rgba(255,43,214,0.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent),
    var(--bg-1);
  /* Matches the .art card border treatment (rgba 0.32 magenta) so the
     reader feels like an enlarged card, not a separate UI surface. */
  border: 1px solid rgba(255,43,214,0.38);
  border-radius: 18px;
  overflow: auto;
  padding: 30px 36px 36px;
  box-shadow:
    /* Outer drop for depth */
    0 30px 100px rgba(0,0,0,0.55),
    /* Magenta glow layers, two-step so it fades naturally */
    0 0 0 1px rgba(255,43,214,0.18),
    0 0 32px rgba(255,43,214,0.22),
    0 0 70px rgba(255,43,214,0.10);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.reader-card::-webkit-scrollbar { width: 6px; }
.reader-card::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.reader-close {
  /* Pinned to a fixed slot inside .reader-card. Brighter now —
     previously rendered grey/muted because the .reader-card
     gradient + the muted base color combined to wash it out. */
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(11,13,24,0.92);
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.45);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  font-family: var(--sans);
  z-index: 5;
  transition: border-color 120ms, color 120ms, box-shadow 120ms;
}
.reader-close:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0,225,255,0.45);
}
.reader-close:active { transform: scale(0.94); }

/* Language pip inside the reader meta strip. Shows the article's
   source language (EN / KO) so the user knows what they're reading. */
.reader-lang {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}
.reader-lang.lang-ko {
  background: rgba(0,225,255,0.10);
  border-color: rgba(0,225,255,0.40);
  color: var(--neon-cyan);
}
.reader-lang.lang-en {
  background: rgba(246,192,96,0.10);
  border-color: rgba(246,192,96,0.40);
  color: #f6c060;
}

/* ── Translate pill (inline in the reader meta strip) ────────────
   Rendered fresh by buildTranslateButton on every renderReader call.
   Matches the editorial polish of the rest of the modal — display
   face for the language label, soft cyan tint at rest, amber active
   state mirroring the lang.translated pip. */
.reader-translate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  height: 24px;
  margin-left: 2px;
  background: rgba(0,225,255,0.08);
  border: 1px solid rgba(0,225,255,0.38);
  border-radius: 999px;
  color: var(--neon-cyan);
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  transition: background 140ms, border-color 140ms, color 140ms,
              box-shadow 140ms, transform 80ms;
}
.reader-translate:hover {
  background: rgba(0,225,255,0.14);
  border-color: rgba(0,225,255,0.65);
  box-shadow: 0 0 12px rgba(0,225,255,0.30);
}
.reader-translate:active { transform: scale(0.97); }
.reader-translate:disabled { cursor: progress; }
.reader-translate .rt-glyph {
  font-size: 11px;
  line-height: 1;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0,225,255,0.55);
}
.reader-translate .rt-label {
  font-family: var(--display);
  font-variation-settings: "opsz" 18, "wdth" 95;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -0.1px;
  text-transform: none;
}
.reader-translate .rt-label[lang="ko"] {
  font-family: var(--kr);
  font-weight: 700;
  letter-spacing: 0.2px;
}
/* Active state: viewing the translation. Amber to match the lang
   pip's "translated" state so the user sees one consistent signal. */
.reader-translate.active {
  background: rgba(246,192,96,0.16);
  border-color: rgba(246,192,96,0.60);
  color: #ffe7b6;
}
.reader-translate.active .rt-glyph {
  color: #ffe7b6;
  text-shadow: 0 0 10px rgba(246,192,96,0.65);
}
.reader-translate.active:hover {
  background: rgba(246,192,96,0.24);
  box-shadow: 0 0 14px rgba(246,192,96,0.35);
}
/* Loading state: spinner replaces the glyph. */
.reader-translate.loading { pointer-events: none; opacity: 0.85; }
.reader-translate.loading .rt-glyph,
.reader-translate.loading .rt-label { visibility: hidden; }
.reader-translate.loading::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  margin-top: 0;
  border: 2px solid var(--neon-cyan);
  border-right-color: transparent;
  border-radius: 50%;
  animation: rt-spin 0.6s linear infinite;
}
.reader-translate { position: relative; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
@media (max-width: 500px) {
  .reader-translate { padding: 3px 9px; height: 22px; }
  .reader-translate .rt-label { font-size: 12px; }
}

/* Tiny translator's note rendered below the title when the model
   compresses or adds context. */
.reader-tnote {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--neon-mag);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: -14px 0 18px;
  padding: 4px 10px;
  border-left: 2px solid var(--neon-mag);
  background: rgba(255,43,214,0.06);
  text-shadow: 0 0 10px rgba(255,43,214,0.3);
}
.reader-tnote[lang="ko"] { font-family: var(--kr); text-transform: none; font-size: 11.5px; }

.reader-loading {
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  padding: 100px 0;
  font-size: 13px;
  letter-spacing: 1.5px;
}

.reader-img {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  border-radius: 12px;
  margin-bottom: 22px;
  /* no filter — photo shown in its real colors */
}

.reader-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;     /* centered to match the title below */
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 4px 0 18px;
}
.reader-meta .src { color: var(--text-2); font-weight: 700; }
.reader-meta .tag {
  background: rgba(0,225,255,0.14);
  color: var(--neon-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.reader-title {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 88, "wdth" 92;
  font-size: calc(clamp(24px, 2.8vw, 36px) * var(--text-scale, 1));
  line-height: 1.08;
  letter-spacing: -1px;
  /* Centered + tight side margins. Old layout had a giant gap to the
     left of the title; centering with text-wrap: balance distributes
     the words evenly across the available width. */
  text-align: center;
  text-wrap: balance;
  margin: 4px auto 22px;
  max-width: 720px;
  color: var(--text);
}
.reader-title[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  letter-spacing: -0.6px;
  line-height: 1.22;
  font-weight: 800;
  /* keep_all so Korean particles don't dangle alone on a new line */
  word-break: keep-all;
}

.reader-tldr {
  background:
    linear-gradient(90deg, rgba(255,230,0,0.08), transparent 80%),
    rgba(255,255,255,0.02);
  border-left: 3px solid var(--neon-yellow);
  padding: 16px 20px;
  border-radius: 10px;
  margin: 0 0 22px;
}
.reader-tldr .tldr-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neon-yellow);
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: 700;
  text-shadow: var(--glow-yellow);
}
.reader-tldr p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wdth" 96;
}
.reader-tldr p[lang="ko"] { font-family: var(--kr); font-variation-settings: normal; }

.reader-section-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  font-weight: 700;
  margin: 0 0 10px;
  text-shadow: var(--glow-cyan);
}

.reader-points {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reader-points li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.reader-points li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--neon-cyan);
  font-weight: 800;
  font-family: var(--mono);
}

.reader-body {
  max-width: 720px;
  margin: 0 auto;
}
.reader-body p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 16px;
  color: var(--text-2);
  letter-spacing: -0.1px;
}
.reader-body p[lang="ko"] {
  font-family: var(--kr);
  font-size: 15.5px;
  line-height: 1.72;
  letter-spacing: -0.3px;
  word-break: keep-all;
}

.reader-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.reader-footer .badge {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.reader-original {
  color: var(--neon-cyan);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.6px;
  font-weight: 700;
}
.reader-original:hover { text-shadow: var(--glow-cyan); }

/* Permanent-delete button in the reader footer. Subtle red outline at
   rest so it doesn't compete with the body; warms up on hover so the
   destructive nature is unmistakable when the user is actually about
   to commit. Click opens the same reason-picker modal as the × on
   the card. */
.reader-delete {
  background: transparent;
  border: 1px solid rgba(255,71,87,0.45);
  color: var(--down);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms,
              box-shadow 140ms, transform 80ms;
}
.reader-delete:hover {
  background: rgba(255,71,87,0.12);
  border-color: var(--down);
  color: #ffd5da;
  box-shadow: 0 0 16px rgba(255,71,87,0.35);
}
.reader-delete:active { transform: scale(0.97); }
@media (max-width: 500px) {
  .reader-delete { padding: 6px 12px; font-size: 10px; }
}
