/* ==========================================================================
   13F Radar — dark editorial terminal
   Palette: warm bone ink on near-black graphite, acid-lime signal accent
   Type:    Instrument Serif (display) / Instrument Sans (UI) / IBM Plex Mono (data)
   ========================================================================== */

:root {
  --bg: #090a0c;
  --bg-2: #0d0f12;
  --panel: #101318;
  --panel-2: #151920;
  --line: #1d232b;
  --line-2: #2a323d;
  --ink: #e9e5db;
  --ink-dim: #b3afa5;
  --muted: #7c828c;
  --faint: #565c65;
  --accent: #d8ff4f;
  --accent-soft: rgba(216, 255, 79, 0.12);
  --accent-line: rgba(216, 255, 79, 0.28);
  --buy: #7fe3a9;
  --sell: #ff7a6b;
  --amber: #e8bf7a;
  --blue: #8ab4f8;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
  --rail: 216px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -12%, rgba(216, 255, 79, 0.055), transparent 62%),
    radial-gradient(900px 600px at 92% 0%, rgba(138, 180, 248, 0.045), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #0a0b0d; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }

.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.accent { color: var(--accent); }
.pos { color: var(--buy); }
.neg { color: var(--sell); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 20px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 40%);
}

.wordmark { display: flex; align-items: baseline; gap: 8px; margin-bottom: 34px; }
.wordmark-num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--accent);
  padding: 1px 5px;
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  line-height: 1.1;
}
.wordmark-word {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.01em;
  font-style: italic;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: var(--ink-dim);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  border-left: 1px solid transparent;
  border-radius: 0 2px 2px 0;
  transition: color 120ms, background 120ms, border-color 120ms;
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.025); }
.nav-link.is-active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(216, 255, 79, 0.08), transparent 90%);
  border-left: 1px solid var(--accent);
}
.nav-idx { font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: 0.08em; }
.nav-link.is-active .nav-idx { color: var(--accent); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line); border-radius: 2px; padding: 6px 8px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.is-live { background: var(--accent); box-shadow: 0 0 0 0 rgba(216, 255, 79, 0.5); animation: pulse 2.4s infinite; }
.dot.is-error { background: var(--sell); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 255, 79, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(216, 255, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 255, 79, 0); }
}
.rail-meta { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.04em; }

.main { min-width: 0; display: flex; flex-direction: column; padding: 0 40px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 66px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.search { position: relative; width: min(460px, 52vw); }
.search input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 7px 24px 7px 22px;
  outline: none; transition: border-color 140ms;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent-line); }
.search::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 11px; height: 11px;
  border: 1px solid var(--faint); border-radius: 50%;
}
.search::after {
  content: ""; position: absolute; left: 10px; top: 19px; width: 5px; height: 1px;
  background: var(--faint); transform: rotate(45deg);
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); z-index: 60;
}
.search-result {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px;
  font-size: 12.5px; border-bottom: 1px solid var(--line); color: var(--ink-dim);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.is-active { background: rgba(216, 255, 79, 0.07); color: var(--ink); }
.search-result .kind { font-family: var(--mono); font-size: 9px; text-transform: uppercase; color: var(--faint); letter-spacing: 0.08em; }

.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 11px; }
#coverage-pill { letter-spacing: 0.03em; font-size: 10.5px; text-transform: uppercase; }

.ghost-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 2px;
  transition: all 140ms; cursor: pointer; background: transparent;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ghost-btn.solid { background: var(--accent); color: #0a0b0d; border-color: var(--accent); }
.ghost-btn.solid:hover { filter: brightness(1.08); color: #0a0b0d; }

/* ------------------------------------------------------------- page head */
.page-head { padding: 46px 0 26px; border-bottom: 1px solid var(--line); position: relative; }
.page-head-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block; }
h1.display {
  font-family: var(--serif); font-size: clamp(34px, 4.6vw, 54px); line-height: 1.02;
  letter-spacing: -0.022em; max-width: 20ch;
}
h1.display em { font-style: italic; color: var(--accent); }
.page-sub { margin-top: 12px; color: var(--ink-dim); font-size: 13.5px; max-width: 74ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title {
  font-size: 11px; font-family: var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim);
}
.section-title b { color: var(--accent); font-weight: 500; }
.section-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em; }

/* --------------------------------------------------------------- KPI strip */
.kpi-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.kpi { padding: 22px 24px 20px 0; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi:not(:first-child) { padding-left: 24px; }
.kpi-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.kpi-value { font-family: var(--mono); font-size: clamp(20px, 2.2vw, 30px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.kpi-value small { font-size: 0.55em; color: var(--muted); letter-spacing: 0; }
.kpi-foot { margin-top: 7px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- panels */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 34px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.panel { background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 120px), var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.panel-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }
.panel-body.tight { padding: 10px 16px; }

/* ----------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 9px 10px; background: var(--panel); border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
table.data thead th.num { text-align: right; }
table.data thead th[data-sort] { cursor: pointer; user-select: none; }
table.data thead th[data-sort]:hover { color: var(--accent); }
table.data thead th .sort-mark { color: var(--accent); margin-left: 4px; font-size: 8px; }
table.data tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data tbody tr { transition: background 100ms; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data td.num { font-family: var(--mono); text-align: right; white-space: nowrap; font-size: 12px; }
table.data td.dim { color: var(--muted); }
table.data .rank { font-family: var(--mono); font-size: 10px; color: var(--faint); width: 30px; }

.ticker { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.01em; color: var(--ink); }
.ticker-sm { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
.issuer { color: var(--muted); font-size: 11.5px; }
.cell-main { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-block; font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; line-height: 1.5;
}
.badge.new { background: var(--accent); border-color: var(--accent); color: #0a0b0d; }
.badge.add { color: var(--buy); border-color: rgba(127, 227, 169, 0.35); background: rgba(127, 227, 169, 0.08); }
.badge.trim { color: var(--amber); border-color: rgba(232, 191, 122, 0.35); background: rgba(232, 191, 122, 0.08); }
.badge.exit { color: var(--sell); border-color: rgba(255, 122, 107, 0.35); background: rgba(255, 122, 107, 0.08); }
.badge.hold { color: var(--muted); }
.badge.option { color: var(--blue); border-color: rgba(138, 180, 248, 0.3); }
.badge.amended { color: var(--amber); border-color: rgba(232, 191, 122, 0.3); }
.badge.pill { border-radius: 20px; padding: 2px 8px; }
.badge.live { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* --------------------------------------------------------------- weight bar */
.wbar { display: inline-block; width: 46px; height: 3px; background: rgba(255, 255, 255, 0.09); border-radius: 2px; overflow: hidden; vertical-align: middle; margin-right: 7px; }
.wbar-fill { display: block; height: 100%; border-radius: 2px; }

.progress { display: block; height: 3px; background: rgba(255, 255, 255, 0.09); border-radius: 2px; overflow: hidden; }
.progress-fill { display: block; height: 100%; }

/* ---------------------------------------------------------------- charts */
.spark { display: block; overflow: visible; }
.chart { display: block; width: 100%; overflow: visible; }
.chart-tick { font-family: var(--mono); font-size: 8px; fill: var(--faint); letter-spacing: 0.04em; }
.chart-max { font-family: var(--mono); font-size: 8.5px; fill: var(--muted); }
.chart-empty { padding: 26px; text-align: center; color: var(--faint); font-family: var(--mono); font-size: 11px; }

/* --------------------------------------------------------------- ticker tiles */
.tile-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tile {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 2px; padding: 3px 7px 3px 5px; background: rgba(255, 255, 255, 0.015);
  transition: border-color 120ms, background 120ms;
}
.mini-tile:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.mini-tile .tk { font-family: var(--mono); font-size: 10px; color: var(--ink); }
.mini-tile .wt { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }

/* ----------------------------------------------------------- filings feed */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  transition: background 120ms;
}
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: rgba(255, 255, 255, 0.022); }
.feed-when { font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.5; }
.feed-main { min-width: 0; }
.feed-manager { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }
.feed-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }
.feed-moves { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.feed-side { text-align: right; font-family: var(--mono); font-size: 12px; }
.feed-side .sub { font-size: 9.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------------------------------------------------------------- lists */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .who { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plain-list .val { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); white-space: nowrap; }

/* ---------------------------------------------------------------- radar */
.radar-wrap { display: flex; flex-direction: column; gap: 14px; }
.radar-meter { display: flex; align-items: center; gap: 14px; }
.radar-meter .progress { flex: 1; }
.coverage-big { font-family: var(--mono); font-size: 30px; letter-spacing: -0.03em; }
.status-pill { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted); }
.status-pill.filed { color: var(--buy); border-color: rgba(127, 227, 169, 0.35); }
.status-pill.overdue { color: var(--sell); border-color: rgba(255, 122, 107, 0.4); background: rgba(255, 122, 107, 0.08); }
.status-pill.waiting { color: var(--amber); border-color: rgba(232, 191, 122, 0.3); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 9px 14px; color: var(--muted); border-bottom: 1px solid transparent; cursor: pointer;
  transition: color 120ms, border-color 120ms; background: transparent; border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- forms */
.select, select {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; padding: 7px 10px; border-radius: 2px; outline: none;
}
.select:focus, select:focus { border-color: var(--accent-line); }
.form-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.input {
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink);
  font-family: var(--mono); font-size: 12px; padding: 8px 10px; border-radius: 2px; outline: none;
}
.input:focus { border-color: var(--accent-line); }

/* ---------------------------------------------------------------- empty */
.empty { padding: 70px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; font-size: 13px; }
.empty code { font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--line); padding: 3px 7px; border-radius: 2px; color: var(--accent); }

/* ---------------------------------------------------------------- misc */
.foot {
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 26px 0 40px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--faint); border-top: 1px solid var(--line); margin-top: 20px;
}
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.note strong { color: var(--ink-dim); font-weight: 500; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.stat-line:last-child { border-bottom: 0; }
.stat-line .k { color: var(--muted); }
.stat-line .v { font-family: var(--mono); }

.reveal { animation: reveal 460ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.reveal:nth-child(2) { animation-delay: 40ms; }
.reveal:nth-child(3) { animation-delay: 80ms; }
.reveal:nth-child(4) { animation-delay: 120ms; }
.reveal:nth-child(5) { animation-delay: 160ms; }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  :root { --rail: 184px; }
  .main { padding: 0 26px; }
  .grid-2 { grid-template-columns: 1fr; gap: 26px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; padding-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  html, body { max-width: 100vw; overflow-x: hidden; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { width: 100%; max-width: 100%; }
  .kpi-strip { width: 100%; }
  .kpi-label { font-size: 8.5px; letter-spacing: 0.08em; }
  .kpi-value { font-size: 24px; }
  .feed-item { width: 100%; }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center; gap: 18px;
    padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; min-width: 0; max-width: 100vw;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .nav { flex-wrap: nowrap; }
  .wordmark { flex: none; }
  .wordmark { margin-bottom: 0; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-link { border-left: 0; border-bottom: 1px solid transparent; padding: 6px 8px; white-space: nowrap; }
  .nav-link.is-active { border-left: 0; border-bottom-color: var(--accent); background: transparent; }
  .nav-idx { display: none; }
  .rail-foot { display: none; }
  .main { padding: 0 16px; }
  .topbar { height: 56px; gap: 12px; }
  .search { width: 100%; }
  .topbar-right { display: none; }
  .page-head { padding: 30px 0 20px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px 14px 14px 0; }
  .kpi:not(:first-child) { padding-left: 14px; }
  .grid-3 { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 1fr; gap: 6px; }
  .feed-side { text-align: left; }
  .foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- returns */
.return-pos { color: var(--buy); }
.return-neg { color: var(--sell); }

/* -------------------------------------------------------------- ad slots */
.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 22px 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
  min-height: var(--ad-min-height, 90px);
}
.ad-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}
.ad-unit { flex: 1; min-height: 60px; }

/* -------------------------------------------------------------- bookshelf */
.bookshelf .book {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  transition: color 120ms;
}
.bookshelf .book:last-of-type { border-bottom: 0; }
.bookshelf .book:hover .book-title { color: var(--accent); }
.book-title { font-size: 13px; color: var(--ink); }
.book-author { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.book-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.disclosure { font-size: 10px; color: var(--faint); line-height: 1.55; margin-top: 10px; }

/* ---------------------------------------------------------------- consent */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: color-mix(in srgb, var(--panel-2) 96%, transparent);
  border-top: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--ink-dim);
}
.consent[hidden] { display: none; }
.consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .ad-slot { margin: 16px 0; }
  .consent { padding: 12px 14px; font-size: 11.5px; }
}

.ad-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(255,255,255,0.012) 7px, rgba(255,255,255,0.012) 14px);
}

.status-pill.dormant { color: var(--faint); border-color: var(--line-2); }

/* ---------------------------------------------------------------- accounts */
.topbar-right { flex-wrap: wrap; }
.account-chip { display: inline-flex; align-items: center; gap: 6px; }
.bell-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #0a0b0d; font-family: var(--mono);
  font-size: 9px; font-weight: 600;
}
.bell-count[hidden] { display: none; }
.inline-form { display: inline; margin: 0; }
.inline-form button { padding: 5px 9px; }
.check-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 0;
  font-size: 12.5px; color: var(--ink-dim); cursor: pointer;
}
.check-row input { accent-color: var(--accent); width: 14px; height: 14px; }
.outbox-item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.outbox-item:last-child { border-bottom: 0; }
.outbox-item summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.outbox-item summary strong { font-weight: 500; color: var(--ink); }
.email-body {
  margin: 12px 0 0; padding: 14px; border: 1px solid var(--line);
  border-radius: 2px; background: rgba(255,255,255,0.015); color: var(--ink-dim);
  font-family: var(--mono); font-size: 11px; line-height: 1.7; white-space: pre-wrap;
  overflow-x: auto;
}

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 20px 0 4px; }
.saved-screen { display: inline-flex; align-items: center; gap: 2px; }
.screen-del {
  background: transparent; border: 0; color: var(--faint); cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 2px 4px;
}
.screen-del:hover { color: var(--sell); }

/* ---------------------------------------------------------- mobile shell */
.mobile-nav { display: none; }

@media (max-width: 860px) {
  body { padding-bottom: 68px; }
  .rail .nav { display: none; }
  .rail-foot { display: none; }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel-2) 96%, transparent);
    border-top: 1px solid var(--line-2);
    backdrop-filter: blur(10px);
  }
  .mn-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .mn-link.is-active { color: var(--accent); }
  .mn-idx { font-size: 7px; color: var(--faint); }
  .consent { bottom: 68px; }
}

/* ------------------------------------------------------ mobile data cards */
@media (max-width: 720px) {
  .table-wrap:has(table[data-cards]) { overflow: visible; }
  table[data-cards] thead { display: none; }
  table[data-cards] tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
  }
  table[data-cards] tbody tr:hover { background: var(--panel); }
  table[data-cards] tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  table[data-cards] tbody td::before {
    content: attr(data-label);
    flex: none;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }
  table[data-cards] tbody td.rank { display: none; }
  table[data-cards] tbody td .wbar { display: none; }
}

/* --------------------------------------------- narrow-screen hardening */
@media (max-width: 720px) {
  html, body { max-width: 100vw; overflow-x: hidden; }
  .main, .section, .panel, .table-wrap { max-width: 100%; }
  .form-row { gap: 8px; }
  .form-row .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .form-row .field:first-child { flex-basis: 100%; }
  .input, .select, select { width: 100%; max-width: 100%; }
  .page-sub, .note, td, th { overflow-wrap: anywhere; }
  table[data-cards] tbody td { min-width: 0; }
  table[data-cards] tbody td > * { min-width: 0; }
  table[data-cards] tbody td .cell-main { max-width: 62%; overflow: hidden; }
  table[data-cards] tbody td .cell-main .issuer,
  table[data-cards] tbody td .cell-main .ticker { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pagination { flex-wrap: wrap; }
  .saved-screen { max-width: 100%; }
}

/* ------------------------------------------- contrast, focus and layout fixes */
:root { --faint: #6f7680; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid-2 > *, .grid-3 > * { min-width: 0; }
.panel, .table-wrap { min-width: 0; max-width: 100%; }
.ad-slot ins.adsbygoogle { min-height: 60px; }
.mn-link .bell-count { margin-left: 4px; }
