/* Colours: Counterly's own look (src/brand.js, BRAND_COLOURS), so it is never mistaken for Wraperers.
   Basil green for actions, a faintly green paper, a green-black dark mode; soft low shadows, not hard ledges.
   (The variable is still called --orange in code: it means "the main colour".) Light is the default; "Dark" is a
   choice in the profile menu, kept on <html data-theme>. Everything else in this file uses these names. */
:root {
  color-scheme: dark;
  --orange: #3DD68C;        /* basil, bright enough for a dark background */
  --orange-shadow: #1E8F5A;
  --on-accent: #0B1A12;     /* words on something filled with the main colour */
  --accent-text: #6FE3AA;   /* basil words on a dark background */
  --spark: #F5B82E;         /* docket yellow, for small highlights */
  --bg: #0D1411;            /* the canvas behind everything */
  --surface: #16201B;       /* cards, panels, inputs */
  --soft: #121A16;          /* quiet blocks inside a card */
  --text: #ECF3EE;          /* words and outlines */
  --muted: #9AA9A0;
  --on-ink: #0F1F17;        /* words on something filled with --text */
  --card-shadow: transparent;
  --good: #7CCB90;
  --bad: #FF8A80;
  --line: color-mix(in srgb, var(--text) 12%, transparent);        /* thin dividers */
  --line-strong: color-mix(in srgb, var(--text) 22%, transparent); /* outlines of cards, fields and buttons */
  --tint: color-mix(in srgb, var(--orange) 14%, var(--surface));    /* what is picked or current */
  --hover: color-mix(in srgb, var(--text) 6%, var(--surface));
  --glow: color-mix(in srgb, var(--orange) 24%, transparent);       /* around a field being typed in */
  --lift: 0 12px 34px rgba(0, 0, 0, 0.32);                          /* under cards and floating windows */
  --raise: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px -4px rgba(0, 0, 0, 0.35); /* a soft low shadow under buttons and cards */
  --sk: #1F2A25;            /* skeleton shapes while a screen loads, and the light that sweeps over them */
  --sk-shine: #2B3832;
}
:root[data-theme="light"] {
  color-scheme: light;
  --orange: #0F8A5F;
  --orange-shadow: #0A6B49;
  --on-accent: #FFFFFF;
  --accent-text: #0A6B49;
  --bg: #F3F5F1;
  --surface: #FFFFFF;
  --soft: #EEF2EC;
  --text: #0F1F17;
  --muted: #56655C;
  --on-ink: #FFFFFF;
  --card-shadow: transparent;
  --good: #157A3B;
  --bad: #B3261E;
  --lift: 0 10px 28px rgba(15, 31, 23, 0.10);
  --raise: 0 1px 2px rgba(15, 31, 23, 0.06), 0 4px 14px -6px rgba(15, 31, 23, 0.16);
  --sk: #E3E8E2;
  --sk-shine: #F3F6F2;
}

* { box-sizing: border-box; }
.feature-new { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--tint); color: var(--accent-text); font-size: 0.68rem; font-weight: 700; line-height: 1.5; letter-spacing: 0.02em; white-space: nowrap; }
.side-nav .feature-new { margin-left: auto; }
body.side-folded .side-nav .feature-new { display: none; }
.inventory-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.inventory-stat { display: grid; grid-template-columns: 24px 1fr; gap: 8px 12px; padding: 18px; text-align: left; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.inventory-stat > span { color: var(--muted); font-size: 0.85rem; }
.inventory-stat > strong { grid-column: 2; font-size: 1.8rem; line-height: 1; }
.inventory-stat.selected { border-color: var(--orange); background: var(--tint); }
.inventory-stat.selected .icon { color: var(--accent-text); }
.inventory-toolbar, .inventory-save, .saved-view-form, .saved-view-list, .ops-section-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.inventory-toolbar { justify-content: space-between; margin-bottom: 16px; }
.inventory-toolbar .search { flex: 1 1 260px; }
.inventory-threshold { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.inventory-threshold input { width: 100px; margin: 0; }
.inventory-save { position: sticky; top: 70px; z-index: 4; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--lift); }
.inventory-save > span { flex: 1; min-width: 130px; }
.inventory-list { margin-top: 20px; }
.inventory-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.inventory-product { display: flex; align-items: center; gap: 14px; min-width: 0; }
.inventory-product > div { min-width: 0; overflow-wrap: anywhere; }
.inventory-product .hint { margin: 3px 0 0; }
.inventory-row > input { margin: 0; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.inventory-threshold input, .saved-view-form input { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.inventory-row > .tag { justify-self: start; }
.inventory-product > .icon { width: 44px; height: 44px; padding: 10px; background: var(--soft); border-radius: 8px; flex-shrink: 0; }
.saved-views { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.saved-views > .hint { margin-bottom: 0; }
/* An order's pickup or delivery time, and the customer's note (allergies), at the top where the kitchen sees them. */
.order-when { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-2, rgba(0, 0, 0, .05)); font-size: 1.05rem; }
.order-note { margin: 12px 0; padding: 12px 16px; border-radius: 12px; border: 2px solid #C77700; background: rgba(255, 176, 32, .14); }
.order-note p { margin: 4px 0 0; white-space: pre-wrap; }
.order-view-tools { margin: 16px 0; }
.order-view-tools > summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; font-weight: 600; }
.order-view-tools > summary::before { content: "+"; font-size: 1.2rem; }
.order-view-tools[open] > summary::before { content: "−"; }
.merchant-cases { display: grid; gap: 18px; margin-top: 24px; }
.merchant-cases .block { margin: 0; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line-strong); border-radius: 12px; }
.merchant-cases .field { max-width: 540px; }
.merchant-cases .page-head h2 { margin: 0; }
.merchant-cases article > .button { margin: 8px 8px 0 0; }
.merchant-cases .field input[type="checkbox"] { width: 20px; height: 20px; }
.saved-views details form { margin-top: 14px; }
.page textarea { display: block; width: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.saved-view-form { margin-top: 12px; }
.saved-view-form input { width: min(100%, 260px); margin: 0; }
.saved-view-list { margin-top: 12px; }
.saved-view { display: inline-flex; align-items: center; gap: 3px; }
.view-remove { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .view-remove:hover { color: var(--bad); background: var(--hover); } }
.inventory-stat:focus-visible, .view-remove:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
@media (max-width: 640px) {
  .inventory-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .inventory-stat { padding: 12px; gap: 8px; }
  .inventory-row { grid-template-columns: minmax(0, 1fr) 100px; gap: 10px; }
  .inventory-row > .tag { grid-column: 1; grid-row: 2; margin-left: 58px; }
  .inventory-row > input { grid-column: 2; grid-row: 1 / 3; }
  .inventory-save { top: 64px; }
}
/* Links take the text colour unless a rule below says otherwise (the browser's own blue is unreadable on dark). */
a { color: var(--text); }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.card {
  width: 100%;
  max-width: 560px;
  padding: 32px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--raise);
}

/* The logo line on the small sign-in card. (Named narrowly: "brand" is also a kind of team.) */
.card > .brand {
  margin: 0 0 12px;
  font-weight: 650;
  color: var(--orange);
  letter-spacing: 0.02em;
}

h1 { margin: 0 0 12px; font-size: 1.7rem; line-height: 1.15; }
h2 { margin: 24px 0 6px; font-size: 1.05rem; }
p { margin: 0 0 10px; line-height: 1.45; }

.hint { color: var(--muted); font-size: 0.92rem; }

.field { display: block; margin: 14px 0; }
.field span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
.field input,
.choice input,
.opt-row input,
.field select,
select.small {
  width: 100%;
  padding: 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.field input:focus-visible,
.choice input:focus-visible,
.opt-row input:focus-visible,
select:focus-visible,
.button:focus-visible,
.link:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.button {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 650;
  color: var(--on-accent);
  background: var(--orange);
  border: 0;
  border-radius: 12px;
  box-shadow: var(--raise);
  cursor: pointer;
}
.button:active { transform: translateY(2px); box-shadow: var(--raise); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.link {
  display: block;
  margin-top: 14px;
  padding: 0;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.error { min-height: 1.3em; margin: 0 0 6px; color: var(--bad); font-weight: 600; font-size: 0.92rem; }

.qr { display: block; width: 200px; height: 200px; margin: 14px auto; border-radius: 8px; }

.secret {
  display: block;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.95rem;
  word-spacing: 0.2em;
  overflow-wrap: anywhere;
}

.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 14px;
  list-style: none;
  background: var(--bg);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}

.check { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; }
.tag { padding: 3px 10px; background: var(--bg); border-radius: 999px; font-size: 0.82rem; }

.status {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.9rem;
}
.status.bad { background: #FBDCD5; }

select.small { width: auto; padding: 6px 8px; border-radius: 8px; font-size: 0.88rem; }
.link.inline { display: inline; margin: 0; text-align: left; }
.link.danger { color: var(--bad); }
.actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li > div:first-child { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Signed-in pages: a menu down the side, a bar across the top, the page between ---------- */
/* The look follows the "Warm Neo-Brutalist Craft" design: 2px ink outlines, white cards on a bone
   background, and flat hard shadows (ink for cards, rust for the main actions). No blur anywhere. */
body.app { display: block; padding: 0; }
body.app .card { max-width: none; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body.app .card > .brand { display: none; }
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.icon { flex: none; width: 20px; height: 20px; }

/* The logo, as on the original design: the orange tile with the ink W, and the name in lowercase orange. */
.logo, .card > .brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.45rem; font-weight: 800; line-height: 1; color: var(--orange); text-decoration: none; letter-spacing: -0.04em; }
.logo-mark { flex: none; width: 32px; height: 32px; }
.logo-mark { background: url("/icons/mark.svg") center / contain no-repeat; border-radius: 9px; }

.side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; height: 100vh; height: 100dvh; padding: 16px 12px 12px; background: var(--surface); border-right: 1px solid var(--line-strong); overflow-y: auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 8px; }
.side-fold { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .side-fold:hover { color: var(--text); background: var(--bg); } }
.side-fold:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.side-site-letter { display: none; }
.side-back { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 0.86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.side-back .icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .side-back:hover { color: var(--text); } }
.side-site { display: flex; flex-direction: column; gap: 4px; padding: 12px; color: var(--text); text-decoration: none; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 0 0 transparent; overflow-wrap: anywhere; }
.side-site-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-site .hint { font-size: 0.8rem; }
.side-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.side-group { display: flex; flex-direction: column; gap: 4px; }
.side-title { margin: 4px 0 2px; padding: 0 10px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side-nav .side-group a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; font-weight: 600; color: var(--muted); text-decoration: none; border: 2px solid transparent; border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { .side-nav .side-group a:hover { color: var(--text); background: var(--bg); } }
.side-nav .side-group a[aria-current="page"] { color: var(--on-ink); font-weight: 650; background: var(--text); border-color: var(--text); box-shadow: var(--raise); }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-badge { flex: none; padding: 1px 8px; font-size: 0.74rem; font-weight: 600; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px; }
.side-badge.hot { color: var(--on-accent); background: var(--orange); }
.side-dot { flex: none; width: 9px; height: 9px; background: #1E7B34; border-radius: 50%; }
.side-me { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; margin: 0 -12px -12px; padding: 12px; border-top: 1px solid var(--line-strong); }
.side-me-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.side-me-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 0.86rem; }
.side-me-links a, .side-me-links .link { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 0; font-size: inherit; font-weight: 600; color: var(--muted); text-decoration: none; }
.side-me-links .icon { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .side-me-links a:hover, .side-me-links .link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; } }
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-weight: 650; color: var(--on-ink); text-decoration: none; background: var(--text); border: 1px solid var(--line-strong); border-radius: 50%; }
.avatar.platform { background: var(--orange); color: var(--on-accent); }
.avatar.agency { background: #2A5BD7; color: #fff; }
.avatar.brand { background: #1E7B34; color: #fff; }

/* Who someone is: the platform team (orange), an agency (blue), a brand (green). The same colours everywhere. */
.role-tag { display: inline-block; align-self: flex-start; max-width: 100%; padding: 2px 10px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text); background: var(--bg); border: 1.5px solid currentColor; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.role-tag.platform { background: #D5F2E3; color: #0A6B49; }
.role-tag.agency { background: #DCE6FB; color: #1B3C8F; }
.role-tag.brand { background: #DDF3E0; color: #14501F; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px 12px; min-height: 60px; padding: 8px clamp(14px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.topbar-site { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-gap { flex: 1; }
.topbar .button.small { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
/* Only the labels sitting directly in the bar: the profile menu inside it lines its own up to the left. */
.topbar > .role-tag, .topbar > .tag { align-self: center; }
.topbar-logo { display: none; }

/* The side menu folded down to a strip of icons (a choice remembered on this device). */
@media (min-width: 901px) {
  body.side-folded .shell { grid-template-columns: 72px minmax(0, 1fr); }
  body.side-folded .side { align-items: center; padding-inline: 10px; overflow-x: hidden; }
  body.side-folded .side-top { flex-direction: column; padding: 0; }
  body.side-folded .logo-full, body.side-folded .side-label, body.side-folded .side-title, body.side-folded .side-badge,
  body.side-folded .side-back span, body.side-folded .side-site-top, body.side-folded .side-site .hint,
  body.side-folded .side-me-text, body.side-folded .side-me-links span { display: none; }
    body.side-folded .side-nav, body.side-folded .side-group { align-items: center; width: 100%; }
  body.side-folded .side-nav .side-group a { justify-content: center; width: 48px; padding: 8px; }
  body.side-folded .side-nav .side-group a .side-dot { position: absolute; margin: -22px -22px 0 0; }
  body.side-folded .side-site { align-items: center; width: 48px; padding: 6px; }
  body.side-folded .side-site-letter { display: grid; place-items: center; width: 32px; height: 32px; font-weight: 650; }
  body.side-folded .side-me { display: flex; flex-direction: column; align-items: center; margin: 0 -10px -12px; padding: 10px 0; }
  body.side-folded .side-me-links { flex-direction: column; align-items: center; gap: 6px; }
}
.topbar .button .icon { width: 16px; height: 16px; }
.menu-button { display: none; place-items: center; width: 44px; height: 44px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.shade { display: none; }
.page { max-width: 1040px; margin: 24px auto 56px; padding: clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--lift); }
.main > .page { width: calc(100% - 2 * clamp(12px, 3vw, 32px)); }
body.wide .page { max-width: 1500px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 8px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 6px; }
.page-head .hint { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.eyebrow { margin: 0 0 8px; }

/* Home: sites as cards, and the welcome for someone with no store yet */
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 0; padding: 0; list-style: none; }
.site-cards li { display: flex; }
.site-card { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; transition: transform 0.08s, box-shadow 0.08s; }
@media (hover: hover) and (pointer: fine) { .site-card:hover { transform: translate(-1px, -1px); box-shadow: var(--raise); } }
.site-card:active { transform: translate(2px, 2px); box-shadow: 0 0 0 transparent; }
.site-letter { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.2rem; font-weight: 650; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; }
/* Name and address stay on one line each (cut with "…" if long), so every card is the same height. */
.site-card-text { display: flex; flex-direction: column; min-width: 0; }
.site-card-text strong, .site-card-text .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .tag { grid-column: 2; justify-self: start; }
.welcome { padding: clamp(20px, 4vw, 36px); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--raise); }
.welcome h2 { margin: 0 0 6px; font-size: 1.5rem; }
.welcome-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 18px 0 22px; padding: 0; list-style: none; }
.welcome-steps li { display: flex; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.welcome-steps .hint { margin: 2px 0 0; }
.welcome-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-weight: 650; color: var(--on-ink); background: var(--text); border-radius: 50%; }
.welcome .button { width: auto; display: inline-block; text-decoration: none; }

/* A site's home */
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 20px; padding: 12px 16px; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 12px; }
.live-bar a { color: var(--accent-text); font-weight: 600; }
.live-dot { flex: none; width: 10px; height: 10px; background: var(--muted); border-radius: 50%; }
.live-bar.on .live-dot { background: #1E7B34; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 20px 0 0; padding: 0; list-style: none; }
.stats li { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; }
.stats li.hot { box-shadow: var(--raise); }
.stat-label, .caps, .table-head { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1.9rem; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; }
.stat-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.86rem; }
.stat-foot .hint { margin: 0; font-size: inherit; }
.stat-foot a { font-weight: 600; color: var(--accent-text); }
.stats li.hot .stat-foot .hint { color: var(--accent-text); font-weight: 600; }

.guide { margin-top: 24px; padding: 20px; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--raise); }
.guide-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; }
.guide-head h2 { margin: 0; font-size: 1.2rem; }
.guide-head .hint, .guide-percent { margin: 2px 0 0; }
.guide-percent { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.guide-percent strong { font-size: 1.1rem; color: var(--text); }
.guide-bar { height: 10px; margin: 12px 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.guide-bar span { display: block; height: 100%; background: var(--orange); }
.guide-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.guide-steps li.next { align-items: flex-start; box-shadow: var(--raise); }
.guide-steps .tick { flex: none; display: grid; place-items: center; width: 32px; height: 32px; font-weight: 650; border: 1px solid var(--line-strong); border-radius: 50%; }
.guide-steps .done .tick { color: #1E7B34; border-color: #1E7B34; background: #DDF3E0; }
.guide-steps .next .tick { color: #0F1F17; background: #D5F2E3; }
.guide-text { flex: 1; min-width: 0; }
.guide-text .hint { margin: 4px 0 0; }
.guide-steps a.tag, .guide-steps .button { flex: none; text-decoration: none; }

.two-up { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 24px; }
.two-up > :only-child { grid-column: 1 / -1; }
.block { margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 0 0 transparent; }
.page .two-up > section { margin-top: 0; }
.block.soft { margin-top: 20px; padding: 14px; background: var(--soft); box-shadow: none; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.block.soft .block-head { margin-bottom: 10px; padding-bottom: 0; border-bottom: 0; }
.block-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.block-head h2 .icon { color: var(--accent-text); }
.block-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.block-head a .icon { width: 16px; height: 16px; }

/* Rows: one clickable line per thing (an order, a page). Tables add a header on top. */
.rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rows .row { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--text); text-decoration: none; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 12px; }
@media (hover: hover) and (pointer: fine) { .rows a.row:hover { background: var(--bg); } }
.rows.compact { gap: 8px; }
.rows.compact .row { padding: 9px 10px; background: var(--surface); border: 1.5px solid var(--bg); }
.row-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.row-main .hint { margin: 0; font-size: 0.86rem; }
.table { margin-top: 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; overflow: hidden; }
.table-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--text); background: var(--bg); border-bottom: 1px solid var(--line-strong); }
.table .rows { gap: 0; }
.table .rows li + li { border-top: 1px solid var(--line); }
.table .rows .row { padding: 14px 16px; background: var(--surface); border: 0; border-radius: 0; }
@media (hover: hover) and (pointer: fine) { .table .rows a.row:hover, .table .rows li.row:hover { background: var(--soft); } }
.table-foot { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line-strong); }
.table.products .table-head, .table.products .rows .row { display: grid; grid-template-columns: 44px minmax(260px, 3fr) minmax(84px, .8fr) 96px minmax(120px, 1.1fr) 36px; align-items: center; gap: 12px; }
.row-move { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.row-move .link { padding: 2px 8px; text-decoration: none; font-weight: 650; }
.row-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-product .row-main { align-items: flex-start; gap: 5px; }
.row-product a { font-weight: 600; color: var(--text); }
.row-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.row-cell.price { flex-direction: column; align-items: flex-start; gap: 0; }
.row-cell.price strong { font-size: 1.05rem; }
.stock { padding: 2px 8px; font-size: 0.8rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; white-space: nowrap; }
.stock.low { color: #18191C; background: #FFE8C7; border-color: #6E4900; }
.stock.none { color: #B3261E; background: #FDE8E7; border-color: #B3261E; }

.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 20px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 40px; padding: 6px 16px; font: inherit; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.tab.on { color: var(--on-ink); background: var(--text); box-shadow: var(--raise); }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.search:focus-within { box-shadow: 0 0 0 3px var(--glow); }
.search input { flex: 1; min-width: 0; min-height: 40px; padding: 0; font: inherit; color: var(--text); background: transparent; border: 0; outline: none; }
.pill-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.pill-cards a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .pill-cards a:hover { box-shadow: 0 0 0 transparent; } }
.pill-cards .hint { margin: 0; font-size: 0.82rem; }

.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.extras li { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; }
.extras .hint { flex: 1; margin: 0; }
.extra-icon { display: grid; place-items: center; width: 40px; height: 40px; color: #18191C; background: #DDF3E0; border: 1px solid var(--line-strong); border-radius: 10px; }
.extras li:nth-child(2) .extra-icon { background: #FFF1CC; }
.extras li:nth-child(3) .extra-icon { background: #DCE6FB; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 20; top: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.18s; }
  .shell.menu-open .side { transform: none; box-shadow: 6px 0 0 rgba(24, 25, 28, 0.2); }
  .shell.menu-open .shade { display: block; position: fixed; z-index: 15; inset: 0; background: rgba(24, 25, 28, 0.45); border: 0; }
  .menu-button { display: grid; }
  .topbar-logo { display: inline-flex; }
  .topbar-logo .logo-full { display: none; }
  .topbar .button.small span, .side-fold { display: none; }
  .two-up { grid-template-columns: minmax(0, 1fr); }
  .page { margin: 14px auto 40px; box-shadow: var(--lift); }
  .table.products .table-head { display: none; }
  .table.products .rows .row { grid-template-columns: 36px minmax(0, 1fr); }
  .table.products .rows .row > .row-cell { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .side, .site-card, .button { transition: none; } }

.page section { margin-top: 28px; }
.page section > h2 { margin-top: 0; }
.list a { color: var(--text); font-weight: 600; }
a.link { display: inline-block; }
a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.empty { padding: 18px; background: var(--bg); border-radius: 12px; }
.empty p { margin: 4px 0 0; }

@media (max-width: 480px) {
  .card { padding: 22px 18px; }
  .who { order: 3; flex-basis: 100%; }
}

.field .suffix { display: block; margin: -2px 0 6px; font-weight: 400; }
.good { color: var(--good); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }
.field .hint:last-child { margin: 6px 0 0; min-height: 1.3em; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 8px 0 24px; }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { color: var(--text); font-weight: 600; }

/* ---------- Site screens: pages, editor, settings, images ---------- */
/* Hidden from the eye, still there for screen readers and for "choose a file" inputs. The sizes are
   !important because form fields have their own width rules, which once made a hidden file input a
   whole screen wide and let every page with an Upload button slide sideways on a phone. */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.button.small { width: auto; margin: 0; padding: 9px 14px; font-size: 0.9rem; box-shadow: var(--raise); }
.button.file { display: inline-block; cursor: pointer; }
.button.file:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.button.busy { opacity: 0.5; pointer-events: none; }

.tag.ok { background: #DDF3E0; }
.tag.warn { background: #FFE8C7; }

.panel { margin: 10px 0; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.panel[open] { padding-bottom: 14px; }
.panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.panel > summary:focus-visible, .subitem > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.panel.is-hidden > summary { color: var(--muted); }

.field > label > span, .field > span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
.field textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; resize: vertical;
}
.field textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; tab-size: 2; white-space: pre; overflow: auto; }
.field textarea:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.field input:disabled, .field textarea:disabled { background: var(--bg); color: var(--muted); }

.sublist { margin: 14px 0; padding: 12px; background: var(--bg); border-radius: 10px; }
.sublist-title { margin: 0 0 8px; font-weight: 600; font-size: 0.92rem; }
.subitem { margin: 6px 0; padding: 0 12px; background: var(--surface); border-radius: 8px; }
.subitem[open] { padding-bottom: 10px; }
.subitem > summary { padding: 9px 0; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }

.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; }
.add-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.add-row select { flex: 1; min-width: 0; padding: 9px; font: inherit; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }

.seg { display: inline-flex; margin: 8px 0; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { padding: 7px 14px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text); background: var(--surface); border: 0; cursor: pointer; }
.seg button[aria-pressed="true"] { color: var(--on-ink); background: var(--text); }
.seg button:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }

/* The page editor uses the whole window: form on the left, preview on the right. */

.editor-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.editor-head h1 { margin: 6px 0 0; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.editor-actions .error { margin: 0; min-height: 0; }
.editor { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-preview { position: sticky; top: 76px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; }
.preview-wrap { height: 72vh; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.preview-frame { display: block; width: 100%; height: 100%; margin: 0 auto; background: #fff; border: 0; }
.preview-wrap.mobile .preview-frame { width: 390px; max-width: 100%; border-inline: 1px solid var(--line-strong); }
/* The desktop preview is drawn 1280px wide and shrunk to fit (see fitPreview), so it must not be capped. */
.preview-wrap:not(.mobile) .preview-frame { max-width: none; }
/* ---------- The preview sits inside a picture of a device ---------- */
/* Computer view: a laptop. A dark bezel with a camera dot, and the laptop's base underneath. */
.device { max-width: 100%; margin: 0 auto; }
.device-body { position: relative; margin: 0 3%; padding: 22px 10px 10px; box-shadow: 0 0 0 2px #45474d; background: #1b1c1f; border-radius: 16px 16px 4px 4px; }
.device-body::before { content: ""; position: absolute; top: 8px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #45474d; }
.device .preview-wrap { border: 0; border-radius: 3px; background: #fff; }
/* A real MacBook screen is 16:10. The page is drawn 1280 wide (see fitPreview), so the site inside
   sees 1280 x 800, like a 13-inch MacBook. The laptop is kept narrow enough for all of it, base
   included, to fit in the window's height. */
.device:not(:has(.preview-wrap.mobile)) { max-width: max(420px, calc((100vh - 250px) * 1.6)); max-width: max(420px, calc((100dvh - 250px) * 1.6)); }
.device .preview-wrap:not(.mobile) { height: auto; aspect-ratio: 16 / 10; }
.device-status, .device-home { display: none; }
.device-base { position: relative; height: 14px; background: linear-gradient(#e6e7ea, #b3b5ba); border-radius: 2px 2px 14px 14px; box-shadow: 0 2px 0 #8d8f94; }
.device-base::before { content: ""; position: absolute; top: 0; left: 42%; width: 16%; height: 6px; background: #c6c8cd; border-radius: 0 0 8px 8px; }
/* Phone view: an iPhone Pro (6.3 inch). Its screen is 402 x 874 points: a 59-point status bar with the
   pill, then the page, 402 wide. If it doesn't fit, the whole phone is shrunk (see fitPhone). */
.device:has(.preview-wrap.mobile) { width: 426px; max-width: none; }
.device:has(.preview-wrap.mobile) .device-body { margin: 0; padding: 12px; background: #0e0f11; border-radius: 67px; box-shadow: inset 0 0 0 2px #45474d; }
.device:has(.preview-wrap.mobile) .device-body::before, .device:has(.preview-wrap.mobile) .device-base { display: none; }
.device:has(.preview-wrap.mobile) .device-status { position: relative; display: flex; align-items: center; justify-content: space-between; height: 59px; padding: 6px 30px 0 44px; background: #fff; color: #111; font-size: 17px; font-weight: 700; border-radius: 55px 55px 0 0; }
.device-status .island { position: absolute; top: 11px; left: 50%; width: 126px; height: 37px; margin-left: -63px; background: #0e0f11; border-radius: 19px; }
.device-status img { display: block; width: 72px; height: 15px; }
.device .preview-wrap.mobile { height: 815px; border-radius: 0 0 55px 55px; }
.device .preview-wrap.mobile .preview-frame { width: 100%; max-width: none; border-inline: 0; }
.device:has(.preview-wrap.mobile) .device-home { display: block; position: absolute; bottom: 20px; left: 50%; width: 144px; height: 5px; margin-left: -72px; background: rgba(0, 0, 0, 0.55); border-radius: 3px; pointer-events: none; }
@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; }
  .preview-wrap { height: 60vh; }
}

.colours { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.colour { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.92rem; }
.colour input { width: 44px; height: 36px; padding: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.thumb { display: block; max-width: 180px; max-height: 90px; margin: 4px 0; background: var(--bg); border-radius: 8px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 4px 12px 10px; margin: 6px 0; background: var(--surface); border-radius: 8px; }
.menu-row .row-actions { grid-column: 1 / -1; margin-top: 0; }
.save-row { margin-top: 28px; }

.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin: 20px 0; padding: 0; list-style: none; }
.images li { min-width: 0; overflow-wrap: anywhere; }
.images img, .images video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); border-radius: 10px; }

/* ---------- Admin ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 4px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tabs a { color: var(--text); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .tabs a:hover { text-decoration: underline; } }
.tabs a[aria-current="page"] { color: var(--accent-text); text-decoration: underline; text-underline-offset: 6px; }
.filters form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 12px; align-items: end; }
.filters .error { grid-column: 1 / -1; order: 9; }
.filters .button { width: auto; margin-bottom: 14px; }
.list.log li { align-items: flex-start; }
@media (max-width: 600px) { .filters form { grid-template-columns: 1fr; } }

/* ---------- Sign-in extras ---------- */
.human { min-height: 65px; margin: 14px 0; font-size: 0.9rem; }
.or { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* ---------- Choosing a photo inside the page editor ---------- */
.images.pick { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }
.pick-btn { display: block; width: 100%; padding: 0; background: none; border: 2px solid transparent; border-radius: 10px; cursor: pointer; }
.pick-btn:focus-visible { border-color: var(--orange); outline: none; }
@media (hover: hover) and (pointer: fine) { .pick-btn:hover { border-color: var(--orange); outline: none; } }
/* Videos too (bug report 29: a video showed at its own size and filled the panel). */
.pick-btn img, .pick-btn video { height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.pick-btn video { pointer-events: none; }

/* ---------- Shop: products ---------- */
.list.products li { gap: 14px; }
.list.products li > div:first-of-type { flex: 1; min-width: 0; }
.mini { flex: none; width: 52px; height: 64px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); }
.mini.none { display: block; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.images.photos { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.images.photos img { aspect-ratio: 4 / 5; }
.choice { display: grid; grid-template-columns: 1fr 130px 80px; gap: 10px; align-items: center; margin: 8px 0; }
.choice.head { margin-bottom: 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.choice input { padding: 10px; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } .choice { grid-template-columns: 1fr 90px 70px; } }
/* Options (Colour, Size) and the grid of combinations made from them. */
.opt-row { display: grid; grid-template-columns: 160px 1fr 80px; gap: 10px; align-items: center; margin: 8px 0; }
.opt-row.head { margin-bottom: 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.opt-row input { padding: 10px; }
.choice.multi { grid-template-columns: minmax(90px, 1fr) 100px 100px 100px 130px 70px; margin: 6px 0; }
.choice.multi .choice-name { font-weight: 600; overflow-wrap: anywhere; }
.choice.opt-bulk { grid-template-columns: 130px auto; justify-content: start; }
.opt-photos h4 { margin: 20px 0 4px; }
.opt-photo { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 220px) 40px; gap: 10px; align-items: center; margin: 8px 0; }
.opt-thumb { width: 40px; height: 50px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 6px; }
@media (max-width: 720px) {
  .opt-row { grid-template-columns: 1fr 2fr auto; }
  .opt-row.head { display: none; }
  .choice.multi { grid-template-columns: 1fr 1fr 70px; padding: 10px 0; border-top: 1px solid var(--line); }
  .choice.multi .choice-name { grid-column: 1 / -1; }
  .choice.multi.head { display: none; }
}
a.button.small { text-decoration: none; }
.list.products .check { display: flex; align-items: center; gap: 12px; margin: 0; flex: 1; }

/* ---------- Themes ---------- */
.swatch { display: block; width: 80px; height: 20px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chips .chip { padding: 5px 12px; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.chips .chip.on { background: var(--text); color: var(--on-ink); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 8px; padding: 0; list-style: none; }
.theme { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.theme.on { box-shadow: 0 0 0 3px var(--orange); }
.theme:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .theme:hover { outline: 3px solid var(--orange); outline-offset: 2px; } }
/* A small picture of the page: the real page at computer width, shrunk to the card. */
.theme-thumb { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line-strong); cursor: pointer; }
.theme-thumb .swatch { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.theme-shot { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.theme-card { display: block; width: 100%; flex: 1; padding: 10px 12px 12px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 0; cursor: pointer; }
.theme-card strong { display: block; }
.theme-card .hint { display: block; margin: 4px 0 0; font-size: 0.82rem; }
.theme-card:focus-visible { outline: none; }
.field.colour { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.colour span { margin: 0; }
.field.colour input { width: 64px; height: 40px; padding: 2px; }
/* The "Add a section" chooser: a window over the page with a picture of each kind of section. */
.chooser { width: min(1180px, 94vw); max-height: 88vh; padding: 20px 24px 24px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; overflow-y: auto; }
.chooser::backdrop { background: rgba(24, 25, 28, 0.55); }
.chooser-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chooser-head h2 { margin: 0; }
.chooser .themes { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 16px; }
.theme-thumb.wide { aspect-ratio: 16 / 10; }
/* The theme screen: the theme being looked at on top, every other theme below, four across. */
.theme-now { margin-bottom: 28px; scroll-margin-top: 76px; }
.theme-name { margin-bottom: 14px; }
.theme-name h2 { margin: 8px 0 2px; }
.theme-name .hint { margin: 0; }
.themes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 420px) { .themes { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Getting started ---------- */
.panel.start { padding: 4px 16px 12px; }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; font-weight: 650; font-size: 0.9rem; }
.steps li.done .tick { background: var(--text); color: var(--on-ink); }
.steps li.done { color: var(--muted); }
.steps a { font-weight: 600; color: var(--text); }
.steps .hint { margin: 2px 0 0; }

/* Orders: the search row (the status buttons reuse .chips from the theme picker) */
.search-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.search-row input { flex: 1 1 220px; min-height: 44px; padding: 8px 12px; border: 2px solid #18191c; border-radius: 10px; font: inherit; background: var(--surface); color: #18191c; }

/* ---------- Shared pieces, restyled to the design (these come last so they win) ---------- */
h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
h2 { font-size: 1.06rem; font-weight: 650; letter-spacing: -0.01em; }
.hint { color: var(--muted); }
.card { box-shadow: var(--raise); }

/* Buttons: orange with ink text and a hard rust shadow; they lift on hover and press down on click. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; font-weight: 650; color: var(--on-accent); text-decoration: none; background: var(--orange); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--raise); transition: transform 0.08s, box-shadow 0.08s; }
@media (hover: hover) and (pointer: fine) { .button:hover { transform: translate(-1px, -1px); box-shadow: var(--raise); } }
.button:active { transform: translate(2px, 2px); box-shadow: var(--raise); }
.button:disabled { transform: none; box-shadow: var(--raise); }
.button.small { min-height: 38px; padding: 6px 14px; font-size: 0.9rem; box-shadow: var(--raise); }
@media (hover: hover) and (pointer: fine) { .button.small:hover { box-shadow: var(--raise); } }
.button.small:active { box-shadow: var(--raise); }
.button .icon { width: 17px; height: 17px; }
.button.plain { color: var(--text); background: var(--surface); box-shadow: var(--lift); }
@media (hover: hover) and (pointer: fine) { .button.plain:hover { box-shadow: var(--lift); } }
.button.plain:active { box-shadow: var(--lift); }
.button.wide { width: 100%; justify-content: space-between; margin-top: 10px; }
.button.wide.centre { justify-content: center; }

/* Fields: the focus ring is a hard orange shadow instead of the browser's glow. */
.field span { font-size: 0.94rem; }
.field input, .choice input, .opt-row input, .field select, .field textarea, select.small { min-height: 44px; }
.field input:focus-visible, .choice input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--glow); }

/* Tags: small outlined pills. */
.tag { display: inline-block; padding: 2px 10px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap; }
.tag.ok { color: #1E7B34; background: #DDF3E0; border-color: #1E7B34; }
.tag.warn { color: #6E4900; background: #FFE8C7; border-color: #6E4900; }
.tag.bad { color: #9B1C1C; background: #FBE0DD; border-color: #9B1C1C; }
a.tag { text-decoration: none; }

/* Notices, panels and lists */
.status { padding: 10px 16px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; }
.status.bad { color: #18191C; background: #FDE8E7; border-color: #B3261E; }
.empty { background: var(--soft); border: 1px dashed var(--line-strong); border-radius: 14px; }
.panel { border-radius: 12px; box-shadow: 0 0 0 transparent; }
.panel > summary { font-weight: 650; }
.list li { padding: 12px 4px; border-bottom: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .list li:hover { background: var(--soft); } }
.mini { border-radius: 10px; }
.mini.none { display: grid; place-items: center; color: var(--muted); background: var(--bg); }
.seg { box-shadow: 0 0 0 transparent; }
.chips .chip { min-height: 36px; padding: 5px 14px; }
.chips .chip.on { box-shadow: var(--raise); }
.theme { box-shadow: 0 0 0 transparent; }
.theme.on { box-shadow: var(--raise); border-color: var(--orange-shadow); }
.chooser { box-shadow: var(--lift); }

/* Small buttons that are links sit in rows and cards now, so they carry no margin of their own. */
.page > a.button.small, .page > section > a.button.small { margin: 12px 0; }
.topbar > * { margin-top: 0; margin-bottom: 0; }

/* Sign out, with its icon, at the foot of the side menu */
.side-out { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 0; font: inherit; font-size: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .side-out:hover { color: var(--bad); text-decoration: underline; text-underline-offset: 4px; } }
.side-out .icon { width: 15px; height: 15px; }
@media (min-width: 901px) {
  body.side-folded .side-group + .side-group { padding-top: 10px; border-top: 1px solid var(--line); }
  body.side-folded .side-me-links a, body.side-folded .side-out { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; }
  @media (hover: hover) and (pointer: fine) { body.side-folded .side-me-links a:hover, body.side-folded .side-out:hover { background: var(--bg); text-decoration: none; } }
  body.side-folded .side-me-links .icon { width: 19px; height: 19px; }
}

/* The profile menu under the avatar at the top right */
.profile { position: relative; }
.profile > summary { list-style: none; cursor: pointer; }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.profile[open] > summary { box-shadow: var(--raise); }
.profile-menu { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: min(320px, calc(100vw - 24px)); padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--lift); }
.profile-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); }
.profile-head .hint { margin: 0; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head .role-tag { align-self: flex-start; }
.profile-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 8px 10px; font: inherit; font-weight: 600; text-align: left; color: var(--text); text-decoration: none; background: none; border: 0; border-radius: 10px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .profile-item:hover { background: var(--bg); } }
.profile-item:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.profile-item .icon { color: var(--muted); }
.profile-item.out { margin-top: 6px; padding-top: 12px; color: var(--bad); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.profile-item.out .icon { color: var(--bad); }

/* The QR code must stay black on white to be scannable, whatever the theme. */
.qr { padding: 8px; background: #fff; }

/* A link inside a pale warning bar keeps dark text, in both looks. */
.status.bad a { color: #18191C; font-weight: 600; }

/* ---------- The theme library, laid out like a theme store ---------- */
.store { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 12px; }
.store-filters { position: sticky; top: 76px; display: grid; gap: 14px; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); padding-right: 6px; overflow-y: auto; }
.store-filters .search { max-width: none; flex: none; }
.filter-group { border-top: 1px solid var(--line-strong); }
.filter-group > summary { padding: 10px 0 6px; font-weight: 650; cursor: pointer; }
.filter-group ul { display: grid; gap: 2px; margin: 0; padding: 0 0 6px; list-style: none; }
.filter-group label { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 2px 4px; border-radius: 8px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .filter-group label:hover { background: var(--bg); } }
.filter-group input { flex: none; width: 18px; height: 18px; accent-color: var(--orange); }
.filter-name { flex: 1; min-width: 0; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-group .hint { font-size: 0.82rem; }
.store .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.theme-thumb.tall { aspect-ratio: 3 / 4; }
.theme-card strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.05rem; }
.theme-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.theme-tags .tag { font-size: 0.74rem; text-transform: capitalize; }
.store-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.store-foot .hint { margin: 0; }
@media (max-width: 1100px) { .store .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .store { grid-template-columns: minmax(0, 1fr); }
  .store-filters { position: static; max-height: none; }
  .filter-group:not([open]) ul { display: none; }
}
@media (max-width: 460px) { .store .themes { grid-template-columns: minmax(0, 1fr); } }

/* Admin -> Demo Menu: the example items theme previews show */
.demo-items { display: grid; gap: 14px; margin: 14px 0 18px; }
.demo-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; }
.page .demo-item { margin-top: 0; }
.demo-side { display: grid; gap: 10px; align-content: start; justify-items: start; }
.demo-pic { width: 112px; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--soft); display: block; }
.demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.demo-fields .field { margin: 0 0 12px; }
.demo-fields .actions { margin-top: 10px; flex-wrap: wrap; }
.demo-foot { display: grid; gap: 12px; justify-items: start; }
.demo-foot .error:empty { display: none; }
@media (max-width: 640px) {
  .demo-item { grid-template-columns: 1fr; }
  .demo-row { grid-template-columns: 1fr; }
}
.theme-open { display: block; margin: 0 12px 12px; padding: 8px 12px; text-align: center; font-weight: 600; font-size: 0.9rem; color: var(--text); text-decoration: none; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { .theme-open:hover { background: var(--text); color: var(--on-ink); } }
.theme-open:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- The guide panel: what to do next, or the tour stop for this screen ---------- */
.guidebox { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; display: grid; gap: 10px; padding: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--raise); }
.guidebox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guidebox-label { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.guidebox-fold { width: 30px; height: 30px; display: grid; place-items: center; font: inherit; font-size: 1.2rem; font-weight: 650; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; }
.guidebox .guide-bar { margin: 0; height: 8px; }
.guidebox-title { font-size: 1.15rem; line-height: 1.2; }
.guidebox-why { margin: 0; color: var(--muted); font-size: 0.95rem; }
.guidebox-on { margin: 4px 0 6px; font-size: 0.74rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.guidebox-tips { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 0.95rem; }
.guidebox-tips.plain { list-style: disc; }
.guidebox .button { justify-self: start; text-decoration: none; }
.guidebox-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.guidebox-foot:empty { display: none; }
.guidebox-foot .link { margin: 0; font-size: 0.9rem; }
.guide-pill { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px 16px; font: inherit; font-weight: 650; color: var(--on-accent); background: var(--orange); border: 1px solid var(--orange-shadow); border-radius: 999px; box-shadow: var(--raise); cursor: pointer; }
.guide-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the menu item the guide is pointing at */
.side a.guide-here { outline: 2px dashed var(--orange); outline-offset: 2px; border-radius: 10px; }
.side a.guide-here::after { content: ""; flex: none; width: 10px; height: 10px; margin-left: auto; border-radius: 50%; background: var(--orange); animation: guide-pulse 1.4s ease-in-out 3; /* three pulses to draw the eye, then still (remove-animations: no endless loops on a persistent element) */ }
@keyframes guide-pulse { 50% { transform: scale(1.6); opacity: 0.45; } }
@media (max-width: 640px) {
  .guidebox { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 62vh; }
  .guide-pill { right: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .side a.guide-here::after { animation: none; } }

/* ---------- "Made for you": custom work, on a site's home ---------- */
.custom-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: 28px; padding: 22px; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--raise); }
.custom-card > div { flex: 1 1 380px; min-width: 0; }
.custom-card h2 { margin: 0 0 8px; }
.custom-card p { margin: 0; }
.custom-card .eyebrow { margin: 0 0 6px; font-size: 0.74rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.custom-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); }
.custom-card .button { flex: none; text-decoration: none; }

/* ---------- Terms and privacy ---------- */
.legal-line { margin: 14px 0 0; font-size: 0.86rem; color: var(--muted); }
.legal-line a { color: var(--text); }
body.legal-page { display: block; padding: 24px 16px 64px; }
.legal { max-width: 760px; margin: 0 auto; padding: clamp(22px, 4vw, 44px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--raise); line-height: 1.6; }
.legal .brand a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--orange); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.04em; }
.legal .brand .logo-mark { width: 36px; height: 36px; }
.legal h1 { margin: 18px 0 4px; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.03em; }
.legal h2 { margin: 30px 0 8px; font-size: 1.2rem; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; display: grid; gap: 6px; }
.legal a { color: var(--accent-text); }
.legal-intro { margin-top: 18px; padding: 14px 16px; background: var(--soft); border-left: 4px solid var(--orange); border-radius: 8px; }
.legal-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.9rem; }

/* ---------- Plan and billing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 12px 0 18px; }
.plan { display: grid; gap: 4px; padding: 18px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 0 0 transparent; cursor: pointer; }
.plan.on { background: var(--soft); box-shadow: var(--raise); outline: 3px solid var(--orange); outline-offset: -5px; }
.plan-name { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.plan-price { font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; }
.plan-per { font-weight: 600; }
.plan .hint { margin-top: 6px; }
.pay-box { max-width: 460px; display: grid; gap: 10px; }
.pay-box .field { margin: 0; }
.pay-box .error:empty { display: none; }
.pay-box .button { justify-self: start; }

/* Admin -> Payments */
.pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.pay-row select { padding: 5px 8px; font: inherit; font-size: 0.86rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }

/* ---------- Skeletons: the grey shape of a screen while it loads (showSkeleton in portal.client.js) ---------- */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.sk { display: block; flex: none; max-width: 100%; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--sk) 20%, var(--sk-shine) 40%, var(--sk) 60%) 0 0 / 300% 100%; animation: sk-sweep 1.4s linear infinite; }
@keyframes sk-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.sk.thin { height: 10px; }
.sk.w-20 { width: 20%; } .sk.w-30 { width: 30%; } .sk.w-40 { width: 40%; } .sk.w-50 { width: 50%; }
.sk.w-60 { width: 60%; } .sk.w-70 { width: 70%; } .sk.w-80 { width: 80%; }
.sk-title { width: min(280px, 60%); height: 30px; border-radius: 10px; }
.sk-number { width: 45%; height: 30px; }
.sk-pill { width: 76px; height: 24px; border-radius: 999px; }
.sk-avatar { width: 48px; height: 48px; border-radius: 12px; }
.sk-input { width: 100%; height: 44px; border-radius: 10px; }
.sk-button { width: 150px; height: 44px; border-radius: 12px; }
.sk-block { width: 100%; height: 64px; border-radius: 12px; }
.sk-tile { width: auto; height: auto; aspect-ratio: 1; border-radius: 12px; }
.sk-screen { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 14px; }
.sk-head, .sk-stack { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.sk-form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.sk-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.sk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.sk-builder { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.skeleton .stats { margin-top: 0; }
.skeleton .stats li { border-color: var(--bg); box-shadow: none; gap: 12px; }
@media (hover: hover) and (pointer: fine) { .skeleton .list li:hover { background: none; } }
@media (max-width: 760px) { .sk-builder { grid-template-columns: 1fr; } }

/* A phone screen never slides sideways: anything that still sticks out is cut off at the edge
   (clip, not hidden, so the top bar stays stuck to the top). Wide things get their own scroll. */
html, body.app { overflow-x: clip; }
body.app .main { overflow-x: clip; }
/* Lists on a phone: the tags and buttons at the end of a row drop under the name instead of pushing the row wider. */
@media (max-width: 640px) {
  .list li { flex-wrap: wrap; }
  .list li > div:first-child { flex: 1 1 100%; }
  .actions { flex-wrap: wrap; flex-shrink: 1; min-width: 0; }
}
/* The setup checklist on a phone: the words get the full width beside the number, and the button goes underneath. */
@media (max-width: 640px) {
  .guide { padding: 14px; }
  .guide-steps li, .guide-steps li.next { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px 12px; }
  .guide-steps li.next { align-items: start; }
  .guide-steps a.tag, .guide-steps .button { grid-column: 2; justify-self: start; }
}
/* The top bar on a phone: the store's name keeps its room (up to a third of the bar); the role tag is the part that shortens. */
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar-site { flex: none; max-width: 34%; }
  .topbar > .role-tag { flex: 0 10 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > .tag { flex: none; }
}

/* ---------- The page editor: a screen of its own (showEditor in editor.client.js) ----------
   A bar across the top, the page's parts down the left, the preview filling the rest. */
body.studio { overflow: clip; }
body.studio .card { height: 100dvh; }
body.studio #view { height: 100%; }
/* Pinned to the window and clipped: the editor itself can never slide or scroll, sideways or down
   (only the list, the settings and the page inside the preview scroll). */
div.studio { position: fixed; inset: 0; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: clip; background: var(--bg); }
.studio-bar { display: flex; align-items: center; gap: 8px 12px; min-width: 0; min-height: 58px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line-strong); overflow: clip; container: bar / inline-size; }
.studio-bar > * { margin-top: 0; margin-bottom: 0; }
.studio-where { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }
.studio-where .tag, .studio-tools, .studio-actions > *, .studio-exit { flex: none; }
.studio-site { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-page { max-width: 220px; padding: 7px 10px; font: inherit; font-weight: 600; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 10px; }
.studio-tools, .studio-actions { display: flex; align-items: center; gap: 6px 10px; }
.studio-tools { padding-right: 12px; border-right: 1px solid var(--line); }
.studio-actions .hint, .studio-actions .error { margin: 0; min-height: 0; max-width: 26ch; font-size: 0.84rem; line-height: 1.25; text-align: right; }
.studio-switch { display: none; margin: 0; }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; color: var(--text); background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; }
.icon-btn .icon { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg); } }
.icon-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.icon-btn:disabled { color: var(--muted); opacity: 0.45; cursor: default; background: transparent; }
.icon-btn[aria-pressed="true"] { color: var(--on-ink); background: var(--text); }
.seg.icons { margin: 0; box-shadow: none; }
.seg.icons button { display: grid; place-items: center; width: 40px; height: 34px; padding: 0; }
.seg.icons .icon { width: 18px; height: 18px; }

/* Three columns: the page's parts, the preview, and the settings of whatever is picked. */
.studio-body { display: grid; grid-template-columns: 280px minmax(0, 1fr) 330px; min-width: 0; min-height: 0; overflow: clip; }
/* Up and down only: a long name is cut short with "...", it never makes a panel scroll sideways. */
.studio-panel { min-width: 0; min-height: 0; padding: 14px 12px 80px; overflow-x: clip; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); scrollbar-width: thin; }
.studio-panel > * { min-width: 0; max-width: 100%; }
.studio-tree { border-right: 1px solid var(--line-strong); }
.studio-inspector { padding-inline: 16px; border-left: 1px solid var(--line-strong); }
.studio-stage { min-width: 0; min-height: 0; padding: 22px clamp(12px, 2vw, 28px) 40px; overflow: auto; }
/* The preview is a plain pane, no picture of a laptop or phone around it (Dhruv, 14 Oct 2026): the
   whole height, at computer width (the page drawn 1280 wide and shrunk to fit) or at phone width. */
.studio-stage { display: flex; justify-content: center; overflow: hidden; padding-bottom: 22px; }
.studio .preview-wrap { flex: 1; min-width: 0; height: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; }
.studio .preview-wrap.mobile { flex: none; width: 406px; max-width: 100%; }
.studio .preview-wrap.mobile .preview-frame { width: 100%; max-width: none; border-inline: 0; }
.studio .preview-wrap { position: relative; }
.preview-frame.incoming { position: absolute; top: 0; left: 0; visibility: hidden; }
/* A page inside a frame is told "the device is in dark mode" when the frame around it is dark. The
   portal is dark by default, so without this a store set to "follow the visitor's device" turned
   dark in every preview, and flipped whenever the portal's own look was switched. Previews always
   show a store as a visitor on a light device would see it; the store's own choice (Theme screen)
   is what makes a preview dark. */
.preview-frame, .theme-shot { color-scheme: light; }
/* Only the preview: both panels put away. */
div.studio.focus .studio-body { grid-template-columns: minmax(0, 1fr); }
div.studio.focus .studio-panel { display: none; }

.panel-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.panel-title strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-title .hint { margin: 0; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-inspector.is-default .panel-head .icon-btn { display: none; } /* nothing is picked: there is nothing to close */
.studio-tree .panel-head .icon-btn { display: none; } /* with the settings always on show, the gear is only needed when they are not (narrow windows) */
.tools { display: flex; align-items: center; gap: 2px; margin: -4px 0 12px; padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.tools .icon-btn { width: 36px; height: 34px; }
@media (hover: hover) and (pointer: fine) { .icon-btn.danger:hover { color: var(--bad); } }
.part { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.part:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.part > .caps { margin: 0 0 8px; }

.tree-group { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tree-group .caps { margin: 0 0 6px; padding: 0 6px; }
.tree { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.tree-row { position: relative; display: flex; align-items: center; min-width: 0; border: 2px solid transparent; border-radius: 10px; }
.tree-row:focus-within { background: var(--bg); }
@media (hover: hover) and (pointer: fine) { .tree-row:hover { background: var(--bg); } }
.tree-row.on { background: var(--text); }
@media (hover: hover) and (pointer: fine) { .tree-row.on:hover { background: var(--text); } }
.tree-row.on .tree-pick, .tree-row.on .tree-pick .icon, .tree-row.on .tree-words .hint, .tree-row.on .icon-btn, .tree-row.on .tree-fold { color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) { .tree-row.on .icon-btn:hover, .tree-row.on .tree-fold:hover { background: transparent; opacity: 0.7; } }
.tree-row.is-hidden:not(.on) .tree-pick { color: var(--muted); }
.tree-row.child { margin-left: 34px; }
.tree-row.child .tree-pick { min-height: 34px; padding-left: 10px; font-weight: 500; font-size: 0.92rem; }
.tree-row.dragging { opacity: 0.4; }
.tree-row.drop-before::before, .tree-row.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; background: var(--orange); border-radius: 2px; }
.tree-row.drop-before::before { top: -4px; }
.tree-row.drop-after::after { bottom: -4px; }
.tree-row[draggable="true"] { cursor: grab; }
.tree-fold { display: grid; place-items: center; flex: none; width: 22px; height: 34px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
span.tree-fold { cursor: default; }
.tree-fold .icon { width: 14px; height: 14px; transition: transform 0.12s; }
.tree-fold[aria-expanded="true"] .icon { transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) { button.tree-fold:hover { color: var(--text); background: var(--surface); } }
.tree-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 42px; padding: 5px 6px 5px 2px; font: inherit; font-weight: 600; text-align: left; color: var(--text); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.tree-pick .icon { flex: none; width: 18px; height: 18px; color: var(--muted); }
.tree-words { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.tree-words > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-words .hint { margin: 0; font-size: 0.76rem; font-weight: 400; }
.tree-pick:focus-visible, .tree-fold:focus-visible { outline: 3px solid var(--orange); outline-offset: -2px; }
.tree-row .icon-btn { width: 32px; height: 34px; color: var(--muted); opacity: 0; }
.tree-row:focus-within .icon-btn, .tree-row.is-hidden .icon-btn, .tree-row.on .icon-btn { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .tree-row:hover .icon-btn { opacity: 1; } }
.tree-row.add .tree-pick, .tree-row.add .tree-pick .icon { color: var(--accent-text); }
.tree-empty { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; padding: 14px; background: var(--soft); border: 1px dashed var(--line-strong); border-radius: 12px; }
.tree-empty .hint { margin: 0; }
.tree-tip { margin-top: 4px; padding: 0 6px; font-size: 0.82rem; }
.studio-panel .field:first-of-type { margin-top: 0; }
.skeleton-studio .studio-panel { display: flex; flex-direction: column; gap: 14px; }
.skeleton-studio .studio-bar .sk-line { height: 18px; }

/* The bar: the way out, where you are, and whether your work is saved. */
.studio-exit { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 12px 0 8px; font-weight: 600; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { .studio-exit:hover { background: var(--bg); } }
.studio-exit .icon { width: 18px; height: 18px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; }
.save-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.save-state.busy::before { background: var(--orange); animation: guide-pulse 1s ease-in-out infinite; }
.save-state.error::before { background: var(--bad); }
.chooser-head input[type="search"] { flex: 1; max-width: 360px; margin: 0 auto 0 8px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .save-state.busy::before { animation: none; } .tree-fold .icon { transition: none; } }

/* A narrower window: two columns. The list and the settings share the left one, one at a time. */
@media (max-width: 1180px) {
  .studio-site, .studio-actions .hint { display: none; }
  .studio-body { grid-template-columns: 320px minmax(0, 1fr); }
  .studio-inspector { grid-column: 1; grid-row: 1; padding-inline: 12px; border-left: 0; border-right: 1px solid var(--line-strong); }
  .studio-stage { grid-column: 2; grid-row: 1; }
  div.studio:not(.has-pick) .studio-inspector, div.studio.has-pick .studio-tree { display: none; } /* div: the body has the class "studio" too */
  .studio-tree .panel-head .icon-btn, .studio-inspector.is-default .panel-head .icon-btn { display: inline-grid; }
}

/* The bar when it is short of room (measured on the bar itself, so it also works when the browser is
   zoomed in): first the store's name goes, then the save message shrinks to its coloured dot (the
   words stay as its tooltip; a problem is always spelled out), then "Discard changes" loses its underline room. */
@container bar (max-width: 1500px) { .studio-site { display: none; } }
@container bar (max-width: 1400px) {
  .studio-actions .save-state:not(.error) { gap: 0; width: 12px; margin-right: 4px; font-size: 0; }
  .studio-tools { padding-right: 6px; }
}
@container bar (max-width: 1040px) { .studio-where .tag { display: none; } .studio-page { max-width: 150px; } }


/* ---------- The calm look, across the whole portal (Dhruv, 14 Oct 2026: "carry this calm look
   across the whole portal") ----------
   The same idea as the page editor: smaller type, lighter weights, thin warm lines instead of heavy
   outlines, soft shadows instead of hard ones, and a soft orange tint for what is current. The
   rules above were converted in place (outlines, shadows, weights); this block is the rest. */
html { font-size: 14.5px; background: var(--bg); } /* also what shows behind the phone's status bar */
body { line-height: 1.5; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-weight: 650; }
.page { box-shadow: var(--lift); }
.card { box-shadow: var(--lift); }
body.app .card { box-shadow: none; }
/* The side menu and tabs: where you are is a tint with an orange edge, not a filled bar. */
.side-nav .side-group a { font-weight: 500; border: 0; }
@media (hover: hover) and (pointer: fine) { .side-nav .side-group a:hover { background: var(--hover); } }
.side-nav .side-group a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--tint); box-shadow: inset 3px 0 0 var(--orange); }
.side-nav .side-group a[aria-current="page"] .icon { color: var(--accent-text); }
.seg { box-shadow: none; }
.seg button[aria-pressed="true"] { color: var(--accent-text); background: var(--tint); }
.chips .chip.on { color: var(--accent-text); background: var(--tint); border-color: var(--orange); box-shadow: none; }
.tree-row.on { background: var(--tint); }
@media (hover: hover) and (pointer: fine) { .tree-row.on:hover { background: var(--tint); } }
/* Fields: soft boxes that glow when typed in. */
.field input, .field textarea, .field select, .choice input, select.small { border-width: 1px; }
.field input:focus-visible, .choice input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, select:focus-visible { border-color: var(--orange); box-shadow: 0 0 0 3px var(--glow); }
/* Buttons: still orange and clear, with a short step under them instead of a hard block. */
.button { font-weight: 650; }
.button.plain { box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .button.plain:hover { background: var(--hover); box-shadow: none; } }
.button.plain:active { box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .list li:hover { background: var(--hover); } }
.tag { font-weight: 500; }
/* Cards that used to stand out with an orange block shadow: an orange outline says the same thing more quietly. */
.guide, .custom-card { box-shadow: none; }
.guide-steps li.next, .stats li.hot { border-color: var(--orange); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .site-card:hover { border-color: var(--orange); box-shadow: none; } }
.guidebox { border-color: var(--orange); box-shadow: var(--lift); }
.guide-pill { box-shadow: var(--lift); }
.profile-menu, .chooser { box-shadow: var(--lift); }
.theme.on { box-shadow: 0 0 0 2px var(--orange); }

/* ---------- The page editor's own, quieter look (Dhruv, 14 Oct 2026: "smaller text, less aggressive,
   warm and nicer") ----------
   Everything here is inside div.studio, so the rest of the portal keeps its bold look. Smaller type,
   lighter weights, thin warm lines instead of heavy outlines, and a soft orange tint for what is picked. */
div.studio {
  --line: color-mix(in srgb, var(--text) 14%, transparent);       /* thin dividers */
  --line-strong: color-mix(in srgb, var(--text) 30%, transparent); /* input outlines */
  --tint: color-mix(in srgb, var(--orange) 14%, var(--surface));   /* the picked row */
  --hover: color-mix(in srgb, var(--text) 6%, var(--surface));
  font-size: 13.5px; line-height: 1.45;
}
div.studio .studio-bar { min-height: 50px; padding: 6px 12px; gap: 6px 10px; border-bottom: 1px solid var(--line); }
div.studio .studio-exit { height: 34px; padding: 0 11px 0 7px; font-size: 1em; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 9px; }
div.studio .studio-exit .icon { width: 16px; height: 16px; }
div.studio .studio-site { font-weight: 600; }
div.studio .studio-page { padding: 6px 9px; font-size: 1em; font-weight: 500; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; }
div.studio .tag { padding: 1px 9px; font-size: 0.86em; font-weight: 500; border-width: 1px; }
div.studio .studio-tools { gap: 4px 6px; padding-right: 10px; border-right: 1px solid var(--line); }
div.studio .icon-btn { width: 34px; height: 34px; border-width: 1px; border-radius: 9px; }
div.studio .icon-btn .icon { width: 17px; height: 17px; stroke-width: 1.8; }
@media (hover: hover) and (pointer: fine) { div.studio .icon-btn:hover { background: var(--hover); } }
div.studio .icon-btn[aria-pressed="true"] { color: var(--accent-text); background: var(--tint); }
div.studio .seg { border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: none; }
div.studio .seg button { padding: 5px 12px; font-size: 0.94em; font-weight: 500; }
div.studio .seg.icons button { width: 36px; height: 32px; }
div.studio .seg button[aria-pressed="true"] { color: var(--accent-text); background: var(--tint); }
div.studio .studio-actions { gap: 4px 12px; }
div.studio .studio-actions .hint, div.studio .studio-actions .error { font-size: 0.9em; }
div.studio .studio-actions .link { font-size: 0.94em; font-weight: 500; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { div.studio .studio-actions .link:hover { color: var(--text); } }
div.studio .button.small { min-height: 34px; padding: 5px 16px; font-size: 1em; font-weight: 700; border-width: 1px; border-radius: 9px; box-shadow: var(--raise); }
@media (hover: hover) and (pointer: fine) { div.studio .button.small:hover { box-shadow: var(--raise); } }
div.studio .button.small:active { box-shadow: 0 0 0 var(--orange-shadow); }

div.studio .studio-panel { padding: 12px 10px 72px; }
div.studio .studio-tree { border-right: 1px solid var(--line); }
div.studio .studio-inspector { padding-inline: 14px; border-left: 1px solid var(--line); }
div.studio .panel-head { margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
div.studio .panel-title strong { font-size: 1.08em; font-weight: 650; }
div.studio .panel-title .hint { font-size: 0.88em; }
div.studio .hint { font-size: 0.92em; line-height: 1.45; }
div.studio .caps { font-size: 0.74em; font-weight: 600; letter-spacing: 0.07em; }

div.studio .tree-group { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
div.studio .tree-row { border: 0; border-radius: 8px; }
div.studio .tree-row:focus-within { background: var(--hover); }
@media (hover: hover) and (pointer: fine) { div.studio .tree-row:hover { background: var(--hover); } }
div.studio .tree-pick { min-height: 36px; gap: 9px; padding: 4px 6px 4px 2px; font-weight: 500; }
div.studio .tree-pick .icon { width: 16px; height: 16px; stroke-width: 1.8; }
div.studio .tree-words .hint { font-size: 0.84em; }
div.studio .tree-row.child .tree-pick { min-height: 30px; font-size: 0.96em; font-weight: 400; }
div.studio .tree-fold { height: 30px; }
div.studio .tree-row .icon-btn { width: 28px; height: 30px; }
/* What is picked: a warm tint and an orange edge, with the words left as they are (not a loud filled bar). */
div.studio .tree-row.on { background: var(--tint); box-shadow: inset 3px 0 0 var(--orange); }
@media (hover: hover) and (pointer: fine) { div.studio .tree-row.on:hover { background: var(--tint); box-shadow: inset 3px 0 0 var(--orange); } }
div.studio .tree-row.on .tree-pick { color: var(--text); font-weight: 600; }
div.studio .tree-row.on .tree-pick .icon { color: var(--accent-text); }
div.studio .tree-row.on .tree-words .hint, div.studio .tree-row.on .icon-btn, div.studio .tree-row.on .tree-fold { color: var(--muted); }
div.studio .tree-empty { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
div.studio .tree-tip { font-size: 0.88em; }

div.studio .field { margin: 12px 0; }
div.studio .field > label > span, div.studio .field > span, div.studio .field span { margin-bottom: 5px; font-size: 0.94em; font-weight: 550; }
div.studio .field input, div.studio .field textarea, div.studio .field select { min-height: 36px; padding: 7px 10px; font-size: 1em; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--soft); }
div.studio .field textarea { line-height: 1.45; }
@media (hover: hover) and (pointer: fine) { div.studio .field input:hover, div.studio .field textarea:hover, div.studio .field select:hover { border-color: var(--muted); } }
div.studio .field input:focus-visible, div.studio .field textarea:focus-visible, div.studio .field select:focus-visible { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
div.studio .field .hint:last-child { margin-top: 5px; min-height: 0; }
div.studio .check { gap: 9px; margin: 12px 0 8px; font-weight: 500; }
div.studio .check input { width: 17px; height: 17px; min-height: 0; }
div.studio .sublist { margin: 12px 0; padding: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
div.studio .sublist-title { margin-bottom: 7px; font-size: 0.94em; font-weight: 600; }
div.studio .subitem { margin: 5px 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
div.studio .subitem > summary { padding: 7px 0; font-weight: 500; }
div.studio .panel { margin: 10px 0; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: none; }
div.studio .panel > summary { padding: 9px 0; font-weight: 600; }
div.studio .status { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 9px; }
div.studio .link.inline { font-size: 0.94em; font-weight: 500; }
div.studio .thumb { border: 1px solid var(--line); }
div.studio .tools { margin: -2px 0 10px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
div.studio .tools .icon-btn { width: 32px; height: 30px; }
div.studio .part { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
div.studio .part:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
div.studio .preview-wrap { border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); }
div.studio .studio-stage { padding: 18px clamp(12px, 1.8vw, 24px); }
/* Narrower columns now that the words are smaller: more room for the page. */
div.studio .studio-body { grid-template-columns: 256px minmax(0, 1fr) 304px; }
@media (max-width: 1180px) {
  div.studio .studio-body { grid-template-columns: 296px minmax(0, 1fr); }
  div.studio .studio-inspector { border-left: 0; border-right: 1px solid var(--line); }
}
div.studio.focus .studio-body { grid-template-columns: minmax(0, 1fr); }

/* "Add a section" in the page editor: a small, quiet picker (it was twenty heavy cards). */
div.studio .chooser { width: min(1080px, 94vw); max-height: 84vh; padding: 16px 18px 18px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); scrollbar-width: thin; }
div.studio .chooser::backdrop { background: rgba(10, 10, 12, 0.5); backdrop-filter: blur(2px); }
div.studio .chooser-head { gap: 12px; margin-bottom: 4px; }
div.studio .chooser-head h2 { font-size: 1.15em; font-weight: 650; }
div.studio .chooser-head input[type="search"] { flex: 1; max-width: 260px; margin: 0 auto 0 4px; padding: 6px 10px; font-size: 1em; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 9px; }
div.studio .chooser-head input[type="search"]:focus-visible { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
.pick-group, .pick-more { margin-top: 16px; }
.pick-group > .caps { margin: 0 0 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.chooser .pick-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; transition: border-color 0.12s, background 0.12s, transform 0.12s; }
.chooser .pick-card button { flex: 1; display: flex; flex-direction: column; width: 100%; padding: 0; font: inherit; text-align: left; color: var(--text); background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .chooser .pick-card:hover { background: var(--tint); border-color: var(--orange); transform: translateY(-1px); } }
.chooser .pick-card:has(button:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.chooser .pick-card button:focus-visible { outline: none; }
.section-pic { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pack-pic { display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 600; color: var(--muted); background: var(--soft); }
.chooser .pick-card .theme-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); cursor: pointer; }
/* The section in the store's own look, over the ready-made picture once it has loaded (openChooser in editor.client.js). */
.section-live { position: absolute; top: 0; left: 0; border: 0; pointer-events: none; transform-origin: 0 0; opacity: 0; background: var(--surface); color-scheme: light; transition: opacity 0.25s; }
.section-live.ready { opacity: 1; }
.pick-words { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.pick-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pick-words strong { font-size: 1.08em; font-weight: 650; }
.pick-words .hint { margin: 0; font-size: 0.92em; line-height: 1.4; }
.pick-more { padding-top: 12px; border-top: 1px solid var(--line); }
.pick-more > summary { font-weight: 600; color: var(--muted); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .pick-more > summary:hover { color: var(--text); } }
.pick-more > .hint { margin: 6px 0 10px; }
.pick-foot { margin: 16px 0 0; }
@media (max-width: 900px) { .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pick-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .chooser .pick-card, .section-live { transition: none; } @media (hover: hover) and (pointer: fine) { .chooser .pick-card:hover { transform: none; } } }

/* ---------- The Theme screen, in the editor's layout (showTheme in theme.client.js) ----------
   Two steps share the left column: the themes to choose from, or customising the one being tried
   ("Themes" / "Customise" in the bar). The preview is beside it. */
div.studio.theme-studio .studio-body { grid-template-columns: 320px minmax(0, 1fr); }
div.studio.theme-studio .studio-tree, div.studio.theme-studio .studio-inspector { grid-column: 1; grid-row: 1; border-left: 0; border-right: 1px solid var(--line); }
div.studio.theme-studio .studio-stage { grid-column: 2; grid-row: 1; }
div.studio.theme-studio:not(.show-adjust) .studio-inspector, div.studio.theme-studio.show-adjust .studio-tree { display: none; }
.theme-summary { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.theme-summary-name { display: flex; flex-direction: column; gap: 1px; }
.theme-summary-name .hint { margin: 0; font-size: 0.82rem; }
.theme-summary .check { margin: 0; font-size: 0.92em; }
.theme-summary .button { align-self: stretch; }
/* Customising: each group folds, so only what is being changed is open. */
.tune { border-bottom: 1px solid var(--line); }
.tune > summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; font-weight: 600; cursor: pointer; list-style: none; }
.tune > summary::-webkit-details-marker { display: none; }
.tune > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
.tune[open] > summary::after { transform: rotate(-135deg); }
.tune > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.tune-body { padding: 0 2px 14px; }
.tune-body > .hint { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .tune > summary::after { transition: none; } }
.theme-library .search { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0 10px; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 9px; }
.theme-library .search .icon { width: 16px; height: 16px; color: var(--muted); }
.theme-library .search input { flex: 1; min-width: 0; padding: 7px 0; font: inherit; color: var(--text); background: none; border: 0; outline: none; }
.theme-library .filter-group { margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; }
.theme-library .filter-group > summary { font-weight: 600; cursor: pointer; }
.theme-library .filter-group ul { display: grid; gap: 4px; margin: 8px 0 2px; padding: 0; list-style: none; }
.theme-library .filter-group label { display: flex; align-items: center; gap: 8px; }
.theme-library .filter-group .filter-name { flex: 1; text-transform: capitalize; }
.theme-library .filter-group .hint { margin: 0; }
div.studio .theme-library .themes { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; }
div.studio .theme-library .theme { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; box-shadow: none; outline: 0; transition: border-color 0.12s, background 0.12s; }
div.studio .theme-library .theme:focus-within { border-color: var(--orange); outline: 0; }
@media (hover: hover) and (pointer: fine) { div.studio .theme-library .theme:hover { border-color: var(--orange); outline: 0; } }
div.studio .theme-library .theme.on { background: var(--tint); border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
div.studio .theme-library .theme-thumb { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); }
div.studio .theme-library .theme-card { padding: 8px 10px 10px; background: none; }
div.studio .theme-library .theme-card strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1em; font-weight: 600; }
div.studio .theme-library .theme-card .hint { display: block; margin: 3px 0 0; font-size: 0.88em; line-height: 1.35; }
div.studio .theme-library .theme-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
div.studio .theme-library .theme-tags .tag { font-size: 0.78em; text-transform: capitalize; }
div.studio .theme-library .store-foot { margin-top: 10px; }
div.studio .field.colour { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
div.studio .field.colour span { margin: 0; }
div.studio .field.colour input { width: 46px; min-height: 30px; height: 30px; padding: 2px; }
.theme-switch { display: inline-flex; margin: 0; }
.theme-switch .for-preview { display: none; }
@media (max-width: 1180px) { div.studio.theme-studio .studio-body { grid-template-columns: 296px minmax(0, 1fr); } }
/* A phone: one thing at a time. */
@media (max-width: 760px) {
  div.studio.theme-studio .studio-bar { flex-wrap: wrap; height: auto; overflow: visible; }
  div.studio.theme-studio .studio-bar .topbar-gap, div.studio.theme-studio .studio-where .tag, div.studio.theme-studio .studio-actions .save-state, div.studio.theme-studio .studio-tools .seg.icons, div.studio.theme-studio .studio-tools .icon-btn { display: none; }
  div.studio.theme-studio .studio-where { flex: 1; }
  div.studio.theme-studio .studio-actions { order: 2; }
  div.studio.theme-studio .theme-switch { order: 3; }
  div.studio.theme-studio .studio-tools { order: 4; margin-left: auto; padding-right: 0; border-right: 0; }
  .theme-switch .for-preview { display: block; }
  div.studio.theme-studio .studio-body { grid-template-columns: minmax(0, 1fr); }
  div.studio.theme-studio .studio-tree, div.studio.theme-studio .studio-inspector, div.studio.theme-studio .studio-stage { grid-column: 1; grid-row: 1; border-right: 0; }
  div.studio.theme-studio:not(.show-themes) .studio-tree, div.studio.theme-studio:not(.show-adjust) .studio-inspector, div.studio.theme-studio:not(.show-preview) .studio-stage { display: none; }
  div.studio.theme-studio.show-themes .studio-tree, div.studio.theme-studio.show-adjust .studio-inspector { display: block; }
  div.studio.theme-studio .studio-stage { padding: 10px; }
  div.studio.theme-studio .preview-wrap, div.studio.theme-studio .preview-wrap.mobile { flex: 1; width: auto; }
}
div.studio .theme-library .theme { position: relative; }
div.studio .theme-library .theme-open { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; margin: 0; padding: 0; color: #18191C; background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(24, 25, 28, 0.2); border-radius: 8px; opacity: 0; transition: opacity 0.12s; }
div.studio .theme-library .theme-open:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) { div.studio .theme-library .theme:hover .theme-open { opacity: 1; } }
div.studio .theme-library .theme-open .icon { width: 15px; height: 15px; }
@media (hover: none) { div.studio .theme-library .theme-open { opacity: 1; } }
/* Only the preview (the expand button): the left column is put away and the preview takes the whole width.
   After the rules above, which would otherwise keep two columns and squeeze the preview into the first. */
div.studio.theme-studio.focus .studio-body { grid-template-columns: minmax(0, 1fr); }
div.studio.theme-studio.focus .studio-panel { display: none; }
div.studio.theme-studio.focus .studio-stage { grid-column: 1; }

/* Security -> Order sound: the sounds to choose from */
.sound-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.sound-kinds .chip { padding: 6px 14px; font: inherit; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .sound-kinds .chip:hover { background: var(--hover); } }
.sound-kinds .chip.on { color: var(--accent-text); background: var(--tint); border-color: var(--orange); }

/* ---------- Shop extras: reviews, unfinished checkouts, size charts (calm look: 1px lines, tokens) ---------- */
.review-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.review-card { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.review-card p { margin: 0; }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.review-body { white-space: pre-line; }
.review-reply { display: grid; gap: 8px; }
.review-reply textarea { width: 100%; }
.stars-text { color: #E2A40B; letter-spacing: 1px; font-size: 1.05rem; }
.chart-scroll { overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.chart-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(56px, 1fr)) 28px; gap: 5px; align-items: center; min-width: min-content; }
.chart-grid input { width: 100%; min-width: 0; padding: 7px 8px; text-align: center; }
.chart-grid input.chart-head { font-weight: 650; background: var(--soft); }
.chart-grid .link { justify-self: center; }
.code-name { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.code-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 4px 0; }
.code-stat { display: grid; gap: 2px; padding: 10px 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.code-stat strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.code-stat .hint { margin: 0; font-size: 0.8rem; }
.code-funnel { display: grid; gap: 8px; margin: 16px 0; }
.code-funnel > div { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 40px; gap: 10px; align-items: center; }
.code-funnel strong { text-align: right; }
.code-bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.code-bar-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 999px; }
.code-bar-fill.all { background: var(--muted); }
.code-bar-fill.good { background: var(--good); }
.code-bar-fill.bad { background: var(--orange); }
.code-days { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 80px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.code-day { display: block; height: max(var(--h, 0%), 2px); background: var(--orange); border-radius: 3px 3px 0 0; opacity: 0.85; }
@media (max-width: 640px) { .code-funnel > div { grid-template-columns: 1fr 40px; } .code-funnel .code-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Phones: while the side menu is open, only the menu scrolls. The page behind it stays put, and
   scrolling to the end of the menu doesn't carry on into the page (scroll chaining). */
html:has(.shell.menu-open), html:has(.shell.menu-open) body { overflow: hidden; }
@media (max-width: 900px) {
  .side { height: 100dvh; overscroll-behavior: contain; }
  .shell.menu-open .shade { touch-action: none; }
}

/* The installed app (not the browser tab): no zooming. Fields are 16px, the size under which an
   iPhone zooms in when one is tapped; pinch zoom is switched off here and in pwa.client.js. */
/* The installed app on every device (html.installed, set by pwa.client.js): feels like an app, not a page. */
html.installed, html.installed body { overscroll-behavior: none; }
html.installed body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: default; }
html.installed :is(input, textarea, select, [contenteditable="true"], code, pre, .selectable) { -webkit-user-select: text; user-select: text; }
html.installed :is(img, a, svg) { -webkit-user-drag: none; }
html.installed { touch-action: pan-x pan-y; }
@media (display-mode: standalone) {
  html { touch-action: pan-x pan-y; }
  input, select, textarea, .field input, .choice input, .field select, .field textarea, select.small { font-size: 16px; }
}

/* Plan and billing: paying once is the quiet choice under the plans (autopay is the usual way). */
.pay-once { margin-top: 12px; }
.pay-once > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .pay-once > summary:hover { color: var(--text); } }
.pay-once[open] > summary { margin-bottom: 12px; }

/* The account menu, calmer (Dhruv, 15 Oct 2026: "congested, make it calm"): a small header with
   the avatar, short groups split by hairlines, lighter type, and Help / Terms / Privacy as a quiet
   footer line instead of three more rows. */
.profile-menu { width: min(288px, calc(100vw - 24px)); padding: 6px; border-color: var(--line); border-radius: 16px; }
.profile[open] > summary { box-shadow: none; outline: 2px solid var(--tint, var(--line-strong)); outline-offset: 2px; }
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; margin: 0; padding: 12px 10px 14px; border-bottom: 0; }
.profile-head .avatar { width: 36px; height: 36px; font-size: 0.95rem; }
.profile-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.profile-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head .hint { font-size: 0.84rem; }
.profile-head .role-tag { grid-column: 2; justify-self: start; font-size: 0.74rem; font-weight: 500; border-width: 1px; }
.profile-group { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-top: 1px solid var(--line); }
.profile-item { gap: 12px; min-height: 36px; padding: 6px 10px; font-size: 0.93rem; font-weight: 500; }
.profile-item .icon { width: 17px; height: 17px; opacity: 0.85; }
@media (hover: hover) and (pointer: fine) { .profile-item:hover { background: var(--soft, var(--bg)); } }
.profile-item.out { margin: 0; padding: 6px 10px; color: var(--muted); border: 0; border-radius: 10px; }
.profile-item.out .icon { color: inherit; }
@media (hover: hover) and (pointer: fine) { .profile-item.out:hover { color: var(--bad); } }
.profile-foot { display: flex; gap: 14px; margin: 0; padding: 8px 10px 6px; border-top: 1px solid var(--line); font-size: 0.8rem; }
.profile-foot a { color: var(--muted); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .profile-foot a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } }
@media (pointer: coarse) { .profile-item { min-height: 42px; } }

/* The store switcher at the top of the account menu (like Shopify's): each store as a small
   two-letter tile, its name and address; the one you are in is tinted and ticked. */
/* Two views in one menu: the account menu, and (after "Switch store") the list of stores. */
.profile-stores { display: none; padding: 2px 0 4px; }
.profile-menu.on-stores .profile-main { display: none; }
.profile-menu.on-stores .profile-stores { display: flex; flex-direction: column; gap: 1px; }
.profile-back { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 4px; padding: 10px 10px 12px; font: inherit; font-size: 0.93rem; font-weight: 600; text-align: left; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; cursor: pointer; }
.profile-back .icon { width: 17px; height: 17px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .profile-back:hover .icon { color: var(--text); } }
.profile-item.switch .switch-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.profile-item.switch .switch-text small { margin: 0; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-item.switch > .icon:last-child { width: 15px; height: 15px; }
/* The store's name in the top bar, as a button that opens the store list. */
button.topbar-site.switch { display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin: 0; padding: 4px 8px; font: inherit; font-size: 1.05rem; font-weight: 600; color: var(--text); background: none; border: 0; border-radius: 8px; cursor: pointer; }
button.topbar-site.switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.topbar-site.switch .icon { flex: none; width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) { button.topbar-site.switch:hover { background: var(--soft, var(--bg)); } }
button.topbar-site.switch:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.profile-store { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; color: var(--text); text-decoration: none; border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { .profile-store:hover { background: var(--soft, var(--bg)); } }
.profile-store:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.profile-store.on { background: var(--tint); }
.profile-store > .icon { width: 16px; height: 16px; color: var(--accent-text, var(--orange)); flex: none; }
.profile-store-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profile-store-text strong { font-weight: 600; font-size: 0.93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-store-text .hint { margin: 0; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-tile { flex: none; display: grid; place-items: center; width: 32px; height: 32px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; color: var(--on-accent); background: var(--orange); border-radius: 9px; }

/* Analytics and affiliates (growth.client.js). Bars are drawn by width/height variables set through
   the style object (the CSP allows that; no inline style attributes). */
.an-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.an-col { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 0; }
.an-col-fill { display: block; width: 100%; height: max(var(--h, 0%), 2px); background: var(--orange); border-radius: 4px 4px 0 0; opacity: 0.85; }
@media (hover: hover) and (pointer: fine) { .an-col:hover .an-col-fill { opacity: 1; } }
.an-ticks { display: flex; gap: 3px; margin-top: 4px; font-size: 0.72rem; color: var(--muted); }
.an-ticks span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }
.an-row { display: grid; grid-template-columns: minmax(84px, 9rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 0.92rem; }
.an-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar { display: block; height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.an-fill { display: block; width: var(--w, 0%); height: 100%; background: var(--orange); border-radius: 99px; }
.an-right { font-size: 0.84rem; color: var(--muted); white-space: nowrap; }
.an-sub { margin-top: 18px; }
.an-list { margin: 0; padding-left: 1.2em; }
.an-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.an-list li .hint { margin: 0; white-space: nowrap; }
.page-head .seg { margin: 0; }
.aff-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; color: var(--accent-text, var(--text)); overflow-wrap: anywhere; }
.aff-links .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .an-row { grid-template-columns: minmax(70px, 6.5rem) minmax(0, 1fr); }
  .an-right { grid-column: 1 / -1; margin-top: -4px; }
  .page-head .seg button { padding: 6px 10px; }
}
/* Phones: the top bar keeps the store's name, its state, "View store" and the avatar. Your role is
   already at the bottom of the side menu, so it gives up its place here. */
@media (max-width: 640px) {
  .topbar > .role-tag { display: none; }
  .topbar > * { min-width: 0; }
}

/* The "⋯" menu at the end of a product row: on sale / hidden in one tap, edit, view, delete. */
.table.products .rows .row { position: relative; }
.row-menu { position: relative; justify-self: end; }
.row-menu > summary { display: grid; place-items: center; width: 34px; height: 34px; list-style: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { color: var(--text); background: var(--soft, var(--bg)); }
@media (hover: hover) and (pointer: fine) { .row-menu > summary:hover { color: var(--text); background: var(--soft, var(--bg)); } }
.row-menu > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.row-menu > summary .icon { width: 20px; height: 20px; stroke-width: 3; }
.row-menu-list { position: absolute; z-index: 25; top: calc(100% + 4px); right: 0; display: flex; flex-direction: column; gap: 1px; min-width: 190px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--lift); }
.row-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; font: inherit; font-size: 0.92rem; font-weight: 500; text-align: left; color: var(--text); text-decoration: none; background: none; border: 0; border-radius: 8px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .row-menu-item:hover { background: var(--soft, var(--bg)); } }
.row-menu-item .icon { width: 16px; height: 16px; color: var(--muted); }
.row-menu-item.danger, .row-menu-item.danger .icon { color: var(--bad); }
@media (max-width: 900px) {
  .table.products .rows .row > .row-menu { position: absolute; top: 10px; right: 6px; }
  .table.products .rows .row { padding-right: 44px; }
}
@media (pointer: coarse) { .row-menu-item { min-height: 42px; } }
/* The product table lets the "⋯" menu hang out of it (a clipped menu on the last row can't be used). */
.table.products { overflow: visible; }
.table.products .table-head { border-radius: 13px 13px 0 0; }

/* The side menu in three parts (Dhruv, 15 Oct 2026): the top (logo, store, search) and the bottom
   (who is signed in) stay where they are; only the menu between them scrolls. */
.side { overflow: hidden; gap: 0; }
.side-head { flex: none; display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -12px; padding: 4px 12px 12px; scrollbar-width: thin; }
.side-me { flex: none; margin-top: 0; }

/* Search */
.side-search { position: relative; }
.side-search-field { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--soft, var(--bg)); border: 1px solid var(--line); border-radius: 10px; cursor: text; }
.side-search-field:focus-within { border-color: var(--orange); box-shadow: var(--glow, 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent)); }
.side-search-field .icon { flex: none; width: 16px; height: 16px; color: var(--muted); }
.side-search-input { flex: 1; min-width: 0; height: 100%; padding: 0; font: inherit; font-size: 0.92rem; color: var(--text); background: none; border: 0; outline: none; }
.side-search-input::-webkit-search-cancel-button { display: none; }
.side-search-key { flex: none; padding: 1px 6px; font: 600 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; }
.side-search-field:focus-within .side-search-key { display: none; }
.side-results { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60vh, 440px); overflow-y: auto; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--lift); }
.side-result { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 8px; color: var(--text); text-decoration: none; border-radius: 8px; }
.side-result:focus { background: var(--tint); outline: none; }
@media (hover: hover) and (pointer: fine) { .side-result:hover { background: var(--tint); outline: none; } }
.side-result-kind { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.side-result-text { display: flex; flex-direction: column; min-width: 0; }
.side-result-text strong { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-result-text .hint { margin: 0; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-results-none { margin: 0; padding: 10px; font-size: 0.88rem; color: var(--muted); }
@media (min-width: 901px) { body.side-folded .side-search { display: none; } }
@media (pointer: coarse) { .side-search-key { display: none; } .side-search-field { height: 42px; } }
@media (min-width: 901px) {
  body.side-folded .side-head { align-items: center; width: 100%; }
  body.side-folded .side-nav { margin: 0 -10px; padding-inline: 10px; width: calc(100% + 20px); }
}

/* Drag to rearrange (grip + sortable in portal.client.js): four dots, a lifted row that follows the
   pointer, and a line where it will land. touch-action: none lets a finger drag instead of scroll. */
.grip { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 7px; cursor: grab; touch-action: none; vertical-align: middle; }
@media (hover: hover) and (pointer: fine) { .grip:hover { color: var(--text); background: var(--soft, var(--bg)); } }
.grip:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; color: var(--text); }
.grip-dots { width: 16px; height: 16px; fill: currentColor; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.is-dragging { position: relative; z-index: 30; transform: translateY(var(--drag-y, 0)); background: var(--surface); box-shadow: var(--lift); border-radius: 10px; transition: none; }
.drop-above, .drop-below { position: relative; }
.drop-above::before, .drop-below::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--orange); border-radius: 3px; pointer-events: none; z-index: 2; }
.drop-above::before { top: -2px; }
.drop-below::after { bottom: -2px; }
@media (pointer: coarse) { .grip { width: 36px; height: 36px; } }
/* Where the grip sits in each list */
.row-move { display: flex; align-items: center; justify-content: center; }
.subitem > summary { display: flex; align-items: center; gap: 6px; }
.subitem > summary > .grip { margin-left: -4px; }
.menu-row:has(> .grip) { grid-template-columns: 32px 1fr 1fr; padding-left: 6px; }
.menu-row > .grip { align-self: center; margin-top: 18px; }
.subitem > summary { list-style: none; }
.subitem > summary::-webkit-details-marker { display: none; }
.subitem > summary > span { flex: 1; min-width: 0; }
.subitem > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.subitem[open] > summary::after { transform: rotate(45deg); }
.demo-tag-row { display: inline-flex; align-items: center; gap: 4px; }

/* Domains (src/portal/domains.client.js) */
.domain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.domain-card { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); display: grid; gap: 10px; }
.domain-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.domain-name { font-size: 1.05rem; font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.domain-gap { flex: 1; }
.domain-steps { display: grid; gap: 8px; }
.dns-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dns-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.dns-row:first-child { border-top: 0; }
.dns-head { background: var(--soft); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.dns-value { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dns-value code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.85rem; padding: 3px 6px; border-radius: 6px; background: var(--soft); }
.dns-row .hint { margin: 0; font-size: 0.8rem; }
.hint-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--muted); }
@media (max-width: 760px) {
  .dns-head { display: none; }
  .dns-row { grid-template-columns: 1fr; gap: 6px; }
}

/* A link made for the brand, with ways to send it (billing.client.js shareBox) */
.share-box { display: grid; gap: 10px; margin: 8px 0 16px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--soft); }
.share-link { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 0.85rem; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.share-box .actions { margin: 0; }
.share-box .hint { margin: 0; }

/* Google and Instagram (channels.client.js) */
.setup-how { margin: 4px 0 12px; }
.setup-how > summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.setup-how[open] > summary { margin-bottom: 8px; }
.setup-steps { margin: 0 0 8px; padding-left: 1.4em; display: grid; gap: 8px; line-height: 1.5; }
.setup-steps a { color: var(--accent-text); }
.block + .domain-list { margin-top: 16px; }

/* ---------- Three ways in: sign-up choice, agency clients, the platform "Today" list (calm look) ---------- */
.kind-label { margin: 8px 0 6px; font-weight: 650; }
.kind-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 8px; }
.kind-card { display: grid; gap: 4px; text-align: left; padding: 12px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; font: inherit; cursor: pointer; }
.kind-card.on { background: var(--tint); border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.kind-card .hint { margin: 0; }
.welcome-steps li.done .welcome-n { background: var(--good); color: var(--on-ink); }
.add-client { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.add-client input { flex: 1 1 220px; min-width: 0; }
.client-cards { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.client-card { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.client-card p { margin: 0; }
.client-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.client-progress { display: grid; grid-auto-flow: column; gap: 4px; }
.client-progress span { height: 6px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.client-progress span.on { background: var(--orange); border-color: var(--orange); }
.check-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.check-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.check-steps li p { margin: 2px 0 0; }
.check-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; }
.check-steps li.done .check-dot { background: var(--good); border-color: var(--good); color: var(--on-ink); }
.check-steps li.done > span:last-child, .check-steps li.done strong { color: var(--muted); }
.today-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.today-list li { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--orange); border-radius: 10px; }
.today-list a { color: var(--text); text-decoration: none; }
.today-list a strong { font-size: 1.2rem; }
.today-list .hint { margin: 0; }
.home-today, .home-agency { margin-bottom: 20px; }
.add-client input { padding: 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
.add-client input:focus { outline: none; border-color: var(--orange); box-shadow: var(--glow); }

/* ---------- WhatsApp inbox (calm look) ---------- */
.wa-inbox { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 12px; min-height: 480px; }
.wa-chats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; max-height: 70vh; overflow-y: auto; }
.wa-chat { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.wa-chat.on { background: var(--tint); border-color: var(--orange); }
.wa-chat-top { display: flex; justify-content: space-between; gap: 8px; }
.wa-chat-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.wa-chat-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-chat-tags:empty { display: none; }
.wa-thread { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--soft); }
.wa-thread-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.wa-thread-head .wa-back { display: none; }
.wa-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; }
.wa-msg { max-width: min(78%, 520px); padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; justify-self: start; }
.wa-msg p { margin: 0; white-space: pre-line; }
.wa-msg.out { justify-self: end; background: var(--tint); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.wa-msg.out.bot { background: var(--surface); border-style: dashed; }
.wa-meta { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.wa-photo { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; margin-bottom: 6px; }
.wa-reply { display: flex; gap: 8px; align-items: end; }
.wa-reply textarea { flex: 1; min-width: 0; padding: 8px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; resize: vertical; }
.wa-orders { margin: 0; }
.steps-text { display: grid; gap: 6px; padding-left: 20px; }
@media (max-width: 760px) {
  .wa-inbox { grid-template-columns: 1fr; }
  .wa-inbox.has-chat .wa-chats { display: none; }
  .wa-inbox:not(.has-chat) .wa-thread { display: none; }
  .wa-thread-head .wa-back { display: inline; }
  .wa-msg { max-width: 88%; }
}

/* ---------- Site settings: tabs of small cards (17 Oct 2026) ---------- */
.settings-tabs { display: flex; gap: 4px; margin: 18px 0 16px; padding-bottom: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 10px 12px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .settings-tab:hover { color: var(--text); } }
.settings-tab.on { color: var(--text); border-bottom-color: var(--orange); }
.settings-tab:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; border-radius: 6px; }
.tab-need { padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 0.74rem; font-weight: 600; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.set-grid.inner { grid-column: 1 / -1; }
.set-grid.inner[hidden] { display: none; }
.set-card { padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; min-width: 0; }
.set-card-head { margin-bottom: 6px; }
.set-card-head h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.set-card-head .hint { margin: 4px 0 0; }
.set-card .field:first-of-type { margin-top: 10px; }
.set-card .check { margin: 12px 0 8px; align-items: flex-start; }
.set-card .check input { flex: none; margin-top: 1px; }
.set-card > .link.inline { display: inline-block; margin-top: 10px; }
.set-card .sublist { margin: 10px 0 0; }
.set-card .pair { gap: 0 12px; }
.pick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.pick-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; text-align: left; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font: inherit; cursor: pointer; }
.pick-card strong { font-weight: 650; }
.pick-card .hint { margin: 0; font-size: 0.82rem; }
@media (hover: hover) and (pointer: fine) { .pick-card:hover:not(:disabled) { border-color: var(--orange); } }
.pick-card.on { background: var(--tint); border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.pick-card:disabled { cursor: default; opacity: 0.7; }
.colour-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.colour-pick { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.colour-pick input { flex: none; width: 40px; height: 40px; padding: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; }
.colour-name { display: block; font-weight: 600; font-size: 0.9rem; }
.colour-hex { display: block; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--lift); }
.save-bar[hidden] { display: none; }
.save-bar .save-status { margin-right: auto; font-weight: 600; }
.save-bar .error { flex-basis: 100%; order: 5; margin: 0; }
.save-bar .error:empty { display: none; }
p.status:empty, .save-status:empty { display: none; }
@media (max-width: 640px) {
  .set-card .pair, .colour-picks { grid-template-columns: 1fr; }
  .set-card { padding: 16px 14px 14px; }
  .save-bar { bottom: 8px; }
}
.page section.set-card { margin-top: 0; }
.check-hint { display: block; margin-top: 2px; font-weight: 400; font-size: 0.84rem; }
@media (min-width: 900px) { .settings-tabs { flex-wrap: wrap; overflow: visible; } }
.set-card.wide { grid-column: 1 / -1; }
.settings-tabs { position: relative; }

/* ---------- Wraps (in-portal apps hub, 18 Oct 2026) ---------- */
.wraps-toolbar { display: grid; gap: 12px; margin: 14px 0 18px; }
.wraps-search { width: 100%; max-width: 460px; padding: 10px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
.wraps-search:focus { outline: none; border-color: var(--orange); box-shadow: var(--glow); }
.wraps-sections { display: grid; gap: 24px; }
.wraps-group { display: grid; gap: 12px; margin-top: 0; }
.wraps-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 14px; }
.wrap-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; min-width: 0; }
.wrap-card.on { border-color: var(--orange); background: color-mix(in srgb, var(--surface) 95%, var(--orange)); }
.wrap-card-top { display: flex; align-items: flex-start; gap: 12px; }
.wrap-icon { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--orange); border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.wrap-title-box { flex: 1; min-width: 0; display: grid; gap: 3px; }
.wrap-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wrap-name { font-weight: 700; font-size: 1.02rem; color: var(--text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { a.wrap-name:hover { color: var(--orange); } }
.wrap-desc { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--text); }
.wrap-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wrap-highlights li { padding: 3px 9px; font-size: 0.78rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
/* The Wrap Store (12 Nov 2026) */
.wrap-promise { margin: 0; font-size: 0.98rem; line-height: 1.4; color: var(--text); font-weight: 600; }
.wrap-cost { margin: 0; }
.wrap-shelf { font-size: 1.1rem; margin: 0; }
.wrap-reco { display: grid; gap: 12px; padding: 18px; border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--line)); border-radius: 14px; background: var(--tint); margin-bottom: 24px; }
.wrap-reco-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wrap-reco-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 600px) { .wrap-reco-item { grid-template-columns: auto minmax(0, 1fr); } .wrap-reco-item > .button { grid-column: 1 / -1; justify-self: start; } }
.wrap-detail-head { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0 16px; }
.wrap-detail-head h1 { margin: 0 0 4px; }
.wrap-icon.big { width: 64px; height: 64px; border-radius: 16px; }
.wrap-icon.big svg { width: 30px; height: 30px; }
.wrap-title-row.start { justify-content: flex-start; margin-top: 6px; }
.wrap-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wrap-detail-actions .button { width: auto; }
.wrap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 18px 0; }
.wrap-fact { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.wrap-fact p { margin: 6px 0 0; line-height: 1.45; }
.wrap-card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Optional app workspaces follow the portal's type, colour and focus tokens. */
.app-workspace{display:grid;gap:20px;max-width:1100px}.app-work-card{padding:24px;border:1px solid var(--line,#ddd);border-radius:16px;background:var(--surface,#fff);min-width:0}.app-work-card h2{margin:0 0 12px;font-size:1.1rem}.app-work-card details{margin-top:16px}.app-work-card summary{cursor:pointer;padding:8px 0}.app-work-card form{margin-top:16px}.app-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:20px}.app-product-checks{border:1px solid var(--line,#ddd);border-radius:8px;max-height:250px;overflow:auto;padding:12px}.app-product-checks label{display:flex;align-items:center;gap:12px;padding:8px}.app-product-checks input{width:18px;height:18px}.app-work-card>a{display:inline-block;margin:12px 16px 0 0}.app-ticket-list{display:grid;gap:8px}.app-ticket-list button{text-align:left;white-space:normal}.app-message{padding:16px 0;border-bottom:1px solid var(--line,#ddd)}.app-message p{white-space:pre-wrap;overflow-wrap:anywhere}.app-message.private{background:var(--tint);padding:16px;border-left:3px solid var(--orange);border-radius:8px}.app-total{font-size:2rem;font-weight:700}@media(max-width:600px){.app-work-card{padding:16px}.app-workspace input,.app-workspace select{max-width:100%}}

/* ---------- Admin -> Plans and prices (20 Oct 2026) ---------- */
.price-rows { display: grid; gap: 8px; margin: 18px 0 12px; }
.price-row { display: grid; grid-template-columns: minmax(140px, 1.4fr) 92px repeat(3, minmax(90px, 1fr)) 70px; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.price-row.head { background: none; border: 0; padding-block: 0; }
.price-row input, .price-row select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.price-row input:focus, .price-row select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--glow); }
.price-country { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; }
.price-country input { text-transform: uppercase; }
@media (max-width: 760px) {
  .price-row { grid-template-columns: 1fr 1fr; }
  .price-row.head { display: none; }
  .price-row > :first-child { grid-column: 1 / -1; }
}
.set-card select.mk-add { display: block; width: auto; min-width: 220px; height: 40px; margin: 12px 0 4px; padding: 0 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; font-weight: 600; }

/* ---------- "Install the app": the bar above every screen and the once-a-visit window (pwa.client.js) ---------- */
.install-nag { position: relative; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--on-accent); background: var(--orange); border-bottom: 1px solid rgba(24, 25, 28, 0.25); animation: nag-shake 12s ease-in-out 3s infinite; }
.install-nag-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; box-shadow: 0 2px 8px rgba(24, 25, 28, 0.25); }
.install-nag-text { display: grid; gap: 1px; min-width: 0; flex: 1; font-size: 0.92rem; line-height: 1.35; }
.install-nag-text strong { font-weight: 700; }
.install-nag .install-nag-go { flex: none; width: auto; margin: 0; padding: 10px 16px; color: #FFFFFF; background: #18191C; border-color: #18191C; box-shadow: 0 3px 0 rgba(24, 25, 28, 0.4); }
.install-nag-later { flex: none; padding: 8px 4px; font: inherit; font-size: 0.85rem; font-weight: 600; color: rgba(24, 25, 28, 0.62); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .install-nag-later:hover { color: #18191C; } }
.install-nag :focus-visible { outline: 3px solid #18191C; outline-offset: 2px; }
@keyframes nag-shake { 0%, 6%, 100% { transform: none; } 1% { transform: translateX(-6px) rotate(-0.4deg); } 2% { transform: translateX(6px) rotate(0.4deg); } 3% { transform: translateX(-4px); } 4% { transform: translateX(4px); } 5% { transform: translateX(-2px); } }
@media (max-width: 640px) {
  .install-nag { flex-wrap: wrap; padding: 10px 12px; }
  .install-nag-text { flex-basis: calc(100% - 52px); }
  .install-nag .install-nag-go { flex: 1; }
}
dialog.install-ask { width: min(420px, calc(100vw - 32px)); padding: 28px 26px 22px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--lift); text-align: center; }
dialog.install-ask::backdrop { background: rgba(12, 13, 15, 0.62); backdrop-filter: blur(3px); }
dialog.install-ask[open] { animation: ask-in 0.35s cubic-bezier(.2, .8, .2, 1.2); }
.install-ask-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 18px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); animation: ask-bounce 2.4s ease-in-out 3; /* three bounces, then still */ }
dialog.install-ask h2 { margin: 0 0 14px; font-size: 1.45rem; }
.install-ask-perks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; text-align: left; }
.install-ask-perks li { display: flex; gap: 10px; align-items: baseline; }
.install-ask-perks li::before { content: "✓"; flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 0.8rem; font-weight: 700; color: var(--on-accent); background: var(--orange); }
.install-ask-steps { margin: 0 0 18px; padding: 12px 14px 12px 34px; text-align: left; background: var(--soft); border-radius: 12px; display: grid; gap: 6px; font-size: 0.95rem; }
.install-ask-actions { display: grid; gap: 8px; }
.install-ask-actions .button { width: 100%; justify-content: center; }
.install-ask-actions .link { justify-self: center; font-size: 0.88rem; color: var(--muted); }
@keyframes ask-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes ask-bounce { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-10px); } 86% { transform: none; } 92% { transform: translateY(-4px); } }
@media (max-width: 640px) {
  dialog.install-ask { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .install-nag, .install-ask-icon, dialog.install-ask[open] { animation: none; } }

/* ---------- The launch screen (22 Oct 2026; Dhruv: "when someone opens the app on a phone it looks like this...
   do something good that a phone app should have") ----------
   Every first load opens like an app (on computers too since 28 Oct 2026; Dhruv chose it over a page-shaped
   placeholder): the logo in the middle of the screen, in the
   look chosen on this device (look.client.js sets it before anything is drawn),
   (the same picture the iPhone shows before anything loads: icons/launch-*.png, and the manifest's colour on
   Android), with a thin orange bar while the scripts load. endLaunch() in portal.client.js fades it away when
   the first real screen is drawn; if the scripts never run, it goes by itself after 10 seconds. */
/* The loader is just the W: its stroke writes itself, pauses, and starts again (Dhruv, 28 Oct 2026: "just a W
   logo... something that looks like loading"). No bar. */
.launch { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); animation: launch-out 0.3s ease 10s forwards; }
.launch-mark { width: 88px; height: 88px; }
.launch-w { stroke-dasharray: 100; stroke-dashoffset: 100; animation: launch-write 1.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.launch.done { animation: launch-out 0.35s ease forwards; }
.launch.done .launch-mark { animation: launch-pop 0.35s ease forwards; }
@keyframes launch-write { 0% { stroke-dashoffset: 100; } 55%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes launch-pop { to { transform: scale(1.18); opacity: 0; } }
@keyframes launch-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .launch-w { animation: none; stroke-dashoffset: 0; } .launch.done .launch-mark { animation: none; } }

/* ---------- The tab bar along the bottom on phones (tabBar in portal.client.js) ---------- */
.tabbar { display: none; }
@media (max-width: 640px) {
  .tabbar { position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--line-strong); }
  .tab { display: grid; justify-items: center; gap: 3px; min-height: 50px; padding: 5px 2px 2px; font: inherit; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; color: var(--muted); text-decoration: none; background: none; border: 0; border-radius: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab-icon { position: relative; display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; transition: background 0.2s, transform 0.12s; }
  .tab-icon svg { width: 22px; height: 22px; }
  .tab:active .tab-icon { transform: scale(0.9); }
  .tab[aria-current="page"] { color: var(--text); }
  .tab[aria-current="page"] .tab-icon { color: var(--accent-text); background: var(--tint); }
  .tab:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
  .tab-badge { position: absolute; top: -4px; left: 30px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; line-height: 1; color: var(--on-accent); background: var(--orange); border: 2px solid var(--surface); border-radius: 999px; }
  .shell:has(.tabbar) .topbar .menu-button { display: none; } /* "More" opens the menu instead */
  /* room for the tabs under the page, and the guide panel sits above them */
  .shell:has(.tabbar) .main { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  body:has(.tabbar) .guidebox, body:has(.tabbar) .guide-pill { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body:has(.tabbar) .guidebox { max-height: calc(62vh - 64px); }
}
/* NO viewport-fit=cover (22 Oct 2026): drawing under the iPhone's status bar made iOS blur the top of the app
   (Dhruv: "why is the top section blurred"). The page starts below the status bar; the tabs keep clear of the
   home bar with a little room of their own in the installed app. */
@media (max-width: 640px) and (display-mode: standalone) {
  .tabbar { padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
}

/* ---------- ⓘ next to technical words (terms.client.js) and what it opens ---------- */
.term-i { display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 2px 0 5px; padding: 0; vertical-align: 0.08em; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: help; font: italic 700 10px/1 Georgia, "Times New Roman", serif; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.term-i::before { content: "i"; }
.term-i:focus-visible { color: var(--accent-text); border-color: var(--orange); background: var(--tint); }
@media (hover: hover) and (pointer: fine) { .term-i:hover { color: var(--accent-text); border-color: var(--orange); background: var(--tint); } }
.term-i:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
h1 .term-i, h2 .term-i { width: 18px; height: 18px; font-size: 11px; vertical-align: 0.25em; }
.term-pop { position: fixed; z-index: 120; width: min(300px, calc(100vw - 16px)); display: grid; gap: 6px; padding: 14px 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--lift); font-size: 0.92rem; line-height: 1.45; text-align: left; }
.term-pop strong { font-size: 1rem; }
.term-pop p { margin: 0; color: var(--muted); }
.term-pop a { justify-self: start; font-weight: 650; color: var(--accent-text); }
@media print { .term-i { display: none; } }

/* Admin -> Partners: a read-only link with a Copy button beside it */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; }

/* Real logos of outside services (src/brands.js): in their own colours, never tinted by the menu */
.brand-logo { flex: none; }
svg.icon.brand-logo { stroke: none; }
.with-logo { display: inline-flex; align-items: center; gap: 8px; }
.with-logo .brand-logo { width: 18px; height: 18px; }
:root:not([data-theme="light"]) .brand-logo.deep { background: #fff; border-radius: 4px; padding: 2px; }
h1.with-logo .brand-logo { width: 26px; height: 26px; }
/* A page title with a logo is a block, so a "← Back" link before it sits on its own line (bug report 13) */
h1.with-logo { display: flex; }

/* Room under every screen for the open guide panel (guide.client.js sets --guide-room to its height). */
body.app:has(.guidebox) .main { padding-bottom: var(--guide-room, 0px); }
/* Wide screens: the panel sits beside the page instead of over it. */
@media (min-width: 1180px) { body.app:has(.guidebox) .main { padding-right: 380px; padding-bottom: 0; } }

/* Team -> Roles: custom roles and their editor (roles.client.js) */
.role-grid { display: grid; gap: 10px; margin: 8px 0 16px; }
.role-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.role-row > div:first-child { flex: 1 1 260px; min-width: 0; }
.role-levels { flex: none; }
.role-templates { margin: 6px 0 14px; }
.role-levels button.on { color: var(--on-ink); background: var(--text); }
@media (max-width: 640px) { .role-levels { width: 100%; } .role-levels button { flex: 1; padding: 8px 6px; } }

/* "Show all tools" in a new store's calm side menu */
.side-more { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; border-radius: 10px; cursor: pointer; text-align: left; }
@media (hover: hover) and (pointer: fine) { .side-more:hover { color: var(--text); background: var(--soft); } }
.side-more .icon { width: 18px; height: 18px; }
.role-note { margin-top: 14px; }

/* New section labels keep their compact shared tag shape. */
.pick-words > .tag{align-self:flex-start;margin:3px 0}

/* Confirming a dangerous action by typing a word (confirmTyped in portal.client.js) */
dialog.confirm-typed { width: min(460px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--lift); }
dialog.confirm-typed::backdrop { background: rgba(0, 0, 0, .55); }
dialog.confirm-typed h2 { margin: 6px 0 8px; font-size: 1.3rem; }
dialog.confirm-typed .ct-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); font-weight: 800; font-size: 1.2rem; }
dialog.confirm-typed .ct-word { color: var(--bad); font-weight: 800; -webkit-user-select: text; user-select: text; }
dialog.confirm-typed .field { margin-top: 16px; }
dialog.confirm-typed .ct-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.button.danger-fill { background: var(--bad); color: #fff; border-color: var(--bad); box-shadow: none; }
.button.danger-fill:disabled { opacity: .45; cursor: not-allowed; }

/* Admin -> Themes: dropping theme files, and the AI steps */
.theme-drop { display: grid; gap: 6px; place-items: center; text-align: center; padding: 34px 20px; margin: 14px 0 6px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--soft); cursor: pointer; }
.theme-drop.over { border-color: var(--orange); background: var(--tint); }
.theme-drop strong { font-size: 1.1rem; }

/* The portal's own dialogs (dialogBox, askConfirm, tell, askText in portal.client.js), in place of the browser's boxes */
dialog.app-dialog .dialog-text { margin: 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
dialog.app-dialog h2 + .dialog-text { margin-top: 2px; }
dialog.app-dialog > form > input { width: 100%; margin-top: 14px; }
dialog.app-dialog .ct-actions { flex-wrap: wrap; }
dialog.app-dialog .dialog-extra { margin-right: auto; color: var(--bad); }
dialog.app-dialog .ct-actions { align-items: center; }
dialog.app-dialog .ct-actions .button { width: auto; margin: 0; }
@media (max-width: 480px) { dialog.app-dialog .ct-actions { flex-direction: column-reverse; align-items: stretch; } dialog.app-dialog .ct-actions .button { width: 100%; } dialog.app-dialog .dialog-extra { margin-right: 0; } }

/* The page card always fills the screen down to the bottom, even when there is little on it (Dhruv, 28 Oct 2026:
   "I need a full page of this kind of information, even though there is nothing to show"). A screen that ends in
   an empty state ("Nothing waiting") lets that box take the rest of the page, with its words in the middle. */
.main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.main > .page { flex: 1 0 auto; margin-bottom: clamp(12px, 3vw, 32px); }
.main > .page:has(> .empty:last-child) { display: flex; flex-direction: column; }
.main > .page:has(> .empty:last-child) > * { flex: none; }
.main > .page > .empty:last-child { flex: 1 0 220px; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px; text-align: center; }
.main > .page > .empty:last-child strong { font-size: 1.15rem; }
.main > .page > .empty:last-child .hint { max-width: 46ch; }

/* Installing on Apple devices: the step-by-step guide and the arrow pointing at Safari's own button (installGuide in pwa.client.js) */
dialog.install-guide { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 16px; display: grid; place-items: center; background: rgba(12, 13, 15, 0.62); border: 0; color: var(--text); overflow: auto; }
dialog.install-guide::backdrop { background: transparent; }
.guide-card { width: min(460px, 100%); padding: 26px 24px 22px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--lift); text-align: center; }
.guide-card h2 { margin: 0 0 6px; font-size: 1.4rem; }
.guide-card > .hint { margin: 0 0 16px; }
.guide-card > .button { width: 100%; margin: 18px 0 0; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.guide-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
.guide-n { width: 30px; min-width: 30px; height: 30px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-weight: 700; color: var(--on-accent); background: var(--orange); }
.guide-words { display: grid; gap: 2px; min-width: 0; }
.guide-words strong { font-size: 1.02rem; }
.guide-words .hint { margin: 0; font-size: 0.86rem; }
.guide-pics { display: flex; align-items: center; gap: 6px; }
.guide-pic { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 0.85rem; font-weight: 600; color: #0A84FF; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; white-space: nowrap; }
.guide-pic.row { color: var(--text); }
.guide-pic.row .guide-glyph { color: var(--text); }
.guide-pic.menu { color: var(--text); font-weight: 700; padding: 5px 12px; border-radius: 6px; }
.guide-pic.go { color: #0A84FF; font-weight: 700; }
.guide-glyph { width: 22px; height: 22px; flex: none; }
/* The arrow: fixed to the screen edge where Safari's button is, bobbing towards it. */
.guide-arrow { position: fixed; z-index: 1; display: grid; justify-items: center; gap: 4px; color: #18191C; pointer-events: none; }
.guide-arrow span { padding: 6px 12px; font-weight: 700; color: var(--on-accent); background: var(--orange); border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.guide-arrow::after { content: ""; width: 0; height: 0; border: 14px solid transparent; }
.at-bottom .guide-arrow { left: 50%; bottom: 10px; transform: translateX(-50%); animation: guide-bob-down 1s ease-in-out infinite; }
.at-bottom .guide-arrow::after { border-top: 18px solid var(--orange); border-bottom-width: 0; }
.at-top-right .guide-arrow, .at-top-left .guide-arrow { top: 10px; flex-direction: column; animation: guide-bob-up 1s ease-in-out infinite; }
.at-top-right .guide-arrow { right: 16px; }
.at-top-left .guide-arrow { left: 64px; }
.at-top-right .guide-arrow::after, .at-top-left .guide-arrow::after { order: -1; border-bottom: 18px solid var(--orange); border-top-width: 0; }
.at-bottom .guide-card { margin-bottom: 70px; }
.at-top-right .guide-card, .at-top-left .guide-card { margin-top: 70px; }
@keyframes guide-bob-down { 50% { transform: translate(-50%, 8px); } }
@keyframes guide-bob-up { 50% { transform: translateY(-8px); } }
@media (max-width: 420px) { .guide-step { grid-template-columns: 30px minmax(0, 1fr); } .guide-step > :last-child { grid-column: 2; justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .guide-arrow { animation: none !important; } }

/* WhatsApp: one-click connect (Meta's Embedded Signup) and the folded "own Meta app" way */
.wa-connect { border-color: color-mix(in srgb, #25D366 45%, var(--line-strong)); }
.wa-connect .wa-go { display: inline-flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.wa-connect h3 { margin: 18px 0 4px; font-size: 1rem; }
details.more-box { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
details.more-box > summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--muted); }
details.more-box[open] { padding-bottom: 14px; }

/* Site settings: the browser tab icon (favicon) picker, five small tiles drawn in the store's colours */
.fav-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.fav-pick { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; text-align: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; color: var(--text); font: inherit; }
@media (hover: hover) and (pointer: fine) { .fav-pick:hover { border-color: var(--orange); } }
.fav-pick.on { background: var(--tint); border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.fav-pick:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.fav-pick strong { font-size: .92rem; font-weight: 600; }
.fav-pick .hint { font-size: .78rem; }
.fav-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; font: 800 24px/1 system-ui, sans-serif; color: #18191C; background: var(--soft); }
.fav-circle { border-radius: 50%; }
.fav-outline { background: #fff; border: 4px solid; }
.fav-tile img { width: 100%; height: 100%; object-fit: cover; }
.fav-none { font: 600 10px/1.2 system-ui, sans-serif; color: var(--muted); padding: 2px; }

/* Paid stores: order notifications off on this device (notifyNag in pwa.client.js) */
.notify-nag { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px clamp(12px, 3vw, 28px) 0; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line-strong)); border-left: 4px solid var(--bad); border-radius: 12px; background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.notify-nag-text { flex: 1 1 260px; display: grid; gap: 2px; }
.notify-nag-text span { color: var(--muted); font-size: 0.92rem; }
.notify-nag-later { flex: none; padding: 6px 4px; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .notify-nag-later:hover { color: var(--text); } }

/* The store switcher's keyboard shortcut, shown on the account menu's "Switch store" row */
.switch-key { flex: none; margin-left: auto; padding: 1px 6px; font: 600 0.7rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; }
@media (pointer: coarse) { .switch-key { display: none; } }

/* Product screen: photos can be dropped on the Photos box (addPhotos in shop.client.js) */
.photo-drop { border: 1.5px dashed transparent; border-radius: 14px; padding: 6px; margin: -6px; transition: border-color .15s, background .15s; }
.photo-drop.drop-on { border-color: var(--orange); background: var(--tint); }
.photo-drop.busy { cursor: progress; }
.photo-drop .photo-drop-hint { margin: 6px 0 0; }
/* One-image boxes (page editor photos, site settings): a picture can be dropped or pasted on them (imageDropBox in editor.client.js) */
.field.image-drop { border: 1px dashed transparent; border-radius: 12px; padding: 6px; margin: 8px -7px; transition: border-color .15s, background .15s; }
.field.image-drop.drop-on { border-color: var(--orange); background: var(--tint); }
.field.image-drop.busy { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .field.image-drop, .photo-drop { transition: none; } }

/* Import products (showProductImport in shop.client.js) */
.import-drop { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; margin: 14px 0; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--surface); transition: border-color .15s, background .15s; }
.import-drop > svg { width: 30px; height: 30px; color: var(--muted); }
.import-drop.drop-on { border-color: var(--orange); background: var(--tint); }
.import-drop.busy { opacity: .6; cursor: progress; }
.import-steps:empty, .import-result:empty { display: none; }
.import-how h3 { margin: 0 0 6px; }
.import-how p { margin: 0 0 6px; }
.import-preview { display: grid; gap: 12px; }
.import-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.import-head svg { width: 20px; height: 20px; color: var(--good); }
.import-sample { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.import-sample li { display: grid; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line); }
.import-sample li:first-child { border-top: 0; }
.import-problems summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.import-problems ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.import-or { display: flex; align-items: center; gap: 12px; margin: 28px 0 8px; color: var(--muted); font-size: .9rem; }
.import-or::before, .import-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.import-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.import-platform { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; font: inherit; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
@media (hover: hover) and (pointer: fine) { .import-platform:hover { border-color: var(--orange); } }
.import-platform.on { background: var(--tint); border-color: var(--orange); }
.import-platform:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.import-logo { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; font: 800 15px/1 system-ui, sans-serif; letter-spacing: -.02em; }

/* Store switcher: a dot on each store's tile, green = customers can open it, red = not live (storeOpen) */
.profile-store .store-tile { position: relative; }
.store-dot { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); }
.store-dot.on { background: #1f9d55; }
.store-dot.off { background: #d93025; }

/* Product info score (productScore in shop.client.js): a ring on the product screen, a chip in the list */
.p-score { display: flex; align-items: center; gap: 18px; margin: 4px 0 18px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); --tone: #d93025; }
.p-score.ok { --tone: #d97706; }
.p-score.good { --tone: #1f9d55; }
.p-score-ring { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--score, 0) * 1%), var(--soft) 0); }
.p-score-ring span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); font-weight: 700; font-size: 1.05rem; }
.p-score-text { min-width: 0; }
.p-score-text strong { display: block; margin-bottom: 4px; }
.p-score-text ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.p-score-text li small { color: var(--tone); font-weight: 700; }
.score-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.score-chip.good { background: color-mix(in srgb, #1f9d55 16%, transparent); color: var(--good); }
.score-chip.ok { background: color-mix(in srgb, #d97706 18%, transparent); color: var(--text); }
.score-chip.low { background: color-mix(in srgb, #d93025 15%, transparent); color: var(--bad); }
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Search engine listing preview on the product screen */
.seo-snippet { display: grid; gap: 2px; margin: 8px 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-family: Arial, sans-serif; }
.seo-snippet .seo-url { color: var(--muted); font-size: 12.5px; }
.seo-snippet strong { color: #1a0dab; font-weight: 400; font-size: 18px; }
:root:not([data-theme="light"]) .seo-snippet strong { color: #8ab4f8; }
.seo-snippet span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* Product screen: saved or not (paintSave in shop.client.js), next to the name and stuck to the top while scrolling */
.product-head { position: sticky; top: 60px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 8px; padding: 8px 0; background: var(--surface); }
.product-head h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.product-save { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); box-shadow: var(--lift, none); --tone: var(--muted); }
.product-save.saved { --tone: #1f9d55; }
.product-save.unsaved { --tone: #d97706; border-color: color-mix(in srgb, #d97706 45%, var(--line-strong)); }
.product-save.saving { --tone: var(--orange); }
.product-save.failed { --tone: #d93025; border-color: color-mix(in srgb, #d93025 45%, var(--line-strong)); }
.save-dot { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--tone); color: #fff; flex: none; }
.save-dot svg { width: 12px; height: 12px; }
.product-save.unsaved .save-dot, .product-save.failed .save-dot { width: 10px; height: 10px; margin: 0 4px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 22%, transparent); }
.product-save.saving .save-dot { width: 14px; height: 14px; background: none; border: 2px solid var(--tone); border-right-color: transparent; animation: save-spin .8s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .product-save.saving .save-dot { animation: none; } }
.save-words { display: grid; line-height: 1.2; }
.save-words strong { font-size: .88rem; }
.save-words small { color: var(--muted); font-size: .74rem; }
.save-words small:empty { display: none; }
.product-save .button.small { padding: 5px 12px; min-height: 0; border-radius: 999px; }
@media (max-width: 640px) { .save-words small { display: none; } }

/* Import screen: how to fill in the sample, and the ChatGPT prompt */
.import-guide { margin: 14px 0 4px; padding: 4px 16px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.import-guide > summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.import-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-table { width: 100%; border-collapse: collapse; font-size: .82rem; white-space: nowrap; }
.import-table th, .import-table td { padding: 7px 10px; text-align: left; border-top: 1px solid var(--line); }
.import-table th { border-top: 0; background: var(--soft); font-weight: 600; color: var(--muted); }
.import-table tr.first td { border-top: 2px solid var(--line-strong); font-weight: 600; }
.import-table td.blank { color: var(--muted); opacity: .5; font-weight: 400; }
.import-rules { margin: 12px 0; padding-left: 18px; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; }
.import-ai { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-radius: 12px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.import-ai > div { flex: 1 1 280px; }
.import-ai p { margin: 4px 0 0; }

/* Products list: choosing several to delete at once (showProducts) */
.row-pick { flex: none; width: 18px; height: 18px; margin: 0 4px 0 0; accent-color: var(--orange); cursor: pointer; }
.head-pick { display: inline-flex; align-items: center; gap: 8px; }
.bulk-bar { position: sticky; top: 64px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 10px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line-strong)); border-radius: 12px; background: var(--surface); box-shadow: var(--lift, none); }
.bulk-bar .bulk-gap { flex: 1; }

/* Product-row uploads reuse the editor's drop tint and the portal's status tones. */
.table.products .row.product-photo-target.drop-on{background:var(--tint);outline:2px dashed var(--orange);outline-offset:-3px}
.table.products .row.photo-uploading{cursor:progress}
.row-photo-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.row-photo-tools .link{font-size:13px;min-height:28px;cursor:pointer}
.row-photo-tools button:disabled{opacity:.6;cursor:default}
.row-photo-tools button:focus-visible{outline:2px solid var(--orange);outline-offset:3px}
.row-photo-status{display:block;min-height:1.3em;max-width:48ch;overflow-wrap:anywhere;font-size:13px}
@media(prefers-reduced-motion:reduce){.product-photo-target{transition:none}}

.row-photo-status.bad{color:var(--bad)}

/* Touch screens and feel (the emil-design-eng and mobile-native skills, 31 Oct 2026): no grey flash on tap, no tap
   delay, long-press on a control doesn't select its words, a stronger ease-out for small motion, and a light press
   on the tappable cards that had none (buttons keep their own "step down"). */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
a, button, summary, label, select, [role="button"], input[type="checkbox"], input[type="radio"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, .button, summary, .tab, [role="button"], .side-nav a, .profile-item, .pick-card, .fav-pick, .import-platform, .profile-store { -webkit-user-select: none; user-select: none; }
.pick-card, .fav-pick, .import-platform, .profile-item, .profile-store, .side-nav a { transition: transform 140ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.pick-card:active, .fav-pick:active, .import-platform:active, .profile-item:active, .profile-store:active, .side-nav a:active { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) { .pick-card:active, .fav-pick:active, .import-platform:active, .profile-item:active, .profile-store:active, .side-nav a:active { transform: none; } }
/* In-app windows open with a short fade and a slight scale from the centre (180ms, ease-out); closing stays instant. */
dialog.confirm-typed[open], dialog.chooser[open] { animation: win-in 180ms var(--ease-out); }
dialog.confirm-typed[open]::backdrop, dialog.chooser[open]::backdrop { animation: win-fade 180ms ease-out; }
@keyframes win-in { from { opacity: 0; transform: scale(0.97); } }
@keyframes win-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.confirm-typed[open], dialog.chooser[open] { animation: win-fade 120ms ease-out; } }
/* Products list rows (screen review, 31 Oct 2026): the name on its own line, then status, info score and photo tools
   on ONE line, and the upload status only when there's something to say. Shows about twice as many products. */
.row-product .row-main { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.row-product .row-main > a { flex-basis: 100%; overflow-wrap: anywhere; line-height: 1.3; }
.row-product .row-photo-tools { gap: 8px; }
.row-product .row-photo-tools .link { min-height: 0; }
.row-product .row-photo-status { flex-basis: 100%; min-height: 0; }
.row-product .row-photo-status:empty { display: none; }
.row-cell.stocks { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.stock.more { cursor: help; }
/* The product screen's sticky header stays compact with a long product name (screen review): a smaller title, two
   lines at most, and a hairline under it so the form scrolling beneath reads as separate. */
.product-head { border-bottom: 1px solid var(--line); }
.product-head h1 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1 1 320px; }
.orders-todo { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 600; color: var(--accent-text); }
.orders-todo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 20%, transparent); }
/* Number cards: four in a row when there's room, else two by two, never three with one left alone (screen review). */
.stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .stats:has(> :nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }

/* Admin -> Wraps (the Wrap manager) */
.wrap-admin-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wrap-targets { margin-top: 8px; }
/* .page section.set-card sets margin-top: 0, so this needs the same weight (bug report 15: the cards touched) */
.page section.set-card.wrap-box { margin-top: 14px; }

/* The theme screen's font picker */
.font-pick { margin: 8px 0; }
.font-pick.open { padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.font-pick.open .font-current { border-color: var(--orange); }
.font-current { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 12px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.font-current:disabled { cursor: default; }
.font-current:focus-visible, .font-row:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.font-panel { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px 4px; }
.font-panel .search { display: flex; align-items: center; gap: 8px; max-width: none; flex: none; margin: 0; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; }
.font-panel .search .icon { width: 16px; height: 16px; color: var(--muted); }
.font-panel .search input { flex: 1; min-width: 0; padding: 7px 0; font: inherit; color: var(--text); background: none; border: 0; outline: none; }
.font-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.font-kinds button { padding: 3px 9px; font: inherit; font-size: 0.8rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.font-kinds button[aria-pressed="true"] { color: var(--on-ink); background: var(--text); border-color: var(--text); }
@media (hover: hover) and (pointer: fine) { .font-kinds button:not([aria-pressed="true"]):hover { color: var(--text); border-color: var(--line-strong); } }
.font-kinds button:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.font-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.font-meta .hint { margin: 0; font-size: 0.8rem; }
.font-meta select { width: auto; min-width: 0; max-width: 55%; min-height: 0; padding: 3px 6px; font-size: 0.8rem; }
.font-list { display: flex; flex-direction: column; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.font-none { margin: 0; padding: 10px 12px; }
.font-upload { padding: 2px 2px 0; }
.font-upload > summary { font-size: 0.88rem; font-weight: 600; color: var(--muted); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .font-upload > summary:hover { color: var(--text); } }
.font-upload[open] { display: flex; flex-direction: column; gap: 8px; }
.font-upload .check, .font-upload .hint { margin: 0; font-size: 0.88em; }
.font-list li { border-bottom: 1px solid var(--line); }
.font-list li:last-child { border-bottom: 0; }
.font-own { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.font-row { flex: 1; min-width: 0; width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 1.05rem; text-align: left; color: var(--text); background: transparent; border: 0; cursor: pointer; overflow-wrap: anywhere; }
.font-row[aria-pressed="true"] { color: var(--on-ink); background: var(--text); }
@media (hover: hover) and (pointer: fine) { .font-row:not([aria-pressed="true"]):hover { background: var(--line); } }

/* The Wraps panel: a second sidebar (wraps.client.js) */
.side-wraps { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; font: inherit; font-weight: 500; text-align: left; color: var(--text); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.side-wraps .icon { flex: none; width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .side-wraps:hover { background: var(--soft); } }
.side-wraps.here { background: var(--tint); font-weight: 600; }
.side-wraps.here .icon { color: var(--accent-text); }
.side-wraps:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
body.side-folded .side-wraps { justify-content: center; width: 48px; }
body.side-folded .side-wraps .side-badge { display: none; }
.wraps-panel-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.wraps-panel-head strong { font-size: 1.05rem; }
.wraps-panel-close { display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .wraps-panel-close:hover { color: var(--text); background: var(--soft); } }
.wraps-panel .chips { margin: 0; }
.wraps-panel input[type="search"] { width: 100%; min-height: 38px; padding: 8px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; }
.wraps-panel-said { margin: 0; min-height: 0; }
.wraps-panel-said:empty { display: none; }
.wraps-panel-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; }
.wraps-panel-list .side-title { margin-top: 10px; }
.wraps-panel-list .side-title:first-child { margin-top: 0; }
.wraps-panel-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.wraps-panel-row.here { background: var(--tint); }
@media (hover: hover) and (pointer: fine) { .wraps-panel-row:hover { background: var(--soft); } .wraps-panel-row.here:hover { background: var(--tint); } }
.wraps-panel-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; }
.wraps-panel-icon .icon { width: 18px; height: 18px; }
.wraps-panel-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wraps-panel-name > a, .wraps-panel-name > span:first-child { font-weight: 550; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.wraps-panel-name .hint { font-size: 0.78rem; margin: 0; }
.wrap-switch { flex: none; position: relative; width: 36px; height: 22px; padding: 0; background: var(--line-strong); border: 0; border-radius: 999px; cursor: pointer; transition: background-color 0.16s ease; }
.wrap-switch[aria-checked="true"] { background: var(--orange); }
.wrap-switch:disabled { opacity: 0.6; cursor: progress; }
.wrap-switch:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.wrap-switch-dot { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.16s ease; }
.wrap-switch[aria-checked="true"] .wrap-switch-dot { transform: translateX(14px); }
.wraps-panel-foot { padding: 8px 4px 0; border-top: 1px solid var(--line); font-size: 0.85rem; }
.wraps-panel-foot:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .wrap-switch, .wrap-switch-dot { transition: none; } }
/* Report a problem (bugs.client.js) */
.bug-open { flex: none; display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bug-open .icon { width: 18px; height: 18px; }
.bug-open[aria-busy="true"] { opacity: 0.5; cursor: progress; }
.bug-open:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .bug-open:hover { color: var(--text); background: var(--soft); } }
dialog.bug-report { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--lift); }
dialog.bug-report::backdrop { background: rgba(0, 0, 0, 0.5); }
.bug-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bug-report-head h2 { margin: 0; }
.bug-picture { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.bug-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.bug-tools .chip { padding: 5px 12px; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.bug-tools .chip.on { color: var(--on-ink); background: var(--text); }
.bug-tools .chip:disabled { opacity: 0.5; cursor: default; }
.bug-canvas-box { overflow: hidden; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.bug-canvas { display: block; width: 100%; max-height: 52dvh; object-fit: contain; cursor: crosshair; touch-action: none; }
.bug-picture-actions { flex-wrap: wrap; gap: 14px; }
.bug-upload { cursor: pointer; }
.bug-label { display: block; margin: 12px 0 6px; font-weight: 600; }
dialog.bug-report textarea { width: 100%; }
.bug-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.bug-head .check { margin: 0; }
.bug-bar { position: sticky; top: 64px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--tint); border: 1px solid var(--line-strong); border-radius: 10px; }
.bug-bar[hidden] { display: none; }
.bug-list .bug-row { display: grid; grid-template-columns: auto 132px minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.bug-row > input[type="checkbox"] { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--orange); }
.bug-thumb { display: block; overflow: hidden; height: 84px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.bug-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bug-thumb.none { display: grid; place-items: center; font-size: 0.78rem; color: var(--muted); }
.bug-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bug-details { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-more { margin-top: 6px; font-size: 0.85rem; }
.bug-more pre { overflow-x: auto; white-space: pre-wrap; font-size: 0.78rem; }
@media (max-width: 760px) {
  .bug-list .bug-row { grid-template-columns: auto minmax(0, 1fr); }
  .bug-text, .bug-row .actions { grid-column: 1 / -1; }
}
.bug-none { margin: 0; padding: 28px 12px; text-align: center; background: var(--soft); border-radius: 8px; }

/* Every drop-down: our own arrow, with room from the edge (bug report #3). */
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 34px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858585' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 14px !important; }

/* A boxed section always has the same room inside it (bug report #2). */
section.panel { padding: 18px; }
.page section.panel { margin: 16px 0; }
section.panel > h2 { margin: 0 0 8px; }
section.panel > :last-child { margin-bottom: 0; }
section.panel[open] { padding-bottom: 18px; }

/* Shop pages (editor.client.js) */
.shop-pages { margin-top: 28px; }
.shop-pages.compact { margin-top: 14px; }
.shop-pages.compact h3 { margin: 0 0 6px; font-size: 0.92rem; }
.shop-page-row { width: 100%; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.shop-page-row:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }

/* The blog screens (blog.client.js) */
.blog-row-cover { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.blog-cover-pick { display: block; max-width: 280px; max-height: 180px; margin: 6px 0; object-fit: cover; border-radius: 8px; }
.field-title { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
#post-body { width: 100%; padding: 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.blog-actions { flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }

/* Windows in the middle of the screen: store switcher, search, Wraps. The same size however much is in them. */
dialog.palette { width: min(620px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 48px)); margin: auto; padding: 0; overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--lift); }
dialog.palette[open] { display: flex; flex-direction: column; }
dialog.palette::backdrop { background: rgba(24, 25, 28, 0.45); }
.palette-field { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-field .icon { flex: none; width: 18px; height: 18px; color: var(--muted); }
.palette-input { flex: 1; min-width: 0; padding: 0; font: inherit; font-size: 1.02rem; color: var(--text); background: none; border: 0; outline: none; }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.palette-row { display: flex; color: inherit; text-decoration: none; border-radius: 10px; }
.palette-row.side-result { display: grid; }
.palette-row.active { background: var(--tint); }
@media (hover: hover) and (pointer: fine) { .palette-row:hover { background: var(--soft); } .palette-row.active:hover { background: var(--tint); } }
.palette-none { margin: 0; padding: 14px 10px; color: var(--muted); }
.palette-foot { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px 16px; font-size: 0.88rem; border-top: 1px solid var(--line); }
.palette-foot .switch-key { margin-left: auto; }
.palette-wraps .wraps-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; padding: 16px; }
button.side-search-field { width: 100%; font: inherit; text-align: left; color: var(--muted); cursor: pointer; }
span.side-search-input { display: block; line-height: 36px; color: var(--muted); }
.wraps-panel-head .switch-key { margin-left: 0; }

/* Admin -> Themes: one library of every theme, as cards or a list (showAdminThemes in theme.client.js). */
.theme-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 12px; }
.theme-toolbar input[type="search"] { flex: 1 1 220px; max-width: 360px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 10px; }
.theme-toolbar .seg { margin: 0; }
.admin-themes { list-style: none; padding: 0; margin: 0; }
.admin-themes.as-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.admin-themes.as-cards .theme-item { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-themes.as-cards .admin-theme-pic { width: 100%; }
.admin-themes.as-list .theme-item { display: grid; grid-template-columns: 180px 1fr; align-items: start; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-themes.as-list .admin-theme-pic { grid-row: span 2; }
.admin-themes.as-list .theme-actions { grid-column: 2; }
.theme-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.theme-desc { margin: 6px 0 0; }
.theme-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: auto; }
.theme-versions { margin-top: 8px; }
.theme-versions summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; }
.admin-theme-pic { flex: none; display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-theme-pic .theme-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); pointer-events: none; }
.admin-theme-pic .theme-shot { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }
.admin-theme-pic.empty-pic { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--soft); }
.admin-theme-pic:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .admin-theme-pic:hover { border-color: var(--orange); } }
.admin-theme-words { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .admin-themes.as-list .theme-item { grid-template-columns: 1fr; }
  .admin-themes.as-list .admin-theme-pic { grid-row: auto; }
  .admin-themes.as-list .theme-actions { grid-column: auto; }
}
/* Batch delete: a tick on each theme, the bar above the list, and the code box (batchDeleteDialog). */
.theme-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.admin-themes.as-list .theme-pick { grid-column: 1 / -1; }
.admin-themes .theme-item.picked { border-color: var(--orange); }
.theme-batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 0.92rem; }
.theme-batch-bar .button { margin-left: auto; }
.theme-batch-list { max-height: 220px; overflow: auto; margin: 0; padding: 8px 12px; list-style: none; border: 1px solid var(--line); border-radius: 8px; }
.theme-batch-list li + li { margin-top: 4px; }
.theme-batch .field { display: grid; gap: 6px; }
.theme-batch .field input { font: inherit; font-size: 1.1rem; letter-spacing: 0.2em; padding: 10px 12px; max-width: 200px; color: var(--text); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 10px; }
/* The upload box */
.theme-upload { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--surface); color: var(--text); }
.theme-upload > * + * { margin-top: 14px; }
/* Versions, export and import of a store's look (theme.client.js lookDialog) */
.look-box { max-height: calc(100dvh - 32px); overflow: auto; }
.look-box .look-part { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; justify-items: start; }
.look-box .look-part h3 { margin: 0; font-size: 16px; }
.look-box .look-versions { width: 100%; }
.look-box .look-versions li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.look-box .look-left { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.theme-upload .theme-drop { display: grid; gap: 6px; place-items: center; text-align: center; padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--soft); cursor: pointer; }
.theme-upload .theme-drop.over { border-color: var(--orange); background: var(--tint); }
.upload-kind { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.upload-kind legend { font-weight: 600; margin-bottom: 4px; }
.how-to summary { cursor: pointer; font-weight: 600; }
/* Product form: Deal of the day days (src/portal/shop.client.js) */
.deal-rows { display: grid; gap: 8px; margin: 8px 0 12px; }
.deal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deal-row input[type="text"] { max-width: 120px; }
/* Admin -> Themes: theme packs (src/portal/theme.client.js) */
.pack-versions { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.pack-versions li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pack-steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 4px; }

/* A product's personalisation options: one card each (bug report 18) */
.custom-rows { display: grid; gap: 12px; margin-top: 10px; }
.custom-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.custom-row .row-actions { justify-content: space-between; }
.custom-rows:empty { display: none; }

/* A product's collections: tick boxes that wrap (bug report 19) */
.col-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.col-pick { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.col-pick:has(input:checked) { border-color: var(--line-strong); background: var(--tint); }
.bulk-bar .bulk-cols { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bulk-bar .bulk-col { width: auto; max-width: 220px; min-height: 40px; padding: 0 12px; font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }

/* Inside a store, the platform admin menu is a panel in the opposite colours (bug report 16), so it never looks
   like one of the store's own screens. Its search results are marked the same way. */
.side-nav .admin-group { padding: 6px; background: var(--text); border-radius: 12px; }
.side-nav .admin-group .side-title { color: color-mix(in srgb, var(--on-ink) 70%, var(--text)); }
.side-nav .admin-group a, .side-nav .admin-group .side-wraps { color: color-mix(in srgb, var(--on-ink) 82%, var(--text)); background: transparent; }
.side-nav .admin-group a[aria-current="page"], .side-nav .admin-group .side-wraps.here { color: var(--on-ink); background: color-mix(in srgb, var(--on-ink) 16%, var(--text)); box-shadow: inset 3px 0 0 var(--orange); }
.side-nav .admin-group a[aria-current="page"] .icon, .side-nav .admin-group .side-wraps.here .icon { color: var(--on-ink); }
.side-nav .admin-group .side-badge { color: var(--on-ink); background: transparent; border-color: color-mix(in srgb, var(--on-ink) 40%, var(--text)); }
@media (hover: hover) and (pointer: fine) {
  .side-nav .admin-group a:hover, .side-nav .admin-group .side-wraps:hover { color: var(--on-ink); background: color-mix(in srgb, var(--on-ink) 10%, var(--text)); }
}
.side-result-kind.admin { justify-self: start; padding: 2px 6px; color: var(--on-ink); background: var(--text); border-radius: 6px; }

/* Reframe a photo for computers and phones (src/portal/editor.client.js, reframePhoto) */
dialog.app-dialog:has(.reframe) { width: min(760px, calc(100vw - 32px)); }
.reframe { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px 18px; margin-top: 8px; align-items: start; }
.reframe > .seg, .reframe > .hint, .reframe > .row-actions, .reframe > .reframe-zoom { grid-column: 1 / -1; }
.reframe-zoom { display: flex; align-items: center; gap: 6px; }
.reframe-zoom > span { font-weight: 600; margin-right: 4px; }
.reframe-zoom input[type=range] { flex: 1; max-width: 320px; height: 24px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--orange); }
.reframe-zoom .icon-btn { width: 32px; height: 32px; font-size: 18px; border: 1px solid var(--line); }
.reframe-zoom-value { min-width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reframe .seg { justify-self: start; }
.reframe-stage { position: relative; justify-self: center; max-width: 100%; touch-action: none; cursor: crosshair; user-select: none; }
.reframe-stage img { display: block; max-width: 100%; max-height: 44vh; border-radius: 8px; }
.reframe-shot { position: relative; overflow: hidden; border-radius: 8px; }
.reframe-crop { position: absolute; box-sizing: border-box; border: 1px solid var(--surface); box-shadow: 0 0 0 1px var(--text), 0 0 0 9999px color-mix(in srgb, var(--text) 45%, transparent); pointer-events: none; }
.reframe-crop[hidden] { display: none; }
.reframe-dot[hidden] { display: none; }
.reframe > .reframe-size, .reframe > .check { grid-column: 1 / -1; }
.reframe-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 1px var(--text); cursor: grab; }
.reframe-dot:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.reframe-previews { display: grid; gap: 12px; }
.reframe-previews figure { margin: 0; display: grid; gap: 4px; }
.reframe-previews img { width: 100%; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.reframe-desk img { aspect-ratio: 16 / 7; }
.reframe-phone { width: 120px; }
.reframe-phone img { aspect-ratio: 4 / 5; }
@media (max-width: 640px) { .reframe { grid-template-columns: minmax(0, 1fr); } .reframe-previews { grid-template-columns: minmax(0, 1fr) 96px; align-items: end; } .reframe-phone { width: auto; } }


/* Linked sections (editor.client.js linkBox): the same section on several pages. */
.linked-box { display: grid; gap: 6px; justify-items: start; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.linked-box p { margin: 0; }


/* The newsletter pop-up card's settings and its picture (newsCardBox in wraps.client.js). The card's own colours
   come from the store's settings, set as --ncp-* from script; the portal's tokens are the fallbacks. */
.nc-admin { margin-top: 28px; }
.nc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; align-items: start; }
@media (max-width: 900px) { .nc-grid { grid-template-columns: 1fr; } }
.nc-fields .colour-pick .link.inline { display: block; padding: 0; font-size: 0.8rem; }
.ncp-frames { position: sticky; top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: end; }
.ncp-frame { position: relative; margin: 0; padding: 0; overflow: hidden; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; }
.ncp-frame.desk { aspect-ratio: 4 / 3; }
.ncp-frame.mob { aspect-ratio: 9 / 18; border-radius: 18px; }
.ncp-frame figcaption { position: absolute; top: 6px; left: 10px; margin: 0; font-size: 0.75rem; }
.ncp-page { display: grid; gap: 8px; padding: 30px 12px 12px; }
.ncp-page i { display: block; height: 10px; background: var(--soft); border-radius: 4px; }
.ncp-page i:first-child { height: 46px; }
.ncp-page i:nth-child(3) { width: 60%; }
.ncp-off { position: absolute; inset: auto 0 12px; margin: 0; text-align: center; color: var(--muted); font-weight: 600; }
.ncp-card { --bg-c: var(--ncp-bg, var(--surface)); --fg-c: var(--ncp-fg, var(--text)); position: absolute; right: 10px; bottom: 10px; width: 62%; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 6px; background: var(--bg-c); color: var(--fg-c); border: 1px solid color-mix(in srgb, var(--fg-c) 14%, transparent); border-radius: 10px; box-shadow: var(--lift); font-size: 0.62rem; line-height: 1.35; }
.ncp-card.left { right: auto; left: 10px; }
.ncp-card.phone { left: 6px; right: 6px; bottom: 6px; width: auto; font-size: 0.52rem; padding: 8px 8px 4px; }
.ncp-h { font-size: 1.25em; padding-right: 14px; }
.ncp-t { opacity: 0.8; }
.ncp-offer { align-self: flex-start; padding: 1px 6px; border: 1px dashed var(--ncp-btn, var(--orange)); border-radius: 999px; font-weight: 700; }
.ncp-x { position: absolute; top: 4px; right: 7px; font-size: 1.4em; line-height: 1; }
.ncp-row { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.ncp-card.phone .ncp-row { flex-direction: row; }
.ncp-in { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid color-mix(in srgb, var(--fg-c) 26%, transparent); border-radius: 5px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncp-go { padding: 4px 6px; background: var(--ncp-btn, var(--orange)); color: var(--ncp-on, var(--on-ink)); border-radius: 5px; font-weight: 700; text-align: center; white-space: nowrap; }
.ncp-fine { font-size: 0.85em; opacity: 0.65; }
.ncp-no { align-self: center; text-decoration: underline; opacity: 0.75; }
.ncp-bars { display: flex; align-items: flex-end; gap: 2px; height: 48px; margin-top: 12px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.ncp-bars span { flex: 1; min-width: 2px; height: calc(var(--h, 0) * 1%); min-height: 1px; background: var(--orange); border-radius: 2px 2px 0 0; }

/* The setup roadmap (guide.client.js showRoadmap): the guide's step list, with a state tag and skip link per step. */
.roadmap { margin-top: 8px; }
.roadmap-step .guide-text strong { margin-right: 8px; }
.roadmap-step .guide-text .tag { vertical-align: 1px; }
.roadmap-step.skipped { opacity: .62; }
.roadmap-step.skipped .guide-text strong { text-decoration: line-through; text-decoration-color: var(--muted); }
.roadmap-actions { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 640px) {
  .roadmap-actions { grid-column: 2; flex-direction: row; align-items: center; justify-self: start; gap: 14px; }
}

/* Admin -> Sections by page (admin.client.js showAdminSections). */
.secmap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 4px; }
.secmap-search { flex: 1 1 220px; max-width: 360px; }
.secmap-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.secmap-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.secmap-chip small { min-width: 22px; padding: 1px 6px; font-size: 0.75rem; text-align: center; color: var(--muted); background: var(--bg); border-radius: 999px; }
.secmap-chip[aria-pressed="true"] { color: var(--text); background: var(--tint); border-color: var(--orange); }
.secmap-chip:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.secmap-body { display: grid; gap: 14px; }
.secmap-body > * { min-width: 0; }
.secmap-head h2 { margin: 0 0 6px; }
.secmap-head p { margin: 4px 0; }
.secmap-group .caps { margin: 0 0 10px; }
.secmap-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.secmap-row { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.secmap-pic { width: 112px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.secmap-words { display: grid; gap: 4px; min-width: 0; }
.secmap-words .hint { font-size: 0.85rem; }
.secmap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.secmap-tags code { font-size: 0.75rem; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.secmap-tags .tag { font-size: 0.75rem; padding: 2px 8px; white-space: normal; max-width: 100%; }
.secmap-off .secmap-row { opacity: .72; }
.secmap-plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.secmap-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.secmap-table { border-collapse: collapse; font-size: 0.85rem; min-width: 100%; }
.secmap-table th, .secmap-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.secmap-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-weight: 600; }
.secmap-table thead th .link { white-space: normal; min-width: 80px; font-size: 0.8rem; }
.secmap-table tbody th { position: sticky; left: 0; background: var(--surface); text-align: left; font-weight: 600; }
.secmap-table td.yes { color: var(--text); font-weight: 700; }
.secmap-table td.no { color: var(--muted); }
@media (max-width: 640px) {
  .secmap-list { grid-template-columns: 1fr; }
  .secmap-row { grid-template-columns: 84px 1fr; }
  .secmap-pic { width: 84px; }
}
@media (hover: hover) and (pointer: fine) {
  .secmap-chip:hover { background: var(--hover); }
  .secmap-table tbody tr:hover th, .secmap-table tbody tr:hover td { background: var(--hover); }
}

/* ---------- The link picker in the page editor (bug report 28): kind of place, then which one ---------- */
.link-pick { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; }
.link-pick select[hidden], .link-custom[hidden] { display: none; }
.link-pick:has(select[hidden]) { grid-template-columns: minmax(0, 1fr); }
.link-custom { margin-top: 8px; }

/* Bundles & Upsells builder (offers.client.js): the form on the left, a sketch of the buy box beside it. */
.offer-build { display: flex; flex-wrap: wrap-reverse; gap: 24px; align-items: flex-start; max-width: 1100px; }
.offer-build > section { flex: 1 1 420px; min-width: 0; }
.offer-preview-wrap { flex: 1 1 300px; max-width: 380px; position: sticky; top: 80px; }
.offer-group { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.offer-group h3 { margin: 0; font-size: 1rem; }
.offer-rows { display: grid; gap: 10px; }
.offer-row { display: grid; gap: 8px; }
.offer-row.boxed { padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--soft); }
.offer-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offer-colour { display: flex; align-items: center; gap: 12px; }
.offer-colour input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.offer-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.offer-start { display: grid; gap: 4px; padding: 16px; text-align: left; color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; }
.offer-start:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.offer-preview { --offer: var(--orange); display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.offer-preview-title { font-size: 0.95rem; text-align: center; }
.offer-preview-tier { position: relative; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.offer-preview-tier.on { border-color: var(--offer); background: color-mix(in srgb, var(--offer) 10%, var(--surface)); }
.offer-preview-tier small { display: block; color: var(--muted); }
.offer-preview-dot { width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 50%; }
.offer-preview-tier.on .offer-preview-dot { border: 5px solid var(--offer); }
.offer-preview-badge { position: absolute; top: -9px; right: 10px; padding: 1px 8px; font-size: 0.72rem; color: var(--on-ink); background: var(--offer); border-radius: 999px; }
.offer-preview-price { display: grid; justify-items: end; }
.offer-preview-price s { color: var(--muted); font-size: 0.8rem; }
.offer-preview-gift { margin: 0; font-size: 0.85rem; color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .offer-start:hover { background: var(--hover); border-color: var(--orange); }
}
@media (max-width: 860px) {
  .offer-preview-wrap { position: static; max-width: none; }
}

/* ---------- Connecting an AI app at the admin level (showConnectAdmin) and the store ID line ---------- */
.connect-reach { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; margin: 0 0 8px; }
.connect-reach legend { padding: 0 6px; font-weight: 700; }
.connect-reach .check { margin: 10px 0; }
.connect-stores { max-height: 240px; overflow: auto; border-top: 1px solid var(--line); padding-left: 4px; }
.connect-stores[hidden] { display: none; }
.connect-stores .check { font-weight: 500; margin: 8px 0; }
.store-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 0; }
.store-id code { font-size: 12px; overflow-wrap: anywhere; }

/* ---------- AI apps (MCP) page (showAiApps) ---------- */
.ai-level { border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px 14px; margin: 18px 0; }
.ai-copy { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.ai-copy input { flex: 1; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: transparent; color: inherit; }
.ai-what { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.ai-what h3, .ai-steps h3 { font-size: 15px; margin: 14px 0 6px; }
.ai-tools { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ai-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ai-what + .hint, .ai-tools + .hint { margin-top: 14px; }
.ai-tools li.is-paused > span:first-child { color: var(--muted); }
.ai-tools li .tag { margin-left: 8px; }

/* ---------- Admin -> AI apps: pause switches (showAdminMcp, src/mcp-pauses.js) ---------- */
.mcp-pause-box { margin: 16px 0; }
.mcp-pause-box.is-paused { border-color: var(--bad); }
.mcp-pause-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mcp-pause-row h2 { margin-bottom: 4px; }
.mcp-pause-row .wrap-switch { margin-top: 4px; }
.mcp-pause-tools { margin-top: 10px; }
.mcp-pause-box .field select { max-width: 100%; }

/* ---------- Code approvals (showDesignReviews, src/store-design.js) ---------- */
.design-review { min-width: 0; flex: 1; }
.design-reasons { margin: 6px 0; padding-left: 20px; display: grid; gap: 2px; }
.list .design-reasons li { display: list-item; padding: 0; border: 0; min-height: 0; }
.design-review details { margin-top: 6px; }
.design-code { max-height: 420px; overflow: auto; margin: 8px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The AI store builder card on the Pages screen (aiBuilderCard in src/portal/editor.client.js) */
section.panel.ai-build { padding: 18px; }
.ai-build h2 { margin: 0 0 6px; }
.ai-build .actions { flex-wrap: wrap; margin-top: 12px; }
.ai-build-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.ai-build-facts dt { font-weight: 600; }
.ai-build-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .ai-build-facts { grid-template-columns: 1fr; } .ai-build-facts dd { margin-bottom: 6px; } }

/* ---------- Dropshipping (src/portal/dropship.client.js) ---------- */
.ds-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 12px 0 16px; }
.ds-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ds-tab.on { color: var(--text); border-bottom-color: var(--orange); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .ds-tab:hover { color: var(--text); } }
.ds-body { display: grid; gap: 16px; }
.ds-filters { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-items: end; }
.ds-filters .field { margin: 0; }
.ds-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ds-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ds-card img, .ds-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.ds-card-body { display: grid; gap: 6px; padding: 12px; }
.ds-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 8px; font-size: 0.875rem; }
.ds-facts dt { color: var(--muted); }
.ds-facts dd { margin: 0; text-align: right; }
.ds-body .bad, .ds-table .bad, .ds-facts .bad { color: var(--bad); }
.ds-open { display: grid; gap: 10px; }
.ds-open-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ds-photos { display: flex; gap: 8px; overflow-x: auto; }
.ds-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; display: block; overflow-x: auto; }
.ds-table th, .ds-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ds-table th { color: var(--muted); font-weight: 500; }
.ds-lines { margin: 6px 0; padding-left: 18px; }
.ds-inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.ds-inline input { min-width: 0; flex: 1 1 180px; }
.ds-thread { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.ds-thread li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 85%; background: var(--surface); }
.ds-thread li.mine { margin-left: auto; background: var(--tint); }
.ds-thread p { margin: 0 0 2px; white-space: pre-wrap; }
.ds-stats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ds-stat { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ds-stat strong { font-size: 1.125rem; }
.ds-checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; margin: 8px 0; }
.ds-checks label { display: flex; gap: 8px; align-items: flex-start; }
.ds-address { font-style: normal; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; }
.ds-ask summary, .ds-body details summary { cursor: pointer; color: var(--accent-text); margin: 6px 0; }

/* ---------- One product in a picker: photo, name, price, See details (bug #32, 15 Nov 2026; shop.client.js productPick) ---------- */
.pick-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; min-width: 0; }
.pick-row > .check { flex: 1; min-width: 0; margin: 0; padding: 6px 0; font-weight: 500; }
.app-product-checks .pick-row > label { padding: 6px 8px; }
.pick-photo { display: contents; }
.pick-row .mini { width: 40px; height: 50px; border-radius: 8px; }
.pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-name { overflow-wrap: anywhere; }
.pick-text .hint { margin: 0; font-weight: 400; font-size: 0.88em; }
.pick-more { flex: none; font-size: 0.9em; white-space: nowrap; }
.pick-preview { margin: 6px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pick-preview[hidden] { display: none; }
