:root {
  /* Layout: segmented tabs (Customer view / Seller setup). Customer view = item list and details on the left, order summary plus a live WhatsApp message preview on the right; stacks on phones. */
  --bg: #F1F5F2;
  --surface: #FFFFFF;
  --ink: #14201B;
  --muted: #586861;
  --line: #D3DDD7;
  --accent: #0E7A55;
  --accent-ink: #FFFFFF;
  --chat-bg: #E4ECE7;
  --bubble: #D9F2E2;
  --bubble-ink: #10261C;
  --warn: #A8461A;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1714;
    --surface: #17221D;
    --ink: #E6EFEA;
    --muted: #93A59B;
    --line: #27362F;
    --accent: #3DDC97;
    --accent-ink: #06251A;
    --chat-bg: #0B1210;
    --bubble: #164633;
    --bubble-ink: #DDF5E7;
    --warn: #F0A06F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1714;
  --surface: #17221D;
  --ink: #E6EFEA;
  --muted: #93A59B;
  --line: #27362F;
  --accent: #3DDC97;
  --accent-ink: #06251A;
  --chat-bg: #0B1210;
  --bubble: #164633;
  --bubble-ink: #DDF5E7;
  --warn: #F0A06F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding-inline: 16px;
  padding-block: 24px 56px;
}
.wrap { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 6px 0 8px; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
p { margin: 0; }
.lede { color: var(--muted); max-width: 54ch; }
.muted { color: var(--muted); }

.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tab { font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.shop-line { display: flex; flex-direction: column; gap: 4px; }
.shop-line .muted { font-size: 14px; }

/* items */
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item-name { font-weight: 600; }
.item-note { font-size: 13px; color: var(--muted); }
.item-price { font-variant-numeric: tabular-nums; font-weight: 500; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.step { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.step:hover { border-color: var(--accent); }
.qty { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 520px) {
  .item { grid-template-columns: minmax(0, 1fr) auto; }
  .item .stepper { grid-column: 1 / -1; }
}
.empty { color: var(--muted); }
.item.soldout .item-main, .item.soldout .item-price { opacity: 0.55; }
.item.soldout .thumb { filter: grayscale(1); }
.soldout-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.item.linked { background: var(--chat-bg); border-radius: 10px; padding-inline: 10px; }
.linknote { font-size: 14px; color: var(--ink); background: var(--bubble); border-radius: 8px; padding: 10px 12px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .legend { font-weight: 500; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 72px; }
input[type="time"], select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0;
}
select:focus-visible, input[type="time"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"] { accent-color: var(--accent); }
input:focus-visible, textarea:focus-visible, .btn:focus-visible, .tab:focus-visible, .step:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radios label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* summary */
.sum-line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.sum-line span:first-child { min-width: 0; overflow-wrap: anywhere; }
.sum-lines { display: flex; flex-direction: column; gap: 6px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; font-family: var(--font-display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.problem { font-size: 13px; color: var(--warn); min-height: 1.4em; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 14px 16px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btns { display: flex; flex-direction: column; gap: 8px; }
.email-wrap { font-size: 13px; color: var(--muted); }
.email-wrap a { color: var(--accent); font-weight: 500; }
.status { font-size: 13px; color: var(--muted); min-height: 1.4em; }

/* chat preview */
.chat { background: var(--chat-bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chat-head { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.bubble { background: var(--bubble); color: var(--bubble-ink); padding: 12px 14px; border-radius: 12px 12px 2px 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.placeholder { opacity: 0.7; }

/* setup */
.prow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; padding-top: 0; }
.prow label { font-size: 12px; color: var(--muted); }
.rm { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.rm:hover { border-color: var(--warn); color: var(--warn); }
@media (max-width: 680px) {
  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow .f-name, .prow .f-note { grid-column: 1 / -1; }
}
.inline-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-btns .btn { width: auto; padding: 10px 16px; }
.note { font-size: 14px; color: var(--muted); max-width: 62ch; }

.item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--chat-bg); display: block; }
.thumb.ph { border: 1px dashed var(--line); }
.small { font-size: 13px; }
.f-photo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn.sm { width: auto; padding: 8px 14px; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* standalone page additions */
:root { color-scheme: light; }
body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--accent); }
.keybox { font-family: var(--font-mono); font-size: 14px; background: var(--chat-bg); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.linkrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.linkrow a { overflow-wrap: anywhere; font-weight: 600; }
.warnbox { color: var(--warn); font-size: 14px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); }

/* plans and admin */
.plan-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat b { font-family: var(--font-display); font-size: 30px; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 8px 0; white-space: nowrap; }
td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.pill.pro { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 6px; }

/* sold out and share links */
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink); }
.chk input { accent-color: var(--warn); width: 18px; height: 18px; margin: 0; }
.f-share { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* options, pictures, payment */
.f-opts { grid-column: 1 / -1; }
.prow { row-gap: 12px; }
.f-photo { row-gap: 8px; column-gap: 16px; }
textarea#s-paynote { min-height: 64px; }

/* option rows, picture notice, payment info */
.item.has-opts { grid-template-columns: minmax(0, 1fr) auto; }
.opts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding-left: 4px; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.opt:first-child { border-top: 0; }
.opt-label { font-weight: 500; overflow-wrap: anywhere; }
.opt-price { font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 520px) {
  .item.has-opts .opts .stepper { grid-column: auto; }
  .opt { grid-template-columns: minmax(0, 1fr) auto; }
  .opt .stepper { grid-column: 1 / -1; }
}
.item-pic { font-size: 12px; color: var(--accent); font-weight: 500; margin-top: 2px; }
.pay-info { font-size: 14px; color: var(--ink); background: var(--chat-bg); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.pay-info:empty { display: none; }
.notice { font-size: 13px; color: var(--ink); background: var(--bubble); border-radius: 8px; padding: 8px 12px; }

/* bookings */
#b-fields { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
#b-days { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.sday { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.sday-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; min-width: 64px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot.booked { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slot.blocked { background: var(--chat-bg); color: var(--muted); text-decoration: line-through; }
.slot:disabled { opacity: 0.4; cursor: default; }
.slot[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.daypick { display: flex; flex-wrap: wrap; gap: 8px; }
.daybtn { font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: center; line-height: 1.25; }
.daybtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.daybtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.daybtn small { display: block; font-size: 12px; opacity: 0.8; }

/* seller page: sections, tabs, save bar, compact product rows */
.stabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 8px; z-index: 6; scrollbar-width: thin; }
.stab { font: inherit; font-weight: 500; font-size: 15px; padding: 10px 14px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; flex: none; }
.stab:hover { color: var(--ink); }
.stab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.stab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tcount { font-size: 12px; opacity: 0.85; }
.tabpanel { display: flex; flex-direction: column; gap: 24px; }
.tabpanel[hidden] { display: none; }
.tabnext { display: flex; justify-content: flex-end; }
.tabnext .btn { width: auto; }
.savebar { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.savebar .btn { width: auto; padding: 12px 22px; }
.savebar .problem { min-height: 0; flex: 1 1 240px; }
.openbox { padding: 0; gap: 0; }
.openbox summary { cursor: pointer; font-weight: 600; padding: 16px 20px; }
.openbox[open] summary { border-bottom: 1px solid var(--line); }
.openbox > :not(summary) { margin: 0 20px; }
.openbox > :nth-child(2) { margin-top: 14px; }
.openbox > :last-child { margin-bottom: 18px; }
.openbox > * + * { margin-top: 12px; }
.f-more { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; background: var(--chat-bg); border-radius: 10px; padding: 12px; }
.f-more[hidden] { display: none; }
.f-more .f-share { grid-column: auto; }
.more-toggle { margin-left: auto; font: inherit; font-size: 14px; color: var(--accent); background: transparent; border: 0; cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.more-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { width: 44px; height: 44px; }
#delivery-block[hidden] { display: none; }
@media (max-width: 520px) {
  .stabs { gap: 2px; padding: 4px; }
  .stab { padding: 10px 9px; font-size: 14px; flex: 1 1 auto; text-align: center; }
  .tnum { display: none; }
}
@media (max-width: 420px) {
  .stab { padding: 10px 6px; font-size: 13px; }
  .savebar .btn { width: 100%; }
}

/* "We have a new address" notice */
.movebox { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.movebox .btn { text-decoration: none; display: inline-block; }
