/* portal.css — design system for the customer-portal demo.
 *
 * The palette, radii and type scale are lifted verbatim from the production
 * portal's compiled stylesheet (see reference/prod-index.css) so the demo reads
 * as the same product. Written by hand rather than reusing that file, because
 * it is a Tailwind build that only contains the utilities the production bundle
 * happened to use — new markup would have no classes to bind to.
 */

:root {
  --ink: #0f172a;
  --subtle: #64748b;
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --accent: #4f46e5;
  --sky: #38bdf8;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --line: #e8edf3;

  --r-card: 24px;
  --r-ctl: 16px;
  --r-pill: 999px;

  --shadow-card: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -12px rgb(15 23 42 / .12);
  --shadow-pop: 0 12px 32px -12px rgb(79 70 229 / .45);
  --shadow-lift: 0 2px 6px rgb(15 23 42 / .06), 0 18px 40px -18px rgb(15 23 42 / .22);

  --nav-h: 64px;
  --tab-h: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

body {
  margin: 0;
  font-family: Rubik, Heebo, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ ribbon */
.ribbon {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap;
  padding: 7px 14px;
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff; font-size: 12.5px; font-weight: 600;
  text-align: center;
}
.ribbon .dot { width: 7px; height: 7px; border-radius: 50%; background: #fde68a; flex: none; }
.ribbon button {
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: var(--r-pill);
  padding: 3px 11px; font-size: 11.5px; font-weight: 700;
}
.ribbon button:hover { background: rgb(255 255 255 / .16); }

/* --------------------------------------------------------------------- nav */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgb(255 255 255 / .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ribbon + .topbar { top: 36px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; flex: none; }
.brand .glyph {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sky));
}
.brand b { font-size: 15.5px; font-weight: 800; white-space: nowrap; }

.tabs { display: flex; gap: 4px; margin-inline-start: auto; }
.tabs a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-ctl);
  font-size: 14px; font-weight: 600; color: var(--subtle);
}
.tabs a:hover { background: var(--canvas); color: var(--ink); }
.tabs a.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.tabs svg { width: 18px; height: 18px; }

.iconbtn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); color: var(--subtle); flex: none;
}
.iconbtn:hover { color: var(--ink); background: var(--canvas); }
.iconbtn svg { width: 18px; height: 18px; }

.who {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--subtle);
}
.who svg { width: 16px; height: 16px; color: var(--accent); }

.backlink {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 7px 12px 7px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 700; color: var(--subtle);
}
.backlink:hover { color: var(--accent); border-color: var(--accent); }
.backlink svg { width: 15px; height: 15px; }

.tabbar { display: none; }

/* --------------------------------------------------------------- cta rail */
/* The "ask for a price" call sits in a rail pinned to the inline-start edge —
 * the empty gutter beside the 1180px column — instead of as a panel at the end
 * of the page, where it read as a portal feature and drew the eye past the pay
 * bar. z-index stays UNDER .stick (45) so the pay bar always wins. */
.ctarail {
  position: fixed; z-index: 40;
  inset-inline-start: 0; top: 50%; transform: translateY(-50%);
}

.ctatab {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 17px 10px; margin: 0; cursor: pointer;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--line); border-inline-start: 0;
  border-start-end-radius: 15px; border-end-end-radius: 15px;
  box-shadow: var(--shadow-lift);
  font: inherit; font-size: 12.5px; font-weight: 800;
  transition: color .16s ease, background .16s ease;
}
/* vertical-rl rotates the glyphs a quarter turn — the usual side-tab treatment,
 * and the only way a label fits in a 40px-wide tab. The extra half turn makes it
 * read bottom-to-top, the convention for a tab on this edge: the letters lean
 * toward the content rather than off the screen. */
.ctatab span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .02em; }
.ctatab svg { width: 18px; height: 18px; }
.ctatab:hover, .ctarail.open .ctatab {
  background: linear-gradient(180deg, var(--accent), var(--sky)); color: #fff;
  border-color: transparent;
}

.ctapanel {
  position: absolute; inset-inline-start: calc(100% + 10px); top: 50%;
  width: 292px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-lift);
  display: grid; gap: 9px;
  transform: translateY(-50%) scale(.96); transform-origin: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.ctapanel b { font-size: 16px; font-weight: 800; }
.ctapanel span { font-size: 13.5px; color: var(--subtle); line-height: 1.55; margin-bottom: 4px; }
.ctapanel .btn { width: 100%; }

.ctarail.open .ctapanel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
/* a pointer can preview it without committing a click; touch gets the tap only */
@media (hover: hover) and (pointer: fine) {
  .ctarail:hover .ctapanel, .ctarail:focus-within .ctapanel {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }
}

/* -------------------------------------------------------------------- page */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 40px; }
.h1 { font-size: 25px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--subtle); font-size: 14px; margin: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.grid { display: grid; gap: 14px; }
/* grid children default to min-width:auto and refuse to shrink below their
 * content, which pushes the whole document wider than the viewport on narrow
 * phones. Samsung Internet then zooms the entire page out. */
.grid > * { min-width: 0; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* -------------------------------------------------------------------- KPIs */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi .ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.kpi .ico svg { width: 20px; height: 20px; }
.kpi .lbl { color: var(--subtle); font-size: 13px; font-weight: 600; }
.kpi .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.kpi .val.sm { font-size: 21px; }
.kpi a { color: var(--accent); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.tint-a { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.tint-w { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tint-o { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* ------------------------------------------------------------------- hero  */
.hero {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: var(--r-card);
  background: linear-gradient(90deg, var(--accent), var(--sky));
  color: #fff; box-shadow: var(--shadow-pop);
  width: 100%; text-align: start;
}
.hero .plus {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: rgb(255 255 255 / .22); display: grid; place-items: center;
}
.hero .plus svg { width: 22px; height: 22px; }
.hero b { display: block; font-size: 17px; font-weight: 800; }
.hero span { font-size: 13px; opacity: .9; }
.hero .chev { margin-inline-start: auto; opacity: .85; }
.hero:hover { filter: brightness(1.04); }

/* ------------------------------------------------------------------ shortcuts */
.shortcut { display: flex; align-items: center; gap: 13px; padding: 16px 18px; width: 100%; text-align: start; }
.shortcut .ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.shortcut .ico svg { width: 19px; height: 19px; }
.shortcut b { display: block; font-size: 14.5px; font-weight: 700; }
.shortcut span { font-size: 12.5px; color: var(--subtle); }
.shortcut .chev { margin-inline-start: auto; color: var(--subtle); }
.shortcut:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.shortcut { transition: box-shadow .18s, transform .18s; }

/* --------------------------------------------------------------- list rows */
.row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { min-width: 0; flex: 1; }
.row b { font-size: 14.5px; font-weight: 700; }
.row .meta { font-size: 12.5px; color: var(--subtle); margin-top: 2px; }
.row .amt { font-weight: 800; font-size: 15px; white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.chip.draft { background: color-mix(in srgb, var(--subtle) 14%, transparent); color: var(--subtle); }
.chip.open  { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.chip.done  { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.chip.late  { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

/* ------------------------------------------------------------------ search */
.search { position: relative; }
.search input {
  width: 100%; padding: 13px 44px 13px 16px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); outline: none; font-size: 14.5px;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.search svg { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--subtle); }

.field { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); outline: none; font-size: 14.5px; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--subtle); margin-bottom: 7px; }

/* ------------------------------------------------------------------ orders */
.ord { padding: 16px 18px; }
.ord .top { display: flex; align-items: center; gap: 10px; }
.ord .no { font-size: 15.5px; font-weight: 800; }
.ord .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ord .fact .k { font-size: 11.5px; color: var(--subtle); font-weight: 600; }
.ord .fact .v { font-size: 14px; font-weight: 700; margin-top: 2px; }
.ord .foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--subtle); }
.ord .foot .warn { color: var(--warn); font-weight: 700; }
.ord .toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 700; font-size: 13px; }
.ord .toggle svg { width: 16px; height: 16px; transition: transform .2s; }
.ord.open .toggle svg { transform: rotate(180deg); }

.items { margin-top: 12px; border-top: 1px solid var(--line); }
.items .it { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.items .it:last-child { border-bottom: 0; }
.items .it .grow { min-width: 0; flex: 1; }
.items .it .sku { font-size: 11.5px; color: var(--subtle); }
.items .it .q { color: var(--subtle); font-size: 12.5px; white-space: nowrap; }
.items .it .t { font-weight: 700; white-space: nowrap; }

/* ---------------------------------------------------------------- invoices */
.inv .hd { display: flex; align-items: center; gap: 12px; padding: 16px 18px; width: 100%; text-align: start; }
.inv .hd .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.inv .hd .ico svg { width: 18px; height: 18px; }
.inv .body { padding: 0 18px 18px; }
.inv .sums { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; }
.inv .sums div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--subtle); }
.inv .sums div.tot { color: var(--ink); font-weight: 800; font-size: 15px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; }
.inv .chev { color: var(--subtle); transition: transform .2s; flex: none; }
.inv.open .chev { transform: rotate(180deg); }
.inv.picked { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.inv .late { color: var(--danger); font-weight: 700; }
.inv .ontime { color: var(--ok); font-weight: 700; }

/* ------------------------------------------------------------ pay iframe */
.paywrap { display: flex; flex-direction: column; gap: 12px; }
.payhead { display: flex; align-items: center; gap: 12px; flex: none; }
.payhead > div { min-width: 0; flex: 1; }

.paylist {
  max-height: 108px; overflow: auto; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 4px 12px; background: var(--canvas);
}
.paylist > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line);
}
.paylist > div:last-child { border-bottom: 0; }

.payframe {
  width: 100%; height: 620px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); background: var(--surface); display: block;
}
.paynote { font-size: 11.5px; color: var(--subtle); line-height: 1.6; text-align: center; flex: none; }

/* ----------------------------------------------------------------- ageing */
.ageing { padding: 18px 20px; }
.ageing .bar { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; background: var(--canvas); margin: 4px 0 16px; }
.ageing .bar i { display: block; }
.ageing .leg { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13.5px; }
.ageing .leg .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ageing .leg .k { color: var(--subtle); }
.ageing .leg .v { margin-inline-start: auto; font-weight: 700; }
.ageing .leg.zero { opacity: .42; }

.balcard { padding: 22px 24px; border-radius: var(--r-card); background: var(--ink); color: #fff; }
.balcard .k { font-size: 13px; opacity: .72; font-weight: 600; }
.balcard .v { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.balcard .d { font-size: 12.5px; opacity: .6; }

/* ------------------------------------------------------------------- select */
.selrow { display: flex; align-items: center; gap: 13px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.selrow:last-child { border-bottom: 0; }
.selrow:hover { background: var(--canvas); }
.chk { width: 21px; height: 21px; border-radius: 7px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: .15s; }
.chk svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.chk:hover { border-color: var(--accent); }
/* ticked either by the row (list rows) or by the box itself (invoice cards) */
.selrow.on .chk, .chk.on { background: var(--accent); border-color: var(--accent); }
.selrow.on .chk svg, .chk.on svg { opacity: 1; }

/* ------------------------------------------------------------------ catalog */
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: thin; }
.cats button {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 700; color: var(--subtle);
}
.cats button svg { width: 16px; height: 16px; }
.cats button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cats button .n { font-size: 11.5px; opacity: .7; }

.catgroup { margin-bottom: 26px; }
.catgroup h3 { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; margin: 0 0 12px; }
.catgroup h3 svg { width: 18px; height: 18px; color: var(--accent); }
.catgroup h3 .n { font-size: 12px; font-weight: 600; color: var(--subtle); }

.prod { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.prod .grow { min-width: 0; flex: 1; }
.prod b { display: block; font-size: 14.5px; font-weight: 700; }
.prod .sku { font-size: 11.5px; color: var(--subtle); margin-top: 1px; }
.prod .m { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--subtle); }
.prod .m .p { color: var(--ink); font-weight: 700; }
.prod.in { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }

.add { display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: 13px; font-weight: 800; flex: none; }
.add:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.add svg { width: 15px; height: 15px; }

.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.stepper button.ghost { background: var(--canvas); color: var(--ink); border: 1px solid var(--line); }
.stepper button svg { width: 15px; height: 15px; }
.stepper .q { min-width: 30px; text-align: center; font-weight: 800; font-size: 15px; }

/* -------------------------------------------------------------- sticky bar */
.stick {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / .93); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.stick .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.stick .k { font-size: 12px; color: var(--subtle); font-weight: 600; }
.stick .v { font-size: 20px; font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--r-ctl);
  background: linear-gradient(90deg, var(--accent), var(--sky));
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: var(--shadow-pop); white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.99); }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--line); box-shadow: none; }
.btn.wide { width: 100%; }

/* ------------------------------------------------------------------- modal */
.veil {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  background: rgb(15 23 42 / .5); backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 420px; max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 26px; padding: 26px;
  box-shadow: var(--shadow-lift); animation: pop .22s cubic-bezier(.2, .8, .3, 1.1);
}
.modal.wide { max-width: 560px; }
/* The payment sheet scrolls; the iframe inside it is grown to its own content by
 * fitFrame(), so there is never a scrollbar within a scrollbar. */
.modal.wide:has(.paywrap) { max-height: 92dvh; padding: 20px; }
.modal .mico { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; }
.modal .mico svg { width: 30px; height: 30px; }
.modal h2 { font-size: 19px; font-weight: 800; margin: 0; text-align: center; }
.modal p { font-size: 14px; color: var(--subtle); margin: 8px 0 0; text-align: center; line-height: 1.6; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(14px) } }

/* ------------------------------------------------------------------- misc */
.empty { padding: 34px 20px; text-align: center; color: var(--subtle); font-size: 14px; }
.muted { color: var(--subtle); }
.count { font-size: 13px; color: var(--subtle); font-weight: 600; }
.spin { width: 20px; height: 20px; border: 2.5px solid rgb(255 255 255 / .3); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg) } }
.fade-in { animation: fi .3s ease both; }
@keyframes fi { from { opacity: 0; transform: translateY(6px) } }

.toast {
  position: fixed; inset-inline: 0; bottom: 24px; z-index: 90;
  display: flex; justify-content: center; pointer-events: none;
}
.toast > div {
  background: var(--ink); color: #fff; padding: 11px 20px;
  border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lift); animation: pop .2s ease;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > :first-child { grid-column: span 2; }
  .ord .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* No gutter left to hide in: the tab lies down into a pill low on the edge,
   * clear of the tab bar and of the pay bar above it, and the panel opens upward
   * as a sheet instead of sideways. It stays white on purpose — a second filled
   * button next to "תשלום חשבוניות" is the competition we removed it to avoid. */
  .ctarail { top: auto; bottom: calc(var(--tab-h) + 88px); transform: none; }
  .ctatab {
    flex-direction: row; gap: 7px; padding: 9px 12px 9px 14px; font-size: 12px;
    border-start-end-radius: var(--r-pill); border-end-end-radius: var(--r-pill);
    box-shadow: var(--shadow-card);
  }
  .ctatab span { writing-mode: horizontal-tb; transform: none; }
  .ctatab svg { width: 16px; height: 16px; }
  .ctapanel {
    position: fixed; inset-inline: 12px; width: auto;
    top: auto; bottom: calc(var(--tab-h) + 140px);
    transform: scale(.96);
  }
  .ctarail.open .ctapanel { transform: scale(1); }
}

@media (max-width: 640px) {
  .wrap { padding: 18px 14px calc(var(--tab-h) + 24px); }
  .h1 { font-size: 21px; }
  .tabs { display: none; }
  .who { margin-inline-start: auto; min-width: 0; padding: 6px 11px; font-size: 12px; }
  .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g3 > :first-child { grid-column: auto; }
  .balcard .v { font-size: 27px; }
  .modal { padding: 22px; }
  .veil { padding: 8px; }
  .modal.wide:has(.paywrap) { max-height: 94dvh; padding: 14px; }
  .paylist { max-height: 62px; }
  .paynote { font-size: 10.5px; }

  .tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 55;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgb(255 255 255 / .94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 10.5px; font-weight: 700; color: var(--subtle);
  }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--accent); }

  /* the cart bar has to clear the tab bar */
  .stick { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .stick .in { gap: 10px; }
  .stick .v { font-size: 17px; }
  .btn { padding: 12px 18px; font-size: 14px; }

  /* the ribbon must stay one line — a two-line banner eats the fold */
  .ribbon { gap: 7px; padding: 6px 10px; font-size: 11px; flex-wrap: nowrap; }
  .ribbon span:not(.dot) {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  }
  .ribbon button { padding: 2px 9px; font-size: 10.5px; flex: none; }
  .ribbon + .topbar { top: 30px; }
  .topbar { gap: 10px; padding: 0 14px; }
  .backlink { padding: 6px 9px; font-size: 11.5px; }
  .backlink span { display: none; }
  .ctapanel { padding: 17px; }
}
