/* =====================================================================
   ForaStack: application shell (/dashboard and /admins)
   - Dashboard: light sidebar, bottom nav on phones.
   - Admin (.shell-admin): ink sidebar in both themes, so the area is unmistakable.
   ===================================================================== */

.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-3) var(--s-4);
  overflow-y: auto; z-index: 50;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-3) var(--s-4); }
.nav { display: grid; gap: 2px; }
.nav-group { margin-top: var(--s-4); }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 0 var(--s-3) var(--s-2); }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 var(--s-3);
  border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-weight: 500; font-size: var(--fs-base);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item .i { color: var(--text-3); transition: color var(--dur); }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover .i { color: var(--text); }
.nav-item.is-active { background: var(--ink-900); color: var(--white); }
.nav-item.is-active .i { color: var(--volt-400); }
[data-theme="dark"] .nav-item.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-item.is-soon { pointer-events: none; opacity: .55; }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: grid; gap: var(--s-3); padding-top: var(--s-4); }

.plan-card { border-radius: var(--r-md); padding: var(--s-4); background: var(--ink-900); color: var(--white); position: relative; overflow: hidden; }
.plan-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 245, 66, .35), transparent 70%); }
.plan-card .eyebrow { color: var(--ink-400); }
.plan-card strong { display: block; font-size: var(--fs-lg); letter-spacing: -0.02em; margin: 4px 0 2px; }
.plan-card p { font-size: var(--fs-xs); color: var(--ink-300); }
[data-theme="dark"] .plan-card { background: var(--surface-3); border: 1px solid var(--border-strong); }

/* Admin sidebar */
.shell-admin .sidebar { background: var(--ink-950); border-right-color: var(--ink-850); color: var(--ink-300); }
.shell-admin .sidebar .brand { color: var(--white); }
.shell-admin .nav-label { color: var(--ink-500); }
.shell-admin .nav-item { color: var(--ink-300); }
.shell-admin .nav-item .i { color: var(--ink-500); }
.shell-admin .nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--white); }
.shell-admin .nav-item:hover .i { color: var(--ink-200); }
.shell-admin .nav-item.is-active { background: rgba(255, 255, 255, .07); color: var(--white); box-shadow: inset 2px 0 0 var(--volt-400); }
.shell-admin .nav-item.is-active .i { color: var(--volt-400); }
.shell-admin .nav-item .badge-soon { border-color: var(--ink-700); color: var(--ink-500); }
.shell-admin .admin-id { display: flex; gap: 10px; align-items: center; padding: var(--s-3); border-radius: var(--r-sm); background: rgba(255, 255, 255, .04); border: 1px solid var(--ink-850); }
.shell-admin .admin-id strong { color: var(--white); font-size: var(--fs-sm); display: block; }
.shell-admin .admin-id span { font-size: var(--fs-xs); color: var(--ink-400); }
.shell-admin .avatar { background: var(--volt-400); color: var(--ink-900); }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 64px;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; font-size: var(--fs-base); color: var(--text-2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title b { color: var(--text); font-weight: 650; }
.topbar-title .sep { color: var(--ink-300); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.user-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: var(--r-full); background: none; }
.user-btn:hover { background: var(--surface-3); }
.user-btn .user-name { font-weight: 600; font-size: var(--fs-sm); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { width: 100%; max-width: 1200px; margin: 0 auto; padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 32px) var(--s-16); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-8); }
.page-head h1 { font-size: clamp(1.5rem, 1.2vw + 1.1rem, 2rem); letter-spacing: var(--tracking-tighter); font-weight: 680; }
.page-head p { color: var(--text-2); margin-top: 6px; }
.section-title { font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.015em; margin-bottom: var(--s-4); }

/* Welcome hero (dashboard home) */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px);
  background: radial-gradient(600px 300px at 100% 0%, rgba(200, 245, 66, .22), transparent 65%), var(--ink-900);
  color: var(--white);
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero > * { position: relative; }
.hero .eyebrow { color: var(--ink-400); }
.hero h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2.25rem); letter-spacing: var(--tracking-tighter); margin-top: var(--s-2); }
.hero p { color: var(--ink-300); margin-top: var(--s-2); max-width: 520px; }
.hero-balance { font-family: var(--font-sans); font-feature-settings: "tnum", "lnum"; font-size: clamp(2rem, 3vw + 1rem, 3rem); font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hero-balance small { font-size: .45em; color: var(--ink-400); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
[data-theme="dark"] .hero { background: radial-gradient(600px 300px at 100% 0%, rgba(200, 245, 66, .16), transparent 65%), var(--surface-2); border: 1px solid var(--border); }

.step { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-2); }
.step.is-done .step-num { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.step h4 { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.01em; }
.step p { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.step .btn { margin-left: auto; flex: none; }

/* ---------- Mobile ---------- */
.menu-toggle { display: none; }
.scrim { display: none; }
.bottom-nav { display: none; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 284px; transform: translateX(-102%); transition: transform 240ms var(--ease); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 45; opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease); }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 720px) {
  .shell-user .content { padding-bottom: 104px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    height: 64px; padding: 6px; border-radius: 18px;
    background: color-mix(in srgb, var(--ink-900) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
  }
  .bottom-nav a { display: grid; place-items: center; gap: 2px; align-content: center; border-radius: 12px; color: var(--ink-400); text-decoration: none; font-size: 10.5px; font-weight: 600; }
  .bottom-nav a.is-active { color: var(--ink-900); background: var(--volt-400); }
  .bottom-nav a.is-soon { opacity: .45; pointer-events: none; }
  [data-theme="dark"] .bottom-nav { background: color-mix(in srgb, var(--surface-3) 94%, transparent); border: 1px solid var(--border-strong); }
  .user-btn .user-name { display: none; }
  .topbar { height: 58px; }
  .page-head { margin-bottom: var(--s-6); }
  .step { flex-wrap: wrap; }
  .step .btn { margin-left: 44px; }
}

/* ---------- Wallet & funding ---------- */
.amount-input { position: relative; }
.amount-prefix { position: absolute; left: 16px; font-family: var(--font-sans); font-size: 28px; color: var(--text-3); pointer-events: none; }
.input-amount { height: 72px; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; padding-left: 44px; }
.chip-amount.is-selected { background: var(--ink-900); color: var(--white); border-color: var(--ink-900); }
[data-theme="dark"] .chip-amount.is-selected { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.quote-kv { grid-template-columns: 1fr auto; row-gap: var(--s-3); }
.quote-kv dd { text-align: right; }
.deposit-wrap { max-width: 620px; margin: 0 auto; }
.deposit-card .card-body { padding: var(--s-8); }
.deposit-meta { display: block; }
.deposit-meta .kv { grid-template-columns: 1fr auto; }
.deposit-meta .kv dd { text-align: right; }
.poll-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--volt-500); margin-right: 6px; animation: pulse 2s infinite; box-shadow: 0 0 0 0 rgba(200, 245, 66, .6); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(200, 245, 66, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 245, 66, 0); } }
.hero .btn-ghost { --btn-fg: var(--white); } .hero .btn-ghost:hover { --btn-bg: rgba(255,255,255,.08); }

/* =====================================================================
   Storefront in the dashboard (Phase 6): browse, product page, routes
   ===================================================================== */
.shop-hero { position: relative; overflow: hidden; display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr) auto; align-items: end; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); color: var(--white);
  background: radial-gradient(640px 320px at 100% 0%, rgba(200, 245, 66, .24), transparent 62%), radial-gradient(420px 260px at 0% 120%, rgba(200, 245, 66, .08), transparent 70%), var(--ink-900); }
.shop-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); pointer-events: none; }
.shop-hero > * { position: relative; }
.shop-hero .eyebrow { color: var(--volt-400); }
.shop-hero h1 { font-size: clamp(1.6rem, 2vw + 1rem, 2.5rem); letter-spacing: var(--tracking-tighter); line-height: 1.08; }
.shop-hero p { color: var(--ink-300); max-width: 540px; }
[data-theme="dark"] .shop-hero { background: radial-gradient(640px 320px at 100% 0%, rgba(200, 245, 66, .16), transparent 62%), var(--surface-2); border: 1px solid var(--border); }
.shop-search { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-2); height: 56px; padding: 0 6px 0 var(--s-4); border-radius: var(--r-md); background: var(--white); box-shadow: var(--shadow-lg); color: var(--ink-900); max-width: 760px; }
.shop-search .i { color: var(--ink-400); flex: none; }
.shop-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: var(--fs-base); color: var(--ink-900); outline: none; }
.shop-search input::placeholder { color: var(--ink-400); }
.shop-search:focus-within { box-shadow: var(--shadow-lg), var(--focus); }
.shop-balance { grid-row: 1; grid-column: 2; display: grid; justify-items: end; gap: 2px; text-align: right; }
.shop-balance .xs { color: var(--ink-400); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.shop-balance strong { font-size: var(--fs-xl); font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -0.03em; }
.shop-balance .link { color: var(--volt-400); font-size: var(--fs-sm); }
.chip-row { display: flex; gap: var(--s-2); overflow-x: auto; padding: var(--s-5) 0 var(--s-4); scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.is-active { background: var(--ink-900); color: var(--white); border-color: var(--ink-900); }
.chip.is-active .i { color: var(--volt-400); }
[data-theme="dark"] .chip.is-active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
[data-theme="dark"] .chip.is-active .i { color: var(--on-accent); }

.product-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: var(--s-3); }
.product-tile { display: flex; flex-direction: column; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); overflow: hidden; text-decoration: none; color: inherit; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
.product-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.product-tile:focus-visible { outline: none; box-shadow: var(--focus); }
.tile-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: radial-gradient(260px 160px at 85% 0%, rgba(200, 245, 66, .28), transparent 65%), var(--ink-900); }
.tile-art.has-image { background: var(--surface-3); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.tile-mono { font-family: var(--font-mono); font-weight: 600; font-size: 2.1rem; letter-spacing: -0.06em; color: var(--white); }
.tile-icon { position: absolute; right: 12px; bottom: 12px; width: 18px; height: 18px; color: var(--volt-400); }
.tile-region { position: absolute; left: 10px; top: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.tile-body { display: grid; gap: 4px; padding: var(--s-4); }
.tile-name { font-size: var(--fs-sm); line-height: 1.3; letter-spacing: -0.01em; }
.tile-price { margin-top: 6px; font-weight: 600; }
.tile-price .num { font-size: var(--fs-lg); letter-spacing: -0.02em; }
.pager-plain { display: flex; justify-content: center; align-items: center; gap: var(--s-4); margin-top: var(--s-6); }

.pdp { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); align-items: start; }
.pdp-info { display: grid; gap: var(--s-5); }
.pdp-art { aspect-ratio: 16 / 8; border-radius: var(--r-lg); display: grid; place-items: center; overflow: hidden; background: radial-gradient(520px 260px at 90% 0%, rgba(200, 245, 66, .3), transparent 62%), var(--ink-900); }
.pdp-art.has-image { background: var(--surface-3); }
.pdp-art img { width: 100%; height: 100%; object-fit: cover; }
.pdp-art .tile-mono { font-size: 4rem; }
.pdp-title { font-size: clamp(1.6rem, 1.5vw + 1rem, 2.25rem); letter-spacing: var(--tracking-tighter); line-height: 1.1; }
.region-panel { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); box-shadow: inset 4px 0 0 var(--volt-400); }
.region-panel strong { font-size: var(--fs-lg); letter-spacing: -0.01em; }
.pdp-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--text-2); }
.pdp-facts li { display: flex; align-items: center; gap: 8px; }
.pdp-facts .i { color: var(--accent-text); }
.pdp-desc { color: var(--text-2); line-height: 1.65; }
.pdp-more { border-top: 1px solid var(--border); padding-top: var(--s-4); }
.pdp-more summary { cursor: pointer; font-weight: 600; }
.pdp-more div { margin-top: var(--s-3); color: var(--text-2); line-height: 1.6; }
.pdp-buy { position: sticky; top: 84px; }
.buy-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.buy-step legend { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--s-3); padding: 0; }
.step-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-900); color: var(--volt-400); font-family: var(--font-mono); font-size: 12px; }
[data-theme="dark"] .step-dot { background: var(--accent); color: var(--on-accent); }
.variant-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.variant-card { position: relative; display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.variant-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.variant-card:hover { border-color: var(--text-3); }
.variant-card:has(input:checked) { border-color: var(--ink-900); box-shadow: inset 0 0 0 1px var(--ink-900); background: var(--volt-50); }
[data-theme="dark"] .variant-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-3); }
.variant-card:has(input:focus-visible) { box-shadow: var(--focus); }
.variant-card.is-off { opacity: .5; cursor: not-allowed; }
.variant-name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.25; }
.variant-price { font-size: var(--fs-sm); color: var(--text-2); }
.player-check { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.player-result { display: none; flex: 1 1 220px; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.player-result[class*="is-"] { display: flex; }
.player-result div { display: grid; gap: 2px; }
.player-result span { color: var(--text-3); font-size: var(--fs-xs); }
.player-result.is-valid { background: var(--success-soft); color: var(--success-text); }
.player-result.is-invalid { background: var(--danger-soft); color: var(--danger-text); }
.player-result.is-info, .player-result.is-busy { background: var(--surface-3); color: var(--text-2); }
.route-set { display: grid; gap: var(--s-2); }
.route-option { position: relative; display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.route-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.route-option:has(input:checked) { border-color: var(--ink-900); box-shadow: inset 0 0 0 1px var(--ink-900); }
[data-theme="dark"] .route-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.route-option:has(input:focus-visible) { box-shadow: var(--focus); }
.route-main, .route-side { display: grid; gap: 2px; }
.route-side { text-align: right; justify-items: end; }
.route-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
.route-name .i { color: var(--accent-text); }
.route-more { margin-top: var(--s-1); }
.route-more summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding: 6px 0; }
.route-more[open] summary { margin-bottom: var(--s-2); }
.route-more .route-option + .route-option { margin-top: var(--s-2); }
.buy-summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.buy-total { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.03em; }
.t-center { text-align: center; }
@media (max-width: 1100px) { .pdp { grid-template-columns: minmax(0, 1fr); } .pdp-buy { position: static; } }
@media (max-width: 720px) { .shop-hero { grid-template-columns: minmax(0, 1fr); } .shop-balance { grid-row: auto; grid-column: auto; justify-items: start; text-align: left; } .pdp-facts { grid-template-columns: 1fr; } .buy-summary { flex-direction: column; align-items: stretch; } }

/* =====================================================================
   Orders (Phase 7)
   ===================================================================== */
.buy-wallet { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: calc(-1 * var(--s-3)); }
.order-list { display: grid; }
.order-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); text-decoration: none; color: inherit; transition: background .15s; }
.order-row:first-child { border-top: 0; }
.order-row:hover { background: var(--surface-2); }
.order-main { display: grid; gap: 2px; min-width: 0; }
.order-main strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-side { display: grid; gap: 4px; justify-items: end; }
.order-layout { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: start; }
.order-summary { position: sticky; top: 84px; }
.order-hero { position: relative; display: flex; gap: var(--s-5); align-items: center; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-lg); background: var(--ink-900); color: var(--white); overflow: hidden; }
.order-hero h1 { font-size: clamp(1.4rem, 1.2vw + 1rem, 2rem); letter-spacing: var(--tracking-tighter); }
.order-hero p { color: var(--ink-300); margin-top: 4px; }
.order-hero .eyebrow { color: var(--ink-400); }
.order-hero-icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.order-hero-icon .i { width: 26px; height: 26px; }
.order-hero.is-completed, .order-hero.is-partially_completed { background: radial-gradient(520px 260px at 100% 0%, rgba(200, 245, 66, .35), transparent 62%), var(--ink-900); }
.order-hero.is-completed .order-hero-icon, .order-hero.is-partially_completed .order-hero-icon { background: var(--volt-400); color: var(--ink-900); }
.order-hero.is-refunded .order-hero-icon { background: rgba(120, 170, 255, .18); color: #a9c7ff; }
.order-hero.is-on_hold .order-hero-icon { background: rgba(255, 193, 94, .18); color: #ffc15e; }
.order-hero .poll-dot { position: absolute; right: 20px; top: 20px; }
[data-theme="dark"] .order-hero { background-color: var(--surface-2); border: 1px solid var(--border); }
.code-item { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.code-meta { display: grid; gap: 4px; min-width: 0; }
.code-value { font-size: var(--fs-lg); letter-spacing: .04em; word-break: break-all; color: var(--text-3); }
.code-value.is-revealed { color: var(--text); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: var(--s-2) var(--s-6) var(--s-5); display: grid; gap: var(--s-4); }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--s-3); position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: calc(-1 * var(--s-4)); width: 2px; background: var(--border); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--surface); border: 2px solid var(--ink-900); }
.timeline li:last-child .tl-dot { background: var(--volt-400); border-color: var(--ink-900); }
[data-theme="dark"] .tl-dot { border-color: var(--accent); }
@media (max-width: 1100px) { .order-layout { grid-template-columns: minmax(0, 1fr); } .order-summary { position: static; } }
@media (max-width: 720px) { .order-row { padding: var(--s-4); grid-template-columns: auto minmax(0, 1fr); } .order-side { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; justify-content: start; gap: var(--s-3); } .code-item { flex-direction: column; align-items: stretch; } }


/* =====================================================================
   Plans & subscription (Phase 8)
   ===================================================================== */
a.plan-card { display: block; text-decoration: none; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.plan-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
a.plan-card:focus-visible { outline: none; box-shadow: var(--focus); }
.list-price { color: var(--text-3); font-weight: 500; font-size: .85em; margin-left: 4px; text-decoration-thickness: 1px; }
.route-side .list-price, .variant-price .list-price { display: inline; }
.nowrap { white-space: nowrap; }

.plan-applied, .plan-upsell { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); margin-top: calc(-1 * var(--s-2)); }
.plan-applied { background: var(--accent-soft); color: var(--accent-text); }
.plan-upsell { border: 1px dashed var(--border-strong); color: var(--text-2); text-decoration: none; transition: border-color var(--dur), color var(--dur); }
.plan-upsell span { flex: 1; }
.plan-upsell .i:first-child { color: var(--accent-text); }
.plan-upsell:hover { border-color: var(--text-3); color: var(--text); }

/* Current plan hero */
.plan-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-8); align-items: end;
  padding: clamp(24px, 3vw, 36px); border-radius: var(--r-lg); color: var(--white);
  background: radial-gradient(560px 280px at 100% 0%, rgba(200, 245, 66, .14), transparent 62%), var(--ink-900); }
.plan-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); }
.plan-hero > * { position: relative; }
.plan-hero.is-paid { background: radial-gradient(620px 300px at 100% 0%, rgba(200, 245, 66, .32), transparent 60%), radial-gradient(380px 220px at 0% 120%, rgba(200, 245, 66, .1), transparent 70%), var(--ink-900); }
.plan-hero .eyebrow { color: var(--ink-400); }
.plan-hero h2 { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem); letter-spacing: var(--tracking-tighter); line-height: 1.05; }
.plan-hero h2 .badge { font-size: var(--fs-xs); letter-spacing: 0; }
.plan-hero-main > p { color: var(--ink-300); margin-top: var(--s-2); max-width: 520px; }
.plan-hero-main > p strong { color: var(--white); }
.plan-progress { margin-top: var(--s-6); height: 6px; border-radius: var(--r-full); background: rgba(255, 255, 255, .1); overflow: hidden; max-width: 460px; }
.plan-progress-bar { height: 100%; border-radius: inherit; background: var(--volt-400); box-shadow: 0 0 12px rgba(200, 245, 66, .5); }
.plan-progress-bar[data-w="0"] { width: 0%; }
.plan-progress-bar[data-w="5"] { width: 5%; }
.plan-progress-bar[data-w="10"] { width: 10%; }
.plan-progress-bar[data-w="15"] { width: 15%; }
.plan-progress-bar[data-w="20"] { width: 20%; }
.plan-progress-bar[data-w="25"] { width: 25%; }
.plan-progress-bar[data-w="30"] { width: 30%; }
.plan-progress-bar[data-w="35"] { width: 35%; }
.plan-progress-bar[data-w="40"] { width: 40%; }
.plan-progress-bar[data-w="45"] { width: 45%; }
.plan-progress-bar[data-w="50"] { width: 50%; }
.plan-progress-bar[data-w="55"] { width: 55%; }
.plan-progress-bar[data-w="60"] { width: 60%; }
.plan-progress-bar[data-w="65"] { width: 65%; }
.plan-progress-bar[data-w="70"] { width: 70%; }
.plan-progress-bar[data-w="75"] { width: 75%; }
.plan-progress-bar[data-w="80"] { width: 80%; }
.plan-progress-bar[data-w="85"] { width: 85%; }
.plan-progress-bar[data-w="90"] { width: 90%; }
.plan-progress-bar[data-w="95"] { width: 95%; }
.plan-progress-bar[data-w="100"] { width: 100%; }
.plan-progress-meta { display: flex; justify-content: space-between; max-width: 460px; margin-top: 8px; color: var(--ink-400); }
.plan-hero-side { display: grid; gap: var(--s-4); justify-items: end; }
.plan-hero-discount { display: grid; justify-items: end; line-height: 1; }
.plan-hero-discount .num { font-size: clamp(2.75rem, 4vw + 1rem, 4rem); font-weight: 600; letter-spacing: -0.06em; color: var(--volt-400); }
.plan-hero:not(.is-paid) .plan-hero-discount .num { color: var(--ink-400); }
.plan-hero-discount small { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-300); }
.plan-renew-toggle { min-width: 280px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); cursor: pointer; }
.switch-row > span:first-child { display: grid; gap: 2px; }
.switch-row strong { font-size: var(--fs-sm); }
.switch-row .xs { color: var(--ink-400); }
.plan-hero .switch input { background: rgba(255, 255, 255, .18); }
.plan-hero .switch input:checked { background: var(--volt-400); }
.plan-hero .switch input:checked::after { background: var(--ink-900); }
[data-theme="dark"] .plan-hero { background-color: var(--surface-2); border: 1px solid var(--border); }
[data-theme="dark"] .plan-hero:not(.is-paid) { background: radial-gradient(560px 280px at 100% 0%, rgba(200, 245, 66, .08), transparent 62%), var(--surface-2); }
[data-theme="dark"] .plan-hero.is-paid { background: radial-gradient(620px 300px at 100% 0%, rgba(200, 245, 66, .2), transparent 60%), var(--surface-2); }

/* Checkout */
.checkout-plan { box-shadow: inset 0 3px 0 var(--volt-400), var(--shadow-md); scroll-margin-top: 84px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); border-top: 1px solid var(--border); }
.checkout-summary { padding: var(--s-6); display: grid; gap: var(--s-5); align-content: start; }
.checkout-plan-name { display: flex; gap: var(--s-4); align-items: center; }
.checkout-plan-name strong { font-size: var(--fs-lg); letter-spacing: -0.02em; }
.checkout-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text-2); }
.checkout-notes li { display: flex; gap: 10px; align-items: flex-start; }
.checkout-notes .i { color: var(--accent-text); margin-top: 2px; flex: none; }
.checkout-notes strong { color: var(--text); }
.checkout-pay { padding: var(--s-6); display: grid; gap: var(--s-4); align-content: start; background: var(--surface-2); border-left: 1px solid var(--border); border-radius: 0 0 var(--r-lg) 0; }
.checkout-due { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.03em; }

/* Comparison */
.plans-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.plans-head .section-title { margin-bottom: 4px; }
.cycle-switch { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.cycle-switch label { position: relative; }
.cycle-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cycle-switch span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); transition: background var(--dur), color var(--dur); }
.cycle-switch em { font-style: normal; font-size: 11px; font-family: var(--font-mono); color: var(--accent-text); }
.cycle-switch input:checked + span { background: var(--ink-900); color: var(--white); }
.cycle-switch input:checked + span em { color: var(--volt-400); }
.cycle-switch input:focus-visible + span { box-shadow: var(--focus); }
[data-theme="dark"] .cycle-switch input:checked + span { background: var(--accent); color: var(--on-accent); }
[data-theme="dark"] .cycle-switch input:checked + span em { color: var(--on-accent); }

.plans-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }
.plan-tile { position: relative; display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.plan-tile.is-featured { border-color: var(--ink-900); box-shadow: inset 0 0 0 1px var(--ink-900), var(--shadow-md); }
.plan-tile.is-featured::before { content: ""; position: absolute; inset: -1px -1px auto; height: 4px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--volt-400); }
.plan-tile.is-current { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 140px); }
[data-theme="dark"] .plan-tile.is-featured { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-tile-head h3 { font-size: var(--fs-lg); letter-spacing: -0.02em; }
.plan-tile-head p { margin-top: 4px; }
.plan-discount { display: flex; align-items: baseline; gap: 8px; padding-bottom: var(--s-4); border-bottom: 1px solid var(--border); }
.plan-discount .num { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.plan-tile.is-featured .plan-discount .num, .plan-tile.is-current .plan-discount .num { color: var(--accent-text); }
.plan-discount .small { color: var(--text-2); }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price .num { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.035em; }
.plan-price-sub { margin-top: 2px; min-height: 18px; }
.cycle-view { display: none; gap: var(--s-3); }
.cycle-view.is-initial { display: grid; }
.plan-cta { margin-top: var(--s-2); }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); flex: 1; align-content: start; }
.plan-feats li { display: flex; gap: 10px; align-items: flex-start; }
.plan-feats .i { flex: none; margin-top: 2px; color: var(--accent-text); }
.plan-perks { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--border); padding-top: var(--s-3); }
.plan-perks div { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: var(--fs-sm); }
.plan-perks dt { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.plan-perks dd { margin: 0; font-weight: 600; }
.event-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.event-label .i { color: var(--text-3); }
.faq { border-top: 1px solid var(--border); padding-top: var(--s-3); }
.faq:first-of-type { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.faq p { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.6; }
@media (max-width: 900px) {
  .plan-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .plan-hero-side { justify-items: start; }
  .plan-hero-discount { justify-items: start; }
  .plan-renew-toggle { min-width: 0; width: 100%; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-pay { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); }
}
@media (max-width: 720px) { .cycle-switch { width: 100%; overflow-x: auto; scrollbar-width: none; } .cycle-switch span { padding: 0 10px; } }
.plans:has(#cy-monthly:checked) .cycle-view { display: none; }
.plans:has(#cy-monthly:checked) .cycle-view[data-cycle="monthly"] { display: grid; }
.plans:has(#cy-quarterly:checked) .cycle-view { display: none; }
.plans:has(#cy-quarterly:checked) .cycle-view[data-cycle="quarterly"] { display: grid; }
.plans:has(#cy-semiannual:checked) .cycle-view { display: none; }
.plans:has(#cy-semiannual:checked) .cycle-view[data-cycle="semiannual"] { display: grid; }
.plans:has(#cy-annual:checked) .cycle-view { display: none; }
.plans:has(#cy-annual:checked) .cycle-view[data-cycle="annual"] { display: grid; }


/* =====================================================================
   API keys & webhooks (Phase 9)
   ===================================================================== */
.mb-4 { margin-bottom: var(--s-4); }
.stat-link { text-decoration: none; color: inherit; transition: border-color var(--dur), box-shadow var(--dur); }
.stat-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat-of { font-size: .45em; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.key-reveal { box-shadow: inset 0 3px 0 var(--volt-400), var(--shadow-md); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 120px); }
.key-box { display: flex; align-items: center; gap: var(--s-3); padding: 10px 10px 10px 16px; border-radius: var(--r-md); background: var(--ink-900); color: var(--volt-400); }
.key-box code { flex: 1; min-width: 0; font-size: var(--fs-sm); word-break: break-all; letter-spacing: .01em; }
[data-theme="dark"] .key-box { background: var(--surface-3); border: 1px solid var(--border-strong); }
.key-list { display: grid; }
.key-row { border-top: 1px solid var(--border); }
.key-row:first-child { border-top: 0; }
.key-row summary { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-6); cursor: pointer; list-style: none; }
.key-row summary::-webkit-details-marker { display: none; }
.key-row summary:hover { background: var(--surface-2); }
.key-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.key-main .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }
.key-chev { color: var(--text-3); transition: transform var(--dur) var(--ease); flex: none; }
.key-row[open] .key-chev { transform: rotate(180deg); }
.key-row[open] summary { background: var(--surface-2); }
.key-edit { display: grid; gap: var(--s-4); padding: var(--s-5) var(--s-6); background: var(--surface-2); border-top: 1px dashed var(--border); }
.input-static { display: flex; align-items: center; height: var(--control-h); padding: 0 12px; border-radius: var(--r-sm); border: 1px dashed var(--border-strong); color: var(--text-2); }
.revoked-keys summary { cursor: pointer; }
.code-block { margin: 0; padding: var(--s-4); border-radius: var(--r-md); background: var(--ink-900); color: #e6e9ef; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.code-block code { font: inherit; color: inherit; }
[data-theme="dark"] .code-block { background: var(--ink-950); border: 1px solid var(--border); }
.code-scroll { max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.method { display: inline-block; min-width: 42px; font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.method-get { color: var(--info-text); } .method-post { color: var(--accent-text); } .method-delete { color: var(--danger-text); }
.event-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.event-check { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.event-check:has(input:checked) { border-color: var(--ink-900); background: var(--volt-50); }
[data-theme="dark"] .event-check:has(input:checked) { border-color: var(--accent); background: var(--surface-3); }
.event-check > span { display: grid; gap: 2px; }
.chip-row-tight { padding: 0; }
.delivery-list { display: grid; }
.delivery-row { border-top: 1px solid var(--border); }
.delivery-row summary { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-6); cursor: pointer; list-style: none; flex-wrap: wrap; }
.delivery-row summary::-webkit-details-marker { display: none; }
.delivery-row summary:hover, .delivery-row[open] summary { background: var(--surface-2); }
.delivery-meta { margin-left: auto; }
.delivery-body { padding: var(--s-4) var(--s-6) var(--s-5); background: var(--surface-2); display: grid; gap: var(--s-3); }
@media (max-width: 720px) { .key-row summary, .key-edit, .delivery-row summary, .delivery-body { padding-left: var(--s-4); padding-right: var(--s-4); } .delivery-meta { margin-left: 0; width: 100%; } }

/* Shop hero search (phones): input shrinks, button stays inside the bar (production audit). */
.shop-hero > * { min-width: 0; }
.shop-search input { width: 100%; }
@media (max-width: 480px) {
  .shop-search { height: 52px; padding-left: 12px; gap: 6px; }
  .shop-search .btn { padding: 0 14px; flex: none; }
  .shop-search input { font-size: 16px; } /* 16px stops iOS zooming into the field */
}

/* Onboarding steps on phones: number + text side by side, action below the text (D-109). */
@media (max-width: 720px) {
  .step { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--s-4); row-gap: var(--s-2); }
  .step .btn { grid-column: 2; justify-self: start; margin-left: 0; }
}

/* Catalog tiles on phones: two per row (storefront + dashboard), compact text (D-117). */
@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .product-grid .tile-body { padding: var(--s-3); }
  .product-grid .tile-region { left: 6px; top: 6px; font-size: 10.5px; }
  .product-grid .tile-price .num { font-size: var(--fs-md); }
}

/* ---- Support (D-121) ---- */
.help-card { display: flex; gap: var(--s-3); align-items: flex-start; color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.help-card > span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.help-card:hover { border-color: var(--ink-300); transform: translateY(-1px); }
.help-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.tick-list li { display: flex; gap: var(--s-2); align-items: flex-start; min-width: 0; }
.tick-list .icon { flex: none; margin-top: 3px; color: var(--accent-text); }
.support-list { list-style: none; margin: 0; padding: 0; }
.support-list > li + li { border-top: 1px solid var(--border); }
.support-item summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-5); cursor: pointer; list-style: none; }
.support-item summary::-webkit-details-marker { display: none; }
.support-item summary:hover { background: var(--surface-2); }
.support-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.support-body { padding: 0 var(--s-5) var(--s-4); }
.support-msg { white-space: normal; overflow-wrap: anywhere; color: var(--text-2); }
@media (max-width: 640px) {
    .support-item summary { grid-template-columns: minmax(0, 1fr) auto; padding: var(--s-3) var(--s-4); }
    .support-item summary .support-subject { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
    .support-item summary > .xs { grid-column: 1 / -1; }
    .support-body { padding: 0 var(--s-4) var(--s-4); }
}
