/* ── Jhome Console — premium dark theme ─────────────────────────────
   Palette: deep-space navy, glass panels, blue accent with soft glow. */

:root {
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-deep: #2563eb;
  --accent-light: #7cb0ff;
  --bg: #090c14;
  --panel: rgba(20, 25, 38, 0.72);
  --panel-solid: #131826;
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e6ecf5;
  --muted: #94a3b8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --glow: 0 0 24px rgba(59, 130, 246, 0.28);
  --radius: 14px;
  --font-display: "Sora", -apple-system, system-ui, sans-serif;
  --font-body: -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow layers */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(59, 130, 246, 0.13), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(600px 500px at 50% 110%, rgba(96, 165, 250, 0.06), transparent 65%);
  pointer-events: none;
}

h1, h2, h3, h4, .brand { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: 2.1rem; line-height: 1.15; }
h2 { font-size: 1.45rem; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { color: #a8c9ff; }

/* ── Top nav ─────────────────────────────────────────────────────── */
.topnav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 12, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  color: var(--text); font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1.02rem;
}
.brand-logo {
  width: 24px; height: 24px; object-fit: contain;
  border-radius: 7px;
}
.navlinks { display: flex; align-items: center; gap: 0.25rem; }
.navlinks a {
  color: var(--muted); margin-left: 0.35rem; text-decoration: none;
  padding: 0.42rem 0.85rem; border-radius: 9px;
  font-size: 0.92rem; transition: color .18s, background .18s;
}
.navlinks a:hover { color: var(--text); background: rgba(148, 163, 184, 0.09); }

.container { flex: 1; max-width: 1040px; margin: 0 auto; padding: 2rem 1.4rem; width: 100%; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-deep) 100%);
  color: #fff; padding: 0.62rem 1.25rem;
  border: 0; border-radius: 10px; text-decoration: none; cursor: pointer;
  font-size: 0.97rem; font-weight: 600; font-family: var(--font-body);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255,255,255,0.18); filter: brightness(1.06); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }
.btn.ghost {
  background: rgba(148, 163, 184, 0.08); color: var(--text);
  box-shadow: none; border: 1px solid var(--border-strong);
}
.btn.ghost:hover { background: rgba(148, 163, 184, 0.14); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 2px 10px rgba(220,38,38,.3); }

/* ── Panels / cards ──────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: wb-fade-up .45s ease both;
}
.panel h3 { margin-top: 0; }
.panel.interactive { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.panel.interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 14px 36px rgba(0,0,0,0.35), 0 0 0 1px rgba(59,130,246,0.12);
}

@keyframes wb-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Forms ───────────────────────────────────────────────────────── */
input, textarea, select {
  width: 100%; padding: 0.62rem 0.75rem; border-radius: 10px; margin: 0.3rem 0 1rem;
  border: 1px solid var(--border-strong); background: rgba(7, 10, 17, 0.75);
  color: var(--text); font-size: 1rem; font-family: var(--font-body);
  transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
label { color: var(--muted); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.error { color: var(--danger); } .ok { color: var(--ok); }
.muted { color: var(--muted); }

.credit { text-align: center; padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom)); }
.credit a { color: var(--muted); opacity: 0.55; font-size: 0.75rem; text-decoration: none; }
.linklike { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.92rem; padding: 0.42rem 0.85rem; border-radius: 9px; transition: color .18s, background .18s; }
.linklike:hover { color: var(--text); background: rgba(148,163,184,0.09); }

/* ── Status pills ────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.22rem 0.7rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--ok); background: rgba(52, 211, 153, 0.11); border: 1px solid rgba(52, 211, 153, 0.3); }
.pill.live .dot { animation: wb-pulse 1.8s ease-in-out infinite; }
.pill.draft { color: var(--warn); background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.28); }
.pill.failed { color: var(--danger); background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.28); }
.pill.neutral { color: var(--muted); background: rgba(148, 163, 184, 0.09); border: 1px solid var(--border-strong); }

@keyframes wb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* ── Stat cards ──────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.1rem; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.05rem 1.2rem; position: relative; overflow: hidden;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: wb-fade-up .45s ease both;
}
.stat-card::after {
  content: ""; position: absolute; top: 0; left: 1.2rem; right: 1.2rem; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent);
}
.stat-card .stat-label { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-top: 0.25rem; line-height: 1.1; }
.stat-card .stat-sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }

/* ── Progress bars ───────────────────────────────────────────────── */
.progress { margin: 0.6rem 0 0.9rem; }
.progress .progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.45rem; }
.progress .progress-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.progress .progress-value { font-size: 0.85rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.progress-track {
  height: 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.13);
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  background-size: 200% 100%;
  animation: wb-shimmer 2.4s linear infinite;
}
.progress-fill.ok { background: linear-gradient(90deg, #059669, var(--ok)); box-shadow: 0 0 12px rgba(52, 211, 153, 0.45); }
.progress-fill.warn { background: linear-gradient(90deg, #d97706, var(--warn)); box-shadow: 0 0 12px rgba(251, 191, 36, 0.4); }
@keyframes wb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Indeterminate variant (AI building) */
.progress-track.indeterminate .progress-fill {
  width: 38%; animation: wb-indeterminate 1.4s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes wb-indeterminate {
  0% { margin-left: -40%; } 100% { margin-left: 105%; }
}

/* ── Setup checklist ─────────────────────────────────────────────── */
.checklist { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.checklist li { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.92rem; }
.checklist li .check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: transparent;
}
.checklist li.done { color: var(--text); }
.checklist li.done .check { background: rgba(52, 211, 153, 0.15); border-color: var(--ok); color: var(--ok); }

/* ── Wizard steps ────────────────────────────────────────────────── */
.wizard-steps { max-width: 560px; margin: 0 auto 1.3rem; }
.wizard-steps .steps-labels { display: flex; justify-content: space-between; margin-bottom: 0.55rem; }
.wizard-steps .step-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.wizard-steps .step-label.active { color: var(--accent-light); }
.wizard-steps .step-label.done { color: var(--ok); }
.wizard-steps .steps-track { display: flex; gap: 6px; }
.wizard-steps .steps-seg { flex: 1; height: 5px; border-radius: 999px; background: rgba(148, 163, 184, 0.13); overflow: hidden; }
.wizard-steps .steps-seg .seg-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent-2)); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); transition: width .8s cubic-bezier(.22, 1, .36, 1); }
.wizard-steps .steps-seg.done .seg-fill, .wizard-steps .steps-seg.active .seg-fill { width: 100%; }

/* ── Charts ──────────────────────────────────────────────────────── */
.chart-card .chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.chart-card .chart-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.chart-card .chart-meta { font-size: 0.8rem; color: var(--muted); }
.wb-chart { width: 100%; display: block; }
.wb-chart-empty {
  display: flex; align-items: center; justify-content: center; height: 120px;
  color: var(--muted); font-size: 0.85rem; border: 1px dashed var(--border-strong);
  border-radius: 10px; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(148,163,184,0.03) 10px 20px);
}

/* ── Timeline (deploys) ──────────────────────────────────────────── */
.timeline { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.timeline li { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; align-self: center; background: var(--muted); }
.timeline .t-dot.live { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.timeline .t-dot.failed { background: var(--danger); box-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }
.timeline .t-dot.pending { background: var(--warn); animation: wb-pulse 1.6s infinite; }
.timeline .t-main { flex: 1; }
.timeline .t-time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* ── Pricing ─────────────────────────────────────────────────────── */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.price-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.3rem; text-align: center; position: relative;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.price-card:hover { transform: translateY(-3px); border-color: rgba(96, 165, 250, 0.4); box-shadow: 0 14px 36px rgba(0,0,0,0.35), var(--glow); }
.price-card.featured { border-color: rgba(96, 165, 250, 0.45); box-shadow: 0 0 0 1px rgba(59,130,246,0.2), var(--glow); }
.price-card .plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-2), var(--accent-deep)); color: #fff;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.28rem 0.8rem; border-radius: 999px; box-shadow: var(--glow); white-space: nowrap;
}
.price-card h3 { margin: 0.3rem 0 0.2rem; font-size: 1.05rem; }
.price-card .price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; margin: 0.35rem 0 0.1rem; }
.price-card .price small { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.price-card .plan-desc { color: var(--muted); font-size: 0.88rem; margin: 0.2rem 0 1.1rem; }
.price-card .btn { width: 100%; }

/* ── Hero (home page) ────────────────────────────────────────────── */
.hero { text-align: center; padding: 3.5rem 1rem 2.5rem; max-width: 640px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0.8rem 0;
  background: linear-gradient(120deg, #f0f6ff 30%, var(--accent-light) 70%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-light); background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3); padding: 0.35rem 0.9rem; border-radius: 999px;
}
.hero p { color: var(--muted); font-size: 1.12rem; line-height: 1.6; }
.hero .hero-actions { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1.6rem; }

/* ── AI building loader ──────────────────────────────────────────── */
.build-hero { text-align: center; padding: 2.2rem 1.4rem; }
.build-orb {
  width: 74px; height: 74px; margin: 0 auto 1.4rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent-deep) 70%);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.5), 0 0 90px rgba(59, 130, 246, 0.25);
  animation: wb-orb 2.6s ease-in-out infinite;
  position: relative;
}
.build-orb::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1.5px solid rgba(96, 165, 250, 0.35); border-top-color: transparent;
  animation: wb-spin 1.6s linear infinite;
}
@keyframes wb-orb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes wb-spin { to { transform: rotate(360deg); } }
.build-status { color: var(--muted); min-height: 1.4em; transition: opacity .3s; }

/* ── Tables ──────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table thead { background: rgba(148, 163, 184, 0.05); }
.admin-table th, .admin-table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: rgba(59, 130, 246, 0.05); }
.admin-table th { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; }

/* ── Tab filters (logs) ──────────────────────────────────────────── */
.tab-row { display: flex; gap: 0.4rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.tab-row a {
  padding: 0.4rem 0.95rem; border-radius: 999px; font-size: 0.86rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--border-strong); text-decoration: none;
  transition: all .16s;
}
.tab-row a:hover { color: var(--text); border-color: rgba(96, 165, 250, 0.4); }
.tab-row a.active { color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent-deep)); border-color: transparent; box-shadow: var(--glow); }

/* ── Page headers ────────────────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head .page-sub { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0; }

/* ── Token balance badge ─────────────────────────────────────────── */
.tok-badge {
  position: fixed; top: 3.6rem; right: 1rem; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; white-space: nowrap;
  text-decoration: none; cursor: pointer; transition: transform .15s ease;
  background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.35);
  color: #7cb0ff;
}
.tok-badge .tok-badge-icon { font-size: 0.95rem; }
.tok-badge[data-state="low"] {
  background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.4); color: #fbbf24;
}
.tok-badge[data-state="zero"] {
  background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.4); color: #f87171;
}
.tok-badge.tok-badge-pulse { transform: scale(1.06); }

/* ── Mobile bottom nav ───────────────────────────────────────────── */
.wb-mobile-nav { display: none; }
.wb-mobile-tabform { flex: 1; display: flex; }
.wb-mobile-tabform .wb-mobile-tab { width: 100%; }
@media (max-width: 1024px) {
  .topnav .navlinks { display: none; }
  .wb-mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(9, 12, 20, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); }
  .wb-mobile-tab { flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; color: #718096; text-decoration: none;
    font-size: 0.58rem; text-transform: uppercase; font-weight: 700;
    letter-spacing: 0.05em; background: none; border: 0; cursor: pointer;
    transition: color .18s; }
  .wb-mobile-tab .icon { font-size: 1.15rem; }
  .wb-mobile-tab:hover { color: var(--accent-light); }
  .wb-mobile-tab.active { color: var(--accent); }
  .container { padding-bottom: 76px; }
  .credit { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}

/* ── Per-site dashboard sidebar (desktop) ────────────────────────── */
.site-shell { display: flex; margin: -2rem -1.4rem; min-height: calc(100vh - 130px); }
.site-sidebar { width: 210px; flex-shrink: 0; background: rgba(13, 17, 28, 0.6);
  border-right: 1px solid var(--border); padding: 1.1rem 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.site-sidebar-title { padding: 0 1.1rem 1rem; font-weight: 700; font-family: var(--font-display);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav-item, .site-nav-group summary { display: block; padding: 0.66rem 1.1rem; color: var(--muted);
  text-decoration: none; cursor: pointer; list-style: none; border-radius: 0 999px 999px 0;
  margin-right: 0.6rem; font-size: 0.94rem; transition: color .16s, background .16s; }
.site-nav-group summary::-webkit-details-marker { display: none; }
.site-nav-item:hover, .site-nav-group summary:hover { color: var(--text); background: rgba(148, 163, 184, 0.07); }
.site-nav-group summary::after { content: "▸"; float: right; color: var(--muted); transition: transform .2s; }
.site-nav-group[open] summary::after { content: "▾"; }
.site-nav-item.active { background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.05));
  border-left: 3px solid var(--accent); color: var(--text);
  font-weight: 600; padding-left: calc(1.1rem - 3px); }
.site-nav-subitem { display: block; padding: 0.5rem 1.1rem 0.5rem 2.1rem; color: var(--muted);
  text-decoration: none; border-radius: 0 999px 999px 0; margin-right: 0.6rem;
  font-size: 0.9rem; transition: color .16s, background .16s; }
.site-nav-subitem:hover { color: var(--text); background: rgba(148, 163, 184, 0.07); }
.site-nav-subitem.active { background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.05));
  border-left: 3px solid var(--accent); color: var(--text);
  font-weight: 600; padding-left: calc(2.1rem - 3px); }
.site-main { flex: 1; padding: 2rem 1.6rem; min-width: 0; }

@media (max-width: 1024px) {
  .site-shell { flex-direction: column; margin: 0; }
  .site-sidebar { display: none; }
  .site-main { padding: 1.2rem; }
}

/* ── Mobile "More" drawer ────────────────────────────────────────── */
.wb-more-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1070;
  opacity: 0; pointer-events: none; transition: opacity .25s; }
.wb-more-overlay.active { opacity: 1; pointer-events: auto; }
.wb-more-drawer { position: fixed; left: 0; right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 1080;
  background: rgba(10, 13, 22, 0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 18px 18px 0 0; padding: 8px 1rem 1.2rem;
  transform: translateY(110%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  pointer-events: none; }
.wb-more-drawer.open { transform: translateY(0); pointer-events: auto; }
.wb-more-handle { width: 40px; height: 4px; border-radius: 2px; background: #2d3748; margin: 4px auto 12px; }
.wb-more-tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }
.wb-more-tile { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px 8px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center;
  transition: all .16s; }
.wb-more-tile:hover { background: #1a1e2e; color: var(--text); }
.wb-more-tile.active { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35);
  color: var(--accent); }
.wb-more-logout-form { margin-top: 0.6rem; }
.wb-more-tile-logout { width: 100%; flex-direction: row; font-size: .8rem;
  color: var(--danger); border-color: rgba(248,113,113,.28); background: rgba(248,113,113,.08); }
.wb-more-tile-logout:hover { background: rgba(248,113,113,.15); color: var(--danger); }
@media (min-width: 1025px) {
  .wb-more-overlay, .wb-more-drawer { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Studio (drag-and-drop draft designer) ───────────────────────── */
.wb-studio-wrap { position: relative; height: calc(100vh - 220px); min-height: 480px; }
.wb-studio-wrap #wb-canvas {
  width: 100%; height: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
#wb-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 90%);
  background: rgba(10, 13, 22, 0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; overflow-y: auto; z-index: 40;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
}
#wb-panel .wb-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
#wb-panel .wb-panel-head h3 { margin: 0; }
#wb-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 1200;
  background: rgba(13, 16, 23, 0.97); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 0.6rem 1.1rem; font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.wb-studio-note { display: none; }
@media (max-width: 1024px) {
  .wb-studio-note { display: block; }
}
