:root {
  color-scheme: light;

      --brand-950: #022c22;
  --brand-900: #059669;
  --brand-800: #065f46;
  --brand-700: #047857;
  --brand-600: #059669;
  --brand-500: #10b981;
  --brand-400: #34d399;
  --brand-300: #6ee7b7;
  --brand-rgb: 5, 150, 105;

    --bg: #f4faf7;
  --bg-soft: #eaf6f0;
  --surface: #ffffff;
  --surface-2: #f5faf8;
  --surface-hover: #e9f6ef;
  --border: #000;
  --border-strong: #c3ddd0;

    --white: #ffffff;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --text-4: #9ca3af;

    --success: #16a34a;
  --success-bg: #ecfdf3;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fff7ed;

    --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-card: 0 8px 30px -14px rgba(var(--brand-rgb), 0.22);
  --shadow-pop: 0 24px 60px -20px rgba(15, 28, 61, 0.25);
  --shadow-glow: 0 0 0 1px rgba(var(--brand-rgb), 0.08), 0 12px 34px -14px rgba(var(--brand-rgb), 0.35);

  --container: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b120f;
    --bg-soft: #0e1713;
    --surface: #141e1a;
    --surface-2: #182420;
    --surface-hover: #1c2b25;
    --border: #000;
    --border-strong: #2e463c;

    --text: #eef5f1;
    --text-2: #a9bcb2;
    --text-3: #7c9187;
    --text-4: #4c5f56;

    --brand-500: #22c08f;
    --brand-400: #4fd8ab;

    --success: #34d399;
    --success-bg: rgba(22, 163, 74, 0.16);
    --danger: #f87171;
    --danger-bg: rgba(220, 38, 38, 0.18);
    --warning: #fbbf24;
    --warning-bg: rgba(217, 119, 6, 0.18);

    --shadow-card: 0 8px 30px -14px rgba(0, 0, 0, 0.55);
    --shadow-pop: 0 26px 70px -24px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 0 1px rgba(var(--brand-rgb), 0.25), 0 16px 40px -16px rgba(var(--brand-rgb), 0.45);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b120f;
  --bg-soft: #0e1713;
  --surface: #141e1a;
  --surface-2: #182420;
  --surface-hover: #1c2b25;
  --border: #ffffff;
  --border-strong: #2e463c;

  --text: #eef5f1;
  --text-2: #a9bcb2;
  --text-3: #7c9187;
  --text-4: #4c5f56;

  --brand-500: #22c08f;
  --brand-400: #4fd8ab;

  --success: #34d399;
  --success-bg: rgba(22, 163, 74, 0.16);
  --danger: #f87171;
  --danger-bg: rgba(220, 38, 38, 0.18);
  --warning: #fbbf24;
  --warning-bg: rgba(217, 119, 6, 0.18);

  --shadow-card: 0 8px 30px -14px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 26px 70px -24px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(var(--brand-rgb), 0.25), 0 16px 40px -16px rgba(var(--brand-rgb), 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  min-width: 0;
  font-family: var(--font-body);
  color: var(--text-2);
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 15% 0%, rgba(var(--brand-rgb), 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0; line-height: 1.6; color: var(--text-2); }

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

button { font-family: inherit; cursor: pointer; }
button, input, select { -webkit-tap-highlight-color: transparent; }

code, .mono { font-family: var(--font-mono); }

img, svg { max-width: 100%; }

::selection { background: rgba(var(--brand-rgb), 0.28); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-400); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(var(--brand-rgb), 0.04);
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.navbar .container {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.brand svg { flex: 0 0 auto; }

.nav-links { display: flex; align-items: center; gap: 30px; min-width: 0; }

.nav-links a {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  padding-bottom: 3px;
  transition: color 0.2s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  transition: right 0.25s var(--ease);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }

.nav-toggle { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(var(--brand-rgb), 0.65);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(var(--brand-rgb), 0.75);
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--brand-500);
  border-color: var(--brand-500);
}

.btn-outline:hover {
  background: rgba(var(--brand-rgb), 0.1);
  transform: translateY(-1px);
}

.btn-block { width: 100%; }

.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(220, 38, 38, 0.55);
}

.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(220, 38, 38, 0.65); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.wave-divider { display: block; width: 100%; line-height: 0; }
.wave-divider svg { width: 100%; height: auto; display: block; }

.pulse-wave path { animation: pulse-wave 7s ease-in-out infinite; }

@keyframes pulse-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero {
  position: relative;
  background: radial-gradient(120% 140% at 10% 0%, var(--brand-500) 0%, var(--brand-600) 38%, var(--brand-700) 72%, var(--brand-900) 100%);
  color: var(--white);
  overflow: hidden;
  padding: 96px 0 0;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: float-glow 9s ease-in-out infinite;
}

@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 20px) scale(1.06); }
}

.hero-inner { position: relative; z-index: 1; max-width: 680px; padding-bottom: 88px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #d1fae5;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.08; font-weight: 700; color: var(--white); }
.hero h1 span { color: #a7f3d0; }

.hero p.lead { margin-top: 20px; font-size: 17px; color: #d9f5e8; max-width: 540px; }

.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.section { padding: 88px 0; }

.section-head { max-width: 560px; margin-bottom: 48px; }

.section-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); margin-top: 10px; }
.section-head p { margin-top: 14px; font-size: 15.5px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.3s var(--ease);
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); border-color: var(--border-strong); }

.icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-bottom: 18px;
  transition: transform 0.25s var(--ease);
}

.card:hover .icon-tile { transform: scale(1.08) rotate(-4deg); }

.icon-tile svg { width: 22px; height: 22px; }

.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14.5px; }

.code-panel {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.code-panel .k { color: var(--text); font-weight: 600; }
.code-panel .s { color: var(--text); }
.code-panel .c { color: var(--text-3); }

.code-tabs { display: flex; gap: 6px; margin-bottom: 14px; }

.code-dot { width: 10px; height: 10px; border-radius: 50%; background: #2f6b56; }
.code-dot:nth-child(1) { background: #ef4444; }
.code-dot:nth-child(2) { background: #f59e0b; }
.code-dot:nth-child(3) { background: #22c55e; }

.footer {
  background: linear-gradient(135deg, var(--brand-950), var(--brand-900));
  color: #cfe9de;
  padding: 40px 0;
  margin-top: 40px;
}

.footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-family: var(--font-display); font-weight: 700; }

.footer p { font-size: 13.5px; color: #9fc9bb; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 140% at 85% 0%, var(--brand-500) 0%, var(--brand-600) 45%, var(--brand-900) 100%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  box-shadow: var(--shadow-pop);
  animation: card-pop 0.45s var(--ease);
}

@keyframes card-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; }

.auth-brand span { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text); }

.auth-card h1 { font-size: 21px; text-align: center; }

.auth-card > p.lead { text-align: center; font-size: 13.5px; margin-top: 6px; margin-bottom: 26px; }

.field { margin-bottom: 16px; }

.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }

.field input, .field select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

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

.field input:focus, .field select:focus {
  border-color: var(--brand-500);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.auth-switch { text-align: center; font-size: 13.5px; margin-top: 20px; color: var(--text-3); }

.auth-switch button { background: none; border: none; color: var(--brand-500); font-weight: 600; padding: 0; }
.auth-switch button:hover { text-decoration: underline; }

.form-msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
  animation: shake-in 0.3s var(--ease);
}

@keyframes shake-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-msg.error { display: block; background: var(--danger-bg); color: var(--danger); }
.form-msg.ok { display: block; background: var(--success-bg); color: var(--success); }

.fee-preview {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
  padding: 4px 0;
}

.fee-row span:last-child { font-weight: 600; color: var(--text); }

.fee-row-total {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.fee-row-total span { color: var(--text); font-weight: 700; }
.fee-row-total span:last-child { color: var(--success); }

.tx-sub { font-size: 11.5px; color: var(--text-4); margin-top: 2px; }

.app-navbar {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: var(--white);
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(var(--brand-rgb), 0.25);
}

.app-navbar .brand { color: var(--white); }
.app-navbar .nav-links a { color: #d1fae5; }
.app-navbar .nav-links a::after { background: linear-gradient(90deg, #ffffff, #a7f3d0); }
.app-navbar .nav-links a.active,
.app-navbar .nav-links a:hover { color: var(--white); }

.dropdown { position: relative; min-width: 0; }

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  display: none;
  z-index: 50;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.dropdown-panel.open { display: block; opacity: 1; transform: translateY(0) scale(1); }

.dropdown-panel h4 { font-size: 14px; margin-bottom: 4px; }
.dropdown-panel p.hint { font-size: 12.5px; margin-bottom: 14px; color: var(--text-3); }

.key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 14px;
  word-break: break-all;
}

#api-key-text { min-width: 0; overflow-wrap: anywhere; }

.icon-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-3);
  padding: 4px;
  display: inline-flex;
  border-radius: 6px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn:hover { background: var(--surface-hover); color: var(--brand-500); }
.icon-btn svg { width: 16px; height: 16px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 190px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  padding: 7px 14px 7px 7px;
  border-radius: 999px;
  font-size: 13.5px;
  transition: background 0.15s var(--ease);
}

.user-chip:hover { background: rgba(255, 255, 255, 0.16); }

.app-navbar .theme-toggle { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.app-navbar .theme-toggle:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5, #6ee7b7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--brand-900);
}

.page-wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 44px 24px 80px; }

.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin-top: 6px; font-size: 14.5px; }

.balance-card {
  background: radial-gradient(120% 140% at 0% 0%, var(--brand-500) 0%, var(--brand-600) 42%, var(--brand-700) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 44px -18px rgba(var(--brand-rgb), 0.55);
}

.balance-card::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  top: -130px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.balance-card .wave-bg { position: absolute; left: 0; right: 0; bottom: -2px; opacity: 0.35; pointer-events: none; }

.balance-label { font-size: 13px; color: #d1fae5; letter-spacing: 0.03em; text-transform: uppercase; font-weight: 600; }

.balance-amount {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 42px);
  font-weight: 700;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.balance-actions { display: flex; gap: 12px; margin-top: 26px; position: relative; z-index: 1; flex-wrap: wrap; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 5px 20px -15px rgba(var(--brand-rgb), 0.25);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.stat-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-glow); }

.stat-card .stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.stat-value.up { color: var(--success); }
.stat-value.down { color: var(--danger); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 5px 20px -16px rgba(var(--brand-rgb), 0.25);
  min-width: 0;
  overflow: hidden;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; }

#tx-table { min-width: 620px; }
.panel:has(table) { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }

tbody tr { transition: background-color 0.15s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 13.5px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 10, 20, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-overlay.open { display: flex; animation: overlay-in 0.2s var(--ease); }

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
  animation: modal-in 0.25s var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; }

.modal-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-3);
  padding: 7px;
  border-radius: 7px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

.modal-close:hover { background: var(--surface-hover); color: var(--brand-500); transform: rotate(90deg); }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start; min-width: 0; }

.docs-nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.docs-nav a {
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-3);
  font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.docs-nav a:hover { background: var(--surface-hover); color: var(--text); }
.docs-nav a.active { background: rgba(var(--brand-rgb), 0.12); color: var(--brand-500); font-weight: 600; }

.docs-nav .docs-group {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-4);
  margin: 14px 12px 4px;
}

.docs-content { min-width: 0; }
.docs-content section { margin-bottom: 52px; scroll-margin-top: 96px; min-width: 0; }
.docs-content h2 { font-size: 22px; margin-bottom: 10px; }
.docs-content h3 { font-size: 15.5px; margin: 22px 0 10px; }
.docs-content p { font-size: 14.5px; margin-bottom: 8px; }

.docs-content .divider { height: 1px; background: var(--border); margin: 44px 0; }

.endpoint-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-width: 0; flex-wrap: wrap; }

.method-tag { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.method-post { background: var(--success-bg); color: var(--success); }
.method-get { background: var(--surface-hover); color: var(--brand-500); }

.endpoint-path { min-width: 0; font-family: var(--font-mono); font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }

.field-table { margin-top: 12px; overflow: hidden; }
.field-table td:first-child { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand-500); white-space: nowrap; }

.theme-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.theme-toggle:hover { transform: translateY(-1px) rotate(8deg); border-color: var(--border-strong); color: var(--brand-500); }
.theme-toggle svg { width: 18px; height: 18px; transition: opacity 0.2s var(--ease), transform 0.3s var(--ease); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.theme-toggle.is-floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 70;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.hero-bg-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, rgba(4, 120, 87, 0.55) 0%, rgba(6, 78, 59, 0.88) 100%);
  pointer-events: none;
}

[data-theme="dark"] .hero-bg-overlay {
  background: linear-gradient(160deg, rgba(9, 13, 24, 0.65) 0%, rgba(9, 13, 24, 0.92) 100%);
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }

  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; padding: 4px 0; }
  .docs-nav .docs-group { display: none; }
  .docs-nav a { background: var(--surface); border: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .navbar .container { min-height: 64px; gap: 10px; }
  .brand { font-size: 18px; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-actions .btn { padding-left: 12px; padding-right: 12px; }

  .page-wrap { padding: 28px 16px 60px; }
  .page-head { margin-bottom: 24px; }
  .page-head h1 { font-size: 24px; }

  .balance-card { padding: 26px 22px; border-radius: 20px; }
  .balance-amount { font-size: 36px; }
  .balance-actions { gap: 10px; }
  .balance-actions .btn { flex: 1 1 auto; }

  .panel { padding: 18px; }

  .modal-overlay { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); padding: 24px 20px; border-radius: 20px; }

  .docs-layout { gap: 18px; }
  .docs-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .docs-nav::-webkit-scrollbar { display: none; }
  .docs-nav a { flex: 0 0 auto; white-space: nowrap; }

  .docs-content .code-panel { font-size: 12px; padding: 18px; border-radius: 12px; }

  .footer { padding: 30px 0; }
}

@media (max-width: 480px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .app-navbar .container { gap: 7px; }
  .app-navbar .brand { font-size: 17px; }
  .app-navbar .brand svg { width: 24px; height: 24px; }

  .nav-actions { gap: 6px; }
  .nav-actions .btn { min-height: 34px; padding: 6px 10px; font-size: 12px; }

  .user-chip { max-width: 52px; padding: 5px; gap: 0; }
  .user-chip #user-email { display: none; }
  .avatar { width: 28px; height: 28px; }

  .dropdown-panel { right: -4px; width: min(320px, calc(100vw - 20px)); }

  .page-wrap { padding: 24px 14px 50px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13.5px; }

  .balance-card { padding: 24px 20px; border-radius: 18px; }
  .balance-label { font-size: 11.5px; }
  .balance-amount { font-size: 34px; }
  .balance-actions { flex-direction: column; }
  .balance-actions .btn { width: 100%; }

  .stat-row { gap: 12px; }
  .stat-card { padding: 17px; }
  .stat-card .stat-value { font-size: 20px; }

  .panel { margin-top: 18px; padding: 16px; border-radius: 14px; }
  .panel-head h3 { font-size: 15px; }
  .empty-state { padding: 32px 12px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: none; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 24px 18px 26px; }
  .modal-head h3 { font-size: 17px; }

  .field { margin-bottom: 14px; }
  .field input, .field select { min-height: 46px; font-size: 15px; }

  .btn { min-height: 44px; }
  .btn-sm { min-height: 34px; }

  .docs-content h2 { font-size: 20px; }
  .docs-content h3 { font-size: 15px; }
  .endpoint-row { align-items: flex-start; }
  .endpoint-path { width: 100%; font-size: 12.5px; }

  .field-table { display: block; width: 100%; overflow-x: auto; }
  .field-table tbody { min-width: 500px; display: table; width: 100%; }

  .footer .container { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 360px) {
  .app-navbar .brand { font-size: 16px; }
  .app-navbar .nav-actions .btn { padding: 5px 8px; font-size: 11px; }
  .balance-card { padding: 22px 17px; }
  .balance-amount { font-size: 31px; }
  .modal { padding: 22px 16px 24px; }
}
