/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --ink: #0a0f17;
  --surface: #111823;
  --raised: #182230;
  --raised-2: #1f2a3a;
  --line: #243041;
  --line-soft: #1b2533;
  --text: #e6edf5;
  --text-2: #b6c2d1;
  --muted: #8a99ad;
  --faint: #5f6d80;
  --brand: #ff7a00;
  --brand-ink: #301200;
  --brand-dim: rgba(255, 122, 0, 0.14);
  --ok: #3dd68c;
  --warn: #f5b544;
  --bad: #ff5c6c;
  --ok-dim: rgba(61, 214, 140, 0.14);
  --warn-dim: rgba(245, 181, 68, 0.14);
  --bad-dim: rgba(255, 92, 108, 0.14);

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-sm: 5px;
  --r: 8px;
  --r-lg: 12px;
  --rail: 232px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 122, 0, 0.28); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

/* ── Shell ────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 2px 8px 22px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; fill: var(--brand); }
.brand-name { font-family: var(--font-cond); font-weight: 600; font-size: 19px; letter-spacing: 0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
  border-left: 2px solid transparent;
}
.nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--raised); border-left-color: var(--brand); }
.nav a[hidden] { display: none; }
.nav-count { font: 500 12px var(--mono); color: var(--brand); }
.nav-count:empty { display: none; }

.rail-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.me-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--raised-2); object-fit: cover; }
.me-avatar:not([src]), .me-avatar[src=""] { visibility: hidden; }
.me-text { min-width: 0; }
.me-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { color: var(--muted); font-size: 13px; }

.main { padding: 28px 36px 60px; min-width: 0; }

/* ── Page header ──────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-cond); font-weight: 600; font-size: 28px; margin: 0; line-height: 1.1; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

h2.section { font-family: var(--font-cond); font-weight: 600; font-size: 19px; margin: 34px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h2.section > span:first-child, h2.section { white-space: normal; }
h2.section small { font-family: var(--font); font-weight: 400; font-size: 14px; color: var(--muted); }
h2.section:first-child { margin-top: 0; }

/* ── Stat strip (overview) ────────────────────────────────── */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  overflow: hidden;
}
.strip > div { padding: 18px 22px; border-right: 1px solid var(--line-soft); min-width: 0; }
.strip > div:last-child { border-right: 0; }
.stat-n { font-family: var(--font-cond); font-weight: 600; font-size: 38px; line-height: 1; letter-spacing: -0.01em; }
.stat-n small { font-size: 20px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat-t { margin-top: 8px; color: var(--text-2); }
.stat-t b { color: var(--text); font-weight: 600; }
.stat-t .warn { color: var(--warn); }
.stat-t .bad { color: var(--bad); }
.stat-t .ok { color: var(--ok); }
.meter { height: 6px; background: var(--raised-2); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width 0.4s ease; }
.meter.low > i { background: var(--warn); }
.meter.empty > i { background: var(--bad); }

/* ── Two-column area ──────────────────────────────────────── */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cols > * { min-width: 0; }
.cols-wide { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 1100px) { .cols, .cols-wide { grid-template-columns: 1fr; } }

/* ── Chart ────────────────────────────────────────────────── */
.chart { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px 18px 8px; }
.chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart svg { display: block; max-width: 100%; }
.chart-svg { min-height: 150px; }
.chart text { fill: var(--faint); font: 11px var(--font); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 13px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface);
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 4px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty b { color: var(--text-2); font-weight: 500; display: block; margin-bottom: 4px; }

.key {
  font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.01em;
  background: var(--raised); border: 1px solid var(--line-soft); padding: 3px 8px; border-radius: var(--r-sm);
  cursor: copy; white-space: nowrap;
}
.key:hover { border-color: var(--brand); }
.key.copied { border-color: var(--ok); color: var(--ok); }
.id { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }

.user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user img { width: 22px; height: 22px; border-radius: 50%; background: var(--raised-2); flex: none; }
.user .u-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.user .u-id { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.user-stack { display: inline-flex; flex-direction: column; line-height: 1.2; }

/* ── Pills ────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; background: var(--raised); color: var(--text-2); border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.plain::before { display: none; }
.pill.ok { color: var(--ok); background: var(--ok-dim); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-dim); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-dim); border-color: transparent; }
.pill.brand { color: var(--brand); background: var(--brand-dim); border-color: transparent; }
.pill.open { color: var(--brand); background: var(--brand-dim); border-color: transparent; }
.pill.closed { color: var(--muted); }
.pill.p-boosts { color: #ff8af5; background: rgba(255, 115, 250, 0.12); border-color: transparent; }
.pill.p-nitro { color: #b49bff; background: rgba(180, 155, 255, 0.12); border-color: transparent; }
.pill.p-deco { color: #6fe3cf; background: rgba(111, 227, 207, 0.12); border-color: transparent; }

/* ── Buttons & inputs ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--raised); color: var(--text); font-weight: 500; cursor: pointer; line-height: 1.2;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--raised-2); border-color: #2f3d52; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover { background: #ff9533; border-color: #ff9533; }
.btn-danger { color: var(--bad); border-color: rgba(255, 92, 108, 0.35); background: transparent; }
.btn-danger:hover { background: var(--bad-dim); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 16px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 11px; color: var(--text); min-width: 0; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15); }
input::placeholder { color: var(--faint); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { font-family: var(--mono); font-size: 13px; min-height: 110px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row > .btn { flex: none; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 7px 12px; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--raised-2); color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ── Panels (form areas) ──────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 20px 22px; }
.panel h3 { font-family: var(--font-cond); font-weight: 600; font-size: 17px; margin: 0 0 14px; }
.panel .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel .grid .full { grid-column: 1 / -1; }
.panel .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }

/* key reveal after generation — the hero object */
.key-hero {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--r);
  background: var(--ink); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.key-hero .big { font: 500 22px var(--mono); letter-spacing: 0.02em; color: var(--brand); cursor: copy; word-break: break-all; }
.key-hero .meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.key-list { font: 13.5px var(--mono); background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 14px; white-space: pre; overflow: auto; max-height: 260px; }

.lookup { position: relative; }
.lookup-results { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 14px 40px rgba(0,0,0,.45); max-height: 240px; overflow: auto; }
.lookup-results button { width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; color: var(--text); }
.lookup-results button:hover { background: var(--raised-2); }

/* ── Detail (user drawer) ─────────────────────────────────── */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-head img { width: 44px; height: 44px; border-radius: 50%; background: var(--raised-2); }
.detail-head h3 { margin: 0; font-size: 18px; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.facts b { color: var(--text); font-weight: 600; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(4, 8, 14, 0.7); display: grid; place-items: center; padding: 24px; z-index: 50; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.modal.wide { width: min(1100px, 100%); height: 92vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-family: var(--font-cond); font-weight: 600; font-size: 19px; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1; }
.modal-body p { margin: 0 0 12px; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.modal iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal.wide .modal-body { padding: 0; }
.x { background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.x:hover { color: var(--text); background: var(--raised); }

/* ── Toasts ───────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--raised-2); border: 1px solid var(--line); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 380px; animation: rise 0.18s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

/* ── Login ────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(900px 500px at 15% 0%, rgba(255, 122, 0, 0.07), transparent 60%), var(--ink); }
.login-box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 34px 32px; }
.login-mark { width: 38px; height: 38px; fill: var(--brand); margin-bottom: 18px; }
.login h1 { font-family: var(--font-cond); font-weight: 600; font-size: 26px; margin: 0 0 8px; }
.login-sub { color: var(--muted); margin: 0 0 22px; }
.login .btn-lg { width: 100%; }
.login-error { color: var(--bad); background: var(--bad-dim); padding: 10px 12px; border-radius: var(--r-sm); margin: 0 0 16px; }
.login-master { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* ── Access columns ───────────────────────────────────────── */
.access-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.access-grid > * { min-width: 0; }
@media (max-width: 900px) { .access-grid { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row .right { display: flex; align-items: center; gap: 8px; flex: none; }

/* ── Sticky code box for transcripts etc ──────────────────── */
.ticket-order { background: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; }
.ticket-order b { font-weight: 600; }
.price { font-family: var(--font-cond); font-weight: 600; font-size: 16px; }
.strike { text-decoration: line-through; color: var(--faint); font-weight: 400; font-size: 13px; margin-right: 6px; }

.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 6px 10px; }
  .nav a.active { border-bottom-color: var(--brand); }
  .rail-foot { margin-top: 0; border-top: 0; padding-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .me-text { display: none; }
  .main { padding: 20px 16px 40px; }
  .panel .grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Stock / Bots / Settings ──────────────────────────────── */
.stock-n { font-family: var(--font-cond); font-weight: 600; font-size: 20px; }
.stock-n.warn { color: var(--warn); }
.stock-n.bad { color: var(--bad); }
/* per-duration stock: "3  7 Days · 0  30 Days" */
.tiers { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tier {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 7px;
  background: var(--raised); border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-2); white-space: nowrap; line-height: 1.2;
}
.tier b { font-family: var(--font-cond); font-weight: 600; font-size: 16px; color: var(--text); }
.tier.warn { border-color: rgba(255, 190, 90, 0.35); }
.tier.warn b { color: var(--warn); }
.tier.bad { border-color: rgba(255, 110, 110, 0.35); }
.tier.bad b { color: var(--bad); }
.tier.ghost { border-style: dashed; color: var(--faint); }
.tier.ghost b { color: var(--muted); }
/* tier → KeyAuth days editor */
.tier-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tier-day { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--raised); }
.tier-day > span { font-size: 13px; font-weight: 500; }
.tier-day input { width: 100%; }
.tier-day small { font-size: 11px; }
.nav-gap { height: 14px; border-top: 1px solid var(--line-soft); margin: 8px 10px 0; }
.nav-count.bad { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.note { background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--brand); border-radius: var(--r); padding: 10px 14px; margin-bottom: 18px; color: var(--text-2); font-size: 14px; }
.note.warn { border-left-color: var(--warn); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); }
section.panel.cfg { margin-bottom: 18px; }
.cfg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cfg-head h3 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--raised-2); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; }
.chip button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.chip button:hover { color: var(--bad); }
.chips .chip-add, .chips .chip-manual { width: auto; flex: 1 1 160px; min-width: 140px; padding: 5px 8px; font-size: 13px; }
.kv-list, .st-list, .mp-list, .tier-list { display: flex; flex-direction: column; gap: 6px; }
.grid-mp { display: grid; grid-template-columns: 110px 1.2fr 1.4fr 1.2fr 1fr 36px; gap: 6px; align-items: center; }
.grid-mp.head { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
@media (max-width: 1000px) { .grid-mp { grid-template-columns: 1fr 1fr; } .grid-mp.head { display: none; } }
.prod { background: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.log { background: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 12px 14px; height: 420px; overflow: auto; margin: 0; font: 12.5px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.log .l-err { color: var(--bad); }
.log .l-sys { color: var(--brand); }
.pill.brand.plain { color: var(--brand); background: var(--brand-dim); font-size: 11px; padding: 1px 7px; }
input[type="color"] { cursor: pointer; }
.modal .grid2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .modal .grid2 { grid-template-columns: 1fr; } }

/* ── Assistant test console, misc ─────────────────────────── */
.chat { background: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px; height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 9px 12px; border-radius: 10px; font-size: 14px; white-space: pre-wrap; line-height: 1.45; }
.bubble.user { align-self: flex-end; background: var(--brand-dim); color: var(--text); border-bottom-right-radius: 3px; }
.bubble.assistant { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 3px; }
.bubble-meta { color: var(--faint); font-size: 11.5px; margin-top: 6px; }
tr.row-bad td { background: var(--bad-dim); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
