/* Tokens panel — placeholder usage / quota stat cards.
 * Wired up next; for now the values are em-dashes in `.muted`.
 *
 * Lives as its own file so when the panel grows real meters and
 * graphs, that work doesn't churn home.css.
 */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 16px 18px;
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.04) 0%,
    rgba(var(--slate-rgb), 0.03) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-mono);
  min-width: 0;
}
.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.stat-label .ico { color: var(--accent); font-size: 12px; }
.stat-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Until the panel is wired, values are em-dashes — keep them visible
   but recede them so the card reads as a placeholder, not as "0". */
.stat-value.muted { color: var(--text-soft); }
.stat-sub {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* Window selector — chip-row above the stat grid. Mirrors the
   topbar's small-pill aesthetic without depending on its CSS. */
.window-bar {
  display: flex;
  gap: 6px;
  margin: 6px 0 14px;
  font-family: var(--font-mono);
}
.window-chip {
  background: rgba(var(--slate-rgb), 0.06);
  border: 1px solid var(--line);
  color: var(--text-soft);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.window-chip:hover { color: var(--text); }
.window-chip.active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.10);
}

/* Histogram. SVG fills width; we use viewBox so the bars scale on
   resize without re-render. */
.histogram {
  margin-top: 22px;
}
.histogram h2 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.histogram-wrap {
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.04) 0%,
    rgba(var(--slate-rgb), 0.03) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 8px;
}
.histogram-svg {
  display: block;
  width: 100%;
  height: 120px;
}
.histogram-svg .bar {
  fill: var(--accent);
  fill-opacity: 0.85;
}
.histogram-svg .bar.empty {
  fill: var(--text-soft);
  fill-opacity: 0.18;
}
.histogram-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* By-model breakdown — same monospace tone as the stat cards.
   Loaded by tokens.js once the panel is opened. */
.by-model {
  margin-top: 22px;
}
.by-model h2 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.by-model-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.04) 0%,
    rgba(var(--slate-rgb), 0.03) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.by-model-table th,
.by-model-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.by-model-table tr:last-child td { border-bottom: 0; }
.by-model-table th {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.by-model-table td.num,
.by-model-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.by-model-table td.empty {
  color: var(--text-soft);
  text-align: center;
  font-style: italic;
}

/* quota bar */
.quota-bar-wrap {
  margin-bottom: 1.25rem;
}
.quota-bar-track {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .35rem;
}
.quota-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.quota-bar-fill.quota-ok   { background: var(--accent); }
.quota-bar-fill.quota-warn { background: #f59e0b; }
.quota-bar-label {
  font-size: .75rem;
  color: var(--text-soft);
}
.quota-bar-label.quota-warn-text { color: #f59e0b; }
