:root {
  --ink: #1B1812; --ink2: #2A251C; --ink3: #3A3326;
  --cream: #F8F5EC; --paper: #FFFFFF; --sand: #EFE6D2; --sand2: #FBF8F1;
  --line: #E3D7BD; --line2: #C9B68C;
  --gold: #C6982E; --gold-lt: #E6C77E; --gold-dk: #7A5714; --gold-ink: #8E6420;
  --muted: #5E5647; --muted2: #6F6553; --body: #3D362B;
  --danger: #8A2E1F;
  --grad: linear-gradient(115deg, #EDD08E 0%, #C6982E 55%, #8E6420 100%);
  --grad-dk: linear-gradient(115deg, #D9B25C 0%, #B8871F 55%, #7A5714 100%);
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --sans: Poppins, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ink); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.shell { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; background: var(--cream); position: relative; overflow: hidden; }
.boot { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; min-width: 0; }

/* type */
.h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.02; }
.h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.goldtext { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.goldtext-dk { background: var(--grad-dk); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .2em; color: var(--gold-dk); text-transform: uppercase; }
.dark .kicker, .kicker.lt { color: var(--gold-lt); }
.lede { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0; }
.small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.label { font-size: 14px; font-weight: 600; }
.err { font-size: 13px; color: var(--danger); text-align: center; }

/* surfaces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.gold { border: 1.5px solid #D9B25C; }
.card.alert { border-color: #E3C6BC; }
.dark { background: var(--ink); color: var(--cream); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.inset { background: var(--sand2); border-radius: 12px; padding: 12px 14px; }
.dark .inset { background: var(--ink2); }

/* buttons */
.btn { min-height: 48px; border-radius: 999px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; text-align: center; }
.btn.primary { background: var(--grad); border: 0; color: var(--ink); font-weight: 700; font-size: 15px; min-height: 54px; }
.btn.darkbtn { background: var(--ink); color: var(--cream); border: 0; }
.btn.sm { min-height: 40px; font-size: 13px; padding: 0 14px; }
.btn.primary.sm { min-height: 42px; font-size: 13.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.dark .btn { background: transparent; color: var(--cream); border-color: #6B5A3A; }
.dark .btn.primary { background: var(--grad); color: var(--ink); border: 0; }
.btn[disabled], .btn.off { background: var(--line) !important; color: var(--muted2) !important; border: 0; }
.link { border: 0; background: none; padding: 0; min-height: 40px; color: var(--gold-dk); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; align-self: flex-start; }
.dark .link { color: var(--gold-lt); }
.proto { border: 0; background: none; color: #B8A984; font-size: 11px; text-decoration: underline; min-height: 32px; align-self: center; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dark .iconbtn, .hdr .iconbtn { background: transparent; border-color: #6B5A3A; color: var(--cream); }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip.on, .opt.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.opt { border-radius: 14px; border: 1px solid var(--line); background: var(--paper); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 56px; }
.opt b { font-size: 15px; } .opt span { font-size: 12px; line-height: 1.4; opacity: .85; }
.choice { text-align: left; min-height: 96px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); padding: 18px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.choice.dk { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.choice b { font-size: 17px; display: block; } .choice span { font-size: 13px; color: var(--muted); line-height: 1.45; } .choice.dk span { color: #D9CFB8; }
.check { width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--line2); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #D8CBAE; }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--gold-lt); }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.input, .textarea { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; font-size: 16px; background: var(--paper); color: var(--ink); }
.textarea { padding: 12px 14px; min-height: 90px; resize: vertical; font-size: 15px; line-height: 1.5; }
.pin { letter-spacing: .5em; font-size: 22px; text-align: center; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.tick input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--ink); }
.drop { min-height: 56px; border: 1.5px dashed var(--line2); border-radius: 14px; background: var(--sand2); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; position: relative; padding: 10px 12px; text-align: center; cursor: pointer; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
input[type=range] { width: 100%; accent-color: #B8871F; }

/* header, tabs, ads */
.hdr { background: var(--ink); color: var(--cream); padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hdr img { height: 40px; }
.hdr .hi { font-size: 17px; font-weight: 600; }
.hdr .phase { font-size: 12px; color: var(--gold-lt); }
.hdr .btn { min-height: 36px; font-size: 12px; font-weight: 500; padding: 0 14px; background: transparent; color: var(--cream); border-color: #6B5A3A; }
.tabs { flex-shrink: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--paper); border-top: 1px solid var(--line); height: 62px; }
.tabs button { border: 0; background: none; font-size: 10px; font-weight: 600; color: var(--muted2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.tabs button.on { color: var(--ink); }
.adbar { flex-shrink: 0; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 14px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); text-decoration: none; }
.adbar .ic { width: 36px; height: 36px; border-radius: 18px; border: 1px solid rgba(230,199,126,.45); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.adbar .t { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.adbar .s { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.adbar .cta { flex-shrink: 0; min-height: 34px; padding: 0 12px 0 14px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.adbar .dots { flex-direction: column; gap: 3px; } .adbar .dots i { width: 4px; height: 4px; }
.dots { display: flex; gap: 4px; } .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(128,112,80,.45); } .dots i.on { background: currentColor; }

/* bits */
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: #5E4A1E; white-space: nowrap; }
.pill.dk { background: var(--ink); color: var(--gold-lt); }
.pill.gold { background: var(--gold-lt); color: var(--ink); }
.pill.mute { background: var(--ink3); color: #E9E1CF; }
.bar { height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, #EDD08E, #C6982E); }
.dark .bar { background: var(--ink3); }
.big { font-family: var(--display); font-size: 72px; line-height: .95; }
.proc-pill { padding: 6px 12px; border-radius: 999px; background: #2E281E; border: 1px solid #5A4A2C; font-size: 12px; font-weight: 500; color: #F2E6C8; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sand); border-radius: 999px; }
.seg button { min-height: 40px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 600; color: var(--body); }
.seg button.on { background: var(--ink); color: var(--cream); }
.tl { display: flex; gap: 12px; }
.tl .rail { width: 22px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl .rail i { width: 2px; background: var(--line); } .tl .rail i:first-child { height: 16px; } .tl .rail i:last-child { flex: 1; }
.tl .rail b { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--line2); background: var(--cream); flex-shrink: 0; }
.tl .rail b.due { background: var(--gold); border-color: var(--gold-ink); } .tl .rail b.done { background: var(--ink); border-color: var(--ink); }
.tl .body { flex: 1; padding: 8px 0 14px; display: flex; gap: 10px; align-items: flex-start; }
.tl .when { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--gold-dk); }
.tl .t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.tl .x { font-size: 13px; line-height: 1.5; color: var(--muted); }
.tl.past .body { opacity: .6; } .tl.isdone .t { text-decoration: line-through; }
.bubble { max-width: 86%; border-radius: 18px; padding: 12px 14px; font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--cream); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--body); }
.bubble img { border-radius: 10px; max-height: 180px; object-fit: cover; }
.logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.logos div { height: 60px; border: 1px solid var(--sand); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 6px; background: #fff; }
.logos img { max-height: 48px; }
.logos .wide { grid-column: span 2; }
.acc { border-radius: 16px; overflow: hidden; }
.acc > button { width: 100%; min-height: 54px; border: 0; background: none; text-align: left; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.acc .in { padding: 0 16px 16px; font-size: 13px; line-height: 1.65; color: var(--body); white-space: pre-line; }
.toast { position: absolute; left: 16px; right: 16px; bottom: 140px; background: var(--ink); color: var(--cream); padding: 14px 16px; border-radius: 16px; font-size: 14px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.sheet-bg { position: absolute; inset: 0; background: rgba(27,24,18,.55); z-index: 40; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--cream); border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* welcome */
.welcome { flex: 1; overflow-y: auto; background: var(--ink); color: var(--cream); padding: calc(40px + env(safe-area-inset-top)) 28px 28px; display: flex; flex-direction: column; gap: 20px; }
.welcome .h1 { font-size: 56px; line-height: .95; }
.welcome .outline { align-self: flex-start; border: 1px solid var(--gold-ink); border-radius: 999px; padding: 9px 18px; font-size: 11px; font-weight: 600; letter-spacing: .24em; color: var(--gold-lt); }
.welcome .bul { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #E9E1CF; }
.welcome .bul i { width: 6px; height: 6px; border-radius: 3px; background: var(--gold); }
.welcome .btn { background: transparent; color: var(--cream); border-color: #6B5A3A; }
.welcome .btn.primary { background: var(--grad); color: var(--ink); border: 0; }

@media (min-width: 481px) { body { padding: 0; } .shell { box-shadow: 0 0 60px rgba(0,0,0,.4); } }

/* shop */
.shdr { background: var(--ink); color: var(--cream); padding: calc(10px + env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.shdr .back { min-height: 40px; border: 1px solid #6B5A3A; border-radius: 999px; background: none; color: var(--cream); font-size: 12px; font-weight: 600; padding: 0 14px 0 8px; display: inline-flex; align-items: center; gap: 4px; }
.shdr img { height: 34px; }
.shdr .cart { position: relative; width: 44px; height: 44px; border-radius: 22px; border: 1px solid #6B5A3A; background: none; color: var(--cream); display: inline-flex; align-items: center; justify-content: center; }
.shdr .cart b { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; color: var(--ink); }
.pcard .ph { aspect-ratio: 1; position: relative; background: var(--sand); }
.pcard .ph img, .pcard .ph svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .ph .pill { position: absolute; left: 8px; top: 8px; }
.pcard .in { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.pcard .nm { font-size: 14px; font-weight: 600; line-height: 1.3; }
.price { font-size: 15px; font-weight: 700; } .price s { color: var(--muted2); font-weight: 500; font-size: 12px; margin-right: 4px; }
.soon { font-size: 12px; color: var(--muted); font-weight: 600; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; border-radius: 22px; background: var(--sand); }
.gallery > * { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: start; object-fit: cover; width: 100%; display: block; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.qty button { width: 40px; height: 40px; border: 0; background: none; font-size: 18px; font-weight: 600; }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }
.cartbar { flex-shrink: 0; background: var(--ink); color: var(--cream); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; }
.cartbar.empty { display: none; }

/* ---------- Shop on a bigger screen: a proper storefront, not a stretched phone.
   Only the shop/product/basket/order views get this — the rest of the app (booking,
   consultations, recovery plan) stays the phone-width layout, which still suits it. */
@media (min-width: 900px) {
  .shell.shell-shop { max-width: 1240px; }
  .shell.shell-shop .shdr { padding-left: 36px; padding-right: 36px; }
  .shell.shell-shop .shdr img { height: 30px; }
  .shell.shell-shop .pad { max-width: 980px; margin: 0 auto; padding: 32px 36px 48px; }
  .shell.shell-shop .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .shell.shell-shop .pcard .nm { font-size: 15px; }
  .shell.shell-shop .pprod { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; max-width: none; }
  .shell.shell-shop .pprod .pgal { position: sticky; top: 32px; }
  .shell.shell-shop .pprod .gallery { aspect-ratio: 1; }

  /* shop/product only: reserve a persistent right-hand cart panel instead of a bottom sheet */
  .shell.shell-shop-cart {
    display: grid; grid-template-columns: 1fr 340px; grid-template-rows: auto 1fr; grid-template-areas: "head head" "main cart";
  }
  .shell.shell-shop-cart .shdr { grid-area: head; }
  .shell.shell-shop-cart > .scroll { grid-area: main; padding-bottom: 40px; min-height: 0; }
  .shell.shell-shop-cart .cartbar, .shell.shell-shop-cart .cartbar.empty {
    grid-area: cart; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 16px; padding: 32px 26px; border-left: 1px solid rgba(239,201,105,.15); overflow-y: auto; min-height: 0;
  }
  .shell.shell-shop-cart .cartbar .btn { width: 100%; }
}
@media (min-width: 1300px) {
  .shell.shell-shop { max-width: 1320px; }
  .shell.shell-shop .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.steps { display: grid; gap: 4px; }
.shopcta { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--gold-ink); border-radius: 20px; padding: 14px 16px; text-decoration: none; color: inherit; background: none; text-align: left; width: 100%; }

.views { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views > div { flex: 0 0 100%; scroll-snap-align: start; }
.paybank summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gold-dk); text-decoration: underline; text-underline-offset: 4px; text-align: center; list-style: none; padding: 6px 0; }
.paybank summary::-webkit-details-marker { display: none; }
