/* CoreTech Shop, shared layer: fonts, tokens and the primitives both platforms use; raw values live only in :root.
   Each platform's layout lives in desktop.css or phone.css, loaded by shop.html with the --phone-media query.
   Reserved heights keep adaptive areas from moving the catalog. */
@font-face{font-family:'Geologica Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url(/vendor/fonts/geologica/geologica-cyrillic-ext-wght-normal.woff2) format('woff2-variations');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:'Geologica Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url(/vendor/fonts/geologica/geologica-cyrillic-wght-normal.woff2) format('woff2-variations');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Geologica Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url(/vendor/fonts/geologica/geologica-latin-ext-wght-normal.woff2) format('woff2-variations');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Geologica Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url(/vendor/fonts/geologica/geologica-latin-wght-normal.woff2) format('woff2-variations');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --font:'Geologica Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --paper:#f7f7f4; --surface:#ffffff; --sunken:#f0efea; --ink:#15181a; --ink-2:#34383a; --muted:#5d605b;
  --line:#e2e1db; --line-strong:#c9c7bf; --field:#8a8580; --scroll:#c9c8c1;
  --accent:#d43d27; --accent-hover:#b9301f; --accent-text:#b9301f; --accent-soft:#fbeae6; --selection:rgba(212,61,39,.18);
  --success:#1e7b4f; --success-soft:#e7f2ec; --scrim:rgba(21,24,26,.45);
  --shadow-float:0 12px 32px rgba(21,24,26,.14), 0 2px 6px rgba(21,24,26,.08);
  --shadow-dialog:0 24px 64px rgba(21,24,26,.22);
  --shadow-up:0 -8px 24px rgba(21,24,26,.08);
  --r-control:6px; --r-card:12px; --r-pill:999px; --r-dialog:16px;
  --fs-12:12px; --fs-13:13px; --fs-15:15px; --fs-16:16px; --fs-17:17px; --fs-18:18px; --fs-20:20px; --fs-22:22px; --fs-30:30px;
  --accent-bright:#EF5239; --on-ink-muted:rgba(255,255,255,.74); --on-ink-line:rgba(255,255,255,.28);
  --ai-tint:color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); --shadow-card:0 10px 24px rgba(21,24,26,.08);
  --header-height:72px; --demo-bar-height:40px;
  /* Chat panel width: a fixed 420px column; an answer's products open in the store area instead (views.js). */
  --chat-width:420px;
  /* Platform breakpoint, the one definition: js/core.js reads it; shop.html must repeat it in the phone.css link media and as
     not (…) in the desktop.css link media (media attributes cannot read custom properties); the checks fail on any drift. */
  --phone-media:(width <= 900px) or (height <= 480px);
  /* Motion: only a change of state moves (something appeared, a value changed, where to look next); fast and quiet.
     Small feedback, appearing, panels and sheets, the offer highlight; entrances ease out. Reduced motion: none of it. */
  --motion-press:120ms; --motion-appear:180ms; --motion-panel:280ms; --motion-highlight:1.2s;
  --motion-rise:8px; --ease-out:cubic-bezier(.16,1,.3,1);
  --offer-tint:color-mix(in srgb, var(--success) 18%, var(--surface));  /* the once-only highlight of a new offer */
}

/* Base */
*,*::before,*::after { box-sizing:border-box; }
html { height:100%; -webkit-text-size-adjust:100%; overflow-anchor:none; }  /* Reserved geometry: the browser never re-anchors scroll. */
body { margin:0; background:var(--paper); color:var(--ink); font:400 var(--fs-15)/1.45 var(--font); font-synthesis:none; text-rendering:optimizeLegibility; }
button,input,select,textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.5; }
a { color:inherit; }
h1,h2,h3,h4 { line-height:1.2; font-weight:600; }
[hidden] { display:none !important; }
::selection { background:var(--selection); color:var(--ink); }
input,textarea { caret-color:var(--accent); }
:where(a,button,input,select,summary,[tabindex]):focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.visually-hidden { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.skip-link { position:absolute; left:12px; top:-80px; z-index:200; padding:10px 14px; border-radius:var(--r-control); background:var(--ink); color:var(--surface); font-weight:600; text-decoration:none; }
.skip-link:focus { top:12px; }
.icon { display:block; flex:none; width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
:where(.products-view,.categories,.cart-scroll,.history-modal-body,.wishlist-items,.messages,.rail,.module-items) { scrollbar-width:thin; scrollbar-color:var(--scroll) transparent; }
:where(.products-view,.categories,.cart-scroll,.history-modal-body,.wishlist-items,.messages,.rail,.module-items)::-webkit-scrollbar { width:8px; height:8px; }
:where(.products-view,.categories,.cart-scroll,.history-modal-body,.wishlist-items,.messages,.rail,.module-items)::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:var(--r-pill); background:var(--scroll); background-clip:padding-box; }
.hint { margin:0; color:var(--muted); font-size:var(--fs-13); }
.shell { width:min(1440px,calc(100% - 48px)); margin:0 auto; }

/* Storefront views; the column shell around them is platform layout. */
.products-view { overflow-anchor:none; }  /* Reserved geometry: refresh never re-anchors scroll. */
.commerce-view { flex-direction:column; overflow:hidden; background:var(--paper); }
.commerce-view:not([hidden]) { display:flex; }

/* Storefront header */
/* Demo bar: the presenter's persona control, kept apart from the shop itself. */
.demo-bar { grid-column:1 / -1; background:var(--ink); color:var(--surface); }
.demo-bar-inner { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:40px; padding:4px 24px; }
.demo-bar-label { display:inline-flex; align-items:center; gap:8px; color:var(--on-ink-muted); font-size:var(--fs-12); font-weight:500; }
.persona-label { display:flex; align-items:center; gap:10px; color:var(--on-ink-muted); font-size:var(--fs-12); font-weight:500; }
.persona-label select { width:220px; height:30px; padding:0 28px 0 10px; border:1px solid var(--on-ink-line); border-radius:var(--r-pill); background:transparent; color:var(--surface); font-size:var(--fs-13); font-weight:500; }
.persona-label select option { color:var(--ink); }
.persona-label select:focus-visible { outline-color:var(--surface); }

/* Storefront header: one confident search, one AI entry, labelled store tools. */
.storefront > header { position:relative; z-index:20; flex:none; background:var(--surface); border-bottom:1px solid var(--line); }
.topbar { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; grid-template-areas:'brand search ai nav'; align-items:center; gap:16px; height:calc(var(--header-height) - 1px); }
.brand { grid-area:brand; display:flex; align-items:center; text-decoration:none; }
.brand-logo { display:block; width:132px; height:auto; }
.search { grid-area:search; display:flex; align-items:center; min-width:0; height:48px; padding:0 4px 0 16px; border:1.5px solid var(--line-strong); border-radius:var(--r-pill); background:var(--paper); }
.search:focus-within { border-color:var(--ink); background:var(--surface); outline:2px solid var(--ink); outline-offset:2px; }
.search-icon { display:grid; flex:none; margin-right:10px; color:var(--muted); }
.search input { flex:1; min-width:0; height:100%; padding:0; border:0; outline:0; background:transparent; font-size:var(--fs-15); }
.search input::placeholder, .composer input::placeholder { color:var(--muted); opacity:1; }
.search-photo { display:grid; place-items:center; flex:none; width:40px; height:40px; padding:0; border:0; border-radius:var(--r-pill); background:transparent; color:var(--ink-2); }
.search-photo:hover { background:var(--sunken); color:var(--ink); }
.search-submit { flex:none; height:40px; margin-left:4px; padding:0 22px; border:0; border-radius:var(--r-pill); background:var(--accent); color:var(--surface); font-weight:600; }
.search-submit:hover { background:var(--accent-hover); }
.header-ai { grid-area:ai; display:inline-flex; align-items:center; gap:8px; height:44px; padding:0 18px 0 14px; border:0; border-radius:var(--r-pill); background:var(--ink); color:var(--surface); font-size:var(--fs-15); font-weight:600; white-space:nowrap; }
.header-ai .icon { color:var(--accent-bright); }
.header-ai:hover { background:var(--ink-2); }
body:not(.chat-closed) .header-ai { background:var(--accent-soft); color:var(--accent-text); }
body:not(.chat-closed) .header-ai .icon { color:var(--accent); }
.store-nav-home { grid-area:nav; }
.store-nav { display:flex; align-items:center; gap:2px; }
.nav-btn { position:relative; display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:52px; height:52px; padding:4px 8px; border:0; border-radius:var(--r-card); background:transparent; color:var(--ink-2); font-size:var(--fs-12); font-weight:500; }
.nav-btn:hover { background:var(--sunken); color:var(--ink); }
.nav-btn.active { background:var(--ink); color:var(--surface); }
.count-pill { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:var(--r-pill); background:var(--accent); color:var(--surface); font-size:var(--fs-12); font-weight:600; font-variant-numeric:tabular-nums; line-height:1; }
.nav-btn .count-pill { position:absolute; top:0; right:4px; box-shadow:0 0 0 2px var(--surface); }

/* Categories: one compact row of one-line pills; the best sellers first, the rest behind "Бүх ангилал". */
.category-shell { flex:none; background:var(--paper); border-bottom:1px solid var(--line); }
.categories { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; padding:10px 0; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scroll-snap-type:x proximity; scrollbar-width:none; }
.categories::-webkit-scrollbar { display:none; }
.categories.all { flex-wrap:wrap; }
.chip { display:inline-flex; flex:none; align-items:center; gap:6px; height:36px; padding:0 14px 0 10px; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--ink-2); font-size:var(--fs-13); font-weight:500; white-space:nowrap; scroll-snap-align:start; }
.chip .icon { width:16px; height:16px; }
.chip:hover { border-color:var(--ink); color:var(--ink); }
.chip.active { border-color:var(--ink); background:var(--ink); color:var(--surface); font-weight:600; }
.chip.more { display:none; }
.categories.all .chip.more { display:inline-flex; }
.chip.all-categories { position:sticky; right:0; z-index:1; padding:0 14px; border-style:dashed; background:var(--paper); color:var(--ink); font-weight:600; box-shadow:-14px 0 10px -4px var(--paper); }  /* Always reachable at the row's edge. */

/* Products view */
.storefront-layout { padding:24px 0 8px; }
/* One line: the title and its data-backed sentence share a baseline; perks and status sit below. */
.greeting { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px; margin:0 0 18px; }
.greeting h1 { margin:0; font-size:var(--fs-22); font-weight:700; letter-spacing:-.01em; }
.greeting p { margin:0; color:var(--muted); }
.greeting .perks, .greeting .ai-state { flex-basis:100%; }
/* Search first: while a query is active the results sit directly under the navigation. */
.products-view.searching .greeting, .products-view.searching .rec-rail { display:none; }
.ai-state { margin:0; color:var(--muted); font-size:var(--fs-12); }
.ai-state:empty { display:none; }
.greeting .ai-state { margin-top:8px; }
/* Member perks: a real coupon priced at checkout, in Savings Wash; no validity date or countdown. */
.perks { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.perk { display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px 8px; min-height:38px; padding:6px 14px 6px 11px; border-radius:var(--r-pill); background:var(--success-soft); color:var(--success); font-size:var(--fs-13); }
.perk .icon { width:18px; height:18px; }
.perk strong { font-weight:700; font-variant-numeric:tabular-nums; }
.perk span { color:var(--ink-2); }
.section-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 16px; margin-bottom:12px; }
.section-head h2, .catalog-head h2 { margin:0; font-size:var(--fs-22); font-weight:700; letter-spacing:-.01em; }
.rec-hint { margin:0; color:var(--muted); font-size:var(--fs-13); }
.rec-rail { height:382px; margin:0 0 36px; padding:18px 20px 0; border:1px solid color-mix(in srgb, var(--accent) 14%, var(--line)); border-radius:var(--r-card); background:var(--ai-tint); overflow:hidden; }
.rec-rail.plain { border-color:var(--line); background:var(--surface); }  /* Best sellers are not AI: no tint. */
.rail { position:relative; display:grid; grid-auto-flow:column; grid-auto-columns:212px; gap:12px; height:314px; padding:0 0 8px; overflow-x:auto; overscroll-behavior-x:contain; align-items:stretch; }
.rail > .product { height:304px; }
.rail .photo { height:108px; }
.rail .because { margin-top:6px; padding-top:6px; }
/* Reserved rail cards while a persona's recommendations load: a photo well over a white body, no empty box. */
.rail > .skeleton { height:304px; border:1px solid var(--line); border-radius:var(--r-card); background:linear-gradient(var(--sunken) 0 108px,var(--surface) 108px); animation:skeleton 1.1s ease-in-out infinite alternate; }
@keyframes skeleton { from { opacity:.55; } to { opacity:1; } }
.catalog-head { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; gap:12px 18px; margin:0 0 16px; }
.catalog-head p { margin:4px 0 0; color:var(--muted); font-size:var(--fs-13); }
#sortSelect { height:36px; padding:0 30px 0 12px; border:1px solid var(--field); border-radius:var(--r-control); background:var(--surface); font-size:var(--fs-13); }
.grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-rows:372px; gap:16px; }
.grid > .product, .grid > .adaptive-slot { height:372px; min-width:0; }
.load { display:block; margin:28px auto 48px; height:44px; padding:0 24px; border:1.5px solid var(--ink); border-radius:var(--r-control); background:var(--surface); color:var(--ink); font-weight:600; }  /* not a buying action: ink, not red */
.load:hover { background:var(--sunken); }
.empty { grid-column:1 / -1; padding:64px 20px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); text-align:center; color:var(--muted); }
.empty h3 { margin:0 0 6px; color:var(--ink); }
footer { padding:24px 0; border-top:1px solid var(--line); color:var(--muted); font-size:var(--fs-12); }

/* Product card: shelf label (name, pack, price) first; the AI reason is a quiet footer. */
.product { position:relative; display:flex; flex-direction:column; min-width:0; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); overflow:hidden; }
.product { transition:transform var(--motion-appear) var(--ease-out), box-shadow var(--motion-appear) var(--ease-out), border-color var(--motion-appear); }
.product:hover { border-color:var(--line-strong); transform:translateY(-2px); box-shadow:var(--shadow-card); }
.product :focus-visible { outline-offset:-3px; }
.photo { position:relative; display:block; flex:none; width:100%; height:180px; padding:0; border:0; background:var(--sunken); overflow:hidden; cursor:pointer; }
.photo img { position:absolute; inset:12px; width:calc(100% - 24px); height:calc(100% - 24px); object-fit:contain; mix-blend-mode:multiply; }
.body { display:flex; flex:1; flex-direction:column; gap:4px; min-height:0; padding:12px 14px 14px; }
.product h3 { flex:none; height:40px; margin:0; overflow:hidden; font-size:var(--fs-15); font-weight:500; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.name-link { padding:0; border:0; background:none; color:inherit; font:inherit; line-height:inherit; text-align:left; }
.name-link:hover { text-decoration:underline; text-underline-offset:3px; }
.meta { overflow:hidden; color:var(--muted); font-size:var(--fs-12); white-space:nowrap; text-overflow:ellipsis; }
.price-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 8px; margin-top:auto; padding-top:6px; }
.price { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 6px; min-width:0; }
.price strong { font-size:var(--fs-18); font-weight:700; font-variant-numeric:tabular-nums; }
.price del { color:var(--muted); font-size:var(--fs-12); }
.discount-label { color:var(--accent-text); font-size:var(--fs-12); font-weight:600; }
.add { display:inline-flex; align-items:center; gap:4px; height:36px; padding:0 12px 0 9px; border:1.5px solid var(--accent-text); border-radius:var(--r-control); background:var(--surface); color:var(--accent-text); font-size:var(--fs-13); font-weight:600; white-space:nowrap; }
.add .icon { width:16px; height:16px; }
.stepper { display:inline-flex; align-items:center; height:36px; border-radius:var(--r-control); background:var(--accent); color:var(--surface); }
.stepper button { display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:var(--r-control); background:transparent; color:inherit; }
.stepper button:hover { background:var(--accent-hover); }
.stepper .icon { width:16px; height:16px; }
.stepper span { min-width:22px; font-weight:600; text-align:center; font-variant-numeric:tabular-nums; }
.add:hover { background:var(--accent-soft); }
.add:active, .checkout:active, .primary:active, .send:active { transform:translateY(1px); }
.because { margin:8px 0 0; padding-top:8px; border-top:1px solid var(--line); color:var(--ink-2); font-size:var(--fs-12); font-weight:500; line-height:1.35; }
.because span { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.wishlist-toggle { position:absolute; top:8px; right:8px; z-index:4; display:grid; place-items:center; width:36px; height:36px; padding:0; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--muted); }
.wishlist-toggle .icon { width:18px; height:18px; }
.wishlist-toggle:hover { color:var(--accent-text); }
.wishlist-toggle.active { color:var(--accent-text); }
.wishlist-toggle.active .icon { fill:currentColor; }
.tile-badge { position:absolute; top:8px; left:8px; max-width:calc(100% - 60px); overflow:hidden; padding:3px 9px; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--ink); font-size:var(--fs-12); font-weight:600; white-space:nowrap; text-overflow:ellipsis; }
.adaptive-slot { position:relative; border-radius:var(--r-card); background:var(--sunken); overflow:hidden; }
.adaptive-slot > .hint { padding:24px; }
.adaptive-slot > .product { height:100%; }
.fade-ghost { position:absolute !important; inset:0; z-index:2; width:100%; height:100%; margin:0 !important; overflow:hidden; pointer-events:none; }

/* Commerce views: cart, history, wishlist */
.view-head { display:flex; flex:none; align-items:center; gap:14px; min-height:64px; padding:10px max(24px,calc((100% - 880px)/2)); border-bottom:1px solid var(--line); background:var(--surface); }
.view-head h2 { margin:0; font-size:var(--fs-20); }
.view-back { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 12px 0 8px; border:1px solid var(--line); border-radius:var(--r-control); background:var(--surface); color:var(--ink-2); font-size:var(--fs-13); font-weight:500; }
.view-back .icon { width:18px; height:18px; }
.view-back:hover { border-color:var(--line-strong); color:var(--ink); }
.cart-scroll { flex:1; min-height:0; padding:4px max(24px,calc((100% - 880px)/2)) 16px; overflow-y:auto; scrollbar-gutter:stable; }
.cart-line { display:grid; grid-template-columns:64px minmax(0,1fr) auto; gap:14px; align-items:start; padding:14px 0; border-bottom:1px solid var(--line); }
.cart-line img { width:64px; height:64px; padding:4px; border-radius:var(--r-control); background:var(--sunken); object-fit:contain; }
.cart-line > div { min-width:0; overflow-wrap:anywhere; }
.line-name { margin:0 0 4px; font-weight:500; }
[data-line-price] { display:inline-block; font-weight:600; font-variant-numeric:tabular-nums; }  /* inline-block: a new price can settle in */
.saving { color:var(--success); font-weight:600; }
.cart-line .saving { margin-left:6px; font-size:var(--fs-13); }
.qty { display:inline-flex; align-items:center; margin-top:8px; border:1px solid var(--field); border-radius:var(--r-control); }
.qty button { display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; background:transparent; color:var(--ink); }
.qty button .icon { width:16px; height:16px; }
.qty span { min-width:28px; font-weight:600; text-align:center; font-variant-numeric:tabular-nums; }
.remove { padding:6px 0; border:0; background:none; color:var(--accent-text); font-size:var(--fs-13); text-decoration:underline; text-underline-offset:3px; }
.history-empty { padding:32px 12px; color:var(--muted); text-align:center; font-size:var(--fs-15); font-weight:400; }
#cartCoupons { color:var(--success); font-size:var(--fs-13); }
#beforePay { margin-top:20px; }
.step-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.step-head h3 { margin:0; font-size:var(--fs-20); }
#beforePay > .hint { margin:6px 0 4px; }
#beforePay section { padding:16px 0 4px; border-top:1px solid var(--line); margin-top:12px; }
#beforePay h4 { margin:0 0 12px; font-size:var(--fs-17); }
.text-button { padding:8px 2px; border:0; background:transparent; color:var(--ink-2); font-size:var(--fs-13); text-decoration:underline; text-underline-offset:3px; }
.module-items { position:relative; display:flex; gap:12px; min-height:48px; padding-bottom:8px; overflow-x:auto; }
.module-items > div { flex:0 0 196px; }
.module-items .product { width:196px; height:308px; }
.module-items .photo { height:112px; }
.module-items > .saving { flex:0 0 auto; align-self:center; max-width:220px; margin:0; }
.module-items p { margin:6px 0 0; }
.cart-foot { display:grid; flex:none; gap:6px; padding:14px max(24px,calc((100% - 880px)/2)) 18px; border-top:1px solid var(--line); background:var(--surface); }
.cart-foot p { margin:0; font-size:var(--fs-13); }
#quoteStatus { color:var(--muted); }
.countdown { display:inline-flex; align-items:center; gap:6px; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.countdown .icon { width:16px; height:16px; }
.total { display:flex; justify-content:space-between; align-items:baseline; font-size:var(--fs-20); font-weight:700; font-variant-numeric:tabular-nums; }
.checkout { width:100%; height:48px; margin-top:6px; border:0; border-radius:var(--r-control); background:var(--accent); color:var(--surface); font-size:var(--fs-15); font-weight:600; }
.checkout:hover { background:var(--accent-hover); }
.history-modal-body, .wishlist-items { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.order-history { padding:8px max(24px,calc((100% - 880px)/2)) 16px; }
.order-card { margin:12px 0; padding:16px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); }
.order-card.recent { border-color:color-mix(in srgb,var(--accent) 40%,var(--line)); box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 10%,transparent); }
.order-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.order-card h4 { margin:0; color:var(--muted); font-size:var(--fs-12); font-weight:500; }
.history-section { margin:24px 0 2px; font-size:var(--fs-17); }
.history-section + .hint { margin-bottom:4px; }
.history-state { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; margin:12px 0; padding:12px 16px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); }
.history-state p { margin:0; font-weight:500; }
.order-status { display:inline-flex; flex:none; align-items:center; gap:4px; padding:4px 10px; border-radius:var(--r-pill); background:var(--sunken); color:var(--ink-2); font-size:var(--fs-12); font-weight:600; }
.order-status.delivered { background:var(--success-soft); color:var(--success); }
.order-status .icon { width:14px; height:14px; }
.order-card .order-note, .order-card .order-more { margin:8px 0 0; color:var(--ink-2); font-size:var(--fs-13); font-weight:400; }
.order-card .order-more { margin:2px 0 0; color:var(--muted); }
.order-card p { margin:4px 0 0; font-size:var(--fs-17); font-weight:700; font-variant-numeric:tabular-nums; }
.order-date { display:block; margin-top:4px; color:var(--ink); font-size:var(--fs-13); font-weight:600; font-variant-numeric:tabular-nums; }
.recent-order-badge { flex:none; padding:4px 9px; border-radius:var(--r-pill); background:var(--ai-tint); color:var(--accent-text); font-size:var(--fs-12); font-weight:600; }
.order-items { margin:12px 0 0; padding:10px 0 0; border-top:1px solid var(--line); list-style:none; }
.order-items li { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:var(--fs-13); }
.order-items li:last-child { border-bottom:0; }
.order-item-main { display:grid; grid-template-columns:48px minmax(0,1fr); align-items:center; gap:10px; min-width:0; }
.order-item-main img { width:48px; height:48px; padding:3px; border-radius:var(--r-control); background:var(--sunken); object-fit:contain; }
.order-item-main span { display:block; overflow-wrap:anywhere; font-weight:600; }
.order-item-main small { display:block; margin-top:3px; color:var(--muted); }
.order-item-actions { display:flex; align-items:center; gap:10px; }
.order-item-actions small { color:var(--muted); white-space:nowrap; }
.history-qty { display:flex; align-items:center; border:1px solid var(--field); border-radius:var(--r-control); }
.history-qty button { display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; background:transparent; color:var(--ink); }
.history-qty button .icon { width:16px; height:16px; }
.history-qty strong { min-width:28px; text-align:center; font-variant-numeric:tabular-nums; }
.history-quantity-note { margin:12px 0 0 !important; padding:10px 12px; border-radius:var(--r-control); background:var(--ai-tint); color:var(--ink-2); font-size:var(--fs-13) !important; font-weight:400 !important; }
.order-card-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; min-height:44px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.order-card-actions p { flex:1; margin:0; color:var(--muted); font-size:var(--fs-13); font-weight:400; }
.history-add-all { min-height:42px; padding:0 16px; border:0; border-radius:var(--r-control); background:var(--accent); color:var(--surface); font-size:var(--fs-13); font-weight:600; white-space:nowrap; }
.history-add-all:hover { background:var(--accent-hover); }
.history-add-all:disabled { background:var(--field); color:var(--muted); }
.wishlist-items { padding:8px max(24px,calc((100% - 880px)/2)) 16px; }
.wishlist-line { display:grid; grid-template-columns:64px minmax(0,1fr) auto; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--line); }
.wishlist-line img { width:64px; height:64px; padding:4px; border-radius:var(--r-control); background:var(--sunken); object-fit:contain; }
.wishlist-line h3 { margin:0 0 4px; font-size:var(--fs-15); font-weight:500; }
.wishlist-line p { margin:0; font-weight:600; font-variant-numeric:tabular-nums; }
.wishlist-line-actions { display:flex; gap:8px; }
.wishlist-line-actions button { height:40px; padding:0 14px; border:1px solid var(--line); border-radius:var(--r-control); background:var(--surface); font-size:var(--fs-13); font-weight:500; }
.wishlist-line-actions .wishlist-add { border-color:var(--accent); background:var(--accent); color:var(--surface); font-weight:600; }

/* Dialogs */
dialog { width:min(880px,calc(100% - 24px)); max-height:92dvh; padding:28px; border:0; border-radius:var(--r-dialog); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-dialog); }
dialog:not([open]) { display:none !important; }
dialog::backdrop { background:var(--scrim); }
.close { float:right; display:grid; place-items:center; width:40px; height:40px; margin:-8px -8px 0 12px; padding:0; border:0; border-radius:var(--r-pill); background:var(--sunken); color:var(--ink); }
.close:hover { background:var(--line); }
#detailContent { clear:both; }
.detail-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; margin-top:16px; }
/* The detail's cart control: a primary "Сагсанд нэмэх" that becomes a large stepper once the product is in the cart. */
.detail-cart .add { height:48px; padding:0 20px 0 16px; border:0; background:var(--accent); color:var(--surface); font-size:var(--fs-16); font-weight:600; }
.detail-cart .add:hover { background:var(--accent-hover); }
.detail-cart .stepper { height:48px; }
.detail-cart .stepper button { width:48px; height:48px; }
.detail-cart .stepper span { min-width:32px; font-size:var(--fs-16); }
.primary { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:44px; padding:0 18px; border:0; border-radius:var(--r-control); background:var(--accent); color:var(--surface); font-weight:600; }
.primary:hover { background:var(--accent-hover); }
.wishlist-detail-toggle { display:inline-flex; align-items:center; gap:6px; }
.wishlist-detail-toggle .icon { width:18px; height:18px; }
.wishlist-detail-toggle[aria-pressed="true"] .icon { fill:currentColor; color:var(--accent-text); }
.confirmation-dialog h2 { margin:0 0 10px; font-size:var(--fs-22); }
.confirmation-dialog h3 { margin:0 0 4px; font-size:var(--fs-17); }
.order-summary { margin:0; font-size:var(--fs-18); font-weight:600; font-variant-numeric:tabular-nums; }
#orderConfirmation { margin:4px 0 0; color:var(--muted); font-size:var(--fs-13); }
.confirmation-dialog hr { margin:24px 0; border:0; border-top:1px solid var(--line); }
.confirmation-dialog .rail { height:auto; margin-top:14px; }
.confirmation-dialog .rail > .product { height:296px; }
.confirmation-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; margin-top:4px; }

/* Toasts sit over the storefront column, never over the composer. */
body.cart-active #toast { top:calc(var(--demo-bar-height) + var(--header-height) + 12px); bottom:auto; }  /* never over checkout */
#toast { position:fixed; left:30%; bottom:24px; z-index:100; max-width:min(90vw,520px); padding:12px 16px; border-radius:var(--r-control); background:var(--ink); color:var(--surface); font-size:var(--fs-13); box-shadow:var(--shadow-float); pointer-events:none; transform:translateX(-50%); }

/* Assistant */
.assistant { display:flex; min-width:0; min-height:0; }
.assistant-panel { display:flex; flex-direction:column; position:static; width:100%; height:100%; min-height:0; overflow:hidden; border-left:1px solid var(--line); background:var(--surface); }
.assistant-head { display:flex; flex:none; align-items:center; gap:10px; height:var(--header-height); padding:0 12px 0 16px; border-bottom:1px solid var(--line); background:var(--ai-tint); }
.assistant-identity { display:flex; flex:1; align-items:center; gap:10px; min-width:0; }
.assistant-identity > div { min-width:0; }
#assistantTitle { margin:0; overflow:hidden; font-size:var(--fs-16); white-space:nowrap; text-overflow:ellipsis; }
#speechStatus { display:block; overflow:hidden; color:var(--muted); font-size:var(--fs-12); white-space:nowrap; text-overflow:ellipsis; }
.assistant-nav-slot:empty { display:none; }
.assistant-controls { display:flex; flex:none; align-items:center; gap:2px; }
.panel-action { display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:var(--r-control); background:transparent; color:var(--muted); text-decoration:none; }
.panel-action .icon { width:18px; height:18px; }
.panel-action:hover { background:var(--sunken); color:var(--ink); }
.panel-action[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-text); }
.panel-action.new-chat { display:inline-flex; gap:4px; width:auto; padding:0 10px 0 8px; font-size:var(--fs-13); font-weight:600; color:var(--ink-2); }
.assistant-panel > .ai-state { flex:none; padding:6px 16px; border-bottom:1px solid var(--line); background:var(--sunken); }
.assistant-panel .pane { display:flex; flex:1; flex-direction:column; min-height:0; overflow:hidden; }
.assistant-layout { display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }
.chat-column { display:flex; flex:1; flex-direction:column; min-width:0; min-height:0; overflow:hidden; }
.messages { position:relative; container:chat / size; contain-intrinsic-block-size:240px; flex:1; min-height:0; padding:20px 16px 8px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.messages > * { overflow-wrap:anywhere; }
.msg { margin:0 0 16px; font-size:var(--fs-15); line-height:1.55; white-space:pre-wrap; }
.msg.user { width:fit-content; max-width:85%; margin-left:auto; padding:8px 12px; border-radius:var(--r-card); background:var(--sunken); }
/* An assistant turn: the CoreTech mark (the logo file cropped to its square symbol) beside an AI-tinted bubble; its
   products follow under the bubble, full width on phones. */
.msg.bot { position:relative; display:grid; grid-template-columns:24px minmax(0,1fr); column-gap:8px; align-items:start; }
.bot-mark { display:block; width:24px; height:24px; object-fit:cover; object-position:left center; }
.msg.bot > .bot-mark { grid-column:1; grid-row:1; margin-top:4px; }
.msg.bot > span { grid-column:2; display:block; width:fit-content; max-width:100%; padding:9px 14px 10px; border-radius:4px var(--r-card) var(--r-card) var(--r-card); background:var(--ai-tint); color:var(--ink); }
.msg.bot:has(> .speak) > span { padding-right:40px; }  /* room for the speak button */
.msg.bot > :is(.more-toggle, .answer.linked) { grid-column:2; }
.msg.bot > .answer { grid-column:1 / -1; }
.msg.bot.clamped > span { display:-webkit-box; overflow:hidden; -webkit-line-clamp:8; -webkit-box-orient:vertical; }
.more-toggle { display:block; margin-top:6px; padding:4px 0; border:0; background:none; color:var(--accent-text); font-size:var(--fs-13); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.speak { position:absolute; top:2px; right:2px; display:grid; place-items:center; width:32px; height:32px; padding:0; border:0; border-radius:var(--r-control); background:transparent; color:var(--muted); }
.speak .icon { width:16px; height:16px; }
.speak:hover { background:var(--sunken); color:var(--ink); }
.attachment-msg { display:flex; align-items:center; gap:10px; padding:6px !important; }
.attachment-msg img { width:64px; height:64px; border-radius:var(--r-control); object-fit:cover; }
.attachment-msg span { max-width:180px; overflow:hidden; font-size:var(--fs-13); white-space:nowrap; text-overflow:ellipsis; }
.msg.pending { display:flex; align-items:center; gap:5px; min-height:28px; }
.msg.pending > .bot-mark { margin-right:6px; }
.msg.pending i { width:7px; height:7px; border-radius:var(--r-pill); background:var(--muted); animation:typing 1.2s var(--ease-out) infinite; }
.msg.pending i:nth-of-type(2) { animation-delay:.15s; }
.msg.pending i:nth-of-type(3) { animation-delay:.3s; }
.msg.pending > .pending-text { padding:0 0 0 6px; color:var(--muted); font-size:var(--fs-13); }
@keyframes typing { 0%,60%,100% { opacity:.25; transform:none; } 30% { opacity:1; transform:translateY(-3px); } }

/* Empty state: one clear way to ask, the other AI capabilities as labelled tools. */
.assistant-welcome { display:grid; gap:14px; margin-bottom:12px; }
.messages.has-messages .assistant-welcome { display:none; }
.assistant-welcome h3 { margin:0; font-size:var(--fs-22); }
.welcome-text { margin:0; color:var(--muted); }
.prompt-chips { display:flex; flex-wrap:wrap; gap:8px; }
.prompt-chip { display:inline-flex; align-items:center; gap:6px; height:38px; padding:0 14px 0 11px; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--ink); font-size:var(--fs-13); font-weight:500; }
.prompt-chip .icon { width:16px; height:16px; color:var(--ink-2); }  /* chips ask; red stays on buying actions */
.prompt-chip:hover { border-color:var(--ink); }
.welcome-note { margin:0; padding:8px 12px; border-radius:var(--r-control); background:var(--sunken); color:var(--ink-2); font-size:var(--fs-13); }
/* The other ways to ask: one compact row. */
.capability-tools { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:4px; }
.capability { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; width:100%; min-height:64px; padding:10px 6px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); color:var(--ink); text-align:center; }
.capability:hover { border-color:var(--ink); }
.capability > .icon { width:20px; height:20px; color:var(--ink-2); }
.capability strong { display:block; font-size:var(--fs-13); font-weight:600; line-height:1.3; }
.capability small { display:block; color:var(--muted); font-size:var(--fs-12); }
.capability small[data-state-label]:not([data-state-label=""])::after { content:attr(data-state-label); display:block; color:var(--accent-text); }
.friction-chip { display:block; max-width:100%; margin:0 0 12px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--sunken); color:var(--ink); font-size:var(--fs-13); text-align:left; }

/* Receipt review */
.receipt-workflow { margin:4px 0 16px; padding:16px; border:1px solid var(--line); border-radius:var(--r-card); background:var(--surface); }
.receipt-workflow h3 { margin:0 0 4px; font-size:var(--fs-17); }
.status { margin:0 0 4px; color:var(--muted); font-size:var(--fs-13); }
.receipt-summary { margin:8px 0 4px; font-weight:600; }
.receipt-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0 4px; }
.receipt-row { padding:12px 0; border-top:1px solid var(--line); }
.receipt-fields { display:grid; grid-template-columns:minmax(0,1fr) 88px; gap:10px; }
.receipt-workflow label { display:block; margin:0 0 4px; color:var(--muted); font-size:var(--fs-12); font-weight:500; }
.receipt-workflow input:not([type="checkbox"]), .receipt-workflow select { width:100%; min-width:0; height:40px; padding:0 10px; border:1px solid var(--field); border-radius:var(--r-control); background:var(--surface); }
.receipt-row > .hint { margin-top:6px; font-size:var(--fs-12); }
.receipt-row strong { display:block; margin-bottom:6px; font-weight:600; }
.receipt-row label.cart-choice { display:flex; align-items:center; gap:8px; margin:10px 0 0; color:var(--ink); font-size:var(--fs-13); cursor:pointer; }
.cart-choice input { width:18px; height:18px; accent-color:var(--accent); }
.receipt-result { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.match-pair { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; }
.match-pair .icon { width:16px; height:16px; color:var(--muted); }
.mini-add { display:inline-flex; align-items:center; gap:4px; height:32px; padding:0 10px 0 8px; border:1.5px solid var(--accent-text); border-radius:var(--r-control); background:var(--surface); color:var(--accent-text); font-size:var(--fs-12); font-weight:600; }
.mini-add .icon { width:14px; height:14px; }
.receipt-workflow .primary { margin-top:14px; }
.approved { display:flex; align-items:flex-start; gap:8px; margin:12px 0 4px; padding:12px; border-radius:var(--r-control); background:var(--success-soft); color:var(--success); font-size:var(--fs-13); font-weight:500; }
.approved .icon { width:18px; height:18px; }
.confirmed-choice { display:inline-flex; align-items:center; gap:4px; color:var(--success); font-size:var(--fs-12); font-weight:600; }
.confirmed-choice .icon { width:14px; height:14px; }

/* Answers own their products: inside the answer's message, scrolling with the one thread, as compact rows (photo,
   two-line name, pack and price, the cart control at the right) on every chat width. A basket groups its rows under
   "Үндсэн" / "Нэмэлт", the essentials' commit after them. Desktop (.linked): the chat keeps the words, the budget line
   and "N бараа харах"; the products show in the store area as the answer's own view. The rows land just after the
   bubble: the words first. */
.answer { display:flex; flex-direction:column; gap:8px; margin-top:10px; white-space:normal; }  /* its message rises in as one piece */
.answer-list { display:grid; gap:8px; }
.answer-group { margin:4px 0 0; color:var(--ink-2); font-size:var(--fs-13); font-weight:600; }
.answer-budget { color:var(--ink-2); font-size:var(--fs-13); font-weight:600; font-variant-numeric:tabular-nums; }
.source-pill { padding:2px 10px; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--muted); font-size:var(--fs-12); font-weight:500; white-space:nowrap; }  /* catalog results, not AI */
.answer .tile-badge, .answer .wishlist-toggle { display:none; }
.answer .product { display:grid; grid-template-columns:56px minmax(0,1fr) auto auto; grid-template-areas:'photo name name control' 'photo meta price control'; align-items:center; gap:2px 10px; padding:8px 10px; }
.answer .product:hover { transform:none; }
.answer .body, .answer .price-row { display:contents; }
.answer .photo { grid-area:photo; width:56px; height:56px; border-radius:var(--r-control); }
.answer .photo img { inset:4px; width:calc(100% - 8px); height:calc(100% - 8px); }
.answer .product h3 { grid-area:name; height:auto; max-height:36px; font-size:var(--fs-13); }
.answer .meta { grid-area:meta; }
.answer .price { grid-area:price; justify-self:end; }
.answer .price strong { font-size:var(--fs-15); }
.answer .cart-control { grid-area:control; }
.answer .because { grid-column:2 / -1; }
.answer:not(.open) .extra { display:none; }
.answer-more { display:block; align-self:flex-start; padding:6px 0; border:0; background:none; color:var(--ink); font-size:var(--fs-13); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.answer-add-all { display:flex; align-items:center; justify-content:center; width:100%; min-height:40px; padding:0 12px; border:1.5px solid var(--accent-text); border-radius:var(--r-control); background:var(--surface); color:var(--accent-text); font-size:var(--fs-13); font-weight:600; font-variant-numeric:tabular-nums; }
.answer-add-all:hover { background:var(--accent-soft); }
.answer-cart { display:flex; flex-wrap:wrap; align-items:center; gap:2px 8px; margin:0; color:var(--ink-2); font-size:var(--fs-13); font-variant-numeric:tabular-nums; }
.answer-cart .text-button { padding:4px 0; color:var(--ink); font-weight:600; }
.answer-open { display:inline-flex; align-self:flex-start; align-items:center; gap:6px; min-height:40px; padding:0 14px 0 16px; border:1.5px solid var(--ink); border-radius:var(--r-pill); background:var(--surface); color:var(--ink); font-size:var(--fs-13); font-weight:600; }
.answer-open:hover { background:var(--sunken); }
.answer-open .icon { width:16px; height:16px; }
.answer.linked > :is(.answer-list, .answer-add-all, .answer-cart, .answer-more) { display:none; }
.answer:not(.linked) > .answer-open { display:none; }
/* Reading mode hides the store: a linked answer shows its own rows there instead of the link. */
.assistant-panel.expanded .answer.linked > :is(.answer-list, .answer-add-all, .answer-cart) { display:flex; }
.assistant-panel.expanded .answer.linked > .answer-open { display:none; }
.msg.stopped-note { margin:-10px 0 16px; color:var(--muted); font-size:var(--fs-12); text-align:right; }
/* Quick replies above the composer: the model's follow-up and the computed actions; a long one wraps inside its chip. */
.quick-replies { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.composer-dock.voice-active .quick-replies { display:none; }  /* the microphone owns the dock while it listens */
.quick-reply { height:auto; min-height:36px; padding:7px 14px; line-height:1.3; text-align:left; white-space:normal; }
.quick-reply .icon { margin-left:-3px; }
@media (pointer:coarse) {
  .answer .add, .answer .stepper, .answer-add-all, .answer-more, .answer-open, .answer-cart .text-button, .quick-reply, .more-toggle { min-height:44px; }
  .answer .stepper button, .speak { width:44px; height:44px; }
  /* Touch: one swipeable line, so the thread keeps its height above the keyboard and the tab bar. */
  .quick-replies { flex-wrap:nowrap; margin-inline:-12px; padding-inline:12px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; }
  .quick-replies::-webkit-scrollbar { display:none; }
  .quick-reply { flex:none; white-space:nowrap; }
}

/* Composer */
.composer-dock { position:relative; z-index:3; flex:0 0 auto; min-width:0; padding:10px 12px 12px; border-top:1px solid var(--line); background:var(--surface); }
.composer-dock > .ai-state { padding:0 4px 6px; }
.composer { display:flex; flex:0 0 auto; align-items:center; gap:4px; padding:4px; border:1px solid var(--field); border-radius:var(--r-card); background:var(--surface); }
.composer:focus-within { outline:2px solid var(--ink); outline-offset:2px; }
.tool-button { display:grid; place-items:center; flex:none; width:40px; height:40px; padding:0; border:0; border-radius:var(--r-control); background:transparent; color:var(--ink-2); }
.tool-button:hover { background:var(--sunken); color:var(--ink); }
#chatInput { flex:1; min-width:0; height:40px; padding:0 6px; border:0; outline:0; background:transparent; font-size:var(--fs-15); }
.send { display:grid; place-items:center; flex:none; width:40px; height:40px; padding:0; border:0; border-radius:var(--r-control); background:var(--accent); color:var(--surface); }
.send:hover { background:var(--accent-hover); }
.send.stop { background:var(--ink); }  /* stop is not a commit: ink, not red */
.send.stop:hover { background:var(--ink-2); }
/* Voice input: while it runs, a bar takes the composer's place: listening (pulsing dot, timer, live level, Болих,
   Дуусгах), recognizing (a spinner), or a problem with "Дахин". A spoken question waits in the input, marked. */
.composer-dock.voice-active .composer { display:none; }
.voice-bar { display:flex; align-items:center; gap:8px; min-height:50px; padding:4px 4px 4px 14px; border:1px solid var(--field); border-radius:var(--r-card); background:var(--surface); }
.voice-bar[hidden] { display:none; }
.voice-dot { flex:none; width:10px; height:10px; border-radius:50%; background:var(--accent); }
.voice-bar[data-state="listening"] .voice-dot { animation:voice-pulse 1.2s ease-in-out infinite; }
.voice-bar[data-state="starting"] .voice-dot, .voice-bar[data-state="recognizing"] .voice-dot { width:16px; height:16px; border:2px solid var(--line-strong); border-top-color:var(--ink); background:none; animation:voice-spin .8s linear infinite; }
.voice-bar[data-state="error"] .voice-dot { background:var(--muted); }
.voice-text { flex:1; min-width:0; overflow:hidden; color:var(--ink); font-size:var(--fs-15); font-weight:600; white-space:nowrap; text-overflow:ellipsis; }
.voice-bar[data-state="error"] .voice-text { color:var(--ink-2); font-size:var(--fs-13); font-weight:500; white-space:normal; }
.voice-time { flex:none; color:var(--muted); font-size:var(--fs-13); font-variant-numeric:tabular-nums; }
.voice-level { display:flex; flex:none; align-items:center; gap:3px; height:24px; }
.voice-level i { width:3px; height:100%; border-radius:2px; background:var(--accent); transform:scaleY(calc(.15 + var(--level, 0) * .85)); transition:transform 90ms linear; }
.voice-level i:nth-child(2), .voice-level i:nth-child(4) { transform:scaleY(calc(.15 + var(--level, 0) * .6)); }
.voice-level i:nth-child(1), .voice-level i:nth-child(5) { transform:scaleY(calc(.15 + var(--level, 0) * .35)); }
.voice-bar:not([data-state="listening"]) :is(.voice-time, .voice-level, .voice-done) { display:none; }
.voice-bar button { display:grid; flex:none; place-items:center; min-width:40px; height:40px; padding:0; border:0; border-radius:var(--r-control); background:transparent; color:var(--ink-2); }
.voice-bar button:hover { background:var(--sunken); color:var(--ink); }
.voice-bar .voice-done { display:inline-flex; gap:6px; padding:0 12px 0 8px; background:var(--accent); color:var(--surface); font-weight:600; }
.voice-bar .voice-done:hover { background:var(--accent-hover); color:var(--surface); }
.voice-bar .voice-retry { padding:0 12px; color:var(--ink); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.voice-bar .voice-retry[hidden] { display:none; }
.composer.from-voice { border-color:var(--accent-text); }
.voice-hint { margin:0 4px 6px; color:var(--ink-2); font-size:var(--fs-13); }
.voice-hint[hidden] { display:none; }
.msg.user.from-voice .voice-mark { display:inline-block; width:14px; height:14px; margin-right:6px; vertical-align:-2px; color:var(--muted); }
@keyframes voice-pulse { 50% { opacity:.3; transform:scale(.75); } }
@keyframes voice-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .voice-bar .voice-dot { animation:none; } .voice-level i { transition:none; } }

/* Expanded reading view: one centered column; the store nav joins the assistant header. */
body.assistant-expanded .storefront { display:none; }
.assistant-panel.expanded .chat-column { width:100%; max-width:820px; margin:0 auto; }
.assistant-panel.expanded .msg { font-size:var(--fs-16); line-height:1.6; }
.assistant-head .store-nav { gap:2px; }
.assistant-head .nav-btn .count-pill { position:static; }

/* Closed assistant: the panel hides; each platform places the one labelled way back. */
body.chat-closed .assistant-panel { display:none; height:auto; }
body.chat-closed .assistant-head { height:auto; }

/* Motion (the :root tokens). A change CSS cannot see (a count, a quantity, a new chat turn, a new offer) is marked by its
   change site with data-motion through play() in js/core.js; the mark goes once it has played, so a view shown again (a
   tab, the chat reopening) never replays it. What simply appears (a dialog, a toast, the voice bar) animates on show.
   Only opacity, translate and scale move (transform stays with hover and centring); the offer tint fades once. */
@keyframes m-rise { from { opacity:0; translate:0 var(--motion-rise); } }
@keyframes m-fade { from { opacity:0; } }
@keyframes m-pop { from { opacity:.5; scale:.9; } }
@keyframes m-bump { 40% { scale:1.12; } }
@keyframes m-tick-up { from { opacity:0; translate:0 .45em; } }
@keyframes m-tick-down { from { opacity:0; translate:0 -.45em; } }
@keyframes m-dialog { from { opacity:0; scale:.97; } }
@keyframes m-highlight { 0%, 20% { background-color:var(--offer-tint); box-shadow:0 0 0 6px var(--offer-tint); } }  /* holds, then fades linearly */
[data-motion="enter"] { animation:m-rise var(--motion-appear) var(--ease-out) backwards; }
[data-motion="bump"] { animation:m-bump var(--motion-press) var(--ease-out); }
/* The card's cart control: "Сагс" turns into the stepper and back; the quantity ticks up or down. */
.cart-control[data-motion="in"] > .stepper { animation:m-pop var(--motion-appear) var(--ease-out); }
.cart-control[data-motion="out"] > .add { animation:m-fade var(--motion-appear) var(--ease-out); }
.cart-control[data-motion="up"] .stepper span { animation:m-tick-up var(--motion-press) var(--ease-out); }
.cart-control[data-motion="down"] .stepper span { animation:m-tick-down var(--motion-press) var(--ease-out); }
/* A new chat turn rises in as one piece (its products with it); the follow-up chips come a beat later. */
.msg.followups[data-motion="enter"] { animation-delay:var(--motion-press); }
/* "Бүгдийг харах": the rows it reveals rise in. */
.answer[data-motion="disclose"] .extra { animation:m-rise var(--motion-appear) var(--ease-out) backwards; }
/* A live offer lands (the demo's key moment): the line and the total tint once while the new price settles in. */
:is(.cart-line, .total)[data-motion="price-drop"] { border-radius:var(--r-control); animation:m-highlight var(--motion-highlight) linear; }
.cart-line[data-motion="price-drop"] [data-line-price], .total[data-motion="price-drop"] #cartTotal { animation:m-tick-down var(--motion-panel) var(--ease-out); }
/* Appearing on show: the scrim, the order confirmation, toasts, the voice bar in the composer's place. */
dialog[open]::backdrop { animation:m-fade var(--motion-appear) var(--ease-out); }
#confirmation[open] { animation:m-dialog var(--motion-appear) var(--ease-out); }
#toast:not([hidden]) { animation:m-rise var(--motion-appear) var(--ease-out); }
.voice-bar:not([hidden]) { animation:m-fade var(--motion-appear) var(--ease-out); }

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after,::backdrop { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}

/* Views (REDESIGN-V): the product's own sections, shared by the desktop page (#productPage) and the phone sheet
   (#detailContent), and the desktop answer view (#answerView). Layout per platform lives in desktop.css / phone.css. */
.crumbs ol { display:flex; flex-wrap:wrap; align-items:center; gap:2px 6px; min-width:0; margin:0; padding:0; list-style:none; color:var(--muted); font-size:var(--fs-13); }
.crumbs li { display:inline-flex; align-items:center; gap:6px; min-width:0; }
.crumbs li + li::before { content:'›' / ''; color:var(--field); }
.crumbs li:last-child { color:var(--ink); font-weight:500; }
.crumbs button { padding:6px 2px; border:0; background:none; color:var(--ink-2); font:inherit; text-decoration:underline; text-decoration-color:var(--line-strong); text-underline-offset:3px; }
.crumbs button:hover { color:var(--ink); text-decoration-color:currentColor; }
.pp-photo { position:relative; min-width:0; overflow:hidden; background:var(--surface); }
.pp-photo img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain; }  /* always the whole pack */
.pp-buy { display:flex; flex-direction:column; min-width:0; }
.pp-brand { margin:0 0 4px; color:var(--muted); font-size:var(--fs-13); font-weight:500; }
.pp-buy h2 { margin:0; font-size:var(--fs-22); font-weight:700; letter-spacing:-.01em; line-height:1.2; text-wrap:balance; }
.pp-pack { margin:6px 0 0; color:var(--ink-2); }
.pp-price { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin:16px 0 0; }
.pp-price strong { font-size:var(--fs-22); font-weight:700; font-variant-numeric:tabular-nums; }
.pp-price del { color:var(--muted); font-variant-numeric:tabular-nums; }
.pp-unit { margin:2px 0 0; color:var(--muted); font-size:var(--fs-13); font-variant-numeric:tabular-nums; }
.pp-stock { display:flex; align-items:center; gap:6px; margin:12px 0 0; color:var(--ink-2); font-size:var(--fs-13); font-weight:500; }
.pp-stock .icon { width:16px; height:16px; color:var(--success); }
.pp-stock.out .icon { color:var(--muted); }
.product-why { margin:20px 0 0; padding:12px 14px; border-radius:var(--r-card); background:var(--ai-tint); }
.product-why > h3, .pp-facts > h3 { margin:0 0 8px; color:var(--ink); font-size:var(--fs-13); font-weight:600; }
.product-why p { margin:0; color:var(--ink-2); line-height:1.5; }
.why-role { display:inline-block; margin-right:8px; padding:1px 9px; border:1px solid var(--line); border-radius:var(--r-pill); background:var(--surface); color:var(--ink); font-size:var(--fs-12); font-weight:600; }
.pp-facts { margin:20px 0 0; }
.pp-chips { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; }
.pp-chips li { padding:5px 12px; border-radius:var(--r-pill); background:var(--sunken); color:var(--ink-2); font-size:var(--fs-13); }
.pp-buy .description { max-width:65ch; margin:20px 0 0; color:var(--ink-2); white-space:pre-line; overflow-wrap:anywhere; }
.pp-row > h3 { margin:0 0 12px; font-size:var(--fs-20); font-weight:700; letter-spacing:-.01em; }
.pp-row .rail { height:auto; }  /* rows size to their cards (no reason footer to reserve) */
.pp-row .rail > .product { height:auto; }
.pp-row .product:hover { transform:none; }
.answer-page-head { display:grid; justify-items:start; gap:10px; max-width:75ch; }
.answer-page-head h2 { margin:0; font-size:var(--fs-22); font-weight:700; letter-spacing:-.01em; text-wrap:balance; }
.answer-advice { margin:0; color:var(--ink); font-size:var(--fs-17); line-height:1.55; }
.answer-budget { margin:0; color:var(--ink-2); font-size:var(--fs-15); font-weight:600; font-variant-numeric:tabular-nums; }
.answer-commit { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin-top:4px; }
.answer-commit .primary { font-variant-numeric:tabular-nums; }
.answer-commit:has(> [data-answer-add][hidden]):has(> .answer-report:empty) { display:none; }  /* nothing to commit or report */
.answer-report { display:flex; flex-wrap:wrap; align-items:center; gap:2px 8px; margin:0; color:var(--ink-2); font-size:var(--fs-13); font-variant-numeric:tabular-nums; }
.answer-report:empty { display:none; }
.answer-report .text-button { padding:4px 0; color:var(--ink); font-weight:600; }
.answer-group > h3 { display:flex; align-items:baseline; gap:8px; margin:0 0 12px; font-size:var(--fs-20); font-weight:700; letter-spacing:-.01em; }
.answer-group > h3 span { color:var(--muted); font-size:var(--fs-15); font-weight:500; font-variant-numeric:tabular-nums; }
.answer-next { display:flex; flex-wrap:wrap; gap:8px; }
