/* ============================================================
   Total Recall — Styles
   Agent-first. Dark. Clean.
   ============================================================ */

:root {
  --bg:         #07091a;
  --surface:    #0d1226;
  --card:       #111827;
  --card-hover: #151e30;
  --border:     #1e2d4a;
  --border-2:   #243450;
  --accent:     #3b82f6;
  --accent-2:   #06b6d4;
  --accent-glow: rgba(59,130,246,0.15);
  --green:      #10b981;
  --red:        #ef4444;
  --amber:      #f59e0b;
  --text:       #e2e8f0;
  --text-muted: #64748b;
  --text-dim:   #94a3b8;
  --mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans:       'Inter', system-ui, sans-serif;
  --radius:     10px;
  --radius-sm:  6px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 9px 18px;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(59,130,246,0.35); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--text); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* ══════════════════════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════════════════════ */

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7,9,26,0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  font-size: 1.4rem;
  color: var(--accent);
}
.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* Hero */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: var(--green);
  margin-bottom: 28px;
  font-family: var(--mono);
}
.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

/* Code Card */
.code-card {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 0 60px rgba(59,130,246,0.08);
}
.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.code-dots {
  display: flex;
  gap: 6px;
}
.code-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-2);
}
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28ca41; }
.code-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.code-block {
  padding: 24px;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

/* Syntax colors */
.c-import  { color: #c792ea; }
.c-keyword { color: #89ddff; }
.c-string  { color: #c3e88d; }
.c-fn      { color: #82aaff; }
.c-comment { color: var(--text-muted); font-style: italic; }
.c-var     { color: #f78c6c; }

/* Pricing Section */
.pricing-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}
.pricing-header { text-align: center; margin-bottom: 40px; }
.pricing-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.pricing-sub { font-size: 0.95rem; color: var(--text-muted); }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: transform 0.15s ease;
}
.price-card:hover { transform: translateY(-2px); }
.price-card.featured {
  border-color: var(--accent);
  background: rgba(59,130,246,0.05);
}
.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.price-tier {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.price-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}
.price-amount span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}
.price-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.price-features li {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.price-features li:first-child { color: var(--text); }
.price-pay-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-icp {
  border-color: rgba(255,196,0,0.3);
  color: #ffc400;
}
.btn-icp:hover { background: rgba(255,196,0,0.08); }
/* Help Tooltips */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}
.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  width: 220px;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 300;
}
.help-tip:hover::after {
  opacity: 1;
}

/* Upgrade Popover */
.upgrade-popover-wrap {
  position: relative;
}
.upgrade-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #16161e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upgrade-popover.hidden { display: none; }
.upgrade-popover-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.5;
  margin-bottom: 2px;
}
.upgrade-popover-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upgrade-popover-card.current-plan {
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.06);
}
.upgrade-popover-tier {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.upgrade-popover-price {
  font-size: 12px;
  opacity: 0.6;
  font-weight: 400;
}
.upgrade-popover-features {
  font-size: 11px;
  opacity: 0.5;
}
.upgrade-popover-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.icp-discount-badge {
  display: inline-block;
  background: #ffc400;
  color: #0a0a0f;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* ICP Payment Modal */
.icp-payment-steps { display: flex; flex-direction: column; gap: 20px; margin: 20px 0; }
.icp-step { display: flex; gap: 14px; align-items: flex-start; }
.icp-step-num {
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.icp-step-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.icp-memo-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.icp-label { font-size: 0.72rem; color: var(--text-muted); min-width: 50px; }
.icp-memo-box code {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  flex: 1;
  word-break: break-all;
}

/* SDK Section */
.sdk-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}
.sdk-header { text-align: center; margin-bottom: 32px; }
.sdk-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  padding: 6px 16px;
  margin-bottom: 20px;
}
.sdk-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.sdk-sub { font-size: 0.95rem; color: var(--text-muted); }
.sdk-code-card {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(59,130,246,0.07);
}
.sdk-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sdk-method {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.sdk-method code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.sdk-method span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Features Grid */
.features {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
}
.feature-card:hover {
  border-color: var(--border-2);
  background: var(--card-hover);
  transform: translateY(-2px);
}
.feature-icon { font-size: 1.6rem; margin-bottom: 12px; }
.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.feature-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.feature-tag.live {
  background: rgba(16,185,129,0.12);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.25);
}
.feature-tag.coming-soon {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.25);
}

/* Canister Info */
.canister-info {
  max-width: 680px;
  margin: 0 auto 60px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.canister-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  flex-wrap: wrap;
}
.canister-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 130px;
}
.canister-id {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-2);
  flex: 1;
}
.status-pill {
  font-size: 0.75rem;
  color: var(--green);
  font-family: var(--mono);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════════ */

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
}
.user-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}
.user-principal {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Usage Dashboard Bar */
#usage-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.usage-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.usage-stat span:first-child {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}
.usage-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.usage-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tier-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  font-family: var(--mono);
}
.tier-badge.free       { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.25); }
.tier-badge.pro        { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.tier-badge.agent      { background: rgba(139,92,246,0.12);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.tier-badge.enterprise { background: rgba(245,158,11,0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
#usage-bar .btn { margin-left: auto; }

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 12px 32px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 18px 10px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-soon {
  font-size: 0.68rem;
  background: rgba(245,158,11,0.15);
  color: var(--amber);
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  letter-spacing: 0.3px;
}

/* Tab Content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Panel Grid */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px 32px;
  max-width: 1100px;
}
@media (max-width: 768px) {
  .panel-grid { grid-template-columns: 1fr; }
  .nav { padding: 16px 20px; }
  .hero { padding: 48px 20px 40px; }
}

/* Panel */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Drop Zone */
#drop-zone {
  padding: 36px 20px;
  text-align: center;
  border: 2px dashed var(--border-2);
  margin: 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}
#drop-zone:hover, #drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.drop-icon { font-size: 2rem; margin-bottom: 10px; }
#drop-zone p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 6px; }
#drop-zone .sub { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 14px; }

/* Progress */
#upload-progress { padding: 16px 20px; }
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}
#progress-label { font-size: 0.82rem; color: var(--text-dim); }

/* File List */
#file-list { padding: 8px 0; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
  gap: 12px;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--card-hover); }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 2px;
}
.file-type-icon { font-size: 1.3rem; flex-shrink: 0; }
.file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Seed / Secrets */
#seed-list { padding: 8px 0; }
.seed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.seed-item:last-child { border-bottom: none; }
.seed-item:hover { background: var(--card-hover); }
.seed-item-main { flex: 1; min-width: 0; }
.seed-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seed-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.seed-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 4px;
  padding: 2px 7px;
}
.seed-badge-net {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.25);
}
.seed-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 5px;
}
/* Seed label kept for backward-compat */
.seed-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

/* Forms */
.panel .form-group,
.panel .form-row,
.panel .security-notice,
.panel .btn-primary {
  margin: 0 20px 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
}
.form-group select {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option { background: #1e1e2e; color: var(--text); }
.label-hint { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; }
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.input-reveal { position: relative; }
.reveal-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.reveal-btn:hover { opacity: 1; }

/* Security notice */
.security-notice {
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.security-notice strong { color: var(--text); }

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 32px 20px;
}

/* Agent Memory Coming Soon Panel */
.coming-soon-panel {
  max-width: 640px;
  margin: 60px auto;
  padding: 48px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.cs-icon { font-size: 3rem; margin-bottom: 20px; }
.coming-soon-panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.coming-soon-panel > p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.6;
}
.cs-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  text-align: left;
  margin-bottom: 28px;
}
.cs-code pre {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.cs-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}
.cs-feat {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}
.cs-feat span { color: var(--green); }

/* Agent Memory & API Keys */
.agent-grid {
  grid-template-columns: 1fr 1fr;
}
.mem-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.15s ease;
}
.mem-item:last-child { border-bottom: none; }
.mem-item:hover { background: var(--card-hover); }
.mem-info { flex: 1; min-width: 0; }
.mem-key {
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mem-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.mem-tag {
  background: rgba(59,130,246,0.12);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-family: var(--mono);
}
.apikey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.apikey-item:last-child { border-bottom: none; }
.apikey-info { flex: 1; min-width: 0; }
.apikey-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.apikey-val {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.apikey-val code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  word-break: break-all;
}
.apikey-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(7,9,26,0.85);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 20px;
}
.modal-box .form-group { margin: 0 0 16px; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.seed-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-all;
  margin: 10px 0;
  line-height: 1.6;
}
#auto-clear-hint { margin-bottom: 8px; }

/* ── For AI Agents Section ───────────────────────────────── */
.agents-section {
  padding: 96px 24px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.agents-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 20px;
  letter-spacing: 0.03em;
}
.agents-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}
.agents-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 56px;
  line-height: 1.6;
}
.agents-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.flow-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 200px;
  text-align: center;
}
.flow-icon { font-size: 1.8rem; margin-bottom: 10px; }
.flow-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.flow-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.flow-arrow { font-size: 1.5rem; color: var(--text-muted); }
@media (max-width: 640px) { .flow-arrow { transform: rotate(90deg); } }
.agents-code-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  margin-bottom: 48px;
}
.agents-proof {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(16,185,129,0.05));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: 32px;
}
.proof-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.proof-text {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Settings Tab ─────────────────────────────────────────── */
.settings-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.settings-card-header h2 { font-size: 1rem; font-weight: 600; }
.settings-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Canister mode grid */
.canister-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px 24px;
}
@media (max-width: 640px) { .canister-mode-grid { grid-template-columns: 1fr; } }
.mode-option {
  position: relative;
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.mode-option:hover { border-color: rgba(99,102,241,0.4); }
.mode-option.mode-active {
  border-color: var(--accent);
  background: rgba(99,102,241,0.08);
}
.mode-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 20px; height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
}
.mode-icon { font-size: 1.6rem; margin-bottom: 8px; }
.mode-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.mode-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 10px; }
.mode-tag { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }

/* BYOC input */
.byoc-input-row { display: flex; gap: 10px; margin-bottom: 8px; }
.byoc-input {
  flex: 1;
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border-2, rgba(255,255,255,0.12));
  border-radius: var(--radius-sm, 8px);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 10px 12px;
  outline: none;
}
.byoc-input:focus { border-color: var(--accent); }
#byoc-input-wrap, #dedicated-request-wrap { padding: 0 24px 20px; }
.dedicated-request-box { padding: 16px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm,8px); border: 1px solid var(--border); }

/* Current canister info */
.settings-current {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.83rem;
}
.settings-current-label { color: var(--text-muted); }
.settings-current code { font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); }

/* Account rows */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.88rem;
}
.settings-row:last-of-type { border-bottom: none; }
.settings-row-label { color: var(--text-muted); }
.settings-row-val { color: var(--text); font-family: var(--mono); font-size: 0.82rem; }

/* ── Quick Start Steps ───────────────────────────────────── */
.quickstart-steps {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qs-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.qs-num {
  min-width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.qs-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.qs-cmd {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #a5b4fc;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 6px;
  padding: 5px 10px;
  word-break: break-all;
}

/* ── Method Grid ─────────────────────────────────────────── */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin: 12px 20px;
  border-radius: 8px;
  overflow: hidden;
}
.method-card {
  background: var(--card);
  padding: 12px 14px;
  transition: background 0.1s;
}
.method-card:hover { background: var(--card-hover, rgba(255,255,255,0.04)); }
.method-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 3px;
}
.method-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Canister row */
.qs-canister-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.qs-canister-row code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  flex: 1;
}

/* ── Hero Visual (replaces code window) ──────────────────── */
.hero-visual {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Stats row */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  gap: 0;
  flex-wrap: wrap;
}
.hero-stat {
  flex: 1;
  text-align: center;
  padding: 8px 16px;
  min-width: 120px;
}
.hero-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  margin-bottom: 4px;
}
.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .hero-stat-divider { display: none; }
  .hero-stat { min-width: 50%; border-bottom: 1px solid var(--border); }
}

/* Feature cards */
.hero-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) { .hero-features { grid-template-columns: 1fr; } }
.hero-feat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s, background 0.15s;
}
.hero-feat:hover {
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.05);
}
.hero-feat-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.hero-feat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.hero-feat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Agents Handoff Card ─────────────────────────────────── */
.agents-handoff-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
  text-align: left;
}
.agents-handoff-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.handoff-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
@media (max-width: 560px) { .handoff-fields { grid-template-columns: 1fr; } }
.handoff-field {
  background: var(--card);
  padding: 16px 24px;
}
.handoff-field-key {
  font-size: 0.82rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 4px;
}
.handoff-field-val {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.handoff-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ── SDK Section Redesign ────────────────────────────────── */
.sdk-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.sdk-step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  min-width: 200px;
}
.sdk-step-num {
  min-width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sdk-step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.sdk-step-cmd {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #a5b4fc;
}
.sdk-step-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
}
@media (max-width: 680px) { .sdk-step-arrow { transform: rotate(90deg); } }

.sdk-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 700px) { .sdk-method-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .sdk-method-grid { grid-template-columns: 1fr; } }
.sdk-method-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
}
.sdk-method-card:hover {
  border-color: rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.06);
}
.sdk-method-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 6px;
}
.sdk-method-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Spaces & Templates ──────────────────────────────────────── */
.spaces-grid { grid-template-columns: 320px 1fr 1fr; }

.memory-entry {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.memory-entry:last-child { border-bottom: none; }
.mem-key     { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.mem-preview { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-actions { display: flex; gap: 6px; }
