/* Colours and type follow qtponline.com: QTP blue, QTP orange, white, Open Sans. */
:root {
  color-scheme: light;
  --blue: #214292;
  --blue-dark: #182f6b;
  --orange: #f9a94b;
  --orange-dark: #f09a33;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --ink: #333333;
  --muted: #666666;
  --line: #dde1ea;
  --head: var(--blue);
  --head-ink: #ffffff;
  --primary: var(--blue);
  --primary-ink: #ffffff;
  --primary-hover: var(--blue-dark);
  --accent: var(--orange);
  --accent-ink: #14275a;
  --danger: #c0271f;
  --ok: #1d7a46;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(33, 66, 146, .06), 0 8px 24px rgba(33, 66, 146, .10);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Source Sans 3", "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top { background: #fff; color: var(--ink); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(33, 66, 146, .06); }
.strip { background: var(--blue); color: #fff; font-size: .85rem; }
.strip-in { max-width: 1320px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 24px; }
.strip a { color: inherit; text-decoration: none; }
.strip .strip-right { margin-left: auto; font-weight: 600; }
.strip a:hover { text-decoration: underline; }
.top-in {
  max-width: 1320px; margin: 0 auto; padding: 12px 16px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 20px; align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--blue); font-family: var(--display); text-decoration: none; font-weight: 700; letter-spacing: .01em; font-size: 1.05rem; white-space: nowrap; }
.brand img { height: 52px; width: auto; display: block; }

.search { display: flex; max-width: 640px; width: 100%; justify-self: center; background: #eee; border-radius: 4px; overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; padding: 10px 14px; background: transparent; color: var(--ink); outline: none; }
.search input::placeholder { color: #6d766f; }
.search:focus-within { box-shadow: 0 0 0 3px var(--accent); }
.search button { border: 0; background: var(--accent); color: #fff; padding: 0 14px; display: grid; place-items: center; }

.cart-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); color: var(--blue); font-weight: 600; border-radius: 4px; padding: 8px 12px; }
.cart-btn:hover { border-color: var(--accent); }
.quick-btn { text-decoration: none; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.cart-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }

/* ---------- check for changes ---------- */
.chg { width: min(680px, calc(100vw - 32px)); }
.chg-in { padding: 26px 28px 24px; display: grid; gap: 12px; }
.chg h2 { color: var(--blue); font-family: var(--display); font-size: 1.4rem; padding-right: 36px; }
.bar-track { height: 18px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 9px; background-color: var(--blue); transition: width .5s ease; }
.bar-fill.running { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 12px, transparent 12px 24px); background-size: 34px 34px; animation: stripes .8s linear infinite; }
.bar-fill.done { background-color: var(--ok); }
@keyframes stripes { to { background-position: 34px 0; } }
.chg-line { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.chg-line #chgPct { font-weight: 700; color: var(--blue); }
.chg-now { font-size: .9rem; color: var(--muted); }
.chg-now strong { font-family: var(--mono); color: var(--ink); font-size: 1rem; }
.chg-log { font-family: var(--mono); font-size: .74rem; line-height: 1.5; color: var(--muted); background: #0f1c3d; color: #b9c8ee; border-radius: 6px; padding: 8px 10px; height: 92px; overflow: hidden; word-spacing: 6px; display: flex; flex-direction: column; justify-content: flex-end; }
.chg-log span { white-space: normal; overflow-wrap: anywhere; }
.chg-found h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); margin-bottom: 6px; }
.chg-found ul { list-style: none; margin: 0; padding: 0; max-height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.chg-found li { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .88rem; display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 2px 12px; }
.chg-found li:last-child { border-bottom: 0; }
.chg-found li .code { color: var(--ink); font-weight: 600; }
.chg-found li .what { color: var(--muted); grid-column: 2; }
.chg-found li.added .what { color: var(--ok); }
.chg-found li.removed .what { color: var(--danger); }
.chg-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#sec-sync .qo-card { display: grid; gap: 10px; align-content: start; }
#sec-sync .chg-found ul { max-height: 320px; }
.badge { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .8rem; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; }
.badge.bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

.demo { background: var(--accent); color: var(--accent-ink); padding: 8px 16px; text-align: center; font-size: .9rem; }
.demo.loading { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.demo code { font-family: var(--mono); font-size: .85em; }

/* ---------- layout ---------- */
.layout { max-width: 1320px; width: 100%; margin: 0 auto; padding: 24px 16px 40px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; flex: 1; align-items: start; }
.side { position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow: auto; padding-right: 4px; }
.side-h { color: var(--blue); font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 10px; }
.main { min-width: 0; outline: none; }

.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 14px; margin-bottom: 12px; }
.side-box .side-h { margin-bottom: 8px; }
.cascade-col { display: grid; gap: 8px; }
.cascade-col label { display: grid; gap: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); min-width: 0; }
.cascade-col select { width: 100%; font-size: .95rem; font-weight: 400; color: var(--ink); text-overflow: ellipsis; }
.cascade-col select.chosen { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.side [data-clear], .drawer [data-clear] { margin-bottom: 14px; }
.side-browse { margin-top: 6px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.tree button { width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tree button:hover { background: var(--surface-2); }
.tree button[aria-current="true"] { background: var(--head); color: var(--head-ink); font-weight: 600; }
.tree .n { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree button[aria-current="true"] .n { color: inherit; opacity: .75; }
.tree .top-level > button { font-weight: 600; }

.finder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.finder summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--blue); font-family: var(--display); font-size: 1.05rem; list-style-position: inside; }
.finder[open] summary { border-bottom: 1px solid var(--line); }
.finder-on { font: 600 .78rem var(--sans); background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.finder-body { padding: 14px 16px 16px; display: grid; gap: 14px; }
.cascade { margin: 0; min-width: 0; }
.cascade legend { color: var(--blue); }
.cascade-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cascade-row label { display: grid; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); min-width: 0; }
.cascade-row select { width: 100%; font-size: 1rem; font-weight: 400; color: var(--ink); text-overflow: ellipsis; }
.cascade-row select.chosen { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
#clearFilters { justify-self: start; }
.bar { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.bar h1 { color: var(--blue); font-family: var(--display); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.2; letter-spacing: -.01em; }
.bar-tools { display: flex; gap: 10px; align-items: center; }
.btn.only-mobile { display: none; }
select, input, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
select { padding-right: 30px; }

.search-note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; font-size: .9rem; margin-bottom: 14px; }
.search-note button { all: unset; cursor: pointer; color: var(--blue); font-weight: 600; text-decoration: underline; }
mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.why { font-size: .78rem; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.why::before { content: "\2713  "; color: var(--ok); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .875rem; }
.chip button { border: 0; background: none; font-size: 1.1rem; line-height: 1; padding: 0 6px; border-radius: 50%; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 16px; }
.card { container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-open { all: unset; cursor: pointer; display: block; }
.card-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }

.thumb {
  aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--ink) 4%, transparent) 10px 11px),
    var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; position: absolute; inset: 0; }
.tag { font-family: var(--mono); font-weight: 700; font-size: .95rem; letter-spacing: .04em; color: var(--blue); background: var(--surface); border: 1.5px solid var(--blue); padding: 6px 12px; border-radius: 4px; position: relative; max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag::before { content: ""; position: absolute; left: -7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--ink); opacity: .0; }

.card-body { padding: 12px 14px 0; }
.code { font-family: var(--mono); font-size: .78rem; color: var(--muted); letter-spacing: .03em; }
.name { font-weight: 600; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.fits { font-size: .8rem; line-height: 1.35; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fits a, .compat a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); text-underline-offset: 2px; }
.fits a:hover, .compat a:hover { color: var(--blue); text-decoration-color: var(--blue); }
.compat dt a { color: var(--ink); }
.card-extra { padding: 0 14px; flex: 1; height: 5.6rem; overflow: hidden; }
.fresh { font-size: .78rem; color: var(--muted); min-height: 1.2em; }
.fresh.ok { color: var(--ok); }
.rel-open { all: unset; cursor: pointer; display: block; min-width: 0; }
.rel-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }
.rel-open:hover .name { color: var(--blue); text-decoration: underline; }
.fits-l { font-weight: 700; color: var(--blue); }
.fits-more { all: unset; cursor: pointer; margin-left: 4px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.fits-more:hover { text-decoration: underline; }
.fits-more:focus-visible { outline: 2px solid var(--accent); border-radius: 3px; }
.compat { padding: 20px 28px; border-top: 1px solid var(--line); }
.compat h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); margin-bottom: 10px; }
.compat dl { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 16px; font-size: .9rem; max-height: 260px; overflow: auto; }
.compat dt { font-weight: 700; }
.compat dd { margin: 0; color: var(--muted); }
.stock { font-size: .78rem; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--muted); }
.card-foot { padding: 10px 14px 14px; display: grid; gap: 10px; margin-top: auto; }
.card-foot .price { min-height: 1.6rem; display: flex; align-items: baseline; flex-wrap: wrap; }
.price { color: var(--price, var(--blue)); font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price s { color: var(--muted); font-weight: 400; font-size: .85rem; margin-right: 6px; text-decoration-thickness: 1.5px; }
.offer-badge { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.card.on-offer { border-color: var(--accent); }
.pd-offer { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-size: .85rem; color: var(--muted); }
.pd-offer .offer-badge { position: static; }
.price small { font-weight: 400; color: var(--muted); font-size: .72rem; margin-left: 4px; }
.price.por { font-size: .95rem; font-weight: 600; color: var(--muted); }
.buy { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
@container (max-width: 265px) {
  .buy { grid-template-columns: 1fr; }
  .buy .stepper { grid-template-columns: 1fr 1.2fr 1fr; width: 100%; }
}

.stepper { display: inline-grid; grid-template-columns: 34px 44px 34px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); height: 40px; }
.stepper button { border: 0; background: var(--surface-2); font-size: 1.1rem; line-height: 1; }
.stepper button:hover { background: var(--line); }
.stepper input { border: 0; border-radius: 0; padding: 0; text-align: center; width: 100%; background: transparent; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn { border: 1px solid transparent; border-radius: 8px; padding: 0 16px; min-height: 40px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn.add { background: var(--btn-add, var(--accent)); color: var(--btn-add-ink, var(--accent-ink)); }
.btn.add:hover { background: var(--btn-add-hover, var(--orange-dark)); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.primary.is-saved:disabled { opacity: 1; cursor: default; background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.primary.is-busy:disabled { cursor: progress; }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.link { background: none; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn.block { width: 100%; }
.btn.added { background: var(--head); color: var(--head-ink); }

.more { text-align: center; margin-top: 24px; }
.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 4px; }

.skel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); height: 330px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--ink) 6%, transparent) 50%, transparent 70%); animation: sweep 1.2s infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.foot a { color: var(--blue); font-weight: 600; }
.foot p + p { margin-top: 6px; }
.foot { border-top: 1px solid var(--line); padding: 18px 16px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(10, 16, 13, .55); }

.drawer { position: fixed; top: 0; bottom: 0; margin: 0; height: 100dvh; max-height: none; width: min(440px, 100vw); max-width: 100vw; box-shadow: var(--shadow); }
.drawer.right { left: auto; right: 0; }
.drawer.left { right: auto; left: 0; width: min(340px, 88vw); }
.drawer[open] { display: flex; flex-direction: column; }
.drawer.right[open] { animation: inR .2s ease; }
.drawer.left[open] { animation: inL .2s ease; }
@keyframes inR { from { transform: translateX(40px); opacity: 0; } }
@keyframes inL { from { transform: translateX(-40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2 { font-size: 1.15rem; color: var(--blue); font-family: var(--display); }
.drawer-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 16px; }
.drawer-foot { flex: none; border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--surface); }
.icon-btn { border: 0; background: none; font-size: 1.7rem; line-height: 1; width: 40px; height: 40px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }

.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:first-child { padding-top: 0; }
.line .name { min-height: 0; }
.line-price { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-price.small { font-weight: 400; }
.line-tools { display: flex; align-items: center; gap: 12px; }
.line .stepper { height: 34px; grid-template-columns: 30px 40px 30px; }
.remove { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: .85rem; padding: 4px; }
.remove:hover { color: var(--danger); }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.total strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.ship { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; }
.ship-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .92rem; }
.ship-row label { font-weight: 600; }
.ship-row select { max-width: 60%; padding: 6px 28px 6px 10px; font-size: .92rem; }
.ship .total { margin-top: 4px; }
.line-weight { font-size: .78rem; color: var(--muted); }
.pd-weight { font-size: .9rem; color: var(--muted); }
.cart-empty { text-align: center; color: var(--muted); padding: 48px 12px; }

fieldset { border: 0; padding: 0; margin: 18px 0 0; }
legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 0; margin-bottom: 8px; }
.f { display: grid; gap: 4px; margin-top: 10px; align-content: start; }
.f label { font-size: .875rem; font-weight: 600; }
.f input, .f textarea { width: 100%; }
.f textarea { resize: vertical; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.error { color: var(--danger); font-size: .9rem; font-weight: 600; }

.done { text-align: center; padding-top: 48px; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: var(--primary-ink); display: grid; place-items: center; margin: 0 auto 16px; }
.done h3 { font-size: 1.4rem; margin-bottom: 6px; }
.ref { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; letter-spacing: .04em; margin: 6px 0 14px; user-select: all; }

.modal { width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border-radius: 14px; box-shadow: var(--shadow); overflow: auto; }
.modal-close { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--surface); }
.pd { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.pd .thumb { aspect-ratio: auto; min-height: 300px; }
.pd .tag { font-size: 1.2rem; padding: 10px 18px; }
.pd-info { padding: 28px 28px 24px; display: grid; gap: 12px; align-content: start; }
.pd-info h2 { color: var(--blue); font-family: var(--display); font-size: 1.45rem; line-height: 1.25; padding-right: 32px; }
.pd-desc { white-space: pre-line; color: var(--muted); }
.pd .buy { max-width: 320px; }
.related { padding: 20px 28px 28px; border-top: 1px solid var(--line); }
.related h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); }
.rel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.rel-nav { display: flex; align-items: center; gap: 6px; }
.rel-count { font-size: .8rem; color: var(--muted); margin-right: 6px; }
.rel-arrow { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--blue); font-size: 1.5rem; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; }
.rel-arrow:hover:not(:disabled) { border-color: var(--blue); background: var(--surface-2); }
.rel-arrow:disabled { opacity: .35; cursor: default; }
.rel-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 2px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.rel-card { flex: 0 0 200px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.rel-card.on-offer { border-color: var(--accent); }
.rel-card .thumb { aspect-ratio: 5 / 3; }
.rel-card .thumb .tag { font-size: .8rem; padding: 4px 8px; }
.rel-card .offer-badge { font-size: .65rem; padding: 3px 6px; }
.rel-body { padding: 8px 10px 0; }
.rel-body .name { font-size: .88rem; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-foot { padding: 6px 10px 10px; display: grid; gap: 8px; margin-top: auto; }
.rel-foot .price { font-size: 1rem; }
.rel-foot .price s { font-size: .75rem; }
.rel-foot .buy { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.rel-foot .stepper { grid-template-columns: 28px 38px 28px; height: 36px; }
.rel-foot .btn { min-height: 36px; padding: 0 6px; min-width: 0; font-size: .9rem; }
.rel-foot .btn.added { font-size: .8rem; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--head); color: var(--head-ink); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- quick order ---------- */
.qo-cat { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.qo-cat-in { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.qo-cat .btn { min-height: 34px; padding: 0 14px; font-size: .9rem; }
.qo-cat .btn:disabled { opacity: .6; cursor: progress; }
.qo-cat .bad { color: var(--danger); font-weight: 600; }
.qo-top { grid-template-columns: auto 1fr; }
.qo-title { color: var(--blue); font-family: var(--display); font-size: 1.5rem; justify-self: end; }
.qo { max-width: 1100px; width: 100%; margin: 0 auto; padding: 24px 16px 120px; flex: 1; }
.qo form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.qo-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; }
.qo-card h2 { color: var(--blue); font-family: var(--display); font-size: 1.15rem; margin-bottom: 6px; }
.qo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.qo-grid .span2 { grid-column: span 2; }
.req { font-weight: 400; color: var(--muted); font-size: .78rem; margin-left: 4px; }
.qo-lines-head { margin-bottom: 12px; }
.qo-addr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.qo-addr-btns { display: flex; gap: 8px; align-items: center; }
.qo-addr-btns .btn { min-height: 34px; padding: 0 12px; font-size: .9rem; }
#useMyAddress:disabled { opacity: .5; cursor: not-allowed; }
.qo-row { display: grid; grid-template-columns: 28px minmax(140px, 1.2fr) minmax(0, 2.4fr) 86px 100px 110px 34px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.qo-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 8px; }
.qo-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.qo-total { font-weight: 700; color: var(--blue); }
.qo-n { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.qo-row input { width: 100%; padding: 8px 10px; }
.qo-code { font-family: var(--mono); text-transform: uppercase; }
.qo-qty { text-align: center; }
.qo-row.ok .qo-code { border-color: var(--ok); }
.qo-row.missing .qo-code, .qo-qty.bad { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.qo-row.missing .qo-desc { color: var(--danger); font-weight: 600; }
.qo-desc { min-width: 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.qo-desc .stock { margin-top: 0; }
.qo-name { font-weight: 600; }
.qo-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); width: 32px; height: 32px; border-radius: 6px; }
.qo-x:hover { background: var(--surface-2); color: var(--danger); }
.qo-lines-foot { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.qo-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(33, 66, 146, .08); z-index: 15; }
.qo-bar-in { max-width: 1100px; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qo-sum { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-right: auto; }
.qo-sum strong { font-size: 1.35rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.qo-ship { flex-basis: 100%; font-size: .92rem; color: var(--muted); }
.qo-ship b { color: var(--text); font-weight: 600; }
.qo-ship .warn { color: #a85d00; }
@media (prefers-color-scheme: dark) { .qo-ship .warn { color: #ffbe6a; } }
.qo-bar .error { margin: 0; flex-basis: 100%; order: -1; }
.qo-bar .btn.primary { min-width: 180px; min-height: 46px; font-size: 1.05rem; }
.qo-done { width: min(480px, calc(100vw - 32px)); padding: 0 24px 28px; }
.qo-done .done { padding-top: 32px; }
.qo-done-actions { display: grid; gap: 8px; margin-top: 18px; }

@media (max-width: 820px) {
  .qo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qo-head { display: none; }
  .qo-row { grid-template-columns: 1fr 86px 34px; grid-template-areas: "code qty x" "desc desc desc" "unit total total"; gap: 6px 10px; padding: 12px 0; }
  .qo-row > :nth-child(1) { display: none; }
  .qo-row > :nth-child(2) { grid-area: code; }
  .qo-row > :nth-child(3) { grid-area: desc; }
  .qo-row > :nth-child(4) { grid-area: qty; }
  .qo-row > :nth-child(5) { grid-area: unit; text-align: left; color: var(--muted); font-size: .85rem; }
  .qo-row > :nth-child(6) { grid-area: total; }
  .qo-row > :nth-child(7) { grid-area: x; }
  .qo-row > :nth-child(5):empty, .qo-row > :nth-child(6):empty, .qo-row > :nth-child(3):empty { display: none; }
  .qo-title { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  .rel-count { display: none; }
  .rel-card { flex-basis: 180px; }
  .qo-grid { grid-template-columns: 1fr; }
  .qo-grid .span2 { grid-column: auto; }
  .qo-bar .btn.primary { width: 100%; }
}

/* ---------- admin ---------- */
.adm-top { grid-template-columns: auto 1fr auto; }
.adm-title { color: var(--blue); font-family: var(--display); font-size: 1.5rem; font-weight: 700; justify-self: end; }
.adm { display: grid; grid-template-columns: 236px minmax(0, 1fr); flex: 1; min-height: 0; }
/* Admin skin — matches the QTP trade store admin (admin-theme.css in QTP 2.0): blue app bar with the QTP mark,
   white band with the shop wordmark, light page with a transparent left menu whose open page is a white card with an
   orange marker; Open Sans 14px body, Source Sans 3 headings. */
body.adm-page { --bg: #f8f8f8; --surface: #ffffff; --surface-2: #f3f4f7; --ink: #222222; --ink-2: #4d4d4d; --muted: #666666; --line: #e2e2e2; --radius: 6px; --shadow: 0 1px 2px rgba(0, 0, 0, .05); font-size: 14px; }
.adm-page .top { border-top: 0; border-bottom: 1px solid var(--line); }
.adm-page .top-in { padding: 10px 20px; max-width: 1400px; }
.adm-bar { background: var(--blue); color: #fff; font-size: 13px; }
.adm-bar-in { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 20px; min-height: 38px; }
.adm-bar .qtp-mark { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 17px; letter-spacing: .02em; color: var(--orange); line-height: 1; vertical-align: -1px; margin-right: 6px; }
.adm-bar-nav { margin-left: auto; display: flex; align-items: stretch; }
.adm-bar-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; opacity: .85; }
.adm-bar-nav a:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.adm-moon { color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; flex: none; }
.adm-moon:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.adm-moon svg { width: 15px; height: 15px; }
.adm-brand { gap: 9px; }
.adm-brand .qtp-mark { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 34px; letter-spacing: -.02em; color: var(--orange); line-height: 1; }
.adm-brand img { height: 44px; }
.adm-brand-text { display: grid; line-height: 1.15; }
.adm-brand-text #shopName { font-family: var(--sans); font-size: 16px; font-weight: 700; color: var(--blue); }
.adm-brand-text small { font-family: var(--sans); font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.adm-title { display: none; }
.adm-top { grid-template-columns: auto 1fr auto; }
.adm { max-width: 1400px; width: 100%; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; flex: 1; }
.adm-nav { background: transparent; color: var(--ink); padding: 22px 0 24px; display: flex; flex-direction: column; gap: 2px; border-right: 0; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.adm-nav-h { margin: 14px 12px 4px; padding: 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.adm-nav-h:first-child { margin-top: 0; font-size: 12px; }
.adm-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; border-left: 3px solid transparent; }
.adm-nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.adm-nav a svg * { stroke-width: 1.8; }
.adm-nav a:hover { background: var(--surface-2); color: var(--ink); }
.adm-nav a.current { background: var(--surface); color: var(--blue); border-left-color: var(--orange); box-shadow: var(--shadow); }
.adm-nav a.current svg { color: var(--blue); }
.adm-nav-sep { border-top: 1px solid var(--line); margin: 12px 12px 4px; }
.adm-main { padding: 22px 0 48px; min-width: 0; }
.adm-head { margin: 4px 0 20px; align-items: flex-end; }
.adm-head h1 { font-family: var(--display); font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.adm-sub { font-size: 14px; }
.adm-page .qo-card { border-radius: 6px; box-shadow: var(--shadow); }
.adm-page .qo-card h2 { font-size: 17px; font-weight: 700; }
.adm-page .btn { border-radius: 4px; font-size: 14px; font-weight: 650; }
.adm-page .tile, .adm-page .usg-tile { border-radius: 6px; box-shadow: var(--shadow); }
.adm-page .tile-l { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.adm-page .tile-v, .adm-page .usg-tile-v { font-size: 26px; color: var(--ink); }
.adm-page .usg-tile-l { font-size: 13px; color: var(--muted); }
.adm-page .adm-table { font-size: 14px; }
.adm-page .adm-table th { font-size: 12px; letter-spacing: .04em; padding: 8px 10px; }
.adm-page select, .adm-page input, .adm-page textarea { border-radius: 4px; border-color: #d5d5d5; }
.adm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-head h1 { color: var(--blue); font-family: var(--display); font-size: 1.7rem; }
.adm-sub { color: var(--muted); margin-top: 2px; font-size: .95rem; }
.adm-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.adm-filters label { display: grid; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.adm-filters input, .adm-filters select { min-width: 140px; font-size: .95rem; font-weight: 400; color: var(--ink); }
.adm-filters input[type=search] { min-width: 240px; }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile-v { font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.tile-l { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile-n { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.adm-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table tbody tr[tabindex] { cursor: pointer; }
.adm-table tbody tr[tabindex]:hover, .adm-table tbody tr[tabindex]:focus-visible { background: var(--surface-2); outline: none; }
.adm-table tr.failed td { color: var(--muted); }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table .mono { font-family: var(--mono); font-size: .85rem; }
.adm-table tfoot td { font-weight: 700; border-bottom: 0; }
.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.placed { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.failed { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.pill.quick-order { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-ink); }
.pill.shop { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.adm-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: .9rem; }
.pager-btns { display: flex; gap: 10px; align-items: center; }
.adm-order { width: min(760px, calc(100vw - 32px)); }
.adm-order-in { padding: 26px 28px 24px; display: grid; gap: 12px; }
.adm-order-in h2 { color: var(--blue); font-family: var(--display); font-size: 1.4rem; padding-right: 36px; }
.od { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.od-row { display: contents; }
.od dt { font-weight: 700; color: var(--muted); }
.od dd { margin: 0; }
.od-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 14px 0; }
.pr-grid .qo-card h2, .pr-preview h2 { font-size: 1.05rem; }
.pr-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; }
.pr-row label, .pr-add label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.pr-switch { display: flex !important; align-items: center; gap: 8px; }
.pr-pct { display: inline-flex; align-items: center; gap: 6px; }
.pr-pct input { width: 96px; text-align: right; }
.pr-add { display: grid; gap: 10px; margin-bottom: 10px; }
.pr-add .cascade-row { grid-template-columns: 1fr; }
.pr-add-line { display: flex; gap: 10px; align-items: center; }
.pr-table td input { width: 100px; padding: 6px 8px; }
.pr-table .qo-x { margin: -4px 0; }
.pr-preview { margin-bottom: 14px; }
.pr-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pr-actions .error { margin: 0; }
.cc-list { margin: 0; padding-left: 18px; font-size: .9rem; }
.cc-list:empty::before { content: "None"; color: var(--muted); margin-left: -18px; }
#ccErrors li { color: var(--danger); font-weight: 600; }
#ccWarnings li { color: #8a5a00; }
#ccErrorsCard.bad { border-color: var(--danger); }
#ccErrorsCard.good { border-color: var(--ok); }
.cc-steps { margin: 0; padding-left: 18px; font-size: .85rem; color: var(--muted); }
.cc-steps li { margin: 2px 0; }
.cc-steps li.err { color: var(--danger); font-weight: 600; }
.cc-images { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cc-images figure { margin: 0; width: 180px; }
.cc-images img { width: 180px; height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cc-images figcaption { font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.cc-json { background: #0f1c3d; color: #b9c8ee; padding: 12px; border-radius: 6px; font-size: .78rem; overflow: auto; max-height: 480px; white-space: pre-wrap; overflow-wrap: anywhere; }
#ccFields td:first-child { font-family: var(--mono); font-size: .82rem; white-space: nowrap; color: var(--blue); }
#ccFields td:last-child { overflow-wrap: anywhere; }
#ccFields tr.blank td { color: var(--muted); }
.zones { display: grid; gap: 12px; margin-top: 12px; }
.zone { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.zone.off { opacity: .7; }
.ship-grid { align-items: start; }
.ship-grid > .qo-card { min-width: 0; }
.ship-groups { display: grid; gap: 10px; margin: 10px 0; }
.ship-group { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.ship-group.everywhere { border-left: 4px solid var(--accent); }
.ship-group > * { min-width: 0; max-width: 100%; }
.ship-group-head { display: flex; gap: 10px; align-items: center; }
.ship-group-head input { flex: 1; min-width: 0; font-weight: 600; }
.ship-group-head .btn.link { white-space: nowrap; }
.ship-table { width: 100%; table-layout: fixed; }
.ship-table th, .ship-table td { padding: 4px 6px 4px 0; white-space: nowrap; }
.ship-table td.num, .ship-table th.num { text-align: right; }
.ship-table th:first-child, .ship-table td:first-child { width: 52px; }
.ship-table th:last-child, .ship-table td:last-child { width: 30px; padding-right: 0; }
.ship-table input { width: calc(100% - 34px); min-width: 0; padding: 6px 8px; text-align: right; }
.ship-table input[name=country] { width: 100%; text-align: left; }
#flatRules th:first-child, #flatRules td:first-child { width: auto; }
#flatRules td.num { width: 150px; }
.ship-table .btn.link { padding: 0; min-height: 0; }
.ship-unit { color: var(--muted); font-size: .85rem; margin-left: 4px; }
@media (max-width: 480px) { #weightGroups .ship-table th:first-child, #weightGroups .ship-table td:first-child { display: none; } .ship-table input { padding: 6px; } .ship-unit { font-size: .75rem; margin-left: 2px; } #flatRules td.num { width: 120px; } }
.promo-head { display: grid; grid-template-columns: minmax(180px, 2fr) 110px 170px 150px 150px auto; gap: 10px; align-items: end; }
.promo-head label, .promo-body label { display: grid; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.promo-head input, .promo-head select, .promo-body textarea { width: 100%; font-size: .95rem; font-weight: 400; color: var(--ink); }
.promo-body { display: grid; gap: 10px; }
.promo-body textarea { resize: vertical; min-height: 64px; font-family: var(--mono); font-size: .85rem; }
.promo-state { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.promo-state.running { background: #e2f3e8; color: var(--ok); }
.promo-state.scheduled { background: #fff1dc; color: #a85d00; }
.promo-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.promo-foot .pr-switch { font-size: .85rem; font-weight: 600; color: var(--ink); }
.zone.off { opacity: .7; }
.logo-preview { background: repeating-linear-gradient(45deg, #f2f2f2 0 8px, #fafafa 8px 16px); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; min-height: 84px; display: grid; place-items: center; margin-bottom: 8px; }
.logo-preview img { height: 52px; width: auto; max-width: 100%; }
.logo-preview img[src=""] { display: none; }
.logo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.logo-row input[type=file] { max-width: 100%; min-width: 0; font-size: .9rem; }
.font-sample { margin-top: 10px; font-size: 1.05rem; line-height: 1.5; }
.color-pair { display: inline-flex; gap: 6px; align-items: center; }
.color-pair input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.color-pair input[type=text] { width: 110px; font-family: var(--mono); }
.theme-sample { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
@media (max-width: 820px) { .promo-head { grid-template-columns: 1fr 1fr; } }
/* Promotions → From QTP: laid out like the shop's own promotion cards */
.qtp-promo { gap: 12px; border-left: 4px solid var(--line); }
.qtp-promo.chosen { border-left-color: var(--accent); }
.qtp-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.qtp-title { display: grid; gap: 2px; min-width: 0; }
.qtp-name { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qtp-name h3 { margin: 0; font-size: 1.05rem; }
.qtp-title p { margin: 0; }
.qtp-head .corner-demo { width: 60px; height: 60px; flex: none; }
.qtp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qtp-tools input[type=search] { flex: 1 1 240px; min-width: 0; min-height: 34px; padding: 4px 10px; }
.qtp-tools .btn.small { min-height: 34px; }
.qtp-parts { max-height: 320px; overflow: auto; }
.qtp-parts table { table-layout: fixed; width: 100%; }
.qtp-parts th:first-child, .qtp-parts td:first-child { width: 64px; text-align: center; }
.qtp-parts th:nth-child(2) { width: 160px; }
.qtp-parts td { overflow-wrap: anywhere; }
@media (max-width: 600px) { .qtp-parts th:first-child, .qtp-parts td:first-child { width: 48px; } .qtp-parts th:nth-child(2) { width: 104px; } }
.qtp-parts td.code { font-family: var(--mono); white-space: nowrap; }
.qtp-parts tr.qtp-missing td { color: var(--muted); font-style: italic; }
.qtp-promo .promo-foot { justify-content: space-between; }
.qtp-actions { margin-top: 16px; }
.promo-state.ended { background: var(--surface-2); color: var(--muted); }
.try-result { font-size: 1.2rem; color: var(--blue); align-self: end; padding-bottom: 6px; }
.adm-page .top { position: static; }
.adm-page .modal { max-height: calc(100dvh - 32px); }

@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .adm-nav { display: none; position: static; max-height: none; }
  body.menu-open .adm-nav { display: flex; }
  .adm-main { padding: 16px; }
  .adm-title { font-size: 1.2rem; }
  .od { grid-template-columns: 1fr; gap: 2px; }
  .od dd { margin-bottom: 8px; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .side { display: none; }
  .btn.only-mobile { display: inline-flex; }
}
@media (max-width: 640px) {
  .strip { display: none; }
  .brand img { height: 40px; }
  .compat { padding: 16px; }
  .compat dl { grid-template-columns: 1fr; gap: 2px; }
  .compat dd { margin-bottom: 8px; }
  .top-in { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .cart-label { display: none; }
  .chg-in { padding: 20px 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px 10px 0; }
  .card-foot { padding: 8px 10px 10px; }
  .buy { grid-template-columns: 1fr; }
  .buy .stepper { grid-template-columns: 1fr 1.2fr 1fr; width: 100%; }
  .bar-tools { width: 100%; }
  .bar-tools .sort, .bar-tools .sort select, .bar-tools .btn { flex: 1; width: 100%; }
  .pd { grid-template-columns: 1fr; }
  .pd .thumb { min-height: 180px; }
  .pd-info { padding: 20px 16px; }
  .related { padding: 16px; }
  .skel { height: 300px; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
  .f2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- search-engine pages (/product, /category, /tractor, /keyword) ---------- */
.seo-main { max-width: 1320px; margin: 0 auto; padding: 16px; width: 100%; }
.seo-page .search button { padding: 0 14px; font-weight: 600; }
.seo-crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--muted); }
.seo-crumbs li + li::before { content: "\203A"; margin: 0 4px; }
.seo-crumbs a { color: var(--blue); }
.seo-product { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.seo-product-top { display: grid; grid-template-columns: minmax(200px, 380px) 1fr; gap: 24px; align-items: start; }
.seo-image { aspect-ratio: 4 / 3; background: var(--surface-2); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; }
.seo-image img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.seo-info h1 { color: var(--blue); font-family: var(--display); font-size: 1.6rem; line-height: 1.25; margin: 4px 0 8px; }
.seo-info .price { font-size: 1.4rem; margin: 6px 0; }
.seo-buy { margin-top: 14px; max-width: 320px; }
.seo-qty { width: 90px; text-align: center; }
.seo-product h2, .seo-main h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin: 22px 0 8px; }
.seo-fits dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .92rem; }
.seo-fits dt { font-weight: 700; }
.seo-fits dd { margin: 0; }
.seo-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.seo-tags li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.seo-tags a { color: var(--blue); text-decoration: none; }
.seo-tags a:hover { text-decoration: underline; }
.seo-sub { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo-sub li { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
.seo-sub a { color: var(--blue); font-weight: 600; text-decoration: none; }
.seo-index { list-style: none; padding: 0; margin: 0; columns: 3 260px; column-gap: 24px; }
.seo-index > li { break-inside: avoid; margin-bottom: 12px; }
.seo-index ul { list-style: none; padding: 0 0 0 12px; margin: 4px 0 0; font-size: .9rem; }
.seo-index a { color: var(--blue); text-decoration: none; }
.seo-index a:hover { text-decoration: underline; }
.seo-az { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; font-weight: 700; }
.seo-pager { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; font-weight: 600; }
.seo-pager a { color: var(--blue); }
.seo-foot { text-align: center; padding: 24px 16px; color: var(--muted); font-size: .9rem; }
.seo-noscript { padding: 8px 16px; text-align: center; }
.pd-link { color: var(--blue); font-family: var(--sans); letter-spacing: 0; }
@media (max-width: 640px) { .seo-product-top { grid-template-columns: 1fr; } .seo-fits dl { grid-template-columns: 1fr; } }

/* admin: catalogue source */
.src-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.src-opt { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line, #dde1ea); border-radius: 10px; padding: 12px; cursor: pointer; }
.src-opt.on { border-color: var(--primary, #214292); background: var(--blue-soft, #e8edf8); }
.src-opt input { margin-top: 3px; }
.src-opt small { display: block; color: var(--muted, #5d6675); font-weight: 400; }
@media (max-width: 640px) { .src-choice { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- usage --- */
.usg-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.usg-bar .grow { display: none; }
.usg-bar .usg-btns { display: flex; gap: 8px; }
.usg-meta { font-size: .85rem; color: var(--muted); flex: 1 1 220px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue); color: #fff; }
.usg-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1250px) { .usg-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .usg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.usg-tile { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 14px 16px 12px; min-height: 108px; }
.usg-tile-l { font-size: .85rem; color: #4b5563; }
.usg-tile-v { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--blue); line-height: 1.15; font-variant-numeric: tabular-nums; }
.usg-tile-n { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.usg-tile-n b { color: var(--blue); font-weight: 700; }
.usg-tile-n b.bad { color: #c0392b; }
.usg-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.usg-chart h2 small, .usg-accounts h2 small { font-family: var(--body, inherit); font-size: .82rem; font-weight: 400; color: var(--muted); margin-left: 8px; }
.usg-bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; border-bottom: 2px solid var(--line); }
.usg-bars.hours { gap: 2px; }
.usg-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.usg-fill { background: var(--blue); border-radius: 2px 2px 0 0; transition: height .25s; }
.usg-fill.zero { opacity: .3; }
.usg-col:hover .usg-fill { background: var(--blue-dark); }
.usg-lbl { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--blue); padding-top: 4px; white-space: nowrap; overflow: hidden; }
.usg-bars { margin-bottom: 22px; }
.usg-accounts .adm-table-wrap.plain { border: 0; border-radius: 0; }
.usg-acct { font-weight: 700; color: var(--blue); text-decoration: none; }
.usg-acct:hover { text-decoration: underline; }
.usg-acct.anon { font-weight: 600; color: var(--ink); }
.usg-events { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; border-top: 1px solid var(--line); }
.usg-events li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.usg-events li.bad .usg-what { color: #c0392b; }
.usg-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usg-what b { color: var(--blue); }
@media (max-width: 900px) { .usg-charts { grid-template-columns: 1fr; } .usg-events li { grid-template-columns: 1fr; gap: 2px; } }

/* -------------------------------------------------------- appearance --- */
/* Admin portal text size, font and theme (html[data-size|data-font|data-theme], set before paint). */
html[data-size="compact"] { font-size: 93%; }
html[data-size="large"] { font-size: 110%; }
html[data-font="source-sans"] body.adm-page { --sans: "Source Sans 3", system-ui, sans-serif; --display: "Source Sans 3", system-ui, sans-serif; }
html[data-font="inter"] body.adm-page { --sans: Inter, system-ui, sans-serif; --display: Inter, system-ui, sans-serif; }
html[data-font="roboto"] body.adm-page { --sans: Roboto, system-ui, sans-serif; --display: Roboto, system-ui, sans-serif; }
html[data-font="lato"] body.adm-page { --sans: Lato, system-ui, sans-serif; --display: Lato, system-ui, sans-serif; }
html[data-font="system"] body.adm-page { --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --display: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.adm-moon { color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; margin-left: 10px; }
.adm-moon:hover { color: var(--blue); background: var(--surface-2); }
.adm-top { grid-template-columns: auto 1fr auto auto; }
.ap-card { margin-bottom: 14px; }
.ap-card h2 { font-size: 1.15rem; }
.ap-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.ap-options.sizes { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ap-opt { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); min-height: 46px; }
.ap-opt:hover { border-color: #9aa7c2; }
.ap-opt.on { border: 2px solid var(--blue); padding: 11px 13px; }
.ap-opt small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.ap-options.sizes .ap-opt { display: grid; gap: 2px; align-content: center; }
.ap-swatch { width: 28px; height: 20px; border-radius: 4px; flex: none; background: linear-gradient(135deg, #fff 50%, var(--blue) 50%); border: 1px solid #c9d0de; }
.ap-swatch.dark { background: linear-gradient(135deg, #1f2937 50%, #8da2d8 50%); border-color: #1f2937; }
.ap-swatch.device { background: linear-gradient(135deg, #1f2937 50%, var(--blue) 50%); border-color: #1f2937; }
.ap-font { display: grid; gap: 2px; align-content: start; min-height: 108px; font-family: var(--f-body); }
.ap-font-big { font-family: var(--f-head); font-weight: 400; font-size: 1.35rem; color: var(--blue); line-height: 1.2; }
.ap-font b { font-weight: 700; }
.ap-actions { margin-top: 14px; }
.ap-shop-head { margin-top: 22px; }
.ap-h2 { color: var(--blue); font-family: var(--display); font-size: 1.35rem; }

/* Dark theme for the admin portal only. */
html[data-theme="dark"] body.adm-page {
  color-scheme: dark;
  --bg: #0f1115; --surface: #181b22; --surface-2: #20242d; --ink: #f2f3f5; --ink-2: #c5c8d0; --muted: #9aa0ab; --line: #2a2f3a; --shadow: none;
  --blue: #8da2d8; --blue-dark: #aebce6; --head-ink: #e6e9f0; --primary: #3c5bb5; --primary-hover: #4d6cc6; --primary-ink: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .adm-page .top { background: #141a27; border-bottom-color: var(--line); box-shadow: none; }
html[data-theme="dark"] .adm-page .adm-nav a.current { background: var(--surface-2); box-shadow: none; }
html[data-theme="dark"] .adm-page .adm-bar { background: #19336f; }
html[data-theme="dark"] .adm-page .adm-nav-h, html[data-theme="dark"] .adm-page .adm-nav a svg { color: #8b95aa; }
html[data-theme="dark"] .adm-page .adm-nav a.current svg { color: var(--blue); }
html[data-theme="dark"] .adm-page .usg-tile-l { color: #c3c9d6; }
html[data-theme="dark"] .adm-page .seg button.on { background: var(--primary); }
html[data-theme="dark"] .adm-page .btn.ghost, html[data-theme="dark"] .adm-page .seg, html[data-theme="dark"] .adm-page input, html[data-theme="dark"] .adm-page select, html[data-theme="dark"] .adm-page textarea { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .adm-page .usg-fill { background: #6f88cc; }
html[data-theme="dark"] .adm-page .usg-col:hover .usg-fill { background: #8da2d8; }
html[data-theme="dark"] .adm-page dialog.modal { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .adm-page .ap-swatch.light { border-color: #555; }
html[data-theme="dark"] .adm-page .adm-table tbody tr[tabindex]:hover { background: var(--surface-2); }

/* ------------------------------------------------- catalogue settings --- */
.cat-search { min-width: 240px; flex: 1 1 240px; }
.cat-tick { width: 36px; }
#catTable input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
#catTable tr.off td { color: var(--muted); }
#catTable tr.off td.code { text-decoration: line-through; }
#catTable td.code { font-weight: 700; font-family: var(--mono); font-size: .9rem; }
#catTable .st { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); }
#catTable .st.off { background: #fde8e6; color: #a1281f; }
#catTable .st.on { background: #e3f3e8; color: #1d7a46; }
#catTable .st.pending { background: #fff3d6; color: #8a5a00; }
.cat-note { margin-top: 14px; }
html[data-theme="dark"] .adm-page #catTable .st.off { background: #4a1f1c; color: #ffb4ab; }
html[data-theme="dark"] .adm-page #catTable .st.on { background: #173b26; color: #9fe0b6; }
html[data-theme="dark"] .adm-page #catTable .st.pending { background: #4a3a10; color: #ffd98a; }

/* ------------------------------------------------ account & payments --- */
.acct-btn { margin-right: 4px; }
.seg.block { display: flex; margin-bottom: 14px; }
.seg.block button { flex: 1; }
.btn.link.inline { display: inline; padding: 0; min-height: 0; color: var(--blue); font-weight: 600; }
.co-signin { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; font-size: .9rem; margin-bottom: 12px; }
.co-totals { display: grid; gap: 4px; font-size: .92rem; margin: 8px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.co-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.co-totals small { color: var(--muted); }
.co-totals .grand { font-size: 1.05rem; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.pay-note { text-align: center; margin-top: 8px; }
.acct-hello { margin-bottom: 12px; }
.acct-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.acct-sec summary { font-weight: 700; color: var(--blue); cursor: pointer; }
.acct-sec > form, .acct-orders { margin-top: 10px; }
.acct-order { border-top: 1px solid var(--line); padding: 8px 0; font-size: .9rem; }
.acct-order summary { cursor: pointer; }
.acct-order ul { margin: 6px 0 0 18px; padding: 0; color: var(--muted); font-size: .85rem; }

.chk { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.cust-code { width: 130px; font-family: var(--mono); font-size: .85rem; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: .85rem; }
#payTable .st, #mailTable .st, #mailSetup .st { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); }
#payTable .st.off, #mailTable .st.off, #mailSetup .st.off { background: #fde8e6; color: #a1281f; }
#payTable .st.on, #mailTable .st.on, #mailSetup .st.on { background: #e3f3e8; color: #1d7a46; }
#payTable .st.pending, #mailTable .st.pending { background: #fff3d6; color: #8a5a00; }
#payTestMsg.ok { color: var(--ok); }

/* ------------------------------------------------ account & payments --- */
.acct-btn { margin-right: 4px; }
.seg.block { display: flex; margin-bottom: 14px; }
.seg.block button { flex: 1; }
.btn.link.inline { display: inline; padding: 0; min-height: 0; color: var(--blue); font-weight: 600; }
.co-signin { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; font-size: .9rem; margin-bottom: 12px; }
.co-totals { display: grid; gap: 4px; font-size: .92rem; margin: 8px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.co-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.co-totals small { color: var(--muted); }
.co-totals .grand { font-size: 1.05rem; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.pay-note { text-align: center; margin-top: 8px; }
.acct-hello { margin-bottom: 12px; }
.acct-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.acct-sec summary { font-weight: 700; color: var(--blue); cursor: pointer; }
.acct-sec > form, .acct-orders { margin-top: 10px; }
.acct-order { border-top: 1px solid var(--line); padding: 8px 0; font-size: .9rem; }
.acct-order summary { cursor: pointer; }
.acct-order ul { margin: 6px 0 0 18px; padding: 0; color: var(--muted); font-size: .85rem; }

.chk { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.cust-code { width: 130px; font-family: var(--mono); font-size: .85rem; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: .85rem; }
#payTable .st, #mailTable .st, #mailSetup .st { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); }
#payTable .st.off, #mailTable .st.off, #mailSetup .st.off { background: #fde8e6; color: #a1281f; }
#payTable .st.on, #mailTable .st.on, #mailSetup .st.on { background: #e3f3e8; color: #1d7a46; }
#payTable .st.pending, #mailTable .st.pending { background: #fff3d6; color: #8a5a00; }
#payTestMsg.ok { color: var(--ok); }


.minq { display: inline-block; font-size: .72rem; font-weight: 600; color: #8a4b00; background: #fff4e5; padding: 2px 6px; margin-left: 6px; border-radius: 3px; }
.minq.bad { color: #b3261e; background: #fdecee; }

.promo-corner { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; padding: 10px 0 2px; border-top: 1px dashed var(--line); margin-top: 10px; }
.promo-corner-opts { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.promo-corner-opts label { display: grid; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.promo-corner-opts input, .promo-corner-opts select { font-size: .95rem; font-weight: 400; color: var(--ink); min-width: 150px; }
.corner-demo { position: relative; width: 84px; height: 84px; overflow: hidden; background: #f3f4f8; border: 1px solid var(--line); }
.corner-demo > span { position: absolute; top: 18px; left: -34px; width: 140px; transform: rotate(-45deg); background: var(--badge, #214292); color: var(--badge-fg, #fff); text-align: center; font-weight: 800; font-size: .62rem; line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; padding: 4px 0; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); white-space: nowrap; overflow: hidden; }
.c-blue { --badge: #214292; } .c-red { --badge: #d0021b; } .c-orange { --badge: #f89c1b; --badge-fg: #1d2433; } .c-green { --badge: #1f7a3d; } .c-black { --badge: #222; }

/* Shop template picker */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 14px; }
.tpl { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tpl.on { outline: 2px solid var(--blue); outline-offset: -2px; }
.tpl-shot { position: relative; height: 210px; background: #e9ecf1; overflow: hidden; border-bottom: 1px solid var(--line); cursor: pointer; }
.tpl-shot iframe { width: 1280px; height: 840px; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; background: #fff; }
.tpl-shot .tpl-cur { position: absolute; top: 8px; left: 8px; background: var(--ok); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.tpl-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.tpl-body h3 { font-size: 1.05rem; color: var(--blue); margin: 0; }
.tpl-body p { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.4; }
.tpl-pals { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-pal { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; background: var(--surface); font-size: .78rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.tpl-pal:hover { border-color: var(--blue); }
.tpl-pal.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint, #e9ecf4); }
.tpl-pal .sw { display: inline-grid; grid-template-columns: 1fr 1fr; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(0, 0, 0, .15); }
.tpl-pal .sw i { display: block; }

/* ---- Admin › E-mail ---- */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
.kv dt { font-weight: 600; color: var(--text-strong, #1d2433); }
.kv dd { margin: 0; color: var(--muted, #5f6b7e); }
.mail-swatches { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 10px; font-size: .88rem; }
.mail-sw { display: inline-flex; align-items: center; gap: 6px; }
.mail-sw i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .12); display: inline-block; }
#mailMsg.ok { color: var(--ok, #1f7a3a); }
#mailMsg.error { color: var(--danger, #b3261e); }
.adm-table td.nowrap { white-space: nowrap; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }
#mailForm .pr-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
#mailForm .qo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
#mailForm .qo-grid .f { min-width: 0; }
#mailForm .qo-grid input, #mailForm .qo-grid select { width: 100%; box-sizing: border-box; }
#mailForm .kv { grid-template-columns: 130px 1fr; }
#mailForm .pr-actions { flex-wrap: wrap; }
@media (max-width: 900px) { #mailForm .pr-grid, #mailForm .qo-grid { grid-template-columns: 1fr; } }

/* ---- Admin › Footer & pages ---- */
.ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ft-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
.ft-two .f { min-width: 0; }
.ft-two input { width: 100%; box-sizing: border-box; }
.ft-links { display: grid; gap: 8px; margin: 10px 0; }
.ft-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto auto; gap: 6px; align-items: center; }
.ft-link input { width: 100%; box-sizing: border-box; min-width: 0; }
.ft-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 12px 0; }
.ft-page { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ft-page.on { border-color: var(--primary, #214292); box-shadow: 0 0 0 1px var(--primary, #214292) inset; }
.ft-page .st { font-size: .74rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.ft-page .st.on { background: #e3f3e8; color: #1d7a46; }
.ft-page .st.pending { background: #fff3d6; color: #8a5a00; }
.ft-editor { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.ft-editor textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.5; }
@media (max-width: 900px) { .ft-grid { grid-template-columns: 1fr; } .ft-link { grid-template-columns: 1fr 1fr; } }

/* ---- Admin › Your login, and the bar's user / sign out ---- */
.adm-user { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: .88rem; margin-left: 8px; }
.adm-user svg { width: 16px; height: 16px; opacity: .85; }
.adm-user a { color: #fff; text-decoration: none; font-weight: 600; }
.adm-user a:hover { text-decoration: underline; }
.adm-signout { background: transparent; border: 1px solid rgba(255, 255, 255, .45); color: #fff; border-radius: 6px; padding: 4px 10px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; margin: 0 8px; }
.adm-signout:hover { background: rgba(255, 255, 255, .12); }
.lg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lg-grid input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.lg-grid .chk { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.lg-must { background: #fff4e0; border-left: 4px solid #f9a94b; padding: 12px 14px; border-radius: 6px; margin: 0 0 14px; color: #5c3d00; }
.lg-meter { height: 6px; background: var(--surface-2, #e8ebf2); border-radius: 99px; overflow: hidden; margin: -4px 0 4px; }
.lg-meter i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.lg-sessions { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.lg-sessions li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; }
.lg-sessions li.on { border-color: var(--primary, #214292); box-shadow: 0 0 0 1px var(--primary, #214292) inset; }
@media (max-width: 900px) { .lg-grid { grid-template-columns: 1fr; } .adm-user { display: none !important; } }
html[data-theme="dark"] .lg-must { background: #3a2c10; color: #ffd98a; }
@media (max-width: 640px) {
  .adm-bar-in { gap: 8px; padding: 0 12px; }
  .adm-app { white-space: nowrap; font-size: 0; }
  .adm-app .qtp-mark { font-size: 17px; }
  .adm-bar-nav a { padding: 9px 8px; }
  .adm-signout { margin: 0 2px; padding: 4px 8px; white-space: nowrap; }
  .adm-moon { margin-left: 0; }
}

/* ---- Admin › Sync › Automatic updates ---- */
.au-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.au-head .st { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.au-head .st.on { background: #e3f3e8; color: #1d7a46; } .au-head .st.off { background: #f3f4f7; color: var(--muted); }
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 18px; margin-top: 10px; }
.au-grid select, .au-grid input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.au-span { grid-column: 1 / -1; }
.au-grid .chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.au-grid .chk input { margin-top: 3px; }
.au-status { display: grid; gap: 4px; background: var(--surface-2, #f3f4f7); border-radius: 8px; padding: 10px 14px; margin: 10px 0 4px; font-size: .92rem; }
.au-how { margin-top: 12px; font-size: .9rem; } .au-how summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.au-how code { word-break: break-all; }
html[data-theme="dark"] .au-head .st.on { background: #173b26; color: #9fe0b6; }
@media (max-width: 760px) { .au-grid { grid-template-columns: 1fr; } }

/* ---- Admin › My products ---- */
#sec-myproducts .st { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #f3f4f7; color: var(--muted); }
#sec-myproducts .st.on { background: #e3f3e8; color: #1d7a46; }
#sec-myproducts .st.pending { background: #fff3d6; color: #8a5a00; }
#sec-myproducts .st.off { background: #fde7e7; color: #a32020; }
.mp-tabs { margin: 4px 0 16px; flex-wrap: wrap; }
.mp-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.mp-tools input[type=search] { flex: 1 1 280px; min-width: 0; }
#mpTable td:first-child, #mpTable th:first-child { width: 28px; }
#mpTable .minus { color: #a32020; font-weight: 700; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.mp-tag { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, #f3f4f7); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mp-tag.t { border-color: rgba(33, 66, 146, .35); }
.mp-publish { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #eef3ff; border: 1px solid rgba(33, 66, 146, .25); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.mp-bar { flex: 1 0 100%; height: 6px; background: rgba(33, 66, 146, .12); border-radius: 99px; overflow: hidden; }
.mp-bar i { display: block; height: 100%; width: 0; background: var(--blue, #214292); transition: width .6s; }
.spin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(33, 66, 146, .25); border-top-color: var(--blue, #214292); animation: mpspin .8s linear infinite; flex: none; }
@keyframes mpspin { to { transform: rotate(360deg); } }
.mp-clash { background: #fff3d6; color: #6b4600; border: 1px solid #f0d58f; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.mp-drop { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 96px; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; margin: 12px 0; cursor: pointer; background: var(--surface-2, #f7f8fa); transition: border-color .15s, background .15s; }
.mp-drop:hover, .mp-drop.over { border-color: var(--blue, #214292); background: #eef3ff; }
.mp-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mp-drop b { color: var(--blue, #214292); }
.mp-opts { display: grid; gap: 6px; margin-bottom: 12px; }
.mp-opts .chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.mp-opts .chk input { margin-top: 3px; }
.mp-res-head { display: grid; gap: 4px; background: #e3f3e8; border-radius: 8px; padding: 10px 14px; margin: 14px 0 10px; }
.mp-res-head.warn { background: #fff3d6; }
.mp-res-table { max-height: 460px; overflow: auto; }
.mp-res-table tr.attention td { background: #fff8f8; }
.mp-pick { position: relative; }
.mp-pick input { width: 100%; box-sizing: border-box; }
.mp-pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.mp-pick-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.mp-pick-item:hover, .mp-pick-item:focus { background: var(--surface-2, #f3f4f7); }
.mp-pick-item small { color: #1d7a46; font-weight: 700; }
.mp-pick-none { padding: 8px 12px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.mp-chips:empty { display: none; }
.mp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2, #f3f4f7); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .85rem; max-width: 100%; }
.mp-chip.own { border-color: #8fd0a7; }
.mp-chip button { border: 0; background: none; font-size: 1.05rem; line-height: 1; padding: 0 6px; cursor: pointer; color: var(--muted); }
.mp-own { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.mp-own li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.mp-own li > div:last-child { display: flex; gap: 4px; flex: none; }
.mp-kind { font-size: .75rem; font-weight: 700; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #eef3ff; color: var(--blue, #214292); }
.mp-dialog { width: min(760px, calc(100vw - 24px)); border-radius: 12px; }
.mp-form { padding: 22px 24px; }
.mp-form h2 { margin: 0 0 14px; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; }
.mp-grid input, .mp-grid textarea { width: 100%; box-sizing: border-box; }
.mp-span { grid-column: 1 / -1; }
.mp-tagbox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; margin: 8px 0 14px; }
.mp-tagbox label { font-weight: 600; display: block; margin-bottom: 4px; }
.own-tag { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #e3f3e8; color: #1d7a46; vertical-align: middle; }
html[data-theme="dark"] .mp-publish, html[data-theme="dark"] .mp-drop.over, html[data-theme="dark"] .mp-kind { background: #1b2640; color: var(--ink); }
html[data-theme="dark"] .mp-clash, html[data-theme="dark"] .mp-res-head.warn, html[data-theme="dark"] #sec-myproducts .st.pending { background: #3a2c10; color: #ffd98a; border-color: #5a4518; }
html[data-theme="dark"] .mp-res-head, html[data-theme="dark"] #sec-myproducts .st.on, html[data-theme="dark"] .own-tag { background: #173b26; color: #9fe0b6; }
html[data-theme="dark"] #sec-myproducts .st.off { background: #3d1a1a; color: #ffb3b3; }
html[data-theme="dark"] .mp-res-table tr.attention td { background: #2a1717; }
@media (max-width: 760px) { .mp-grid, .mp-tagbox { grid-template-columns: 1fr; } .mp-form { padding: 18px 16px; } }

/* Pricing › currency rate */
.pr-global { grid-column: 1 / -1; }
.pr-rate { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.pr-rate select { width: auto; max-width: 100%; }
.pr-rate #rateIn { width: 120px; }
.pr-rate-l { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.pr-rate-l .pr-pct { flex-wrap: wrap; }
.pr-rate p { margin: 6px 0 0; }
.pr-cur { margin-top: 8px; font-size: .9rem; }
.pr-cur summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.pr-cur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 8px; }
.pr-cur-item { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; align-items: end; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pr-cur-item.shop { background: var(--surface-2, #f3f4f7); }
.pr-cur-name { grid-column: 1 / -1; }
.pr-cur-f { display: grid; gap: 2px; }
.pr-cur-f input { width: 100%; box-sizing: border-box; }
.pr-cur-item > .pr-cur-f.muted { align-self: center; }

/* ---- Admin › Security ---- */
.adm-nav [hidden], .adm-bar-nav [hidden] { display: none !important; }
#usTable .us-can { max-width: 420px; }
#usTable tr.us-off td { opacity: .6; }
#usTable .us-act { white-space: nowrap; text-align: right; }
#sec-security .st { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #f3f4f7; color: var(--muted); }
#sec-security .st.on { background: #e3f3e8; color: #1d7a46; }
#sec-security .st.pending { background: #fff3d6; color: #8a5a00; }
#sec-security .st.off { background: #fde7e7; color: #a32020; }
.us-dialog { width: min(820px, calc(100vw - 24px)); border-radius: 12px; }
.us-areas-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 8px 0 6px; }
.us-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.us-group { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.us-group .us-all { position: absolute; top: -11px; right: 10px; background: var(--surface, #fff); padding: 0 4px; font-size: .8rem; }
.us-group legend { font-weight: 700; font-size: .85rem; padding: 0 4px; color: var(--blue, #214292); }
.us-group .chk { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 4px 0; }
.us-group .chk input { margin-top: 3px; }
.us-group .us-sec { color: #a32020; font-weight: 600; }
.btn.link.danger { color: #a32020; margin-left: auto; }
html[data-theme="dark"] #sec-security .st.on { background: #173b26; color: #9fe0b6; }
html[data-theme="dark"] #sec-security .st.pending { background: #3a2c10; color: #ffd98a; }
html[data-theme="dark"] #sec-security .st.off { background: #3d1a1a; color: #ffb3b3; }
