/* ============================================================
   TOKEN HIVE — Styles
   Aesthetic: Industrial Honeycomb / Dark Amber
   ============================================================ */

:root {
  --amber: #F5A623;
  --amber-dark: #C8851A;
  --amber-glow: rgba(245,166,35,0.15);
  --amber-glow-strong: rgba(245,166,35,0.35);
  --bg: #080A0E;
  --bg-2: #0D1117;
  --bg-3: #131922;
  --bg-4: #1A2232;
  --border: rgba(245,166,35,0.12);
  --border-hover: rgba(245,166,35,0.35);
  --text: #E8EDF5;
  --text-2: #94A3B8;
  --text-3: #5A6A84;
  --green: #22C55E;
  --red: #EF4444;
  --blue: #3B82F6;
  --font-main: 'DM Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 64px;
  --mobile-nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================ AMBIENT BG */
.bg-hive {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.hex-grid {
  position: absolute; inset: 0; opacity: 0.04;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpolygon points='28,2 54,16 54,50 28,64 2,50 2,16' fill='none' stroke='%23F5A623' stroke-width='1'/%3E%3Cpolygon points='28,52 54,66 54,100 28,114 2,100 2,66' fill='none' stroke='%23F5A623' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 100px;
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.25;
}
.glow-1 { width: 500px; height: 500px; background: #F5A623; top: -150px; right: -100px; }
.glow-2 { width: 400px; height: 400px; background: #3B82F6; bottom: -100px; left: -100px; opacity: 0.12; }
.glow-3 { width: 300px; height: 300px; background: #F5A623; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0.06; }

/* ============================================================ TOPBAR */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(8,10,14,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem;
}

.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; flex-shrink: 0; }
.logo-icon { width: 32px; height: 32px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em;
}
.logo-text em { color: var(--amber); font-style: normal; }

.topnav { display: flex; gap: 0.25rem; flex: 1; }
.nav-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-family: var(--font-main); font-size: 0.875rem; font-weight: 600;
  padding: 0.4rem 0.85rem; border-radius: 8px;
  transition: all 0.2s;
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-btn.active { color: var(--amber); background: var(--amber-glow); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

.net-toggle {
  display: flex; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.net-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-main); font-size: 0.75rem; font-weight: 600;
  color: var(--text-3); padding: 0.3rem 0.7rem; border-radius: 6px;
  transition: all 0.2s;
}
.net-btn.active { background: var(--amber); color: var(--bg); }

.connect-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--amber-glow); border: 1px solid var(--border-hover);
  color: var(--amber); font-family: var(--font-main); font-size: 0.8rem; font-weight: 700;
  padding: 0.45rem 1rem; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.connect-btn:hover { background: var(--amber); color: var(--bg); }
.connect-btn.connected { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: var(--green); }

.btn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: pulse-dot 2s ease-in-out infinite;
}
.connect-btn.connected .btn-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

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

/* ============================================================ MOBILE NAV */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--mobile-nav-h);
  background: rgba(8,10,14,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
}
.mnav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem; color: var(--text-3); font-family: var(--font-main);
  font-size: 0.65rem; font-weight: 600; padding: 0.5rem 0;
  transition: all 0.2s;
}
.mnav-btn svg { width: 20px; height: 20px; }
.mnav-btn.active { color: var(--amber); }
.mnav-btn.active svg { stroke: var(--amber); }

/* ============================================================ MAIN */
.main-content {
  position: relative; z-index: 10;
  max-width: 1280px; margin: 0 auto;
  padding: calc(var(--topbar-h) + 2rem) 1.5rem 2rem;
  min-height: 100vh;
}

.view { display: none; }
.view.active { display: block; animation: fadeUp 0.35s ease; }

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

/* ============================================================ VIEW HEADER */
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.view-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700;
  letter-spacing: -0.03em; color: var(--text);
  line-height: 1.1;
}
.view-sub {
  font-size: 0.9rem; color: var(--text-2); margin-top: 0.25rem;
}

/* ============================================================ CTA BUTTON */
.cta-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--amber); color: var(--bg);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-main); font-size: 0.875rem; font-weight: 700;
  padding: 0.6rem 1.25rem; transition: all 0.2s;
  white-space: nowrap;
}
.cta-btn:hover { background: #FFB83A; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(245,166,35,0.4); }
.cta-btn:active { transform: translateY(0); }
.cta-btn svg { width: 16px; height: 16px; }
.cta-btn.secondary {
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border);
}
.cta-btn.secondary:hover { background: var(--bg-4); color: var(--text); box-shadow: none; }
.cta-btn.full { width: 100%; justify-content: center; margin-top: 1rem; }
.cta-btn.sm { font-size: 0.8rem; padding: 0.45rem 1rem; }

/* ============================================================ STATS BAR */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-val {
  font-size: 1.75rem; font-weight: 800; color: var(--amber);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.stat-label { font-size: 0.75rem; color: var(--text-3); font-weight: 600; margin-top: 0.15rem; }

/* ============================================================ SEARCH */
.search-bar {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.search-input-wrap {
  flex: 1; min-width: 200px;
  position: relative; display: flex; align-items: center;
}
.search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); }
.search-input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-main); font-size: 0.875rem;
  padding: 0.6rem 0.75rem 0.6rem 2.4rem;
  outline: none; transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { border-color: var(--amber); }

.filter-pills { display: flex; gap: 0.5rem; }
.pill {
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--font-main); font-size: 0.8rem; font-weight: 600;
  padding: 0.4rem 0.85rem; border-radius: 20px; cursor: pointer;
  transition: all 0.2s;
}
.pill:hover { border-color: var(--border-hover); color: var(--text); }
.pill.active { background: var(--amber-glow); border-color: var(--amber); color: var(--amber); }

/* ============================================================ TOKEN GRID */
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.token-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  cursor: pointer; transition: all 0.25s;
  position: relative; overflow: hidden;
  animation: fadeUp 0.35s ease both;
}
.token-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.token-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.token-card:hover::before { opacity: 1; }

.tc-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.85rem; }
.tc-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: var(--amber);
  overflow: hidden; flex-shrink: 0;
  font-family: var(--font-mono);
}
.tc-logo img { width: 100%; height: 100%; object-fit: cover; }
.tc-name-group { flex: 1; min-width: 0; }
.tc-name { font-size: 0.95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-symbol { font-size: 0.75rem; color: var(--amber); font-family: var(--font-mono); font-weight: 700; }

.tc-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.badge {
  font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 4px;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-mainnet { background: rgba(245,166,35,0.15); color: var(--amber); border: 1px solid rgba(245,166,35,0.3); }
.badge-testnet { background: rgba(59,130,246,0.15); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-verified { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-tag { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }
.badge-privacy-ready {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-privacy-ready:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
}

.tc-address {
  font-size: 0.7rem; color: var(--text-3); font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 0.75rem;
}
.tc-desc { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; margin-bottom: 0.85rem; }

.tc-footer { display: flex; align-items: center; justify-content: space-between; }
.tc-date { font-size: 0.7rem; color: var(--text-3); }
.tc-copy {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-3); cursor: pointer; padding: 0.3rem 0.6rem;
  font-size: 0.7rem; font-family: var(--font-mono);
  transition: all 0.2s;
}
.tc-copy:hover { border-color: var(--amber); color: var(--amber); }

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-2);
}
.empty-hex { width: 80px; height: 80px; margin: 0 auto 1.5rem; }
.empty-hex svg { width: 100%; height: 100%; }

/* ============================================================ LAUNCH */
.launch-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 2rem;
}
.steps-panel {
  display: flex; flex-direction: column;
}
.step-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem; border-radius: var(--radius); cursor: default;
  transition: all 0.2s;
}
.step-item.active .step-circle { background: var(--amber); color: var(--bg); }
.step-item.done .step-circle { background: var(--green); color: var(--bg); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-weight: 800; font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.3s;
}
.step-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.step-desc { font-size: 0.75rem; color: var(--text-3); }
.step-line { width: 1px; height: 28px; background: var(--border); margin: 0 1rem 0 calc(1rem + 16px); }

.form-panel {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
}
.form-step { display: none; animation: fadeUp 0.3s ease; }
.form-step.active { display: block; }
.form-step-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text); }

/* ============================================================ FIELDS */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-size: 0.8rem; font-weight: 700;
  color: var(--text-2); margin-bottom: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.req { color: var(--amber); }
.inp {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-main); font-size: 0.875rem;
  padding: 0.65rem 0.85rem; outline: none; transition: border-color 0.2s;
}
.inp::placeholder { color: var(--text-3); }
.inp:focus { border-color: var(--amber); }
.inp[readonly] { opacity: 0.6; cursor: not-allowed; }
.inp-ta { resize: vertical; min-height: 80px; }
.mono { font-family: var(--font-mono) !important; font-size: 0.82rem !important; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.logo-preview {
  margin-top: 0.5rem; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); overflow: hidden; display: none;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

.toggle-field {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.65rem 0.85rem;
  font-size: 0.875rem; color: var(--text-2);
}
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--bg-4); border-radius: 24px;
  transition: 0.3s; cursor: pointer; border: 1px solid var(--border);
}
.slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-3); bottom: 2px; left: 2px;
  transition: 0.3s;
}
.toggle input:checked + .slider { background: var(--amber-glow); border-color: var(--amber); }
.toggle input:checked + .slider::before { transform: translateX(20px); background: var(--amber); }

.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-group.horizontal { flex-direction: row; }
.radio-opt {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem;
  cursor: pointer; transition: all 0.2s; flex: 1;
}
.radio-opt input { display: none; }
.radio-opt.selected { border-color: var(--amber); background: var(--amber-glow); }
.radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--text-3); flex-shrink: 0; transition: all 0.2s;
  position: relative;
}
.radio-opt.selected .radio-dot { border-color: var(--amber); }
.radio-opt.selected .radio-dot::after {
  content: ''; position: absolute; width: 8px; height: 8px;
  background: var(--amber); border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.radio-label { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.radio-sub { font-size: 0.75rem; color: var(--text-3); }

/* ============================================================ DEPLOY */
.deploy-summary {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-key { color: var(--text-3); font-weight: 600; }
.summary-val { color: var(--text); font-weight: 700; font-family: var(--font-mono); font-size: 0.82rem; }

.deploy-info {
  display: flex; align-items: center; gap: 0.75rem;
  background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-sm); padding: 0.75rem; margin-bottom: 1rem;
  font-size: 0.8rem; color: var(--text-2);
}
.deploy-info svg { width: 18px; height: 18px; color: var(--amber); flex-shrink: 0; }

.tx-progress { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.tx-step {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem; color: var(--text-2); padding: 0.5rem;
  border-radius: 8px; transition: all 0.3s;
}
.tx-step.done { color: var(--green); }
.tx-step.dim { opacity: 0.4; }
.tx-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-3); flex-shrink: 0;
}
.tx-dot.spinning {
  background: var(--amber);
  animation: spin-border 1s linear infinite;
  box-shadow: 0 0 8px var(--amber);
}
.tx-dot.done-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

@keyframes spin-border {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

.tx-success {
  text-align: center; padding: 2rem 0;
}
.success-hex {
  width: 64px; height: 64px; background: rgba(34,197,94,0.2); border: 2px solid var(--green);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem; color: var(--green);
}
.tx-success h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.tx-success p { color: var(--text-2); font-size: 0.8rem; margin-bottom: 1.25rem; }
.launch-btn { font-size: 1rem; padding: 0.75rem 1.5rem; }

/* API */
.api-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 2rem;
  align-items: start;
}

.api-sidebar {
  position: sticky; top: calc(var(--topbar-h) + 1rem);
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
}
.api-nav-section {
  font-size: 0.65rem; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.5rem 0.6rem 0.3rem;
}
.api-nav-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-2);
  padding: 0.45rem 0.6rem; border-radius: 6px; transition: all 0.15s;
}
.api-nav-item:hover { color: var(--text); background: var(--bg-3); }
.api-nav-item.active { color: var(--amber); background: var(--amber-glow); }

.api-content {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
}
.endpoint-badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.method {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.6rem; border-radius: 4px;
}
.method.get { background: rgba(34,197,94,0.2); color: var(--green); }
.method.post { background: rgba(59,130,246,0.2); color: var(--blue); }
.endpoint-path { font-family: var(--font-mono); font-size: 0.875rem; color: var(--amber); }

.endpoint-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.endpoint-desc { color: var(--text-2); font-size: 0.875rem; margin-bottom: 1.5rem; line-height: 1.6; }

.code-block {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.25rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: #94A3B8;
  overflow-x: auto; margin-bottom: 1rem;
  position: relative;
}
.code-block .kw { color: var(--blue); }
.code-block .str { color: var(--green); }
.code-block .num { color: var(--amber); }
.code-block .key { color: #E2E8F0; }
.code-label {
  font-size: 0.7rem; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem;
}
.copy-code-btn {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-family: var(--font-main); font-size: 0.7rem;
  padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer;
  transition: all 0.2s;
}
.copy-code-btn:hover { color: var(--amber); border-color: var(--amber); }

.param-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.82rem; }
.param-table th {
  text-align: left; padding: 0.5rem 0.75rem; font-size: 0.7rem;
  font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.param-table td {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: top;
}
.param-table tr:last-child td { border-bottom: none; }
.param-name { font-family: var(--font-mono); color: var(--amber); }
.param-type { font-family: var(--font-mono); color: var(--blue); font-size: 0.75rem; }
.param-req { color: var(--red); font-size: 0.7rem; font-weight: 700; }

/* ============================================================ ACCOUNT */
.account-panel {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
}
.not-connected { text-align: center; padding: 2rem; }
.nc-icon { width: 80px; height: 80px; margin: 0 auto 1.5rem; }
.nc-icon svg { width: 100%; height: 100%; }
.not-connected h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.not-connected p { color: var(--text-2); font-size: 0.875rem; margin-bottom: 1.5rem; line-height: 1.6; }

.connected-account { display: flex; flex-direction: column; gap: 1.25rem; }
.wallet-card {
  background: var(--bg-3); border: 1px solid var(--border-hover);
  border-radius: var(--radius); padding: 1.25rem;
}
.wallet-addr { font-family: var(--font-mono); font-size: 0.82rem; color: var(--amber); word-break: break-all; margin-bottom: 0.5rem; }
.wallet-net { font-size: 0.75rem; color: var(--text-3); }
.disconnect-btn {
  background: none; border: 1px solid rgba(239,68,68,0.3);
  color: var(--red); font-family: var(--font-main); font-size: 0.8rem;
  padding: 0.4rem 0.85rem; border-radius: 6px; cursor: pointer;
  transition: all 0.2s; margin-top: 0.75rem;
}
.disconnect-btn:hover { background: rgba(239,68,68,0.1); }

/* ============================================================ MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.modal-wide { max-width: 680px; }

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

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 1rem; padding: 0.25rem; transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
}

.modal-token-header { display: flex; align-items: center; gap: 1rem; }
.modal-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800; color: var(--amber);
  font-family: var(--font-mono); overflow: hidden;
}
.modal-logo img { width: 100%; height: 100%; object-fit: cover; }

.fetch-btn {
  width: 100%; margin-top: 0.5rem;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--font-main); font-size: 0.8rem; font-weight: 700;
  padding: 0.5rem; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s;
}
.fetch-btn:hover { border-color: var(--amber); color: var(--amber); }

.fetched-badge {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  border-radius: 8px; padding: 0.6rem 0.75rem;
  font-size: 0.8rem; color: var(--green); font-weight: 600;
  margin-bottom: 1rem;
}
.fetched-badge svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================ TOAST */
.toast-container {
  position: fixed; bottom: 5rem; right: 1rem; z-index: 300;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  font-size: 0.875rem; color: var(--text);
  display: flex; align-items: center; gap: 0.6rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: slideInRight 0.3s ease;
  max-width: 320px;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(245,166,35,0.4); }
.toast-icon { flex-shrink: 0; font-size: 1rem; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================ API BASE URL BADGE */
.api-base-badge {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.85rem;
  font-size: 0.78rem; color: var(--amber);
  word-break: break-all;
  max-width: 100%;
}

@media (max-width: 580px) {
  .api-base-badge {
    width: 100%;
    font-size: 0.7rem;
  }

  .view-header {
    gap: 0.75rem;
  }
}

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .topnav { display: none; }
  .topbar-right .net-toggle { display: none; }
  .mobile-nav { display: flex; }
  .main-content { padding-bottom: calc(var(--mobile-nav-h) + 1.5rem); }
  .launch-grid { grid-template-columns: 1fr; }
  .steps-panel { flex-direction: row; overflow-x: auto; padding-bottom: 0.5rem; }
  .step-line { width: 28px; height: 1px; margin: 1rem 0; align-self: center; }
  .api-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stats-bar { grid-template-columns: repeat(2,1fr); }
  .field-row { grid-template-columns: 1fr; }
  .steps-panel {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .step-item {
    padding: 0.6rem 0.75rem;
    flex-shrink: 0;
  }

  .step-name { font-size: 0.8rem; }
  .step-desc { display: none; }

  .form-panel {
    padding: 1.25rem;
  }
  .api-sidebar {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;          /* ← locks to horizontal scroll only */
    user-select: none;             /* ← prevents text-drag feeling */
    -webkit-user-select: none;
    scroll-snap-type: x proximity; /* ← snaps cleanly between items */
    cursor: default;               /* ← removes grab cursor on desktop fallback */
  }

  .api-nav-item {
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;      /* ← pairs with snap above */
    touch-action: manipulation;    /* ← kills 300ms tap delay on each button */
  }

  .api-nav-section {
    display: none;
  }

  .api-content {
    padding: 1rem;
  }

  .code-block {
    font-size: 0.72rem;
    padding: 0.85rem;
  }

  .param-table {
    font-size: 0.75rem;
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 580px) {
  .topbar-right { display: none; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .token-grid { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .filter-pills { overflow-x: auto; }
  .radio-group.horizontal {
    flex-direction: column;
  }

  .deploy-actions .field-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Blueprint info box inline styles can't be targeted by class,
     so we override the flex layout for all such children */
  #formStep1 > div:first-of-type {
    flex-direction: column;
    gap: 0.75rem;
  }

  #formStep1 > div:first-of-type > div:last-child {
    text-align: left;
    flex-direction: row;
    gap: 1rem;
  }

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

/* WALLET PICKER */
.wallet-option {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
  cursor: pointer; transition: all 0.2s; width: 100%;
  margin-bottom: 0.5rem; color: var(--text);
  font-family: var(--font-main); font-size: 0.95rem; font-weight: 600;
}
.wallet-option:hover { border-color: var(--amber); background: var(--amber-glow); }
.wallet-option img { width: 36px; height: 36px; border-radius: 8px; }
.wallet-option-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-4); display: flex; align-items: center;
  justify-content: center; font-size: 1.25rem;
}
.wallet-none {
  text-align: center; padding: 1rem;
  font-size: 0.85rem; color: var(--text-3); line-height: 1.6;
}
.wallet-none a { color: var(--amber); }

.registry-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Hide the duplicate mobile toggle on desktop since topbar already has one */
.mobile-net-toggle {
  display: none;
}

@media (max-width: 900px) {
  .mobile-net-toggle {
    display: flex;
  }
}

/* ── Prevent API view from feeling draggable on mobile ── */
@media (max-width: 900px) {
  #view-api {
    touch-action: pan-y;     /* vertical page scroll only at view level */
    user-select: none;
    -webkit-user-select: none;
  }

  #view-api .api-sidebar {
    touch-action: pan-x;     /* sidebar itself scrolls horizontally */
  }

  #view-api .api-content {
    touch-action: pan-y;     /* content area scrolls vertically */
    overflow-y: auto;
  }
}

/* ── Fix Launch Step 2 scroll on mobile ── */
@media (max-width: 900px) {
  #view-launch {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }

  #formStep3 {
    touch-action: pan-y;
    overflow-y: auto;
  }

  #formStep3 .deploy-actions {
    touch-action: manipulation;
  }
}

/* Fix long addresses and URLs breaking out of modals */
.modal-body,
.modal-body .summary-val,
.modal-body .mono,
.deploy-summary .summary-val {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.summary-row {
  align-items: flex-start;
  gap: 1rem;
}

.summary-key {
  flex-shrink: 0;
  min-width: 110px;
}

.summary-val {
  flex: 1;
  min-width: 0;
  text-align: right;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Token detail modal on mobile */
@media (max-width: 580px) {
  .modal {
    max-height: 92vh;
    overflow-y: auto;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .modal-footer .cta-btn {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }
  .summary-row {
    flex-direction: column;
    gap: 0.2rem;
  }
  .summary-key {
    min-width: unset;
  }
  .summary-val {
    text-align: left;
  }
}
