/* Self-hosted so the site renders in this font regardless of whether the
   viewer has it installed locally. */
@font-face {
  font-family: "DepartureMono Nerd Font Mono";
  src: url("/assets/DepartureMonoNerdFontMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Design tokens - dark palette matches the user's terminal color scheme
   (ai/instructions.md); light palette swaps fg/bg and darkens the accent
   for contrast on a cream background. */
:root {
  color-scheme: light;
  --surface: #f5f2e6;
  --plane: #eee8d5;
  --text-primary: #000000;
  --text-secondary: #2c5a65;
  --text-muted: #7699a3;
  --gridline: #ddd6c0;
  --border: rgba(0, 0, 0, 0.10);
  --accent: #3d7c9a;
  --accent-wash: rgba(61, 124, 154, 0.10);
  --delta-up: #24936e;
  --delta-down: #d32f2f;
  --chart-orange: #e6844f;
  --chart-pink: #e03c8a;
  --chart-blue: #58b2dc;
  --chart-green: #24936e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #14181a;
    --plane: #000000;
    --text-primary: #eee8d5;
    --text-secondary: #bcb28d;
    --text-muted: #7699a3;
    --gridline: #2c5a65;
    --border: rgba(238, 232, 213, 0.10);
    --accent: #58b2dc;
    --accent-wash: rgba(88, 178, 220, 0.14);
    --delta-up: #24936e;
    --delta-down: #d32f2f;
    --chart-orange: #e6844f;
    --chart-pink: #e03c8a;
    --chart-blue: #58b2dc;
    --chart-green: #24936e;
  }
}

/* Explicit user choice (persisted in localStorage) overrides the OS setting
   in either direction - see the theme-toggle script in html.zig. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #14181a;
  --plane: #000000;
  --text-primary: #eee8d5;
  --text-secondary: #bcb28d;
  --text-muted: #7699a3;
  --gridline: #2c5a65;
  --border: rgba(238, 232, 213, 0.10);
  --accent: #58b2dc;
  --accent-wash: rgba(88, 178, 220, 0.14);
  --texture: rgba(88, 178, 220, 0.09);
  --delta-up: #24936e;
  --delta-down: #d32f2f;
  --chart-orange: #e6844f;
  --chart-pink: #e03c8a;
  --chart-blue: #58b2dc;
  --chart-green: #24936e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--plane);
  color: var(--text-primary);
  font-family: "DepartureMono Nerd Font Mono", "DepartureMono Nerd Font", ui-monospace, monospace;
  font-size: 10pt;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* Form controls don't inherit font-family from the UA stylesheet by
   default, so without this they'd fall back to the system UI font. */
button, input, select, textarea { font-family: inherit; }

/* Sticks header + color-divider together as one unit so the break line
   scrolls along with the bar instead of staying behind under it. */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header {
  padding: 10px 24px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* The break between the nav bar and the page: four adjacent horizontal
   lines, one per chart color, stacked in place of a plain border-bottom. */
.color-divider {
  display: flex;
  flex-direction: column;
}

.color-divider-line { height: 3px; }
.color-divider-line:nth-child(1) { background: var(--chart-orange); }
.color-divider-line:nth-child(2) { background: var(--chart-pink); }
.color-divider-line:nth-child(3) { background: var(--chart-blue); }
.color-divider-line:nth-child(4) { background: var(--chart-green); }

.brand {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Textbook chapter-heading style: an oversized initial on the first letter
   of each word. */
.brand-cap {
  font-size: 1.6em;
  line-height: 1;
  vertical-align: -0.08em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--gridline);
  background: var(--plane);
}

.nav-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }

.header-search { position: relative; width: 220px; }

.header-search-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
}

.header-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.header-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-width: 80vw;
  border-radius: 10px;
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover { border-color: var(--accent); }

@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; }
  .header-search { width: 100%; order: 3; }
  .header-results { left: 0; right: 0; width: auto; max-width: none; }
}

/* Screener */

.screener h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.screener > p {
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.screener-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screener-field label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Period toggle (quarterly / annual): a pair of plain links on the ticker
   page (a full page reload, so `.period-btn` needs no `:checked` state)
   and a pair of radio buttons inside the screener/scatter filter forms
   (an htmx re-fetch on change, so those need the native input for its
   change event). Both share the same segmented-pill chrome. */
.period-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.period-btn {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--plane);
  text-decoration: none;
}

.period-btn + .period-btn { border-left: 1px solid var(--border); }

.period-btn:hover { color: var(--accent); }

.period-btn.is-active {
  color: var(--accent);
  background: var(--accent-wash);
}

.period-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--plane);
  cursor: pointer;
}

.period-radio + .period-radio { border-left: 1px solid var(--border); }

.period-radio:has(input:checked) {
  color: var(--accent);
  background: var(--accent-wash);
}

.period-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 10px 0 20px;
  max-width: 640px;
}

.screener-industry {
  max-width: 360px;
  margin-bottom: 20px;
}

.screener-industry select {
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.screener-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.screener-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.screener-range input {
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.screener-range input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.screener-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.screener-actions button {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.screener-actions button:hover { opacity: 0.9; }

.screener-actions .back-link { margin-bottom: 0; }

table.screener-results th, table.screener-results td { text-align: right; }
table.screener-results th:nth-child(-n+3), table.screener-results td:nth-child(-n+3) {
  text-align: left;
  font-variant-numeric: normal;
}

main {
  flex: 1;
  width: 100%;
  padding: 40px 24px 64px;
}

.site-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Home / search */

.hero {
  text-align: center;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  margin: 0;
}

.search-wrap {
  position: relative;
  max-width: 560px;
  margin: 28px auto 0;
}

.search-input {
  width: 100%;
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.htmx-indicator { opacity: 0; transition: opacity 120ms; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

#results {
  max-width: 560px;
  margin: 8px auto 0;
  border-radius: 10px;
  overflow: hidden;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--gridline);
  background: var(--surface);
}

.result-row:hover, .result-row.is-active { background: var(--accent-wash); }
.result-row:first-child { border-radius: 10px 10px 0 0; }
.result-row:last-child { border-radius: 0 0 10px 10px; border-bottom: none; }

/* The header (mini) search dropdown sits over the page content, where the
   translucent accent-wash hover reads as a washed-out glitch rather than
   a clean highlight - use a flat, fully opaque hover here instead. */
.header-results .result-row:hover,
.header-results .result-row.is-active {
  background: var(--accent);
}
.header-results .result-row:hover .result-symbol,
.header-results .result-row:hover .result-name,
.header-results .result-row:hover .result-industry,
.header-results .result-row.is-active .result-symbol,
.header-results .result-row.is-active .result-name,
.header-results .result-row.is-active .result-industry {
  color: var(--surface);
}

.result-symbol { font-weight: 600; }
.result-name { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-industry { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

.result-empty, .result-hint {
  padding: 14px 16px;
  color: var(--text-muted);
  text-align: center;
}

.stats-line {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* Extra breathing room between the tracked-symbols count and the
   "Browse the stock screener" link/button beneath it - they're two
   separate stats-line paragraphs back to back. */
.stats-line + .stats-line {
  margin-top: 22px;
}

/* Ticker dashboard */

.ticker-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ticker-symbol {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ticker-name { color: var(--text-secondary); font-size: 1.1rem; }

.ticker-industry {
  display: inline-block;
  margin: 10px 0 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--gridline);
  border: 1px solid var(--gridline);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
}

.stat-tile {
  background: var(--surface);
  padding: 16px;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 600;
}

.stat-delta { font-size: 0.82rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--delta-up); }
.delta-down { color: var(--delta-down); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  --chart-color: var(--accent);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 28px;
}

.chart-grid .chart-card { margin-bottom: 0; }

.chart-expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.chart-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.chart-expand-icon { display: block; stroke: currentColor; }

/* Fullscreen overlay for a single expanded chart - the JS in html.zig
   clones the clicked card's <svg> into #chart-overlay-body. */
.chart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
}

.chart-overlay.is-open { display: flex; }

.chart-overlay-inner {
  position: relative;
  /* No fixed width - shrinks to fit chart-overlay-body's explicit width
     below instead of leaving empty side margins inside the panel. */
  max-width: 96vw;
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.chart-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.chart-overlay-close:hover { border-color: var(--accent); color: var(--accent); }

.chart-overlay-title {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 40px 16px 0;
}

/* Hover crosshair drawn into the enlarged chart's cloned <svg> (see
   setupChartHover in html.zig) - not present on the small grid tiles. */
.chart-hover-guide { stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.chart-hover-dot { fill: var(--chart-color); stroke: var(--surface); stroke-width: 2; }

.chart-tooltip {
  display: none;
  position: fixed;
  z-index: 300;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
  font-size: 0.78rem;
  white-space: pre-line;
  pointer-events: none;
}

/* Each dashboard chart category (see ChartCategory in handlers.zig) owns
   one of the site's four chart colors for every tile in its group, instead
   of the color cycling by tile position. */
.chart-card.cat-market  { --chart-color: var(--chart-orange); }
.chart-card.cat-income  { --chart-color: var(--chart-pink); }
.chart-card.cat-balance { --chart-color: var(--chart-blue); }
.chart-card.cat-insider { --chart-color: var(--chart-green); }

/* Subtle section label marking where a chart category's tiles begin -
   spans the full grid width so it reads as a break between color bands.
   The small square echoes the category's chart color without shouting. */
.chart-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 8px 0 -4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.chart-section-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.chart-section-heading::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
  background: var(--section-color);
}

.chart-section-heading.cat-market  { --section-color: var(--chart-orange); }
.chart-section-heading.cat-income  { --section-color: var(--chart-pink); }
.chart-section-heading.cat-balance { --section-color: var(--chart-blue); }
.chart-section-heading.cat-insider { --section-color: var(--chart-green); }

.chart-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sparkline-svg { width: 100%; height: auto; display: block; image-rendering: pixelated; }

/* The fullscreen overlay clones this same <svg> - square it up there only,
   so the default grid tiles keep their compact landscape shape and just
   the zoomed-in view gets bigger and square. */
/* Wide, not square: forcing the 4:1 (640x160) viewBox into a square box
   would stretch it vertically ~4x more than horizontally (preserveAspectRatio
   is "none"), which blew the axis-label text far past the gridlines. Just
   give the chart a big explicit width and let height follow the SVG's own
   intrinsic ratio (the .sparkline-svg base rule's height:auto) - same
   undistorted shape as the grid tiles, just much larger. */
.chart-overlay-body { width: min(86vw, 1300px); }
/* Square joins/caps on the stepped path read as blocky pixel edges rather
   than a smooth plotted line. */
.sparkline-line { fill: none; stroke: var(--chart-color); stroke-width: 3; stroke-linejoin: miter; stroke-linecap: butt; }
.sparkline-area { fill: var(--chart-color); opacity: 0.10; }
.sparkline-dot { fill: var(--chart-color); stroke: var(--surface); stroke-width: 2; }
.sparkline-grid { stroke: var(--gridline); stroke-width: 1; }
/* Portion of the line/area below zero (see the clip-path split in
   writeChart) - or the whole thing, when every value is negative. */
.sparkline-line-negative { stroke: var(--delta-down); }
.sparkline-area-negative { fill: var(--delta-down); }
.sparkline-dot-negative { fill: var(--delta-down); }
.sparkline-zero { stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.sparkline-label { fill: var(--text-muted); font-size: 10px; }
/* Min/max value labels sit inside the plot area, right at the range's
   gridlines - a minimal y-axis without a full tick/ruler treatment. */
.sparkline-axis-label { fill: var(--text-secondary); font-size: 9px; }

/* Scatterplot */

/* The whole page (header + this section + footer) is sized to fit inside
   one viewport - see the body:has(.scatter) rules below - so the chart
   and its controls never need page-level scrolling. */
body:has(.scatter) {
  height: 100vh;
  overflow: hidden;
}

body:has(.scatter) main {
  flex: 1;
  min-height: 0;
  padding: 16px 24px;
  overflow: hidden;
  display: flex;
}

.scatter {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.scatter h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.scatter > p {
  color: var(--text-secondary);
  margin: 0 0 12px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Chart on the left, options sidebar on the right - both sized to fill
   whatever vertical space is left under the intro text. */
.scatter-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 24px;
}

.scatter-chart-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scatter-chart-area .stats-line { flex-shrink: 0; margin-top: 0; margin-bottom: 8px; }

.scatter-controls {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
}

.scatter-controls select {
  width: 100%;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.scatter-controls .period-toggle { width: 100%; }
.scatter-controls .period-radio { flex: 1; justify-content: center; }

.scatter-check label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Flexes to fill scatter-chart-area; the SVG's own viewBox/
   preserveAspectRatio keeps its 880x540 aspect and letterboxes rather
   than overflowing, so the chart always fits without scrolling. */
.scatter-card {
  --chart-color: var(--accent);
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
}

.scatter-svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.scatter-frame { fill: none; stroke: var(--gridline); stroke-width: 1; }
.scatter-point { fill: var(--chart-color); opacity: 0.65; }
.scatter-point:hover { opacity: 1; }
.scatter-label { fill: var(--text-secondary); font-size: 10px; }
.scatter-axis-title { fill: var(--text-muted); font-size: 11px; }

/* Below this width there isn't room for a side-by-side layout - fall
   back to the normal stacked, scrollable page instead of squashing
   the chart down to nothing. */
@media (max-width: 720px) {
  body:has(.scatter) { height: auto; overflow: visible; }
  body:has(.scatter) main { display: block; overflow: visible; padding: 40px 24px 64px; }
  .scatter-layout { flex-direction: column; }
  .scatter-chart-area { flex: none; }
  .scatter-controls { width: 100%; overflow: visible; }
  .scatter-card { flex: none; }
  .scatter-svg { height: auto; }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.export-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
  text-decoration: none;
}

.export-btn:hover { border-color: var(--accent); color: var(--accent); }

table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

table.history th, table.history td {
  padding: 10px 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}

table.history th:first-child, table.history td:first-child { text-align: left; font-variant-numeric: normal; }

table.history th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--plane);
}

table.history tbody tr:last-child td { border-bottom: none; }

.table-scroll { overflow-x: auto; }

.not-found {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* Prices */

.pricing h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  text-align: center;
}

.pricing > p {
  color: var(--text-secondary);
  margin: 0 0 32px;
  text-align: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
}

.pricing-card.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.pricing-tier {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.9;
}

.pricing-cta {
  display: inline-block;
  width: 100%;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--plane);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.pricing-card.is-featured .pricing-cta {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pricing-cta:hover { opacity: 0.9; }

/* API docs */

.docs-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.docs-toc {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-toc-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.docs-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 0;
}

.docs-toc a:hover { color: var(--accent); }

.docs-toc a.docs-toc-sub {
  padding-left: 12px;
  font-size: 0.8rem;
}

.docs {
  flex: 1;
  min-width: 0;
}

.docs h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.docs > p {
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.docs-endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.docs-route {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font: inherit;
  flex-wrap: wrap;
  scroll-margin-top: 16px;
}

@media (max-width: 720px) {
  .docs-layout { flex-direction: column; gap: 20px; }
  .docs-toc {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  .docs-toc-title { width: 100%; margin-bottom: 2px; }
}

.docs-method {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-wash);
  color: var(--accent);
}

.docs-path {
  font-weight: 600;
}

.docs-endpoint p {
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.docs-params {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.docs-params th, .docs-params td {
  text-align: left;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--gridline);
}

.docs-params th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-params code { color: var(--accent); }

pre.code-block {
  background: var(--plane);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

code { font-family: inherit; }
