/* gpuindex — market data terminal styling.
   No external fonts, no CDN, no framework. Everything loads offline. */

:root {
  --bg:        #0b0e13;
  --panel:     #11151d;
  --panel-2:   #161b25;
  --line:      #222a38;
  --line-soft: #1a212c;
  --text:      #e6ebf2;
  --text-dim:  #8b97a8;
  --text-faint:#5d6879;
  --accent:    #4da3ff;
  --up:        #26a96c;
  --down:      #e5484d;
  --warn:      #d9a441;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- chrome ---------- */

header.top {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 20;
}
.top-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 28px; height: 52px;
}
.brand {
  font-family: var(--mono); font-weight: 600; font-size: 15px;
  letter-spacing: -0.3px; color: var(--text);
}
.brand span { color: var(--accent); }
nav.main { display: flex; gap: 20px; flex: 1; }
nav.main a {
  color: var(--text-dim); font-size: 13px; padding: 4px 0;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--text); text-decoration: none; }
nav.main a.active { color: var(--text); border-bottom-color: var(--accent); }

.status-pill {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.dot.ok { background: var(--up); }
.dot.stale { background: var(--warn); }
.dot.bad { background: var(--down); }

main { max-width: 1400px; margin: 0 auto; padding: 24px 20px 72px;
  overflow-x: hidden; }

/* ---------- headings ---------- */

h1 {
  font-size: 26px; font-weight: 600; letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.subtitle { color: var(--text-dim); font-size: 13px; margin: 0 0 24px; }

h2 {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-dim);
  margin: 32px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
h3 { font-size: 14px; font-weight: 600; margin: 24px 0 8px; }

/* ---------- benchmark cards ---------- */

.cards {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px 15px; display: block; color: inherit;
}
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card-model {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.3px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.card-price {
  font-family: var(--mono); font-size: 27px; font-weight: 600;
  letter-spacing: -1px; line-height: 1.1;
}
.card-price .unit { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.card-changes { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.chg { font-family: var(--mono); font-size: 11px; }
.chg .lbl { color: var(--text-faint); margin-right: 4px; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.na { color: var(--text-faint); }
.card-meta {
  margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* ---------- tables ---------- */

.table-wrap {
  border: 1px solid var(--line); border-radius: 6px;
  overflow-x: auto; background: var(--panel);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: right; padding: 9px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim);
  border-bottom: 1px solid var(--line); background: var(--panel-2);
  white-space: nowrap; position: sticky; top: 0;
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td {
  padding: 8px 12px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.model { font-family: var(--mono); font-size: 12px; }
td.px { font-family: var(--mono); font-weight: 600; }
.muted { color: var(--text-faint); }

/* ---------- badges ---------- */

.badge {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.4px;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--panel-2);
}
.badge.thin { border-color: #4a3a1a; color: var(--warn); background: #1d1710; }
.badge.mkt  { border-color: #1d3a4a; color: #5cb8d9; background: #101a20; }
.badge.neo  { border-color: #2a3a22; color: #86c06a; background: #131a10; }

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  background: var(--panel); border-radius: 4px;
  padding: 12px 14px; font-size: 13px; color: var(--text-dim);
  margin: 12px 0;
}
.notice strong { color: var(--text); font-weight: 600; }
.notice.info { border-left-color: var(--accent); }
.empty {
  padding: 40px 20px; text-align: center; color: var(--text-faint);
  font-size: 13px; border: 1px dashed var(--line); border-radius: 6px;
}

/* ---------- panels & charts ---------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 16px;
}
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.chart { width: 100%; height: 300px; display: block; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-label { fill: var(--text-faint); font-family: var(--mono); font-size: 10px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-band { fill: var(--accent); opacity: 0.09; }
.chart-dot { fill: var(--accent); }

.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 16px; }
.stat { min-width: 96px; }
.stat .k {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint); margin-bottom: 3px;
}
.stat .v { font-family: var(--mono); font-size: 17px; font-weight: 600; }

/* ---------- prose ---------- */

.prose { max-width: 760px; min-width: 0; font-size: 14px; line-height: 1.65;
  color: #cdd6e2; overflow-wrap: anywhere; }
.prose .table-wrap, .prose table { max-width: 100%; }
/* Prose tables carry sentences, not figures. The global nowrap that keeps
   numeric tables aligned makes a changelog cell 1200px wide and scrolls the
   whole page sideways on a phone. */
.prose tbody td, .prose thead th { white-space: normal; }
.prose table { display: block; overflow-x: auto; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: var(--mono); font-size: 12px; background: var(--panel-2);
  padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line);
}
.prose h3 { margin-top: 28px; }

footer {
  border-top: 1px solid var(--line); margin-top: 56px; padding: 20px;
  color: var(--text-faint); font-size: 12px; text-align: center;
}

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .top-inner { gap: 16px; height: auto; padding: 10px 14px; flex-wrap: wrap; }
  nav.main { gap: 14px; order: 3; width: 100%; overflow-x: auto; }
  main { padding: 16px 14px 48px; }
  h1 { font-size: 21px; }
}

/* ---------- audit additions ---------- */

thead th.sorted { color: var(--text); }
thead th.sorted::after { content: ' \2191'; font-size: 9px; }
thead th[data-dir="desc"].sorted::after { content: ' \2193'; }

details.evidence {
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); margin: 10px 0;
}
details.evidence > summary {
  cursor: pointer; padding: 9px 13px; font-size: 12px;
  color: var(--text-dim); font-family: var(--mono); user-select: none;
  list-style: none;
}
details.evidence > summary::-webkit-details-marker { display: none; }
details.evidence > summary::before { content: '▸ '; color: var(--text-faint); }
details.evidence[open] > summary::before { content: '▾ '; }
details.evidence > summary:hover { color: var(--text); }
.evidence-body { padding: 0 13px 13px; }
.evidence-body .table-wrap { border: none; }

.controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 0 0 16px;
}
.controls input[type="search"], .controls select {
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 5px; padding: 7px 10px;
  font-family: var(--mono); font-size: 12px; min-width: 150px;
}
.controls input[type="search"]:focus, .controls select:focus {
  outline: none; border-color: var(--accent);
}
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg-toggle button {
  background: var(--panel-2); border: none; color: var(--text-dim);
  padding: 7px 13px; font-family: var(--mono); font-size: 12px; cursor: pointer;
  border-right: 1px solid var(--line);
}
.seg-toggle button:last-child { border-right: none; }
.seg-toggle button.on { background: var(--accent); color: #041018; font-weight: 600; }
.seg-toggle button:hover:not(.on) { color: var(--text); }

.ctrl-note { font-size: 11px; color: var(--warn); font-family: var(--mono); }

.tooltip {
  position: fixed; pointer-events: none; z-index: 60;
  background: #0d1219; border: 1px solid var(--line); border-radius: 5px;
  padding: 7px 10px; font-family: var(--mono); font-size: 11px;
  color: var(--text); box-shadow: 0 6px 22px rgba(0,0,0,.6); display: none;
  white-space: nowrap;
}
.chart-hit { fill: transparent; }
.chart-cursor { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; }

.compare-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); margin-bottom: 14px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 10px; font-family: var(--mono); font-size: 11px;
}
.chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 0; }
.chip button:hover { color: var(--down); }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- docs ---------- */
.prose pre {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 12px 14px; overflow-x: auto;
  /* Without an explicit max-width a wide <pre> widens the whole page on a
     phone, so the document scrolls sideways instead of the code block. */
  max-width: 100%; min-width: 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  color: #cfe0f0; margin: 0 0 16px;
}
.prose pre code { background: none; border: none; padding: 0; font-size: 12px; }
.prose table { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 5px; }
.prose thead th { text-align: left; }
.prose tbody td { text-align: left; }
.prose tbody td.num, .prose thead th.num { text-align: right; }
.prose h3 { scroll-margin-top: 70px; padding-top: 6px; }

/* ---------- account pages ---------- */
.auth-card {
  max-width: 420px; margin: 48px auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 28px;
}
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-faint); margin-bottom: 6px;
}
.field input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 5px; padding: 10px 12px;
  font-family: var(--mono); font-size: 13px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.btn {
  width: 100%; background: var(--accent); color: #041018; border: none;
  border-radius: 5px; padding: 11px; font-weight: 600; font-size: 13px;
  cursor: pointer; font-family: var(--sans);
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); width: auto; padding: 8px 14px;
}
.btn.danger { background: var(--panel-2); color: var(--down);
  border: 1px solid #4a2020; width: auto; padding: 8px 14px; }
.form-error {
  border: 1px solid #4a2020; background: #1d1012; color: #f0a0a2;
  border-radius: 5px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.form-ok {
  border: 1px solid #1d3a2a; background: #0f1a14; color: #86c06a;
  border-radius: 5px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.key-reveal {
  background: #0d1219; border: 1px solid var(--accent); border-radius: 6px;
  padding: 14px; font-family: var(--mono); font-size: 13px;
  word-break: break-all; color: #cfe0f0; margin: 10px 0;
}
.meter { height: 7px; background: var(--panel-2); border-radius: 4px;
  overflow: hidden; border: 1px solid var(--line); margin-top: 7px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
