
/* The Othman Brand — shop + back office.
   Layout: Amazon-style shop — dark sticky header + search, category rail, marble hero, product shelves; owners get a tabbed back office in the same page */
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh}
img{max-width:100%}
[hidden]{display:none!important}
:root{
  --ink:#141516;--ink-2:#232528;--on-ink:#f2eee6;--on-ink-dim:#b9b4aa;
  --gold:#c9a25a;--gold-deep:#9a7638;--gold-soft:#f3e9d5;
  --bg:#eff0ee;--surface:#ffffff;--surface-2:#f6f6f4;--line:#dcdcd7;
  --fg:#1b1c1d;--fg-dim:#5d5f62;--fg-faint:#8a8c8f;
  --deal:#b3261e;--deal-soft:#fbe9e7;--ok:#1f7a4d;--ok-soft:#e3f2ea;--warn:#a5610a;--warn-soft:#fdf0dc;
  --shadow:0 1px 2px rgba(20,21,22,.06),0 6px 18px rgba(20,21,22,.06);
  --display:"Bodoni Moda","Didot","Bodoni 72",Georgia,serif;
  --body:"Jost","Avenir Next","Segoe UI",system-ui,sans-serif;
  --r:10px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0f1011;--surface:#1a1b1d;--surface-2:#222326;--line:#2f3134;
  --fg:#ecE8e1;--fg-dim:#b0aca5;--fg-faint:#85827c;--gold-soft:#2f2717;
  --deal:#ff8a80;--deal-soft:#3a1d1b;--ok:#6fd3a0;--ok-soft:#173326;--warn:#f2b45c;--warn-soft:#3a2a12;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 22px rgba(0,0,0,.35);color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0f1011;--surface:#1a1b1d;--surface-2:#222326;--line:#2f3134;
  --fg:#ece8e1;--fg-dim:#b0aca5;--fg-faint:#85827c;--gold-soft:#2f2717;
  --deal:#ff8a80;--deal-soft:#3a1d1b;--ok:#6fd3a0;--ok-soft:#173326;--warn:#f2b45c;--warn-soft:#3a2a12;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 22px rgba(0,0,0,.35);color-scheme:dark}
*{box-sizing:border-box}
body{background:var(--bg);color:var(--fg);font-family:var(--body);font-size:15px;line-height:1.5}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.wrap{max-width:1280px;margin:0 auto;padding-inline:16px}
.num{font-variant-numeric:tabular-nums}
h1,h2,h3{text-wrap:balance;margin:0}

/* header */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:30;background:var(--ink);color:var(--on-ink)}
.top-in{display:flex;align-items:center;gap:14px;padding-block:10px}
.brand{display:flex;align-items:center;gap:10px;background:none;border:0;padding:0;color:inherit;flex:none}
.brand img{width:42px;height:42px;border-radius:50%;display:block}
.brand b{font-family:var(--display);font-weight:600;font-size:1.25rem;letter-spacing:.01em;white-space:nowrap}
.brand small{display:block;font-size:.66rem;letter-spacing:.18em;text-transform:uppercase;color:var(--gold);line-height:1}
.search{flex:1;display:flex;min-width:0;border-radius:8px;overflow:hidden;background:#fff;border:2px solid transparent}
.search:focus-within{border-color:var(--gold)}
.search input{flex:1;min-width:0;border:0;padding:9px 12px;background:#fff;color:#141516;outline:none}
.search button{border:0;background:var(--gold);color:var(--ink);padding:0 16px;font-weight:600}
.tbtn{display:flex;align-items:center;gap:6px;background:none;border:1px solid transparent;color:var(--on-ink);padding:6px 10px;border-radius:8px;white-space:nowrap}
.tbtn:hover{border-color:#ffffff33}
.tbtn .cnt{background:var(--gold);color:var(--ink);font-weight:700;border-radius:20px;min-width:22px;padding:0 6px;font-size:.8rem;text-align:center}
.tbtn.admin{border-color:var(--gold);color:var(--gold)}
.cats{background:var(--ink-2);color:var(--on-ink)}
.cats-in{display:flex;gap:4px;overflow-x:auto;padding-block:6px;scrollbar-width:none}
.cats-in::-webkit-scrollbar{display:none}
.chip{border:1px solid transparent;background:none;color:var(--on-ink);padding:5px 12px;border-radius:20px;white-space:nowrap;font-size:.92rem}
.chip:hover{border-color:#ffffff40}
.chip.on{background:var(--on-ink);color:var(--ink);font-weight:600}
.chip.hot{color:var(--gold)}
.banner{background:var(--gold);color:var(--ink)}
.banner-in{display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;align-items:center;padding-block:7px;font-weight:500;text-align:center}
.timer{font-variant-numeric:tabular-nums;background:var(--ink);color:var(--gold);padding:1px 8px;border-radius:5px;font-size:.88rem}
@media (max-width:720px){
  .top-in{flex-wrap:wrap}
  .search{order:3;flex-basis:100%}
  .brand b{font-size:1.1rem}
  .tbtn .lbl{display:none}
  .top-in .spacer{flex:1}
}

/* hero */
.hero{margin-top:18px;border-radius:14px;overflow:hidden;color:#16171a;display:grid;grid-template-columns:1.1fr 1fr;
  background:
   linear-gradient(115deg,transparent 0 38%,rgba(255,255,255,.55) 38.3%,transparent 38.8%),
   linear-gradient(64deg,transparent 0 61%,rgba(255,255,255,.35) 61.2%,transparent 61.5%),
   linear-gradient(150deg,transparent 0 70%,rgba(120,120,120,.18) 70.2%,transparent 70.6%),
   radial-gradient(120% 140% at 20% 10%,#d9dad7 0,#bfc1bf 55%,#a9aba9 100%)}
.hero-copy{padding:34px 32px;display:flex;flex-direction:column;gap:14px;justify-content:center}
.eyebrow{font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;font-weight:600;color:#7a5b22}
.hero h1{font-family:var(--display);font-size:clamp(2rem,4.4vw,3.4rem);line-height:1.02;font-weight:600}
.hero p{margin:0;max-width:38ch;color:#2f3134}
.hero-pics{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:8px;padding:14px;height:380px}
.hero-pics button{border:0;padding:0;border-radius:10px;overflow:hidden;background:#0002}
.hero-pics button:first-child{grid-row:span 2}
.hero-pics img{width:100%;height:100%;object-fit:cover;display:block}
@media (max-width:720px){.hero{grid-template-columns:1fr}.hero-copy{padding:24px 20px}.hero-pics{height:260px}}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--surface);color:var(--fg);padding:8px 14px;border-radius:8px;font-weight:500;text-decoration:none;white-space:nowrap}
.btn:hover{border-color:var(--fg-faint)}
.btn.pri{background:var(--gold);border-color:var(--gold);color:var(--ink);font-weight:600}
.btn.pri:hover{background:var(--gold-deep);border-color:var(--gold-deep);color:#fff}
.btn.dark{background:var(--ink);border-color:var(--ink);color:var(--on-ink)}
.btn.danger{color:var(--deal);border-color:var(--deal)}
.btn.sm{padding:5px 10px;font-size:.88rem}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.hero .btn{align-self:flex-start}

/* shelves */
.sec{margin-top:28px}
.sec-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.sec-h h2{font-family:var(--display);font-size:1.6rem;font-weight:600}
.sec-h .sub{color:var(--fg-dim);font-size:.92rem}
.linkbtn{background:none;border:0;color:var(--gold-deep);font-weight:600;padding:0}
:root[data-theme="dark"] .linkbtn{color:var(--gold)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .linkbtn{color:var(--gold)}}
.shelf{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(200px,230px);gap:14px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory}
.shelf>*{scroll-snap-align:start}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
@media (max-width:460px){.grid{grid-template-columns:1fr 1fr;gap:10px}.shelf{grid-auto-columns:minmax(160px,46%)}}

.card{background:var(--surface);border-radius:var(--r);overflow:hidden;display:flex;flex-direction:column;box-shadow:var(--shadow);min-width:0}
.card .pic{position:relative;aspect-ratio:1;background:var(--surface-2);border:0;padding:0;display:block;width:100%}
.card .pic img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s}
.card:hover .pic img{transform:scale(1.04)}
.badges{position:absolute;left:8px;top:8px;display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.bdg{font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:2px 7px;border-radius:4px}
.bdg.new{background:var(--ink);color:var(--gold)}
.bdg.deal{background:var(--deal);color:#fff}
.bdg.sample{background:#fff;color:#555;border:1px dashed #999}
.card .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:4px;flex:1}
.card .cat{font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--fg-faint)}
.card .nm{font-weight:500;line-height:1.3;background:none;border:0;padding:0;text-align:left;color:var(--fg);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card .nm:hover{color:var(--gold-deep)}
.price{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.price .now{font-size:1.2rem;font-weight:600;font-variant-numeric:tabular-nums}
.price .per{color:var(--fg-dim);font-size:.82rem}
.price .was{color:var(--fg-faint);text-decoration:line-through;font-size:.85rem}
.price .off{color:var(--deal);font-weight:600;font-size:.85rem}
.stock-note{font-size:.82rem;color:var(--warn);font-weight:500}
.ends{font-size:.8rem;color:var(--deal)}
.card .add{margin-top:auto;padding-top:6px}
.card .add .btn{width:100%}

.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.toolbar select,.field input,.field select,.field textarea,.inp{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:8px 10px;min-width:0}
.empty{background:var(--surface);border:1px dashed var(--line);border-radius:var(--r);padding:28px;text-align:center;color:var(--fg-dim)}

/* footer */
.foot{margin-top:40px;background:var(--ink);color:var(--on-ink-dim)}
.foot-in{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;padding-block:26px;font-size:.92rem}
.foot b{color:var(--on-ink);display:block;margin-bottom:4px;font-weight:600}
.foot .copy{background:none;border:1px solid #ffffff30;color:var(--on-ink);border-radius:6px;padding:1px 8px;font-size:.8rem;margin-left:6px}

/* modal + drawer */
.scrim{position:fixed;inset:0;background:rgba(10,10,12,.55);z-index:50;display:flex;align-items:flex-start;justify-content:center;padding:calc(env(safe-area-inset-top,0px) + 4vh) 16px 16px;overflow-y:auto}
.modal{background:var(--surface);border-radius:14px;width:min(960px,100%);box-shadow:0 20px 60px rgba(0,0,0,.35);position:relative}
.modal.narrow{width:min(560px,100%)}
.x{position:absolute;right:10px;top:10px;width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:var(--surface);font-size:1.2rem;line-height:1;z-index:2}
.pd{display:grid;grid-template-columns:1.05fr 1fr;gap:24px;padding:22px}
@media (max-width:760px){.pd{grid-template-columns:1fr;padding:16px}}
.zoom{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:var(--surface-2);cursor:zoom-in}
.zoom img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .15s}
.zoom.on img{transform:scale(2.2)}
.zoom .hint{position:absolute;right:8px;bottom:8px;background:rgba(0,0,0,.6);color:#fff;font-size:.75rem;padding:2px 8px;border-radius:12px}
.pd h2{font-family:var(--display);font-size:1.7rem;font-weight:600;line-height:1.1;padding-right:36px}
.pd .stack{display:flex;flex-direction:column;gap:12px;min-width:0}
.pd .price .now{font-size:1.7rem}
.opts{display:flex;flex-wrap:wrap;gap:6px}
.opt{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:5px 12px}
.opt.on{border-color:var(--gold);background:var(--gold-soft);font-weight:600}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.stepper button{border:0;background:var(--surface-2);width:36px;height:36px;font-size:1.1rem}
.stepper input{width:64px;text-align:center;border:0;background:var(--surface);height:36px}
.calc{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface-2)}
.calc summary{cursor:pointer;font-weight:600}
.calc .row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px}
.muted{color:var(--fg-dim);font-size:.88rem}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(420px,100%);background:var(--surface);z-index:60;display:flex;flex-direction:column;box-shadow:-10px 0 40px rgba(0,0,0,.3);padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
.drawer-h{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line)}
.drawer-h h2{font-family:var(--display);font-size:1.4rem}
.drawer-b{flex:1;overflow-y:auto;padding:12px 16px;display:flex;flex-direction:column;gap:12px}
.drawer-f{border-top:1px solid var(--line);padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.line{display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:start}
.line img{width:64px;height:64px;object-fit:cover;border-radius:8px}
.line .ln-top{display:flex;justify-content:space-between;gap:8px}
.tot{display:flex;justify-content:space-between;font-weight:600;font-size:1.1rem}

/* admin */
.adm-h{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:18px}
.adm-h h1{font-family:var(--display);font-size:1.8rem;font-weight:600}
.savepill{font-size:.82rem;padding:3px 10px;border-radius:20px;background:var(--ok-soft);color:var(--ok);font-weight:500}
.savepill.pending,.savepill.saving{background:var(--warn-soft);color:var(--warn)}
.savepill.error{background:var(--deal-soft);color:var(--deal)}
.tabs{display:flex;gap:4px;overflow-x:auto;margin-top:12px;border-bottom:1px solid var(--line)}
.tab{border:0;background:none;padding:10px 14px;border-bottom:3px solid transparent;color:var(--fg-dim);font-weight:500;white-space:nowrap}
.tab.on{color:var(--fg);border-bottom-color:var(--gold)}
.panel{margin-top:18px;display:flex;flex-direction:column;gap:18px}
.box{background:var(--surface);border-radius:var(--r);padding:16px;box-shadow:var(--shadow);min-width:0}
.box h3{font-size:1.05rem;font-weight:600;margin-bottom:10px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.kpi{background:var(--surface);border-radius:var(--r);padding:14px 16px;box-shadow:var(--shadow)}
.kpi .k{font-size:.75rem;letter-spacing:.1em;text-transform:uppercase;color:var(--fg-faint)}
.kpi .v{font-size:1.5rem;font-weight:600;font-variant-numeric:tabular-nums}
.kpi .s{font-size:.82rem;color:var(--fg-dim)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media (max-width:860px){.two{grid-template-columns:1fr}}
.bars{display:grid;grid-template-columns:repeat(14,1fr);gap:4px;align-items:end;height:150px;padding-top:6px;border-bottom:1px solid var(--line)}
.bars div{background:var(--gold);border-radius:3px 3px 0 0;min-height:2px;position:relative}
.bars div.today{background:var(--ink)}
:root[data-theme="dark"] .bars div.today{background:var(--on-ink)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .bars div.today{background:var(--on-ink)}}
.bar-l{display:grid;grid-template-columns:repeat(14,1fr);gap:4px;font-size:.68rem;color:var(--fg-faint);text-align:center;margin-top:4px}
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line);min-width:0}
.li:first-child{border-top:0}
.li img{width:40px;height:40px;border-radius:6px;object-fit:cover;flex:none}
.li .grow{flex:1;min-width:0}
.li .grow b{font-weight:500;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pill{font-size:.75rem;padding:2px 8px;border-radius:20px;font-weight:600;white-space:nowrap}
.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.bad{background:var(--deal-soft);color:var(--deal)}
.pill.mute{background:var(--surface-2);color:var(--fg-dim)}
.tbl-wrap{overflow-x:auto}
table.inv{width:100%;border-collapse:collapse;min-width:820px}
.inv th{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--fg-faint);text-align:left;font-weight:600;padding:8px;border-bottom:1px solid var(--line)}
.inv td{padding:8px;border-bottom:1px solid var(--line);vertical-align:middle}
.inv td.r,.inv th.r{text-align:right}
.inv img{width:48px;height:48px;border-radius:6px;object-fit:cover;display:block}
.inv tr.off td{opacity:.62}
.sw{position:relative;display:inline-block;width:40px;height:22px;flex:none}
.sw input{opacity:0;width:0;height:0;position:absolute}
.sw span{position:absolute;inset:0;background:var(--line);border-radius:20px;transition:.2s;cursor:pointer}
.sw span::before{content:"";position:absolute;width:16px;height:16px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 2px #0004}
.sw input:checked+span{background:var(--ok)}
.sw input:checked+span::before{transform:translateX(18px)}
.sw input:focus-visible+span{outline:2px solid var(--gold);outline-offset:2px}
.swl{display:flex;align-items:center;gap:8px}
.form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.form .full{grid-column:1/-1}
@media (max-width:600px){.form{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field label,.flabel{font-size:.8rem;font-weight:600;color:var(--fg-dim)}
.field textarea{min-height:76px;resize:vertical}
.drop{border:2px dashed var(--line);border-radius:10px;padding:16px;text-align:center;background:var(--surface-2)}
.drop.over{border-color:var(--gold);background:var(--gold-soft)}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.compare label{display:flex;flex-direction:column;gap:6px;border:2px solid var(--line);border-radius:10px;padding:6px;cursor:pointer}
.compare label.on{border-color:var(--gold)}
.compare img{aspect-ratio:1;object-fit:cover;width:100%;border-radius:6px}
.compare input{position:absolute;opacity:0}
.mfoot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:14px 22px;border-top:1px solid var(--line)}
.mhead{padding:18px 22px 0}
.mhead h2{font-family:var(--display);font-size:1.5rem;font-weight:600;padding-right:40px}
.mbody{padding:16px 22px}
.pos{display:grid;grid-template-columns:1fr 1.1fr;gap:18px;align-items:start}
@media (max-width:860px){.pos{grid-template-columns:1fr}}
.pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;max-height:520px;overflow-y:auto}
.pick button{display:flex;flex-direction:column;gap:4px;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:6px;min-width:0}
.pick button:hover{border-color:var(--gold)}
.pick img{width:100%;aspect-ratio:1.4;object-fit:cover;border-radius:5px}
.pick .t{font-size:.84rem;font-weight:500;line-height:1.25;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.tk{display:grid;grid-template-columns:1fr 84px 104px 30px;gap:6px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}
.tk input{width:100%;border:1px solid var(--line);border-radius:6px;padding:5px 6px;background:var(--surface);text-align:right}
.tk .rm{border:0;background:none;color:var(--fg-faint);font-size:1.1rem}
.receipt{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.86rem;white-space:pre-wrap;background:var(--surface-2);border-radius:8px;padding:14px;border:1px solid var(--line)}
.note{background:var(--gold-soft);border-radius:8px;padding:10px 12px;font-size:.9rem;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.meter{height:8px;background:var(--surface-2);border-radius:8px;overflow:hidden;border:1px solid var(--line)}
.meter i{display:block;height:100%;background:var(--gold)}
.toast{position:fixed;left:50%;bottom:calc(18px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--on-ink);padding:10px 16px;border-radius:10px;z-index:90;box-shadow:0 8px 24px rgba(0,0,0,.3);max-width:calc(100% - 32px)}
.toast.err{background:var(--deal);color:#fff}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* sign-in */
.auth{max-width:420px;margin:8vh auto;background:var(--surface);border-radius:14px;box-shadow:var(--shadow);padding:28px 24px;display:flex;flex-direction:column;gap:14px}
.auth img{width:72px;height:72px;border-radius:50%;align-self:center}
.auth h1{font-family:var(--display);font-size:1.7rem;font-weight:600;text-align:center}
.auth .err{color:var(--deal);font-size:.9rem;min-height:1.2em;margin:0}
.auth .btn{width:100%}
.who{color:var(--on-ink-dim);font-size:.88rem;white-space:nowrap}
a.tbtn{text-decoration:none}
.loading{padding:60px 0;text-align:center;color:var(--fg-dim)}
.skel{background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));background-size:200% 100%;animation:sk 1.2s infinite;border-radius:var(--r);aspect-ratio:.72}
@keyframes sk{to{background-position:-200% 0}}

/* colour variants */
.swatches{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.swatch{width:26px;height:26px;border-radius:50%;padding:0;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line);overflow:hidden;background:var(--surface-2)}
.swatch:hover{box-shadow:0 0 0 2px var(--gold)}
.swatch img{width:100%;height:100%;object-fit:cover;display:block}
.sw-note{font-size:.78rem;color:var(--fg-dim);margin-left:2px}
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;margin-top:6px}
.vopt{display:flex;flex-direction:column;gap:2px;text-align:left;border:2px solid var(--line);background:var(--surface);border-radius:10px;padding:5px;min-width:0}
.vopt img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:6px;display:block}
.vopt .vn{font-size:.84rem;font-weight:600;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vopt .vq{font-size:.74rem;color:var(--fg-dim)}
.vopt.on{border-color:var(--gold);background:var(--gold-soft)}
.vopt[disabled]{opacity:.45;cursor:not-allowed}
.vopt[disabled] img{filter:grayscale(1)}
.vrow{display:grid;grid-template-columns:64px minmax(0,1fr) 110px auto;gap:10px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}
.vrow:first-child{border-top:0}
.vrow .vpic{width:64px;height:64px;border-radius:8px;object-fit:cover;background:var(--surface-2);border:1px dashed var(--line);display:flex;align-items:center;justify-content:center;font-size:.7rem;color:var(--fg-faint);cursor:pointer;overflow:hidden;text-align:center;padding:0}
.vrow .vpic img{width:100%;height:100%;object-fit:cover}
.vrow input{border:1px solid var(--line);border-radius:8px;padding:7px 9px;background:var(--surface);min-width:0;width:100%}
.vrow .vtools{display:flex;flex-direction:column;gap:2px;align-items:flex-end}
@media (max-width:520px){.vrow{grid-template-columns:56px minmax(0,1fr) 84px;}.vrow .vtools{grid-column:1/-1;flex-direction:row;justify-content:flex-end;gap:10px}}
.chipv{display:inline-flex;align-items:center;gap:4px;font-size:.75rem;color:var(--fg-dim);margin:2px 6px 0 0;white-space:nowrap}
.chipv img{width:16px;height:16px;border-radius:50%;object-fit:cover}
.chipv.out{opacity:.5;text-decoration:line-through}

/* chat widget (shop) */
.chat-fab{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:70;display:flex;align-items:center;gap:8px;border:0;border-radius:28px;background:var(--ink);color:var(--on-ink);padding:12px 18px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.chat-fab.on{width:48px;height:48px;padding:0;justify-content:center;font-size:1.5rem;border-radius:50%}
.chat-fab .cnt{background:var(--deal);color:#fff;border-radius:20px;min-width:22px;padding:0 6px;font-size:.78rem;text-align:center}
.chat-panel{position:fixed;right:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:70;width:min(380px,calc(100% - 32px));max-height:min(620px,calc(100vh - 110px));background:var(--surface);border-radius:14px;box-shadow:0 20px 50px rgba(0,0,0,.3);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line)}
.chat-h{display:flex;gap:10px;align-items:center;padding:12px 14px;background:var(--ink);color:var(--on-ink)}
.chat-h img{width:36px;height:36px;border-radius:50%}
.chat-h small{display:block;color:var(--on-ink-dim);font-size:.78rem;line-height:1.3}
.chat-b{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;min-height:160px}
.chat-form{gap:10px}
.chat-form textarea{min-height:90px}
.bub{max-width:85%;padding:8px 11px;border-radius:12px;font-size:.92rem;line-height:1.4;overflow-wrap:anywhere}
.bub small{display:block;font-size:.7rem;opacity:.7;margin-top:3px}
.bub.me{align-self:flex-end;background:var(--gold);color:var(--ink);border-bottom-right-radius:4px}
.bub.them{align-self:flex-start;background:var(--surface-2);border:1px solid var(--line);border-bottom-left-radius:4px}
.chat-send{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--line)}
.chat-send textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface);min-height:40px;max-height:120px}
.chat-new{font-size:.8rem;padding:0 12px 10px;align-self:center}
.err-t{color:var(--deal);font-size:.86rem;margin:0}
@media (max-width:520px){.chat-fab .lbl{display:none}.chat-fab{padding:0;width:52px;height:52px;justify-content:center;border-radius:50%;font-size:1.3rem}.chat-fab .cnt{position:absolute;top:-4px;right:-4px}}

/* messages inbox (store manager) */
.tabbadge{background:var(--deal);color:#fff;border-radius:20px;font-size:.72rem;padding:0 6px;margin-left:5px;font-weight:700}
.inbox{display:grid;grid-template-columns:minmax(240px,340px) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:820px){.inbox{grid-template-columns:1fr}.inbox.has-thread .tlist-box{display:none}}
.tlist{display:flex;flex-direction:column;max-height:640px;overflow-y:auto}
.titem{display:flex;flex-direction:column;gap:2px;text-align:left;border:0;border-top:1px solid var(--line);background:none;padding:10px 6px;border-radius:0;min-width:0}
.titem:first-child{border-top:0}
.titem.on{background:var(--gold-soft)}
.titem .tt{display:flex;justify-content:space-between;gap:8px;align-items:center}
.titem b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.titem .tl{color:var(--fg-dim);font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.titem.unread b::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--deal);margin-right:6px;vertical-align:middle}
.convo{display:flex;flex-direction:column;gap:10px;min-width:0}
.convo-log{display:flex;flex-direction:column;gap:8px;max-height:460px;overflow-y:auto;padding:4px 2px}
.convo-log .bub.me{align-self:flex-start;background:var(--surface-2);color:var(--fg);border:1px solid var(--line);border-bottom-left-radius:4px;border-bottom-right-radius:12px}
.convo-log .bub.them{align-self:flex-end;background:var(--ink);color:var(--on-ink);border:0;border-bottom-right-radius:4px;border-bottom-left-radius:12px}
.reply{display:flex;gap:8px;align-items:flex-end}
.reply textarea{flex:1;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface);min-height:60px;resize:vertical}
