/* A2 — Institutional fintech (preview + future live theme) */
html {
  color-scheme: dark;
}

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --gold: #c9a227;
  --gold-soft: #d4b85a;
  --gold-brand: #c5a059;
  --gold-brand-light: #e8c97a;
  --line: #30363d;
  --card: #1c2128;
  --ok: #22c55e;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html,
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.site-header {
  background: rgba(13, 17, 23, 0.92);
  border-bottom-color: var(--line);
}

.brand-mark {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.brand-text {
  color: var(--text);
}

.brand-sub,
.brand-gtw-sub,
.gtw-mark,
.gtw-badge {
  display: none !important;
}

.gtw-hero {
  margin-bottom: 0.25rem;
}

.gtw-hero .eyebrow {
  color: var(--accent-soft);
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 0.35rem;
}

.gtw-hero h1 {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 600;
  margin: 0 0 0.45rem;
  color: var(--text);
  line-height: 1.25;
}

.gtw-quote {
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
  margin: 0;
}

.gtw-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  margin-bottom: -1px;
}

.gtw-tab:hover {
  color: var(--text);
}

.gtw-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-soft);
}

.gtw-tabs {
  border-bottom: 1px solid var(--line);
  gap: 0.25rem;
}

.gtw-card,
.active-card,
.metric-card {
  background: var(--card);
  border-color: var(--line);
}

.gtw-form input:focus,
.gtw-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.btn-gold,
.btn-primary-a2 {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
}

.btn-gold:hover {
  background: var(--accent-soft) !important;
}

.btn-outline {
  border-color: #484f58;
  color: var(--text);
}

.header-login-tab {
  display: none !important;
}

#loginPanel {
  display: none !important;
}

.status-pill.is-online {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.status-pill.is-online .status-dot {
  background: var(--ok);
}

.status-pill.is-offline {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.panel-subtitle {
  color: var(--accent-soft);
}

.ladder span.active-tp {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.metric-card .val {
  color: var(--accent-soft);
}

[data-live-price] {
  color: var(--accent-soft);
}

.preview-banner {
  display: none;
}

body.preview-a2 .preview-banner {
  display: block;
  background: linear-gradient(90deg, #1e3a5f, #1e40af);
  color: #dbeafe;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.78rem;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.api-status-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(40, 20, 24, 0.45);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 48rem;
}

.api-status-panel.err {
  color: #f0d4d4;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#csvForm.csv-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-bar .brand-lead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-bar .brand-lead img {
  height: 64px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
}

.header-bar .brand-divider {
  width: 1px;
  height: 44px;
  background: var(--line);
}

/* G8 — gold badge / desk label */
.header-bar .brand-gtw-name {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4af37;
  white-space: nowrap;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 8px;
  background: rgba(197, 160, 89, 0.08);
  line-height: 1.2;
}

@media (max-width: 640px) {
  .header-bar .brand-divider {
    display: none;
  }

  .header-bar .brand-lead img {
    height: 52px;
    max-width: 58px;
  }

  .header-bar .brand-gtw-name {
    font-size: 0.72rem;
    padding: 0.38rem 0.55rem;
    letter-spacing: 0.06em;
  }
}
