/* Alopel online store. Phone-first: most customers shop from a phone, often on a slow connection. */
:root {
  --bg: #f5f8f5;
  --surface: #ffffff;
  --surface-2: #eef4ef;
  --border: #dce5de;
  --border-strong: #c2cfc5;
  --text: #15211a;
  --text-2: #3f4f45;
  --text-3: #66766c;
  --brand: #17773a;
  --brand-hover: #11602e;
  --brand-soft: #e3f2e7;
  --on-brand: #ffffff;
  --leaf: #6cb33f;
  --red: #d6392e;
  --danger: #b93a2c;
  --danger-soft: #fbe9e6;
  --warning: #8a5a00;
  --warning-soft: #fcf1d8;
  --success: #1b7a41;
  --success-soft: #e2f3e8;
  --focus: #2563eb;
  --foot: #0f3a22;
  --foot-text: #d5e8db;
  --shadow: 0 1px 2px rgba(15, 40, 25, 0.06), 0 4px 16px rgba(15, 40, 25, 0.06);
  --shadow-lg: 0 14px 40px rgba(15, 40, 25, 0.2);
  --radius: 14px;
  --radius-sm: 9px;
  /* Buttons, search boxes and chips: fully round unless the owner picks other corners under Appearance. */
  --pill: 999px;
  color-scheme: light;
}

/* Dark colours follow the customer's device, unless the owner has chosen always light or always dark under
   Appearance (data-theme on <html>, set by src/views/layout.js). That is why the same block appears twice. The
   owner's own colours (src/appearance.js) come after this file and override both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1511;
    --surface: #151f19;
    --surface-2: #1b2820;
    --border: #273830;
    --border-strong: #365044;
    --text: #e5efe8;
    --text-2: #b0c2b6;
    --text-3: #829488;
    --brand: #4cc27a;
    --brand-hover: #63d18e;
    --brand-soft: #173826;
    --on-brand: #06200f;
    --red: #f07167;
    --danger: #f08a7e;
    --danger-soft: #3a1d19;
    --warning: #efbd5b;
    --warning-soft: #392d13;
    --success: #63d18e;
    --success-soft: #16301f;
    --focus: #79a8ff;
    --foot: #0a1a11;
    --foot-text: #b9d0c1;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1511;
  --surface: #151f19;
  --surface-2: #1b2820;
  --border: #273830;
  --border-strong: #365044;
  --text: #e5efe8;
  --text-2: #b0c2b6;
  --text-3: #829488;
  --brand: #4cc27a;
  --brand-hover: #63d18e;
  --brand-soft: #173826;
  --on-brand: #06200f;
  --red: #f07167;
  --danger: #f08a7e;
  --danger-soft: #3a1d19;
  --warning: #efbd5b;
  --warning-soft: #392d13;
  --success: #63d18e;
  --success-soft: #16301f;
  --focus: #79a8ff;
  --foot: #0a1a11;
  --foot-text: #b9d0c1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-3); }
.small { font-size: 14px; }
.i { width: 20px; height: 20px; flex: none; }
.i.big { width: 52px; height: 52px; color: var(--text-3); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 16px; padding-bottom: 56px; }
.stack { display: grid; gap: 16px; align-content: start; }
.narrow { max-width: 480px; margin: 0 auto; }
.page-title { margin: 8px 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--pill);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn.lg { min-height: 50px; padding: 10px 22px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .i { width: 18px; height: 18px; }

/* ---- header ---- */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.head {
  display: grid; align-items: center; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand nav" "search search";
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; flex: none; }
.brand-name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { grid-area: search; display: flex; align-items: center; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--pill); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 6px 10px 16px; outline: none; }
.search button { display: grid; place-items: center; width: 44px; height: 42px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.head-nav { grid-area: nav; display: flex; gap: 4px; }
.head-link { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--pill); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.head-link:hover { background: var(--surface-2); }
.head-link span { display: none; }
.cart-count {
  position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 12px; line-height: 20px;
}
@media (min-width: 560px) {
  .head-link span { display: inline; }
  .cart-link { padding-right: 14px; }
  .cart-count { position: static; }
}
@media (min-width: 820px) {
  .head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search nav"; }
  .search { max-width: 560px; justify-self: center; width: 100%; }
}

.banner { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 16px; background: var(--warning-soft); color: var(--warning); font-weight: 600; text-align: center; }

/* ---- home ---- */
.hero {
  display: grid; gap: 20px; align-items: center;
  padding: 24px 20px; margin-top: 4px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%);
  border: 1px solid var(--border);
}
.hero h1 { font-size: 30px; }
.lead { font-size: 17px; color: var(--text-2); margin: 8px 0 16px; max-width: 46ch; }
.hero-search { display: flex; gap: 8px; max-width: 560px; }
.hero-search input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface); }
.hero-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hero-search .btn span { display: none; }
.hero-logo { display: none; width: 200px; height: 200px; border-radius: 28px; background: #fff; object-fit: contain; box-shadow: var(--shadow); }
.perks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.perks li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; }
.perks .i { color: var(--brand); }
@media (min-width: 560px) {
  .hero-search .btn span { display: inline; }
  .perks { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr auto; padding: 36px 40px; }
  .hero h1 { font-size: 38px; }
  .hero-logo { display: block; }
}

.block { margin-top: 32px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.block-head a .i { width: 16px; height: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none; scroll-snap-align: start;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip span { color: var(--text-3); font-weight: 500; font-size: 13px; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }
.how .steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.how .steps li { counter-increment: step; display: grid; gap: 2px; padding: 16px 16px 16px 60px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.how .steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 16px;
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 800;
}
.how .steps span { color: var(--text-2); }
@media (min-width: 760px) { .how .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---- search suggestions ---- */
/* Under the search box while the customer types (public/js/shop.js). The one in the page goes under the sticky
   header when scrolled; the header's own sits above everything. */
.has-suggest { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  display: grid; gap: 2px; max-height: min(70vh, 480px); overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: left;
}
.hero-search .suggest { z-index: 15; }
.suggest-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.suggest-item:hover, .suggest-item.active { background: var(--surface-2); }
.suggest-thumb { display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.suggest-thumb img { width: 100%; height: 100%; object-fit: contain; }
.suggest-thumb .ph .i { width: 55%; height: 55%; opacity: 0.6; }
.suggest-cat .suggest-thumb { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.suggest-text { display: grid; min-width: 0; }
.suggest-name { overflow: hidden; font-weight: 600; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.suggest-name mark { padding: 0 1px; border-radius: 3px; background: var(--brand-soft); color: inherit; }
.suggest-meta { font-size: 13px; color: var(--text-3); }
.suggest-meta b { color: var(--text); }
.suggest-meta .in { color: var(--success); }
.suggest-fix { min-height: 40px; font-size: 15px; color: var(--text-2); }
.suggest-fix b { color: var(--brand); }
.suggest-all { justify-content: center; min-height: 44px; margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--brand); font-weight: 700; font-size: 15px; }
.suggest-all .i { width: 18px; height: 18px; }
.suggest-empty { margin: 0; padding: 12px 10px; color: var(--text-3); font-size: 15px; }
.suggest-hint { margin: 0; padding: 6px 10px 4px; color: var(--text-3); font-size: 14px; }
.suggest-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px 10px; color: var(--text-3); font-size: 13px; font-weight: 600; }
.suggest-clear { padding: 4px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--brand); font-weight: 600; cursor: pointer; }
.suggest-clear:hover { background: var(--surface-2); }
.suggest-recent { min-height: 44px; }
.suggest-recent .i { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.suggest-hint b { color: var(--text-2); }

/* ---- slideshow (home page) ---- */
/* A row of slides that scrolls sideways and snaps, so a swipe works with or without the script; the script adds
   the arrows, dots and turning by itself. On phones the words sit under the picture, so a short banner is never
   covered; from 560px they lie over it. */
.slides { margin-top: 4px; }
.slides + .hero { margin-top: 16px; }
.slides-frame { position: relative; }
/* The row keeps the height of its tallest slide, so the page below never jumps as the slides turn. Each slide
   has its own frame, so on a phone a picture with no words under it is just the picture. */
.slides-track {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.slides-track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; display: flex; flex-direction: column; overflow: hidden; scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
/* overflow: hidden makes the chosen shape win over the picture's own proportions. */
.slide-media { display: block; aspect-ratio: 3 / 1; overflow: hidden; background: var(--surface-2); }
.slides[data-shape="standard"] .slide-media { aspect-ratio: 2 / 1; }
.slides[data-shape="tall"] .slide-media { aspect-ratio: 16 / 9; }
.slide-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-copy { display: grid; gap: 4px; justify-items: start; padding: 12px 16px 14px; }
.slide-copy h2 { font-size: 18px; }
.slide-copy p { margin: 0; color: var(--text-2); font-size: 15px; }
.slide-copy .btn { margin-top: 6px; }
.slides-arrow {
  position: absolute; top: 50%; z-index: 1; display: none; place-items: center; width: 42px; height: 42px; transform: translateY(-50%);
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #15211a; box-shadow: var(--shadow); cursor: pointer;
}
.slides-prev { left: 12px; }
.slides-next { right: 12px; }
.slides-bar { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 6px; }
.slides-dot, .slides-pause { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-3); cursor: pointer; }
.slides-dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); transition: width 0.2s; }
.slides-dot[aria-current="true"]::before { width: 22px; background: var(--brand); }
.slides-pause .i { width: 16px; height: 16px; }
.slides-pause[aria-pressed="true"] .pause, .slides-pause[aria-pressed="false"] .play { display: none; }
@media (min-width: 560px) {
  .slides-arrow { display: grid; }
  .slide-copy {
    position: absolute; inset: auto 0 0 0; padding: 48px 24px 20px; color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
  }
  .slide-copy h2 { font-size: 24px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
  .slide-copy p { max-width: 52ch; color: rgba(255, 255, 255, 0.92); }
  .slide-copy .btn:not(.primary) { background: #fff; color: #15211a; border-color: #fff; }
}
@media (min-width: 900px) {
  .slide-copy { padding: 64px 40px 32px; }
  .slide-copy h2 { font-size: 32px; }
  .slide-copy p { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .slides-dot::before { transition: none; } }

/* ---- product cards ---- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.list-main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .list-main .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: box-shadow 0.15s, border-color 0.15s; }
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
/* 4:3 rather than square: most products start without a photo, and a shorter tile fits more on a phone. */
.card-media { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; }
.ph .i { width: 30%; height: 30%; opacity: 0.5; }
.ph-0 { background: #e6f4ea; color: #17773a; }
.ph-1 { background: #e7f1f7; color: #23628a; }
.ph-2 { background: #fdf0e3; color: #a35b16; }
.ph-3 { background: #f3ecf8; color: #6f4296; }
.ph-4 { background: #fdeceb; color: #b23a30; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ph-0 { background: #17301f; color: #7fd49d; }
  :root:not([data-theme="light"]) .ph-1 { background: #172734; color: #8cc3e6; }
  :root:not([data-theme="light"]) .ph-2 { background: #34261a; color: #f0b37a; }
  :root:not([data-theme="light"]) .ph-3 { background: #2a2134; color: #c9a6ea; }
  :root:not([data-theme="light"]) .ph-4 { background: #361d1b; color: #f09c94; }
}
:root[data-theme="dark"] .ph-0 { background: #17301f; color: #7fd49d; }
:root[data-theme="dark"] .ph-1 { background: #172734; color: #8cc3e6; }
:root[data-theme="dark"] .ph-2 { background: #34261a; color: #f0b37a; }
:root[data-theme="dark"] .ph-3 { background: #2a2134; color: #c9a6ea; }
:root[data-theme="dark"] .ph-4 { background: #361d1b; color: #f09c94; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 10px 12px 12px; }
.card-name {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.card-name:hover { color: var(--brand); }
.card-price { margin: 2px 0 0; }
.card-price b { color: var(--brand); font-size: 17px; }
.card-price span, .card-more { color: var(--text-3); font-size: 13px; margin: 0; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.add .i { width: 16px; height: 16px; }
.stock { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--success); }
.stock.low { color: var(--warning); }
.stock.out { color: var(--text-3); }

/* ---- lists ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.list-head h1 { font-size: 24px; }
.list-head p { margin: 2px 0 0; }
.sort label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
select { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.list-layout { display: grid; gap: 16px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cats a {
  flex: none; display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.cats a span { color: var(--text-3); font-weight: 500; font-size: 12px; }
.cats a.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.cats a.on span { color: inherit; opacity: 0.8; }
@media (min-width: 960px) {
  .list-layout { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
  .cats { flex-direction: column; gap: 2px; overflow: visible; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
  .cats a { justify-content: space-between; border: 0; border-radius: var(--radius-sm); background: transparent; padding: 8px 12px; }
  .cats a:hover { background: var(--surface-2); }
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty h1 { font-size: 22px; }
.empty .actions { justify-content: center; margin-top: 8px; }

/* ---- product page ---- */
.product { display: grid; gap: 20px; }
.product-media { aspect-ratio: 1; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 560px; width: 100%; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.product-cat { display: inline-block; margin-bottom: 6px; font-size: 14px; font-weight: 600; text-decoration: none; text-transform: uppercase; letter-spacing: 0.04em; }
.product-info h1 { font-size: 26px; }
.product-price { margin: 10px 0 16px; }
.product-price b { font-size: 30px; color: var(--brand); }
.product-price span { color: var(--text-3); }
.sizes { border: 0; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.sizes legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.size {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio name price" "radio stock stock";
  align-items: center; gap: 0 12px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.size input { grid-area: radio; width: 20px; height: 20px; accent-color: var(--brand); }
.size-name { grid-area: name; font-weight: 600; }
.size-name small { color: var(--text-3); font-weight: 500; }
.size-price { grid-area: price; font-weight: 700; }
.size-stock { grid-area: stock; font-size: 13px; color: var(--text-3); }
.size:has(input:checked), .size.on { border-color: var(--brand); background: var(--brand-soft); }
.size:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.buy-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.buy-row .btn { flex: 1; min-width: 180px; }
.buy-stock { margin: 10px 0 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface); overflow: hidden; }
.stepper .step { display: grid; place-items: center; width: 44px; height: 48px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.stepper .step:hover { background: var(--surface-2); }
.stepper .step .i { width: 18px; height: 18px; }
.stepper input { width: 52px; height: 48px; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.sm .step { width: 34px; height: 36px; }
.stepper.sm input { width: 40px; height: 36px; }
.product-desc { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-2); }
.help-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.help-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 15px; }
.help-list .i { color: var(--brand); margin-top: 2px; }
@media (min-width: 860px) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .product-media { position: sticky; top: 90px; }
  .product-info h1 { font-size: 30px; }
}

/* ---- panels, forms, notices ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 18px; }
.panel h2 .i { color: var(--brand); }
.step-num { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 800; }
.panel > :last-child { margin-bottom: 0; }
.opt { color: var(--text-3); font-weight: 500; font-size: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 15px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; font-weight: 400;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-weight: 400; font-size: 13.5px; color: var(--text-3); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.notice .i { margin-top: 2px; }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.err { background: var(--danger-soft); color: var(--danger); }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px;
  padding: 14px; cursor: pointer; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.choice input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; }
.choice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--brand); }
.choice-text { display: grid; gap: 2px; }
.choice-text small { color: var(--text-3); font-size: 14px; }
.choice-price { font-style: normal; font-weight: 700; font-size: 14px; text-align: right; }
.choice:has(input:checked), .choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:checked) .choice-icon, .choice.on .choice-icon { background: var(--surface); }
@media (max-width: 420px) {
  .choice { grid-template-columns: auto 1fr; }
  .choice-icon { display: none; }
  .choice-price { grid-column: 2; text-align: left; }
}

/* ---- cart and checkout ---- */
.cart-layout { display: grid; gap: 16px; }
.cart-lines { display: grid; gap: 10px; }
.cart-line {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info remove" "img qty total";
  gap: 6px 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.cart-line.problem { border-color: var(--warning); }
.cart-img { grid-area: img; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; align-self: start; }
.cart-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cart-img .ph .i { width: 50%; height: 50%; }
.cart-info { grid-area: info; min-width: 0; }
.cart-info a { color: var(--text); font-weight: 600; text-decoration: none; }
.cart-info a:hover { color: var(--brand); }
.cart-info .meta { font-size: 14px; color: var(--text-3); }
.cart-info .warn { font-size: 14px; color: var(--warning); font-weight: 600; }
.cart-qty { grid-area: qty; }
.cart-total { grid-area: total; text-align: right; font-weight: 700; }
.cart-remove { grid-area: remove; justify-self: end; border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 6px; border-radius: 8px; }
.cart-remove:hover { color: var(--danger); background: var(--danger-soft); }
.sum-rows { display: grid; gap: 8px; margin: 0 0 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; }
.sum-row.total { padding-top: 10px; border-top: 1px solid var(--border); font-size: 20px; font-weight: 800; }
.sum-lines { display: grid; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; }
.sum-line span:first-child { color: var(--text-2); }
.summary .btn.block { margin: 6px 0 12px; }
.checkout { display: grid; gap: 16px; }
.co-main { display: grid; gap: 16px; align-content: start; }
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .checkout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .co-side, .cart-side { position: sticky; top: 90px; }
}

/* ---- order page ---- */
.order-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.order-head p { margin: 0 0 2px; }
.status { display: inline-flex; padding: 6px 14px; border-radius: var(--pill); font-weight: 700; font-size: 15px; background: var(--surface-2); color: var(--text-2); }
.status.s-awaiting_confirmation, .status.s-placed, .status.s-received { background: var(--brand-soft); color: var(--brand); }
.status.s-ready, .status.s-completed { background: var(--success-soft); color: var(--success); }
.status.s-awaiting_fee, .status.s-awaiting_payment { background: var(--warning-soft); color: var(--warning); }
.status.s-cancelled { background: var(--danger-soft); color: var(--danger); }
.progress { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: s; }
.progress li { counter-increment: s; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; font-size: 13px; line-height: 1.25; color: var(--text-3); }
.progress li span { display: block; width: 100%; padding: 0 2px; }
.progress li::before {
  content: counter(s); position: relative; z-index: 1; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); font-weight: 700;
}
.progress li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); }
.progress li:first-child::after { display: none; }
.progress li.done, .progress li.now { color: var(--text); font-weight: 600; }
.progress li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.progress li.now::before { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.progress li.done::after, .progress li.now::after { background: var(--brand); }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.order-actions:empty { display: none; }
.order-cols { display: grid; gap: 16px; }
@media (min-width: 900px) { .order-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.lines th { text-align: left; font-size: 13px; color: var(--text-3); font-weight: 600; padding: 0 6px 8px; border-bottom: 1px solid var(--border); }
.lines td { padding: 10px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines td small { display: block; color: var(--text-3); font-size: 13px; }
.lines .num { text-align: right; white-space: nowrap; }
.lines tfoot td { border-bottom: 0; padding: 6px; color: var(--text-2); }
.lines tfoot .total td { font-size: 18px; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; }
@media (max-width: 520px) { .hide-sm { display: none; } }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.bank dt { color: var(--text-3); }
.bank dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct { font-size: 18px; letter-spacing: 0.04em; }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--success); font-weight: 600; }
.help-grid { display: grid; gap: 16px; }
.help-grid ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
@media (min-width: 860px) { .help-grid { grid-template-columns: 1fr 1fr; } }

/* ---- customers' accounts ---- */
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.field .check-line { margin: 2px 0; }
.field input[hidden] { display: none; }
.signed-in-as { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; }
.signed-in-as .i { width: 18px; height: 18px; color: var(--brand); }
.account-switch { margin: 16px 0; text-align: center; }
.forgot summary { font-weight: 600; cursor: pointer; }
.forgot[open] summary { margin-bottom: 10px; }
.account-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.account-head p { margin: 0 0 2px; }
.account-cols { display: grid; gap: 16px; }
@media (min-width: 900px) { .account-cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.account-orders { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.account-orders a {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.account-orders a:hover { border-color: var(--brand); }
.account-order-main { display: grid; gap: 2px; }
.account-order-main .muted { font-size: 14px; }
.account-order-side { display: flex; align-items: center; gap: 12px; }
.account-order-side .status { padding: 4px 10px; font-size: 13px; }
.account-offer { margin-bottom: 16px; border-color: var(--brand); background: var(--brand-soft); }
.account-offer-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.account-offer-form .field { flex: 1; min-width: 220px; margin: 0; }
.account-offer .notice { margin: 12px 0 0; }

/* ---- footer ---- */
.site-foot { background: var(--foot); color: var(--foot-text); padding: 32px 0 20px; font-size: 15px; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot { display: grid; gap: 20px; }
.foot b { display: block; color: #fff; font-size: 17px; margin-bottom: 8px; }
.foot p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; }
.foot p a { display: inline-flex; gap: 8px; align-items: center; }
.foot .i { width: 18px; height: 18px; margin-top: 2px; opacity: 0.85; }
.foot-links { display: grid; gap: 8px; align-content: start; }
.foot-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; opacity: 0.8; }
@media (min-width: 760px) { .foot { grid-template-columns: 1.3fr 1fr 1fr; } }

/* ---- live chat ---- */
/* A round button on phones, with its label from 560px. On phones the window fills the screen. */
.chat-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand);
  font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-lg);
}
.chat-fab:hover { background: var(--brand-hover); }
.chat-fab .i { width: 24px; height: 24px; }
.chat-fab span { display: none; }
.chat-fab.online::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--leaf); border: 2px solid var(--surface); }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--surface);
  background: var(--red); color: #fff; font-size: 12px; line-height: 1;
}
.chat.open .chat-fab { display: none; }
.chat-panel { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; background: var(--surface); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; background: var(--brand); color: var(--on-brand); }
.chat-head img { width: 36px; height: 36px; border-radius: 9px; background: #fff; object-fit: contain; flex: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 13px; line-height: 1.3; }
.chat-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #c9d3cc; box-shadow: 0 0 0 2px #fff; transform: translateY(-1px); }
.chat-status.on::before { background: #2ecc71; }
.chat-restart { flex: none; padding: 4px 10px; border: 1px solid currentColor; border-radius: var(--pill); background: transparent; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-close { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.chat-restart:hover, .chat-close:hover { background: rgba(255, 255, 255, 0.16); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
.msg { display: grid; gap: 3px; max-width: 85%; }
.msg p { margin: 0; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; }
.msg.them p { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; justify-items: end; }
.msg.me p { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 5px; }
.msg-meta { padding: 0 6px; font-size: 12px; color: var(--text-3); }
.chat-note { margin: 0; font-size: 14px; color: var(--text-3); text-align: center; }
.chat-form { display: grid; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chat-who label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chat-who .opt { font-size: inherit; }
.chat-who .hint { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.chat-who input:not([type=checkbox]), .chat-row textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.chat-wa, .chat-wide { grid-column: 1 / -1; }
.chat-wa { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chat-wa input[type=tel] { flex-basis: 100%; }
.chat-who .chat-same { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.chat-same input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.chat-as { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; color: var(--text-2); }
.chat-as .i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--brand); }
.chat-as-text { display: grid; gap: 1px; min-width: 0; }
.chat-as-text b { color: var(--text); }
.chat-as-text span { font-size: 13px; overflow-wrap: anywhere; }
.chat-who-one { grid-template-columns: 1fr; margin-top: 8px; }
.chat-who-one:empty { display: none; }
.chat-change { margin-left: auto; padding: 4px 6px; border: 0; background: none; color: var(--brand); font-weight: 600; text-decoration: underline; cursor: pointer; }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row textarea { flex: 1; max-height: 120px; padding: 10px 14px; border-radius: 22px; line-height: 1.4; resize: none; overflow-y: hidden; }
.chat-who input:focus, .chat-row textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chat-send { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brand); color: var(--on-brand); cursor: pointer; }
.chat-send:hover { background: var(--brand-hover); }
.chat-send:disabled { opacity: 0.5; cursor: wait; }
.chat-error { margin: 0; font-size: 14px; color: var(--danger); }
/* Attaching a photo or document. */
.chat-attach { display: grid; place-items: center; flex: none; width: 42px; height: 46px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.chat-attach:hover { color: var(--brand); background: var(--surface-2); }
.chat-attach:disabled { opacity: 0.5; cursor: wait; }
.chat-attach[aria-expanded="true"] { color: var(--brand); background: var(--brand-soft); }
/* Take a photo, a photo from the phone, or a document: just above the message box. */
.chat-attach-menu { display: grid; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.chat-attach-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.chat-attach-menu button:hover, .chat-attach-menu button:focus-visible { background: var(--surface-2); }
.chat-attach-menu .i { width: 20px; height: 20px; color: var(--brand); }
.chat-pending { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.chat-pending img, .chat-pending-icon { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.chat-pending-icon { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.chat-pending-text { display: grid; flex: 1; min-width: 0; }
.chat-pending-text b { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.chat-pending-text small { font-size: 13px; color: var(--text-3); }
.chat-pending-remove { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.chat-pending-remove:hover { background: var(--danger-soft); color: var(--danger); }
.msg-photo { display: block; }
.msg-photo img { display: block; min-width: 96px; min-height: 72px; max-width: 100%; max-height: 260px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); object-fit: cover; }
.msg-file { display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; }
.msg-file span { display: grid; min-width: 0; }
.msg-file b { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.msg-file small { font-size: 12.5px; color: var(--text-3); }
.msg-file .i { flex: none; width: 26px; height: 26px; color: var(--brand); }
.msg.me .msg-file { border-color: transparent; background: var(--brand); color: var(--on-brand); }
.msg.me .msg-file small, .msg.me .msg-file .i { color: inherit; opacity: 0.85; }
.chat-panel.dropping .chat-log { outline: 2px dashed var(--brand); outline-offset: -8px; }
/* Toasts sit above the chat button on phones, and the page behind a full-screen chat stays put. */
.has-chat .toasts { bottom: 86px; }
@media (max-width: 559px) { body.chat-open { overflow: hidden; } }
@media (min-width: 560px) {
  .chat-fab { width: auto; padding: 0 20px 0 16px; }
  .chat-fab span { display: inline; }
  .chat-panel {
    inset: auto 16px 16px auto; width: 380px; height: min(600px, calc(100vh - 32px));
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  }
  .has-chat .toasts { bottom: 20px; }
}

/* ---- toasts ---- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 12px; background: #13261b; color: #fff; box-shadow: var(--shadow-lg);
  animation: rise 0.18s ease-out;
}
.toast a { color: #9be3b4; font-weight: 700; white-space: nowrap; }
.toast.err { background: #5a1d17; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .btn { transition: none; } }
