/* Haatly — one stylesheet for landing, seller panel and storefront. */
:root {
  --green: #0F3D2E;
  --green-2: #1C5A45;
  --ink: #14201B;
  --muted: #4F5B55;
  --line: #D5D9D2;
  --soft: #F1F2EE;
  --paper: #F7F5EF;
  --white: #FFFFFF;
  --accent: #F2A33A;
  --on-accent: #14201B;
  --wa: #1A7F4B;
  --danger: #B3261E;
  --r: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.5; }
h1, h2 { font-family: var(--display); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.3px; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; font-family: var(--body); letter-spacing: 0; }
p { margin: 0 0 12px; }
a { color: var(--green); font-weight: 500; }
a:hover { color: #0A2A20; }
img { max-width: 100%; display: block; }
small { font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 24px 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap-gap { flex-wrap: wrap; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--ink); font: 700 15px/1 var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.wa { background: var(--wa); color: #fff; border-color: transparent; }
.btn.wa:hover { background: #136a3e; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost-light { background: transparent; color: var(--paper); border-color: rgba(247,245,239,.5); }
.btn.ghost-light:hover { border-color: var(--paper); color: var(--paper); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.lg { min-height: 56px; font-size: 17px; padding: 0 24px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.link-btn { background: none; border: 0; color: var(--muted); font: 500 15px var(--body); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; padding: 10px 0; min-height: 44px; }
.link-btn:hover { color: var(--ink); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
input, select, textarea {
  font: 400 16px var(--body); color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-height: 50px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,61,46,.15); }
input::placeholder, textarea::placeholder { color: #7A8580; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { flex-direction: row !important; align-items: center; font-weight: 400 !important; gap: 8px; }
.check input { width: 20px; min-height: 20px; height: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.prefix-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--white); overflow: hidden; }
.prefix-input span { padding: 0 0 0 14px; display: flex; align-items: center; color: var(--muted); font-weight: 400; font-size: 14px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.prefix-input input { border: 0; padding-left: 2px; min-width: 0; }
.switch-row { flex-direction: row !important; justify-content: space-between; align-items: center; background: var(--soft); border-radius: var(--r); padding: 12px 16px; }
.switch-row > span { display: flex; flex-direction: column; font-weight: 400; }
.switch { appearance: none; -webkit-appearance: none; width: 52px !important; min-height: 32px !important; height: 32px; border-radius: 16px; background: #B9C1BC; border: 0; padding: 0; position: relative; cursor: pointer; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.swatches legend { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); cursor: pointer; position: relative; flex-direction: row !important; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 4px; }

/* Flash + badges */
.flash { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 500; }
.flash.ok { background: #E1F0E6; color: #0F3D2E; }
.flash.err { background: #FBE4E1; color: #8A1C14; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; white-space: nowrap; }
.s-new { background: #FDEBCB; color: #6E4300; }
.s-confirmed { background: #E0ECF8; color: #1D4F86; }
.s-shipped { background: #ECE3F7; color: #4E2A84; }
.s-delivered { background: #E1F0E6; color: #0F3D2E; }
.s-cancelled { background: #F1F2EE; color: #4F5B55; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 22px var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.4px; }
.brand.light, .brand.light:hover { color: var(--paper); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--green); display: inline-flex; align-items: center; justify-content: center; }

/* Landing */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.land-top { background: var(--green); color: var(--paper); padding: 20px 0 72px; }
.hero { padding-top: 64px; max-width: 720px; margin-left: max(0px, calc((100% - 1080px) / 2)); }
.hero h1 { font-size: clamp(38px, 7vw, 64px); letter-spacing: -1.5px; margin-bottom: 16px; }
.hero p { font-size: 18px; color: #C9D6CF; max-width: 560px; margin-bottom: 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: -40px; }
.feature { background: var(--white); border-radius: 20px; padding: 24px; box-shadow: 0 6px 20px rgba(15,61,46,.08); }
.feature p { color: var(--muted); margin: 0; }
.feat-ic { width: 44px; height: 44px; border-radius: 12px; background: #E1F0E6; color: var(--green); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.land-foot { padding: 40px 20px; color: var(--muted); font-size: 14px; }

/* Auth */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--green); }
.auth-hero { padding: 28px 24px 32px; max-width: 480px; width: 100%; margin: 0 auto; }
.auth-card { background: var(--paper); flex: 1; border-radius: 28px 28px 0 0; padding: 28px 24px 40px; width: 100%; max-width: 480px; margin: 0 auto; }
@media (min-width: 600px) { .auth { justify-content: center; padding: 40px 16px; } .auth-card { flex: none; border-radius: 28px; } .auth-hero { padding: 0 8px 20px; } }

/* Seller app shell */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 260px; background: var(--white); border-right: 1px solid #E4E6E0; padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: #E1F0E6; color: var(--green); font-weight: 700; }
.side-logout { margin-top: auto; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px clamp(16px, 4vw, 40px) 100px; max-width: 1100px; display: flex; flex-direction: column; gap: 20px; }
.main > h1 { margin: 0; }
@media (max-width: 760px) {
  .app { flex-direction: column; flex-wrap: nowrap; }
  .side { max-width: none; flex: none; padding: 0; border: 0; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; border-top: 1px solid #E4E6E0; gap: 0; }
  .side .brand, .side-logout { display: none; }
  .nav { flex-direction: row; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; font-size: 11px; padding: 8px 2px; border-radius: 0; min-height: 60px; justify-content: center; }
  .nav a.on { background: transparent; }
  .main { padding-top: 20px; }
}
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); min-height: 44px; }

.card { background: var(--white); border-radius: 20px; padding: 20px; box-shadow: 0 2px 10px rgba(15,61,46,.05); }
.card.narrow { max-width: 560px; }
.card.empty { text-align: left; }
.hello p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--white); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font: 800 26px var(--display); }
.share { display: flex; flex-direction: column; gap: 12px; }
.share p { margin: 0; }

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; background: var(--white); border-radius: 16px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.list-item:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--line); }
.list-item small { color: var(--muted); font-weight: 400; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: #E1F0E6; color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Products (seller) */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.prod-card { background: var(--white); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.prod-card.oos .prod-img { opacity: .5; }
.prod-img { aspect-ratio: 1; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.prod-body h2 { font-size: 16px; margin: 0; }
.prod-body p { margin: 0; display: flex; gap: 8px; }
.photo-pick { display: flex; flex-direction: column; gap: 8px; }
.photo-drop { position: relative; width: 160px; height: 160px; border-radius: 18px; border: 2px dashed #9AA7A0; background: var(--soft); cursor: pointer; overflow: hidden; display: block !important; }
.photo-drop input, .logo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; height: 100%; }
.photo-drop:focus-within, .logo-drop:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.photo-preview { position: absolute; inset: 0; background: center/cover no-repeat; pointer-events: none; }
.photo-hint { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(255,255,255,.92); border-radius: 10px; padding: 6px 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; justify-content: center; pointer-events: none; }
.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-row > div { display: flex; flex-direction: column; gap: 2px; }
.logo-drop { position: relative; width: 80px; height: 80px; border-radius: 20px; overflow: hidden; cursor: pointer; display: block !important; flex: none; }
.logo-preview { position: absolute; inset: 0; background: var(--accent) center/cover no-repeat; color: var(--on-accent); font: 800 32px var(--display); display: flex; align-items: center; justify-content: center; pointer-events: none; }

/* Orders */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tabs a { white-space: nowrap; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; background: var(--white); text-decoration: none; color: var(--ink); font-size: 14px; }
.tabs a small { color: var(--muted); }
.tabs a.on { background: var(--green); color: var(--paper); }
.tabs a.on small { color: #C9D6CF; }
.orders { display: flex; flex-direction: column; gap: 14px; }
.order { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 20px; }
.order:target { box-shadow: 0 0 0 3px var(--accent); }
.order h2 { margin: 0; }
.items { width: 100%; border-collapse: collapse; font-size: 15px; }
.items td { padding: 6px 0; border-bottom: 1px solid #ECEEE8; }
.items .tot td { font-weight: 700; border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.cust { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: 15px; }
.cust dt { color: var(--muted); }
.cust dd { margin: 0; }
.order select { width: auto; min-height: 40px; padding: 6px 10px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--white); text-decoration: none; }
.pager a.on { background: var(--green); color: var(--paper); }

/* Storefront */
.shop { max-width: 960px; margin: 0 auto; background: var(--white); min-height: 100vh; }
body:has(.shop) { background: var(--soft); }
.shop-top { background: var(--green); height: 120px; }
.shop-top-inner { padding: 16px 20px; text-align: right; }
.shop-host { font-size: 12px; color: #C9D6CF; }
.shop-head { padding: 0 20px; margin-top: -40px; }
.shop-head h1 { font-size: 26px; margin: 8px 0 4px; }
.shop-logo { width: 80px; height: 80px; border-radius: 22px; border: 4px solid var(--white); background: var(--accent) center/cover no-repeat; color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: 800 32px var(--display); }
.shop-search { padding: 16px 20px 8px; }
.shop-search input { background: var(--soft); border-color: transparent; }
.shop-grid { padding: 8px 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 14px; }
.item { display: flex; flex-direction: column; gap: 6px; }
.item[hidden] { display: none; }
.item-img { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--soft); border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item.oos .item-img img { opacity: .5; }
.oos-tag { position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.item h2 { font-size: 15px; font-weight: 500; margin: 0; }
.price { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price s { font-size: 13px; color: #6A746F; }
.off { font-size: 12px; font-weight: 700; color: var(--wa); }
.btn.add { width: 100%; border-color: var(--green); color: var(--green); }
.stepper { display: flex; align-items: center; justify-content: space-between; border-radius: 12px; background: var(--green); color: #fff; min-height: 44px; min-width: 112px; }
.stepper button { background: none; border: 0; color: #fff; font: 700 20px var(--body); width: 44px; height: 44px; cursor: pointer; }
.stepper span { font-weight: 700; }
.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(928px, calc(100% - 32px)); background: var(--green); color: var(--paper); border-radius: 18px; padding: 8px 8px 8px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 8px 24px rgba(15,61,46,.3); z-index: 10; }
.cartbar[hidden] { display: none; }
body.has-cart .shop { padding-bottom: 90px; }

/* Bottom sheets */
.sheet { border: 0; padding: 24px 20px 28px; width: min(560px, 100%); max-height: 92vh; border-radius: 24px 24px 0 0; margin: auto auto 0; overflow-y: auto; color: var(--ink); background: var(--white); }
.sheet::backdrop { background: rgba(20,32,27,.55); }
@media (min-width: 640px) { .sheet { border-radius: 24px; margin: auto; } }
.sheet h2 { font: 800 22px var(--display); padding-right: 40px; }
.sheet .x { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--soft); font-size: 24px; cursor: pointer; color: var(--ink); }
.sheet form[method=dialog] { margin: 0; }
.sheet > form[method=dialog] .btn { margin-top: 10px; }
.pd-img img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 16px; background: var(--soft); margin-bottom: 14px; }
.co-items { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.co-row { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #ECEEE8; }
.co-row .num { min-width: 70px; font-weight: 700; }
.co-total { display: flex; justify-content: space-between; font-size: 18px; margin: 4px 0 16px; }

/* ---- v2: options, plans, owner ---- */
@media (max-width: 760px) { .nav a.hide-m { display: none; } }
.upsell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: #FFF6E6; }
.upsell p { margin: 0; }
.options { border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.options legend { font-size: 14px; font-weight: 700; padding: 0 6px; }
.options p { margin: 0; }
.opt-head, .opt-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 56px 44px; gap: 8px; align-items: center; }
.opt-head { font-size: 12px; color: var(--muted); font-weight: 700; }
#optRows { display: flex; flex-direction: column; gap: 8px; }
#optRows:empty + template + .row { margin-top: 0; }
.opt-row input:not(.switch) { min-height: 44px; padding: 8px 10px; }
.opt-del { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--soft); font-size: 22px; cursor: pointer; color: var(--muted); }
.opt-del:hover { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chips:empty { display: none; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font: 500 15px var(--body); cursor: pointer; }
.chip.on { border-color: var(--green); background: var(--green); color: #fff; }
.chip.oos { text-decoration: line-through; color: #8A938E; cursor: not-allowed; }
.co-row small { display: block; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 4px; }
.plan-card.pro { box-shadow: 0 0 0 2px var(--accent); }
.plan-price { font: 800 32px var(--display); margin: 0; }
.plan-price small { font: 400 15px var(--body); color: var(--muted); }
.plan-price.sm { font-size: 20px; }
.plan-now p { margin: 0; }
.ticks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 12px; height: 7px; border-left: 2.5px solid var(--wa); border-bottom: 2.5px solid var(--wa); transform: rotate(-45deg); }
.period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0 16px; }
.period-opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; }
.period-opt:has(input:checked) { border-color: var(--green); background: #E1F0E6; }
.period-opt input { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); }
.period-opt span { display: flex; flex-direction: column; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 18px; }
.steps li { padding-left: 4px; }
.steps li > * { display: flex; margin-top: 6px; }
.steps li > b { margin-top: 0; }
.steps li > .btn { display: inline-flex; }
.qr { width: 200px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.dot { background: var(--accent); color: var(--on-accent) !important; border-radius: 10px; padding: 0 7px; font-weight: 700; }
.stat small, .stat a { font-size: 13px; }
.search-row input { flex: 1; min-width: 0; }
.store-row h2 a { color: var(--ink); text-decoration: none; }
.store-row h2 a:hover { text-decoration: underline; }
.store-row p { margin: 0; }
.store-row select { width: auto; min-height: 40px; padding: 6px 10px; }
.qr-preview { background-color: var(--soft); color: var(--muted); font-size: 18px; }

/* ---- Owner panel ---- */
.owner-app .side { background: var(--green); border-color: var(--green); color: var(--paper); }
.owner-app .nav a { color: #C9D6CF; }
.owner-app .nav a:hover { background: var(--green-2); color: #fff; }
.owner-app .nav a.on { background: var(--paper); color: var(--green); }
.owner-app .link-btn { color: #C9D6CF; }
.owner-app .link-btn:hover { color: #fff; }
.owner-who { font-size: 13px; color: #C9D6CF; margin: 0; word-break: break-all; }
.owner-app .brand-mark, .owner-auth .brand-mark { background: var(--paper); color: var(--green); }
@media (max-width: 760px) {
  .owner-app .side { border-top: 0; }
  .owner-app .nav a.on { background: transparent; color: #fff; }
  .owner-app .main { padding-bottom: 100px; }
}
.m-only { display: none; }
@media (max-width: 760px) {
  .m-only { display: flex; }
  .m-bar { justify-content: space-between; align-items: center; gap: 12px; margin: -8px 0 -8px; }
}

/* ---- Customer accounts ---- */
.shop-top-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.acct-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--green-2); color: var(--paper); text-decoration: none; font-size: 14px; }
.acct-link:hover { color: #fff; background: #246b53; }
.shop-flash { margin: 12px 20px 0; position: relative; z-index: 1; }
.co-acct { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.cust-top { background: var(--green); color: var(--paper); padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.cust-top b { font-size: 18px; }
.back.light { color: #C9D6CF; }
.back.light:hover { color: #fff; }
.shop-logo.sm { width: 40px; height: 40px; border-radius: 12px; border-width: 2px; font-size: 18px; }
.cust-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.cust-body h1 { margin: 0; }
.tabs.sub a { min-height: 36px; font-size: 13px; }
.cust-row { flex-wrap: wrap; }

[hidden] { display: none !important; }

/* ---- Email codes ---- */
.code-input { font-size: 26px !important; letter-spacing: 10px; font-weight: 700; text-align: center; }
.otp-resend { margin-top: -4px; }
.otp-resend .link-btn { padding: 0; }

/* ---- Quantity discount editor ---- */
.tier-head, .tier-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.tier-head { font-size: 12px; color: var(--muted); font-weight: 700; }
.tier-row input { min-height: 44px; padding: 8px 10px; }
.tier-pct { display: flex; align-items: center; gap: 6px; }
.tier-pct span { color: var(--muted); font-weight: 700; }
.domain-row input { flex: 1; min-width: 180px; min-height: 40px; padding: 6px 10px; }
.plan-card.current { box-shadow: 0 0 0 3px var(--green); }

/* ---- Quantity discounts, catalogue mode, estimates ---- */
.bulk-tag { margin: 0; font-size: 12px; font-weight: 700; color: var(--wa); }
.tiers { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.tiers:empty { display: none; }
.tier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-chip { font-size: 13px; padding: 4px 10px; border-radius: 14px; background: #E1F0E6; color: var(--green); }
.tier-chip.on { background: var(--green); color: #fff; font-weight: 700; }
.stepper input { width: 52px; min-height: 36px; height: 36px; padding: 0 4px; border: 0; border-radius: 8px; text-align: center; font-weight: 700; background: rgba(255,255,255,.15); color: #fff; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body.catalog #pdPrice, body.catalog .co-total, body.catalog .cartbar .amt { display: none; }
.done-actions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.est-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-type { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier-unit { white-space: nowrap; }

/* ---- Order editor ---- */
.edit-table { display: flex; flex-direction: column; gap: 8px; }
.edit-head, .edit-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1fr) 56px; gap: 8px; align-items: center; }
.edit-head { font-size: 12px; color: var(--muted); font-weight: 700; }
.edit-row input { min-height: 44px; padding: 8px 10px; }
.edit-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.edit-row.removed { opacity: .45; }
.edit-row.removed input:not([type=checkbox]) { text-decoration: line-through; }
.add-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .8fr) minmax(0, 1fr); gap: 8px; }
.add-row select, .add-row input { min-height: 44px; padding: 8px 10px; }
@media (max-width: 640px) {
  .edit-head { display: none; }
  .edit-row { grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--soft); padding: 10px; border-radius: 12px; }
  .edit-row > span:first-child { grid-column: 1 / -1; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .add-row select { grid-column: 1 / -1; }
}

/* ---- Catalogue & QR ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cat-qr, .cat-pdf { display: flex; flex-direction: column; gap: 12px; }
.qr-box { align-self: center; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 0 0 1px var(--line); }
.qr-box svg { display: block; width: 240px; height: 240px; max-width: 100%; }

/* ---- v3: options with stock, categories, inventory, reports ---- */
.opt5 { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, .8fr) 56px 44px !important; }
.req { color: var(--danger); font-weight: 700; font-size: 12px; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 8px; }
.cat-chips button { white-space: nowrap; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--white); font: 500 14px var(--body); color: var(--ink); cursor: pointer; }
.cat-chips button.on { background: var(--green); border-color: var(--green); color: #fff; }
.cat-title { grid-column: 1 / -1; margin: 10px 0 -4px; font-size: 18px; }
.stock-low { color: var(--danger); font-weight: 700; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.inv-table th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.inv-table td { padding: 8px; border-bottom: 1px solid #ECEEE8; vertical-align: middle; }
.inv-table input { width: 110px; min-height: 40px; padding: 6px 10px; }
.table-wrap { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bars .bar { flex: 1; background: #2E7D5B; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { background: var(--green); }
.bar-labels { display: flex; gap: 4px; font-size: 11px; color: var(--muted); }
.bar-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.range-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle-form { display: inline-flex; }
.chip-btn { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--white); font: 600 13px var(--body); cursor: pointer; color: var(--muted); }
.chip-btn.on { background: #E1F0E6; border-color: var(--wa); color: var(--green); }
.price-note { margin: 4px 20px 8px; }
.price-modes { border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; } .price-modes legend { font-size: 14px; font-weight: 700; padding: 0 6px; }
.log { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--soft); padding: 12px; border-radius: 10px; max-height: 480px; overflow: auto; margin: 0; }

/* ---- Installable app ---- */
.top-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
button.acct-link { border: 0; font: 500 14px var(--body); cursor: pointer; }
.install-hint { margin: 10px 20px 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; position: relative; z-index: 1; }
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1.5px dashed var(--line); }
.install-card > div { flex: 1 1 260px; }
.install-hint-inline { margin: 6px 0 0; color: var(--ink); }

/* ---- Store design picker (seller settings) ---- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0; }
.themes legend { font-weight: 700; margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.theme-opt { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer; position: relative; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-opt.locked { cursor: not-allowed; opacity: .6; }
.theme-name { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.theme-name .ic { width: 14px; height: 14px; vertical-align: -2px; }
.tp { display: block; height: 84px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #E4E6E0; }
.tp i { display: block; font-style: normal; }
.tp-top { height: 24px; background: #0F3D2E; }
.tp .tp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; }
.tp-tiles i { height: 22px; border-radius: 5px; background: #E6E8E2; }
.tp-pop .tp-top { background: var(--accent); }
.tp-minimal .tp-top { background: #fff; border-bottom: 1px solid #E4E6E0; }
.tp-minimal .tp-tiles i { border-radius: 1px; }
.tp-dark { background: #121A17; border-color: #121A17; }
.tp-dark .tp-top { background: #0B1310; }
.tp-dark .tp-tiles i { background: #2A3631; }
.tp.tp-list .tp-tiles { grid-template-columns: 1fr; gap: 4px; }
.tp-list .tp-tiles i { height: 10px; border-radius: 3px; border-left: 14px solid #C9CDC5; }

/* ---- Store themes (storefront + customer pages) ---- */
/* Colour pop: header in the store's own colour */
body.theme-pop .shop-top, body.theme-pop .cust-top { background: var(--accent); color: var(--on-accent); }
body.theme-pop .shop-host, body.theme-pop .back.light { color: var(--on-accent); opacity: .8; }
body.theme-pop .acct-link { background: rgba(0,0,0,.14); color: var(--on-accent); }
body.theme-pop .acct-link:hover { background: rgba(0,0,0,.24); color: var(--on-accent); }
body.theme-pop .cat-chips button.on, body.theme-pop .stepper { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
body.theme-pop .stepper button { color: var(--on-accent); }
body.theme-pop .btn.add { border-color: var(--accent); color: var(--ink); }
body.theme-pop .cartbar { background: var(--ink); }

/* Minimal: white, thin lines, square photos */
body.theme-minimal { background: #fff; }
body.theme-minimal .shop-top { background: #fff; height: auto; border-bottom: 1px solid var(--line); }
body.theme-minimal .shop-host { color: var(--muted); }
body.theme-minimal .acct-link { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
body.theme-minimal .acct-link:hover { background: var(--soft); color: var(--ink); }
body.theme-minimal .shop-head { margin-top: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
body.theme-minimal .shop-logo { border-radius: 50%; border-color: var(--line); border-width: 1px; }
body.theme-minimal .shop-head h1 { letter-spacing: 1px; text-transform: uppercase; font-size: 22px; }
body.theme-minimal .item-img, body.theme-minimal .btn.add, body.theme-minimal .shop-search input, body.theme-minimal .stepper { border-radius: 2px; }
body.theme-minimal .item-img { aspect-ratio: 1 / 1; }
body.theme-minimal .btn.add { border-color: var(--ink); color: var(--ink); }
body.theme-minimal .stepper, body.theme-minimal .cat-chips button.on { background: var(--ink); border-color: var(--ink); }
body.theme-minimal .cat-chips button { border-radius: 2px; }
body.theme-minimal .cartbar { background: var(--ink); border-radius: 4px; }
body.theme-minimal .cust-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
body.theme-minimal .back.light { color: var(--muted); }

/* Night: dark background */
body.theme-dark {
  --white: #16201C; --soft: #222D28; --paper: #0F1714; --ink: #EEF2EE; --muted: #A9B5AF; --line: #3A4741;
  --green: #0B1310; --green-2: #26332D; --wa: #3FBF7F; background: #0F1714; color-scheme: dark;
}
body.theme-dark .shop-top { background: #0B1310; border-bottom: 1px solid #26332D; }
body.theme-dark .shop-logo { border-color: #16201C; }
body.theme-dark .btn.add { border-color: var(--accent); color: var(--accent); }
body.theme-dark .stepper, body.theme-dark .cat-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
body.theme-dark .stepper button { color: var(--on-accent); }
body.theme-dark .price s, body.theme-dark .item-img { color: var(--muted); }
body.theme-dark .cartbar { background: var(--accent); color: var(--on-accent); }
body.theme-dark .cartbar .btn.primary { background: #0B1310; color: #fff; }
body.theme-dark .oos-tag { background: #000; }
body.theme-dark a:not(.btn):not(.acct-link) { color: var(--accent); }
body.theme-dark .flash.ok { color: #14201B; }

/* Wholesale list: compact rows with a small photo */
body.theme-list .shop-grid { grid-template-columns: 1fr; gap: 0; }
body.theme-list .item { display: grid; grid-template-columns: 76px 1fr auto; grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
body.theme-list .item-img { grid-row: 1 / 4; width: 76px; aspect-ratio: 1 / 1; border-radius: 10px; }
body.theme-list .item h2 { grid-column: 2; }
body.theme-list .item .price, body.theme-list .item .bulk-tag { grid-column: 2; }
body.theme-list .item .qty-slot, body.theme-list .item > .btn.add { grid-column: 3; grid-row: 1 / 4; align-self: center; width: auto; min-width: 104px; }
body.theme-list .item .qty-slot .btn.add { width: 100%; }
body.theme-list .oos-tag { font-size: 10px; left: 4px; top: 4px; padding: 2px 5px; }
@media (max-width: 380px) {
  body.theme-list .item { grid-template-columns: 64px 1fr; }
  body.theme-list .item-img { width: 64px; }
  body.theme-list .item .qty-slot, body.theme-list .item > .btn.add { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 6px; }
}
body.theme-dark .acct-link, body.theme-dark .cust-top, body.theme-dark .back.light { color: #EEF2EE; }
body.theme-dark .acct-link:hover { background: #33423B; color: #fff; }
body.theme-dark .shop-host { color: #A9B5AF; }
.progress { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; margin: 14px 0 8px; }
.progress span { display: block; height: 100%; background: var(--green); transition: width .3s; }
.price .ask { color: var(--muted); font-weight: 700; font-size: 14px; }
