/* ---------------------------------------------------------------
   KeyVault - inventory-manifest look.
   Slate panels, sand accent, segmented stock meters. Light and dark.
   --sand is the accent for TEXT (dark enough to read on each background);
   --sand-fill is the accent for filled buttons and meters.
   --------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #f2f5f6;
  --panel: #ffffff;
  --panel-2: #e7edf0;
  --line: #d3dce0;
  --text: #13222a;
  --muted: #56707a;
  --sand: #a34a06;
  --sand-dim: #f0bf95;
  --blue: #2563c9;
  --blue-soft: rgba(37, 99, 201, 0.13);
  --sand-fill: #f28c38;
  --on-fill: #1d0f04;
  --mint: #127452;
  --rust: #b3372a;
  --header-bg: linear-gradient(180deg, #ffffff, var(--bg));
  --overlay: rgba(19, 34, 42, 0.45);
  --shadow: 0 6px 24px rgba(19, 34, 42, 0.12);
  --toast-ok: #e5f3ec;
  --toast-err: #fbe9e6;

  --r: 4px;
  --pad: 20px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', var(--sans);
}

/* Dark: follows the device setting until the visitor picks a theme with the header button. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1417;
    --panel: #151e22;
    --panel-2: #1b262b;
    --line: #24333a;
    --text: #e9eef0;
    --muted: #8aa0a8;
    --sand: #f7a462;
    --sand-dim: #7a4722;
    --blue: #6aa6ff;
    --blue-soft: rgba(106, 166, 255, 0.16);
    --sand-fill: #f28c38;
    --on-fill: #1d0f04;
    --mint: #5fbf9c;
    --rust: #e27d6d;
    --header-bg: linear-gradient(180deg, #121a1e, var(--bg));
    --overlay: rgba(6, 10, 12, 0.78);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --toast-ok: #13261f;
    --toast-err: #2a1714;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1417;
  --panel: #151e22;
  --panel-2: #1b262b;
  --line: #24333a;
  --text: #e9eef0;
  --muted: #8aa0a8;
  --sand: #f7a462;
  --sand-dim: #7a4722;
  --blue: #6aa6ff;
  --blue-soft: rgba(106, 166, 255, 0.16);
  --sand-fill: #f28c38;
  --on-fill: #1d0f04;
  --mint: #5fbf9c;
  --rust: #e27d6d;
  --header-bg: linear-gradient(180deg, #121a1e, var(--bg));
  --overlay: rgba(6, 10, 12, 0.78);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --toast-ok: #13261f;
  --toast-err: #2a1714;
}

* { box-sizing: border-box; }
/* an element with the hidden attribute is hidden, whatever display it was given */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */

header.top {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand span { color: var(--sand); }
.brand:hover { text-decoration: none; }
nav.links { display: flex; gap: 14px; margin-left: auto; align-items: center; font-size: 14px; }
nav.links a { color: var(--muted); }
nav.links a.active, nav.links a:hover { color: var(--text); text-decoration: none; }

.balance-chip {
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--sand-dim);
  color: var(--sand);
  border-radius: var(--r);
  padding: 5px 10px;
  white-space: nowrap;
}

/* ---------- hero ---------- */

.hero { padding: 44px 0 28px; border-bottom: 1px solid var(--line); }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
  max-width: 18ch;
}
.hero p { color: var(--muted); max-width: 56ch; margin: 0; }
.hero-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.hero-stats div { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero-stats b { display: block; font-size: 22px; color: var(--text); font-weight: 500; }

/* ---------- catalogue ---------- */

.cat-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 26px 0 0;
  overflow: hidden;
  scroll-margin-top: 76px;
}
.cat-head {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) 110px 120px 236px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.cat-head h2 {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
}
.cat-head .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.col-head { font-size: 11.5px; font-weight: 500; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; }
.cat-block.flash .cat-head { animation: flash 1.6s ease; }

.row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 110px 120px 236px;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--blue-soft); }
.row .name {
  display: block; width: 100%; text-align: left; padding: 0;
  background: none; border: 0; color: var(--text);
  font: inherit; font-weight: 500; line-height: 1.35; cursor: pointer;
}
.row .name:hover, .row .name:focus-visible { color: var(--blue); }
.row .name .more { color: var(--muted); font-size: 12.5px; font-weight: 400; white-space: nowrap; margin-left: 7px; }
.row .name .caret { width: 13px; height: 13px; vertical-align: -2px; transition: transform 0.15s ease; }
.row .name.open .caret { transform: rotate(180deg); }
.row-more { margin-top: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--panel-2); }
.row-more .desc { color: var(--text); font-size: 13.5px; margin: 0 0 8px; }
.more-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.more-facts b { color: var(--text); font-weight: 500; }
.row .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.row .tags:empty { display: none; }
.row .tags .tiers { margin-top: 0; }
.tag {
  font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint);
}
.row .col-label { display: none; color: var(--muted); font-size: 11px; }
.row .price { font-family: var(--mono); }
.row .price .unit { font-size: 16px; color: var(--sand); font-weight: 500; }
.row .price .from { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.row .buy { display: flex; gap: 8px; justify-content: flex-end; }
.row .buy .qty { width: 96px; flex: none; }
.row .buy .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.row .buy .btn svg { width: 16px; height: 16px; flex: none; }
.stock-label { font-family: var(--mono); font-size: 14px; color: var(--text); }
.stock-label.out { color: var(--rust); }

/* category pictures: tiles on top, the section heads and each product row */
.tile-icon, .row-icon, .head-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--c, var(--sand-fill)); color: #ffffff; overflow: hidden;
}
.tile-icon.has-img, .row-icon.has-img, .head-icon.has-img { background: transparent; }
.tile-icon img, .row-icon img, .head-icon img { width: 100%; height: 100%; object-fit: contain; }
.row-icon { width: 40px; height: 40px; border-radius: 10px; }
.row-icon svg { width: 21px; height: 21px; }
.head-icon { width: 28px; height: 28px; border-radius: 8px; }
.head-icon svg { width: 16px; height: 16px; }

.qty { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.qty button {
  background: var(--panel);
  border: 0;
  color: var(--text);
  width: 28px;
  font-size: 16px;
  cursor: pointer;
}
.qty button:hover { background: var(--panel-2); }
.qty input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
  padding: 7px 0;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- buttons, forms ---------- */

.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--sand-fill);
  background: var(--sand-fill);
  color: var(--on-fill);
  padding: 8px 14px;
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.small { padding: 5px 9px; font-size: 13px; }
.btn.danger { background: transparent; border-color: var(--rust); color: var(--rust); }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  padding: 9px 11px;
  font-family: var(--sans);
  font-size: 14px;
}
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; min-height: 120px; }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--pad);
  margin-bottom: 18px;
}
.card h3 {
  font-family: var(--display);
  font-size: 15px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.notice { border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.notice.err { background: color-mix(in srgb, var(--rust) 10%, transparent); color: var(--rust); border: 1px solid color-mix(in srgb, var(--rust) 35%, transparent); }
.notice.ok  { background: color-mix(in srgb, var(--mint) 10%, transparent); color: var(--mint); border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { font-family: var(--mono); text-align: right; padding-right: 18px; }
td:last-child, th:last-child { padding-right: 0; }

.tag {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.ok { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 45%, transparent); }
.tag.warn { color: var(--sand); border-color: var(--sand-dim); }
.tag.bad { color: var(--rust); border-color: color-mix(in srgb, var(--rust) 45%, transparent); }

/* ---------- modal ---------- */

.modal-bg {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto;
  padding: 22px;
}
.modal h3 { font-family: var(--display); margin: 0 0 6px; font-size: 18px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.keys {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  white-space: pre;
  word-break: break-all;
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.copy-addr {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  word-break: break-all;
  margin-bottom: 10px;
}

footer.bottom {
  border-top: 1px solid var(--line);
  margin-top: 50px;
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.empty { color: var(--muted); font-size: 14px; padding: 22px 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 12px; border-radius: var(--r); cursor: pointer; font-size: 13px;
}
.tabs button.active { color: var(--text); border-color: var(--sand-dim); background: var(--panel); }

@media (max-width: 760px) {
  /* everything a notch smaller on phones, so more fits on one screen */
  body { font-size: 14px; line-height: 1.5; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .top .wrap { height: auto; padding-top: 9px; padding-bottom: 9px; }
  .brand { font-size: 17px; }
  nav.links { font-size: 13px; gap: 10px; }
  .balance-chip { font-size: 12px; padding: 4px 8px; }
  .theme-toggle { width: 30px; height: 30px; }
  .hero-x h1 { font-size: clamp(21px, 6.4vw, 27px); }
  .hero-x p { font-size: 13.5px; }
  .hero-facts { font-size: 12px; gap: 12px; }
  .btn { font-size: 13.5px; padding: 8px 14px; }
  .btn.cta { font-size: 15px; padding: 11px 20px; }
  .searchbox input { font-size: 14px; }
  .section-title { font-size: 17px; margin-bottom: 14px; }
  .cat-head h2 { font-size: 15px; }
  .cat-head .count { font-size: 11px; }
  .head-icon { width: 24px; height: 24px; border-radius: 7px; }
  .head-icon svg { width: 14px; height: 14px; }
  .row-icon { width: 32px; height: 32px; border-radius: 8px; }
  .row-icon svg { width: 17px; height: 17px; }
  .row .name { font-size: 14px; }
  .row .name .more { font-size: 11.5px; }
  .tag, .tiers span { font-size: 11px; padding: 1px 6px; }
  .row .col-label { font-size: 10.5px; }
  .stock-label { font-size: 13px; }
  .row .price .unit { font-size: 15px; }
  .row .price .from { font-size: 11px; }
  .row-more .desc { font-size: 13px; }
  .more-facts { font-size: 12.5px; }
  .qty input { font-size: 13px; padding: 6px 0; }
  .qty button { width: 26px; font-size: 15px; }
  .modal { padding: 16px; }
  .modal h3 { font-size: 16px; }
  .modal .sub { font-size: 12.5px; margin-bottom: 12px; }
  .net-tab { font-size: 13px; padding: 8px 10px; min-width: 0; }
  .pay-amount { font-size: 20px; }
  .copy-addr { font-size: 12px; padding: 8px 10px; }
  .pay-warn { font-size: 12px; padding: 8px 10px; }
  .card { padding: 14px; }
  h1 { font-size: 21px !important; }
  h2 { font-size: 17px; }
  h3 { font-size: 15px; }
  .hero-stats { gap: 16px; margin-top: 16px; }
  .hero-stats div { font-size: 12px; }
  .hero-stats b { font-size: 18px; }
  .eyebrow { font-size: 10px; }

  .cat-block { scroll-margin-top: 108px; }
  .cat-head { grid-template-columns: auto auto minmax(0, 1fr); padding: 9px 12px; gap: 9px; }
  .cat-head .col-head { display: none; }
  .row { grid-template-columns: 32px 1fr 1fr; gap: 8px 10px; padding: 11px 12px; }
  .row .info { grid-column: 2 / -1; }
  .row .stock { grid-column: 1 / 3; }
  .row .col-label { display: block; margin-bottom: 2px; }
  .row .buy { grid-column: 1 / -1; }
  .row .buy .qty { width: 96px; }
  .row .info { min-width: 0; }
  .row-more { padding: 8px 10px; margin-top: 6px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; transform: none; width: auto; max-width: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .top .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
  table { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- search ---------- */
.searchbar { margin: 26px 0 -8px; }
.searchbar input {
  background: var(--panel);
  padding: 11px 13px;
  font-size: 14px;
}
.searchbar input::placeholder { color: var(--muted); }

/* ---------- wholesale ladder ---------- */
.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tiers span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 6px;
}
.unit.discounted { color: var(--mint); }
.row[hidden], section[hidden] { display: none; }

/* wide admin tables scroll sideways on phones instead of breaking the page */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 5px 6px 5px 10px; font-size: 13px; background: var(--bg);
}
.chip .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.chip button:hover { color: var(--text); }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 99; display: flex; flex-direction: column; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px);
  /* messages are read, never tapped - taps go through to whatever is under them */
  pointer-events: none;
}
.toasts .notice { margin: 0; background: var(--panel); box-shadow: var(--shadow); }
.toasts .notice.ok { background: var(--toast-ok); }
.toasts .notice.err { background: var(--toast-err); }

.list-search { margin-bottom: 14px; max-width: 360px; }
.hint { color: var(--muted); font-size: 13px; margin: -6px 0 14px; max-width: 70ch; }

/* ---------- theme switch ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--panel-2); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.modal { box-shadow: var(--shadow); }

nav.links a { white-space: nowrap; }
@media (max-width: 760px) {
  nav.links { margin-left: 0; width: 100%; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
  nav.links .nav-store { display: none; } /* the logo already goes to the store */
}

/* ---------- pay screen ---------- */
.pay-label { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 14px 0 4px; }
.pay-amount { font-family: var(--mono); font-size: 24px; color: var(--sand); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.pay-note b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.pay-status { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pay-status.bad { color: var(--rust); }
.pay-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sand-fill); animation: pulse 1.6s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: 0.25; } }
.balance-chip[hidden] { display: none; }

.card.attention { border-color: var(--sand-dim); }
.wait-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.wait-row:first-of-type { border-top: 0; }

/* ---------- home hero: navy band, orange accents ---------- */
.hero-x {
  --navy: #0f2150;
  position: relative;
  overflow: hidden;
  background-color: var(--navy);
  background-image:
    radial-gradient(900px 380px at 50% -10%, rgba(90, 130, 255, 0.28), transparent 70%),
    linear-gradient(160deg, #0b1a40 0%, #13295f 55%, #0f2150 100%);
  color: #ffffff;
  text-align: center;
  padding: 64px 0 86px;
}
/* orange blocks in the corners */
.hero-x::before {
  content: '';
  position: absolute;
  width: 170px; height: 170px;
  left: -58px; bottom: -64px;
  background: #f28c38;
  border-radius: 30px;
  transform: rotate(28deg);
}
.hero-x::after {
  content: '';
  position: absolute;
  right: -2px; bottom: -2px;
  border-left: 120px solid transparent;
  border-bottom: 90px solid #f28c38;
}
.hero-dots {
  position: absolute;
  top: 18px; right: 22px;
  width: 150px; height: 96px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1.4px, transparent 1.6px);
  background-size: 14px 14px;
}
.hero-inner { position: relative; z-index: 1; }
.hero-x h1 {
  font-family: var(--display);
  font-size: clamp(24px, 3.3vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 auto 12px;
  max-width: 38ch;
  text-wrap: balance;
  color: #ffffff;
}
.hero-x .hl { color: #ff9a45; }
.hero-x .bar { color: rgba(255, 255, 255, 0.55); font-weight: 400; }
.hero-br { display: none; }
.hero-x p { color: #cfd9f1; margin: 0 auto 24px; max-width: 64ch; font-size: 16px; text-wrap: balance; }
.btn.cta {
  display: inline-block;
  padding: 12px 26px;
  font-size: 15px;
  border-radius: 8px;
  background: #f28c38;
  border-color: #f28c38;
  color: #1d0f04;
  box-shadow: 0 8px 24px rgba(242, 140, 56, 0.35);
  text-decoration: none;
}
.btn.cta:hover { filter: brightness(1.06); text-decoration: none; }
.hero-facts {
  margin-top: 22px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--mono); font-size: 12.5px; color: #aebbdc;
}
.hero-facts b { color: #ffffff; font-weight: 500; }

/* the search bar floats over the bottom edge of the hero */
.search-float { position: relative; z-index: 2; margin-top: -26px; }
.searchbox {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  box-shadow: var(--shadow);
  color: var(--muted);
  cursor: text;
}
.searchbox svg { width: 18px; height: 18px; flex: none; }
.searchbox input,
.searchbox input[type=search] {
  border: 0; background: transparent; padding: 14px 0; font-size: 15px; box-shadow: none;
}
.searchbox input:focus { outline: none; }
.searchbox:focus-within { border-color: var(--sand-fill); }

/* category tiles */
#categories { margin-top: 34px; }
.section-title {
  font-family: var(--display);
  font-size: 20px;
  text-align: center;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}
.cat-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 118px; padding: 16px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cat-tile:hover, .cat-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 6px 18px var(--blue-soft);
  text-decoration: none;
}
.cat-tile:hover .tile-name, .cat-tile:focus-visible .tile-name { color: var(--blue); }
.tile-icon { width: 50px; height: 50px; border-radius: 14px; }
.tile-icon svg { width: 26px; height: 26px; }
.tile-name { font-size: 13.5px; font-weight: 500; line-height: 1.25; overflow-wrap: normal; word-break: normal; max-width: 100%; }
.row.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--sand-fill) 14%, transparent); } 100% { background: transparent; } }

@media (max-width: 760px) {
  .hero-x { padding: 30px 0 56px; }
  .hero-x .bar { display: none; }
  .hero-br { display: inline; }
  .hero-x::before { width: 110px; height: 110px; left: -48px; bottom: -48px; }
  .hero-x::after { border-left-width: 80px; border-bottom-width: 60px; }
  .hero-dots { width: 90px; height: 60px; top: 10px; right: 10px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
  .cat-tile { min-height: 84px; padding: 9px 2px; border-radius: 12px; gap: 6px; }
  .tile-icon { width: 36px; height: 36px; border-radius: 11px; }
  .tile-icon svg { width: 19px; height: 19px; }
  .tile-name { font-size: 11px; letter-spacing: -0.01em; }
}

.hero-x .nowrap { white-space: nowrap; }

/* admin: category list */
.cat-admin { display: grid; gap: 6px; }
.cat-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.cat-thumb {
  width: 32px; height: 32px; border-radius: 8px; flex: none; overflow: hidden;
  background: var(--panel-2); display: inline-flex; align-items: center; justify-content: center;
}
.cat-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cat-title { flex: 1; min-width: 140px; font-weight: 500; }
.cat-title .count { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 4px; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* payment: choose the chain */
.net-tabs { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.net-tab {
  flex: 1; min-width: 120px; padding: 9px 12px; cursor: pointer;
  background: var(--panel); color: var(--text); font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--r);
}
.net-tab:hover { background: var(--panel-2); }
.net-tab.on { border-color: var(--sand-fill); background: color-mix(in srgb, var(--sand-fill) 14%, transparent); font-weight: 500; }
.net-tab[disabled] { opacity: 0.6; cursor: default; }
.pay-warn {
  margin: 12px 0 0; padding: 9px 11px; border-radius: var(--r); font-size: 13px;
  background: var(--toast-err); color: var(--text); border: 1px solid var(--line);
}

.cat-slug { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* payment: address with its QR code */
.pay-addr-row { display: flex; gap: 14px; align-items: flex-start; }
.pay-addr-col { flex: 1; min-width: 0; }
.pay-qr {
  flex: none; width: 132px; height: 132px; border-radius: var(--r);
  background: #ffffff; border: 1px solid var(--line); padding: 5px;
  display: flex; align-items: center; justify-content: center;
}
.pay-qr svg { width: 100%; height: 100%; display: block; }
.pay-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
@media (max-width: 760px) {
  .pay-addr-row { flex-direction: column; align-items: center; }
  .pay-addr-col { width: 100%; }
  .pay-qr { width: 150px; height: 150px; }
}

/* admin: foldable "Add a product" */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { margin: 0; }
details.fold > summary::after {
  content: ''; width: 8px; height: 8px; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s ease;
}
details.fold[open] > summary::after { transform: rotate(45deg); }
details.fold > summary:hover h3 { color: var(--blue); }
details.fold[open] > summary { margin-bottom: 14px; }

/* search: clear button and the count under the box */
.search-clear {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 4px; margin-left: 6px;
}
.search-clear:hover { color: var(--text); }
.search-count { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* Telegram channel banner */
.promo-wrap { margin-top: 18px; }
.promo {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: 10px;
  background: var(--blue-soft); border: 1px solid var(--blue);
  color: var(--text);
}
.promo:hover { text-decoration: none; filter: brightness(1.03); }
.promo svg { width: 19px; height: 19px; flex: none; color: var(--blue); }
.promo-text { font-size: 14.5px; }
.promo-cta {
  margin-left: auto; font-size: 13px; font-weight: 500; color: var(--blue);
  border: 1px solid var(--blue); border-radius: 999px; padding: 3px 12px; white-space: nowrap;
}

/* coupon */
.coupon-bar { display: flex; justify-content: center; margin-top: 12px; }
.coupon-box {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 4px 4px 12px;
}
.coupon-box input {
  border: 0; background: transparent; color: var(--text); font-family: var(--mono);
  font-size: 13.5px; width: 150px; text-transform: uppercase; padding: 6px 0;
}
.coupon-box input:focus { outline: none; }
.coupon-box:focus-within { border-color: var(--blue); }
.coupon-on {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px;
  background: color-mix(in srgb, var(--mint) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint) 45%, transparent);
  color: var(--text); border-radius: var(--r); padding: 7px 12px;
}
.coupon-on b { font-family: var(--mono); }
.coupon-on button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; text-decoration: underline; }
.coupon-on button:hover { color: var(--text); }
.row .buy .btn s { opacity: 0.7; font-weight: 400; margin-right: 4px; }

/* chat button in the corner */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--blue); color: #ffffff; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.chat-fab:hover { text-decoration: none; filter: brightness(1.08); }
.chat-fab svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .promo { padding: 10px 12px; gap: 8px; }
  .promo-text { font-size: 13px; }
  .promo-cta { font-size: 12px; padding: 2px 10px; }
  .coupon-box input { width: 120px; font-size: 13px; }
  .chat-fab { right: 12px; bottom: 12px; padding: 10px 14px; font-size: 13.5px; }
  .chat-fab svg { width: 17px; height: 17px; }
  .toasts { bottom: 74px; }
}

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--sand-fill); width: 16px; height: 16px; }
