:root {
  --bg: #fbfbf8; --panel: #fff; --panel2: #f3f3ee; --line: #e4e4dc; --text: #15151b; --muted: #676774; --accent: #c6f432; --ink: #15151b; --good: #16794a; --bad: #c62838; --warn: #8a5a00;
  --radius: 12px; color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
a { color: inherit; }
h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 14px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 18px 0 10px; }
.panel h2:first-child, aside h2:first-child { margin-top: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
img { max-width: 100%; display: block; }
code, pre { background: var(--panel2); border-radius: 6px; padding: 2px 6px; font-size: 14px; }
pre { padding: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 16px; padding-bottom: 40px; }
.narrow { max-width: 520px; margin: 0 auto; }
.narrow.prose { max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); }
.bad-text { color: var(--bad); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 5; }
.test-banner { background: #ffe9a8; color: #4a3500; text-align: center; font-size: 13px; padding: 5px 12px; font-weight: 600; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo span { background: var(--ink); color: var(--accent); width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; }
.search { flex: 1; min-width: 160px; }
.search input { width: 100%; }
.top-links { display: flex; gap: 14px; align-items: center; }
.top-links a { text-decoration: none; font-weight: 600; font-size: 15px; }
.basket b { background: var(--accent); border-radius: 99px; padding: 0 7px; font-size: 13px; }
.cats { border-top: 1px solid var(--line); overflow-x: auto; }
.cats .wrap { display: flex; gap: 18px; padding-top: 8px; padding-bottom: 8px; white-space: nowrap; }
.cats a { text-decoration: none; font-size: 14px; color: var(--muted); }
.cats a:hover { color: var(--text); }

.foot { background: var(--panel); border-top: 1px solid var(--line); padding: 20px 0; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot p { margin: 8px 0 0; }

input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
input[readonly] { background: var(--panel2); }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
label .muted { font-weight: 400; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.stack { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline input { width: auto; max-width: 150px; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; background: var(--accent); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--panel); border: 1px solid var(--line); }
.btn.danger { color: var(--bad); }
.btn.lg { padding: 13px 22px; font-size: 17px; width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }

.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-size: 15px; }
.flash.ok { background: #e6f6ec; color: #0f5b37; }
.flash.warn { background: #fff5dc; color: #6b4500; }
.flash.bad { background: #fde8ea; color: #92202c; }

.hero { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px 24px; margin-bottom: 20px; }
.hero h1 { font-size: 36px; margin: 0 0 8px; color: var(--accent); }
.hero p { margin: 0; max-width: 560px; }
.offers { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.offers li { background: var(--accent); color: var(--ink); border-radius: 99px; padding: 3px 12px; font-size: 14px; font-weight: 600; }
.cat-tiles { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-tiles a { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; text-decoration: none; font-size: 14px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.card:hover { border-color: #bdbdb2; }
.art { aspect-ratio: 1; background: var(--panel2); position: relative; display: grid; place-items: center; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art em { position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.art em.sale { background: var(--accent); color: var(--ink); }
.tile { font-size: 56px; font-weight: 800; color: #c9c9bf; }
.card-text { padding: 10px 12px 12px; display: grid; gap: 2px; }
.title { font-weight: 600; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; }
.tag { font-size: 12px; color: var(--muted); }
.bar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 14px; flex-wrap: wrap; }
.sorts { display: flex; gap: 12px; }
.sorts a { color: var(--muted); }
.sorts a.on { color: var(--text); font-weight: 700; text-decoration: none; }
.pager { display: flex; gap: 14px; justify-content: center; margin-top: 20px; font-size: 14px; }

.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.gallery { display: grid; gap: 10px; align-content: start; }
.gallery img { border-radius: var(--radius); width: 100%; }
.art.big { border-radius: var(--radius); }
.big-price { font-size: 24px; margin: 0 0 10px; }
.options { display: grid; gap: 6px; }
.options label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.options label .muted { margin-left: auto; }
.options label.off { opacity: .55; }
.qty { max-width: 120px; }
.specs { display: grid; gap: 4px; }
.specs div, .totals div { display: flex; justify-content: space-between; gap: 12px; }
dt { color: var(--muted); }
dd { margin: 0; }

.two { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.two.even { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.panel, .summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.summary { display: grid; gap: 10px; position: sticky; top: 12px; }
.lines { display: grid; gap: 10px; justify-items: start; }
.line { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; width: 100%; }
.thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--panel2); display: grid; place-items: center; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tile { font-size: 30px; }
.line-text { display: grid; font-size: 15px; }
.line-text a { font-weight: 600; text-decoration: none; }
.line-text .muted, .line-text .good { font-size: 13px; }
.line-qty { display: grid; gap: 4px; justify-items: center; }
.line-qty input { width: 68px; padding: 6px 8px; }
.line-total { font-weight: 700; min-width: 64px; text-align: right; }
.totals { margin: 0; display: grid; gap: 4px; }
.totals .total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 800; font-size: 18px; }
.totals .total dt { color: var(--text); }
.totals .good dt { color: var(--good); }
.coupon { display: flex; gap: 8px; }
.coupon-on { display: flex; justify-content: space-between; align-items: center; }
.mini { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; align-items: center; padding: 4px 0; }
.nudges { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.nudges li { background: #f4fbdc; border: 1px solid #dcea9e; border-radius: 10px; padding: 8px 12px; font-size: 15px; font-weight: 600; }
.meter { display: block; height: 6px; border-radius: 99px; background: #e4ecc0; margin-top: 6px; overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--ink); }
.choices { display: grid; gap: 6px; }
.choice { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.choice span span { display: block; font-size: 13px; }
.choice.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pay-or { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0; }
.pay-error { color: var(--bad); font-size: 14px; min-height: 1em; margin: 10px 0; }
#pay .btn { width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pane, .panel { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--panel2); white-space: nowrap; }
.s-paid, .s-delivered { background: #e6f6ec; color: #0f5b37; }
.s-shipped { background: #e4eefc; color: #1c4a8a; }
.s-needs_review, .s-disputed { background: #fde8ea; color: #92202c; }
.s-pending_payment { background: #fff5dc; color: #6b4500; }

.admin { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; }
.side { display: grid; gap: 2px; align-content: start; position: sticky; top: 12px; }
.side a { padding: 6px 10px; border-radius: 8px; text-decoration: none; font-size: 15px; }
.side a.on { background: var(--ink); color: #fff; }
.pane { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats > * { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; display: grid; }
.stats b { font-size: 24px; }
.stats span { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; flex: 1; min-width: 140px; }
.variant { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 10px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.thumbs img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.row-bad { background: #fff3f4; }
.change { display: block; font-size: 13px; }
.plain { list-style: none; padding: 0; margin: 0; }
#qr svg { display: block; margin: 10px 0; }

@media (max-width: 760px) {
  .product, .two, .admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: flex; overflow-x: auto; }
  .side a { white-space: nowrap; }
  .summary { position: static; }
  .hero h1 { font-size: 28px; }
  .line { grid-template-columns: 56px 1fr auto; }
  .thumb { width: 56px; height: 56px; }
  .line-total { grid-column: 2 / -1; text-align: left; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
