/* HD Item design system: warm farm colours, chunky friendly controls, mobile first. */
:root {
  --cream: #fff8e9;
  --cream-deep: #f8ecd2;
  --paper: #ffffff;
  --ink: #45301f;
  --ink-soft: #7c6753;
  --ink-faint: #a8977f;
  --line: #ecdfc6;
  --green: #44a850;
  --green-dark: #2f7d3a;
  --green-soft: #e7f5e3;
  --green-light: #5ec466;
  --green-tint: #f1faee;
  --orange: #f28c28;
  --orange-dark: #c96a12;
  --orange-soft: #fff0dc;
  --sun: #ffc83d;
  --red: #e2553f;
  --red-dark: #b53c29;
  --red-soft: #fde9e4;
  --sky: #3f9fd8;
  --sky-soft: #e3f2fb;
  --wood: #b97a45;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 0 rgba(120, 84, 40, .08), 0 10px 24px -12px rgba(120, 84, 40, .28);
  --shadow-lift: 0 4px 0 rgba(120, 84, 40, .08), 0 18px 36px -14px rgba(120, 84, 40, .38);
  --font: 'Prompt', 'Leelawadee UI', 'Noto Sans Thai', Tahoma, sans-serif;
  --topbar: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
/* A second tap on the same spot must not zoom the page (taps here are fast and repeated);
   pinch zoom and scrolling stay as they are. */
* { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(rgba(185, 122, 69, .09) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(26px, 5vw, 44px); }
h2 { font-size: clamp(20px, 3vw, 28px); }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: 2px; border-radius: 8px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: Consolas, 'SF Mono', monospace; letter-spacing: .3px; }
.price { color: var(--orange-dark); font-weight: 700; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 24px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  background: rgba(255, 250, 238, .92); backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--line);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-links { display: none; gap: 4px; margin-left: 12px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; }
.nav-links a:hover { background: var(--cream-deep); text-decoration: none; color: var(--ink); }
@media (min-width: 860px) { .nav-links { display: flex; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 600; font-size: 15px;
  line-height: 1.2; cursor: pointer; text-align: center; white-space: nowrap; user-select: none;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 0 var(--line);
  transition: transform .06s ease, box-shadow .06s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.04); text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px var(--line), 0 1px 0 var(--line); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: linear-gradient(var(--green-light), var(--green)); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--green-dark); }
.btn-accent { background: linear-gradient(#ffb04a, var(--orange)); color: #fff; box-shadow: 0 3px 0 var(--orange-dark); }
.btn-accent:active { box-shadow: 0 1px 0 var(--orange-dark); }
.btn-danger { background: linear-gradient(#ef735f, var(--red)); color: #fff; box-shadow: 0 3px 0 var(--red-dark); }
.btn-danger:active { box-shadow: 0 1px 0 var(--red-dark); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--cream-deep); color: var(--ink); }
.btn-ghost:active { box-shadow: none; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 11px; }
.btn-lg { min-height: 52px; padding: 13px 24px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }

/* ---- cards ---- */
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.card-title svg { width: 20px; height: 20px; color: var(--green-dark); flex: none; }
@media (min-width: 720px) { .card-pad { padding: 22px; } }
.divider { height: 1.5px; background: var(--line); border: 0; margin: 14px 0; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-weight: 600; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fffdf8; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(68, 168, 80, .16); }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input-sm { min-height: 36px; padding: 6px 10px; }
.input-affix { position: relative; }
.input-affix .input { padding-left: 38px; }
.input-affix > svg, .input-affix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 46px; height: 26px; border-radius: 999px; background: #d9cdb6; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: 2px; }

/* ---- pills, chips, alerts ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--cream-deep); color: var(--ink-soft); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill svg { width: 13px; height: 13px; flex: none; }
.pill-green { background: var(--green-soft); color: var(--green-dark); }
.pill-orange { background: var(--orange-soft); color: var(--orange-dark); }
.pill-red { background: var(--red-soft); color: var(--red-dark); }
.pill-blue { background: var(--sky-soft); color: #1f6fa3; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.chip:hover { border-color: var(--green); color: var(--ink); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-dark); }
.chip .count { font-size: 12px; font-weight: 600; opacity: .75; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--sky-soft); color: #1d5f8b; font-size: 14px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-warn { background: var(--orange-soft); color: #8a4a08; }
.alert-danger { background: var(--red-soft); color: var(--red-dark); }
.alert-ok { background: var(--green-soft); color: var(--green-dark); }

/* ---- toast ---- */
.toasts { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { padding: 11px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow-lift); animation: rise .2s ease; text-align: center; }
.toast.err { background: var(--red-dark); }
.toast.ok { background: var(--green-dark); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- modal (a bottom sheet on phones) ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(60, 40, 20, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal { width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lift); animation: sheet .22s ease; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.modal-head h3 { flex: 1; font-size: 19px; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 6px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal.tall { height: 92vh; height: 92dvh; }
.modal-foot[hidden] { display: none; }
/* While a dialog is open the page behind stays put, and its blurred bars stop costing a repaint a frame. */
html.modal-open { overflow: hidden; }
.modal-open .topbar, .modal-open .toolbar { -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-width: 520px; border-radius: 22px; animation: pop .18s ease; }
  .modal.tall { height: min(86vh, 760px); }
  .modal.wide { max-width: 760px; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---- empty states, skeletons ---- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 34px 18px; }
.empty img { width: 150px; height: 150px; object-fit: contain; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--ink-soft); max-width: 420px; }
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, #f3e8d2 25%, #fbf3e2 37%, #f3e8d2 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; min-height: 18px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- item icons ---- */
.item-icon { width: 44px; height: 44px; flex: none; object-fit: contain; }
.item-icon.lg { width: 76px; height: 76px; }
.item-icon.sm { width: 30px; height: 30px; }
.item-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-line .names { min-width: 0; }
.item-line .names b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-line .names small { color: var(--ink-faint); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- tables (cards on phones) ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #f4ead6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffaf0; }
@media (max-width: 719px) {
  .table.stackable thead { display: none; }
  .table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 10px 0; border-bottom: 1.5px solid var(--line); }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { border: 0; padding: 3px 0; }
  .table.stackable td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 96px; color: var(--ink-soft); font-size: 12.5px; }
}

/* ---- landing ---- */
.hero { position: relative; overflow: hidden; background: #8fd0f2; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 248, 233, .9) 0%, rgba(255, 248, 233, .72) 46%, rgba(255, 248, 233, .1) 100%); }
.hero-inner { position: relative; z-index: 1; padding: 44px 16px 230px; }
.hero h1 { max-width: 520px; text-wrap: balance; }
.hero-wordmark { display: block; width: 190px; height: auto; margin: 0 0 14px -4px; filter: drop-shadow(0 3px 0 rgba(74, 53, 32, .18)); }
@media (min-width: 900px) { .hero-wordmark { width: 250px; } }
.hero p.lead { max-width: 500px; margin-top: 12px; font-size: 17px; color: #5d4733; }
.hero .row { margin-top: 22px; }
@media (min-width: 860px) {
  .hero::after { background: linear-gradient(90deg, rgba(255, 248, 233, .97) 0%, rgba(255, 248, 233, .92) 36%, rgba(255, 248, 233, .5) 56%, rgba(255, 248, 233, 0) 76%); }
  .hero-inner { padding: 86px 16px 110px; }
  .hero-art { object-position: 100% 50%; }
}
.section { padding: 46px 0; }
.section-head { text-align: center; margin-bottom: 26px; }
.section-head p { color: var(--ink-soft); margin-top: 6px; }
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature { text-align: center; padding: 22px 18px; }
.feature img { width: 124px; height: 124px; margin: 0 auto 8px; object-fit: contain; }
.feature p { color: var(--ink-soft); margin-top: 6px; font-size: 14.5px; }
.steps-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step-card { padding: 20px; position: relative; }
.step-card::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sun); color: #6b4a00; font-weight: 700; font-size: 18px; box-shadow: 0 3px 0 #dba412; margin-bottom: 10px; }
.step-card p { color: var(--ink-soft); margin-top: 4px; font-size: 14.5px; }
.shop-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shop-card { overflow: hidden; color: var(--ink); display: block; transition: transform .12s ease, box-shadow .12s ease; }
.shop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
.shop-card .cover { height: 92px; background-size: cover; background-position: right center; }
.shop-card .body { padding: 0 16px 16px; display: flex; gap: 12px; align-items: flex-end; margin-top: -26px; }
.shop-card .body > div { min-width: 0; padding-top: 30px; }
.shop-logo { width: 64px; height: 64px; border-radius: 18px; border: 3px solid #fff; background: var(--green-soft); box-shadow: var(--shadow); object-fit: cover; flex: none; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--green-dark); }
.price-card { max-width: 440px; margin: 0 auto; text-align: center; padding: 28px 22px; border-color: var(--sun); border-width: 2.5px; }
.price-big { font-size: 52px; font-weight: 700; color: var(--green-dark); line-height: 1; }
.checks { list-style: none; padding: 0; margin: 18px 0; text-align: left; display: grid; gap: 9px; }
.checks li { display: flex; gap: 9px; align-items: flex-start; }
.checks svg { width: 20px; height: 20px; color: var(--green); flex: none; margin-top: 2px; }
.footer { padding: 26px 0 40px; color: var(--ink-soft); font-size: 13.5px; text-align: center; }

/* ---- auth ---- */
.auth-wrap { min-height: calc(100vh - var(--topbar)); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.auth-art { display: none; background: linear-gradient(160deg, #cdeebf, #9ad98d); padding: 28px; text-align: center; color: #25562d; }
.auth-art img { width: 210px; margin: 0 auto 8px; }
.auth-art img.auth-wordmark { width: 170px; margin-bottom: 4px; }
.auth-form { padding: 26px 22px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line, #eadfc8); }
.terms-box { max-height: 320px; overflow-y: auto; background: var(--cream); border: 1.5px solid var(--line, #eadfc8); border-radius: 14px; padding: 14px 16px; }
.terms-box h4 { font-size: 15.5px; margin-bottom: 8px; }
.terms-box ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; }
.terms-box li b { display: block; }
.terms-box li span { color: var(--ink-soft); }
.plan-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.plan-perks > div { background: var(--cream); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; border: 1.5px solid transparent; }
.plan-perks > div.on { background: var(--green-soft); border-color: var(--green-light, #9ad98d); }
.plan-perks span { color: var(--ink-soft); font-size: 14px; }
.fb-gate { max-width: 620px; margin: 24px auto; }
.fb-gate ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-soft); font-size: 14px; }
.fb-code { display: inline-block; font: 700 20px/1 ui-monospace, Consolas, monospace; letter-spacing: 2px; background: var(--cream); border-radius: 10px; padding: 8px 14px; }
@media (min-width: 760px) { .auth-card { grid-template-columns: 5fr 6fr; } .auth-art { display: flex; flex-direction: column; justify-content: center; } .auth-form { padding: 36px; } }

/* ---- storefront ---- */
.shop-hero { position: relative; background-size: cover; background-position: right center; background-color: #bfe3f5; }
.shop-hero.hero-classic::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(40, 26, 12, .62) 0%, rgba(40, 26, 12, .36) 55%, rgba(40, 26, 12, .08) 100%); }
.shop-hero-inner { position: relative; display: flex; gap: 14px; align-items: center; padding: 22px 0; color: #fff; min-height: 150px; }
.shop-hero .shop-logo { width: 78px; height: 78px; font-size: 32px; }
.shop-hero h1 { font-size: clamp(22px, 4.5vw, 34px); text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.shop-hero .tagline { opacity: .95; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.shop-foot { margin-top: 34px; padding: 18px 0 96px; border-top: 1.5px dashed var(--line); color: var(--ink-soft); font-size: 13.5px; }
.shop-foot .container[hidden] { display: none; }
.shop-foot .container + .container { margin-top: 12px; }
.install-card { display: flex; align-items: center; gap: 12px; border: 2px solid var(--green); background: var(--green-tint); }
#install-slot:empty { display: none; }
.install-card > svg { width: 30px; height: 30px; color: var(--green-dark); flex: none; }
.install-card img { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.shop-foot .container { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center; }
.shop-tabs { display: flex; gap: 4px; margin-top: 14px; box-shadow: inset 0 -2px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
               border-bottom: 3px solid transparent; border-radius: 12px 12px 0 0; }
.shop-tabs a svg { width: 17px; height: 17px; }
.shop-tabs a span { background: var(--cream-deep); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; }
.shop-tabs a:hover { color: var(--ink); }
.shop-tabs a.on { color: var(--green-dark); border-bottom-color: var(--green); }
.shop-tabs a.on span { background: var(--green-soft); }
.shop-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.shop-meta .pill { background: rgba(255, 255, 255, .92); color: var(--ink); }
.shop-meta .pill.pill-green { color: var(--green-dark); }
.shop-meta .pill.pill-red { color: var(--red-dark); }
@media (min-width: 760px) { .shop-hero-inner { min-height: 210px; padding: 30px 0; } .shop-hero .shop-logo { width: 104px; height: 104px; font-size: 42px; border-radius: 26px; } }

.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px 0 110px; }
@media (min-width: 1040px) { .shop-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; padding-bottom: 50px; } }
.toolbar { position: sticky; top: var(--topbar); z-index: 20; background: rgba(255, 248, 233, .95); backdrop-filter: blur(8px); padding: 10px 0 6px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
.toolbar-row { display: flex; gap: 8px; margin-bottom: 8px; }
.toolbar-row .select { width: auto; min-width: 0; flex: none; padding-right: 6px; }
.group-title { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 10px; font-size: 18px; font-weight: 700; }
.group-title span { font-size: 13px; color: var(--ink-faint); font-weight: 500; }
.shelf-count { font-size: 12.5px; color: var(--ink-faint); margin: 2px 2px 6px; }
.seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 12px; background: var(--cream-deep); }
.seg button { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 2px rgba(90, 60, 20, .2); }
.seg svg { width: 18px; height: 18px; }
.step-row { display: flex; align-items: center; gap: 8px; padding: 2px 0 4px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.step-tip { overflow: hidden; text-overflow: ellipsis; color: var(--ink-faint); }
.chip.sm { padding: 5px 11px; font-size: 13px; }
#subs { margin-top: 2px; }

/* The automatic pick: its entry button above the shelf, and the result sheet. */
.autopick { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 4px; padding: 8px 12px 8px 8px; border: 1.5px solid #f3d38a; border-radius: 16px; background: linear-gradient(100deg, #fff4cf, #ffe9c2); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 2px 0 #ecc876; }
.autopick:active { transform: translateY(2px); box-shadow: none; }
.autopick img { width: 46px; height: 46px; flex: none; }
.autopick span { flex: 1; min-width: 0; line-height: 1.3; }
.autopick b { display: block; font-size: 15px; }
.autopick small { display: block; font-size: 12px; color: var(--ink-soft); }
.autopick svg { width: 20px; height: 20px; flex: none; color: var(--orange-dark); }
.ap-box { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fffdf8; }
.ap-box.on { border-color: var(--green); background: #f6fbf4; }
.ap-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0 0; }
.ap-row .item-icon { width: 38px; height: 38px; }
.ap-row .names b { display: block; font-weight: 600; }
.ap-row .names small { color: var(--ink-faint); font-size: 12px; }
.ap-result { text-align: right; line-height: 1.2; }
.ap-result small { display: block; font-size: 11px; }
.ap-pick { font-size: 18px; color: var(--green-dark); }
.ap-spin { width: 28px; height: 28px; color: var(--green); margin-top: 6px; }
.ap-top { display: flex; align-items: center; gap: 10px; }
.ap-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 12px; }
.ap-meter { min-width: 0; }
.ap-meter .bar { display: flex; height: 8px; margin: 4px 0 2px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; }
.ap-meter .bar i { display: block; height: 100%; background: var(--green); }
.ap-meter .bar i.add { background: var(--orange); }
.ap-goals { display: flex; width: 100%; }
.ap-goals button { flex: 1; min-width: 0; height: 38px; padding: 0 4px; font-size: 13.5px; white-space: nowrap; }
.ap-part { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ap-part:empty { display: none; }
.ap-settings { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 10px 14px; align-items: end; }
.ap-settings .label { display: block; margin-bottom: 5px; font-size: 13px; }
.ap-settings .input { min-width: 0; }
.ap-settings .seg button { min-width: 32px; padding: 0 7px; }
.ap-settings .row-tight .input { flex: 1; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
.ap-notes { margin: 0; padding-left: 20px; font-size: 13px; color: #8a4a08; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.ap-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 5px 2px 4px; border-radius: 12px; background: #fff6e2; text-align: center; line-height: 1.15; }
.ap-cell .item-icon { width: 34px; height: 34px; }
.ap-cell b { font-size: 13px; color: var(--orange-dark); }
.ap-cell small { width: 100%; font-size: 10.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-foot { line-height: 1.2; }
.ap-foot b { font-size: 21px; }

/* A dense shelf: as many items a screen as stay readable. The whole tile is the button. */
.tile-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.tile { display: flex; flex-direction: column; min-width: 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; transition: border-color .1s ease, background .1s ease; }
.tile-hit { all: unset; box-sizing: border-box; flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 6px 4px 1px; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile-hit:focus-visible { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: -3px; border-radius: 12px; }
.tile-hit .item-icon { width: 48px; height: 48px; }
.tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; height: 2.4em; margin-top: 2px; font-size: 11.5px; line-height: 1.2; font-weight: 500; overflow-wrap: anywhere; }
.tile-price { font-size: 13.5px; font-weight: 700; color: var(--orange-dark); line-height: 1.3; }
.foot { display: flex; align-items: center; justify-content: center; height: 28px; padding: 0 3px 4px; }
.foot .left { font-size: 11px; color: var(--ink-faint); }
.tile:hover { border-color: #d9c79f; }
.tile.in-cart, .lrow.in-cart { background: var(--green-tint); }
.tile.in-cart { border-color: var(--green); }
.tile.sold-out, .lrow.sold-out { opacity: .45; }
.tile.sold-out .tile-hit, .lrow.sold-out .lrow-hit { cursor: default; }
.bump { animation: bump .2s ease; }
@keyframes bump { 40% { transform: scale(.93); } 100% { transform: none; } }
.mini-qty { display: flex; width: 100%; height: 24px; border-radius: 8px; background: var(--green); overflow: hidden; }
.mini-qty button { padding: 0; border: 0; background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.mini-qty button[data-bump] { flex: none; width: 24px; font-size: 16px; line-height: 1; }
.mini-qty .num { flex: 1; min-width: 0; margin: 2px 0; border-radius: 5px; background: #fff; color: var(--green-dark); font-size: 12.5px; }
@media (min-width: 760px) {
  .tile-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
  .tile-hit { padding: 8px 6px 2px; }
  .tile-hit .item-icon { width: 58px; height: 58px; }
  .tile-name { font-size: 12.5px; }
  .tile-price { font-size: 14.5px; }
  .foot { height: 32px; padding: 0 5px 6px; }
  .mini-qty { height: 26px; }
  .mini-qty button[data-bump] { width: 28px; }
}
/* The same shelf as rows, for reading names in full. */
.lrow-list { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 96px; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid #f4ead6; }
.lrow:last-child { border-bottom: 0; }
.lrow-hit { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lrow-hit:focus-visible { outline: 3px solid rgba(63, 159, 216, .55); border-radius: 8px; }
.lrow-hit .item-icon { width: 40px; height: 40px; }
.lrow-hit .names { min-width: 0; }
.lrow-hit .names b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-hit .names small { display: block; font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-price { font-weight: 700; color: var(--orange-dark); white-space: nowrap; }
.lrow .foot { height: auto; padding: 0; justify-content: flex-end; }
.lrow .mini-qty { height: 30px; }
.lrow .foot .left { font-size: 12.5px; }
@media (min-width: 1240px) { .lrow-list { display: grid; grid-template-columns: 1fr 1fr; } .lrow:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }
.toolbar .chips { padding-bottom: 4px; }
.toolbar .chip { padding: 6px 12px; font-size: 13.5px; }
.toolbar-row { margin-bottom: 6px; }
@media (max-width: 559px) {
  /* Sort shrinks to an icon; the phone's own picker still shows the choices in full. */
  .toolbar-row .select { width: 44px; padding: 0; color: transparent; text-indent: -999px; background: #fffdf8 center / 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c6753' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M3 16l4 4 4-4M17 20V4M13 8l4-4 4 4'/%3E%3C/svg%3E"); -webkit-appearance: none; appearance: none; }
  .toolbar-row .select option { color: var(--ink); }
}
/* On phones the site header scrolls away so the search and category bar get the top of the screen. */
@media (max-width: 1039px) {
  .shop-page .topbar { position: static; }
  .shop-page .toolbar { top: 0; }
  .step-tip { display: none; }
}
.qty { display: flex; align-items: center; width: 100%; border-radius: 13px; background: var(--green-soft); padding: 3px; gap: 3px; }
.qty button { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: #fff; color: var(--green-dark); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 0 #cfe6c9; line-height: 1; }
.qty button:active { transform: translateY(1px); box-shadow: none; }
.qty input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 16px; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart { position: sticky; top: calc(var(--topbar) + 14px); display: none; max-height: calc(100vh - var(--topbar) - 28px); flex-direction: column; }
@media (min-width: 1040px) { .cart { display: flex; } }
.cart-list { overflow-y: auto; padding: 0 16px; display: flex; flex-direction: column; }
.cart-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f4ead6; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .qty { width: 118px; }
.cart-line .qty button { width: 30px; height: 30px; font-size: 17px; }
.cart-line .qty input { height: 30px; font-size: 14.5px; }
.cart-foot { padding: 14px 16px 16px; border-top: 1.5px solid var(--line); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-line b { font-size: 24px; color: var(--orange-dark); }
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 20px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lift); animation: rise .2s ease; }
.cartbar .sum { flex: 1; min-width: 0; line-height: 1.25; }
.cartbar .sum b { font-size: 18px; color: var(--sun); display: block; }
@media (min-width: 1040px) { .cartbar { display: none; } }

/* ---- order page ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 2px; }
.step { text-align: center; font-size: 12.5px; color: var(--ink-faint); font-weight: 600; position: relative; padding-top: 34px; }
.step::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 4px; background: var(--line); }
.step:first-child::before { display: none; }
.step i { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); display: grid; place-items: center; z-index: 1; font-style: normal; font-size: 13px; }
.step.done { color: var(--green-dark); }
.step.done::before, .step.now::before { background: var(--green); }
.step.done i { background: var(--green); border-color: var(--green); color: #fff; }
.step.now { color: var(--ink); }
.step.now i { border-color: var(--green); box-shadow: 0 0 0 5px rgba(68, 168, 80, .2); }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) { .pay-grid { grid-template-columns: 240px 1fr; align-items: start; } }
.qr-box { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px; text-align: center; max-width: 260px; margin: 0 auto; }
.qr-box img { width: 100%; image-rendering: pixelated; border-radius: 8px; }
.amount-big { font-size: 34px; font-weight: 700; color: var(--orange-dark); line-height: 1.1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 2px dashed #d8c7a6; border-radius: 16px; background: #fffaf0; text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--green); background: var(--green-soft); }
.drop img { max-height: 220px; border-radius: 10px; }
.drop svg { width: 30px; height: 30px; color: var(--ink-faint); }
.drop input { display: none; }
.order-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 900px) { .order-two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }

/* ---- back office shell ---- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.side { display: none; }
.main { padding: 16px 0 96px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { flex: 1 1 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; background: var(--paper); border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); position: relative; }
.tabbar a:hover { text-decoration: none; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--green-dark); }
.tabbar a .badge { position: absolute; top: 3px; left: calc(50% + 6px); }
@media (min-width: 960px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-right: 1.5px solid var(--line); background: rgba(255, 252, 244, .8); position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; }
  .side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink-soft); font-weight: 600; }
  .side a:hover { background: var(--cream-deep); text-decoration: none; color: var(--ink); }
  .side a.active { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
  .side a svg { width: 20px; height: 20px; flex: none; }
  .side a .badge { margin-left: auto; }
  .side .side-foot { margin-top: auto; padding-top: 12px; border-top: 1.5px solid var(--line); }
  .main { padding: 24px 0 48px; }
  .tabbar { display: none; }
}
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
a.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat .k { font-size: 13px; color: var(--ink-soft); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .k svg { width: 16px; height: 16px; }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat.hot { border-color: var(--orange); background: #fffaf1; }
.stat.hot .v { color: var(--orange-dark); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .bar i { width: 100%; max-width: 30px; border-radius: 7px 7px 3px 3px; background: linear-gradient(#7fd486, var(--green)); min-height: 3px; }
.bars .bar.zero i { background: var(--line); }
.bars .bar span { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.checklist { display: grid; gap: 8px; }
.checklist a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fffaf0; border: 1.5px solid var(--line); color: var(--ink); font-weight: 500; }
.checklist a:hover { border-color: var(--green); text-decoration: none; }
.checklist a.done { background: var(--green-soft); border-color: transparent; color: var(--green-dark); }
.checklist a i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d5c6a8; flex: none; display: grid; place-items: center; font-style: normal; font-size: 13px; color: #fff; }
.checklist a.done i { background: var(--green); border-color: var(--green); }
.checklist a svg { width: 16px; height: 16px; margin-left: auto; color: var(--ink-faint); }

.order-card { padding: 14px 16px; }
.order-card.need { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 140, 40, .14), var(--shadow); }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.order-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.order-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; background: #fff6e2; font-size: 13.5px; font-weight: 500; }
.order-item img { width: 26px; height: 26px; object-fit: contain; }
.order-item b { color: var(--orange-dark); }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.buyer-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.buyer-line b { color: var(--ink); font-weight: 600; }
.copy { cursor: pointer; border-bottom: 1.5px dashed #cdb893; }
.copy:hover { color: var(--green-dark); border-color: var(--green); }

.savebar { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 44; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lift); animation: rise .2s ease; }
.savebar span { flex: 1; font-weight: 500; }
@media (min-width: 960px) { .savebar { left: calc(236px + 24px); right: 24px; bottom: 20px; max-width: 760px; margin: 0 auto; } }
.prod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f4ead6; }
.prod-row:last-child { border-bottom: 0; }
.prod-row.dirty { background: linear-gradient(90deg, rgba(255, 200, 61, .16), transparent 40%); }
.prod-ctl { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; flex-wrap: wrap; }
.prod-ctl label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.prod-ctl .input { width: 92px; text-align: right; }
.prod-stock { text-align: right; font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.prod-stock b { font-size: 17px; color: var(--ink); display: block; }
@media (min-width: 760px) { .prod-row { grid-template-columns: minmax(0, 1fr) 120px auto; } .prod-ctl { grid-column: auto; flex-wrap: nowrap; } }
.banner-picker { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .banner-picker { grid-template-columns: repeat(4, 1fr); } }
.banner-opt { position: relative; cursor: pointer; border-radius: 12px; overflow: hidden; border: 3px solid transparent; }
.banner-opt input { position: absolute; opacity: 0; }
.banner-opt img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; }
.banner-opt span { display: block; text-align: center; font-size: 12.5px; padding: 3px; background: var(--cream-deep); }
.banner-opt:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 3px rgba(68, 168, 80, .2); }
.farm-card { padding: 16px; }
.code-box { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--ink); color: var(--sun); font-family: Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: 2px; cursor: pointer; }
.code-box svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--green-soft); }
.link-box span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--green-dark); }
.slip-img { max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 12px; }
.month-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.month-opts label { cursor: pointer; }
.month-opts input { position: absolute; opacity: 0; }
.month-opts span { display: block; text-align: center; padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf8; font-weight: 600; }
.month-opts input:checked + span { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }

.buyer-line svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.alert .spin { color: var(--sky); }

/* iPhones zoom the page when a field with text under 16px gets the focus. */
@media (max-width: 959px) {
  .input, .select, .textarea, .qty input { font-size: 16px; }
}
/* These two reset every property (all: unset), so they need the no-double-tap-zoom rule said again. */
.tile-hit, .lrow-hit { touch-action: manipulation; }

/* Delivery progress on an order line. */
.got { color: var(--green-dark); font-weight: 600; }
.got.part { color: var(--orange-dark); }

/* The seller's delivery screen. */
.dv-h { margin: 16px 0 8px; font-size: 15px; }
.dv-progress .bar { height: 8px; margin-top: 4px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; }
.dv-progress .bar i { display: block; height: 100%; background: var(--green); }
.dv-farm { margin-bottom: 8px; }
.dv-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dv-actions .btn { padding: 6px 4px; font-size: 12.5px; white-space: normal; line-height: 1.15; }
.dv-actions .tiny { margin-top: 4px; text-align: center; line-height: 1.25; }
.dv-actions .tiny svg { width: 12px; height: 12px; vertical-align: -2px; }
.dv-table { margin-top: 10px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.dv-tr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 42px); align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid #f4ead6; }
.dv-tr > span:not(:first-child) { text-align: right; }
.dv-th { border-top: 0; background: var(--cream-deep); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.dv-tr .item-line { gap: 6px; }
.dv-sale { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f4ead6; }
.dv-sale:last-child { border-bottom: 0; }
.dv-tr .item-line { min-width: 0; line-height: 1.2; }
.dv-tr .item-line > span { min-width: 0; overflow-wrap: anywhere; }
.dv-sale .grow { min-width: 0; line-height: 1.3; }
.dv-farm .ap-result small { display: block; font-size: 11px; color: var(--ink-soft); }
@media (max-width: 480px) {
  .dv-tr { grid-template-columns: minmax(0, 1fr) 32px 42px 32px 32px 36px; padding: 6px; font-size: 12.5px; }
  .dv-th span { white-space: nowrap; }
  .dv-tr .item-line img { width: 24px; height: 24px; }
}

/* The live delivery screen. */
.dv-live { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12.5px; color: var(--green-dark); }
.dv-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; animation: dvpulse 1.6s ease-out infinite; }
.dv-live.off { color: var(--red-dark); }
.dv-live.off i { background: var(--red); animation: none; }
@keyframes dvpulse { 0% { box-shadow: 0 0 0 0 rgba(68, 168, 80, .55); } 100% { box-shadow: 0 0 0 9px rgba(68, 168, 80, 0); } }
.dv-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.dv-nums b { font-size: 22px; color: var(--green-dark); line-height: 1.1; }
.dv-nums b.wait, .ap-pick.wait { color: var(--orange-dark); }
.dv-nums b.need { color: var(--red-dark); }
.dv-nums small { display: block; font-size: 11.5px; }
.dv-progress .bar { display: flex; }
.dv-progress .bar i { flex: none; transition: width .4s; }
.dv-progress .bar i.wait { background: #f6c27a; }
.dv-alert { margin-top: 8px; font-size: 13.5px; }
.dv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 12px 0 8px; padding: 4px; border-radius: 14px; background: var(--cream-deep); position: sticky; top: -6px; z-index: 2; }
.dv-tabs button { all: unset; box-sizing: border-box; cursor: pointer; touch-action: manipulation; padding: 7px 4px; border-radius: 10px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.dv-tabs button b { margin-left: 5px; padding: 0 6px; border-radius: 99px; background: rgba(0, 0, 0, .08); font-size: 12px; }
.dv-tabs button.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.dv-tabs button.active b { background: var(--green); color: #fff; }
.dv-empty { padding: 22px 12px; border-radius: 14px; border: 1.5px dashed var(--line); text-align: center; color: var(--ink-soft); font-size: 14px; }
.dv-empty svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--green); }
.dv-farm .ap-row { padding: 5px 0; }
.dv-proof { margin-top: 14px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 12px; }
.dv-proof summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 14px; list-style-position: inside; }
.dv-proof summary svg { width: 16px; height: 16px; vertical-align: -3px; }
.dv-proof summary .tiny { display: block; margin: 2px 0 0 18px; font-weight: 400; color: var(--ink-soft); }
.dv-proof summary .tiny svg { width: 12px; height: 12px; }
.dv-proof[open] { padding-bottom: 12px; }
.dv-stray { display: flex; align-items: center; gap: 8px; padding: 6px 0 0; margin-top: 6px; border-top: 1px solid rgba(0, 0, 0, .08); color: var(--ink); }
.dv-stray .grow { min-width: 0; line-height: 1.3; }
.dv-stray .tiny { display: block; color: var(--ink-soft); }
.dv-stray .btn { flex: none; padding: 5px 10px; }
.dv-strays { max-height: 168px; overflow-y: auto; overscroll-behavior: contain; }
.dv-who { display: block; font-size: 13px; }

/* The delivery board: the whole order on one screen, a tile an item. */
.modal.full .modal-body.dv-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
#dv { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dv-top { flex: none; display: grid; gap: 8px; padding-bottom: 8px; }
.dv-top .dv-live { margin: 0 0 0 auto; }
.dv-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 2px 2px 14px; }
.dv-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 13px; color: var(--ink-soft); }
.dv-stats .s b { font-size: 20px; line-height: 1; margin-right: 2px; }
.dv-stats .buy b { color: var(--green-dark); }
.dv-stats .wait b { color: var(--orange-dark); }
.dv-stats .need b { color: var(--red-dark); }
.dv-stats .bar { flex: 1 1 100%; display: flex; height: 6px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; }
.dv-stats .bar i { flex: none; background: var(--green); transition: width .4s; }
.dv-stats .bar i.wait { background: #f6c27a; }
.dv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dv-bar .chip { padding: 5px 11px; font-size: 13px; }
.dv-bar .chip svg { width: 14px; height: 14px; }
.dv-bar .chip.warn { border-color: var(--orange); background: var(--orange-soft); color: #8a4a08; }
.dv-bar .chip.warn-red { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); animation: dvblink 1.2s ease-in-out infinite; }
.dv-bar .chip.warn.active, .dv-bar .chip.warn-red.active { color: #fff; animation: none; }
.dv-bar .chip.warn.active { background: var(--orange); box-shadow: 0 2px 0 var(--orange-dark); }
.dv-bar .chip.warn-red.active { background: var(--red); border-color: var(--red); box-shadow: 0 2px 0 var(--red-dark); }
@keyframes dvblink { 50% { box-shadow: 0 0 0 4px rgba(226, 85, 63, .25); } }
.dv-farmname { font-size: 14px; }
.dv-farmname b { font-size: 15px; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.dv-tile { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 6px 4px 5px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); text-align: center; line-height: 1.15; }
.dv-tile img { width: 38px; height: 38px; object-fit: contain; }
.dv-tile .nm { width: 100%; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-tile .n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.dv-tile .n svg { width: 22px; height: 22px; vertical-align: -3px; }
.dv-tile small { font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; }
.dv-tile .tag { position: absolute; top: 3px; right: 3px; padding: 0 5px; border-radius: 99px; background: #f6c27a; color: #5e3206; font-size: 10px; font-style: normal; font-weight: 600; }
.dv-tile.todo { border-color: #e9b7ad; background: #fff8f6; }
.dv-tile.todo .n { color: var(--red-dark); }
.dv-tile.wait { border-color: #f1c98f; background: var(--orange-soft); }
.dv-tile.wait .n { color: var(--orange-dark); }
.dv-tile.done { border-color: #bfe2b9; background: var(--green-soft); opacity: .62; }
.dv-tile.done .n { color: var(--green-dark); }
.dv-tile.short { border-color: var(--red); background: var(--red-soft); }
.dv-tile.short .n { color: var(--red-dark); }
.dv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.dv-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; border: 1.5px solid var(--line); }
.dv-legend i.todo { border-color: #e9b7ad; background: #fff8f6; }
.dv-legend i.wait { border-color: #f1c98f; background: var(--orange-soft); }
.dv-legend i.done { border-color: #bfe2b9; background: var(--green-soft); }
.dv-legend i.short { border-color: var(--red); background: var(--red-soft); }
.dv-scroll .dv-strays { max-height: none; }
@media (min-width: 720px) {
  .modal.full { max-width: min(1760px, 97vw); height: 94vh; height: 94dvh; }
  .dv-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
  .dv-tile { padding: 4px 4px 3px; }
  .dv-tile img { width: 38px; height: 38px; }
  .dv-tile .nm { font-size: 12px; }
  .dv-tile .n { font-size: 21px; }
}
@media (max-width: 480px) {
  .dv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .dv-tile img { width: 34px; height: 34px; }
  .dv-tile .n { font-size: 20px; }
  .dv-top .dv-live { margin-left: auto; }
  .dv-top { gap: 6px; padding-bottom: 6px; }
  .dv-top .pre, .dv-tile .pre { display: none; }
  .dv-top .buyer-line { gap: 4px 10px; font-size: 13px; }
  .dv-top .buyer-line .btn { padding: 4px 8px; font-size: 12px; }
  .dv-stats { gap: 2px 10px; font-size: 12px; }
  .dv-stats .s b { font-size: 17px; }
  .dv-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 2px; }
  .dv-bar::-webkit-scrollbar { display: none; }
  .dv-bar .chip { flex: none; }
  .dv-bar .grow { display: none; }
  .dv-tile small { font-size: 10px; }
}
.dv-sec { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 6px; padding-bottom: 3px; border-bottom: 1.5px solid var(--line); font-size: 15px; }
.dv-sec:first-child, .dv-farmname + .dv-sec { margin-top: 0; }
.dv-sec span { font-size: 12px; color: var(--ink-soft); }
.dv-pic { position: relative; display: block; line-height: 0; }
.dv-pic .have { position: absolute; right: -14px; bottom: -2px; font-style: normal; font-size: 12.5px; font-weight: 700; line-height: 1; color: #fff;
  text-shadow: -1px -1px 0 #4a3520, 1px -1px 0 #4a3520, -1px 1px 0 #4a3520, 1px 1px 0 #4a3520, 0 2px 0 #4a3520; }

/* Live chat: the buyer's floating button and window, and the seller's chat page. */
.chat-fab { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 48; transition: bottom .2s ease; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; background: linear-gradient(var(--green-light), var(--green)); color: #fff; font: inherit; font-weight: 600;
  box-shadow: 0 3px 0 var(--green-dark), 0 8px 20px rgba(60, 40, 20, .25); cursor: pointer; touch-action: manipulation; }
/* it steps up only while the phone's cart bar is on screen under it */
@media (max-width: 1039px) { body.has-cartbar .chat-fab { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.chat-fab svg { width: 22px; height: 22px; }
.chat-fab .badge { position: absolute; top: -5px; right: -3px; }
.chat-log { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.chat-msg { max-width: 82%; align-self: flex-start; }
.chat-msg p { margin: 0; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--cream-deep); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-msg small { display: block; margin: 2px 6px 0; font-size: 11px; color: var(--ink-faint); }
.chat-msg.me { align-self: flex-end; }
.chat-msg.me p { border-radius: 16px 16px 4px 16px; background: var(--green); color: #fff; }
.chat-msg.me small { text-align: right; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; text-align: center; color: var(--ink-soft); font-size: 14px; }
.chat-empty img { width: 96px; height: 96px; object-fit: contain; }
.chat-empty b { color: var(--ink); font-size: 16px; }
.chat-form { flex: 1; display: grid; gap: 8px; min-width: 0; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; }
.chat-send textarea { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 120px; line-height: 1.4; padding: 10px 12px; }
.modal-foot .chat-send .btn, .chat-send .btn { flex: none; }
.chat-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.chat-list { overflow: hidden; }
.chat-thread { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f4ead6; color: var(--ink); }
.chat-thread:hover { text-decoration: none; background: var(--cream); }
.chat-thread.active { background: var(--green-soft); }
.chat-thread .grow { min-width: 0; display: grid; gap: 1px; }
.chat-thread .avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; font-size: 17px; }
.chat-room { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-room .chat-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1.5px solid var(--line); }
.chat-room .chat-head .grow { min-width: 0; display: grid; }
.chat-room .chat-back svg { transform: rotate(180deg); }
.chat-room .chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; overscroll-behavior: contain; }
.chat-room .chat-form { flex: none; padding: 10px 12px; border-top: 1.5px solid var(--line); }
.chat-room { height: calc(100dvh - 230px); min-height: 320px; }
.chat-page:not(.has-open) .chat-room, .chat-page.has-open .chat-list { display: none; }
@media (min-width: 900px) {
  .chat-page, .chat-page.has-open { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .chat-page:not(.has-open) .chat-room, .chat-page.has-open .chat-list { display: flex; }
  .chat-page .chat-list { display: block !important; max-height: calc(100dvh - 170px); overflow-y: auto; }
  .chat-room { height: calc(100dvh - 170px); }
  .chat-room .chat-back { display: none; }
}
@media (max-width: 719px) {
  .chat-fab { padding: 13px; }
  .chat-fab span { display: none; }
}

/* The shelf as small cards: picture, name, price and what is left in two short lines. */
.pcard-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.pcard { position: relative; min-width: 0; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); transition: border-color .1s ease, background .1s ease; }
.pcard-hit { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; align-items: center; width: 100%; padding: 5px 8px 5px 6px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pcard-hit:focus-visible, .itile-hit:focus-visible { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: -3px; border-radius: 10px; }
.pcard-hit .item-icon { grid-row: 1 / 3; width: 40px; height: 40px; }
.pcard-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-price { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--orange-dark); white-space: nowrap; }
.pcard .foot, .itile .foot { display: contents; }
.pcard .foot .left { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--ink-faint); pointer-events: none; }
.pcard .minus { position: absolute; right: 5px; bottom: 4px; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: var(--green-soft); color: var(--green-dark); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; }
.qbadge { position: absolute; top: -5px; left: -5px; z-index: 1; min-width: 22px; height: 20px; padding: 0 6px; border: 2px solid var(--paper); border-radius: 999px; background: var(--green); color: #fff; font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; }
.pcard:hover, .itile:hover { border-color: #d9c79f; }
.pcard.in-cart, .itile.in-cart { border-color: var(--green); background: var(--green-tint); }
.pcard.sold-out, .itile.sold-out { opacity: .45; }
.pcard.sold-out .pcard-hit, .itile.sold-out .itile-hit { cursor: default; }

/* The shelf as pictures only: what the shop has of each, and the level that unlocks it. */
.itile-grid { display: grid; gap: 7px 6px; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
.itile { position: relative; min-width: 0; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); transition: border-color .1s ease, background .1s ease; }
.itile-hit { all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; width: 100%; padding: 4px 2px 15px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.itile-hit .item-icon { width: 42px; height: 42px; }
.itile .stock { position: absolute; right: 4px; bottom: 15px; font-style: normal; font-size: 12.5px; font-weight: 700; line-height: 1; color: #fff;
  text-shadow: -1px -1px 0 #4a3520, 1px -1px 0 #4a3520, -1px 1px 0 #4a3520, 1px 1px 0 #4a3520, 0 2px 0 #4a3520; }
.itile .lv { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-style: normal; font-size: 10px; line-height: 1.1; color: var(--ink-faint); }
.itile .qbadge { left: auto; right: -5px; }
@media (min-width: 760px) {
  .pcard-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
  .pcard-hit .item-icon { width: 44px; height: 44px; }
  .pcard-hit { grid-template-columns: 44px minmax(0, 1fr); padding: 6px 9px 6px 7px; }
  .pcard-name { font-size: 13px; }
  .itile-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
  .itile-hit .item-icon { width: 48px; height: 48px; }
  .itile .stock { font-size: 13px; }
}

/* The cart's bin and "empty the cart". */
.cart-ctl { display: flex; align-items: center; gap: 4px; }
.cart-del { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink-faint); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.cart-del svg { width: 17px; height: 17px; }
.cart-del:hover { background: var(--red-soft); color: var(--red-dark); }
.cart-del.sure { width: auto; padding: 0 8px; background: var(--red); color: #fff; }
.cart-line .qty button:disabled { opacity: .35; cursor: default; box-shadow: none; }
.cart-clear { display: flex; justify-content: flex-end; padding: 6px 0 2px; }
.cart-clear .btn { color: var(--ink-faint); }
.cart-clear .btn svg { width: 15px; height: 15px; }

/* ---- A shop's own look: the colours, page background and layout its seller chose. ---- */
body[data-theme="sky"] { --green: #3f9fd8; --green-dark: #2a79ab; --green-soft: #e1f1fb; --green-light: #68bcee; --green-tint: #eef7fd; --cream: #f3f9fe; --cream-deep: #e2eff9; --line: #d3e4f1; }
body[data-theme="rose"] { --green: #e8638c; --green-dark: #bf3f69; --green-soft: #fde6ee; --green-light: #f48aaa; --green-tint: #fff1f5; --cream: #fff5f8; --cream-deep: #fbe4ec; --line: #f3d3de; }
body[data-theme="grape"] { --green: #8a63d2; --green-dark: #6843ad; --green-soft: #efe8fb; --green-light: #a888e6; --green-tint: #f6f1fd; --cream: #f8f5ff; --cream-deep: #ece4fb; --line: #ddd1f3; }
body[data-theme="berry"] { --green: #e2553f; --green-dark: #b53c29; --green-soft: #fde7e2; --green-light: #f07a66; --green-tint: #fff2ef; --cream: #fff6f3; --cream-deep: #fbe3dc; --line: #f1cfc6; }
body[data-theme="teal"] { --green: #1fa39a; --green-dark: #157a73; --green-soft: #dcf4f1; --green-light: #45c2b8; --green-tint: #effaf8; --cream: #f2fbfa; --cream-deep: #dcf2ef; --line: #c7e6e1; }
body[data-theme="cocoa"] { --green: #a9713f; --green-dark: #7f5127; --green-soft: #f5e8da; --green-light: #c48f5c; --green-tint: #fbf3ea; --cream: #fbf4ea; --cream-deep: #f3e3cd; --line: #e6d2b6; }
body[data-theme="night"] { --green: #4563a8; --green-dark: #2f4680; --green-soft: #e3e9f7; --green-light: #6481c4; --green-tint: #f0f4fb; --cream: #f3f6fc; --cream-deep: #e2e8f5; --line: #d0d9ec; }
body[data-pattern="plain"] { background-image: none; }
body[data-pattern="grid"] { background-image: linear-gradient(rgba(120, 100, 80, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 100, 80, .07) 1px, transparent 1px); background-size: 26px 26px; }
body[data-pattern="stripes"] { background-image: repeating-linear-gradient(135deg, rgba(120, 100, 80, .05) 0 12px, transparent 12px 28px); background-size: auto; }
body[data-logo="circle"] .shop-logo { border-radius: 50%; }

/* The top of a shop, three ways. */
.shop-hero.hero-classic { background-position: center; }
.shop-hero.hero-classic .shop-hero-inner { min-height: 170px; }
.shop-hero-inner .grow { min-width: 0; }
.shop-hero .shop-logo { box-shadow: 0 6px 18px rgba(40, 26, 12, .35); }
.hero-actions { display: flex; gap: 6px; }
.hero-actions .btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .93); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.hero-actions .btn svg { width: 17px; height: 17px; }
.hero-classic .hero-actions, .hero-compact .hero-actions { position: absolute; top: 12px; right: 0; }
.shop-meta .tiny-icon { width: 13px; height: 13px; }
.hero-center { background: none; }
.hero-center .hero-cover { height: 150px; background-size: cover; background-position: center; background-color: var(--green-soft); }
.hero-center .hero-card { position: relative; margin-top: -54px; padding: 56px 16px 16px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); text-align: center; color: var(--ink); }
.hero-center .shop-logo { position: absolute; top: -46px; left: 50%; width: 92px; height: 92px; margin-left: -46px; font-size: 36px; border-width: 4px; }
.hero-center h1 { font-size: clamp(22px, 4.5vw, 32px); text-shadow: none; }
.hero-center .tagline { color: var(--ink-soft); text-shadow: none; }
.hero-center .shop-meta { justify-content: center; }
.hero-center .shop-meta .pill { background: var(--cream-deep); }
.hero-center .hero-actions { position: absolute; top: 12px; right: 12px; }
.hero-center .hero-actions .btn { background: var(--cream-deep); box-shadow: none; }
.hero-compact { background: linear-gradient(110deg, var(--green-dark), var(--green) 70%, var(--green-light)); }
.hero-compact .shop-hero-inner { min-height: 0; padding: 14px 0; }
.hero-compact .shop-hero-inner .grow { padding-right: 130px; }
.hero-compact .shop-logo { width: 54px; height: 54px; font-size: 24px; }
.hero-compact h1 { font-size: clamp(19px, 3.6vw, 26px); }
@media (min-width: 760px) {
  .shop-hero.hero-classic .shop-hero-inner { min-height: 220px; align-items: flex-end; padding-bottom: 26px; }
  .shop-hero.hero-classic .shop-logo { width: 96px; height: 96px; font-size: 38px; }
  .hero-center .hero-cover { height: 220px; }
}

/* The goods a seller puts first. */
.featured { margin: 6px 0 2px; }
.featured .group-title { margin: 8px 0 8px; }
.featured .group-title svg { width: 20px; height: 20px; color: var(--sun); fill: var(--sun); align-self: center; }
.featured-row { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px 6px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.fcard { flex: none; width: 112px; scroll-snap-align: start; border-color: #f3d38a; background: linear-gradient(#fffdf6, #fff6e0); }
.fcard .pcard-hit { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 1px; padding: 8px 6px 8px; text-align: center; }
.fcard .pcard-hit .item-icon { grid-row: auto; width: 56px; height: 56px; }
.fcard .pcard-name { max-width: 100%; }
.fcard .pcard-price { padding-bottom: 14px; }
.fcard .foot .left { left: 0; right: 0; bottom: 5px; text-align: center; }
.fcard .minus { right: 5px; bottom: 5px; }
.about-text { margin: 0 0 12px; white-space: pre-line; overflow-wrap: anywhere; }

/* The back office's design page: the form, and the storefront in a frame beside it. */
.design-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.design-preview { min-width: 0; }
.frame-wrap { height: 620px; border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.frame-wrap.phone { max-width: 400px; margin: 0 auto; border-radius: 26px; border-width: 6px; border-color: #45301f; }
.frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (min-width: 1100px) {
  .design-page { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); }
  .design-preview { position: sticky; top: 76px; }
  .frame-wrap { height: calc(100vh - 190px); min-height: 480px; }
}
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { min-width: 0; padding: 0 12px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.swatches button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 13px; cursor: pointer; }
.swatches button i { flex: none; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.swatches button.active { border-color: var(--ink); background: var(--cream-deep); font-weight: 600; }
.feat-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.feat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 6px; border-radius: 999px; background: var(--orange-soft); font-size: 13px; }
.feat-chip button { all: unset; width: 20px; height: 20px; border-radius: 50%; text-align: center; line-height: 20px; cursor: pointer; color: var(--ink-soft); }
.feat-chip button:hover { background: rgba(0, 0, 0, .08); }
.feat-list { margin-top: 6px; max-height: 250px; overflow-y: auto; border: 1.5px solid var(--line); border-radius: 12px; }
.feat-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.feat-row:last-child { border-bottom: 0; }
.feat-row:hover { background: var(--cream); }
.feat-row b { flex: none; font-size: 12.5px; color: var(--green-dark); }
.feat-row.on { background: var(--green-tint); }
.feat-row.on b { color: var(--red-dark); }

/* Notifications on Telegram: the steps a seller follows to link a chat. */
.alert-steps { margin: 0; padding-left: 22px; display: grid; gap: 16px; }
.alert-steps li::marker { font-weight: 700; color: var(--green-dark); }
.alert-steps.small { gap: 8px; font-size: 13.5px; }
.alert-add { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 10px; }
.alert-qr { width: 132px; height: 132px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.alert-wait { display: inline-flex; align-items: center; gap: 6px; }
.alert-wait svg { width: 14px; height: 14px; animation: spin 1.6s linear infinite; }
.alert-nudge { display: flex; align-items: center; gap: 12px; color: var(--ink); border-color: var(--green); background: var(--green-tint); }
.alert-nudge:hover { text-decoration: none; }
.alert-nudge > svg:first-child { flex: none; width: 26px; height: 26px; color: var(--green-dark); }
.alert-nudge > span { flex: 1; min-width: 0; line-height: 1.35; }
.alert-nudge > svg:last-child { flex: none; width: 18px; height: 18px; color: var(--ink-faint); }

/* Rent packages: the three on the landing page, and the choice on the seller's rent page. */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; max-width: 760px; margin: 0 auto 18px; }
.plan-card { text-align: center; padding: 22px 14px; border-width: 2.5px; border-color: var(--sun); }
.plan-card .plan-farms { display: inline-block; padding: 3px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-weight: 700; margin-bottom: 10px; }
.plan-card .price-big { font-size: 44px; }
.plan-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.plan-opts label { cursor: pointer; }
.plan-opts input { position: absolute; opacity: 0; }
.plan-opts span { display: grid; gap: 1px; text-align: center; padding: 10px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffdf8; height: 100%; align-content: center; }
.plan-opts span b { font-size: 17px; }
.plan-opts span i { font-style: normal; font-size: 13.5px; color: var(--ink-soft); }
.plan-opts span em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--green-dark); }
.plan-opts input:checked + span { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
.plan-opts input:checked + span i, .plan-opts input:checked + span em { color: #fff; }
.plan-opts input:disabled + span { opacity: .45; cursor: not-allowed; }
.plan-opts input:focus-visible + span { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: 2px; }
.farm-room { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.farm-room a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; }
.farm-room a svg { width: 14px; height: 14px; }

/* Restocking from the wholesaler: farm and size choices, the list being built, the checks, the bar with the total. */
.rs-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 14px; flex: none; }
.rs-farms, .rs-sizes { display: grid; gap: 8px; }
.rs-farms { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rs-sizes { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.rs-farms label, .rs-sizes label { cursor: pointer; }
.rs-farms input, .rs-sizes input { position: absolute; opacity: 0; }
.rs-farms span, .rs-sizes span { display: grid; gap: 1px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffdf8; height: 100%; }
.rs-sizes span { text-align: center; font-weight: 700; font-size: 17px; padding: 11px 4px; }
.rs-farms span i { font-style: normal; font-size: 12.5px; color: var(--ink-soft); }
.rs-farms span em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--green-dark); }
.rs-farms input:checked + span, .rs-sizes input:checked + span { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
.rs-farms input:checked + span i, .rs-farms input:checked + span em { color: #fff; }
.rs-farms input:focus-visible + span, .rs-sizes input:focus-visible + span { outline: 3px solid rgba(63, 159, 216, .55); outline-offset: 2px; }
.rs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.rs-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffdf8; min-width: 0; }
.rs-row.bad { border-color: var(--red); background: var(--red-soft); }
.rs-row .item-icon { width: 38px; height: 38px; flex: none; }
.rs-what { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.rs-what b { font-size: 14.5px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.2; }
.rs-what small { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-bad { color: var(--red-dark) !important; font-weight: 600; }
.rs-qty { display: flex; align-items: center; flex: none; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.rs-qty button { all: unset; width: 32px; height: 38px; text-align: center; font-size: 20px; font-weight: 600; color: var(--green-dark); cursor: pointer; touch-action: manipulation; }
.rs-qty button:active { background: var(--green-soft); }
.rs-qty input { width: 52px; height: 38px; border: 0; text-align: center; font: inherit; font-weight: 700; font-size: 15px; background: transparent; color: var(--ink); }
.rs-qty input:focus { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 8px; }
.rs-del { all: unset; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-faint); cursor: pointer; }
.rs-del:hover { background: rgba(0, 0, 0, .07); color: var(--red-dark); }
.rs-del svg { width: 15px; height: 15px; }
.rs-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.rs-hits:not(:empty) { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--line); }
.rs-hit { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1.5px dashed var(--green); cursor: pointer; font-size: 14px; min-width: 0; }
.rs-hit:hover { background: var(--green-tint); }
.rs-hit .item-icon { width: 30px; height: 30px; flex: none; }
.rs-hit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rs-hit small { font-size: 12px; color: var(--ink-soft); flex: none; }
.rs-hit > svg { width: 16px; height: 16px; color: var(--green-dark); flex: none; }
.rs-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rs-checks li { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; }
.rs-checks li i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: #fff; background: var(--green); }
.rs-checks li.bad i { background: var(--red); }
.rs-checks li.warn i { background: var(--orange); }
.rs-checks li.bad span { color: var(--red-dark); font-weight: 600; }
.rs-checks li.warn span { color: var(--orange-dark); font-weight: 600; }
.rs-bar { position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lift); }
.rs-bar .sum { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.rs-bar .sum b { font-size: 19px; color: var(--sun); }
.rs-bar .sum b.bad { color: #ffb4a6; }
.rs-bar .btn { flex: none; }
.rs-bar .btn:disabled { opacity: .45; }
@media (min-width: 900px) { .rs-bar { bottom: 14px; } }
.alert-nudge.low { border-color: var(--orange); background: var(--orange-soft); }
.alert-nudge.low > svg:first-child { color: var(--orange-dark); }
@media (max-width: 480px) { .rs-row { gap: 6px; padding-left: 6px; } .rs-row .item-icon { width: 32px; height: 32px; } .rs-qty button { width: 27px; } .rs-qty input { width: 42px; } .rs-del { width: 24px; } }
.rs-hit.off { border-color: var(--line); border-style: solid; opacity: .6; cursor: not-allowed; }
.rs-hit.off:hover { background: none; }
.rs-order { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffdf8; }
.rs-order.fresh { border-color: var(--green); background: var(--green-tint); }
.rs-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rs-order-head b { font-size: 16px; }
.rc-intro { max-width: 520px; margin: 0 auto; padding: 18px 4px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.rc-intro img { width: 130px; height: 130px; object-fit: contain; }
.rc-intro p { color: var(--ink-soft); line-height: 1.55; }
.rc-intro .alert { text-align: left; }
.rs-via { display: grid; gap: 10px; }
.rs-via button { all: unset; box-sizing: border-box; display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fffdf8; cursor: pointer; }
.rs-via button:hover, .rs-via button:focus-visible { border-color: var(--green); background: var(--green-tint); }
.rs-via button[data-via="supplier"] { border-color: var(--orange); background: var(--orange-soft); }
.rs-via button:disabled, .rs-via button:disabled:hover { border-color: var(--line); background: #f4efe6; cursor: not-allowed; opacity: .75; }
.rs-via button:disabled em { color: var(--red); font-size: 15px; }
.sp-gate { display: grid; gap: 8px; }
.sp-gate.closed { border: 2px solid var(--red); background: #fff6f4; }
.rs-via button b { font-size: 18px; }
.rs-via button em { font-style: normal; font-weight: 700; color: var(--green-dark); }
.rs-via button[data-via="supplier"] em { color: var(--orange-dark); font-size: 17px; }
.rs-via button small { color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
