:root {
  --bg: #0b0b0e;
  --bg-deep: #070709;
  --panel: rgba(22, 22, 28, 0.96);
  --panel-border: rgba(148, 163, 184, 0.18);
  --panel-strong: rgba(18, 18, 24, 0.98);
  --field: rgba(11, 11, 14, 0.9);
  --field-border: rgba(148, 163, 184, 0.14);
  --text: #f4f7fb;
  --text-soft: #bcc7d6;
  --muted: #95a7ba;
  --soft: #8394a8;
  --accent: #9ab4cf;
  --accent-soft: rgba(154, 180, 207, 0.14);
  --accent-line: rgba(154, 180, 207, 0.26);
  --accent-strong: #3b82f6;
  --accent-ink: #ffffff;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.app-page {
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #111114 0%, var(--bg) 50%, var(--bg-deep) 100%);
}

.app-page button,
.app-page input,
.app-page select,
.app-page textarea {
  font: inherit;
}

.app-header {
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: rgba(12, 12, 15, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.app-tab-rail {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  overflow-y: hidden;
  overflow-x: auto;
  padding: 0 4px;
  border: none;
  border-bottom: 1px solid var(--panel-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-tab-rail::-webkit-scrollbar {
  display: none;
}

.app-tab-pill {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0 0 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font: 600 14px/1.25 "Inter", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  text-transform: none;
}

.app-tab-pill:hover,
.app-tab-pill:focus-visible {
  color: var(--text);
  outline: none;
}

.app-tab-pill.active {
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.app-tab-pill.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

/* Override the .app-page button { font: inherit } reset — that selector has
   specificity (0,1,1) which beats .app-tab-pill (0,1,0). This rule uses
   two class selectors (0,2,0) to win and keep the tab font explicit. */
.app-tab-rail .app-tab-pill {
  font: 600 14px/1.25 "Inter", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
}

.app-panel,
.app-modal-card,
.app-legal-shell {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.app-subpanel {
  border: 1px solid var(--field-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  box-shadow: none;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.app-modal-card {
  background: var(--panel-strong);
  border-radius: 20px;
}

.app-legal-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px;
}

.app-link {
  color: var(--accent);
}

.app-link:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .app-tab-rail {
    gap: 18px;
  }
}
