/* ═══════════════════════════════════════════════════════════════
   TSun API — Main Stylesheet
   Dark cyberpunk / high-tech aesthetic
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts already loaded in HTML ── */

/* ── Custom Properties ─────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-core:       #050505;
  --bg-surface:    #0f0f0f;
  --bg-raised:     #161616;
  --bg-hover:      #1c1c1c;

  /* Brand */
  --primary:       hsl(16, 100%, 50%);       /* #FF4500 */
  --primary-dim:   hsla(16, 100%, 50%, 0.15);
  --primary-glow:  hsla(16, 100%, 50%, 0.35);
  --accent-cyan:   #00f2ff;
  --accent-purple: #bd00ff;

  /* Text */
  --text-main:     #ffffff;
  --text-sub:      #c8c8c8;
  --text-muted:    #707070;
  --text-faint:    #444444;

  /* Borders */
  --border-light:  rgba(255, 255, 255, 0.08);
  --border-mid:    rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);

  /* Cards */
  --card-bg:       rgba(20, 20, 20, 0.72);
  --card-blur:     blur(14px);

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-pill: 999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-ui:      'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:   cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.7);
  --glow-primary: 0 0 24px var(--primary-glow);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-core);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font-ui);
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-ui);
}

/* ── Background Effects ────────────────────────────────────────── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.06;
}

.bg-circle--1 {
  width: 700px;
  height: 700px;
  background: var(--primary);
  top: -200px;
  right: -150px;
}

.bg-circle--2 {
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  bottom: -100px;
  left: -100px;
  opacity: 0.04;
}

.bg-circle--3 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  top: 50%;
  left: 40%;
  opacity: 0.03;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  position: relative;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand__accent {
  color: var(--primary);
}

.brand__tagline {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: border-color 0.3s, color 0.3s;
}

.status-badge.is-online {
  border-color: rgba(0, 220, 120, 0.3);
  color: #00dc78;
}

.status-badge.is-offline {
  border-color: rgba(255, 69, 0, 0.3);
  color: var(--primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.uptime-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  display: none;
}

.uptime-chip:not(:empty) {
  display: inline-block;
}

/* ── Tab Navigation ────────────────────────────────────────────── */
.tab-nav {
  position: relative;
  z-index: 9;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tab-bar {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: 4px;
  width: fit-content;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.22s var(--ease-smooth), background 0.22s var(--ease-smooth);
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text-sub);
  background: rgba(255,255,255,0.05);
}

.tab-btn--active,
.tab-btn[aria-selected="true"] {
  background: #ffffff;
  color: #050505;
  box-shadow: var(--shadow-sm);
}

.tab-btn--active:hover,
.tab-btn[aria-selected="true"]:hover {
  background: #f0f0f0;
  color: #050505;
}

.tab-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 1.4;
}

/* ── Main Content ───────────────────────────────────────────────── */
.site-main {
  position: relative;
  z-index: 1;
  padding: var(--space-12) 0;
  min-height: 60vh;
}

/* ── Tab Panels ────────────────────────────────────────────────── */
.tab-panel {
  animation: fadeInUp 0.35s var(--ease-out-expo) both;
}

.tab-panel[hidden] {
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Panel Header ──────────────────────────────────────────────── */
.panel-header {
  margin-bottom: var(--space-8);
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-3);
  color: var(--text-main);
}

.text-accent {
  color: var(--primary);
}

.panel-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Form Card ─────────────────────────────────────────────────── */
.form-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s;
}

.form-card:focus-within {
  border-color: var(--border-mid);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: end;
}

.form-row--triple {
  grid-template-columns: repeat(3, 1fr);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-group--sm {
  min-width: 180px;
}

.field-group--full {
  width: 100%;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ── Inputs ────────────────────────────────────────────────────── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
  flex-shrink: 0;
  stroke-width: 1.4;
  transition: color 0.2s;
}

.text-input {
  width: 100%;
  padding: 10px 13px 10px 38px;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.text-input.mono {
  font-family: var(--font-mono);
  font-size: 0.83rem;
}

.text-input::placeholder {
  color: var(--text-faint);
}

.text-input:hover {
  border-color: var(--border-mid);
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.text-input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--primary);
}

/* Select */
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-input {
  width: 100%;
  padding: 10px 36px 10px 13px;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-ui);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.select-input:hover {
  border-color: var(--border-mid);
}

.select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.select-input option {
  background: var(--bg-raised);
  color: var(--text-main);
}

.select-chevron {
  position: absolute;
  right: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
  stroke-width: 1.5;
}

/* Textarea */
.textarea-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-mono);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.7;
}

.textarea-input::placeholder {
  color: var(--text-faint);
}

.textarea-input:hover {
  border-color: var(--border-mid);
}

.textarea-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.char-counter {
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: var(--space-1);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-bounce),
    box-shadow 0.2s,
    opacity 0.2s;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn--primary:disabled,
.btn--primary.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.btn--lg {
  padding: 12px 28px;
  font-size: 0.85rem;
}

/* Loading spinner in button */
.btn.is-loading::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Copy button ────────────────────────────────────────────────── */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.btn-copy svg {
  width: 13px;
  height: 13px;
}

.btn-copy:hover {
  color: var(--text-main);
  border-color: var(--border-mid);
  background: var(--bg-hover);
}

.btn-copy.copied {
  color: #00dc78;
  border-color: rgba(0,220,120,0.3);
}

/* ── Result Area ────────────────────────────────────────────────── */
.result-area {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.3s var(--ease-out-expo) both;
  box-shadow: var(--shadow-md);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
}

.result-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-json {
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-sub);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

.result-json::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.result-json::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 2px;
}

/* JSON syntax highlight helpers (applied via JS) */
.result-json .key   { color: #7dd3fc; }
.result-json .str   { color: #86efac; }
.result-json .num   { color: #fb923c; }
.result-json .bool  { color: var(--primary); }
.result-json .null  { color: var(--text-muted); }

/* ── Verdict Box ─────────────────────────────────────────────────── */
.verdict-box {
  margin: var(--space-3) var(--space-5) var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-transform: uppercase;
}

.verdict-box--banned {
  background: rgba(255,69,0,0.1);
  border: 1px solid rgba(255,69,0,0.3);
  color: var(--primary);
}

.verdict-box--clean {
  background: rgba(0,220,120,0.08);
  border: 1px solid rgba(0,220,120,0.25);
  color: #00dc78;
}

/* ── Endpoint Reference ──────────────────────────────────────────── */
.endpoint-ref {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.endpoint-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.endpoint-sep {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.endpoint-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  padding: 2px 8px;
  background: rgba(0,242,255,0.06);
  border: 1px solid rgba(0,242,255,0.15);
  border-radius: var(--r-sm);
}

/* ── Info Callout ────────────────────────────────────────────────── */
.info-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  margin-bottom: var(--space-5);
  border: 1px solid;
}

.info-callout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-callout--warning {
  background: rgba(255,180,0,0.07);
  border-color: rgba(255,180,0,0.2);
  color: #f0b429;
}

.info-callout strong {
  font-weight: 700;
}

/* ── Docs Grid ───────────────────────────────────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}

.doc-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform 0.22s var(--ease-out-expo), border-color 0.22s, box-shadow 0.22s;
  box-shadow: var(--shadow-sm);
}

.doc-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
}

.doc-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.method-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.method-badge--get {
  background: rgba(0,242,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,242,255,0.2);
}

.doc-endpoint {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-all;
}

.doc-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-params {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.param-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.77rem;
}

.param-name {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--text-sub);
  min-width: 80px;
}

.param-type {
  padding: 1px 7px;
  background: rgba(189,0,255,0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(189,0,255,0.2);
  border-radius: var(--r-sm);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.param-req {
  padding: 1px 7px;
  background: rgba(255,69,0,0.1);
  color: var(--primary);
  border: 1px solid rgba(255,69,0,0.2);
  border-radius: var(--r-sm);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.param-desc {
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.footer-sep {
  color: var(--text-faint);
}

.footer-link {
  color: var(--primary);
  transition: opacity 0.15s;
}

.footer-link:hover {
  opacity: 0.75;
}

.footer-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s var(--ease-out-expo);
  pointer-events: none;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  border-color: rgba(0,220,120,0.3);
  color: #00dc78;
}

.toast--error {
  border-color: rgba(255,69,0,0.3);
  color: var(--primary);
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .form-row--triple {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .tab-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .tab-btn span {
    display: none;
  }

  .tab-btn {
    padding: var(--space-2) var(--space-3);
  }

  .tab-icon {
    width: 18px;
    height: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row--triple {
    grid-template-columns: 1fr;
  }

  .field-group--sm {
    min-width: unset;
  }

  .form-card {
    padding: var(--space-5);
  }

  .btn--lg {
    width: 100%;
    justify-content: center;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-ref {
    flex-direction: column;
    align-items: flex-start;
  }

  .uptime-chip {
    display: none !important;
  }

  .panel-title {
    font-size: 1.7rem;
  }
}

/* ── Touch devices: remove hover effects ────────────────────────── */
@media (hover: none) {
  .doc-card:hover {
    transform: none;
  }

  .btn--primary:hover {
    transform: none;
    box-shadow: 0 4px 18px var(--primary-glow);
  }

  .doc-card:active {
    transform: translateY(-2px);
  }

  .btn--primary:active {
    transform: translateY(1px);
  }
}
