:root {
  --paper: #eef1f4;      /* cool slate paper */
  --surface: #ffffff;
  --ink: #131c26;
  --muted: #64707d;
  --line: #d7dde3;
  --yield: #0a6b47;      /* premium green */
  --yield-bg: #e2f3ea;
  --iv: #9a4d00;         /* volatility amber */
  --focus: #1f4fd8;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 92;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.86rem; }
.muted { color: var(--muted); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

/* ── Top bar ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.scanline { margin: 0.15rem 0 0; font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 0.7rem; }
.who { font-weight: 700; }
.ghost {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 0.4rem 0.8rem; cursor: pointer; text-decoration: none; color: var(--ink);
}
.ghost:hover { border-color: var(--ink); }

/* ── Layout ── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.4rem; }
h2 { font-size: 1.05rem; letter-spacing: 0.02em; margin: 1.6rem 0 0.6rem; }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 0.5rem;
}
.section-head h2 { margin: 1.6rem 0 0.6rem; }
.sort-toggle { display: flex; gap: 0.4rem; }
.sort-toggle a {
  font-size: 0.8rem; font-weight: 600; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.7rem;
}
.sort-toggle a:hover { border-color: var(--ink); color: var(--ink); }
.sort-toggle a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.statusrow { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.7rem 1rem; min-width: 160px;
}
.stat-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-value.small { font-size: 1rem; font-weight: 600; }
.pulse-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--yield); margin-right: 0.4rem; vertical-align: middle;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* ── Table ── */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--ink);
}
td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.ticker { font-weight: 800; letter-spacing: 0.03em; display: block; }
.company { font-size: 0.72rem; color: var(--muted); display: block; }
.iv { color: var(--iv); font-weight: 600; }
.yield {
  display: inline-block; background: var(--yield-bg); color: var(--yield);
  font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 0.9rem;
  padding: 0.15rem 0.5rem; border-radius: 5px;
}
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: 8px;
  padding: 2rem; text-align: center;
}
.lookup-form {
  display: flex; gap: 0.6rem; margin: 0.4rem 0 1.4rem; max-width: 420px;
}
.lookup-form input {
  flex: 1; font: inherit; font-family: "IBM Plex Mono", monospace; text-transform: uppercase;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
.lookup-form input:focus { border-color: var(--focus); outline: none; }
.lookup-form button {
  font: inherit; font-weight: 700; background: var(--ink); color: #fff;
  border: none; border-radius: 6px; padding: 0.6rem 1.1rem; cursor: pointer;
}
.lookup-form button:hover { background: #22303d; }
.footnote { font-size: 0.75rem; color: var(--muted); margin-top: 1.2rem; }

/* ── Login ── */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink);
  border-radius: 10px; padding: 2rem; width: 100%; max-width: 380px;
}
.login-card h1 { margin: 0.4rem 0 0.2rem; font-size: 1.9rem; font-weight: 800; line-height: 1.05; }
.login-sub { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; color: var(--muted); margin: 0 0 1.4rem; }
.login-card label { display: block; font-size: 0.8rem; font-weight: 600; margin: 0.8rem 0 0.25rem; }
.login-card input {
  width: 100%; font: inherit; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
}
.login-card input:focus { border-color: var(--focus); outline: none; }
.login-card button[type="submit"] {
  margin-top: 1.2rem; width: 100%; font: inherit; font-weight: 700;
  background: var(--ink); color: #fff; border: none; border-radius: 6px;
  padding: 0.65rem; cursor: pointer;
}
.login-card button[type="submit"]:hover { background: #22303d; }
.form-error {
  background: #fdecec; color: #8a1f1f; border-radius: 6px;
  padding: 0.5rem 0.7rem; font-size: 0.85rem;
}
.login-note { font-size: 0.72rem; color: var(--muted); margin-top: 1rem; }

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