:root {
  color-scheme: light dark;
  --bg: #f7f5f0; --panel: #ffffff; --ink: #1f2a37; --muted: #5b6675; --line: #e3dfd6;
  --accent: #c2410c; --accent-ink: #ffffff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --soft: #fbf3ec;
}
@media (prefers-color-scheme: dark) {      /* follows the device's setting */
  :root {
    --bg: #14181f; --panel: #1c222b; --ink: #e8e6e1; --muted: #9aa4b2; --line: #2d3540;
    --accent: #fb923c; --accent-ink: #1a1a1a; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --soft: #2a2119;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
main { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
textarea { min-height: 70px; resize: vertical; }
input[type=number], select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--accent); background: var(--soft); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pill { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.listed { color: var(--ink); } .pill.err { color: var(--bad); }
/* Where a catalog product is live: one small letter per marketplace (A1/A2 per Amazon account), linking to it */
.mks { display: inline-flex; gap: 3px; vertical-align: 1px; }
.mk { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 4px; font: 600 .68rem/16px system-ui, sans-serif; text-align: center; text-decoration: none; color: #fff; background: var(--muted); }
.mk:hover { filter: brightness(1.1); text-decoration: none; }
/* the marketplaces' own brand colours: Amazon orange on its navy, Meesho's purple (jamuni), Flipkart yellow on its blue */
/* each marketplace's badge colours (.mk-<letter>) come from its registry entry: app.js setMe */
/* product page images in rows by where they go: a bar on the left says which marketplaces get that row */
.irow { display: flex; gap: 8px; margin-top: 10px; }
.irowbar { flex: 0 0 22px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 2px; border-right: 2px solid var(--line, #ddd); padding-right: 6px; }
.irowbar > span:last-child { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .68rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.irow .imgs { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.err { color: var(--bad); }
.ok-text { color: var(--ok); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) { td.opt, th.opt { display: none; } }

.pager { justify-content: space-between; margin: 6px 0 12px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
label.inline input, label.inline select { width: auto; }
.small { font-size: .8rem; }
.photo-row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.photo-row img { width: 110px; height: 110px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.photo-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.photo-fields input[type=text] { width: 260px; max-width: 100%; }
.photo-fields textarea { min-height: 54px; }
.dims input { width: 76px; padding: 7px 8px; }
.dims select { width: auto; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
select { font: inherit; }
@media (max-width: 600px) { .photo-row { grid-template-columns: 72px 1fr; } .photo-row img { width: 72px; height: 72px; } .dims input { width: 62px; } }

/* ---------- product review ---------- */
.strip-wrap { margin: 10px 0; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.thumb { flex: 0 0 auto; width: 92px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.thumb.on { border-color: var(--accent); }
.thumb img { width: 80px; height: 80px; object-fit: contain; background: #fff; border-radius: 6px; }
.thumb .pill { font-size: .65rem; padding: 1px 6px; }
.carousel { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: stretch; }
.nav { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; font-size: 2rem; cursor: pointer;
  position: sticky; top: 70px; height: calc(100vh - 90px); align-self: start; }
.nav:hover { background: var(--soft); color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.ptop { gap: 10px; margin-bottom: 10px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.ptop .pstat { gap: 10px; margin-left: auto; padding-bottom: 6px; }   /* which product, its status: on the right */
.ptop.tabbed { border-bottom: 1px solid var(--line); margin-bottom: 16px; }   /* the tabs' line runs under the whole bar */
.ptop .sidetabs { border-bottom: 0; margin: 0; }
.pgrid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; }
.pimg > img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.pform fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0 0 12px; }
.pform legend { font-weight: 700; padding: 0 6px; }
.fld { display: block; margin: 8px 0 0; font-weight: 600; font-size: .9rem; }
.fld input, .fld textarea, .fld select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 400; }
.fld input:disabled, .fld textarea:disabled, .fld select:disabled { opacity: .7; }
.ferr { display: block; color: var(--bad); font-weight: 400; font-size: .8rem; min-height: 1em; }
.count { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }   /* listing text: under its label */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.pkghead { display: flex; align-items: center; gap: 4px; }
.gids { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }   /* a listing's ids on one line */
.actions { background: var(--soft); border-left: 4px solid var(--warn); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: .9rem; }
details summary { cursor: pointer; font-weight: 700; margin: 8px 0; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.img { border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--bg); }
.img img, .img .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.img.removed img { opacity: .3; }
.iname { font-size: .75rem; margin-top: 4px; line-height: 1.2; }
.img .row { gap: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; margin-right: 6px; }
@keyframes pulse { 50% { opacity: .25; } }
h3 { font-size: 1rem; margin: 14px 0 8px; }
@media (max-width: 760px) {
  .pgrid { grid-template-columns: 1fr; }
  .carousel { grid-template-columns: 30px 1fr 30px; gap: 4px; }
  .nav { font-size: 1.4rem; }
}

/* ---------- settings + table view ---------- */
.seg .btn { border-radius: 0; } .seg .btn:first-child { border-radius: 8px 0 0 8px; } .seg .btn:last-child { border-radius: 0 8px 8px 0; }
.seg .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fld input.bad { border-color: var(--bad); }

[hidden] { display: none !important; }   /* layout rules must never override hidden */

/* ---------- image overlay ---------- */
.zoom { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, .88); display: grid;
  grid-template-columns: 64px 1fr 64px; align-items: center; justify-items: center; padding: 16px; }
.lb figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; }
.lb img { max-width: min(90vw, 1000px); max-height: 80vh; object-fit: contain; background: #fff; border-radius: 8px; }
.lb figcaption { color: #e8e6e1; font-size: .95rem; text-align: center; }
.lb-nav { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 2rem; cursor: pointer; }
.lb-nav:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.lb-nav:disabled { opacity: .25; cursor: default; }
.lb-x { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.2rem; cursor: pointer; }
@media (max-width: 600px) { .lb { grid-template-columns: 40px 1fr 40px; padding: 8px; } .lb-nav { width: 38px; height: 38px; font-size: 1.5rem; } }

/* ---------- wider batch pages ---------- */
body.wide main { max-width: 1440px; }
@media (min-width: 761px) {
  body.wide .pgrid { grid-template-columns: minmax(260px, 420px) 1fr; gap: 28px; }
  body.wide .pform .g2 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  main { padding: 14px 12px 50px; }
  .bar { padding: 10px 12px; gap: 8px; }
  nav { gap: 10px; font-size: .9rem; }
  #who { display: none; }                       /* the email takes a whole line on phones */
  .g2 { grid-template-columns: 1fr; }
  .g3 { gap: 0 8px; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .panel { padding: 12px; }
  .pgrid { gap: 14px; }                         /* one column from 760px down */
}

/* chips (marketplace categories, filters) */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); font-size: .85rem; }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 2px 6px; border-radius: 999px; }
.chip-x:hover { background: var(--line); color: var(--ink); }
.mtabs .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mtabs .tab { order: 0; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 8px 8px 0 0; background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.mtabs .tab.on { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.mtabs .tabbody { order: 1; flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 4px; }
.mtabs .tabs.sub { margin-top: 8px; gap: 0 4px; }
.mtabs .tabs.sub > .tab { padding: 8px 12px 6px; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  background: none; color: var(--muted); font-weight: 500; box-shadow: none; }
.mtabs .tabs.sub > .tab:hover { color: var(--ink); border-bottom-color: var(--line); }
.mtabs .tabs.sub > .tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.mtabs .tabs.sub > .tabbody { border-top: 1px solid var(--line); margin-top: -1px; }
.mtabs .tab.addl { font-weight: 600; min-width: 36px; justify-content: center; color: var(--accent); }
.mtabs .tabrm { display: none; align-self: center; margin-left: -8px; padding: 3px; border: 0; border-radius: 6px; background: none; color: var(--muted); line-height: 0; cursor: pointer; }
.mtabs .tab.on + .tabrm { display: inline-flex; }   /* beside its product type tab (a sibling: no button in a button) */
.mtabs .tabrm:hover, .mtabs .tabrm:focus-visible { color: var(--bad); background: var(--panel); }
.mtabs .tabs.sub > .tab.addl { color: var(--accent); }
table.addltable td select { width: 100%; min-width: 150px; }
table.addltable td.small { color: var(--muted); padding-right: 10px; }
@media (max-width: 700px) {
  .mtabs .tabs.sub { display: flex; }
  .mtabs .tabs.sub > .tab { display: inline-flex; width: auto; margin-top: 0; border-radius: 0; }
  .mtabs .tabs.sub > .tabbody { padding: 0 0 8px; }
  .mtabs .tabs.sub > .tab::after, .mtabs .tab.addl::after { content: none; }
  .mtabs .tab.addl { justify-content: center; }
  table.addltable tr { display: grid; grid-template-columns: 1fr; padding: 6px 0; border-bottom: 1px solid var(--line); }
  table.addltable tr:first-child { display: none; }
  .mtabs .tabs { display: block; }
  .mtabs .tab { display: flex; width: 100%; justify-content: space-between; border-radius: 8px; margin-top: 6px; text-align: left; }
  .mtabs .tab::after { content: "▾"; color: var(--muted); }
  .mtabs .tab.on::after { content: "▴"; }
  .mtabs .tabbody { border-top: 0; padding: 0 4px 8px; }
}

/* page subtitle (batch name under the page title) */
.sub { margin: 2px 0 10px; }

/* Seller Notes: selecting photos and grouping photos of one product */
.groupbar { gap: 10px; align-items: center; }
.photo-row .pick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; }
.photo-row .pick input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; z-index: 1; }
.photo-row.group { grid-template-columns: 110px 1fr; background: var(--soft); border-radius: 10px; padding: 12px; }
.gside { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gitems { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.gcell { display: grid; gap: 4px; width: 84px; }
.gpurpose { width: 100%; box-sizing: border-box; font-size: .75rem; padding: 2px 4px; }
.gitem { position: relative; width: 84px; height: 84px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.gitem.on { border-color: var(--accent); }
.gitem img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.gitem .pill { position: absolute; bottom: 2px; left: 2px; font-size: .65rem; }
@media (max-width: 600px) { .photo-row.group { grid-template-columns: 72px 1fr; } .gitem { width: 64px; height: 64px; } .gcell { width: 64px; } }
.gitem.pickable { cursor: pointer; }
.gitem.pickable:hover { border-color: var(--accent); }
.photo-row .pick img.zoom { cursor: zoom-in; }
.photo-row .pick .trash { color: var(--bad); }
.gitem .zoombtn { position: absolute; top: 2px; left: 2px; border: 0; background: rgba(255,255,255,.9); border-radius: 50%;
  width: 24px; height: 24px; cursor: zoom-in; font-size: 13px; line-height: 24px; padding: 0; color: #1f2a37; }   /* dark on its white disc */

/* Seller Notes: photos chosen but not uploaded yet */
.pending { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.pthumb { position: relative; width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pthumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.pthumb .chip-x { position: absolute; top: 2px; right: 2px; background: rgba(255,255,255,.92); color: #5b6675; }
.gitem .star { position: absolute; top: 2px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9);
  color: var(--accent); font-size: 18px; line-height: 26px; text-align: center; pointer-events: none; }

/* landing page */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.card.tile { background: var(--bg); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); margin: 0; }
.card.tile:hover { border-color: var(--accent); }
.card.tile p { flex: 1; margin: 0; }
.card.tile .btn { align-self: flex-start; }
/* catalog and list tables */
.filters { gap: 10px; align-items: center; }
.filters input[type=search], .filters select, .ibar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit; min-height: 40px; }
.filters input[type=search]:focus, .filters select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.filters label.inline { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.ctable { width: 100%; border-collapse: collapse; }
.ctable th, .ctable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ctable .cthumb { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.ctable .ctitle { max-width: 380px; font-size: .9rem; }
.ctable .clots a, .ctable .clots button { display: block; text-align: left; }
.ctable input[type=text], .ctable input:not([type]) { width: 100%; }
#nav a.here { font-weight: 700; text-decoration: none; }
.carousel.single { grid-template-columns: 1fr; }
.ovr { margin-bottom: 8px; }      /* apart from the size fields below */
.ovr .row { gap: 6px; flex-wrap: wrap; align-items: center; }
/* the price and package lines: the size of the field headings */
.pform .ovr > .row.small, .pform .pkghead.small, .pform .ovr > .row .link.small, .pform .pkghead .link.small { font-size: .9rem; }
.ovrchip { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px 1px 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
table.ovrtable { border-collapse: collapse; width: 100%; max-width: 560px; }
table.ovrtable th { text-align: left; font-weight: 500; font-size: .85rem; padding: 3px 8px 3px 0; white-space: nowrap; }
table.ovrtable td { padding: 3px 6px 3px 0; }
table.ovrtable input { width: 100%; min-width: 70px; }
table.ovrtable .ferr:empty { display: none; }
@media (max-width: 600px) { .ctable .ctitle { max-width: 160px; } }
/* Amazon tab: category chips, the first is the main category */
.chip.main { border-color: var(--accent); background: var(--soft); font-weight: 600; }
.chip .link { text-decoration: none; color: var(--ink); }
.chip .link:hover { text-decoration: underline; }
/* Seller Notes: heading row with ✎ and "Add photos"; panels opened from tab buttons */
.snhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.snhead h1 { margin: 0; }
.snname { gap: 6px; align-items: center; }
.iconbtn { border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem;
  padding: 2px 8px; border-radius: 8px; }
.iconbtn:hover { border-color: var(--line); color: var(--ink); }
.ptabs { gap: 8px; margin: 4px 0 10px; }
.ptab { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: .9rem; cursor: pointer; }
.ptab::after { content: " ▸"; color: var(--muted); }
.ptab.on { border-color: var(--accent); background: var(--soft); }
.ptab.on::after { content: " ▾"; }
#rows .pick input[data-sel] { display: none; }
#rows.picking .pick input[data-sel] { display: inline-block; }
/* external link icon (opens the marketplace's product page) */
.extlink { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); vertical-align: middle;
  padding: 4px; border-radius: 6px; }
.extlink:hover { background: var(--soft); }
.asinrow { gap: 6px; align-items: center; flex-wrap: nowrap; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: var(--accent-ink); }
/* top bar: Lots ▾ and your-email ▾ menus; ☰ on phones */
.menu { position: relative; }
.menubtn { text-decoration: none; }
.menubtn:hover, .menubtn.here { text-decoration: underline; }
.menubtn.here { font-weight: 700; }
.menulist { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.menulist::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }   /* hover bridge */
.menulist.right { left: auto; right: 0; }
.menulist[hidden] { display: none; }
.menulist a, .menulist .menuitem { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menulist a:hover, .menulist .menuitem:hover { background: var(--soft); }
.menuhead { font-size: .8rem; color: var(--muted); padding: 8px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.burger { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; }
.addbtn#addtop { display: none; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; }
  .burger:not([hidden]) { display: inline-block; margin-left: auto; }
  .addbtn#addtop:not([hidden]) { display: inline-block; }
  #nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  body.navopen #nav:not([hidden]) { display: flex; }
  #nav .addbtn { display: none; }
  .menulist { position: static; box-shadow: none; margin: 4px 0 4px 12px; }
  #nav .menulist[hidden] { display: flex !important; }   /* phones: every menu shown open inside ☰ (beats the global [hidden]) */
}
.ph.big { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; }
.thumb .ph { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }
.card.prep h3 { font-size: 1.05rem; }
/* Help: a "?" in the top bar (also "Help" in the email menu) */
.helpicon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; text-decoration: none; font-size: .95rem; }
.helpicon:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) {
  .helpicon { width: auto; height: auto; border: 0; border-radius: 0; justify-content: flex-start; font-weight: 400; text-decoration: underline; }
  .helpicon::after { content: " Help"; }
}
/* account avatar (initials) and the menu's who/business header */
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; }
.avatar:hover, .avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--soft); text-decoration: none; }
.menuwho { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
  overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #m-user .avatar { align-self: flex-start; }
}
/* Settings: dividers between groups, tax row (GSTIN wider), ? tips */
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0 8px; }
.gtax { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 12px; }
.qtip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border: 1px solid var(--muted); border-radius: 50%; font-size: .7rem; color: var(--muted); cursor: help; vertical-align: 1px; }
.qtip > span { display: none; position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%); width: max-content; max-width: 260px;
  background: var(--ink, #222); color: var(--bg, #fff); padding: 6px 8px; border-radius: 6px; font-size: .8rem; font-weight: 400; line-height: 1.35; z-index: 20; white-space: normal; }
.qtip:hover > span, .qtip:focus > span { display: block; }
@media (max-width: 640px) { .gtax { grid-template-columns: 1fr 1fr; } .gtax > :first-child { grid-column: 1 / -1; } .qtip > span { left: 0; transform: none; } }
.fld input[type=checkbox] { display: inline; width: auto; margin: 0 4px 0 0; padding: 0; vertical-align: -2px; }
@media (max-width: 640px) { .gship { grid-template-columns: 1fr 1fr; } .gship > :last-child { grid-column: 1 / -1; } }
/* Images: library grid, picker, image panel */
.ibar { gap: 10px; margin-bottom: 10px; }
.ibar input[type=search] { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.fchips { gap: 6px; }
.fchip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.fchip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.selbar { gap: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--soft); border-radius: 8px; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.igrid.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 56vh; overflow: auto; margin: 10px 0; }
.icard { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--bg); cursor: pointer; min-width: 0; }
.icard:hover { border-color: var(--accent); }
.icard.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.icard img, .icard .ph { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.img .ph, .icard .ph { background: var(--panel); }   /* no image yet: a tile in the theme's colours (the muted text stays readable in dark mode) */
.icard .iname { font-size: .85rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .aib { font-size: .7rem; color: var(--muted); }   /* made with AI: a quiet tag beside the label, off the image */
.icard .ilabel { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.icard .ilabel .pill { font-size: .7rem; padding: 1px 7px; }
.isel { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(255,255,255,.9); border-radius: 6px; padding: 2px 4px; line-height: 0; }
.isel input { width: 18px; height: 18px; margin: 0; }
.ipick { width: min(960px, 96vw); max-height: 92vh; overflow: auto; margin: 0; }
.tools { gap: 6px; }
.tools .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.recbox { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; }
.recbox canvas { max-width: 100%; height: auto; cursor: crosshair; border-radius: 6px; display: block; margin: 6px 0; }
.recbox input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.colchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 4px 2px 6px; }
.colchip .sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); }
.colchip input { width: 90px; border: 0; background: none; color: var(--ink); font: inherit; font-size: .85rem; }
p.warn, .small.warn { color: var(--warn); }
@media (max-width: 760px) { .igrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ifilt { background: var(--soft); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.ifacts { display: grid; gap: 2px; margin-top: 6px; }
.ichanges { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 8px; }
.ichanges .inline { display: inline-flex; align-items: center; gap: 4px; }
.ichanges label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.ichanges input { width: auto; }
.ichanges .qh { width: 18px; height: 18px; font-size: .7rem; }
.ikids { gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.ikid { width: 52px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; cursor: pointer; display: grid; place-items: center; }
.ikid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idelrow { margin-top: 28px; }
/* Images editor page (/images/<id>) and collage page */
.edhead { gap: 12px; align-items: center; margin-bottom: 6px; }
.h1in { font-size: 1.4rem; font-weight: 700; border: 1px solid transparent; background: transparent; color: var(--ink); padding: 4px 6px; border-radius: 6px; width: 100%; max-width: 720px; }
.h1in:hover, .h1in:focus { border-color: var(--line); background: var(--panel); }
.edgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.edstage { position: sticky; top: 72px; }
.edwrap { position: relative; display: flex; justify-content: center; background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; border-radius: 8px; min-height: 200px; }
.edwrap img { display: block; max-width: 100%; max-height: 56vh; object-fit: contain; }
.edwrap canvas { position: absolute; pointer-events: none; touch-action: none; }
.edwrap canvas.active { pointer-events: auto; cursor: crosshair; }
.edbusy { position: absolute; top: 8px; right: 8px; background: var(--panel); border-radius: 999px; padding: 4px 8px; }
.esteps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.esteps > div { width: 100%; }
.stepchip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .85rem; background: var(--panel); }
.stepchip.ai { border-color: var(--accent); background: var(--soft); }
.edtools { display: grid; gap: 10px; }
.edgrid .card { margin: 0; }                      /* image and Tell box top-aligned */
.edtools .card { padding: 10px 14px; }
.edtools .ptabs { margin: 0; flex-wrap: wrap; }
.edtools hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.ehd { gap: 8px; align-items: center; }
.qh { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font: 600 .8rem/1 inherit; cursor: pointer; padding: 0; flex: none; }
.qh[aria-expanded=true], .qh:hover { border-color: var(--accent); color: var(--accent); }
.helptext { background: var(--soft); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.efacts { justify-content: space-between; align-items: flex-end; gap: 12px; }
.about { margin-top: 10px; }
.about summary { cursor: pointer; color: var(--muted); }
.etbox { position: absolute; border: 2px dashed var(--accent); border-radius: 4px; cursor: move; touch-action: none; box-sizing: border-box; background: rgba(255,255,255,.08); }
.etbox .rs { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; }
.stepchip[data-edit] { cursor: pointer; }
.stepchip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.edtitle { margin: 0 0 10px; gap: 10px; flex-wrap: nowrap; align-items: center; }
.edtitle .btn { flex: none; margin-left: auto; }
.edtools input:not([type]), .edtools input[type=text], .edtools select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.edtools textarea { width: 100%; box-sizing: border-box; margin: 6px 0; }
.edtools .tools { margin: 6px 0; gap: 6px; flex-wrap: wrap; align-items: center; }
.edtools input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
[data-mode].on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slider { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 8px; font-size: .9rem; margin: 4px 0; }
.slider span { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.lotpick { display: grid; gap: 6px; margin: 8px 0; }
.lotpick .btn { text-align: left; }
.layouts { gap: 8px; flex-wrap: wrap; }
.lay { width: 84px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; display: grid; gap: 3px; color: var(--ink); font-size: .72rem; }
.lay.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.lay i { display: block; background: var(--line); border-radius: 2px; min-height: 14px; }
.lay span { grid-column: 1 / -1; text-align: center; }
.lay.side { grid-template-columns: 1fr 1fr; } .lay.side i { min-height: 30px; }
.lay.grid4 { grid-template-columns: 1fr 1fr; }
.lay.grid9 { grid-template-columns: 1fr 1fr 1fr; } .lay.grid9 i { min-height: 8px; }
.lay.big2 { grid-template-columns: 2fr 1fr; } .lay.big2 i:first-child { grid-row: span 2; }
.lay.big3 { grid-template-columns: 1fr 1fr 1fr; } .lay.big3 i:first-child { grid-column: span 3; min-height: 20px; }
.lay.row23 { grid-template-columns: repeat(6, 1fr); } .lay.row23 i { grid-column: span 2; } .lay.row23 i:nth-child(-n+2) { grid-column: span 3; }
.lay.big4 { grid-template-columns: repeat(4, 1fr); } .lay.big4 i:first-child { grid-column: span 4; min-height: 20px; }
.lay.grid6 { grid-template-columns: 1fr 1fr 1fr; }
.lay.big5 { grid-template-columns: 1fr 1fr 1fr; } .lay.big5 i { min-height: 8px; } .lay.big5 i:first-child { grid-column: span 2; grid-row: span 2; }
.ccells { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ccell { border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--panel); }
.ccell.out { opacity: .45; }
.ccell[draggable=true] { cursor: grab; }
.ccell.dragging { opacity: .4; }
.ccell.drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.ccell img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.ccell .row { justify-content: space-between; }
@media (max-width: 820px) {
  .edgrid { grid-template-columns: 1fr; }
  .edstage { position: static; }
  .edtitle { flex-wrap: wrap; }
  .edtitle .btn { margin-left: 0; }
  .slider { grid-template-columns: 90px 1fr 36px; }
}
.mainacts { margin: 6px 0 10px; }
.mainacts .row { gap: 8px; }
.mainacts p { margin: 4px 0; }
/* listing image card: ‹ › and ✕ in a bar above the image; drag a card onto another to move it */
.img .itop { justify-content: space-between; margin-bottom: 2px; gap: 0; font-size: .8rem; line-height: 1.2; }   /* the size of Edit / Replace below */
.img .itop .link { text-decoration: none; padding: 0 4px; color: var(--muted); }
.img .itop .link:hover:not(:disabled) { color: var(--ink); }
.img .itop .link:disabled { opacity: .3; cursor: default; }
/* the caption sits between the bar and the image, always two lines high so the images line up */
.img .iname { margin: 0 0 4px; font-size: .85rem; font-weight: 600; height: 2.4em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.img[draggable="true"] { cursor: grab; }
.img.dragging { opacity: .4; }
.img.drop { outline: 2px solid var(--accent); outline-offset: 2px; }
.img .ph.making { flex-direction: column; gap: 6px; padding: 10px; text-align: center; overflow: hidden; }   /* stays square */
.img .ph.making .mtext { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
/* the Edit popup on the product page */
.qedit { width: min(480px, 96vw); max-height: 92vh; overflow: auto; margin: 0; display: grid; gap: 10px; }
.qedit img { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; background: #fff; justify-self: center; }
.qedit textarea { width: 100%; }
.qedit textarea[readonly] { opacity: .6; }
.qedit .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qedit .chips[hidden], .qedit [data-m]:empty { display: none; }
.qedit .chip { padding: 4px 10px; border-radius: 10px; }

/* ---- grid (table view): site/assets/grid.js ---- */
.grid-tools { gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.grid-tools .g-sep { flex: 0 0 12px; }
.grid-msg { margin-left: 6px; }
.grid-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 6px; outline: none; }
.grid-scroll:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.grid-wrap { position: relative; }
.grid-wrap::before, .grid-wrap::after { content: ""; position: absolute; top: 1px; bottom: 14px; width: 28px; pointer-events: none; z-index: 4; opacity: 0; transition: opacity .15s; }
.grid-wrap::after { right: 14px; background: linear-gradient(to left, rgba(0,0,0,.14), transparent); }
.grid-wrap::before { left: var(--g-frozen, 0); background: linear-gradient(to right, rgba(0,0,0,.10), transparent); }
.grid-wrap.g-more-r::after, .grid-wrap.g-more-l::before { opacity: 1; }
.grid-scroll { scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }
.grid-scroll::-webkit-scrollbar { width: 12px; height: 12px; }       /* always shown, also on Macs */
.grid-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 6px; border: 3px solid var(--panel); }
.grid-scroll::-webkit-scrollbar-track { background: var(--bg); }
.g-cols { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.g-cols[hidden] { display: none; }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: .9rem; user-select: none; -webkit-user-select: none; }
table.sheet th, table.sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 8px; height: 30px; white-space: nowrap; background: var(--panel); }
table.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-weight: 600; text-align: left; }
table.sheet thead th.g-corner { left: 0; z-index: 3; }
table.sheet th.g-head { position: sticky; left: 0; z-index: 1; background: var(--bg); font-weight: normal; text-align: left; cursor: pointer; }
table.sheet th.g-head.g-rsel { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
.g-sort { all: unset; cursor: pointer; }
.g-num { text-align: right; }
table.sheet td { cursor: cell; min-width: 60px; }
table.sheet td.g-sel { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
table.sheet td.g-cur { box-shadow: inset 0 0 0 2px var(--accent); }
table.sheet td.g-locked { color: var(--muted); background: color-mix(in srgb, var(--muted) 6%, var(--panel)); }
table.sheet td.g-locked.g-sel { background: color-mix(in srgb, var(--accent) 8%, color-mix(in srgb, var(--muted) 8%, var(--panel))); }
table.sheet td.g-na { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--muted) 10%, transparent) 6px 7px); }
table.sheet td.g-err { box-shadow: inset 0 -2px 0 var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
table.sheet td.g-err.g-cur { box-shadow: inset 0 0 0 2px var(--accent), inset 0 -2px 0 var(--bad); }
table.sheet td.g-editing { padding: 0; }
table.sheet td.g-saving { color: var(--muted); font-style: italic; }   /* shown at once, saving in the background */
.g-in { width: 100%; min-width: 80px; height: 30px; border: 0; padding: 4px 8px; font: inherit; background: var(--bg); color: var(--ink); box-sizing: border-box; outline: 2px solid var(--accent); }
.g-ph { color: var(--muted); }
.g-sku { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sheet td.g-empty { padding: 16px; cursor: default; }
.g-prod { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.g-prod .g-open { margin-left: auto; padding: 2px; }   /* ↗ at the right edge: a click elsewhere in the cell selects the row */
.g-thumb { position: relative; width: 28px; height: 28px; display: inline-block; }
.g-thumb img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.g-thumb:hover img { position: absolute; left: 0; top: 0; width: 220px; height: 220px; z-index: 10; box-shadow: 0 6px 24px rgba(0,0,0,.25); background: var(--panel); }
@media (max-width: 899px) { #vTable { display: none; } }

/* ---- saving in the background (app.js saveApi) ---- */
.savestate { margin-left: auto; margin-right: 12px; white-space: nowrap; }
.savestate.ok { color: var(--ok, #2e7d32); }
.savefail { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.savefail p { margin: 4px 0; }
/* a page that takes a moment shows "Loading…", after a short wait so quick pages don't flash it */
.loading-late { opacity: 0; animation: show-late 0s .25s forwards; }
@keyframes show-late { to { opacity: 1; } }

/* Variant groups: the catalog's group pill, the group page */
a.vgicon { color: var(--muted); display: inline-flex; vertical-align: middle; padding: 2px; border-radius: 4px; }
a.vgicon:hover { color: var(--ink); background: var(--bg); }
.pagetabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; }
.pagetabs a { padding: 8px 2px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pagetabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.pagetabs a:hover { color: var(--ink); }
.vgprods { min-width: 200px; }
a.vgprod { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: .9rem; }
.vgthumb { width: 26px; height: 26px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--line); flex: none; }
.vgaccts { display: flex; flex-wrap: wrap; gap: 4px 12px; white-space: nowrap; }
.vgacct { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; }
.vtable td { vertical-align: top; }
input.h1input { font-family: inherit; font-size: 1.6rem; font-weight: 700; line-height: 1.2; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; width: 100%; max-width: 640px; min-width: 0; background: transparent; color: var(--ink); }
input.h1input:hover, input.h1input:focus { border-color: var(--line); background: var(--panel); }
.gtitle { display: flex; align-items: center; gap: 2px; max-width: 100%; }
.gtitle input.h1input { width: auto; field-sizing: content; min-width: 4ch; max-width: calc(100% - 32px); }
button.pencil { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 4px; cursor: pointer; border-radius: 6px; }
button.pencil:hover, button.pencil:focus-visible { color: var(--ink); background: var(--panel); }
.glabel { width: 100%; min-width: 140px; }
.gfields label { display: flex; flex-direction: column; gap: 4px; } .gfields input { width: 100%; }
.vgacc { margin-top: 10px; } .vgacc ul { margin: 4px 0 0; padding-left: 18px; } .vgacc li { margin: 3px 0; }
.vgacc .warn { color: var(--warn); }
@media (max-width: 640px) {         /* Variants on a phone: each group a card */
  .vtable, .vtable tbody, .vtable tr, .vtable td { display: block; width: auto; }
  .vtable tr:first-child { display: none; }
  .vtable tr { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); }
  .vtable td { border: 0; padding: 3px 0; }
  .vtable td:first-child { position: absolute; left: 0; top: 10px; }
  .vgprods { min-width: 0; }
}
/* Catalog's "Add to lot…" drop-down sits among the buttons: look like one */
select#tolot { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; max-width: 200px; }
select#tolot:disabled { opacity: .5; cursor: not-allowed; }
/* the Amazon tab's category chips and their "add" drop-down, on one wrapping line */
.cats { gap: 6px 16px; margin: 4px 0 2px; align-items: center; flex-wrap: wrap; }
.cats select, #pnl-apply select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem; max-width: 260px; }
/* Our drop-downs: one chevron, with room from the right edge (not the browser's own arrow) */
.dims select, .fld select, .filters select, .ibar select, .edtools select, select#tolot, select#bfilter, .cats select, #pnl-apply select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; background-repeat: no-repeat; background-position: right 11px center;
  background-size: 12px 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237b8594' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select#bfilter { max-width: 240px; border: 1px solid var(--line); border-radius: 8px; background-color: var(--bg); color: var(--ink); padding-top: 6px; padding-bottom: 6px; padding-left: 10px; font: inherit; font-size: .9rem; }
.dims select, .edtools select, .cats select, #pnl-apply select { padding-right: 30px; background-position: right 9px center; }

/* Duplicate: the split button on the product page (Duplicate | ▾) and its dialog */
.splitbtn { display: inline-flex; }
.splitbtn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.splitbtn > .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid var(--line); margin-left: -1px; padding-left: 8px; padding-right: 8px; }
.splitbtn .menulist { min-width: 200px; }
.qedit.dupdlg { width: min(720px, 96vw); }
.dupdlg .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dupline { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.duppic { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.duppic img { width: 220px; height: 220px; max-height: none; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.duppic img.faded { opacity: .35; }
.duppic .ph { width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--line); border-radius: 8px; padding: 12px; box-sizing: border-box; }
.dupctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dupctl p { margin: 0; }
.dupctl canvas { max-width: 100%; cursor: crosshair; border-radius: 6px; }
.dupsw { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; align-self: flex-start; }
.dupsw[hidden] { display: none; }
@media (max-width: 760px) {
  .dupline, .dupdlg .g2 { grid-template-columns: 1fr; }
  .duppic img, .duppic .ph { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; }
}

/* Variant group page → + Add products: the product picker */
.gadd { gap: 12px; flex-wrap: wrap; }
.pplist { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pprow { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.pprow:hover { background: var(--soft); }
.pprow > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pprow img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); flex: none; }
.pprow .row { gap: 8px; align-items: center; }
.ppq { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--panel); color: var(--ink); }
.nowrap { white-space: nowrap; }

/* ---- Product Sheet: photos, the sheet's fields, the conversation (docs/product-sheet-design.md) ---- */
.sphotos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sphotos .phw { position: relative; }
.phn { position: absolute; left: 4px; top: 4px; font-size: .75rem; font-weight: 600; padding: 0 6px; border-radius: 99px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); pointer-events: none; }
.sphotos .phcell { display: grid; gap: 2px; width: 128px; align-content: start; }
.sphotos .phcell img { width: 128px; height: 128px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.phrole { font: inherit; font-size: .8rem; padding: 2px 4px; }
.phpurpose { width: 100%; box-sizing: border-box; font: inherit; font-size: .8rem; line-height: 1.3; padding: 3px 5px; resize: vertical; }
.sphotos .phcell .ph { width: 128px; height: 128px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
@media (max-width: 600px) { .sphotos .phcell { width: 100px; } .sphotos .phcell img, .sphotos .phcell .ph { width: 100px; height: 100px; } }
.sheetbox .srows { display: grid; grid-template-columns: fit-content(240px) 1fr auto; column-gap: 24px; row-gap: 0; }   /* labels: as wide as the longest */
.srow { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; padding: 7px 0; border-top: 1px solid var(--line);
  font-size: .95rem; line-height: 1.45; }
.srow .slab { font-weight: 600; }
.srow.fresh { background: var(--soft); }
.srow .sval .dtext { display: inline; }
.srow.needed .slab { color: var(--bad); }
.srow.edit { align-items: start; }
.sheetbox .srows > p { grid-column: 1 / -1; }
.srow.edit textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.45; resize: vertical; overflow: hidden; }
.srow .dims input { width: 64px; }
.textbox { margin: 14px 0; }
.textbox .sval { white-space: normal; overflow-wrap: anywhere; }
.textbox [data-kwprev] { display: block; margin-top: 4px; }   /* the keyword chips: a row of their own */
@media (max-width: 600px) { .sheetbox .srows { grid-template-columns: 1fr; } .srow { gap: 2px; } }
.sq { margin-top: 6px; }
.sflag { font-size: .75rem; padding: 0 8px; border-radius: 99px; margin-left: 6px; color: var(--accent); border: 1px solid var(--accent); font-weight: 400; }
.sflag.soft { color: var(--muted); border-color: var(--line); }
.sflag.new { color: var(--accent-ink); background: var(--accent); }
.sidetabs { margin: 0 0 16px; }      /* Product Sheet | Listings Content: the page tabs' look, across the page */
.sidetabs button { padding: 8px 2px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; }
.sidetabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.sidetabs button:hover:not(:disabled) { color: var(--ink); }
.sidetabs button:disabled { opacity: .5; cursor: not-allowed; }

/* ---- the conversation about the product, image history, pointing at the photo ---- */
fieldset.tell textarea { width: 100%; }
#chat { display: grid; gap: 8px; max-height: 720px; overflow-y: auto; margin-bottom: 8px; padding: 2px; }
.thinking { display: grid; gap: 8px; padding: 8px; border-radius: 12px; animation: chatpulse 1.4s ease-in-out infinite; }   /* Mr Munshi at work: as the dot */
@keyframes chatpulse { 50% { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); } }
@media (prefers-reduced-motion: reduce) { .thinking { animation: none; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); } }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 90%; display: grid; gap: 4px; }
.msg.me { justify-self: end; background: var(--soft); }
.msg.mm { justify-self: start; border: 1px solid var(--line); background: var(--panel); }
.msg .chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.msg .chip { padding: 4px 10px; cursor: pointer; font: inherit; font-size: .85rem; }
#chatmsg { margin-top: 6px; }
.histdlg { width: min(720px, 96vw); }
.histlist { display: flex; flex-wrap: wrap; gap: 12px; }
.hist { width: 150px; display: grid; gap: 6px; align-content: start; }
.hist img { width: 150px; height: 150px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
#sphoto.marking { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: 2px; }
.phx { position: absolute; right: 4px; top: 4px; font-size: .75rem; line-height: 1; padding: 2px 5px; border-radius: 99px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); cursor: pointer; }
.chatthumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #fff; }

/* Needs updating (corrections.py) and what Mr Munshi is doing about a change */
/* the left column ends with what to do next (actBox), right below its content: kept apart by space and a tint. Scrolling
   down past it, it stays in view under the header (sticky within the column, so it never covers the column's content) */
.pimg { min-width: 0; }
.actbox { position: sticky; top: 72px; z-index: 1; margin-top: 48px; background: var(--soft); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 -6px 18px rgba(0, 0, 0, .08); }
@media (max-width: 600px) { .actbox { position: static; margin-top: 20px; } }   /* phones: in place, after the images */
.actbox .qtip > span { left: -40px; transform: none; max-width: min(260px, 80vw); }
.actbox .actslot { gap: 6px; align-items: center; margin-top: 4px; }
.actbox #amsg:empty { display: none; }
.actbox #amsg { margin-top: 6px; }
.needs { margin: 0 0 10px; }
.needs .nhead { justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.needs .ngroup { padding: 8px 0 6px; border-bottom: 1px solid var(--line); }
.needs .ngroup:last-child { border-bottom: 0; padding-bottom: 0; }
.needs .ntitle { font-weight: 700; font-size: .9rem; display: block; margin-bottom: 4px; }
.needs .nempty .ntitle { display: inline; margin: 0; }
.needs .nitem { gap: 6px; align-items: flex-start; flex-wrap: nowrap; padding: 3px 0; font-size: .88rem; line-height: 1.35; }
.needs .nitem label { flex: 1; min-width: 0; gap: 6px; align-items: flex-start; flex-wrap: nowrap; margin: 0; font-weight: normal; }
.needs .nitem label > span, .needs .nitem > span { flex: 1; min-width: 0; }
.needs .nitem input { flex: none; width: auto; margin: 2px 0 0; }
.needs .nmulti { display: block; }
.needs .nchips { gap: 4px 12px; align-items: center; }
.needs .nitem .nchip { display: inline-flex; flex: none; min-width: auto; gap: 5px; align-items: center; margin: 0; font-weight: normal; white-space: nowrap; }
.needs .nwhy { margin: 3px 0 0; gap: 6px; flex-wrap: nowrap; align-items: flex-start; }
.needs .nwhy > span { flex: 1; min-width: 0; }
.needs .nx { flex: none; background: none; border: 0; padding: 0 2px; color: var(--muted); cursor: pointer; font-size: .8rem; line-height: 1.6; }
.needs .nx:hover { color: var(--ink); }
/* controls locked while Mr Munshi replies (or otherwise off) look it, as .btn does */
.link:disabled, .nx:disabled, .phx:disabled, .chip:disabled { opacity: .5; cursor: not-allowed; }
.needs .nitem .dot { margin-top: 6px; flex: none; }
.needs .ndone { color: var(--muted); }
.needs .ndone > span { flex: none; }
.needs .ndone .link { color: var(--muted); text-align: left; text-decoration: none; }
.needs .ndone .link:hover { text-decoration: underline; }
.newmark { position: absolute; left: 6px; top: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 8px; font-size: .72rem; }
.updwrap { position: relative; }
.updwrap.on img { opacity: .45; }
.updwrap .updmark { position: absolute; inset: auto 6px 6px 6px; background: var(--bg); border-radius: 6px; padding: 4px 6px;
  font-size: .8rem; display: flex; gap: 6px; align-items: center; justify-content: center; }
.pimg > img.dim { opacity: .45; }
.banner { background: var(--soft); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }
.msg.latest { box-shadow: 0 0 0 2px var(--accent); }
.msg.mm.working { color: var(--muted); }
.msg.undone { opacity: .55; text-decoration: line-through; }   /* taken back with Undo */
.flink { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.flink:hover { color: var(--accent); }
.srow.flash { animation: fieldflash 1.6s ease-out; }
@keyframes fieldflash { 0%, 40% { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); } }
.round { border-left: 2px solid var(--line); padding-left: 8px; }
.round > summary { cursor: pointer; padding: 2px 0; }
.round .roundmsgs { display: grid; gap: 8px; margin-top: 6px; }
.actline { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px solid var(--accent); padding-top: 4px; color: var(--accent); font-weight: 600; }
.actline .muted { font-weight: 400; }
.mmnote { max-width: none; margin: 0 0 14px; }
.tdiff { margin: 6px 0; display: grid; gap: 2px; }
/* a text change in place (diffHTML): removed words struck through on red, added on green, each change boxed */
.dtext { line-height: 1.6; }
.dchg { border: 1px solid var(--line); border-radius: 4px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.dchg del + ins { margin-left: 3px; }
.dchg del { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); text-decoration: line-through; }
.dchg ins { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ink); text-decoration: none; }

.srlive { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* read out only (sayReply) */

/* a question answered: where it was answered, its choices as plain text */
.msg.asked { opacity: .92; }
.askedopts { gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.askedopts .chosen { font-weight: 600; }
#chat .sq.flash { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; transition: outline-color .4s; }
