:root {
  color-scheme: dark;
  --bg: #0c0d0f;
  --tile: #111214;
  --tile-2: #14161a;
  --paper: #f2f2ec;
  --paper-ink: #1e2520;
  --paper-muted: #505850;
  --paper-rule: #cfd3ca;
  --ink: #f0f1f3;
  --muted: #9b9fa8;
  --stroke: #262830;
  --mint: #afddd1;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --r-outer: 16px;
  --r-inner: 8px;

  --font-display: 'LeanLab Compact', 'Bricolage Grotesque', Geist, sans-serif;
  --font-ui: Geist, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; min-width: 0; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
*:focus-visible { outline: 2px solid #d5dcfa; outline-offset: 2px; }
.hidden { display: none !important; }

.shell {
  max-width: 1040px; margin: 0 auto;
  padding: 12px 14px 86px;
  display: flex; flex-direction: column; gap: var(--s1);
}

/* Lightweight inline brand row (replaces bulky sticky header) */
.mini-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s1);
  padding: 0 2px 2px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 32px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--paper); line-height: 1; }
.brand-tag { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.why-pill {
  min-height: 30px; padding: 0 10px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--stroke); background: transparent;
  display: inline-flex; align-items: center;
}

/* Mode Tile */
.mode-tile {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--tile); border: 1px solid var(--stroke); border-radius: var(--r-outer);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.ll-wave { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.42; pointer-events: none; }
.mode-top h1 { font-size: 20px; color: var(--paper); }
.mode-top p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  background: rgba(12, 13, 15, 0.86); border: 1px solid #333540; border-radius: 10px; padding: 4px;
}
.tab-btn {
  min-height: 40px; background: transparent; border: none; color: #b7bac4;
  padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn[aria-selected="true"] { background: var(--paper); color: var(--paper-ink); }
.tab-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(175, 221, 209, 0.22); color: var(--mint);
}
.tab-btn[aria-selected="true"] .tab-badge { background: rgba(30, 37, 32, 0.16); color: var(--paper-ink); }

/* Main Bento Stack */
.panel-stack { display: flex; flex-direction: column; gap: var(--s1); }
.section-tile {
  background: var(--tile-2); border: 1px solid var(--stroke); border-radius: var(--r-outer);
  padding: 12px 14px;
}
.section-tile.aura-wrap {
  position: relative; overflow: hidden; isolation: isolate; background: #4e5370;
}
.aura {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 18% 96%, #bed9ed 0, transparent 48%),
    radial-gradient(ellipse at 86% 88%, #ef9f8a 0, transparent 42%),
    radial-gradient(ellipse at 55% 108%, #f8dcac 0, transparent 46%);
  filter: blur(22px); transform: scale(1.12);
}

.group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin-bottom: 8px; }
.group-head h2 { font-size: 16px; color: var(--paper); }
.group-sub { font-size: 11.5px; color: rgba(242, 242, 236, 0.78); margin-top: 2px; display: block; }

.car-nav { display: flex; gap: 6px; flex: none; }
.car-btn {
  width: 32px; height: 32px; border-radius: var(--r-inner);
  background: rgba(17, 18, 20, 0.72); border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--paper); font-size: 16px; cursor: pointer; display: grid; place-items: center;
}

.carousel {
  display: flex; gap: var(--s1); overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.car-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.car-dot {
  width: 6px; height: 6px; border-radius: 99px; border: none; padding: 0;
  background: rgba(242, 242, 236, 0.35); cursor: pointer; transition: width 160ms ease, background 160ms ease;
}
.car-dot[aria-current="true"] { width: 18px; background: var(--paper); }

/* Compact Cloud Set Cards */
.card {
  flex: 0 0 244px; scroll-snap-align: start;
  background: var(--paper); color: var(--paper-ink);
  border-radius: 10px; overflow: hidden; border: 2px solid transparent;
  box-shadow: 0 8px 20px rgba(18, 20, 32, 0.26);
  display: flex; flex-direction: column;
}
.card.active { border-color: var(--paper-ink); box-shadow: 0 0 0 2px var(--mint), 0 10px 22px rgba(18, 20, 32, 0.32); }
.card-media {
  position: relative; aspect-ratio: 2 / 1; background: #e4e4dc; border-bottom: 1px solid var(--paper-rule);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-code { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: rgba(30, 37, 32, 0.22); }
.media-hint { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(80, 88, 80, 0.72); }
.media-tag {
  position: absolute; top: 8px; left: 8px; font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(242, 242, 236, 0.92); color: var(--paper-ink); border: 1px solid var(--paper-rule);
  padding: 2px 6px; border-radius: 3px;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--paper-ink); }
.card-desc { font-size: 11.5px; color: var(--paper-muted); line-height: 1.38; flex: 1; }
.price-block { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--paper-rule); }
.price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.p-now { font-family: var(--font-mono); font-size: 15px; font-weight: 800; color: var(--paper-ink); }
.p-was { font-family: var(--font-mono); font-size: 11px; color: var(--paper-muted); text-decoration: line-through; }
.p-save { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--paper-muted); border-left: 1px solid var(--paper-rule); padding-left: 6px; }
.card-foot { padding: 0 12px 12px; }
.add-btn, .stepper { width: 100%; height: 40px; border-radius: var(--r-inner); background: #171a1e; color: var(--paper); border: none; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.s-btn { height: 100%; background: transparent; border: none; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.s-qty { text-align: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }

/* Bottom-Drawer Trigger Bar (replaces collapsible accordion) */
.addon-trigger {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--tile-2); border: 1px solid var(--stroke); border-radius: var(--r-outer);
  min-height: 52px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color 140ms ease, background 140ms ease;
}
.addon-trigger:hover { border-color: #3f4350; background: #17191f; }
.addon-trigger strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--paper); }
.addon-trigger > div > span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.addon-trigger-icon {
  width: 30px; height: 30px; border-radius: 99px; flex: none;
  background: #1d2028; border: 1px solid #323540; color: var(--mint);
  font-family: var(--font-mono); font-size: 13px; display: grid; place-items: center;
}
.addon-drawer-body { display: flex; flex-direction: column; gap: 10px; }
.sub-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.addon-grid { display: grid; grid-template-columns: 1fr; gap: var(--s1); }
.addon-card {
  background: #181a20; border: 1px solid #282a33; border-radius: 10px;
  padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.addon-card.active { border-color: var(--mint); background: #1a2024; }
.addon-title { font-size: 13px; font-weight: 700; color: var(--paper); }
.addon-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.addon-price { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.addon-price .p-now { color: var(--paper); font-size: 13px; }
.addon-price .p-was { color: var(--muted); font-size: 10.5px; }
.addon-price .p-save { background: rgba(175, 221, 209, 0.16); color: var(--mint); }
.p-tier { font-family: var(--font-mono); font-size: 10.5px; color: #f8dcac; }
.addon-stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.addon-sbtn {
  width: 36px; height: 36px; border-radius: var(--r-inner);
  background: var(--paper); color: var(--paper-ink); border: none;
  font-size: 16px; font-weight: 700; cursor: pointer; display: grid; place-items: center;
}
.addon-sbtn.minus { background: #262830; color: var(--ink); }

/* ==========================================================================
   FLOATING DYNAMIC ISLAND NAV (Thumb-Zone)
   ========================================================================== */
.island-wrap {
  position: fixed; bottom: 16px; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.island {
  pointer-events: auto;
  background: rgba(17, 18, 22, 0.94); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; gap: 6px;
  max-width: 100%;
}
.isl-home {
  width: 42px; height: 42px; border-radius: 999px;
  background: #1c1f27; border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid; place-items: center; flex: none;
}
.isl-home svg { width: 22px; height: 24px; display: block; }
.isl-bot {
  height: 42px; padding: 0 14px; border-radius: 999px;
  background: #1c1f27; border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.bot-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--mint); }
.isl-cart {
  height: 42px; padding: 0 16px; border-radius: 999px;
  background: var(--paper); color: var(--paper-ink); border: none;
  font-family: var(--font-mono); font-size: 13px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.isl-count {
  background: var(--paper-ink); color: var(--mint);
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
}

/* ==========================================================================
   SLIDE-UP BOTTOM SHEETS (Smart Bot & Checkout)
   ========================================================================== */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(4px);
}
@keyframes sheetUp {
  from { transform: translate(-50%, 28px); opacity: 0.6; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 50;
  width: min(520px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--tile); border: 1px solid var(--stroke);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6);
  animation: sheetUp 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: #3a3d48; margin: 0 auto 2px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 19px; color: var(--paper); }
.sheet-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 99px; flex: none;
  background: #1d2028; border: 1px solid #333642; color: var(--ink); cursor: pointer;
}

/* Smart Helper Bot UI */
.bot-log { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.bot-msg {
  background: #181a21; border: 1px solid #282b34; border-radius: 12px;
  padding: 12px; font-size: 13px; color: var(--ink); line-height: 1.48;
}
.bot-msg.user { background: var(--paper); color: var(--paper-ink); align-self: flex-end; font-weight: 600; }
.bot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bot-act-btn {
  padding: 7px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
  background: var(--paper); color: var(--paper-ink); border: none;
}
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px solid var(--stroke); }
.bot-chip {
  padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: #191b22; border: 1px solid #323540; color: var(--ink);
}
.bot-chip:hover { border-color: var(--mint); }

/* Checkout Sheet Items & Fields */
.cart-items { display: flex; flex-direction: column; gap: 8px; }
.cart-empty { font-size: 13px; color: var(--muted); padding: 14px; text-align: center; background: #16181e; border-radius: 10px; }
.cart-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #171920; border: 1px solid #272933; border-radius: 10px; padding: 10px 12px;
}
.cart-row strong { display: block; font-size: 13px; color: var(--paper); }
.cart-row small { font-family: var(--font-mono); font-size: 11px; color: var(--mint); }

.checkout-fields { display: flex; flex-direction: column; gap: 8px; }
.grid-3, .grid-2 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.inp {
  min-height: 42px; background: #181a20; border: 1px solid #2e3038; border-radius: var(--r-inner);
  padding: 0 12px; font-size: 13px; width: 100%;
}
.sheet-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--stroke); padding-top: 12px; }
.foot-row { display: flex; align-items: baseline; justify-content: space-between; }
.foot-label { font-size: 13px; color: var(--muted); }
.foot-val { text-align: right; }
.foot-val strong { font-family: var(--font-mono); font-size: 19px; color: var(--paper); display: block; }
.foot-val small { font-family: var(--font-mono); font-size: 11px; color: var(--mint); }
.foot-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn-sec, .btn-pri { min-height: 44px; border-radius: var(--r-inner); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-sec { background: #1d2028; color: var(--ink); border: 1px solid #393b46; }
.btn-pri { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--paper); }
.btn-sec:disabled, .btn-pri:disabled { opacity: 0.35; cursor: not-allowed; }
.toast { font-size: 12px; color: var(--mint); min-height: 14px; text-align: center; }

@media (min-width: 768px) {
  .shell { padding: var(--s3) var(--s3) 112px; }
  .mode-tile { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--s3); }
  .tabs { min-width: 320px; }
  .section-tile { padding: var(--s3); }
  .carousel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
  .card { flex: none; }
  .car-nav, .car-dots { display: none; }
  .addon-grid, .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .carousel { scroll-behavior: auto; } }
