/* Ordo seller platform.
   Mobile-first: the seller is on a phone, standing at a table, in the evening.
   Section 21.6 drives the packing screen's type sizes — they are large on
   purpose, not by accident.

   Light surfaces are the default. Dark mode is an explicit seller preference.
   Shared teal accents connect the public shopfront and the app. */

/* Fonts are served from here, not a font CDN: the app is used on patchy
   mobile data, and Sinhala text in the phone's old system font was what
   sellers called out as dated. Both are SIL Open Font License. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/seller/fonts/inter-latin.woff2?v=1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans Sinhala"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/seller/fonts/noto-sans-sinhala.woff2?v=1") format("woff2");
  unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4;
}

:root {
  color-scheme: light;
  --ink: #12211f;
  --ink-soft: #5b6b68;
  --line: #dfe5e3;
  --bg: #f6f8f7;
  --card: #ffffff;
  --brand: #08745e;
  --brand-soft: #e6efee;
  --accent: #b4530a;
  --ok: #1f7a44;
  --warn: #a8730b;
  --danger: #b3261e;

  /* Tinted backings for the status pills. They were inline hex values that
     only existed in the light theme, so a warning pill in dark mode kept a
     cream background behind amber text. */
  --warn-soft: #fdf1dc;
  --danger-soft: #fbe6e4;
  --ok-soft: #e2f3e9;

  /* One spacing scale, 4px based. The previous stylesheet used 6, 8, 9, 10,
     11, 12 and 14px inside a single card, which is why nothing quite lined
     up with anything else. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --tabbar-h: 62px;

  /* Three elevations. Everything used to be a flat 1px border, so a card, a
     sheet and the navigation all sat on the same plane and the eye had
     nothing to order them by. */
  --e1: 0 1px 2px rgba(18, 33, 31, 0.05), 0 1px 1px rgba(18, 33, 31, 0.04);
  --e2: 0 2px 4px rgba(18, 33, 31, 0.05), 0 4px 12px rgba(18, 33, 31, 0.06);
  --e3: 0 8px 24px rgba(18, 33, 31, 0.1), 0 2px 6px rgba(18, 33, 31, 0.06);

  /* A focus ring that sits outside the border without moving the element.
     `outline-offset` made every field visibly jump when it was focused. */
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);

  --tap: 44px; /* Minimum comfortable touch target. */
  /* Text size chosen in Settings. Every font-size is multiplied by it. */
  --fs: 1;
  /* Filled surfaces are tints, not the dark brand colour: sellers found the
     solid dark buttons and chat bubbles heavy on a bright phone screen. */
  --fill: #dcefea; --fill-hover: #cce7e0; --fill-ink: #0b4a47; --fill-line: #b9dcd4;
  /* Switches, radio dots and meters: a clear mid teal, never the near-black brand. */
  --on: #2bb39a;
  /* Chart series: one hue, validated (>= 3:1 on the card, inside the lightness band). */
  --viz-1: #1a9580; --viz-grid: #e6ebea; --viz-base: #c5cfcd;
  --bubble-out: #e3f3ee; --bubble-out-ink: #12211f;
  --cod: #fff3e6; --cod-ink: #9a4508; --cod-line: #f5c79c;

}

/* Dark mode is applied only after the seller explicitly selects it. */

/* The toggle in the top bar forces a theme, overriding the phone's setting.
 *
 * It used to switch to a different PALETTE — blue brand, glass panels, a stack
 * of !important — which meant the product had two unrelated identities
 * depending on a button nobody explained. It now does what its sun/moon icon
 * says: light or dark, in Ordo's own colours.
 *
 * Declared after :root and before any component so it wins on order, not on
 * !important. */
html.light-theme {
  color-scheme: light;
  --ink: #12211f; --ink-soft: #5b6b68; --line: #dfe5e3;
  --bg: #f6f8f7; --card: #ffffff; --brand: #08745e;
  --brand-soft: #e6efee; --accent: #b4530a; --ok: #1f7a44;
  --warn: #a8730b; --danger: #b3261e;
  --warn-soft: #fdf1dc; --danger-soft: #fbe6e4; --ok-soft: #e2f3e9;
  --e1: 0 1px 2px rgba(18, 33, 31, 0.05), 0 1px 1px rgba(18, 33, 31, 0.04);
  --e2: 0 2px 4px rgba(18, 33, 31, 0.05), 0 4px 12px rgba(18, 33, 31, 0.06);
  --e3: 0 8px 24px rgba(18, 33, 31, 0.1), 0 2px 6px rgba(18, 33, 31, 0.06);
  /* Filled surfaces are tints, not the dark brand colour: sellers found the
     solid dark buttons and chat bubbles heavy on a bright phone screen. */
  --fill: #dcefea; --fill-hover: #cce7e0; --fill-ink: #0b4a47; --fill-line: #b9dcd4;
  /* Switches, radio dots and meters: a clear mid teal, never the near-black brand. */
  --on: #2bb39a;
  /* Chart series: one hue, validated (>= 3:1 on the card, inside the lightness band). */
  --viz-1: #1a9580; --viz-grid: #e6ebea; --viz-base: #c5cfcd;
  --bubble-out: #e3f3ee; --bubble-out-ink: #12211f;
  --cod: #fff3e6; --cod-ink: #9a4508; --cod-line: #f5c79c;
}
html.dark-theme {
  color-scheme: dark;
  --ink: #e8efed; --ink-soft: #9bada9; --line: #2a3634;
  --bg: #101917; --card: #17221f; --brand: #7fd1c8;
  --brand-soft: #1d2c2a; --accent: #e59a5b; --ok: #63c48d;
  --warn: #d9ad55; --danger: #f08a82;
  --warn-soft: #33290f; --danger-soft: #3a1f1d; --ok-soft: #16301f;
  --e1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --e2: 0 2px 4px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.3);
  --e3: 0 8px 24px rgba(0, 0, 0, 0.44), 0 2px 6px rgba(0, 0, 0, 0.3);
  --fill: #245a55; --fill-hover: #2c6a64; --fill-ink: #e6fbf7; --fill-line: #2f6b65; --on: #3fc2aa; --viz-1: #27a38b; --viz-grid: #24302d; --viz-base: #34423f;
  --bubble-out: #1f3a37; --bubble-out-ink: #e8efed;
  --cod: #3a2610; --cod-ink: #f3b06f; --cod-line: #6b4520;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: calc(15px * var(--fs))/1.55 "Inter", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.spacer { flex: 1; }

/* Digits that stack in a column have to line up, or the eye realigns them
   before it can compare them. Money, counts, phone numbers, references. */
.tnum, .kpi .v, .pill, .count, .badge,
.ord-total, .ord-ref, .pack-phone, .pack-cod .amt, .pack-item-qty {
  font-variant-numeric: tabular-nums;
}

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- login */
.login { display: grid; place-items: center; min-height: 100dvh; padding: var(--s5) var(--s4); }
.login-card {
  border: 1px solid var(--line);
  background: var(--card); border-radius: var(--radius-xl);
  padding: var(--s6) var(--s5); width: min(400px, 100%);
  display: grid; gap: var(--s3); box-shadow: var(--e3);
}
.brand {
  font-size: calc(32px * var(--fs)); font-weight: 700; color: var(--brand);
  letter-spacing: -0.03em; line-height: 1.1; text-decoration: none; width: fit-content;
}
/* The portal is reached from the landing page; without this a seller who
   opened it by mistake had only the browser's back button to get out. */
.back-home {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  font-size: calc(13px * var(--fs)); font-weight: 500; color: var(--ink-soft); text-decoration: none;
  margin: calc(-1 * var(--s2)) 0 0 -4px; padding: 4px; border-radius: 8px;
}
.back-home:hover { color: var(--brand); }
.signup-hello {
  display: grid; gap: 2px; margin-top: var(--s1); padding: var(--s3) var(--s4);
  border-radius: var(--radius); background: var(--brand-soft, rgba(61,220,166,.1));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.signup-hello b { font-family: "Noto Sans Sinhala", "Inter", sans-serif; font-size: calc(19px * var(--fs)); font-weight: 600; color: var(--ink); line-height: 1.35; }
.signup-hello span { font-size: calc(14px * var(--fs)); color: var(--ink-soft); }
label { display: grid; gap: 6px; font-size: calc(13px * var(--fs)); color: var(--ink-soft); font-weight: 500; }

input, select, textarea {
  font: inherit; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--ink); width: 100%;
  transition: border-color 0.16s, box-shadow 0.16s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }

button { font: inherit; cursor: pointer; border-radius: var(--radius); border: 1px solid transparent; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* Press feedback. There was none: on a slow connection a tap gave no sign it
   had registered, so sellers tapped a second time. */
.primary {
  background: var(--fill); color: var(--fill-ink); padding: 13px; font-weight: 600;
  border-color: var(--fill-line);
  box-shadow: var(--e1); transition: transform 0.14s, box-shadow 0.14s, filter 0.14s;
}
.primary:hover:not(:disabled) { box-shadow: var(--e2); background: var(--fill-hover); }
.primary:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--e1); }
html:not(.dark-theme) .primary { background: var(--brand); color: #fff; border-color: var(--brand); }
html:not(.dark-theme) .primary:hover:not(:disabled) { background: #075e4d; border-color: #075e4d; }
.ghost {
  background: transparent; border-color: var(--line); color: var(--ink);
  padding: 8px 12px; transition: background 0.14s, border-color 0.14s;
}
.ghost:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
.ghost:active:not(:disabled) { transform: translateY(1px); }
.danger-btn { background: var(--danger); color: #fff; padding: 13px; font-weight: 600; }

.error { color: var(--danger); font-size: calc(13px * var(--fs)); min-height: 18px; }
.hint { font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
/* "Sign in with Google": Google draws the button; this only places it. */
.google-area { display: grid; gap: var(--s3); }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.or-line { display: flex; align-items: center; gap: var(--s3); color: var(--ink-soft); font-size: calc(12px * var(--fs)); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.save-shop .google-btn { margin-bottom: var(--s1); }
.auth-switch { text-align: center; font-size: calc(13px * var(--fs)); color: var(--ink-soft); }
.linkish {
  background: none; border: none; color: var(--brand);
  font-weight: 600; padding: 2px 4px; text-decoration: underline;
}

/* Setup checklist — a new shop starts empty, and an empty shop is a shop the
   AI cannot answer for. This is the first thing the seller sees. */
.setup { border-left: 3px solid var(--brand); }
.setup ol { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: 6px; }
.setup li.done { color: var(--ink-soft); text-decoration: line-through; }

/* ---------------------------------------------------------------- shell */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
/* Everything after the shop name is account chrome and belongs together at
   the far end, rather than drifting apart across the width of a monitor. */
.topbar .who { margin-left: auto; }
.shop { font-weight: 700; color: var(--brand); font-size: calc(17px * var(--fs)); letter-spacing: -0.01em; }
/* A returning customer's saved delivery details, under their name in a chat. */
.saved-details {
  margin-top: 4px; font-size: calc(12px * var(--fs)); color: var(--ink-soft);
  background: var(--brand-soft); border-radius: 8px; padding: 4px 8px; display: inline-block;
}

/* In-app back. Leftmost, where a thumb and every other app expect it. */
.nav-back {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  background: var(--brand-soft); color: var(--brand); border: 1px solid transparent;
  border-radius: 999px; padding: 6px 12px 6px 8px; font-size: calc(13px * var(--fs)); font-weight: 600;
  max-width: 40vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: border-color .14s, filter .14s;
}
.nav-back:hover { border-color: var(--brand); }
.nav-back:active { transform: translateY(1px); }
/* A phone is 360–400px wide, and back + Ordo + shop name + theme + who +
   Logout does not fit on one line: Logout was pushed off the edge. The shop
   name takes the space that is left and shortens with an ellipsis, and the
   signed-in name goes — it is in Settings. */
@media (max-width: 560px) {
  .topbar { gap: var(--s2); padding-inline: var(--s3); }
  .topbar .who { display: none; }
  .topbar .spacer { display: none; }
  /* Sign out lives in Settings → My account on a phone; the bar keeps the
     room for the shop's name. */
  .shop {
    flex: 1; min-width: 0; font-size: calc(15px * var(--fs));
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  .home-link { font-size: calc(15px * var(--fs)); padding-right: var(--s2); }
}
@media (max-width: 420px) {
  /* The label goes; the arrow stays. The shop name needs the room. */
  #nav-back-label { display: none; }
  .nav-back { padding: 6px; }
}

/* Back to the landing page. Sits before the shop name, split from it by a rule. */
.home-link {
  font-weight: 700; font-size: calc(17px * var(--fs)); letter-spacing: -0.02em; color: var(--ink);
  text-decoration: none; padding-right: var(--s3); border-right: 1px solid var(--line); flex: none;
}
.home-link:hover { color: var(--brand); }
.who { font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.topbar .ghost { border-radius: 999px; padding: 7px 13px; font-size: calc(13px * var(--fs)); }
/* Round icon buttons in the bar: help, theme, a sheet's close. */
.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--fill-line); }

/* Setup progress in the bar: a ring and "3 of 5". */
.setup-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 12px 0 6px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid transparent;
  font-size: calc(13px * var(--fs)); font-weight: 600; white-space: nowrap;
}
.setup-btn:hover { border-color: var(--ok); }
.setup-btn .ring { flex: none; }
@media (max-width: 560px) {
  .setup-label { display: none; }
  .setup-btn { padding: 0 6px; }
}
main { flex: 1; padding: var(--s4); padding-bottom: calc(var(--tabbar-h) + var(--s5)); }

/* Sellers hold the phone one-handed in the evening: primary nav sits at the
   bottom, within thumb reach. */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); box-shadow: 0 -1px 0 var(--line), var(--e2);
  padding-bottom: env(safe-area-inset-bottom); z-index: 20;
}
.tabbar button {
  background: none; border: none; color: var(--ink-soft);
  font-size: calc(10px * var(--fs)); display: grid; gap: 1px; place-items: center;
  position: relative; padding: 0;
}
.tabbar button.active { color: var(--brand); font-weight: 600; }
/* A filled disc behind the active icon. The only cue used to be colour on a
   10px label — the first thing lost on a dim screen outdoors. */
.tabbar .ico {
  display: grid; place-items: center; width: 40px; height: 26px;
  border-radius: 999px; transition: background 0.18s;
}
.tabbar button.active .ico { background: var(--brand-soft); }
.tabbar .ico svg { width: 21px; height: 21px; stroke-width: 1.7; stroke: currentColor; fill: none; }
/* Anchored to the icon, not to the cell. `right: 22%` put it 22% of the
   BUTTON's width away, so on a wide screen the count floated most of a
   column clear of the thing it was counting. */
.tabbar .ico { position: relative; }
.tabbar .badge {
  position: absolute; top: -6px; left: calc(50% + 4px);
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: calc(10px * var(--fs)); font-weight: 700; padding: 1px 5px;
  min-width: 17px; text-align: center; box-shadow: var(--e1);
  border: 2px solid var(--card); line-height: 1.2;
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s4); margin-bottom: var(--s3);
  box-shadow: var(--e2);
}
.row { display: flex; align-items: center; gap: var(--s2); }
h2 { font-size: calc(20px * var(--fs)); margin: var(--s1) 0 var(--s3); letter-spacing: -0.015em; }
.list { display: grid; gap: var(--s3); }

.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-soft); }
.empty .big {
  width: 72px; height: 72px; border-radius: 999px; background: var(--brand-soft);
  display: grid; place-items: center; margin: 0 auto var(--s3);
}
.empty .big svg { width: 32px; height: 32px; stroke-width: 1.6; stroke: var(--brand); fill: none; }
.empty strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* Status carries a dot as well as a colour. Colour alone fails for the ~8% of
   men with a colour-vision deficiency, and washes out entirely on a phone held
   in sunlight — which is where this product is used. */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: calc(11px * var(--fs)); padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; white-space: nowrap;
}
.pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; flex: none;
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.plain::before { display: none; }

/* One segmented track rather than four loose chips, so the control reads as a
   single choice with one answer. */
.filters {
  display: flex; gap: 2px; overflow-x: auto; margin-bottom: var(--s4);
  background: var(--card); border-radius: 999px; padding: 3px;
  box-shadow: var(--e1); scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  background: transparent; border: none; color: var(--ink-soft);
  padding: 8px 14px; font-size: calc(13px * var(--fs)); font-weight: 600; white-space: nowrap;
  border-radius: 999px; transition: background 0.16s, color 0.16s;
}
.filters button:hover { color: var(--ink); }
.filters button.on { background: var(--brand-soft); color: var(--brand); }

/* An initials disc. Scanning twenty rows by name alone means reading twenty
   times; a disc gives the eye a fixed place to land first. */
.av {
  width: 42px; height: 42px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: calc(14px * var(--fs));
  background: var(--brand-soft); color: var(--brand); letter-spacing: 0.02em;
}
.av.sm { width: 34px; height: 34px; font-size: calc(12px * var(--fs)); }

/* ---------------------------------------------------------------- inbox */
.conv { display: flex; gap: var(--s3); align-items: center; cursor: pointer; }
.conv:active { transform: scale(0.995); }
.conv .grow { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.conv .name { font-weight: 600; }
.conv .when { margin-left: auto; font-size: calc(12px * var(--fs)); color: var(--ink-soft); flex: none; }
.conv .last {
  color: var(--ink-soft); font-size: calc(13px * var(--fs)); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
/* A conversation waiting on the seller claims its whole left edge, so it
   survives being glanced at from across a table. */
.card.flag { border-left: 3px solid var(--danger); padding-left: calc(var(--s4) - 3px); }
.count {
  background: var(--danger); color: #fff; border-radius: 999px; flex: none;
  font-size: calc(11px * var(--fs)); font-weight: 700; padding: 2px 7px; min-width: 20px; text-align: center;
}

/* ------------------------------------------------------------------ chat */
.thread-layout { display: flex; flex-direction: column; }
.thread-right-pane { display: contents; }
.thread-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.thread-side { display: flex; flex-direction: column; }
.thread-head {
  position: sticky; top: 0; z-index: 5; margin: 0 calc(var(--s4) * -1) var(--s3);
  padding: var(--s3) var(--s4); background: var(--card); box-shadow: var(--e1);
  display: flex; align-items: center; gap: var(--s3);
}
.thread-head .grow { min-width: 0; flex: 1; display: grid; gap: 2px; }
.thread-head .nm { font-weight: 700; display: flex; align-items: center; gap: var(--s2); }
.thread-head .sub { font-size: calc(12px * var(--fs)); color: var(--ink-soft); }

.thread { display: grid; gap: var(--s1); margin: var(--s4) 0; }

/* A day marker. A thread spanning three days used to show nothing but clock
   times, so "09:14" could be this morning or last Tuesday. */
.day {
  justify-self: center; font-size: calc(11px * var(--fs)); font-weight: 600; color: var(--ink-soft);
  background: var(--card); border-radius: 999px; padding: 4px 12px;
  margin: var(--s3) 0 var(--s2); box-shadow: var(--e1);
}

.msg {
  max-width: 80%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap;
  word-break: break-word; box-shadow: var(--e1); position: relative; line-height: 1.45;
}
.msg.in { background: var(--card); justify-self: start; }
.msg.out { background: var(--bubble-out); color: var(--bubble-out-ink); justify-self: end; }
/* Only the last bubble of a run gets a tail, so a burst of four messages reads
   as one turn instead of four separate ones. */
.msg.in.tail { border-bottom-left-radius: 5px; }
.msg.out.tail { border-bottom-right-radius: 5px; }
/* Messages inside a run sit tighter than messages between turns. */
.msg.cont { margin-top: -2px; }
.msg .when { font-size: calc(10px * var(--fs)); opacity: 0.7; display: block; margin-top: 4px; }
.msg .msg-photo { display: block; margin: -4px -6px 6px; }
.msg .msg-photo img { display: block; width: 100%; max-width: 260px; max-height: 320px; object-fit: cover; border-radius: 12px; }
.msg.out .when { text-align: right; }
.msg .edited { font-size: calc(10px * var(--fs)); opacity: 0.65; font-style: italic; margin-left: 6px; }
/* Options for one message: out of the way until the bubble is hovered or tapped. */
.msg .msg-menu {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px;
  background: var(--card); color: var(--ink-soft); box-shadow: var(--e1);
  opacity: 0; transition: opacity 0.15s; cursor: pointer;
}
.msg.in .msg-menu { right: auto; left: calc(100% + 4px); }
.msg.out .msg-menu { right: calc(100% + 4px); }
.msg:hover .msg-menu, .msg:focus-within .msg-menu { opacity: 1; }
@media (hover: none) { .msg .msg-menu { opacity: 0.7; } }
.danger-text { color: var(--danger, #b42318); display: inline-flex; align-items: center; gap: 6px; }
.sheet textarea { width: 100%; }

.by-ai {
  font-size: calc(9px * var(--fs)); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.75; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 3px;
}
.by-ai::before {
  content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor;
}

/* A reply that never reached the customer. Deliberately loud: the whole point
   is that a failed send must not resemble a successful one. */
.msg.failed { box-shadow: 0 0 0 1.5px var(--danger), var(--e1); }
.not-sent {
  display: inline-flex; align-items: center; gap: 4px; margin-top: var(--s2);
  font-size: calc(10px * var(--fs)); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--danger); background: var(--danger-soft); border-radius: 6px;
  padding: 3px 7px; width: fit-content;
}
/* The background used to be a hardcoded #fff, which put white behind red text
   on every dark-theme phone. */

.composer {
  display: flex; gap: var(--s2); align-items: flex-end;
  position: sticky; bottom: calc(var(--tabbar-h) + var(--s2)); z-index: 5;
  background: var(--bg); padding-top: var(--s2);
}
.composer input {
  flex: 1; border-radius: 22px; padding: 12px var(--s4); box-shadow: var(--e1);
  border-color: transparent;
}
.composer input:focus { border-color: var(--brand); }
.composer button {
  width: var(--tap); height: var(--tap); flex: none; border-radius: 999px; padding: 0;
  display: grid; place-items: center;
}
.composer button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* An AI suggestion waiting on the seller (suggest mode). */
.suggestion {
  background: var(--brand-soft); border-radius: var(--radius-lg);
  padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  border-left: 3px solid var(--brand);
}

/* ------------------------------------------------- packing (section 21.6) */
/* One order fills the screen. Address in large type so it can be copied onto
   a parcel without squinting; the COD amount is the loudest surface on the
   screen, because a rider collecting the wrong amount is a dispute the seller
   has to settle with their own customer. Every size here is deliberate. */
.pack-progress { text-align: center; color: var(--ink-soft); font-size: calc(13px * var(--fs)); margin-bottom: var(--s2); }
.pack-card {
  background: var(--card); border-radius: var(--radius-xl);
  padding: var(--s5); box-shadow: var(--e3);
}
.pack-name { font-size: calc(26px * var(--fs)); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.pack-addr { font-size: calc(22px * var(--fs)); line-height: 1.45; margin: var(--s3) 0; white-space: pre-wrap; }
.pack-phone { font-size: calc(24px * var(--fs)); font-weight: 600; letter-spacing: 0.02em; }
.pack-cod {
  background: var(--cod); color: var(--cod-ink); border: 1px solid var(--cod-line);
  border-radius: var(--radius-lg); padding: var(--s4); text-align: center; margin: var(--s4) 0;
}
.pack-cod .amt { font-size: calc(46px * var(--fs)); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.pack-cod .lbl { font-size: calc(12px * var(--fs)); letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.92; }
.pack-items {
  border-top: 1px dashed var(--line); padding-top: var(--s4);
  font-size: calc(18px * var(--fs)); margin-top: var(--s4);
}
.pack-item-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.pack-item-qty {
  background: var(--fill); color: var(--fill-ink); font-weight: 800;
  padding: 6px 14px; border-radius: 10px; font-size: calc(22px * var(--fs));
  min-width: 54px; text-align: center; flex: none;
}
.pack-item-name { font-weight: 700; line-height: 1.2; }
.pack-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
.pack-actions button { padding: 17px; font-size: calc(16px * var(--fs)); font-weight: 600; }

/* ---------------------------------------------------------------- orders */
.order-card { cursor: pointer; }
.order-card:active { transform: scale(0.995); }
/* Rows waiting on the seller carry an accent edge — the same grammar the
   inbox uses for "needs you". */
.card.act { border-left: 3px solid var(--accent); padding-left: calc(var(--s4) - 3px); }
.ord-ref { font-size: calc(14px * var(--fs)); font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
.ord-total { margin-left: auto; font-size: calc(17px * var(--fs)); font-weight: 700; letter-spacing: -0.01em; }
.ord-items { font-size: calc(13px * var(--fs)); font-weight: 600; margin-top: var(--s2); }
.ord-sub { font-size: calc(13px * var(--fs)); color: var(--ink-soft); margin-top: 2px; }

/* ------------------------------------------------------------------ kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--s3); }
.kpi {
  background: var(--card); border-radius: var(--radius-lg); padding: var(--s4);
  box-shadow: var(--e2); display: grid; gap: 2px;
}
/* The label sits above the value. A seller reads the big number first either
   way; putting the label first means they know what they are looking at
   before they look at it. */
.kpi .k {
  order: -1; font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.kpi .v { font-size: calc(30px * var(--fs)); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
/* The dashboard's own copy calls this "the number above all others". It was
   set in the same 26px as COD outstanding; now the layout agrees with the
   sentence. */
.kpi.star {
  grid-column: 1 / -1; background: var(--fill); border: 1px solid var(--fill-line);
}
.kpi.star .k { color: var(--fill-ink); opacity: 0.8; }
.kpi.star .v { color: var(--fill-ink); font-size: calc(44px * var(--fs)); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--fs)); }
th, td { text-align: left; padding: 10px var(--s2); border-bottom: 1px solid var(--line); }
th {
  font-size: calc(11px * var(--fs)); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); font-weight: 700;
}
tbody tr:last-child td { border-bottom: none; }
.scroll-x { overflow-x: auto; }

/* ---------------------------------------------------------------- banners */
.banner {
  padding: var(--s3) var(--s4); border-radius: var(--radius); font-size: calc(13px * var(--fs));
  margin-bottom: var(--s3); border-left: 3px solid var(--warn);
  background: var(--card); box-shadow: var(--e1);
}
/* The assistant has stopped sending — louder than a warning, because the shop
   is answering nobody until it is dealt with. */
.banner.danger { border-left-color: var(--danger); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--s4)); background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 999px; font-size: calc(14px * var(--fs)); z-index: 50;
  box-shadow: var(--e3); animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* A skeleton shows the shape of what is coming, so the screen does not appear
   to jump when it lands. Replaces a centred "Loading…". */
.loading { display: grid; gap: var(--s3); padding: var(--s2) 0; }
.sk {
  background: var(--card); border-radius: var(--radius-lg); padding: var(--s4);
  box-shadow: var(--e2); display: grid; gap: var(--s2);
}
.sk i {
  display: block; height: 12px; border-radius: 6px; background: var(--line);
  position: relative; overflow: hidden;
}
.sk i::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--card) 70%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.back {
  background: none; border: none; color: var(--brand); font-weight: 600;
  padding: 0 0 var(--s3); display: inline-flex; align-items: center; gap: 6px;
}

/* ------------------------------------------------------------- desktop
   The app is built for a phone and was never given a desktop layout, so on a
   1920px screen six tab icons were strung across the full width with 300px of
   nothing between them, the filter track stretched to 920px holding four
   words, and a dead channel ran down the middle of the page.

   Above 1024px the bottom tab bar becomes a left rail. Same markup, same six
   buttons, same order — CSS grid moves them. A rail is also where a person
   using a mouse expects navigation to be, and it gives back the vertical space
   a fixed bottom bar was taking. */

/* Tablet: the column stops being full-bleed before the rail appears. */
@media (min-width: 720px) {
  main { max-width: 760px; margin: 0 auto; width: 100%; }
  /* A segmented control is as wide as its options, not as wide as its
     container — stretched to 920px it read as a bar that happened to have
     words in it. */
  .filters { width: fit-content; max-width: 100%; }
}

@media (min-width: 1024px) {
  :root { --topbar-h: 61px; }

  .app {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100dvh;
  }
  .topbar { grid-column: 1 / -1; grid-row: 1; padding-inline: var(--s5); }

  /* The rail. */
  .tabbar {
    position: sticky; top: var(--topbar-h);
    grid-column: 1; grid-row: 2;
    height: calc(100dvh - var(--topbar-h));
    display: flex; flex-direction: column; gap: var(--s1);
    padding: var(--s4) var(--s3); align-content: start;
    box-shadow: 1px 0 0 var(--line);
    left: auto; right: auto; bottom: auto; z-index: 1;
  }
  .tabbar button {
    display: flex; flex-direction: row; align-items: center; gap: var(--s3);
    justify-content: flex-start; width: 100%;
    padding: 10px var(--s3); border-radius: 12px;
    font-size: calc(14px * var(--fs)); text-align: left;
    transition: background 0.16s, color 0.16s;
  }
  .tabbar button:hover { background: var(--brand-soft); color: var(--brand); }
  /* The whole row lights up, not a disc behind the icon — at this size the
     icon is no longer the thing being pointed at, the row is. */
  .tabbar button.active { background: var(--brand-soft); }
  .tabbar .ico { width: auto; height: auto; }
  /* Same specificity as the base rule and later in the file, so it wins on
     order rather than on !important. */
  .tabbar button.active .ico { background: none; }
  .tabbar .ico svg { width: 20px; height: 20px; }
  /* The count stays pinned to the icon rather than drifting to the far end of
     a 252px row, where it would no longer read as belonging to it. */
  .tabbar .badge { top: -7px; left: calc(50% + 3px); }

  /* Anchored to the rail, not centred in what is left of the screen.
     Centring a 1040px column in a 1668px gap parked 314px of nothing between
     the navigation and the content it belongs to — the page read as two
     unrelated things either side of a channel. Left-aligned, the rail and the
     list are one object, and the slack collects at the outer edge where a
     margin is supposed to be. */
  main {
    grid-column: 2; grid-row: 2;
    max-width: 1400px; margin: 0; width: 100%;
    padding: var(--s5) var(--s5) var(--s6);
  }


  /* The customer and the order sit apart from the chat: room either side
     and a rule down the middle of the gap, so the shop's right-hand bubbles
     do not run into the cards. */
  .thread-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: calc(var(--s6) * 2);
    align-items: start;
    background: linear-gradient(var(--line), var(--line)) no-repeat calc(100% - 340px - var(--s6)) 0 / 1px 100%;
  }
  .thread-head { 
    margin: 0 0 var(--s3) 0; 
    padding: var(--s4); 
    border-radius: var(--radius-lg); 
    border: 1px solid var(--line); 
    position: static; 
  }
  .thread-right-pane { position: sticky; top: calc(var(--topbar-h) + var(--s4)); order: 2; display: flex; flex-direction: column; }
  .thread-main { order: 1; }
  .composer { bottom: var(--s4); }
}

/* Wide screens get more room, not more margin. A list row showing a name, a
   status, a time and a message preview uses width; it does not need to be
   capped like a paragraph. */
@media (min-width: 1440px) {
  main { padding-inline: var(--s6); }
}

/* ---------------------------------------------------------------- products */
.product-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 500px) { .product-form-grid { grid-template-columns: 1fr; } }

.product-grid { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card {
  background: var(--card); border: 1px solid transparent; border-radius: var(--radius-lg);
  padding: var(--s4); box-shadow: var(--e2);
  transition: box-shadow 0.18s, transform 0.18s;
}
.product-card:hover { box-shadow: var(--e3); transform: translateY(-1px); }

.pc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.pc-actions { display: flex; gap: var(--s1); flex-shrink: 0; }
.pc-name { font-weight: 700; font-size: calc(15px * var(--fs)); line-height: 1.3; }
.pc-name-si { font-size: calc(13px * var(--fs)); color: var(--ink-soft); margin-top: 2px; }
.pc-sku { font-size: calc(11px * var(--fs)); color: var(--ink-soft); margin-top: var(--s1); font-family: ui-monospace, monospace; }
.pc-price-row { margin-top: var(--s2); display: flex; align-items: baseline; gap: var(--s2); }
.pc-price { font-size: calc(19px * var(--fs)); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.pc-price-old { font-size: calc(14px * var(--fs)); color: var(--ink-soft); text-decoration: line-through; }
.pc-price-sale { font-size: calc(19px * var(--fs)); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.pc-meta { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.pc-desc {
  font-size: calc(12px * var(--fs)); color: var(--ink-soft); margin-top: var(--s2); line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pc-stock-select { width: 100%; margin-top: var(--s3); padding: 8px 10px; font-size: calc(12px * var(--fs)); }
.pc-edit { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.pc-edit-head, .pc-edit-actions { display: none; }

/* ---- the product editor as a dialog */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(2px);
  animation: fade-in .15s ease-out;
}
/* A transform on an ancestor makes position:fixed relative to it — the hover
   lift on the card would pin the dialog inside the card. */
.product-card.editing, .product-card.editing:hover { transform: none; }
.product-card.editing .pc-edit {
  position: fixed; z-index: 100; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--e3);
  padding: var(--s4) var(--s5); gap: var(--s3);
  animation: pop-in .16s ease-out;
}
.product-card.editing .pc-edit label { font-size: calc(13px * var(--fs)); }
.product-card.editing .pc-edit input, .product-card.editing .pc-edit select,
.product-card.editing .pc-edit textarea { font-size: calc(14px * var(--fs)); padding: 10px; }
.product-card.editing .pc-edit-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  grid-column: 1 / -1; position: sticky; top: calc(-1 * var(--s4)); z-index: 1;
  background: var(--card); margin: calc(-1 * var(--s4)) calc(-1 * var(--s5)) 0;
  padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line);
}
.product-card.editing .pc-edit-actions {
  display: flex; position: sticky; bottom: calc(-1 * var(--s4)); z-index: 1;
  background: var(--card); margin: 0 calc(-1 * var(--s5)) calc(-1 * var(--s4));
  padding: var(--s3) var(--s5); border-top: 1px solid var(--line); gap: var(--s2);
}
.modal-x { border-radius: 999px; width: 34px; height: 34px; padding: 0; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@media (max-width: 560px) {
  /* On a phone the dialog is the whole screen, with the buttons always in reach. */
  .product-card.editing .pc-edit {
    inset: 0; left: 0; top: 0; transform: none; width: 100%; max-height: none; height: 100dvh;
    border-radius: 0; grid-template-columns: 1fr; padding: var(--s4);
  }
  .product-card.editing .pc-edit-head { margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) 0; padding: var(--s3) var(--s4); }
  .product-card.editing .pc-edit-actions { margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: var(--s3) var(--s4); }
  @keyframes pop-in { from { opacity: 0; } }
}
.pc-edit label { font-size: calc(12px * var(--fs)); }
.pc-edit input, .pc-edit select, .pc-edit textarea { font-size: calc(13px * var(--fs)); padding: 9px; }

/* ---------------------------------------------------------------- billing */
/* A row that goes somewhere, so it has to look like one — the rest of the
   settings screen is fields, and a card that is secretly a button is the
   easiest thing on a phone to miss. */
.billing-link { display: flex; align-items: center; gap: var(--s3); cursor: pointer; }
.billing-link .grow { flex: 1; min-width: 0; }
.billing-link .chev { font-size: calc(24px * var(--fs)); color: var(--ink-soft); line-height: 1; }
.billing-link:active { transform: scale(0.995); }

/* Usage against a limit. The bar is the thing a seller reads; the numbers
   underneath are for when they need to act on it. */
.usage-bar {
  height: 8px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin-top: var(--s3);
}
.usage-bar i { display: block; height: 100%; background: var(--on); border-radius: 999px; }
/* Approaching a limit is a warning; past it, the assistant has stopped
   writing, and that has to look different from "nearly there". */
.usage-bar.near i { background: var(--warn); }
.usage-bar.over i { background: var(--danger); }
.usage-note {
  display: flex; justify-content: space-between; gap: var(--s2);
  font-size: calc(13px * var(--fs)); margin-top: 6px; font-variant-numeric: tabular-nums;
}

.feature-list { display: grid; gap: var(--s2); }
.feature-row { display: flex; align-items: center; gap: var(--s3); font-size: calc(14px * var(--fs)); }

.plan-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .plan-grid { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); } }
.plan-card { display: grid; gap: 4px; align-content: start; }
.plan-card.current { border-left: 3px solid var(--brand); padding-left: calc(var(--s4) - 3px); }
.plan-price { font-size: calc(26px * var(--fs)); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-card .actions { display: grid; gap: var(--s2); margin-top: var(--s3); }

/* ------------------------------------------------------------ variations */
.variant-editor {
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3);
  margin-top: 6px; display: grid; gap: var(--s2); background: var(--card);
}
.ve-toggle {
  display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; margin: 0;
}
.ve-toggle input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.ve-toggle span { display: grid; gap: 2px; }
.ve-toggle small { font-size: calc(12px * var(--fs)); font-weight: 400; }
.ve-body { display: grid; gap: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.ve-step { font-weight: 600; font-size: calc(13px * var(--fs)); margin-top: var(--s1); }
.ve-step .muted { font-weight: 400; }
.ve-opts { display: grid; gap: 6px; }
.ve-opt { display: grid; gap: 6px; grid-template-columns: minmax(min(90px, 100%), 1fr) minmax(0, 2.4fr) auto; align-items: center; }
.ve-opt input { margin: 0; }
.ve-add-opt { justify-self: start; }
.ve-bulk {
  display: grid; gap: 6px; align-items: center;
  grid-template-columns: auto minmax(min(70px, 100%), 1fr) minmax(min(70px, 100%), 1fr) minmax(60px, .8fr) auto;
  padding: var(--s2); border-radius: 10px; background: var(--brand-soft);
}
.ve-bulk input { margin: 0; }
.ve-bulk .muted { font-size: calc(12px * var(--fs)); }
.ve-head, .ve-row {
  display: grid; gap: 6px; align-items: center;
  grid-template-columns: minmax(110px, 1.6fr) minmax(min(70px, 100%), 1fr) minmax(min(70px, 100%), 1fr) minmax(60px, .8fr) 52px 36px;
}
.ve-head { font-size: calc(11px * var(--fs)); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; padding: 0 2px; }
.ve-rows { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.ve-row input { margin: 0; }
.ve-name { font-weight: 600; font-size: calc(13.5px * var(--fs)); overflow-wrap: anywhere; }
.ve-remove { padding: 6px 10px; }
.ve-excluded { font-size: calc(12px * var(--fs)); }
.ve-hint { font-size: calc(12px * var(--fs)); margin: 0; }
@media (max-width: 560px) {
  /* A phone: each variation is a small card — its name, then its three numbers. */
  .ve-head { display: none; }
  .ve-row {
    grid-template-columns: 1fr 1fr 1fr 36px;
    padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  }
  .ve-row .ve-name { grid-column: 1 / 3; }
  .ve-row .ve-out { grid-column: 3; grid-row: 1; justify-self: end; }
  .ve-row .ve-remove { grid-column: 4; grid-row: 1; }
  .ve-bulk { grid-template-columns: 1fr 1fr 1fr; }
  .ve-bulk .muted { grid-column: 1 / -1; }
  .ve-bulk button { grid-column: 1 / -1; }
  .ve-opt { grid-template-columns: 1fr 36px; }
  .ve-opt .ve-opt-values { grid-column: 1; }
  .ve-opt .ve-remove { grid-column: 2; grid-row: 1 / 3; }
}
.pc-from { font-size: calc(12px * var(--fs)); margin-right: 4px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.variant-chips .pill { font-size: calc(11px * var(--fs)); }
input[readonly] { opacity: .75; cursor: not-allowed; }

/* ---------------------------------------------------------------- settings
   One section per job, each with its own Save that wakes up only when
   something in that section changed. */
.settings-nav {
  position: sticky; z-index: 20; width: 100%;
  /* A ring of page colour, so the card scrolling underneath does not peek out
     around the bar's rounded ends. */
  box-shadow: 0 0 0 8px var(--bg), var(--e1);
}
/* minmax(0, …): a long page id or link in a section must wrap, not widen the
   whole page sideways on a phone. */
.settings-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); transition: box-shadow 0.3s; }
.settings-sec #channels-body { overflow-wrap: anywhere; }
.settings-sec h2 { margin: 0; }
.settings-sec.flash { box-shadow: 0 0 0 2px var(--brand), var(--e2); }
.sec-sub { font-size: calc(13px * var(--fs)); color: var(--ink-soft); margin: -6px 0 0; }

.save-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); flex-wrap: wrap; }
.save-bar .primary { padding: 11px 22px; }
.save-state { font-size: calc(13px * var(--fs)); color: var(--ink-soft); }
.save-state.dirty { color: var(--warn); }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--danger); }

.opts { display: grid; gap: var(--s2); }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; padding: var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.opt input { width: auto; margin: 3px 0 0; accent-color: var(--on); flex: none; }
.opt:has(input:checked) { border-color: var(--on); background: var(--brand-soft); }
.opt strong, .switch-row strong { display: block; font-size: calc(14px * var(--fs)); color: var(--ink); }
.opt small, .switch-row small { display: block; font-size: calc(12px * var(--fs)); color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.payment-methods .opt:has(input:disabled) { cursor: not-allowed; background: var(--bg); border-style: dashed; }
.payment-methods .opt > span { min-width: 0; }
.payment-soon { display: inline-block; margin: 3px 0; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--ink-soft); font-size: 11px; font-style: normal; font-weight: 500; }
.payment-result, .payment-availability { margin-bottom: var(--s3); }
.payment-reference { overflow-wrap: anywhere; }
#co-methods { display: grid; gap: var(--s2); }
#co-methods[hidden] { display: none; }
#co-retry { margin-top: var(--s2); }

.switch-row { display: flex; align-items: center; gap: var(--s3); padding: 2px 0; cursor: pointer; }
.switch-row .grow { flex: 1; min-width: 0; }
/* A real checkbox underneath, so keyboards and screen readers get one. */
.switch {
  appearance: none; -webkit-appearance: none; width: 44px; height: 26px; padding: 0;
  border-radius: 999px; background: var(--line); position: relative; flex: none;
  border: none; cursor: pointer; transition: background 0.16s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--e1); transition: transform 0.16s;
}
.switch:checked { background: var(--on); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { box-shadow: var(--ring); }

.d-fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.preview {
  background: var(--brand-soft); border-radius: var(--radius); padding: var(--s3);
  font-size: calc(13px * var(--fs)); display: grid; gap: 4px;
}

.faq-list { display: grid; gap: var(--s2); }
.faq-row {
  display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.faq-row.off { opacity: 0.6; }
.faq-row .grow { flex: 1; min-width: 0; }
.faq-a { font-size: calc(13px * var(--fs)); color: var(--ink-soft); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.faq-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.faq-actions .ghost { padding: 6px 10px; font-size: calc(13px * var(--fs)); }
.faq-add, .pw-box {
  display: grid; gap: var(--s3); border-top: 1px solid var(--line);
  padding-top: var(--s3); margin-top: var(--s1);
}
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-chips .ghost { font-size: calc(12px * var(--fs)); padding: 6px 10px; border-radius: 999px; }

.team-row { padding: 6px 0; }
.team-row .grow { flex: 1; min-width: 0; }
.team-row .muted { font-size: calc(12px * var(--fs)); overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .d-fields.two { grid-template-columns: 1fr; }
  .faq-row { flex-direction: column; }
  .faq-actions { align-self: flex-end; }
}

/* ---------------------------------------------------------------- sheets
   A side panel on a computer, a sheet from the bottom on a phone. */
.sheet-wrap { position: fixed; inset: 0; z-index: 120; }
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(12, 22, 20, 0.35);
  backdrop-filter: blur(2px); animation: fade-in 0.15s ease-out;
}
.sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--card); box-shadow: var(--e3); overflow-y: auto;
  padding: var(--s5); display: grid; align-content: start; gap: var(--s3);
  animation: sheet-in 0.2s ease-out;
}
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) {
  .sheet {
    top: auto; left: 0; width: 100%; max-height: 86dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
    animation-name: sheet-up;
  }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
body.sheet-open { overflow: hidden; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.sheet-head h2 { margin: 2px 0 0; }
.sheet-kicker {
  font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ok);
}
.sheet-sub { margin: 0; color: var(--ink-soft); font-size: calc(14px * var(--fs)); }

.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.3s; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.step {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.step .grow { flex: 1; min-width: 0; }
.step strong { display: block; font-size: calc(14px * var(--fs)); }
.step .muted { font-size: calc(12px * var(--fs)); }
.step-mark {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  border: 2px solid var(--line); display: grid; place-items: center; color: #fff;
}
.step.done .step-mark { background: var(--ok); border-color: var(--ok); }
.step.done { background: color-mix(in srgb, var(--ok-soft) 45%, transparent); }
.step.done strong { color: var(--ink-soft); }
.step-go { padding: 8px 14px; font-size: calc(13px * var(--fs)); white-space: nowrap; }

.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); counter-reset: none; }
.guide-steps li { display: flex; gap: var(--s3); align-items: flex-start; font-size: calc(14px * var(--fs)); }
.guide-steps .num {
  width: 26px; height: 26px; border-radius: 999px; flex: none; display: grid; place-items: center;
  background: var(--fill); color: var(--fill-ink); font-weight: 700; font-size: calc(13px * var(--fs));
}
.guide-tip {
  background: var(--warn-soft); border-radius: var(--radius); padding: var(--s3);
  font-size: calc(13px * var(--fs)); color: var(--ink);
}
.guide-tip strong { color: var(--warn); }

/* ---------------------------------------------------------------- misc */
.field-label { font-size: calc(13px * var(--fs)); color: var(--ink-soft); font-weight: 500; margin-bottom: -4px; }
.opts.four { grid-template-columns: repeat(4, 1fr); }
.size-opt { position: relative; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 6px; }
.size-opt input { position: absolute; opacity: 0; pointer-events: none; }
.size-opt strong { line-height: 1.1; }
.missing { color: var(--danger); font-weight: 600; }
.missing-note {
  margin-top: var(--s2); font-size: calc(12px * var(--fs)); color: var(--danger);
  background: var(--danger-soft); border-radius: 8px; padding: 6px 10px;
}
.pack-fee { font-size: calc(12px * var(--fs)); margin-top: 6px; opacity: 0.85; }

.kpi { min-width: 0; }
.kpi .v { overflow-wrap: anywhere; }
.signout-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s3); }

/* ---------------------------------------------------------------- home
   Business overview. Status colours (critical / serious / warning) always
   travel with an icon and a word, never alone. */
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.ov-title { font-size: calc(24px * var(--fs)); margin: 0; letter-spacing: -0.02em; }
.ov-sub { margin: 2px 0 0; font-size: calc(13px * var(--fs)); }
.ov-period { margin: 0; }
.ov-section { margin-bottom: var(--s4); }
.ov-h { font-size: calc(15px * var(--fs)); margin: 0 0 var(--s2); color: var(--ink-soft); font-weight: 600; }

.bns { display: grid; gap: var(--s2); }
.bn {
  --sev: #fab219; --sev-soft: color-mix(in srgb, #fab219 14%, var(--card));
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sev);
  border-radius: var(--radius);
}
.bn.critical { --sev: #d03b3b; --sev-soft: color-mix(in srgb, #d03b3b 12%, var(--card)); }
.bn.serious { --sev: #ec835a; --sev-soft: color-mix(in srgb, #ec835a 14%, var(--card)); }
.bn.ok { --sev: var(--ok); --sev-soft: var(--ok-soft); }
.bn-ico {
  width: 34px; height: 34px; border-radius: 999px; flex: none; display: grid; place-items: center;
  background: var(--sev-soft); color: var(--sev);
}
.bn.warning .bn-ico { color: #a86f00; }
.bn .grow { flex: 1; min-width: 0; }
.bn strong { display: block; font-size: calc(14px * var(--fs)); }
.bn .muted { font-size: calc(13px * var(--fs)); }
.bn-sev { font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.bn-go { flex: none; white-space: nowrap; font-size: calc(13px * var(--fs)); }
@media (max-width: 560px) {
  .bn { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; padding: var(--s3); }
  .bn-go { grid-column: 2; justify-self: start; }
}

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s4); display: grid; gap: 2px; min-width: 0;
}
.stat-k { font-size: calc(12px * var(--fs)); color: var(--ink-soft); font-weight: 600; }
.stat-v { font-size: calc(26px * var(--fs)); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.stat-sub { font-size: calc(12px * var(--fs)); color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 18px; }
.delta { font-weight: 700; border-radius: 999px; padding: 1px 7px; font-size: calc(11px * var(--fs)); }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.delta.flat { color: var(--ink-soft); background: var(--bg); }

.viz { display: grid; gap: var(--s2); min-width: 0; align-content: start; }
.viz-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.viz-head h2 { margin: 0; font-size: calc(16px * var(--fs)); }
.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.viz-grid > .card { margin-bottom: 0; }
.chart-note { margin: 0; font-size: calc(12px * var(--fs)); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--viz-grid); stroke-width: 1; }
.chart .base { stroke: var(--viz-base); stroke-width: 1; }
.chart .axis-t { fill: var(--ink-soft); font-size: 11px; font-family: inherit; }
.chart .mark { fill: var(--viz-1); transition: opacity 0.12s; }
.chart .hit { cursor: default; outline: none; }
.chart .hit:hover .mark, .chart .hit:focus .mark { opacity: 0.75; }
.chart .hit:focus rect { stroke: var(--viz-1); stroke-width: 1; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; gap: 4px; outline: none; border-radius: 6px; }
.hbar:focus-visible { box-shadow: var(--ring); }
.hbar-label { font-size: calc(13px * var(--fs)); color: var(--ink); overflow-wrap: anywhere; }
.hbar-note { color: var(--ink-soft); font-size: calc(12px * var(--fs)); }
.hbar.flagged .hbar-note { color: var(--danger); font-weight: 600; }
.hbar-track { display: flex; align-items: center; gap: 8px; }
.hbar-track i {
  display: block; height: 14px; background: var(--viz-1); border-radius: 0 4px 4px 0; flex: none;
  max-width: calc(100% - 70px); transition: opacity 0.12s;
}
.hbar:hover .hbar-track i { opacity: 0.75; }
.hbar-val { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
.mini-stats.three { grid-template-columns: repeat(3, 1fr); }
.mini-stats .stat { padding: var(--s3); }
.mini-stats .stat-v { font-size: calc(20px * var(--fs)); }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--ok); font-size: calc(13px * var(--fs)); margin: 0; }
.ok-line svg { flex: none; }

.heat { display: grid; gap: 2px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 40px repeat(24, minmax(min(10px, 100%), 1fr)); gap: 2px; align-items: center; }
.heat-day { font-size: calc(11px * var(--fs)); color: var(--ink-soft); }
.heat-cell {
  height: 18px; border-radius: 3px;
  background: color-mix(in oklab, var(--viz-1) var(--a), var(--bg));
}
.heat-axis span { font-size: calc(10px * var(--fs)); color: var(--ink-soft); text-align: left; }

.viz-tip {
  position: fixed; z-index: 130; pointer-events: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--e3); border-radius: 10px; padding: 8px 10px;
  font-size: calc(12px * var(--fs)); display: grid; gap: 1px; max-width: 240px;
}
.viz-tip strong { font-size: calc(14px * var(--fs)); }
.viz-table summary { cursor: pointer; font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.viz-table table { margin-top: var(--s2); }

/* ---------------------------------------------------------------- team */
.team-list { display: grid; gap: 2px; }
.team-row { gap: var(--s3); }
.role-select { width: auto; padding: 7px 10px; font-size: calc(13px * var(--fs)); }
.invite-av { background: var(--warn-soft); color: var(--warn); }
.ghost.small { padding: 6px 10px; font-size: calc(12px * var(--fs)); }
.invite-link {
  display: grid; gap: var(--s2); padding: var(--s3); border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid var(--fill-line);
}
.link-row input { flex: 1; min-width: 0; font-size: calc(12px * var(--fs)); padding: 9px; }
.wa-share { text-align: center; text-decoration: none; border-radius: var(--radius); }
@media (max-width: 480px) {
  .team-row { flex-wrap: wrap; }
  .team-row .grow { flex-basis: calc(100% - 60px); }
}

/* ---------------------------------------------------------------- billing */
.bill-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.plan-card { display: grid; gap: var(--s3); }
.plan-status { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: calc(14px * var(--fs)); }
.plan-note { font-size: calc(13px * var(--fs)); border-radius: var(--radius); padding: var(--s2) var(--s3); }
.warn-note { background: var(--warn-soft); color: var(--warn); }
.wallet { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.wallet-v { font-size: calc(30px * var(--fs)); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.wallet.low .wallet-v { color: var(--warn); }

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--s3); }
.meter { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); display: grid; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; gap: var(--s2); font-size: calc(13px * var(--fs)); }
.meter-head span { color: var(--ink-soft); font-weight: 600; }
.meter-head strong { font-variant-numeric: tabular-nums; }
.meter-note { font-size: calc(12px * var(--fs)); }
.meter.near .meter-note { color: var(--warn); }
.meter.over { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.meter.over .meter-note { color: var(--danger); font-weight: 600; }
.meter.locked { background: var(--bg); }
.usage-bar.near i { background: var(--warn); }
.usage-bar.over i { background: var(--danger); }
.sub-h { font-size: calc(14px * var(--fs)); margin: var(--s4) 0 var(--s2); color: var(--ink-soft); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 6px var(--s3); }
.feat { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs)); padding: 4px 0; }
.feat svg { flex: none; }
.feat.on svg { color: var(--ok); }
.feat.off { color: var(--ink-soft); }
.feat.soon { color: var(--ink-soft); }
.feat em { font-style: normal; font-size: calc(10px * var(--fs)); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--bg); border-radius: 999px; padding: 1px 7px; }

.addons { display: grid; gap: var(--s2); }
.addon { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); flex-wrap: wrap; }
.addon-buy { display: flex; align-items: center; gap: var(--s3); }

.plans-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin: var(--s4) 0 var(--s3); }
.plans-head h2 { margin: 0; }
.cycle-toggle { margin: 0; }
.save-pill { background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 1px 7px; font-size: calc(10px * var(--fs)); margin-left: 4px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.pcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s4); display: flex; flex-direction: column; gap: 6px; position: relative;
}
.pcard.hl { border: 2px solid var(--viz-1); box-shadow: var(--e2); }
.pcard.current { background: var(--brand-soft); }
.pc-tag { font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--viz-1); min-height: 1.2em; }
.pc-name { font-weight: 800; font-size: calc(19px * var(--fs)); letter-spacing: -0.01em; }
.pc-price { font-weight: 800; font-size: calc(22px * var(--fs)); letter-spacing: -0.02em; }
.pc-price span { font-size: calc(12px * var(--fs)); color: var(--ink-soft); font-weight: 500; }
.pc-sub { font-size: calc(12px * var(--fs)); color: var(--ink-soft); min-height: 1.4em; }
.pcard ul { list-style: none; margin: var(--s2) 0; padding: var(--s2) 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; flex: 1; }
.pcard li { display: flex; gap: 8px; align-items: flex-start; font-size: calc(13px * var(--fs)); }
.pcard li svg { color: var(--ok); flex: none; margin-top: 3px; }
.pcard > button { width: 100%; }
.pay-table td { vertical-align: top; }
.invoice-link {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  color: var(--brand); font-weight: 600; text-decoration: none;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
}
.invoice-link:hover { background: var(--brand-soft); }

.summary { display: grid; gap: 6px; background: var(--bg); border-radius: var(--radius); padding: var(--s3); font-size: calc(14px * var(--fs)); }
.summary .discount { color: var(--ok); }
.summary .total { border-top: 1px solid var(--line); padding-top: 6px; font-size: calc(16px * var(--fs)); }
.promo-row { display: flex; gap: var(--s2); }
.promo-row input { flex: 1; min-width: 0; }
.bank-box { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.bank-line { display: flex; align-items: center; gap: var(--s2); font-size: calc(14px * var(--fs)); }
.bank-line .muted { width: 110px; flex: none; font-size: calc(12px * var(--fs)); }
.bank-line strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drop {
  display: grid; place-items: center; text-align: center; gap: 4px; padding: var(--s4);
  border: 2px dashed var(--fill-line); border-radius: var(--radius); background: var(--brand-soft); cursor: pointer; color: var(--fill-ink);
}
.drop input { display: none; }
.drop span { display: grid; place-items: center; gap: 4px; }
.drop small { color: var(--ink-soft); }
.slip-preview { max-height: 220px; width: auto; max-width: 100%; border-radius: var(--radius); justify-self: center; }

.locked-card { background: var(--bg); }
.locked-card .pill { gap: 4px; }
.export-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Product photo gallery in the edit dialog. */
.gallery-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.g-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-main { position: absolute; left: 4px; bottom: 4px; font-size: calc(10px * var(--fs)); background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 1px 5px; }
.g-remove { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 999px; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 1; padding: 0; }
.g-add { width: 84px; height: 84px; border: 2px dashed var(--fill-line); border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 0; cursor: pointer; color: var(--fill-ink); background: var(--brand-soft); }
.g-add input { display: none; }
.g-add span { font-size: 24px; line-height: 1; }
.g-add small { font-size: calc(10px * var(--fs)); }
.viz-tip[hidden] { display: none; }

/* A demo shop an operator is building: says so above every screen. */
.demo-chip {
  margin-left: 10px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: calc(12px * var(--fs)); font-weight: 600;
  background: var(--brand-soft); color: var(--brand); border: 1px dashed var(--brand);
}
@media (max-width: 600px) { .demo-chip { display: none; } }

/* The shop's picture, in Settings. */
.logo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.logo-pic {
  width: 64px; height: 64px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-size: calc(20px * var(--fs));
}
.logo-pic img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }

/* ---------------------------------------------------------------- Ordo AI */

.ai-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--fill-line); background: var(--fill); color: var(--fill-ink);
  font-weight: 600; font-size: calc(13px * var(--fs));
}
.ai-btn:hover { background: var(--fill-hover); }
/* On a phone the top bar is tight: the icon alone. */
@media (max-width: 719px) {
  .ai-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .ai-btn-label { display: none; }
}

.ai-panel {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
}
.ai-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s3) var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top));
  background: var(--card); box-shadow: 0 1px 0 var(--line);
}
.ai-head-text { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.ai-head-text strong { font-size: calc(16px * var(--fs)); }
.ai-usage { color: var(--ink-soft); font-size: calc(12px * var(--fs)); }

.ai-log {
  flex: 1; overflow-y: auto; padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s3);
  overscroll-behavior: contain;
}
.ai-msg { display: flex; flex-direction: column; gap: var(--s2); max-width: 88%; }
.ai-msg.me { align-self: flex-end; align-items: flex-end; }
.ai-msg.bot { align-self: flex-start; }
.ai-bubble {
  padding: 10px 13px; border-radius: 16px; line-height: 1.5;
  font-size: calc(14.5px * var(--fs)); overflow-wrap: anywhere;
}
.ai-msg.me .ai-bubble { background: var(--brand); color: var(--card); border-bottom-right-radius: 5px; }
.ai-msg.bot .ai-bubble { background: var(--card); box-shadow: var(--e1); border-bottom-left-radius: 5px; }
.ai-img { width: 180px; max-width: 100%; border-radius: 14px; box-shadow: var(--e1); display: block; }

.ai-typing { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: ai-dot 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
.ai-typing em { font-style: normal; margin-left: 6px; font-size: calc(13px * var(--fs)); }
@keyframes ai-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.ai-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; display: grid; gap: 4px; font-size: calc(13.5px * var(--fs));
}
.ai-card-line { display: flex; gap: var(--s2); align-items: baseline; }
.ai-card-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); transform: translateY(-1px); }
.ai-card.done .ai-card-dot { background: var(--ok); }
.ai-card.pending { border-color: var(--warn); background: var(--warn-soft); }
.ai-card.pending .ai-card-dot { background: var(--warn); }
.ai-card.failed .ai-card-dot { background: var(--danger); }
.ai-card.cancelled { opacity: 0.7; }
.ai-card-state { color: var(--ink-soft); font-size: calc(12px * var(--fs)); padding-left: 16px; }
.ai-card-actions { display: flex; gap: var(--s2); padding-left: 16px; margin-top: 4px; }
.primary.small { padding: 7px 14px; font-size: calc(13px * var(--fs)); }

.ai-empty { margin: auto 0; text-align: center; color: var(--ink-soft); display: grid; gap: var(--s3); justify-items: center; padding: var(--s4) 0; }
.ai-empty p { max-width: 34ch; line-height: 1.5; margin: 0; }
.ai-empty-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.ai-suggest { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.ai-suggest button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 13px; font-size: calc(13px * var(--fs));
}
.ai-suggest button:hover { border-color: var(--brand); background: var(--brand-soft); }

.ai-compose {
  background: var(--card); box-shadow: 0 -1px 0 var(--line);
  padding: var(--s2) var(--s3); padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom));
  display: grid; gap: var(--s2);
}
.ai-row { display: flex; align-items: flex-end; gap: var(--s2); }
.ai-row textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px;
  border-radius: 21px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: calc(15px * var(--fs)); line-height: 1.4;
}
.ai-row textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--brand); }
.ai-attach { cursor: pointer; flex: none; }
.ai-send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: none;
  display: grid; place-items: center; background: var(--brand); color: var(--card);
}
.ai-send:disabled { opacity: 0.5; }
.ai-photo { position: relative; width: 64px; }
.ai-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: block; }
.ai-photo-x {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--ink); color: var(--card); line-height: 1; padding: 0;
}

@media (min-width: 720px) {
  .ai-panel {
    inset: auto var(--s4) var(--s4) auto; width: 400px;
    height: min(640px, calc(100dvh - 2 * var(--s4)));
    border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--e3);
    border: 1px solid var(--line);
  }
  .ai-head { padding-top: var(--s3); }
}
body.ai-open { overflow: hidden; }
@media (min-width: 720px) { body.ai-open { overflow: auto; } }

/* Out of stock, now: the seller's own switch, whatever the count says. */
.ve-out { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: calc(12px * var(--fs)); color: var(--ink-soft); cursor: pointer; }
.ve-out input { width: 16px; height: 16px; margin: 0; accent-color: var(--danger); }
.stock-switch {
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; width: 100%;
  margin-top: var(--s2); padding: 8px 12px; border-radius: 10px; text-align: left;
  border: 1px solid var(--fill-line); background: var(--ok-soft); color: var(--ok); font-weight: 600;
  font-size: calc(13px * var(--fs));
}
.stock-switch .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; grid-row: 1 / 3; }
.stock-switch small { grid-column: 2; font-weight: 400; color: var(--ink-soft); font-size: calc(11.5px * var(--fs)); }
.stock-switch.is-out { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.vchip { border: none; cursor: pointer; font: inherit; }
.vchip:hover { filter: brightness(1.08); outline: 1px solid currentColor; }

/* A transfer slip in the chat and on the order: photo, checks, a reminder. */
.slip-card { white-space: normal; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 2px 0 6px; max-width: 340px; color: var(--ink); }
.card .slip-card { max-width: 520px; margin-top: 10px; }
.slip-card .sc-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.slip-card .sc-photo { display: block; position: relative; border-radius: 8px; overflow: hidden; background: var(--bg); margin-bottom: 8px; }
.slip-card .sc-photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.slip-card .sc-photo .sc-gone { display: none; padding: 14px; font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.slip-card .sc-photo.gone img { display: none; }
.slip-card .sc-photo.gone .sc-gone { display: block; }
.slip-card .sc-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.slip-card .sc-row { display: grid; grid-template-columns: 18px auto 1fr; column-gap: 8px; align-items: baseline; font-size: calc(13px * var(--fs)); }
.slip-card .sc-k { color: var(--ink-soft); }
.slip-card .sc-v { font-weight: 600; text-align: right; }
.slip-card .sc-why { grid-column: 2 / -1; font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.slip-card .sc-ok { color: var(--ok); font-weight: 700; }
.slip-card .sc-bad { color: var(--danger); font-weight: 700; }
.slip-card .sc-q { color: var(--warn); font-weight: 700; }
.slip-card .sc-note { font-size: calc(12px * var(--fs)); color: var(--muted); line-height: 1.45; }
.msg.has-slip { max-width: 360px; }
.ord-slip { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.server-behind { position: sticky; top: 0; z-index: 100; background: var(--warn); color: #fff; padding: 8px 16px; font-size: calc(13px * var(--fs)); text-align: center; }
.slip-card .sc-ref { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: calc(13px * var(--fs)); margin: 2px 0 2px 26px; }
.slip-card .sc-ref code { font-weight: 700; font-size: calc(14px * var(--fs)); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; user-select: all; }
.slip-card .sc-copy { padding: 3px 10px; font-size: calc(12px * var(--fs)); }
.slip-card > .sc-why { margin: 0 0 8px 26px; font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.shop-link { display: flex; gap: 12px; align-items: flex-start; border-color: var(--brand); }
.shop-link.off { align-items: center; border-color: var(--line); }
.shop-link-url { margin-top: 10px; }
.shop-link-url code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: calc(13px * var(--fs)); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; user-select: all; }
.btn-link { display: inline-flex; align-items: center; text-decoration: none; }

/* A shop opened from /start, not saved yet: how long it has, and the button. */
.guest-bar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: 10px var(--s4); background: var(--brand-soft); color: var(--ink);
  border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs)); line-height: 1.45;
}
.guest-bar span { flex: 1 1 260px; }
.guest-bar .primary { flex: none; }
.save-shop { display: grid; gap: var(--s3); margin-top: var(--s4); }
.save-shop .error:empty { display: none; }
.save-shop .linkish { justify-self: center; }
.ai-hello { color: var(--ink); font-size: calc(17px * var(--fs)); }
/* On a computer, over the content beside the rail. */
@media (min-width: 1024px) {
  .app:has(> .guest-bar) { grid-template-rows: auto auto minmax(0, 1fr); }
  .app:has(> .guest-bar) .tabbar { grid-row: 2 / span 2; }
  .app:has(> .guest-bar) main { grid-row: 3; }
  .guest-bar { grid-column: 2; grid-row: 2; padding-inline: var(--s5); }
}

/* The shop's own link: on Home, and in Settings with its editor. */
.share-shop { display: flex; gap: 14px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(135deg, var(--brand-soft), var(--card) 70%); }
.share-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: var(--card); flex: none; }
.share-sub { font-size: calc(13px * var(--fs)); margin-top: 2px; }
.share-url code, .shop-link-url code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: calc(13.5px * var(--fs)); font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 8px; user-select: all; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.shop-link-edit { margin-top: 12px; }
.shop-link-edit summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: calc(13.5px * var(--fs)); }
.shop-link-edit[open] { display: grid; gap: 10px; }
.slug-field { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding-left: 10px; background: var(--card); }
.slug-field input { border: 0; box-shadow: none; padding-left: 2px; min-width: 0; }
.shop-listed { font-size: calc(12.5px * var(--fs)); margin-top: 10px; }
.pill.web { background: var(--brand-soft); color: var(--brand); }
.channel-row.built-in { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.conv .ctx { font-size: calc(12px * var(--fs)); color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .sub.ctx { margin-top: 2px; }
.name-edit { width: 26px; height: 26px; padding: 0; vertical-align: middle; color: var(--ink-soft); }
.ord-hint { font-size: calc(12.5px * var(--fs)); color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }

/* Products from photos */
.photo-batch .pb-list { display: grid; gap: 10px; }
.photo-batch .pb-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.photo-batch .pb-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--line); }
.photo-batch .pb-fields { display: grid; gap: 6px; min-width: 0; }
.photo-batch .pb-fields input { margin: 0; min-width: 0; }
.photo-batch .pb-note { font-size: calc(12px * var(--fs)); }
.photo-batch .pb-x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.photo-batch .pb-busy { display: flex; align-items: center; gap: 8px; padding: 8px 0; }

/* Linking WhatsApp */
.wa-choice { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.wa-steps { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; }
.wa-code { font: 700 calc(30px * var(--fs)) / 1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; margin: 10px 0 8px; padding: 12px 16px; border-radius: 12px; background: var(--line); display: inline-block; }

/* Sample products */
.sample-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-card .chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; }
.sample-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.flash { animation: flash 1.2s ease-out 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent, #2b8a6e); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ord-hint.warn-hint { color: var(--danger); background: var(--danger-soft); }
.bc-list { margin-top: 12px; display: grid; gap: 6px; }
.bc-row { display: flex; justify-content: space-between; gap: 8px; font-size: calc(13px * var(--fs)); }
.phone-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; }
.phone-row + .phone-row { border-top: 1px solid var(--line); }
.phone-row .muted { font-size: calc(13px * var(--fs)); }
.phone-row button { white-space: nowrap; flex: none; }
.invite-link { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font: 600 calc(14px * var(--fs)) / 1.4 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
a.primary.btn-link { border-radius: var(--radius); }

/* The next step, asked */
.nudge { text-align: center; padding: 8px 4px 4px; }
.nudge-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--brand-soft); color: var(--brand); }
.nudge h2 { margin: 0 0 6px; }
.nudge-actions { display: grid; gap: 8px; margin-top: 16px; }
.nudge-actions .linkish { justify-self: center; }

/* ------------------------------------------------------- small screens
 * Down to a 320px phone, nothing runs off the right edge: a row of pills
 * wraps under the name instead, and long words and addresses break. */
.conv .row { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.conv .name { min-width: 0; overflow-wrap: break-word; }
.thread-head .nm { flex-wrap: wrap; row-gap: 4px; min-width: 0; overflow-wrap: break-word; }
.thread-head .sub, .saved-details { overflow-wrap: anywhere; max-width: 100%; }
/* Six tabs share the width equally whatever their labels say; a long
   Sinhala label shortens rather than pushing Settings off the screen. */
.tabbar { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tabbar button > span:not(.ico):not(.badge) {
  max-width: 100%; padding-inline: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
@media (max-width: 400px) {
  /* The shop's own name matters more than Ordo's in its own app. */
  .home-link { display: none; }
  .topbar { gap: 6px; }
  .topbar .icon-btn { width: 34px; height: 34px; }
  .setup-btn { height: 34px; }
}
/* A card's first line (an order's number, its state and its total) wraps
   as whole pieces: "ORD-0001" and "Rs. 3,300" never break in the middle. */
.card > .row:first-child { flex-wrap: wrap; row-gap: 6px; }
.ord-ref, .ord-total, .card > .row:first-child > strong, .pill { white-space: nowrap; }
@media (max-width: 400px) {
  .guest-bar { padding: 8px var(--s3); gap: 6px var(--s2); font-size: calc(12px * var(--fs)); }
  .guest-bar .small { padding: 6px 10px; }
}
/* Tablets and small laptops: the shop's name stays on one line and shortens,
   and the bar's buttons never break their labels over two lines. */
.shop { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar .ghost, .setup-btn, .home-link, .nav-back { white-space: nowrap; }
.topbar .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
@media (max-width: 1100px) {
  .topbar .who { display: none; }
}
/* A tablet: the setup ring and the AI sparkle say enough on their own, so
   the shop's name gets the room. */
@media (max-width: 900px) {
  .setup-label { display: none; }
  .setup-btn { padding: 0 6px; }
}
@media (max-width: 760px) {
  .home-link { display: none; }
}
/* Money in a table stays on one line: "Rs." never ends up above "2,950". */
.scroll-x td:not(:first-child), .scroll-x th:not(:first-child) { white-space: nowrap; }

/* ---------------------------------------------------------- reselling */
.resell-head { margin-bottom: var(--s4); }
.resell-head .muted { margin: 4px 0 var(--s3); font-size: calc(14px * var(--fs)); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); max-width: 100%; }
.seg button { border: 0; background: none; color: var(--ink-soft); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: calc(14px * var(--fs)); white-space: nowrap; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
.resell-h { font-size: calc(16px * var(--fs)); margin: var(--s5) 0 var(--s3); }
.resell-list { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.resell-list .card { margin: 0; }
.resell-card { display: grid; gap: var(--s2); }
.resell-top { align-items: center; gap: var(--s3); }
.resell-top .grow { flex: 1; min-width: 0; }
.resell-top strong { overflow-wrap: break-word; }
.resell-logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover;
  display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.resell-meta { font-size: calc(12px * var(--fs)); }
.resell-about { margin: 0; color: var(--ink-soft); font-size: calc(13px * var(--fs)); }
.resell-note { margin: 0; font-size: calc(13px * var(--fs)); }
.resell-terms { font-size: calc(12px * var(--fs)); line-height: 1.5; }
.resell-balance { font-size: calc(15px * var(--fs)); }
.resell-balance.big { font-size: calc(18px * var(--fs)); margin: var(--s2) 0 var(--s3); }
.resell-actions { flex-wrap: wrap; gap: 8px; margin-top: var(--s2); }
.resell-join { gap: 8px; flex-wrap: wrap; }
.resell-join input { flex: 1 1 180px; text-transform: uppercase; letter-spacing: 0.08em; }
.resell-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-soft); font-size: calc(14px * var(--fs)); }
.resell-code-box { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); display: grid; gap: 6px; }
.resell-code { font-size: calc(28px * var(--fs)); font-weight: 800; letter-spacing: 0.12em; color: var(--brand); }
.resell-switch { align-items: flex-start; gap: var(--s3); }
.resell-switch .grow { flex: 1; min-width: 0; }
.resell-entry { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.resell-entry .grow { flex: 1 1 220px; min-width: 0; }
.resell-entry .muted { font-size: calc(13px * var(--fs)); }
.resell-hint { background: var(--brand-soft); color: var(--brand); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn, #b45309); }
.resell-terms-form { display: grid; gap: var(--s3); }
.resell-terms-form .check { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.resell-terms-form .check input { width: auto; }
/* What resellers pay, one row a product; on a phone each row stacks. */
.sp-prices { display: grid; gap: 6px; }
.sp-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sp-headrow { font-size: calc(12px * var(--fs)); border-bottom: 0; padding-bottom: 0; }
.sp-name { min-width: 0; overflow-wrap: break-word; font-size: calc(14px * var(--fs)); }
.sp-retail { white-space: nowrap; font-size: calc(14px * var(--fs)); }
.sp-cell input { padding: 8px 10px; }
.sp-lbl { display: none; }
@media (max-width: 640px) {
  .sp-headrow { display: none; }
  .sp-row { grid-template-columns: 1fr 1fr; }
  .sp-name { grid-column: 1 / -1; }
  .sp-retail { grid-column: 1 / -1; color: var(--ink-soft); font-size: calc(13px * var(--fs)); }
  .sp-lbl { display: block; }
}
/* The supplier's catalogue in the sheet. */
.cat-item { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.cat-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--brand-soft); }
.cat-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.cat-meta { font-size: calc(12px * var(--fs)); overflow-wrap: break-word; }
.cat-row { gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.cat-price { flex: 1 1 120px; }
.cat-price input { padding: 8px 10px; }
.cat-earn { font-size: calc(12px * var(--fs)); }
.cat-added { justify-self: start; }
.st-list { display: grid; }
.st-row { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.st-row > div { min-width: 0; }
.st-row strong:last-child { white-space: nowrap; }
.st-sub { font-size: calc(12px * var(--fs)); }
.pay-form { margin: 0 0 var(--s3); }
.resell-terms-form .form-row { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.pay-form .form-row { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }

/* What a shop sells: two ticks, at signup and in Settings. */
.kinds { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; min-width: 0; }
.kinds legend { font-size: calc(13px * var(--fs)); color: var(--ink-soft); font-weight: 500; padding: 0; margin-bottom: 6px; }
.kind {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
  transition: border-color .14s, background .14s;
}
.kind:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.kind input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.kind-text { display: grid; gap: 2px; min-width: 0; }
.kind-text b { font-size: calc(14px * var(--fs)); font-weight: 600; }
.kind-text small { font-size: calc(12px * var(--fs)); color: var(--ink-soft); font-weight: 400; line-height: 1.4; }
#set-kinds { margin: 0 0 var(--s3); }

/* Settings as a short list (app.js SETTINGS_MENU): a row opens one section. */
.settings-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.settings-wrap .settings-nav { display: none; }
.settings-wrap.set-menu .settings-sec,
.settings-wrap.set-menu #shop-link-card { display: none; }
.settings-wrap.set-open .set-group,
.settings-wrap.set-open .set-list,
.settings-wrap.set-open .billing-link,
.settings-wrap.set-open .settings-sec:not(.open) { display: none; }
.settings-wrap.set-open:not([data-open="s-shop"]) #shop-link-card { display: none; }
.settings-wrap.set-open[data-open="s-shop"] #shop-link-card { order: 2; }
.settings-wrap.set-open[data-open="s-shop"] #s-shop { order: 1; }
.set-group { margin: var(--s2) 4px -4px; font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.set-list { padding: 0; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 14px var(--s4); min-height: 64px;
  background: none; border: 0; border-radius: 0; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row:hover { background: var(--bg); }
.set-row:active { background: var(--bg); }
.set-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft, rgba(16,140,110,.1)); }
.set-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.set-text b { font-size: calc(16px * var(--fs)); font-weight: 650; }
.set-text small { font-size: calc(13.5px * var(--fs)); color: var(--ink-soft); line-height: 1.35; }
.set-row .chev { font-size: calc(24px * var(--fs)); color: var(--ink-soft); line-height: 1; }

/* Home: the reports fold away under one row (app.js renderDashboard). */
.more-reports { display: grid; gap: var(--s3); }
.more-reports > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 14px var(--s4); padding-right: 44px; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r, 14px); font-weight: 650; font-size: calc(16px * var(--fs)); }
.more-reports > summary::-webkit-details-marker { display: none; }
.more-reports > summary small { font-weight: 400; font-size: calc(13.5px * var(--fs)); }
.more-reports > summary::after { content: '›'; position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%) rotate(90deg); font-size: calc(24px * var(--fs)); color: var(--ink-soft); transition: transform .2s; }
.more-reports[open] > summary::after { transform: translateY(-50%) rotate(-90deg); }
.more-reports[open] { margin-bottom: var(--s2); }

/* Products: the less common ways to add fold under one line. */
.more-add { display: grid; gap: var(--s3); }
.more-add > summary { list-style: none; cursor: pointer; padding: 12px var(--s4); color: var(--brand); font-weight: 650; font-size: calc(15px * var(--fs)); }
.more-add > summary::-webkit-details-marker { display: none; }
.more-add > summary::before { content: '+ '; }
.more-add[open] > summary::before { content: '− '; }
.pc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sharing products (app.js shareProduct, shareProducts). */
.pc-actions { display: flex; align-items: center; gap: 4px; }
.pc-share { padding: 4px 8px; display: inline-grid; place-items: center; }
.pc-pick { display: none; margin: 0; padding: 4px; cursor: pointer; }
.pc-pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.product-grid.picking .pc-pick { display: inline-flex; }
.product-grid.picking .pc-actions > :not(.pc-pick) { display: none; }
.product-grid.picking .product-card:has([data-pick]:checked) { box-shadow: 0 0 0 2px var(--brand); }
#pick-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin: 0; }
.pick-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 32px -12px rgba(0,0,0,.35); max-width: calc(100vw - 24px); }
.pick-bar .pick-n { font-weight: 650; margin-right: 4px; white-space: nowrap; }
.pick-bar .primary { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 900px) { .pick-bar { bottom: 24px; } }
.product-tools #product-search-input { flex: 1 1 160px; min-width: 0; }
@media (max-width: 560px) {
  .product-tools #pick-toggle { flex: 1 1 100%; justify-content: center; }
  .pick-bar { left: 12px; right: 12px; transform: none; justify-content: flex-end; }
  .pick-bar .pick-n { margin-right: auto; }
}

/* Reselling on product cards (app.js resellTags) and who resells a product (openProductResellers). */
.rs-tags { display: grid; gap: 4px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 4px 10px; border-radius: 999px;
  font: 700 calc(12px * var(--fs))/1.2 var(--font, inherit); border: 1px solid transparent; }
.tag-resell { background: #e8f0fe; color: #1f4fae; border-color: #c9dafc; }
.tag-wholesale { background: #fff3e0; color: #8a4b00; border-color: #ffd9a8; cursor: pointer; }
.tag-wholesale:hover { border-color: #f0b25e; }
html.dark-theme .tag-resell { background: #1b2a44; color: #9cc0ff; border-color: #2c4370; }
html.dark-theme .tag-wholesale { background: #3a2a12; color: #ffc77a; border-color: #5a4220; }
.rs-line { font-size: calc(12.5px * var(--fs)); }
.rsr-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rsr-sum > div { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.rsr-sum span { font-size: calc(12px * var(--fs)); }
.rsr-list { display: grid; gap: 10px; }
.rsr { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.rsr-head { display: flex; align-items: center; gap: 10px; }
.rsr-head .grow { flex: 1; min-width: 0; }
.rsr-head .muted { font-size: calc(13px * var(--fs)); }
.rsr-av { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.rsr-av img { width: 100%; height: 100%; object-fit: cover; }
.rsr-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(13px * var(--fs)); color: var(--ink-soft); }
.rsr-stats b { color: var(--ink); }
.rsr-actions, .rsr-foot { flex-wrap: wrap; gap: 6px; }
.danger-text { color: var(--danger); }

/* QR codes (app.js openQr) and the product Share choice. */
.qr-card { display: grid; place-items: center; padding: 8px; background: var(--bg); border-radius: 16px; }
.qr-card img { width: 100%; max-width: 360px; height: auto; border-radius: 12px; }
.qr-actions, .share-choice { display: grid; gap: 8px; }
.qr-actions .btn-link, .share-choice button, .qr-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-decoration: none; }
[data-qr-shop] { display: inline-flex; align-items: center; gap: 6px; }

/* Orders → To pack: packing one order at a time (renderPacking). */
.pack-start { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.pack-start .grow { flex: 1 1 220px; min-width: 0; }
.pack-start .muted { font-size: calc(13px * var(--fs)); }
.resell-menu-toggle { margin-top: 6px; }
/* Paying resellers: payday, who is owed, and each payout's slip. */
.payouts-card { display: grid; gap: var(--s3); }
.pay-due { padding: var(--s3); border-radius: 12px; background: var(--warn-soft); display: grid; gap: 4px; }
.pay-due strong { color: var(--warn); }
.pay-due.critical { background: var(--danger-soft); }
.pay-due.critical strong { color: var(--danger); }
.pay-due .muted { font-size: calc(13px * var(--fs)); }
.pay-list { display: grid; }
.pay-row { align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pay-row .grow { flex: 1 1 140px; min-width: 0; overflow-wrap: break-word; }
.pay-amt { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.score-line { align-items: center; gap: 6px; flex-wrap: wrap; }
.score-why { font-size: calc(11px * var(--fs)); font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.score-why.good { background: var(--ok-soft); color: var(--ok); }
.score-why.bad { background: var(--danger-soft); color: var(--danger); }
.st-proof { gap: 8px; align-items: center; padding: 0 0 10px; border-bottom: 1px solid var(--line); margin-top: -6px; font-size: calc(13px * var(--fs)); flex-wrap: wrap; }
.st-row:has(+ .st-proof) { border-bottom: 0; }
.slip-add { cursor: pointer; }
.muted.small { font-size: calc(12px * var(--fs)); }
.resell-terms-form [hidden] { display: none; }

/* The account menu behind the avatar, at the far end of the bar. */
.profile { position: relative; flex: none; }
.topbar .spacer { flex: 1; }
.avatar-btn {
  position: relative; width: 36px; height: 36px; padding: 0; border-radius: 999px; flex: none;
  display: inline-grid; place-items: center; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 700; font-size: calc(15px * var(--fs));
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--brand-soft); }
.setup-dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 999px; background: var(--warn); border: 2px solid var(--card); }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 24px)); z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); display: grid; gap: 2px;
  animation: pm-in 0.14s ease-out;
}
@keyframes pm-in { from { opacity: 0; transform: translateY(-4px); } }
.pm-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; }
.pm-avatar { width: 44px; height: 44px; border-radius: 999px; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: calc(18px * var(--fs)); }
.pm-id { min-width: 0; }
.pm-id strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pm-id .who { display: block; }
.pm-shop { display: grid; gap: 2px; padding: 10px 10px; border-top: 1px solid var(--line); font-size: calc(12px * var(--fs)); color: var(--ink-soft); }
.pm-shop strong { color: var(--ink); font-size: calc(14px * var(--fs)); overflow-wrap: anywhere; }
.pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  font-size: calc(14px * var(--fs)); font-weight: 500;
}
.pm-item:hover, .pm-item:focus-visible { background: var(--brand-soft); outline: none; }
.pm-item.danger { color: var(--danger); }
.pm-item.danger:hover { background: var(--danger-soft); }
.pm-item svg { flex: none; color: var(--ink-soft); }
.pm-item.danger svg { color: var(--danger); }
.pm-setup { display: grid; gap: 6px; background: var(--ok-soft); margin: 4px 0; }
.pm-setup:hover { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.pm-setup-top { display: flex; justify-content: space-between; gap: 8px; font-size: calc(13px * var(--fs)); }
.pm-setup-top span { color: var(--ok); font-weight: 600; white-space: nowrap; }
.pm-setup .progress { display: block; height: 6px; margin: 0; }
.contact-list { display: grid; gap: 8px; }
.contact-opt { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.contact-opt:hover { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 560px) {
  .topbar .spacer { display: none; }
}
/* Ordo's reselling fee: bills to pay and this month so far. */
.fees-card { display: grid; gap: var(--s3); }
.fee-bill { align-items: center; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fee-bill .grow { flex: 1 1 160px; min-width: 0; }
.fee-amt { white-space: nowrap; }
.fee-month { display: grid; gap: 2px; }
.fees-card > p { margin: 0; }
/* The language button: a word, not an icon, so it reads in either language. */
.lang-btn { font-weight: 700; font-size: calc(12px * var(--fs)); letter-spacing: 0.02em; }
/* Ordo AI's message box: one line to start, grows as you type, no scroll bar
   until it is full, and a long placeholder stays on one line. */
.ai-row textarea { overflow-y: hidden; scrollbar-width: thin; }
.ai-row textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A section folded under one line (Reselling): tap the line to open it. */
.fold { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg, 16px); margin: var(--s3) 0; }
.fold > summary {
  list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 14px var(--s4); padding-right: 44px; position: relative;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary b { font-size: calc(15px * var(--fs)); }
.fold > summary small { color: var(--ink-soft); font-size: calc(13px * var(--fs)); }
.fold > summary::after {
  content: '›'; position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%) rotate(90deg);
  font-size: calc(24px * var(--fs)); color: var(--ink-soft); transition: transform .2s;
}
.fold[open] > summary::after { transform: translateY(-50%) rotate(-90deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: var(--s3); }
.fold-body > .resell-list { margin: 0; }
/* Sign-in card: back to the site on the left, the language on the right. */
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.login-top .back-home { margin: 0; }
.lang-pill {
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; font-size: calc(13px * var(--fs)); font-weight: 600; cursor: pointer;
}
.lang-pill:hover { color: var(--brand); border-color: var(--brand); }
/* The signup greeting in the page's language only. */
html[lang="en"] .signup-hello [lang="si"], html[lang="si"] .signup-hello [lang="en"] { display: none; }
html[lang="en"] .signup-hello [lang="en"] { font-weight: 700; font-size: calc(18px * var(--fs)); color: var(--ink); }
/* Wholesale fields on the product form (0081). */
.ws-box { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.ws-check { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; color: var(--ink); cursor: pointer; }
.ws-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.ws-check span { display: grid; gap: 2px; }
.ws-check small { color: var(--ink-soft); font-weight: 400; font-size: calc(12.5px * var(--fs)); }
.tag-wsonly { background: var(--warn-soft); color: var(--warn); }
/* Wholesale items: remove link under the name; Add item sheet. */
.sp-stop { display: inline-block; margin-left: 8px; font-size: calc(12px * var(--fs)); }
.aw-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.aw-row { align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.aw-row[hidden] { display: none; }
.aw-row .grow { flex: 1; min-width: 0; }
.aw-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--brand-soft); display: inline-block; }
.ws-more { display: grid; gap: 8px; }
.ws-more[hidden] { display: none; }
.sp-anyone { margin-top: 6px; }
/* Ordo paused the assistant for every shop. */
.paused-bar { background: var(--danger-soft); color: var(--danger); }
.paused-bar strong { color: var(--danger); }

/* ------------------------------------------- messages between two shops */
.chat-btn { display: inline-flex; align-items: center; gap: 6px; }
.chat-unread {
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: calc(11px * var(--fs)); font-weight: 700; padding: 0 6px; min-width: 18px; line-height: 18px; text-align: center;
}
.sheet.lc-sheet { grid-template-rows: auto 1fr auto; align-content: stretch; overflow: hidden; }
@media (max-width: 560px) { .sheet.lc-sheet { height: 86dvh; } }
.lc-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 2px; }
.lc-empty { margin: auto; text-align: center; }
.lc-msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); align-self: flex-start; }
.lc-msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.lc-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.lc-meta { margin-top: 4px; font-size: calc(11px * var(--fs)); color: var(--ink-soft); }
.lc-msg.mine .lc-meta { text-align: right; }
.lc-ref { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.lc-form { display: grid; gap: 8px; }
.lc-about { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: calc(13px * var(--fs)); padding: 6px 10px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.lc-compose { display: flex; gap: 8px; align-items: flex-end; }
.lc-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; overflow-y: auto; scrollbar-width: none; }
.lc-closed { text-align: center; font-size: calc(13px * var(--fs)); }

/* Short authentication steps fit the screen with full-size tap targets.
   Keep overflow available for the keyboard, zoom and very short screens. */
.login { padding: 16px; }
.login-card { width: min(460px, 100%); padding: 32px; gap: 20px; border-color: #dfe8e4; border-radius: 24px; box-shadow: 0 16px 48px #1c47430c, 0 2px 8px #1c474306; }
.auth-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.signup-progress { display: grid; gap: 6px; text-align: right; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.signup-track { display: flex; gap: 4px; }
.signup-track span { height: 3px; width: 40px; background: var(--line); border-radius: 3px; }
.signup-track span:first-child, .last-step .signup-track span { background: var(--brand); }
.auth-intro { display: grid; gap: 5px; }
.auth-intro h1 { margin: 0; font-size: calc(24px * var(--fs)); line-height: 1.35; letter-spacing: -.025em; font-weight: 600; }
.auth-intro p { font-size: calc(13px * var(--fs)); line-height: 1.5; }
#signup-fields, .auth-credentials { display: grid; gap: 12px; min-width: 0; }
.login-card label { min-width: 0; color: var(--ink); }
.login-card input:not([type="checkbox"]) { min-height: 46px; padding: 11px 12px; font-size: 16px; border-radius: 10px; }
.login-card .primary { min-height: 44px; padding: 10px 14px; }
.login-card .kinds { margin: 0; gap: 8px; }
.login-card .kind { padding: 12px 10px; border-radius: 10px; align-items: center; }
.signup-mode #signup-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.signup-mode .kinds { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.signup-mode .kind { gap: 8px; }
.signup-mode .kind-text small { display: block; font-size: calc(11px * var(--fs)); margin-top: 2px; }
.signup-mode .kind input { margin: 0; }
.login-card .error:empty { display: none; }
.login-card .auth-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.login-card .auth-switch .linkish { min-height: 36px; }
.auth-actions { display: flex; gap: 10px; }
.auth-actions .primary { flex: 1; min-width: 0; }
.auth-step-back { min-height: 44px; padding: 10px 16px; }
.auth-password-field { display: grid; gap: 6px; }
.auth-password { position: relative; }
.login-card .auth-password input { padding-right: 48px; }
.auth-password button { position: absolute; top: 1px; bottom: 1px; right: 1px; width: 44px; display: grid; place-items: center; background: transparent; color: var(--ink-soft); border-radius: 9px; }
.auth-password button:hover { color: var(--brand); background: var(--brand-soft); }
.auth-password .eye-slash { display: none; }
.auth-password [aria-pressed="true"] .eye-slash { display: block; }
.login-card :is(button, a):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.login-card .google-area { gap: 8px; }
.login-card .muted { margin: 0; }
@media (max-width: 480px) {
  .login-card { padding: 24px; gap: 16px; border-radius: 20px; }
}
@media (max-height: 700px) {
  .login { padding: 8px 12px; }
  .login-card { padding: 16px; gap: 8px; }
  .auth-intro { gap: 2px; }
  .auth-intro h1 { font-size: calc(21px * var(--fs)); }
  .login-card .auth-switch { padding-top: 6px; }
  #signup-fields, .auth-credentials { gap: 8px; }
  .login-card .kind { padding: 6px 8px; }
  .login-card .kinds { gap: 6px; }
}

/* COD watch on a COD order (src/cod/watch.ts) */
.cod-watch.cod-high { background: color-mix(in srgb, var(--danger) 12%, var(--card)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
