/* ═══════════════ FUENTES AUTO-HOSTEADAS GEST Y BOOTSTRAP ICONS ═══════════════ */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ═══════════════ TOKENS VERCEL (dark puro / light) ═══════════════ */
:root, [data-theme="light"], html.light {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --surface-3: #e4e4e7;
  --border: #e4e4e7;
  --border-2: #d4d4d8;
  --fg: #18181b;
  --fg-strong: #09090b;
  --fg-muted: #52525b;
  --fg-subtle: #71717a;
  --accent: #0f766e;
  --accent-fg: #ffffff;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --blue: #0284c7;
  --purple: #7c3aed;
  --topbar-h: 60px;
  --nav-h: 64px;
  --ease-md: cubic-bezier(.2, 0, 0, 1);
  --trans-fast: 0.15s ease;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Components & Studio Variables */
  --code-bg: #f8fafc;
  --code-fg: #0f172a;
  --btn-primary-bg: #09090b;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #f4f4f5;
  --btn-secondary-fg: #18181b;
  --btn-secondary-border: #e4e4e7;
}

[data-theme="dark"], html.dark {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #141414;
  --surface-3: #1c1c1c;
  --border: #1f1f1f;
  --border-2: #2e2e2e;
  --fg: #ededed;
  --fg-strong: #fafafa;
  --fg-muted: #a1a1a1;
  --fg-subtle: #71717a;
  --accent: #14b8a6;
  --accent-fg: #00302b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --blue: #0ea5e9;
  --purple: #8b5cf6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);

  /* Components & Studio Variables */
  --code-bg: #050505;
  --code-fg: #f4f4f5;
  --btn-primary-bg: #ffffff;
  --btn-primary-fg: #000000;
  --btn-secondary-bg: #171717;
  --btn-secondary-fg: #ededed;
  --btn-secondary-border: #262626;
}

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

html {
  overflow-x: clip;
  overscroll-behavior-y: none;
  font-family: var(--font-sans);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--nav-h) + 24px);
  min-height: 100vh;
}

/* ═══════════════ SCROLLBAR ANDROID ═══════════════ */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════ TOPBAR VERCEL / ANDROID ═══════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #14b8a6, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.4);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent);
  animation: dot-pulse 2.2s infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 8%, transparent); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  border: 1px solid var(--border);
  font-size: 1.05rem;
  transition: all .18s var(--ease-md);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--fg-strong);
  border-color: var(--border-2);
}

/* ═══════════════ HERO / SEARCH BAR ═══════════════ */
.hero-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 28px 20px 16px;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--fg-strong);
}

.hero-subtitle {
  font-size: 0.92rem;
  color: var(--fg-muted);
  max-width: 600px;
  line-height: 1.5;
}

.search-box {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-subtle);
  font-size: 1.05rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  background: var(--surface-2);
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--fg-subtle);
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
}

/* ═══════════════ CATEGORY CHIPS ═══════════════ */
.chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.chips-container::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease-md);
  font-family: inherit;
  user-select: none;
}

.chip:hover {
  border-color: var(--border-2);
  color: var(--fg);
  background: var(--surface-2);
}

.chip.active {
  background: var(--fg-strong);
  color: var(--bg);
  border-color: var(--fg-strong);
}

.dark .chip.active {
  background: #ffffff;
  color: #000000;
}

.chip-count {
  font-size: 0.68rem;
  opacity: 0.75;
  font-family: var(--font-mono);
  background: color-mix(in srgb, currentColor 18%, transparent);
  padding: 1px 6px;
  border-radius: 999px;
}

/* ═══════════════ ENDPOINTS GRID ═══════════════ */
.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform .18s var(--ease-md), border-color .18s, box-shadow .18s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.endpoint-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.method-get {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

.method-post {
  background: color-mix(in srgb, var(--info) 14%, transparent);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.endpoint-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.endpoint-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  word-break: break-all;
}

.endpoint-desc {
  font-size: 0.83rem;
  color: var(--fg-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.endpoint-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.endpoint-path-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.endpoint-path-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.scrapers-pill-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.scrapers-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 10%, transparent);
  padding: 3px 8px;
  border-radius: 8px;
}

.test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.endpoint-card:hover .test-btn {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

/* GENERAL CARD & UTILITIES */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}

.badge-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.cmt {
  color: var(--fg-subtle);
  font-style: italic;
}

.modal-action-bar {
  margin-top: 12px;
  width: 100%;
}

.media-preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 10px;
}

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-border {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: -0.125em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.spinner-border-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ═══════════════ SHEETS MD3 / PLAYGROUND (ENHANCED DUAL PANE & TABS) ═══════════════ */
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: scrim-in .2s var(--ease-md);
  display: none;
}

.sheet-scrim.open {
  display: block;
}

.md-sheet {
  position: fixed;
  z-index: 1200;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92dvh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  animation: sheet-up .28s var(--ease-md);
  overflow: hidden;
}

@media (min-width: 860px) {
  .md-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(960px, calc(100vw - 32px));
    height: 84vh;
    max-height: 84vh;
    border-radius: 20px;
    border: 1px solid var(--border-2);
    animation: sheet-pop .25s var(--ease-md);
  }
  @keyframes sheet-pop {
    from { transform: translate(-50%, -46%) scale(.96); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-2);
  margin: 10px auto 2px;
  flex: none;
}

@media (min-width: 860px) {
  .sheet-handle { display: none; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.sheet-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sheet-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sheet-endpoint-select {
  background: var(--surface-2);
  color: var(--fg-strong);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 10px;
  max-width: 180px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--trans-fast);
}

.sheet-endpoint-select:hover,
.sheet-endpoint-select:focus {
  border-color: var(--fg-strong);
}

@media (max-width: 600px) {
  .sheet-endpoint-select {
    max-width: 125px;
    font-size: 0.72rem;
    padding: 5px 8px;
  }
}

/* MODAL BODY SPLIT GRID */
.sheet-body-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  padding: 16px 20px;
  overflow: hidden;
}

@media (max-width: 859px) {
  .sheet-body-grid {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 50px;
    overflow-y: auto;
    gap: 18px;
  }
}

.modal-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-pane-left {
  overflow-y: auto;
  padding-right: 4px;
}

.modal-pane-right {
  overflow: hidden;
  height: 100%;
}

@media (max-width: 859px) {
  .modal-pane-left {
    overflow-y: visible;
    padding-right: 0;
  }
  .modal-pane-right {
    overflow-y: visible;
    height: auto;
  }
}

/* ═══════════════ PLAYGROUND COMPONENTS ═══════════════ */
.playground-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LIVE URL BOX & COPY BUTTON (VERCEL MONO STYLE) */
.live-url-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.live-url-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fg);
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  max-height: 48px;
  overflow-y: auto;
  min-width: 0;
  flex: 1;
  line-height: 1.4;
  user-select: all;
}

.copy-route-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  flex-shrink: 0;
}

.copy-route-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

/* PARAMETER INPUTS (VERCEL CLEAN INPUTS) */
.params-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.param-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.param-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.param-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--fg-strong);
}

.param-desc {
  font-size: 0.72rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.param-badge-req {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  padding: 1px 6px;
  border-radius: 4px;
}

.param-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.param-input:focus {
  border-color: var(--fg-strong);
  box-shadow: 0 0 0 1px var(--fg-strong);
}

/* EXECUTE BUTTON (TRUE VERCEL PRIMARY BUTTON) */
.btn-execute {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-execute:hover {
  opacity: 0.90;
  transform: translateY(-1px);
}

.btn-execute:active {
  transform: translateY(0) scale(0.99);
}

.btn-execute:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-execute.btn-running {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4) !important;
}

.btn-execute.btn-running:hover {
  background: #dc2626 !important;
  opacity: 1 !important;
}

/* STICKY FOOTER (MOBILE) */
.sheet-mobile-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 20;
}

/* JSON VIEWER & COPY BUTTON (VERCEL CODE STUDIO) */
.json-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--code-bg);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.json-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.badge-success {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
}

.badge-danger {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
}

.response-time-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.copy-json-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
  cursor: pointer;
  transition: all .15s ease;
}

.copy-json-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

.json-view-wrapper {
  flex: 1;
  min-height: 220px;
  max-height: calc(84vh - 170px);
  overflow: auto;
  background: var(--code-bg);
}

@media (max-width: 859px) {
  .json-view-wrapper {
    max-height: 380px;
  }
}

.code-body {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--code-fg);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Syntax Highlighting */
[data-theme="dark"] .json-key, html.dark .json-key { color: #79c0ff; font-weight: 600; }
[data-theme="dark"] .json-string, html.dark .json-string { color: #a5d6ff; }
[data-theme="dark"] .json-number, html.dark .json-number { color: #ffa657; }
[data-theme="dark"] .json-boolean, html.dark .json-boolean { color: #ff7b72; font-weight: 600; }
[data-theme="dark"] .json-null, html.dark .json-null { color: #8b949e; font-style: italic; }

:root:not(.dark) .json-key, [data-theme="light"] .json-key, html.light .json-key { color: #0969da; font-weight: 600; }
:root:not(.dark) .json-string, [data-theme="light"] .json-string, html.light .json-string { color: #0a3069; }
:root:not(.dark) .json-number, [data-theme="light"] .json-number, html.light .json-number { color: #953800; }
:root:not(.dark) .json-boolean, [data-theme="light"] .json-boolean, html.light .json-boolean { color: #cf222e; font-weight: 600; }
:root:not(.dark) .json-null, [data-theme="light"] .json-null, html.light .json-null { color: #6e7781; font-style: italic; }

/* MEDIA PREVIEW & PLAYERS */
.media-preview-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.media-player-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.media-video-player {
  max-height: 260px;
  width: 100%;
  border-radius: 8px;
  background: #000000;
  outline: none;
}

.media-audio-player {
  width: 100%;
  outline: none;
}

.media-image-preview {
  max-height: 240px;
  border-radius: 8px;
  object-fit: contain;
  margin: 0 auto;
}

.media-download-bar {
  display: flex;
  justify-content: flex-end;
}

.media-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  text-decoration: none;
  border: 1px solid var(--btn-secondary-border);
  transition: all .15s ease;
}

.media-dl-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

/* ═══════════════ ANDROID BOTTOM NAVIGATION ═══════════════ */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 12px env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.bottom-nav-inner {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 600px;
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 16px;
  cursor: pointer;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  font-family: inherit;
  transition: all .18s var(--ease-md);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn i {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform .2s var(--ease-md);
}

.bottom-nav-btn span {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.bottom-nav-btn:hover {
  color: var(--fg);
}

.bottom-nav-btn.active {
  color: var(--fg-strong);
}

.bottom-nav-btn.active i {
  transform: translateY(-2px);
  color: var(--accent);
}

/* ═══════════════ ANDROID SNACKBAR / TOAST ═══════════════ */
@keyframes toast-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-3);
  color: var(--fg-strong);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: min(420px, calc(100vw - 32px));
  animation: toast-in .25s var(--ease-md);
  pointer-events: none;
}

.snackbar.success {
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.snackbar.error {
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}

/* STATS TAB / LEAGUE */
.stats-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--fg-strong);
}

.stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.stat-box-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--fg-strong);
}

.stat-box-label {
  font-size: 0.72rem;
  color: var(--fg-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}
