*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, :root[data-theme="dark"] {
  --jet: hsl(0 0% 3%);
  --bg: var(--jet);
  --surface: hsl(0 0% 8%);
  --surface-a: hsl(0 0% 8%);
  --surface-b: hsl(0 0% 7%);
  --surface-c: hsl(0 0% 9%);
  --surface-hover: hsl(0 0% 12%);
  --line: hsl(0 0% 18%);
  --line-soft: hsl(0 0% 13%);
  --text: #ffffff;
  --text-dim: hsl(0 0% 66%);
  --text-faint: hsl(0 0% 46%);
  --accent: #cc0000;
  --accent-bright: #ff2400;
  --accent-rgb: 204, 0, 0;
  --green: #5e9e69;
  --blue: #6b90b8;
  --red: #cc6b6b;
  --yellow: #c2a763;
  --purple: #a082c9;
  --sidebar-w: 280px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --jet: hsl(0 0% 98%);
  --bg: var(--jet);
  --surface: hsl(0 0% 100%);
  --surface-a: hsl(0 0% 96%);
  --surface-b: hsl(0 0% 93%);
  --surface-c: hsl(0 0% 97%);
  --surface-hover: hsl(0 0% 92%);
  --line: hsl(0 0% 85%);
  --line-soft: hsl(0 0% 90%);
  --text: hsl(0 0% 7%);
  --text-dim: hsl(0 0% 35%);
  --text-faint: hsl(0 0% 50%);
  --accent: #c00000;
  --accent-bright: #e21b00;
  --accent-rgb: 192, 0, 0;
  --green: #3a7d46;
  --blue: #45688c;
  --red: #ad4949;
  --yellow: #9c7f37;
  --purple: #7a5aa8;
  color-scheme: light;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.25); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.4); }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  opacity: 0;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(128,128,128,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,128,128,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, transparent 40%, rgba(0,0,0,0.35) 100%);
}

#overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.4);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  backdrop-filter: blur(8px);
}
#overlay.show { opacity: 1; visibility: visible; }

#sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 50;
  background: var(--surface-a);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0; gap: 10px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-brand img {
  width: 32px; height: 32px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line); flex-shrink: 0;
}
.sidebar-brand-name {
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 7px; border-radius: 4px;
  letter-spacing: 0.04em;
}
.sidebar-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sidebar-body {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-group-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 10px 4px;
}
.sidebar-divider { height: 1px; background: var(--line); margin: 10px 0; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  text-decoration: none; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s, transform 0.25s var(--ease);
  user-select: none;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); transform: translateX(4px); }
.nav-item.active { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.nav-item .nav-left { display: flex; align-items: center; gap: 10px; }
.nav-item i { font-size: 12px; width: 14px; text-align: center; }
.nav-item .nav-count {
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--text-faint);
  background: var(--surface-b);
  border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 20px;
}
.sidebar-footer { margin-top: auto; padding: 16px 16px 20px; border-top: 1px solid var(--line); }

@media (min-width: 768px) {
  body { padding-left: var(--sidebar-w); }
  #overlay { display: none !important; }
  #sidebarToggle, #sidebarClose { display: none !important; }
}
@media (max-width: 767px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  main { padding-top: 64px; }
}

.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 30;
  background: rgba(255, 255, 255, 0.02);
  background-color: var(--surface-a);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 10px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mobile-header * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 767px) { .mobile-header { display: flex; } }

.icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text-dim); cursor: pointer; transition: all 0.2s var(--ease); flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--line); color: var(--text); background: var(--surface-hover); }
.icon-btn.sm { width: 30px; height: 30px; font-size: 12px; }

main { position: relative; z-index: 10; min-height: 100vh; }
.content-wrap { max-width: 1100px; margin: 0 auto; padding: 40px 30px 80px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 24px; margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title {
  font-family: 'Inter', sans-serif;
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.count-pill {
  padding: 4px 10px;
  background: var(--surface-a); border: 1px solid var(--line);
  border-radius: 20px;
  font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--text-faint);
}
.search-wrap { position: relative; width: 260px; max-width: 100%; }
.search-wrap i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 12px; pointer-events: none;
}
.inp {
  width: 100%;
  background: var(--surface-a); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 14px;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px;
  transition: all 0.25s var(--ease);
  box-sizing: border-box;
}
.inp:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); background: var(--surface-hover); }
.inp::placeholder { color: var(--text-faint); }
.search-inp { padding-left: 36px; }

.tab-wrap {
  display: flex; border-bottom: 1px solid var(--line);
  margin: 30px 0; gap: 8px; overflow-x: visible; flex-wrap: wrap;
  align-items: flex-end;
}
.tab-btn {
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-faint); background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all 0.25s var(--ease); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; margin-bottom: -1px;
  flex-shrink: 0;
}
.tab-btn i { font-size: 12px; }
.tab-btn:hover { color: var(--text); background: var(--surface-hover); border-radius: 8px 8px 0 0; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); }

@media (max-width: 480px) {
  .tab-wrap { gap: 4px; }
  .tab-btn { padding: 10px 12px; font-size: 12px; }
}

.section-content { display: none; opacity: 0; }
.section-content.active { display: block; opacity: 1; }

#apiContent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.route-card {
  background: var(--surface-a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.route-card:hover {
  border-color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.25);
}
.route-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.badge-method {
  font-family: 'Geist Mono', monospace; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; border: 1px solid transparent;
  letter-spacing: 0.02em; flex-shrink: 0;
}
.badge-get  { border-color: rgba(94,158,105,0.35); color: var(--green); background: rgba(94,158,105,0.12); }
.badge-post { border-color: rgba(107,144,184,0.35); color: var(--blue); background: rgba(107,144,184,0.12); }
.badge-del  { border-color: rgba(204,107,107,0.35); color: var(--red); background: rgba(204,107,107,0.12); }
.badge-put  { border-color: rgba(194,167,99,0.35); color: var(--yellow); background: rgba(194,167,99,0.12); }
.route-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.route-lock { color: var(--text-faint); font-size: 10px; }

.tier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Inter', sans-serif; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 35%, transparent);
  white-space: nowrap;
}
.tier-badge i { font-size: 0.95em; }
.tier-icon-dot {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 40%, transparent);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-online  { background: var(--green); box-shadow: 0 0 8px rgba(94,158,105,0.5); }
.status-offline { background: var(--red);   box-shadow: 0 0 8px rgba(204,107,107,0.5); }
.route-path {
  font-family: 'Geist Mono', monospace; font-size: 11px;
  color: var(--text-faint); margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.route-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; flex: 1; }
.route-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.route-cat-tag { font-size: 12px; color: var(--text-faint); font-weight: 500; }
.route-actions { display: flex; gap: 8px; }
.btn-action {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  transition: all 0.25s var(--ease);
}
.btn-action i { font-size: 10px; }
.btn-action:hover { border-color: var(--text); color: var(--bg); background: var(--text); }
.btn-action.code-btn:hover { border-color: var(--blue); color: #fff; background: var(--blue); }

.blankslate { grid-column: 1 / -1; padding: 80px 24px; text-align: center; color: var(--text-faint); }
.blankslate i { font-size: 32px; margin-bottom: 20px; display: block; opacity: 0.5; }
.blankslate h3 {
  font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 700;
  color: var(--text); margin-bottom: 8px; letter-spacing: -0.01em;
}
.blankslate p { font-size: 14px; color: var(--text-dim); }

.config-wrap { max-width: 560px; }
.config-heading {
  font-family: 'Inter', sans-serif;
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); padding-bottom: 20px;
  border-bottom: 1px solid var(--line); margin-bottom: 30px;
}
.config-group { margin-bottom: 24px; }
.config-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.config-hint { font-size: 12px; color: var(--text-faint); margin-top: 8px; }
.inp-wrapper { position: relative; }
.inp-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--text-faint); cursor: pointer;
  transition: color 0.3s;
}
.inp-eye:hover { color: var(--text); }
.history-item, .history-item * { -webkit-tap-highlight-color: transparent; }
.tier-option, .addon-toggle { -webkit-tap-highlight-color: transparent; }
.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  -webkit-tap-highlight-color: transparent;
  padding: 10px 22px; background: var(--text); color: var(--bg);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  border: none; border-radius: 100px; cursor: pointer;
  white-space: nowrap; line-height: 1;
  transition: all 0.3s var(--ease);
}
.btn-save i {
  width: 14px; height: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
}
.login-btn-icon {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  width: 14px !important; height: 14px !important; flex-shrink: 0 !important;
  font-size: 12px !important; line-height: 1 !important; margin: 0 !important;
  vertical-align: middle !important;
}
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2); background: var(--text); color: var(--bg); }
.btn-modal-cancel { -webkit-tap-highlight-color: transparent; }
.blankslate .btn-save { width: fit-content; margin: 0 auto; }

.info-note {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(107,144,184,0.08);
  border: 1px solid rgba(107,144,184,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
}
.info-note i {
  flex-shrink: 0; margin-top: 1px;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(107,144,184,0.25);
  color: #8fb4d9;
  font-size: 10px;
}
.info-note span { font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.info-note.warn { background: rgba(194,167,99,0.08); border-color: rgba(194,167,99,0.2); }
.info-note.warn i { background: rgba(194,167,99,0.25); color: #d9bd7a; }

#keyStatsBox { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); }
.stats-heading { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.stats-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-a); }
.stats-card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-b);
  display: flex; justify-content: space-between; align-items: center;
}
.stats-owner { font-size: 14px; font-weight: 600; color: var(--text); }
.stats-date  { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.stats-body  { padding: 20px; }
.stats-row   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stats-row span:first-child { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.progress-bar-wrap { width: 100%; height: 6px; background: var(--surface-b); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--text-dim), var(--text)); border-radius: 6px; transition: width 1s var(--ease); }
.key-status-badge { padding: 5px 12px; border-radius: 20px; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; }
.key-status-active  { background: rgba(94,158,105,0.12); border: 1px solid rgba(94,158,105,0.25); color: var(--green); }
.key-status-expired { background: rgba(204,107,107,0.12); border: 1px solid rgba(204,107,107,0.25); color: var(--red); }

.plans-header { text-align: center; margin-bottom: 48px; }
.plans-header i {
  position: relative; display: inline-block; font-size: 36px;
  color: var(--text); margin-bottom: 16px;
  animation: lightning-flash 4s infinite;
}
@keyframes lightning-flash {
  0%, 88%, 92%, 96%, 100% { text-shadow: none; transform: scale(1); }
  90%, 94%, 98% { text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4); transform: scale(1.05); }
}
.plans-header h2 { font-family: 'Inter', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-bottom: 10px; }
.plans-header p  { font-size: 15px; color: var(--text-dim); }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.plan-card {
  background: var(--surface-a); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px 24px; display: flex; flex-direction: column; position: relative;
  transition: all 0.3s var(--ease);
}
.plan-card:hover { border-color: var(--text); transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.25); }
.plan-card.featured { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.05); }
.featured-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-name { font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.plan-price { font-family: 'Inter', sans-serif; font-size: 34px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.plan-price span { font-size: 16px; font-weight: 400; color: var(--text-faint); }
.plan-period-note { font-size: 12px; color: var(--text-faint); margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.plan-features { list-style: none; margin-bottom: 30px; flex: 1; }
.plan-features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.plan-features li i { color: var(--text); font-size: 12px; }
.btn-plan-premium {
  all: unset; display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px; cursor: pointer;
  background: var(--text); color: var(--bg);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  border-radius: 100px; text-align: center;
  transition: all 0.3s var(--ease);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}
.btn-plan-premium:hover { background: var(--text); color: var(--bg); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 255, 255, 0.25); }
.btn-plan-premium > div { display: flex; align-items: center; justify-content: center; width: 100%; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(12px); }
.modal-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--jet) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg); width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative; z-index: 10;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
}
.modal-header {
  padding: 22px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.modal-header-left { flex: 1; min-width: 0; }
.modal-title { font-family: 'Inter', sans-serif; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-sub { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-faint); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close { background: var(--surface-a); border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-dim); transition: all 0.25s var(--ease); flex-shrink: 0; }
.modal-close:hover { color: var(--text); border-color: var(--line); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 20px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 12px;
}
.btn-modal-cancel { padding: 10px 20px; background: transparent; border: 1px solid var(--line); border-radius: 100px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all 0.25s var(--ease); }
.btn-modal-cancel:hover { border-color: var(--text); color: var(--text); }
.btn-modal-run { padding: 10px 24px; background: var(--text); color: var(--bg); border: none; border-radius: 100px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.25s var(--ease); }
.btn-modal-run:hover { background: var(--text); color: var(--bg); transform: translateY(-1px); }
.btn-modal-run:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.query-group { margin-bottom: 16px; }
.query-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.query-required { color: var(--text-dim); margin-left: 2px; }

#apiResponseLoading { display: none; text-align: center; padding: 40px; }
#apiResponseLoading p { font-size: 13px; color: var(--text-dim); margin-top: 16px; }
#responseContainer { display: none; }
.response-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.response-label span { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.copy-btn { background: transparent; border: none; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: color 0.25s; }
.copy-btn:hover { color: var(--text); }
pre.url-box { background: var(--surface-b); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-faint); word-break: break-all; white-space: pre-wrap; margin: 0; }
#apiResponseContent { background: var(--surface-b); border: 1px solid var(--line); border-radius: 8px; padding: 16px; font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-dim); max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }

.examples-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; }
.examples-divider span { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.examples-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.examples-icon-row {
  display: flex; flex-wrap: nowrap; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.examples-icon-row::-webkit-scrollbar { height: 4px; }
.example-lang-btn { scroll-snap-align: start; }
.example-lang-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 64px; flex-shrink: 0; padding: 10px 6px;
  background: var(--surface-a); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.example-lang-btn:hover { border-color: var(--text); background: var(--surface-hover); transform: translateY(-2px); }
.example-lang-btn i { font-size: 18px; color: var(--text-dim); }
.example-lang-btn span { font-size: 10px; color: var(--text-faint); }
.example-lang-btn:hover i, .example-lang-btn:hover span { color: var(--text); }

.file-input-box {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 20px;
  background: var(--surface-b); border: 1px dashed var(--line); border-radius: 8px;
  cursor: pointer; transition: all 0.25s var(--ease);
}
.file-input-box:hover, .file-input-box:focus-within { border-color: var(--text); background: var(--surface-hover); }
.file-input-box i { font-size: 28px; color: var(--text-faint); transition: color 0.25s; }
.file-input-box:hover i, .file-input-box:focus-within i { color: var(--text); }
.file-input-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.file-label-text { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text-dim); text-align: center; pointer-events: none; }

#caseModal .modal-card { max-width: 860px; }
.code-viewer-header {
  background: var(--surface-b); border-bottom: 1px solid var(--line);
  padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  min-height: 54px;
}
.code-viewer-tabs { display: flex; gap: 0; }
.code-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; font-family: 'Geist Mono', monospace; font-size: 12px;
  color: var(--text-faint); cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.25s; white-space: nowrap; margin-bottom: -1px;
}
.code-tab.active { color: var(--text); border-bottom-color: var(--text); }
.code-tab:hover:not(.active) { color: var(--text-dim); }
.code-viewer-actions { display: flex; align-items: center; gap: 12px; }
.code-lang-badge {
  font-family: 'Geist Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line);
  color: var(--text-faint); background: var(--surface-a);
}
.code-with-lines {
  display: grid; grid-template-columns: auto 1fr; gap: 0;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}
.line-nums {
  padding: 20px 16px 20px 20px; text-align: right;
  color: var(--text-faint);
  font-family: 'Geist Mono', monospace; font-size: 13px; line-height: 1.7;
  user-select: none; pointer-events: none;
  border-right: 1px solid var(--line);
  background: var(--surface-b); white-space: pre;
}
.code-lines {
  padding: 20px; white-space: pre; overflow-x: auto;
  color: var(--text); font-family: 'Geist Mono', monospace; font-size: 13px; line-height: 1.7;
}

.json-key    { color: var(--purple); }
.json-string { color: var(--blue); }
.json-number { color: var(--yellow); }
.json-bool   { color: var(--red); }
.json-null   { color: var(--text-faint); }

[data-t="kw"]  { color: var(--red); }
[data-t="fn"]  { color: var(--purple); }
[data-t="str"] { color: var(--blue); }
[data-t="num"] { color: var(--yellow); }
[data-t="cmt"] { color: var(--text-faint); font-style: italic; }

#changelogModal .modal-card { max-width: 660px; }
.changelog-entry { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-hash { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-dim); font-weight: 700; }
.changelog-date { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-faint); }

.docs-footer {
  padding: 30px 0; margin-top: 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-faint);
}

#sz-toast-container {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 99999; display: flex; flex-direction: column; gap: 10px;
}
.sz-toast {
  background: var(--surface-c); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 20px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .plans-grid { grid-template-columns: 1fr; }
  .content-wrap { padding: 24px 16px 60px; }
  .search-wrap { width: 100%; order: 3; }
  .topbar { flex-wrap: wrap; }
  #apiContent { grid-template-columns: 1fr; }
}

.sz-loader-kinetic, .sz-loader-chase, .sz-loader-ripple, .sz-loader-pulse { display: block; margin: 0 auto; }
.sz-loader-kinetic { width: 32px; height: 32px; position: relative; }
.sz-loader-kinetic::before, .sz-loader-kinetic::after { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 0; border: 16px solid transparent; border-bottom-color: var(--text); animation: sz-spinA 2s linear infinite 0.5s; }
.sz-loader-kinetic::before { transform: rotate(90deg); animation: sz-spinB 2s linear infinite; }
@keyframes sz-spinA { 0%, 25% { transform: rotate(0deg); } 50%, 75% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@keyframes sz-spinB { 0%, 25% { transform: rotate(90deg); } 50%, 75% { transform: rotate(270deg); } 100% { transform: rotate(450deg); } }

.sz-loader-chase { width: 32px; height: 32px; position: relative; animation: sz-rotate-chase 2s linear infinite; }
.sz-loader-chase::before, .sz-loader-chase::after { content: ''; position: absolute; top: 0; left: 0; width: 60%; height: 60%; border-radius: 50%; background: var(--text); animation: sz-bounce-chase 2s ease-in-out infinite; }
.sz-loader-chase::after { top: auto; bottom: 0; animation-delay: -1s; }
@keyframes sz-rotate-chase { 100% { transform: rotate(360deg); } }
@keyframes sz-bounce-chase { 0%, 100% { transform: scale(0); } 50% { transform: scale(1); } }

.sz-loader-ripple { width: 40px; height: 40px; position: relative; }
.sz-loader-ripple::before, .sz-loader-ripple::after { content: ''; position: absolute; border: 2px solid var(--text); border-radius: 50%; animation: sz-ripple 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite; }
.sz-loader-ripple::after { animation-delay: -0.5s; }
@keyframes sz-ripple { 0% { top: 18px; left: 18px; width: 0; height: 0; opacity: 1; } 100% { top: -1px; left: -1px; width: 38px; height: 38px; opacity: 0; } }

.sz-loader-pulse { width: 32px; height: 32px; position: relative; }
.sz-loader-pulse::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--text); animation: sz-pulse 1.2s infinite ease-in-out; }
@keyframes sz-pulse { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

.sparkle-group { display: inline-flex; align-items: center; color: var(--text-faint); }
.sparkle-group span { display: inline-block; }
.sp-star { color: var(--text-dim); animation: pulseStar 3s ease-in-out infinite; margin: 0 2px; }
.sp-plus { animation: floatPlus 1.5s ease-in-out infinite alternate; }
.sp-dot1 { animation: swayDot 2s ease-in-out infinite alternate; }
.sp-dot2 { animation: swayDot 2.5s ease-in-out infinite alternate-reverse; }
.sparkle-group.reverse .sp-star { animation-delay: -1.5s; }
.sparkle-group.reverse .sp-plus { animation-delay: -0.7s; }
.sparkle-group.reverse .sp-dot1, .sparkle-group.reverse .sp-dot2 { animation-delay: -1s; }
@keyframes pulseStar { 0% { transform: scale(0.8); text-shadow: 0 0 0 transparent; opacity: 0.6; } 50% { transform: scale(1.3); text-shadow: 0 0 10px rgba(255, 255, 255, 0.6); color: var(--text); opacity: 1; } 100% { transform: scale(0.8); text-shadow: 0 0 0 transparent; opacity: 0.6; } }
@keyframes floatPlus { 0% { transform: translateY(2px); opacity: 0.4; } 100% { transform: translateY(-3px) scale(1.1); opacity: 1; color: var(--text); } }
@keyframes swayDot { 0% { transform: translateX(-2px) translateY(1px); opacity: 0.3; } 100% { transform: translateX(2px) translateY(-1px); opacity: 0.8; } }

.theme-lang-btn {
  width: auto; flex: 1; gap: 7px;
  padding: 0 12px; font-size: 12px; font-weight: 600;
  font-family: 'Inter', sans-serif; color: var(--text-dim);
}
.theme-lang-btn i { font-size: 12px; }
.theme-lang-btn #lang-label { font-family: 'Geist Mono', monospace; font-size: 11px; }
