/* ── Reset / Base ────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--accent-mid) #0b1220; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0b1220; border-radius: 999px; }
::-webkit-scrollbar-thumb { background: var(--accent-mid); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--silver); }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #14203a 0%, var(--bg-main) 55%);
  color: var(--text-1);
}
a { color: var(--interactive); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

.shell { max-width: 875px; margin: 0 auto; padding: 24px; min-height: 100vh; }
.page-body { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-sm { max-width: 560px; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); }
.grid-kpi-2 { grid-template-columns: repeat(2, 1fr); }
.grid-kpi-1 { grid-template-columns: 1fr; }
.home-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 839px) {
  .grid-kpi,
  .grid-kpi-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-kpi-1 { grid-template-columns: 1fr; }
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */

.nav { display: flex; margin-bottom: 24px; align-items: center; }
.nav > a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.nav > a:hover { color: var(--interactive-hover); }
.nav-brand { color: var(--gold) !important; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.nav-brand:hover { color: var(--gold-soft) !important; }
.nav-links { flex: 1; display: flex; justify-content: center; gap: 48px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: var(--interactive-hover); }
.nav-avatar { position: relative; display: flex; align-items: center; gap: 8px; }
.beta-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent-deep); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); letter-spacing: 0.03em; }
.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-radius 150ms ease, background 150ms ease, color 150ms ease, width 150ms ease;
}
.nav-avatar:hover .avatar-btn,
.nav-avatar:focus-within .avatar-btn {
  border-radius: 8px 8px 0 0;
  background: var(--surface-1);
  color: var(--text-1);
  width: 160px;
  border: 1px solid var(--border);
  border-top-color: color-mix(in srgb, var(--gold) 22%, var(--border) 78%);
  border-bottom: none;
  position: relative;
  z-index: 101;
  margin-bottom: -1px;
}
.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  padding: 8px 6px 6px;
  width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  flex-direction: column;
  gap: 2px;
}
.nav-avatar:hover .nav-dropdown,
.nav-avatar:focus-within .nav-dropdown { display: flex; }
.nav-dropdown::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--border);
  margin: 0 10px 4px;
}
.nav-dropdown a,
.nav-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-1);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.nav-dropdown a:hover,
.nav-dropdown button:hover { background: var(--surface-2); }
.nav-dropdown form { margin: 0; }
.nav-dropdown .nav-overflow-item + a:not(.nav-overflow-item) { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.nav-login { margin-left: auto; }

/* ── Panel ───────────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-top-color: color-mix(in srgb, var(--gold) 22%, var(--border) 78%);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 16px 36px rgba(3, 8, 18, 0.38);
}
.panel h3 { border-left: 2px solid var(--gold); padding-left: 8px; color: var(--silver); font-weight: 500; }
.activity-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.activity-header h3 { margin-bottom: 0; }
.activity-ts { font-size: 12px; }
.panel-warn { border-top-color: color-mix(in srgb, var(--status-warn) 55%, var(--border) 45%); }
.panel-warn p { margin: 0 0 12px; }
.panel-narrow { max-width: 480px; margin: 0 auto; }
.panel-mt { margin-top: 16px; }
.panel-empty { text-align: center; padding: 64px 24px; }
.panel-empty > div { max-width: 380px; margin: 0 auto; }
.panel-empty h2 { margin: 0 0 10px; }
.panel-empty p { margin: 0 0 28px; }
.panel-empty .btn { padding: 10px 28px; }

/* ── Typography ──────────────────────────────────────────────────────────── */

h1, h2, h3 { margin-top: 0; margin-bottom: 12px; }
.muted { color: var(--text-2); }
.observer-banner { font-size: 12px; font-weight: 600; color: var(--gold); letter-spacing: 0.04em; text-transform: uppercase; }
.error { color: var(--deficit); font-weight: 600; }
.nowrap { white-space: nowrap; }
.kpi { font-size: 26px; font-weight: 800; margin: 4px 0; }
.footnotes {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}
.footnote { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.footnote-warn { color: var(--status-warn); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-mid), var(--accent-main));
  color: var(--text-1);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.btn:hover { transform: translateY(-1px); filter: saturate(1.08); }
.btn-danger { background: linear-gradient(135deg, #7a1f1f, var(--deficit)); }
.btn-secondary { background: linear-gradient(135deg, var(--accent-deep), var(--accent-mid)); border: 0; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-tiny { padding: 4px 10px; font-size: 11px; border-radius: 999px; }
.btn-group { display: flex; gap: 8px; flex-shrink: 0; }
.btn-group .btn { min-width: 74px; text-align: center; margin-right: 10px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

label { font-size: 13px; color: var(--text-2); font-weight: 600; }
input:not([type=radio]):not([type=checkbox]),
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
  font-size: 15px;
  background: var(--surface-2);
  color: var(--text-1);
}
#bot_name {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 6px 4px;
}
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.label-row { display: flex; align-items: center; gap: 6px; }
.form-inline { display: inline; }
.feature-list { padding-left: 1.2em; margin: 16px 0; }
.mt-sm { margin-top: 12px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }
.table-scroll-capped { max-height: 123px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); text-align: left; padding: 10px 8px; font-size: 14px; }
th { color: var(--text-1); font-weight: 600; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.td-right { text-align: right; }

/* ── Home ────────────────────────────────────────────────────────────────── */

.home-proof { display: flex; flex-direction: column; gap: 16px; }
.home-proof-copy h2 { margin-bottom: 8px; }
.home-proof-copy p { margin: 0; }
.home-proof-grid { gap: 12px; }
.home-proof-card {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 85%, transparent), var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--gold) 14%, var(--border) 86%);
}
.home-proof-card .muted { margin: 0; }
.home-proof-meta { margin: 0; }
.home-hero { text-align: center; padding: 64px 24px 48px; }
.home-hero-title { font-size: 42px; font-weight: 800; margin-bottom: 16px; line-height: 1.15; }
.home-accent { color: var(--gold); }
.home-hero-sub { font-size: 18px; color: var(--text-2); max-width: 540px; margin: 0 auto 32px; line-height: 1.6; }
.home-media-row { margin-top: 24px; }
.home-placeholder { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; height: 320px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.home-placeholder-video { height: 420px; }

/* ── Dev ─────────────────────────────────────────────────────────────────── */

.dev-bar { position: fixed; bottom: 16px; right: 16px; z-index: 9999; font-size: 0.8em; opacity: 0.5; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.dev-bar a { color: var(--text-2); }

/* ── Narrow (≤ 550px) ───────────────────────────────────────────────────── */

@media (max-width: 550px) {
  .nav-links { gap: 16px; }
  .home-grid { grid-template-columns: 1fr; }
}
