/* FawriChat dashboard. Colours are tokens (light + dark); spacing uses logical properties so Arabic mirrors. */
:root {
  --bg: #F3F5F7; --surface: #FFFFFF; --surface-2: #F6F8F9; --line: #E2E7EB; --line-strong: #CCD5DB;
  --ink: #15222B; --ink-2: #3A4A55; --muted: #667682;
  --accent: #0F6E6A; --accent-ink: #FFFFFF; --accent-soft: #E3F1EF; --accent-line: #BCDDD8;
  --warn: #85560A; --warn-soft: #FDF1DA; --warn-line: #EFCF92;
  --bad: #B03F37; --bad-soft: #FBECEA; --ok: #146B45; --ok-soft: #DFF2E7; --now: #D2463A;
  --shadow: 0 1px 2px rgba(16, 32, 40, 0.06), 0 12px 32px -16px rgba(16, 32, 40, 0.28);
  --brand-teal: #12A797; --brand-night: #0B1A20; /* the logo's "Chat" on light backgrounds; the logo's own background */
  /* charts (the Summary): one series in the accent, days shown for context in grey, hairline grid and baseline, and one
     colour per way of paying that follows the method everywhere (checked for colour blindness against the card surfaces) */
  --chart-accent: var(--accent); --chart-context: #C3CCD2; --chart-grid: var(--line); --chart-axis: var(--line-strong);
  --chart-cash: #2A78D6; --chart-card: #EB6834; --chart-link: #1BAF7A; --chart-deposit: #EDA100;
  --font: "Manrope", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1418; --surface: #141E24; --surface-2: #1A262D; --line: #24323B; --line-strong: #34454F;
    --ink: #E3EAEE; --ink-2: #C1CDD4; --muted: #8FA0AB;
    --accent: #3FB5AC; --accent-ink: #052220; --accent-soft: #11302D; --accent-line: #1E5550;
    --warn: #E9B75C; --warn-soft: #33281A; --warn-line: #5B4524;
    --bad: #EC8A80; --bad-soft: #3A1F1D; --ok: #5FCD91; --ok-soft: #13301F; --now: #F06B60; --brand-teal: #3AD6C6;
    --chart-context: #3A4952; --chart-cash: #3987E5; --chart-card: #D95926; --chart-link: #199E70; --chart-deposit: #C98500;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[dir="rtl"] body { font-family: var(--font-ar); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
[dir="rtl"] .icon.dir { transform: scaleX(-1); }
.section-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .section-label, [dir="rtl"] .nav-label { letter-spacing: 0; }
.boot { height: 100%; display: grid; place-items: center; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
a.btn { text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { filter: none; }
.btn-plain[aria-disabled="true"]:hover { background: var(--surface); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); filter: brightness(0.97); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; height: 44px; }
.link-btn { background: none; border: 0; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; justify-self: center; cursor: pointer; font-weight: 600; }
input, select, textarea { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); min-width: 0; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field.inline { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field-hint, .form-note { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; font-weight: 600; color: var(--bad); }
.field-live:empty { margin-top: -5px; } /* no gap for an empty live region */
input[aria-invalid="true"] { border-color: var(--bad); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-lead { font-size: 14.5px; }
.form-error { color: var(--bad); font-weight: 600; font-size: 13px; }
.search-input { width: min(320px, 100%); }
.search-input.big { width: 100%; height: 46px; font-size: 16px; margin-bottom: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.pill-neutral { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; object-fit: cover; }
.badge { font-style: normal; background: var(--now); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips button.attn:not(.on) { border-color: var(--warn-line); color: var(--warn); }
.chips .count { opacity: 0.75; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 16px; color: var(--muted); max-width: 420px; margin: 0 auto; }
.empty h3 { color: var(--ink); font-size: 16px; }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.spinner { display: grid; place-items: center; padding: 40px; }
.spinner span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.shell { height: 100%; }
.shell-desktop { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.shell-tablet { display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.main { overflow: auto; min-width: 0; height: 100%; }
.shell-phone .main { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 12px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 2px 8px 14px; }
.logo-mark { width: 32px; height: auto; flex: none; display: block; }
.logo-word { font-family: "Manrope", system-ui, sans-serif; font-size: 18px; font-weight: 500; letter-spacing: -0.025em; line-height: 1; color: var(--brand-teal); white-space: nowrap; }
.logo-word b { font-weight: 800; color: var(--ink); }
.biz { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 4px; display: grid; }
.biz b { font-size: 13.5px; }
.biz small { color: var(--muted); font-size: 11.5px; }
.nav-group { display: grid; gap: 1px; margin-top: 10px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 4px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px;
  background: none; border: 0; width: 100%; cursor: pointer; text-align: start; position: relative; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); }
.nav-text { flex: 1; }
.sidebar-foot { margin-top: auto; display: grid; gap: 1px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; gap: 9px; align-items: center; padding: 8px 10px 2px; }
.me span { display: grid; }
.me small { color: var(--muted); font-size: 11.5px; }
.sidebar.compact { align-items: center; padding: 12px 8px; }
.sidebar.compact .logo { padding: 2px 0 12px; justify-content: center; }
/* the logo is never mirrored: in Arabic it keeps the mark on the left, at the start (right) of the sidebar */
[dir="rtl"] .logo { direction: ltr; justify-content: flex-end; }
[dir="rtl"] .sidebar.compact .logo { justify-content: center; }
.sidebar.compact .nav-group { margin-top: 8px; }
.sidebar.compact .nav-item { width: 46px; height: 42px; justify-content: center; padding: 0; }
.sidebar.compact .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar.compact .badge { position: absolute; top: 2px; inset-inline-end: 2px; }
.sidebar.compact .sidebar-foot { justify-items: center; }
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabs a, .tabs button { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 4px; text-decoration: none; cursor: pointer; }
.tabs .on { color: var(--accent); }
.tab-icon { position: relative; display: grid; }
.tab-icon .badge { position: absolute; top: -4px; inset-inline-start: 14px; }
.tab-icon .nav-dot { position: absolute; top: -1px; inset-inline-start: 17px; }
.more { display: grid; gap: 4px; }
.more .nav-group { margin-top: 6px; }

/* ---------- screens ---------- */
.screen { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.shell-phone .screen { padding: 14px 16px 24px; gap: 12px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 800; }
.shell-phone .topbar h1 { font-size: 20px; }
.daynav { display: flex; gap: 6px; align-items: center; }
.date-input { width: 150px; }
.shell-phone .date-input { display: none; }
.shell-phone .topbar { justify-content: space-between; }
.topbar-actions { margin-inline-start: auto; display: flex; gap: 8px; }
.shell-phone .topbar-actions { display: none; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.stats > div { display: grid; }
.stats b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 12.5px; }
.shell-phone .stats { flex-wrap: nowrap; overflow-x: auto; gap: 8px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.shell-phone .stats > div { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.shell-phone .stats b { font-size: 16px; }

/* Today: grid */
.today-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.today-body.with-detail { grid-template-columns: minmax(0, 1fr) 360px; }
.grid-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; max-height: calc(100dvh - 176px); }
.grid { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(170px, 1fr)); }
.grid-corner, .grid-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.grid-corner { inset-inline-start: 0; z-index: 4; }
.grid-head { display: flex; gap: 9px; align-items: center; padding: 10px 12px 12px; border-inline-start: 1px solid var(--line); min-width: 0; }
.grid-head span { display: grid; min-width: 0; }
.grid-head b { font-size: 13.5px; }
.grid-head small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.util { position: absolute; inset-inline: 12px; bottom: 5px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.util::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--u); background: var(--accent); border-radius: 3px; }
.grid-times { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); }
.grid-times span { position: absolute; inset-inline-end: 8px; transform: translateY(3px); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-col { position: relative; border-inline-start: 1px solid var(--line); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--hour) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.grid-col > .off { position: absolute; inset-inline: 0; cursor: default; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); }
.grid-col > .off span { position: absolute; top: 14px; inset-inline: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 12px; }
.block { position: absolute; inset-inline: 4px; border-radius: 9px; padding: 5px 8px; text-align: start; display: flex; flex-direction: column; gap: 1px; overflow: hidden; cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); font-size: 12px; line-height: 1.3; }
.block:hover { filter: brightness(0.98); }
.block.st-pending_deposit { background: var(--warn-soft); border-color: var(--warn-line); }
.block.st-no_show { background: var(--bad-soft); border-color: transparent; opacity: 0.8; }
.block.st-no_show b { text-decoration: line-through; }
.block.sel { box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
.block-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; min-width: 0; }
.block-top b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-top .pill { font-size: 10px; padding: 0 6px; }
.block-meta { color: var(--ink-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.block.short { padding: 2px 8px; justify-content: center; }
.block.short .block-meta, .block.short .pill { display: none; }
.now-line { position: absolute; inset-inline: 0; height: 2px; background: var(--now); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }

/* Today: detail */
.detail-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: sticky; top: 0; max-height: calc(100dvh - 176px); overflow: auto; }
.detail { display: grid; gap: 14px; }
.detail-pills { display: flex; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.detail-title { font-size: 21px; font-weight: 800; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.answers-kv { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.sheet .detail-title { display: none; } /* the sheet header already names the service */
.cust-card { display: flex; gap: 11px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.cust-card span { display: grid; min-width: 0; }
.cust-card small { color: var(--muted); font-size: 12px; }
.cust-card.big { border: 0; padding: 0; }
.cust-card.big b { font-size: 16px; }
.detail-actions { display: grid; gap: 8px; }
.action-row { display: flex; flex-wrap: wrap; gap: 6px; }
.action-row .btn { flex: 1 1 auto; }
.confirm { background: var(--warn-soft); border-radius: 12px; padding: 12px; display: grid; gap: 10px; font-size: 13px; color: var(--ink); }

/* Today: phone list */
.daylist { display: grid; gap: 12px; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda-item { width: 100%; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 12px; text-align: start; cursor: pointer; }
.agenda-item.st-pending_deposit { border-color: var(--warn-line); }
.agenda-item.st-no_show { opacity: 0.7; }
.agenda-time { display: grid; font-weight: 800; font-variant-numeric: tabular-nums; }
.agenda-time small, .agenda-main small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.agenda-main { display: grid; min-width: 0; }
.agenda-main b, .agenda-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-pills { display: grid; gap: 4px; justify-items: end; }
.now-row { display: flex; align-items: center; gap: 8px; color: var(--now); font-size: 11.5px; font-weight: 800; padding: 0 4px; }
.now-row::after { content: ""; flex: 1; height: 2px; background: var(--now); border-radius: 2px; }
.fab { position: fixed; inset-inline-end: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 18px; border: 0; z-index: 15;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; }

/* ---------- inbox ---------- */
.screen.inbox { padding: 0; gap: 0; display: grid; height: 100%; min-height: 0; }
.inbox-desktop { grid-template-columns: 340px minmax(0, 1fr) 320px; }
.inbox-tablet { grid-template-columns: 300px minmax(0, 1fr); }
.inbox-phone { display: block; }
.convlist { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; height: 100%; }
.convlist-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 16px 10px; }
.convlist-head h1 { font-size: 22px; font-weight: 800; }
.convlist .chips { padding: 0 16px 12px; flex-wrap: wrap; }
.convs { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.conv-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line);
  border-inline-start: 3px solid transparent; color: var(--ink); text-decoration: none; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.sel { background: var(--accent-soft); }
.conv-item.attn { border-inline-start-color: var(--warn); }
.conv-main { display: grid; min-width: 0; }
.conv-main b, .conv-prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-prev { color: var(--muted); font-size: 12.5px; }
.conv-meta { display: grid; gap: 4px; justify-items: end; }
.conv-meta time { color: var(--muted); font-size: 11px; }
.conv { display: flex; flex-direction: column; min-height: 0; height: 100%; min-width: 0; }
.inbox-phone .conv { height: 100dvh; }
.shell-phone .screen.inbox.has-conv { position: fixed; inset: 0; z-index: 30; background: var(--bg); }
.conv-empty { display: grid; place-items: center; }
.conv-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.conv-who { display: grid; flex: 1; min-width: 0; }
.conv-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-who small { color: var(--muted); font-size: 12px; justify-self: start; }
.conv-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.composer { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
.reply { display: grid; gap: 8px; }
.reply textarea { width: 100%; }
.reply-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bot-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); flex-wrap: wrap; }
.bot-note span { display: inline-flex; gap: 8px; align-items: center; }
.ctx { background: var(--surface); border-inline-start: 1px solid var(--line); overflow-y: auto; padding: 20px 18px; }
.context { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.context > .btn { white-space: normal; height: auto; min-height: 38px; padding-block: 8px; text-align: center; } /* a long label wraps in the narrow side panel */
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ctx-note { margin: 0; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.mini-stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.mini-stats dt { color: var(--muted); font-size: 11.5px; }
.mini-stats dd { margin: 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.ctx-bookings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ctx-bookings li { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ctx-bookings a { display: grid; color: var(--ink); text-decoration: none; min-width: 0; }
.ctx-bookings small { color: var(--muted); font-size: 11.5px; }

/* messages */
.thread { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(80%, 520px); padding: 8px 12px 5px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.bubble.in { align-self: flex-start; border-start-start-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); border-start-end-radius: 4px; }
.bubble.out.team { background: var(--ok-soft); border-color: transparent; }
.bubble-who { display: flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { display: block; text-align: end; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.answers { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12.5px; }
.answers dt { color: var(--muted); text-transform: capitalize; }
.answers dd { margin: 0; font-weight: 600; }
.opts { display: grid; gap: 6px; margin-top: 8px; }
.opts.row { display: flex; flex-wrap: wrap; }
.opt { display: grid; text-align: start; border: 1px solid var(--accent-line); background: var(--surface); border-radius: 10px; padding: 7px 11px; font-size: 13px; color: var(--accent); font-weight: 700; cursor: pointer; }
.opt small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.opt.static { color: var(--ink-2); cursor: default; border-style: dashed; }
.opt.link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; justify-self: start; }
.photos { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 4px; }
.photos figure { margin: 0; display: grid; gap: 2px; font-size: 11.5px; font-weight: 700; }
.photos img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; }
.photos small { display: block; color: var(--muted); font-weight: 600; }
.flow { display: grid; gap: 8px; margin-top: 8px; }

/* bot tester */
.sim-top { display: flex; gap: 8px; align-items: end; }
.sim-top .field { flex: 1; }
.sim-thread { background: var(--bg); border-radius: 14px; padding: 14px; margin-top: 12px; min-height: 280px; }
.sim-compose { display: flex; gap: 8px; width: 100%; }
.sim-compose input { flex: 1; }

/* customers */
.cust-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cust-list li + li { border-top: 1px solid var(--line); }
.cust-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.cust-row:hover { background: var(--surface-2); }
.cust-main { display: grid; min-width: 0; }
.cust-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-stats { display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
.shell-phone .cust-row { grid-template-columns: 40px minmax(0, 1fr); }
.shell-phone .cust-stats { grid-column: 2; flex-wrap: wrap; }

/* search */
.results { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 2px; }
.results button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 8px; background: none; border: 0; border-radius: 10px; text-align: start; cursor: pointer; }
.results button:hover { background: var(--surface-2); }
.results span { display: grid; }
.results small { color: var(--muted); font-size: 12px; }
.result-time { font-weight: 800; min-width: 92px; }

/* ---------- set-up, records and admin screens ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.page-title { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; max-width: 72ch; }
.page-title h1 { font-size: 22px; font-weight: 800; }
.shell-phone .page-title h1 { font-size: 20px; }
.page-title p { font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shell-phone .page-actions { width: 100%; }
.shell-phone .page-actions > * { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.shell-phone .toolbar .search-input { width: 100%; }
.banner.info { background: var(--accent-soft); color: var(--ink-2); font-weight: 500; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rows > li + li { border-top: 1px solid var(--line); }
.row-btn, .row-static { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: start; color: var(--ink); background: none; border: 0; }
.row-btn { cursor: pointer; }
.row-btn:hover { background: var(--surface-2); }
.row-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.row-main > b, .row-main > small { overflow-wrap: anywhere; }
.row-main > small { color: var(--muted); font-size: 12.5px; }
.row-time { display: grid; min-width: 86px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.row-time small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); font-size: 12.5px; }
.row-side > .icon:last-child { opacity: 0.5; }
.row-side .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.row-side .confirm { font-size: 12.5px; }
[dir="rtl"] .row-side > .icon:last-child { transform: scaleX(-1); }
.row-btn.st-cancelled .row-main b, .row-btn.st-no_show .row-main b { color: var(--muted); }
.rows.compact .row-btn, .rows.compact .row-static { padding: 9px 12px; }
.panel .rows { border-radius: 10px; }
.chip-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip-line:empty { display: none; }
.mini-chip { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.clamp.msg-preview { margin-top: 4px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-strong); color: var(--ink-2); font-size: 13px; -webkit-line-clamp: 1; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.day-group { display: grid; gap: 8px; }
/* a list read in pages (Bookings, Customers, Payments): its rows, then how many show of how many and Show more,
   centred (on two lines when a phone has no room); while another filter or search loads, the rows read before stay, faded */
.paged { display: flex; flex-direction: column; gap: inherit; min-width: 0; }
.list-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 6px 0 2px; text-align: center; }
.list-more .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.shell-phone .list-more .btn { flex: 1 1 100%; max-width: 320px; }
/* a booking's row on a phone: its pills go under the service and customer (at the end) when they leave them no room */
.shell-phone .day-group .row-btn .row-main { flex-basis: 120px; }
.shell-phone .day-group .row-btn .row-side { margin-inline-start: auto; }
.shell-phone .row-btn, .shell-phone .row-static { flex-wrap: wrap; gap: 6px 12px; padding: 12px 14px; }
.shell-phone .row-side { flex-wrap: wrap; }
.shell-phone .rows .row-static .row-side { width: 100%; justify-content: flex-start; }
.shell-phone .row-time { min-width: 64px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.shell-phone .panel { padding: 16px; }
.panel > h2, .panel-head h2 { font-size: 16px; font-weight: 800; }
.panel > h2 + p.muted { margin-top: -6px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.panel-head > div { display: grid; gap: 4px; flex: 1 1 280px; max-width: 72ch; }
.status-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-inline-start: 4px solid var(--ok); }
.status-panel.is-bad { border-inline-start-color: var(--bad); background: var(--bad-soft); }
.status-panel > div:first-child { display: grid; gap: 4px; }
.status-panel h2 { font-size: 17px; font-weight: 800; }
.shell-phone .status-panel { grid-template-columns: 1fr; }
details.panel > summary { cursor: pointer; list-style-position: inside; }
details.panel > summary b { font-size: 15px; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 12.5px; max-height: 420px; overflow: auto; }
.log-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.log-list li.bad { color: var(--bad); }
.log-list time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 88px; }
.log-list small { flex-basis: 100%; padding-inline-start: 98px; overflow-wrap: anywhere; }
.shell-phone .log-list small { padding-inline-start: 0; }
.locked .empty-icon { background: var(--warn-soft); color: var(--warn); }

/* toggle, segmented control, check chips */
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.15s; margin-top: 1px; }
.toggle-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: inset-inline-start 0.15s; }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { inset-inline-start: 19px; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-text { display: grid; gap: 1px; font-weight: 600; }
.toggle-text small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.toggle.is-disabled { opacity: 0.55; cursor: not-allowed; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; justify-self: start; max-width: 100%; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 32, 40, 0.12), 0 0 0 1px var(--line); }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px;
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.check-chip.on::before { content: "✓"; font-weight: 800; }
.check-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
button.check-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; direction: ltr; }
fieldset.group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
fieldset.group legend { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-field { display: flex; gap: 8px; min-width: 0; }
.inline-field input { flex: 1; min-width: 0; } /* the field gives way to its button on a phone */
.danger-zone { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; display: grid; justify-items: start; }
.danger-zone .confirm { width: 100%; }
.photo-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.photo-edit .avatar { grid-row: span 2; }

/* weekly hours */
.week { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.week-day { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 12px; min-height: 52px; flex-wrap: wrap; }
.week-day + .week-day { border-top: 1px solid var(--line); }
.week-day.is-off { background: var(--surface-2); }
.week-name { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; min-width: 130px; }
.week-name input { width: 18px; height: 18px; accent-color: var(--accent); }
.week-times { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.week-times input { width: auto; font-variant-numeric: tabular-nums; }

/* offer cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; align-content: start; }
.card.is-paused { background: var(--surface-2); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 0.04em; background: var(--accent-soft); color: var(--accent); border-radius: 7px; padding: 2px 8px; direction: ltr; }
.card .action-row { margin-top: 4px; }
.panel .action-row .btn, .card .action-row .btn { flex: 0 1 auto; }

/* settings: sticky save bar */
.screen.settings { padding-bottom: 96px; }
.settings .panel { max-width: 860px; }
/* Owners on WhatsApp: each number's two switches sit on its row; the summary time and Send now under the list.
   The name keeps room of its own: the actions (and Remove's question) move under it when they don't fit beside it. */
.owners .row-static { flex-wrap: wrap; row-gap: 8px; }
.owners .row-main { flex: 1 1 160px; }
.owners .row-side { margin-inline-start: auto; }
.owners .row-side .toggle { align-items: center; gap: 8px; color: var(--ink); }
.owners .row-side .toggle-track { margin-top: 0; }
.owners-summary { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.owners-summary .field { flex: 0 1 260px; }
.owners-summary .form-note { flex-basis: 100%; margin: 0; }
.savebar { position: sticky; bottom: 16px; z-index: 10; align-self: center; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg);
  padding: 8px 8px 8px 16px; padding-inline: 16px 8px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; margin-top: -8px;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.savebar.show { transform: none; opacity: 1; pointer-events: auto; }
.savebar span { margin-inline-end: 6px; }
.savebar .btn:not(.btn-primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.shell-phone .savebar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 100%; }
.shell-phone .savebar span { flex: 1; font-size: 13px; }
@media (max-width: 767px) {
  .form-row.three { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .form-row.three { grid-template-columns: 1fr 1fr; }
}

/* ---------- WhatsApp connection ---------- */
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; box-shadow: 0 0 0 2px var(--surface); }
.sidebar.compact .nav-dot { position: absolute; top: 8px; inset-inline-end: 9px; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner .muted { font-weight: 500; }
.wa-connect { gap: 16px; max-width: 760px; }
.wa-hero { display: flex; gap: 14px; align-items: flex-start; }
.wa-hero > div { display: grid; gap: 4px; }
.wa-hero h2 { font-size: 18px; font-weight: 800; }
.wa-badge { width: 48px; height: 48px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.steps li span { font-size: 13px; }
.wa-number { font-weight: 700; margin-top: 4px; }
.wa-number.big { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.status-panel h2 .icon { vertical-align: -3px; color: var(--ok); }
.wa-pending { border-inline-start: 4px solid var(--warn); max-width: 760px; }
.wa-pending > div:first-child { display: grid; gap: 4px; }
.wa-pending h2 { font-size: 17px; font-weight: 800; }
.wa-pin { max-width: 320px; }
.wa-pin input { font-size: 18px; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; text-align: center; }
.wa-kv dd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wa-ids summary, .wa-tech summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.wa-ids .kv, .wa-tech .kv { margin-top: 10px; }
.wa-ids code, .wa-tech code { font-size: 12.5px; overflow-wrap: anywhere; }
.wa-copy { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wa-copy .btn { height: 30px; width: 30px; }
.whatsapp .panel, .whatsapp .banner { max-width: 860px; }
.wa-pay a { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.shell-phone .wa-number.big { font-size: 19px; }
.shell-phone .wa-hero { flex-direction: column; }

/* ---------- sheet: side drawer, bottom sheet on phones ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(8, 18, 22, 0.45); display: flex; justify-content: flex-end; animation: fade 0.15s ease-out; }
.sheet { background: var(--surface); width: min(440px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide 0.2s ease-out; }
.sheet:focus { outline: none; } /* a sheet that takes the focus itself (initialFocus="sheet"); its controls keep their focus ring */
.sheet-wide { width: min(560px, 100%); }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px 20px; padding-inline: 20px 12px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 20px 18px; }
.sheet-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.sheet-foot > .confirm { flex: 1; } /* a "… anyway" that asks first: the question across the footer */
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } }
[dir="rtl"] .sheet { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(-24px); opacity: 0.6; } }
@media (max-width: 767px) {
  .sheet-wrap { align-items: flex-end; }
  .sheet, .sheet-wide { width: 100%; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; animation: rise 0.22s ease-out; }
  [dir="rtl"] .sheet { animation-name: rise; }
  .sheet-grab { display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; }
  .sheet-foot .btn { flex: 1; height: auto; min-height: 44px; min-width: 0; white-space: normal; text-align: center; padding-block: 6px; } /* a long label (Arabic, with the change) wraps */
  .form-row { grid-template-columns: 1fr; }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0.6; } }

/* ---------- sign-in: the brand panel (the logo's own night background) beside the form ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 36px;
  padding: 56px clamp(32px, 5vw, 76px) 36px; background: var(--brand-night); color: #E4F2F0; }
.login-brand::before { content: ""; position: absolute; z-index: -1; inset-block-start: -28%; inset-inline-end: -18%; width: 78%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(58, 214, 198, 0.22), transparent 62%); }
.login-brand::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%); mask-image: linear-gradient(180deg, #000, transparent 80%); }
.brand-lockup { display: grid; gap: 12px; }
.brand-logo { display: flex; align-items: center; gap: 12px; direction: ltr; width: fit-content; }
.brand-logo .logo-mark { width: 84px; }
.brand-logo .logo-word { font-size: 44px; color: #3AD6C6; }
.brand-logo .logo-word b { color: #fff; }
.brand-tagline { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: rgba(228, 242, 240, 0.72); padding-inline-start: 96px; }
.login-story { margin-block: auto; display: grid; gap: 30px; }
[dir="rtl"] .brand-tagline { padding-inline-start: 0; }
.login-chat { width: min(430px, 100%); display: grid; gap: 10px; padding: 18px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.75); }
.lc-head { display: flex; align-items: center; gap: 10px; padding-block-end: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.lc-head span { display: grid; gap: 1px; }
.lc-head b { font-size: 14px; color: #fff; }
.lc-head small { font-size: 12px; color: #3AD6C6; font-weight: 600; }
.lc-msg { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; animation: lc-in 0.5s ease both; }
.lc-in { justify-self: start; background: rgba(255, 255, 255, 0.09); color: #EAF5F3; border-end-start-radius: 5px; animation-delay: 0.25s; }
.lc-out { justify-self: end; background: linear-gradient(135deg, #1B7E75, #13615A); color: #fff; border-end-end-radius: 5px; animation-delay: 0.85s; }
.lc-done { background: linear-gradient(135deg, #2BC3B3, #1A9487); animation-delay: 1.5s; font-weight: 600; }
.lc-times { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 8px; }
.lc-times i { font-style: normal; font-weight: 700; font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28); }
.lc-times i.on { background: #3AD6C6; border-color: #3AD6C6; color: #06231F; }
@keyframes lc-in { from { opacity: 0; transform: translateY(8px); } }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; font-size: 14.5px; font-weight: 600; color: rgba(228, 242, 240, 0.86); }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgba(58, 214, 198, 0.16); color: #3AD6C6; }
.login-foot { font-size: 12.5px; color: rgba(228, 242, 240, 0.42); }
.login-main { position: relative; z-index: 1; display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 18px; }
.login-head { display: grid; gap: 6px; margin-block-end: 4px; }
.login-card h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.login-head .muted { font-size: 15px; }
.login-card input { height: 50px; border-radius: 12px; font-size: 15.5px; padding: 0 14px; }
.pw-field { position: relative; display: block; }
.pw-field input { width: 100%; padding-inline-end: 76px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); height: 38px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.pw-toggle:hover { background: var(--accent-soft); }
.login-submit { height: 52px; border-radius: 12px; font-size: 15.5px; gap: 8px; }
.login-card .link-btn { justify-self: center; }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { padding: 40px 20px 76px; gap: 0; text-align: center; }
  .brand-logo { justify-content: center; gap: 10px; margin-inline: auto; }
  .brand-logo .logo-mark { width: 56px; }
  .brand-logo .logo-word { font-size: 30px; }
  .brand-tagline { padding-inline-start: 0; font-size: 16px; }
  .login-story, .login-foot { display: none; }
  .login-main { place-items: start center; padding: 0 16px 32px; margin-block-start: -48px; }
  .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow); }
  .login-card h1 { font-size: 26px; }
}
/* the paused-business notice: the card alone on the night background */
.login-solo { grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; background: var(--brand-night); }
.login-solo .login-card { background: var(--surface); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login-solo .brand-logo { justify-content: flex-start; }
.login-solo .brand-logo .logo-mark { width: 46px; }
.login-solo .brand-logo .logo-word { font-size: 25px; color: var(--brand-teal); }
.login-solo .brand-logo .logo-word b { color: var(--ink); }
.login-solo .brand-tagline { padding-inline-start: 0; font-size: 15px; color: var(--muted); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100% - 32px);
  pointer-events: none; } /* taps go through to the buttons under a toast */
.shell-phone .toasts { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); }
.toast-bad { background: var(--bad); color: #fff; }
.toast-warn { background: var(--warn-soft); color: var(--warn); }

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

/* ---------- businesses, team, support view ---------- */
a.biz { color: var(--ink); text-decoration: none; }
.biz-switch { cursor: pointer; }
.biz-switch:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.biz-switch small { color: var(--accent); }
a.me { color: var(--ink); text-decoration: none; border-radius: 9px; padding: 8px 10px; }
a.me:hover, a.me.on { background: var(--surface-2); }
.support-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 20px;
  background: var(--accent-soft); color: var(--accent); border-bottom: 1px solid var(--accent-line); font-size: 13px; font-weight: 700; }
.support-bar span { flex: 1; min-width: 0; }
.support-bar a { color: var(--accent); font-weight: 800; }
.support-bar.is-paused { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.support-bar.is-paused a { color: var(--bad); }
.alert-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 20px; background: var(--bad-soft); color: var(--bad);
  border-bottom: 1px solid var(--bad); font-size: 13px; font-weight: 700; }
.alert-bar span { flex: 1; min-width: 0; }
.alert-bar a, .alert-bar .link-btn { color: var(--bad); font-weight: 800; }
.charges { gap: 12px; }
.charges-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.charges-head > div { min-width: 0; flex: 1 1 260px; }
.charges-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.charges-total .big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wa-charges dd { font-variant-numeric: tabular-nums; }
.row-side.wrap { flex-wrap: wrap; justify-content: flex-end; flex-shrink: 1; min-width: 0; }
.biz-list .row-main { flex: 1 1 200px; }
.shell-phone .biz-list .row-btn, .shell-phone .panel .row-static { flex-wrap: wrap; }
.shell-phone .row-side.wrap { justify-content: flex-start; flex-basis: 100%; }
.is-off-row .row-main b { color: var(--muted); }
.controls { display: grid; gap: 12px; }
.controls > .section-label { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.controls > .section-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.biz-row { display: flex; align-items: center; flex-wrap: wrap; }
.biz-row > .row-btn { flex: 1 1 460px; width: auto; min-width: 0; }
.biz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-inline-end: 16px; }
.biz-actions .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.biz-actions .confirm { font-size: 12.5px; max-width: 360px; padding: 8px 0; }
.shell-phone .biz-actions, .shell-tablet .biz-actions { flex-basis: 100%; padding: 0 12px 12px; }
.danger-panel { border-inline-start: 4px solid var(--bad); }

/* ---------- checkout: walk-ins, the checkout panel, the Sales screen and cash-up ---------- */
/* the checkout panel takes the whole phone screen; on wider screens it stays a side drawer */
@media (max-width: 767px) {
  .sheet-full { height: 100dvh; max-height: 100dvh; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); }
  .sheet-full .sheet-grab { display: none; }
}
/* Today on phones: Walk-in sits at the inline start, opposite the "+" button; the list ends above both buttons */
.shell-phone .screen.today { padding-bottom: 80px; }
.fab.fab-walkin { inset-inline-end: auto; inset-inline-start: 16px; width: auto; display: inline-flex; align-items: center; gap: 8px; padding-inline: 14px 18px;
  background: var(--surface); color: var(--accent); border: 1px solid var(--accent-line); font-weight: 800; font-size: 14.5px; }
.checked-out { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }
.checked-out.on-sale { color: var(--warn); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.group-head .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }

/* service picker (Walk-in, Add service) */
.svc-picker { display: grid; gap: 12px; }
.svc-picker .search-input.big { margin-bottom: 0; }
.co-amt { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* walk-in */
.walkin { gap: 16px; }
.walkin-svc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.walkin-svc span { display: grid; min-width: 0; }
.walkin-svc small { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.walkin .link-btn, .co .link-btn { color: var(--accent); justify-self: start; padding: 4px 0; }
.walkin-staff .row-btn.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.walkin-staff .row-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.walkin-staff .row-btn:disabled:hover { background: none; }
.walkin-first { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }

/* checkout panel */
.co { display: grid; gap: 18px; }
.co-customer { display: grid; gap: 10px; }
.co-customer .cust-card > span:not(.avatar) { flex: 1; }
.co-note { white-space: pre-line; overflow-wrap: anywhere; }
.co-items .row-btn.on { background: var(--surface-2); }
.co-items .row-main small:empty { display: none; }
.co-item-edit { display: grid; gap: 10px; padding: 4px 16px 14px; background: var(--surface-2); }
.co-add .btn { flex: 0 1 auto; }
.co-add-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.co-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.co-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--accent-line);
  background: var(--surface); color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.co-chip:hover { background: var(--accent-soft); }
.co-discount { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.co-discount .action-row .btn { flex: 0 1 auto; }
.co-discount-on { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.co-discount-on span { flex: 1; min-width: 0; }
.co .co-discount-on .link-btn { color: inherit; text-decoration: underline; }
.co-totals { grid-template-columns: minmax(0, 1fr) auto; column-gap: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.co-totals dd { text-align: end; padding-inline-start: 14px; }
.co-totals .co-total { color: var(--ink); font-weight: 800; }
.co-totals .co-due { padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 800; }
.co-totals dt.co-due { display: flex; align-items: center; } /* both cells keep the divider on the same line */
.co-totals dd.co-due { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.co-totals .co-wait { color: var(--warn); }
.co-totals .co-due-next { border-top: 0; margin-top: 0; padding-top: 2px; } /* To pay under "Waiting for the link" */
.co-unused { display: grid; gap: 8px; justify-items: start; }
.co-unused .confirm { width: 100%; }
.co-pays .row-static { flex-wrap: wrap; }
.co-pays .action-row, .co-pays .confirm { flex-basis: 100%; }
.co-pays .action-row .btn { flex: 0 1 auto; }
.co-method { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-methods .btn { flex: 1 1 140px; flex-direction: column; gap: 4px; height: auto; min-height: 64px; padding: 10px; border-radius: 12px; white-space: normal; font-size: 14px; }
.pay-methods .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.co-pay-form { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.tender-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tender-chips button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.tender-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* phones: what the receptionist taps at the counter is at least 44px tall */
.shell-phone .tender-chips button, .shell-phone .co .link-btn { min-height: 44px; }
.shell-phone .co-pays .btn-icon { min-width: 44px; min-height: 44px; }
.co-change { color: var(--ok); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.co-done { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; }
.co-done-check { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.co-done h3 { font-size: 20px; font-weight: 800; }
.co-done .co-change { font-size: 26px; }
.co-closed { display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.co-closed .detail-pills { align-items: center; }
.co-closed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.co-refund { display: grid; gap: 10px; justify-items: start; }
.co-refund.form { justify-items: stretch; }
.co-refund .rows { border-radius: 10px; }
.co-refund-line { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.co-refund-line input[type="checkbox"] { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.co-refund-amt { width: 110px; font-variant-numeric: tabular-nums; }
.co-refund .confirm { width: 100%; }
.co .danger-zone .confirm textarea { width: 100%; }

/* Sales screen and cash-up */
.sales-day h2 { font-size: 17px; font-weight: 800; }
.banner .link-btn { display: inline; padding: 0; margin-inline-start: 6px; color: var(--accent); font-weight: 700; text-decoration: underline; }
.method-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.method-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sale-total { min-width: 92px; text-align: end; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-btn.st-void .row-main b { color: var(--muted); text-decoration: line-through; }
.shell-phone .sale-total { min-width: 0; }
.sale-end { display: inline-flex; align-items: center; gap: 8px; }
.sale-end > .icon { opacity: 0.5; }
/* phones: who and what keep the first line; how it was paid, the status and the total go on the lines under them,
   the total always at the end */
.shell-phone .sales-list .row-main { flex: 1 1 180px; }
.shell-phone .sales-list .row-side { flex: 1 1 100%; row-gap: 6px; padding-inline-start: 76px; }
.shell-phone .sales-list .sale-end { margin-inline-start: auto; }
.cashup .stats { gap: 8px 28px; }
/* laptops and tablets: the four ways of paying, then total taken, sales and discounts; phones: two columns, so every
   figure shows without scrolling sideways */
.shell-desktop .cashup .stats, .shell-tablet .cashup .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shell-phone .cashup .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
.cashup-expected { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.cashup-expected span { color: var(--ink-2); font-weight: 700; }
.cashup-expected b { color: var(--accent); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- products and stock: the list, a product's sheet, Count stock, Receive delivery, Product sales ---------- */
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--accent); font-weight: 700; text-decoration: none; }
.shell-phone .back-link { min-height: 40px; }
/* the low-stock tile is a button that shows the low products */
.stats > .stat-btn { display: grid; text-align: start; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.stat-btn span { text-decoration: underline dotted; text-underline-offset: 3px; }
.stat-btn.is-low b { color: var(--warn); }
.stat-btn[aria-pressed="true"] span { color: var(--accent); }
.shell-phone .stats > .stat-btn { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
/* phones: the four totals in two columns, so every figure shows without scrolling sideways */
.shell-phone .stats.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
/* phones: a product's name keeps the first line; its stock, price and the arrow go on the line under it (the list,
   the checkout panel's product picker, Receive delivery's matches) */
.shell-phone .prod-list .row-main { flex: 1 1 100%; }
.shell-phone .prod-list .row-side { flex: 1 1 100%; }
.shell-phone .prod-list .row-side .co-amt { margin-inline-start: auto; }
fieldset.prod-fields { gap: 14px; }
.prod-fields input:disabled, .prod-fields select:disabled { background: var(--surface-2); color: var(--ink-2); }
/* a product's stock: the number, then Received / Counted / Remove, each opening its form */
.prod-stock { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.prod-onhand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.prod-onhand b { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.prod-onhand span { color: var(--ink-2); font-weight: 700; }
.prod-onhand .pill { align-self: center; }
.prod-acts .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.prod-stock-form { padding-top: 12px; border-top: 1px solid var(--line); }
.prod-stock-form .action-row .btn { flex: 0 1 auto; }
/* stock history: what happened on the left, the change (green in, red out) and what was left on the right */
.mv-list .row-static { flex-wrap: nowrap; align-items: flex-start; }
.mv-side { display: grid; justify-items: end; text-align: end; }
.shell-phone .mv-list .row-static .row-side { width: auto; justify-content: flex-end; }
.mv-qty { font-size: 15px; font-variant-numeric: tabular-nums; }
.mv-qty.up { color: var(--ok); }
.mv-qty.down { color: var(--bad); }
.mv-side small { font-size: 11.5px; white-space: nowrap; }
/* Count stock and Receive delivery: one row per product with a number box; a bar with the save button stays in
   view at the bottom (above the phone tabs) */
.stock-screen .search-input.big { margin-bottom: 0; }
.stock-draft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.stock-draft .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.stock-rows .stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.shell-phone .stock-rows .stock-row { padding: 10px 14px; }
.stock-row.hit { animation: stock-hit 1.4s ease-out; }
@keyframes stock-hit { from { background: var(--accent-soft); } }
.stock-row.is-bad { background: var(--bad-soft); }
.stock-in { width: 5.5rem; flex: none; text-align: end; font-variant-numeric: tabular-nums; }
.stock-diff { min-width: 3rem; flex: none; text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.stock-diff.up { color: var(--ok); }
.stock-diff.down { color: var(--bad); }
.stock-field { display: grid; gap: 2px; flex: none; width: 5.5rem; align-self: end; font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.stock-field.wide { width: 7.5rem; }
.stock-field .stock-in { width: 100%; }
.shell-phone .recv-row { flex-wrap: wrap; }
.shell-phone .recv-row .row-main { flex: 1 1 100%; }
.recv-find { gap: 8px; }
.recv-find .search-input.big { margin-bottom: 0; }
.recv-find .recv-new { justify-self: start; color: var(--accent); padding: 4px 0; }
.stock-bar { position: sticky; bottom: 16px; z-index: 10; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 10px; padding-inline-start: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--ink-2); font-weight: 700; }
.shell-phone .stock-bar { bottom: 8px; } /* the phone tabs are already under the scrolling area's bottom padding */
.shell-phone .stock-bar .btn { flex: 1 1 auto; height: 44px; }
/* Product sales */
.psales-range { align-items: flex-end; }
.psales-range .field { flex: 0 1 180px; }
.shell-phone .psales-range .field { flex: 1 1 0; min-width: 0; } /* From and To side by side on a phone */
.psales-side { gap: 18px; }
.psales-fig { display: grid; justify-items: end; min-width: 92px; }
.psales-fig b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.psales-fig small { font-size: 11.5px; }
.shell-phone .psales-fig { justify-items: start; min-width: 0; }
/* products in the checkout panel: stock to check, and products coming back with a refund */
.co-short { color: var(--warn); font-weight: 700; }
.co-back-line { flex-wrap: wrap; row-gap: 8px; }
.co-back-line .co-refund-line { flex: 1 1 200px; } /* narrow panels: the name keeps its line, how many and Back in stock go under it */
.co-back-how { display: flex; align-items: center; gap: 12px; margin-inline-start: 28px; }
.co-refund-qty { width: 72px; font-variant-numeric: tabular-nums; }
.co-worth { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.co-restock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.co-restock input { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }

/* ---------- packages: the list, a package's sheet, a customer's packages, and packages in the checkout panel ---------- */
/* the price with the normal price struck through before it, and the arrow: kept together on one line */
.pkg-end { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pkg-end s { font-size: 12px; font-variant-numeric: tabular-nums; }
.pkg-end > .icon { opacity: 0.5; }
/* phones: a package's name and what's in it keep the first lines; its pills, price and the arrow go on the line under
   them, the price at the end (the list and the checkout panel's package picker) */
.shell-phone .pkg-list .row-main { flex: 1 1 100%; }
.shell-phone .pkg-list .row-side { flex: 1 1 100%; }
.shell-phone .pkg-list .row-side .pkg-end, .shell-phone .pkg-list .row-side > .co-amt { margin-inline-start: auto; }
/* the services in a package: the service, its sessions (a short number box) and remove, on one line down to 360px */
.pkg-items-head { display: grid; grid-template-columns: minmax(0, 1fr) 5rem 38px; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pkg-items-head span:nth-child(2) { text-align: end; }
.pkg-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pkg-item { display: grid; grid-template-columns: minmax(0, 1fr) 5rem 38px; gap: 8px; align-items: center; }
.pkg-item select { width: 100%; text-overflow: ellipsis; }
.pkg-qty { width: 100%; text-align: end; font-variant-numeric: tabular-nums; }
.pkg-add-svc { justify-self: start; color: var(--accent); padding: 4px 0; }
.shell-phone .pkg-add-svc { min-height: 40px; }
/* a customer's packages on their card: one card per package, past ones folded away */
.cpk { display: grid; gap: 8px; }
.cpk-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cpk-card { width: 100%; display: grid; gap: 4px; padding: 10px 12px; text-align: start; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--accent-line); border-radius: 12px; }
.cpk-card:hover { background: var(--surface-2); }
.cpk-card.is-past { border-color: var(--line); background: var(--surface-2); color: var(--ink-2); }
.cpk-card.is-past b { color: var(--muted); }
.cpk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cpk-head b { min-width: 0; overflow-wrap: anywhere; }
.cpk-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 12.5px; }
.cpk-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.cpk-left { color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.cpk-card small { font-size: 11.5px; }
.cpk-past > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13px; padding: 4px 0; }
.cpk-past[open] > summary { margin-bottom: 8px; }
.shell-phone .cpk-past > summary { padding-block: 11px; } /* a 40px target that keeps its disclosure triangle */
/* a customer's package: Change expiry / Correct sessions / Refund what's left, each opening its form under them */
.cpk-who { display: grid; justify-items: start; }
.cpk-who bdi + bdi { font-weight: 500; color: var(--ink-2); }
/* its sessions: the service and what's left stay on one line, on phones too */
.shell-phone .cpk-sessions .row-static { flex-wrap: nowrap; }
.shell-phone .rows.cpk-sessions .row-static .row-side { width: auto; justify-content: flex-end; }
.cpk-acts .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.cpk-form { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.cpk-form .action-row .btn { flex: 0 1 auto; }
.cpk-form .rows { border-radius: 10px; }
.cpk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cpk-chips button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cpk-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.shell-phone .cpk-chips button { min-height: 44px; }
/* bookings a change left without the package's cover, until the sheet closes */
.cpk-released { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: 13px; }
.cpk-released > b { color: var(--warn); }
.cpk-released ul { margin: 0; padding-inline-start: 18px; font-variant-numeric: tabular-nums; }
.cpk-left-row { cursor: text; }
.cpk-left-row .stock-in { width: 5rem; }
.shell-phone .rows .cpk-left-row { flex-wrap: nowrap; }
.shell-phone .rows .cpk-left-row .row-main { flex: 1 1 auto; }
/* a package change refused for an open sale: why, and the button that opens it */
.co-open-sale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.co-open-sale > span { flex: 1 1 220px; }
/* checkout: a service a package pays for shows In package instead of an amount; the customer's packages as chips */
.co-inpkg { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); }
.co-pkg-chip { border-style: solid; background: var(--accent-soft); cursor: default; }
.co-pkg-chip:hover { background: var(--accent-soft); }

/* ---------- tips: a sale's tip in the checkout panel, the Tips screen, the sales list, the cash-up and Team ---------- */
/* the tip in the checkout panel: preset chips (as the cash chips), who gets it, and the split editor */
.co-tip { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.tip-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tip-chips button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.tip-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tip-chips button:disabled { cursor: progress; opacity: 0.7; }
.shell-phone .tip-chips button { min-height: 44px; }
.co-tip-rows { border-radius: 10px; }
.shell-phone .rows.co-tip-rows .row-static { flex-wrap: nowrap; } /* a name and its share stay on one line */
.shell-phone .rows.co-tip-rows .row-static .row-side { width: auto; justify-content: flex-end; }
.co-tip-acts .btn { flex: 0 1 auto; }
/* the split editor: a name and its share (a short number box) per line, down to 360px */
.co-tip-split { gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.co-tip-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.co-tip-person { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; align-items: center; gap: 10px; font-weight: 600; cursor: text; }
.co-tip-person span { min-width: 0; overflow-wrap: anywhere; }
.co-tip-amt { width: 100%; text-align: end; font-variant-numeric: tabular-nums; }
.co-tip-add { justify-self: start; max-width: 100%; }
.co-tip-split .action-row .btn { flex: 0 1 auto; }
/* the sales list: the tip under the total; the cash-up: tips paid out from the drawer, above the expected cash */
.sale-sum { display: grid; justify-items: end; }
.sale-tip { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cashup-out { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Team: whose tips a staff sign-in sees, with its label beside it */
.team-link-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; max-width: 100%; }
.team-link-field span { white-space: nowrap; }
.team-link { height: 32px; font-size: 12.5px; max-width: 220px; min-width: 0; }
/* checkout: more than what's left typed for cash or card, offered as a tip */
.co-over-tip { display: grid; gap: 8px; }
.co-over-tip p { margin: 0; }
.co-over-tip .action-row .btn { flex: 0 1 auto; }
/* the Tips screen: the period (quick choices, then From and To side by side, on a phone too) */
.tips-range { align-items: flex-end; gap: 10px 16px; }
.tips-days { display: flex; gap: 10px; }
.tips-days .field { flex: 0 1 170px; }
.shell-phone .tips-days { flex: 1 1 100%; }
.shell-phone .tips-days .field { flex: 1 1 0; }
/* each person: what they're owed and since when at the end; on phones the figures go under the name when they don't fit */
.tips-owed { display: grid; justify-items: end; text-align: end; }
.tips-owed b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tips-owed small { font-size: 11.5px; white-space: nowrap; }
.shell-phone .tips-list .row-main, .shell-phone .tips-rows .row-main { flex: 1 1 160px; }
.shell-phone .tips-list .row-side, .shell-phone .tips-rows .row-side { flex: 1 1 auto; justify-content: flex-end; }
/* one person's tips: the figures, the statement, Pay out, and the lists */
.tips-detail { display: grid; gap: 16px; }
.shell-phone .tips-detail .stats.tiles > div:last-child { grid-column: 1 / -1; } /* owed now, the third tile, across the row */
.tips-acts .btn { flex: 0 1 auto; }
.tips-pay h3 { font-size: 15px; font-weight: 800; }
.tips-pay > .field:has(input) { max-width: 360px; }
.tips-preview { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tips-preview.muted { color: var(--muted); font-weight: 500; }
.shell-phone .tips-pay .action-row .btn { flex: 1 1 auto; height: 44px; }
/* on a phone the three ways of paying out are a list, one per line, rather than a row that breaks unevenly */
.shell-phone .tips-pay .seg { display: grid; grid-template-columns: minmax(0, 1fr); justify-self: stretch; }
.shell-phone .tips-pay .seg button { text-align: start; min-height: 40px; }
/* a payout: Undo asks under the line; an undone one is greyed out with its amount struck through */
.tips-payout { flex-wrap: wrap; }
.tips-payout .row-side { flex-wrap: wrap; justify-content: flex-end; }
.tips-payout .row-side .confirm { flex-basis: 100%; }
.shell-phone .rows.tips-rows .tips-payout .row-side { width: auto; flex: 1 1 auto; justify-content: flex-end; }
.tips-payout.is-undone .row-main b, .tips-payout.is-undone .co-amt { color: var(--muted); }
.tips-payout.is-undone .co-amt { text-decoration: line-through; }

/* ---------- invoices: Print and Send on WhatsApp, a sale's invoice in the checkout panel, the sales list, Business settings ---------- */
/* Print and Send on WhatsApp: in the done view big and centred, full width one under the other on phones, with Open
   and Copy link under them; in the checkout panel's footer at the end, sharing the width on phones */
.co-done .inv-btns { justify-content: center; }
.co-done .inv-btns .btn { flex: 0 1 auto; min-width: 168px; height: 44px; }
.shell-phone .co-done .inv-btns { justify-self: stretch; }
.shell-phone .co-done .inv-btns .btn { flex: 1 1 100%; }
.inv-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: -4px; }
.inv-links .link-btn { color: var(--accent); text-decoration: none; padding: 4px 2px; min-height: 36px; }
.shell-phone .inv-links .link-btn { min-height: 44px; }
.sheet-foot > .inv-btns .btn { flex: 0 1 auto; }
@media (max-width: 767px) {
  .sheet-foot > .inv-btns { flex: 1 1 auto; }
  .sheet-foot > .inv-btns .btn { flex: 1 1 auto; } /* each as wide as its label, then sharing what's left */
}
/* Send on WhatsApp with sending off: the ways to share it by hand */
.inv-off-acts .btn { flex: 0 1 auto; }
/* an invoice or credit note number inside a sentence never splits over two lines */
.inv-no { white-space: nowrap; }
/* a completed sale's invoice: its number, the print and link buttons (wrapping), its credit notes and sends */
.inv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.inv-head b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-head small { color: var(--muted); font-size: 12.5px; }
.inv-panel .inv-acts .btn { flex: 0 1 auto; }
.shell-phone .inv-panel .inv-acts .btn { flex: 1 1 auto; min-height: 44px; }
.inv-panel h4 { margin: 6px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.inv-cns { border-radius: 10px; }
.inv-cns .row-main b { font-variant-numeric: tabular-nums; }
.inv-sends { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.inv-sends li { overflow-wrap: anywhere; }
/* Send on WhatsApp: the message as it will go (a bubble), and its button under it, both in the message's own direction
   (the business's language, not the dashboard's) */
.inv-msg { display: grid; gap: 6px; }
.inv-preview { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font-size: 13.5px; font-weight: 500; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-cta { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--accent-line); background: var(--surface); color: var(--accent); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.inv-cta:hover { background: var(--accent-soft); } /* it opens the invoice, to look at it before sending */
.inv-to-msgs .btn { flex: 0 1 auto; }
/* the sales list: the invoice number under the time, small and on one line (the time column grows to fit it) */
.row-time .sale-inv { white-space: nowrap; font-size: 11px; letter-spacing: 0.01em; }
/* Sales: the owner's CSVs in the Download sheet */
.sale-files .row-btn { text-decoration: none; }
.sale-files + .form-note { margin-top: 10px; }
/* Business settings: the logo on a white tile, as it prints, whatever the theme */
.inv-logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.inv-logo { display: grid; place-items: center; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; }
.inv-logo img { display: block; max-width: 200px; max-height: 90px; object-fit: contain; }
.inv-logo-acts { display: grid; gap: 6px; flex: 1 1 220px; min-width: 0; }
.inv-logo-acts .action-row .btn { flex: 0 1 auto; }
.inv-settings h3 { font-size: 14px; font-weight: 800; margin-top: 4px; }
/* the first number once invoices have been issued: shown, but plainly not editable (as on the products form) */
.inv-settings input:disabled { background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; }
.inv-next { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: -6px; }
.inv-print-hint { margin-top: -8px; }
.inv-missing { display: grid; gap: 6px; }
.inv-missing-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.inv-missing a, .inv-settings .banner a { color: inherit; font-weight: 700; }
.inv-save { align-items: center; }
.inv-settings .inv-sample { color: var(--accent); text-decoration: none; padding: 4px 0; }
.inv-settings .inv-sample:disabled { opacity: 0.5; cursor: not-allowed; }
/* Team: Load demo refused for a business with invoices, and the button that deletes them with it */
.demo-invoices { display: grid; gap: 8px; justify-items: start; }
.demo-invoices .confirm { width: 100%; }

/* ---------- the business summary: the period, the four figures, the charts, the payment mix, top lists and the team ---------- */
/* the period (quick choices, then From and To side by side, on a phone too), as on the Tips screen */
.sum-range { align-items: flex-end; gap: 10px 16px; }
.sum-days { display: flex; gap: 10px; }
.sum-days .field { flex: 0 1 170px; }
.shell-phone .sum-days { flex: 1 1 100%; }
.shell-phone .sum-days .field { flex: 1 1 0; }
/* on a phone the five periods share the width evenly, three to a line, rather than breaking unevenly */
.shell-phone .sum-range .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-self: stretch; width: 100%; }
.shell-phone .sum-range .seg button { padding-inline: 6px; min-height: 40px; }
/* a read that failed: why, and Try again when the server or the connection failed */
.sum-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
/* everything under the period; while another period loads, the last figures stay, faded (no flash, no jump) */
.sum { display: grid; gap: 14px; transition: opacity 0.2s; }
.shell-phone .sum { gap: 12px; }
.is-stale { opacity: 0.55; transition: opacity 0.2s; }
.sum > .form-note { margin-top: -6px; } /* what the figures are compared with, under the period */
/* the four figures: four across on laptops, two by two on tablets (four once they're 200 px each) and phones */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.shell-tablet .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 956px) { .shell-tablet .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shell-phone .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { min-width: 0; display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  container-type: inline-size; }
.shell-phone .kpi { padding: 12px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
/* a large figure keeps the font's own (proportional) digits: 22 px (18 on phones), smaller when it wouldn't fit the
   tile's width at that size (--em: its width at 1 px, measured by summary.js) */
.kpi-value { font-size: 22px; font-size: clamp(12px, calc(100cqi / var(--em, 6)), 22px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.shell-phone .kpi-value { font-size: 18px; font-size: clamp(12px, calc(100cqi / var(--em, 6)), 18px); }
.kpi-detail { color: var(--muted); font-size: 12.5px; }
/* how it moved: the arrow and the change in green when that's good, red when it's bad, grey when there's none */
.delta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--muted); }
.delta b { font-weight: 800; }
.delta.is-good .icon, .delta.is-good b { color: var(--ok); }
.delta.is-bad .icon, .delta.is-bad b { color: var(--bad); }
.delta .icon { margin-inline-end: -4px; }
/* the cards under the figures: as many across as fit, the trend and the team the whole width; one column on phones */
.sum-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.sum-cards > * { min-width: 0; }
.sum-trend, .sum-team { grid-column: 1 / -1; }
.shell-phone .sum-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sum-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.sum-head h2 { font-size: 16px; font-weight: 800; }
.panel > h2 + .form-note { margin-top: -6px; }
/* the trend: the chart and where the revenue came from, side by side on laptops, one under the other elsewhere */
.sum-trend-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sum-trend-body.is-wide { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 28px; align-items: start; }
.sum-chart { display: grid; gap: 6px; min-width: 0; }
.sum-from { display: grid; gap: 8px; align-content: start; min-width: 0; }
.sum-kinds { margin: 0; display: grid; }
.sum-kinds > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.sum-kinds dt { color: var(--ink-2); min-width: 0; }
.sum-kinds dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-kinds > .sum-kinds-total { border-top-color: var(--line-strong); }
.sum-kinds-total dt, .sum-kinds-total dd { color: var(--ink); font-weight: 800; }

/* charts (charts.js): text in ink or muted, never in a series colour; hairline solid grid; the tooltip a small card */
.chart { margin: 0; display: grid; gap: 4px; min-width: 0; }
.chart-plot { position: relative; height: 180px; }
.chart-plot svg, .stackbar-plot svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.chart-plot svg:focus, .stackbar-plot svg:focus { outline: none; }
.chart-plot svg:focus-visible, .stackbar-plot svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.chart-y { position: absolute; inset-block: 0; inset-inline-start: 0; width: 40px; pointer-events: none; }
.chart-y span { position: absolute; inset-inline: 0 6px; transform: translateY(-50%); text-align: end; font-size: 11px; line-height: 1; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-x { position: relative; height: 16px; }
.chart-x span { position: absolute; inset-block-start: 0; font-size: 11px; line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; z-index: 3; display: grid; gap: 1px; padding: 7px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; max-width: 100%; pointer-events: none; }
.chart-tip b { color: var(--ink); font-size: 13.5px; font-weight: 800; }
.chart-tip small { color: var(--muted); font-size: 12px; }
.chart-tip.is-off { opacity: 0; }
.chart .chart-toggle { justify-self: start; color: var(--accent); padding: 4px 0; }
.shell-phone .chart .chart-toggle { min-height: 40px; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.chart-table th, .chart-table td { padding: 6px 0; border-top: 1px solid var(--line); text-align: start; font-weight: 500; vertical-align: baseline; }
.chart-table td { text-align: end; padding-inline-start: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-table td:last-child { color: var(--muted); }
.chart-table tr.is-muted th, .chart-table tr.is-muted td { color: var(--muted); }
/* the payment mix: the thin bar, then one line per way of paying, all four always: its colour, its name (with what was
   given back or kept under it), and its amount (with its share under it) */
.stackbar { position: relative; }
.stackbar-plot { position: relative; height: 14px; }
.mix-legend { list-style: none; margin: 0; padding: 0; display: grid; }
.mix-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line);
  transition: background-color 0.15s, box-shadow 0.15s; }
.mix-legend li:first-child { border-top: 0; }
/* the line the bar points at (hover, tap, keys): its background, reaching a little past the text on both sides */
.mix-legend li.is-active { background: var(--surface-2); box-shadow: -8px 0 0 var(--surface-2), 8px 0 0 var(--surface-2); }
.mix-swatch { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; }
.mix-name { display: grid; color: var(--ink); font-weight: 600; min-width: 0; }
.mix-name small { color: var(--muted); font-size: 12px; font-weight: 500; }
.mix-fig { display: grid; justify-items: end; text-align: end; }
.mix-fig b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mix-fig small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mix-legend .mix-total { border-top-color: var(--line-strong); }
.mix-total .mix-name { grid-column: 1 / 3; } /* no colour of its own: the name takes the swatch's place too */
.mix-total .mix-name, .mix-total .mix-fig b { font-weight: 800; }
.mix-tips { padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
/* top services and products: the name and figure, a thin bar under them, then the detail */
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.barlist li { display: grid; gap: 4px; min-width: 0; }
.barlist-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.barlist-top > span { min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--ink); }
.barlist-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.barlist-track { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.barlist-track > span { display: block; height: 100%; border-radius: 3px; background: var(--chart-accent); }
.barlist small { color: var(--muted); font-size: 12px; }
.barlist .is-muted .barlist-top > span { color: var(--muted); }
.barlist .is-muted .barlist-track > span { background: var(--chart-context); }
/* the team: a table on laptops and tablets (figures at the end, aligned), a list on phones */
.sum-table-wrap { overflow-x: auto; }
.sum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sum-table th, .sum-table td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: middle; }
/* the headings may take two lines (they're often wider than the figures under them), so the table fits a tablet */
.sum-table thead th { border-top: 0; padding-top: 0; color: var(--muted); font-size: 12px; font-weight: 700; white-space: normal; vertical-align: bottom; }
.shell-tablet .sum-table { font-size: 12.5px; }
.shell-tablet .sum-table :is(th, td) { padding-inline: 6px; }
/* a pill under a name may take two lines, so a long one doesn't widen the table */
.sum-table .pill { white-space: normal; min-width: 6.5em; border-radius: 8px; line-height: 1.35; padding-block: 3px; }
.sum-table th:first-child { text-align: start; white-space: normal; padding-inline-start: 0; }
.sum-table :is(th, td):last-child { padding-inline-end: 0; }
.sum-table tbody th { font-weight: 600; }
.sum-table tfoot th, .sum-table tfoot td { font-weight: 700; color: var(--ink-2); }
/* a row that is no one's (Not assigned, Deposits kept): its name, and what it is under it */
.sum-other { display: grid; gap: 1px; }
.sum-other small { color: var(--muted); font-size: 12px; font-weight: 500; }
.sum-table .sum-total :is(th, td) { border-top-color: var(--line-strong); color: var(--ink); font-weight: 800; }
.sum-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sum-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.sum-name b { overflow-wrap: anywhere; }
.sum-nobody { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
/* phones: the name and the revenue on one line; the pill (no longer on the team, not taking bookings) and the figures
   under them, across the row */
.sum-team-list .row-static { align-items: flex-start; }
.shell-phone .rows.sum-team-list .row-static { flex-wrap: nowrap; }
.sum-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px 10px; }
.sum-line > b:first-child { min-width: 0; overflow-wrap: anywhere; }
.sum-line > .co-amt { flex: none; }
.sum-pill { display: flex; margin-block: 1px 2px; }
/* the total closes the list, under a stronger line; a space where the others have a picture keeps it in line */
.sum-spacer { width: 28px; flex: none; }
.rows.sum-team-list > li.sum-team-total { border-top-color: var(--line-strong); }
.sum-team-total .sum-line b { font-weight: 800; }
/* phones: a link in a notice (Open <day>, Show open sales) is a whole line of its own, tall enough to tap */
.shell-phone .banner .link-btn { display: flex; align-items: center; justify-self: start; min-height: 44px; margin-inline-start: 0; }

/* ---------- branches: the switcher, the colour line, Set up › Branches, Today by branch, moving a team member ---------- */
/* a branch's colour as a dot (a neutral ring for All branches), and a branch as a chip: neutral, its dot giving the
   colour, so text never sits on a branch's colour (in dark mode too) */
.branch-dot { display: inline-block; width: var(--size, 10px); height: var(--size, 10px); border-radius: 50%; background: var(--dot); flex: none; }
.branch-dot.is-all { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
/* dark mode: a light ring, so a dark branch colour still stands out from the surface */
@media (prefers-color-scheme: dark) { .branch-dot:not(.is-all) { box-shadow: 0 0 0 1px rgba(227, 234, 238, 0.6); } }
.branch-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 1px 8px; padding-inline-start: 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.branch-chip.is-none { border-style: dashed; background: transparent; color: var(--muted); }
/* the switcher: the business's card in the laptop sidebar and the phone's More sheet (name, the branch chosen, a
   chevron), a slim bar with the branch's name at the top of the screen on tablets and phones */
.branch-switch { font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.biz.branch-switch { width: 100%; background: var(--surface); grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.biz.branch-switch b, .biz.branch-switch .branch-now { grid-column: 1; min-width: 0; }
.biz.branch-switch b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz.branch-switch > .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); }
.biz.branch-switch:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.branch-now { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.branch-now > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-bar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; text-align: start; cursor: pointer; }
.branch-bar > span:not(.branch-dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-bar > .icon { color: var(--muted); }
/* the chosen branch's colour as a thin line across the top of the screen, under the alert bar, staying in view while
   the screen scrolls; when FawriChat staff look at the business it is the lower edge of the support bar, which stays
   at the top too */
.main.has-branch > .branch-line { position: sticky; top: 0; z-index: 6; height: 3px; margin-bottom: -3px; background: var(--branch-color); pointer-events: none; }
.main.has-branch > .support-bar > .branch-line { position: absolute; inset-inline: 0; bottom: -1px; height: 3px; background: var(--branch-color); pointer-events: none; }
/* a branch just switched to: the screen stays, dimmed and still, until that branch's figures are in */
.main.is-switching > .screen { opacity: 0.55; pointer-events: none; transition: opacity 0.15s; }
/* the list of branches to switch to: the chosen one ticked; each address on one line */
.branch-pick .row-btn.on { background: var(--accent-soft); }
.branch-pick .row-btn > .icon { color: var(--accent); }
.branch-pick .branch-addr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Set up › Branches: a note with one branch, a checklist for a branch nobody works at yet, a card per branch (two
   across on laptops and tablets, one under the other on phones) */
.br-intro { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; max-width: 860px; }
.br-intro-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.br-check { border-inline-start: 4px solid var(--branch-color); max-width: 860px; }
.br-check-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.br-check-head .btn { height: 32px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.br-check h2 { display: flex; align-items: center; gap: 8px; }
.br-check-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.br-check-list li.is-done { list-style: none; color: var(--muted); }
.br-check-list li.is-done > .icon { margin-inline: -22px 6px; vertical-align: -3px; color: var(--ok); }
.br-check-list li.is-done :is(a, .link-btn) { color: var(--muted); font-weight: 500; }
.br-check-list a, .br-check-list .link-btn { color: var(--accent); font-weight: 600; }
.br-check-list .link-btn { display: inline; padding: 0; font: inherit; font-weight: 600; text-align: start; text-decoration: underline; text-underline-offset: 3px; }
.br-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shell-phone .br-cards { grid-template-columns: minmax(0, 1fr); }
.br-card { border-top: 3px solid var(--branch-color); }
.br-card-top { display: flex; align-items: center; gap: 10px; }
.br-card-name { display: grid; min-width: 0; }
.br-card-name b { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.br-addr { display: flex; align-items: flex-start; gap: 6px; color: var(--ink-2); font-size: 13px; }
.br-addr .icon { margin-top: 2px; color: var(--muted); }
.br-card .muted { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.br-card .action-row .btn { flex: 0 1 auto; }
/* a branch's sheet: the colours as round swatches (the chosen one ringed, a visible focus ring), what it offers (hidden
   services and packages greyed), and why it can't be deleted */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.swatch { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }
.shell-phone .swatch { width: 38px; height: 38px; }
.br-locked { font-size: 15px; font-variant-numeric: tabular-nums; justify-self: start; }
.br-offer .check-chip.is-muted { opacity: 0.6; }
.br-in-use { display: grid; gap: 4px; width: 100%; margin-top: 10px; }
.br-in-use ul { margin: 0; padding-inline-start: 18px; font-weight: 500; }

/* Today: in All branches each branch's name over its columns, in its colour; a column of someone at another branch
   that day is greyed; on phones a section label per branch */
.grid.by-branch .grid-head { top: 36px; }
.grid-branch { position: sticky; top: 0; z-index: 3; height: 36px; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; background: var(--surface);
  border-top: 3px solid var(--branch-color); border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.grid-branch b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-head.is-elsewhere b { color: var(--muted); }
.grid-head.is-elsewhere .avatar { opacity: 0.45; }
.branch-label { display: flex; align-items: center; gap: 8px; }
.form-at { display: flex; align-items: center; gap: 6px; }
/* a branch under a row (Bookings and Sales in All branches, the Inbox, an open chat) */
.row-at, .sale-at, .conv-at { display: flex; min-width: 0; margin-top: 2px; }
/* the Inbox: customers waiting for a person at another branch, with the button that opens it */
.inbox-elsewhere { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin: 0 16px 8px; font-size: 13px; }
.inbox-elsewhere > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.inbox-elsewhere .link-btn { margin-inline-start: 0; }
.co-where { display: flex; margin-bottom: -6px; }

/* bookings that would be at a branch where their stylist isn't working (a changed week, a move, special hours) */
.away-list { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn-line); }
.away-list h3 { font-size: 14px; font-weight: 800; color: var(--warn); }
.away-list > p { font-size: 13px; color: var(--ink); }
.away-list .rows { border-radius: 10px; }
.away-at { display: flex; margin-top: 2px; }
.br-clear { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }
/* a team member's sheet: a working day's branch beside its times (under them on phones), and a planned move */
.week-times.with-branch { flex-wrap: wrap; }
.week-branch { height: 32px; padding: 0 8px; font-size: 12.5px; max-width: 160px; }
.shell-phone .week-branch { flex: 1 1 100%; max-width: none; height: 40px; }
.staff-move { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
/* a day off or special hours: what changes, side by side in equal parts (three with someone at another branch) */
.off-modes .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.off-modes .seg button { padding-inline: 6px; line-height: 1.25; }
.staff-move .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }

/* Summary: each branch's figures (All branches) */
.sum-branch { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sum-branch b { overflow-wrap: anywhere; }
.sum-by-branch .sum-table .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.sum-branch-list .row-static { align-items: flex-start; }
/* Tips: the branch a payout's tips were earned at, with its colour */
.tips-at { display: flex; align-items: center; gap: 8px; }
.tips-at select { flex: 1; min-width: 0; }
.tips-pay > .field:has(select) { max-width: 360px; }
/* Products: each branch's stock in a product's sheet; Count stock and Receive delivery pick their branch at the top */
.prod-by-branch { display: grid; gap: 6px; }
.prod-by-branch .rows { border-radius: 10px; }
.shell-phone .prod-by-branch .rows .row-static { flex-wrap: nowrap; }
.shell-phone .prod-by-branch .rows .row-static .row-side { width: auto; }
.stock-branch { gap: 8px; }
.stock-branch select { flex: 0 1 280px; }
/* Business settings: the branch details are in Branches */
.inv-branches { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.inv-branches a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; }
/* WhatsApp: the number's branch */
.wa-branches .form { max-width: 420px; }
/* Team: the branches a staff sign-in can use, on a line of its own under the row (a button that opens them on phones) */
.row-static.has-branches { flex-wrap: wrap; }
.team-branches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex-basis: 100%; justify-content: flex-end; }
.team-branches-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.team-branches .check-chip { padding: 4px 10px; font-size: 12.5px; }
.team-branches-save { display: inline-flex; gap: 6px; }
.team-branches-save .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.shell-phone .team-branches { justify-content: flex-start; }
.team-br-btn { height: auto; min-height: 32px; padding: 4px 10px; font-size: 12.5px; white-space: normal; text-align: start; }

/* ---------- reviews: private ratings, review requests, reply drafts and their settings (reviews.js) ---------- */
/* the four tabs: as wide as their words on laptops, the whole width in four equal parts on phones */
.shell-phone .rv-tabs .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.shell-phone .rv-tabs .seg button { padding-inline: 4px; min-height: 40px; }
/* a notice over Ratings and Requests: what stops requests going out, and the button that fixes it */
.rv-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.rv-notice .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
.shell-phone .rv-notice .btn { width: 100%; height: 40px; }
/* the period and the filters on one line (the filters under the period on phones); a read that failed, with Try again */
.rv-bar { gap: 8px 12px; }
.rv-bar .chips { min-width: 0; max-width: 100%; }
.rv-period { height: 36px; }
.shell-phone .rv-period, .shell-phone .rv-bar .chips { width: 100%; }
.shell-phone .rv-bar .chips { flex-wrap: wrap; } /* every filter in view: under each other rather than off the edge */
.rv-failed, .search-failed, .ctx-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.search-failed { padding: 16px; }
.rv-list, .rv-overview { display: grid; gap: 12px; transition: opacity 0.2s; }
.rv-more { display: flex; justify-content: center; }
/* stars: filled in amber, empty in a line's colour (in dark mode the muted text colour, which stays visible on the amber
   tint); a score of 3 or fewer sits on an amber tint */
.rv-stars { display: inline-flex; align-items: center; gap: 1px; flex: none; padding: 2px 7px; border-radius: 999px; font-size: 15px; line-height: 1.2;
  font-family: system-ui, "Segoe UI Symbol", sans-serif; letter-spacing: 0; }
.rv-stars i { font-style: normal; color: var(--line-strong); }
.rv-stars i.on { color: var(--warn); }
@media (prefers-color-scheme: dark) { .rv-stars i:not(.on) { color: var(--muted); } }
.rv-stars.is-low { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); }
.rv-stars.is-small { font-size: 12px; padding: 1px 6px; }
/* private ratings: cards, two across on laptops, one under the other on tablets and phones; one still to look at (3
   stars or fewer, not handled) has an amber edge. Notes keep their line breaks (a blank line between two notes). */
.rv-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.rv-card { gap: 6px; min-width: 0; }
.rv-card.is-todo { border-inline-start: 3px solid var(--warn); }
.rv-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rv-who { font-size: 15px; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.rv-card .row-at { margin-top: 0; }
.rv-visit { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.rv-note { white-space: pre-line; overflow-wrap: anywhere; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.rv-note.is-none { background: none; padding: 0; color: var(--muted); font-size: 13px; }
.rv-src { color: var(--muted); font-size: 12px; }
.rv-card .action-row { margin-top: 2px; }
.rv-card .action-row .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
.shell-phone .rv-card .action-row .btn { flex: 1 1 auto; height: 40px; }
/* review requests: the figures (four across on laptops, two by two on phones), how the period's visits went, each
   branch's figures, then one row per request: the status, Opened Google and the score under the visit, Don't ask again
   at the end (under it on phones) */
.rv-funnel, .rv-why, .rv-todo-note { margin-top: -4px; }
.rv-branch-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.rv-cell { display: inline-grid; justify-items: end; }
.rv-cell small { color: var(--muted); font-size: 12px; }
.rv-req-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 5px; }
.rv-req-tags .pill, .rv-by-branch .pill { white-space: normal; }
.rv-reqs .row-side .btn { white-space: nowrap; }
/* reply drafts: the form, then the reply to edit with what wrote it and the buttons (wrapping on phones) */
.rv-reply, .rv-draft { max-width: 860px; }
.rv-draft { scroll-margin-top: 16px; }
.rv-reply textarea, .rv-draft textarea { width: 100%; }
.rv-draft textarea { min-height: 170px; font-size: 14.5px; line-height: 1.55; }
.rv-at { display: flex; align-items: center; gap: 8px; }
.rv-at select { flex: 1; min-width: 0; max-width: 320px; }
.shell-phone .rv-at select { max-width: none; }
.shell-phone .rv-stars-pick .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.shell-phone .rv-stars-pick.is-five .seg { grid-template-columns: repeat(5, minmax(0, 1fr)); } /* 1 to 5 only: one row */
.shell-phone .rv-stars-pick .seg button { min-height: 40px; }
.rv-acts { align-items: center; }
.shell-phone .rv-acts .btn { flex: 1 1 auto; height: 42px; }
.rv-kind { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 12.5px; }
.rv-kind .icon { margin-top: 2px; }
.rv-kind.is-ai { color: var(--accent); }
/* settings: three cards; quiet hours side by side (on a phone too, as the Tips and Summary periods); the request as
   customers get it; each branch's link under a line of its own, its pill, Try it and Save on one line */
.rv-settings { display: grid; gap: 14px; }
.rv-settings .panel { max-width: 860px; }
.rv-requests-set select { max-width: 420px; }
.rv-quiet .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
.rv-quiet input[type="time"] { font-variant-numeric: tabular-nums; }
.rv-preview { display: grid; gap: 6px; justify-items: start; }
.rv-preview-text { white-space: pre-line; overflow-wrap: anywhere; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-strong); color: var(--ink-2); font-size: 13.5px; }
.rv-preview-text.is-off { color: var(--muted); }
.rv-link { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.rv-link-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; }
.rv-link-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-link-foot > .btn-primary { margin-inline-start: auto; }
.shell-phone .rv-link-foot > .btn { flex: 1 1 auto; }
.rv-opt-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.rv-opt-add .field { flex: 1 1 220px; max-width: 320px; }
.shell-phone .rv-opt-add .field { max-width: none; }
.shell-phone .rv-opt-add .btn { width: 100%; height: 42px; }

/* ---------- AI replies (ai.js): Business settings, the Inbox, the bot tester, FawriChat's screens ---------- */
/* the panel: the title with its spark, the status pill at the end; the month's figures, then See what happened and Test
   the bot (side by side, a whole line each on phones) */
.ai-panel .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.ai-panel .panel-head h2 .icon, .conv-handed > .icon { color: var(--accent); }
.ai-figures { display: grid; gap: 3px; }
.ai-month { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-actions { justify-content: flex-start; }
.ai-actions .btn { flex: 0 0 auto; }
.shell-phone .ai-actions .btn { flex: 1 1 100%; height: 42px; }
.ai-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* See what happened: one card per typed message (who, when, what AI took it as and how sure), what the customer wrote
   quoted, what AI understood as chips (what was left out muted, dashed and struck through), what the bot sent with where
   its words came from (each clamped to three lines), why the menu answered or the chat was passed on, and the buttons */
/* See what happened's three tabs: one row of three on a phone (a long label wraps inside its own tab) */
.shell-phone .ai-turns-tabs .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.shell-phone .ai-turns-tabs .seg button { padding-inline: 4px; min-height: 40px; line-height: 1.25; }
.ai-turns { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ai-turn { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); min-width: 0; }
.ai-turn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ai-turn-top time { font-size: 12px; }
.ai-turn-intent { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.ai-turn-dl { display: grid; gap: 2px; margin: 0; font-size: 13px; }
.ai-turn-dl dt { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.ai-turn-dl dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.ai-turn-cost { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ai-quote { white-space: pre-line; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-strong); color: var(--ink); }
.ai-turn .action-row { justify-content: flex-start; }
.ai-turn .action-row .btn { flex: 0 0 auto; height: 34px; font-size: 12.5px; }
.shell-phone .ai-turn .action-row .btn { flex: 1 1 auto; height: 40px; }
.ai-chips { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.ai-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); }
.ai-chip > .icon { color: var(--accent); }
.ai-chip > span { min-width: 0; overflow-wrap: anywhere; }
.ai-chip.is-dropped { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--muted); font-weight: 500;
  text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ai-sent { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; }
.ai-sent li { display: grid; justify-items: start; gap: 3px; padding-inline-start: 10px; border-inline-start: 2px solid var(--accent-line); }
.ai-sent-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; color: var(--ink-2); max-width: 100%; }
.ai-sent.is-full .ai-sent-body { display: block; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: anywhere; }
.ai-sent .chip-line { margin-top: 0; }
.mini-chip.is-line { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.ai-sent-line { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; max-width: 100%; }
/* the friendly line: its switch set in under AI replies' (by the switch's own width), with what customers see as an
   example (the bot's bubble, the line first, then the bot's reply in words); in a message card, the line AI wrote, quoted,
   with Sent or Not sent and why (a dropped line muted; the pill wraps on phones); in a chat, the line at the top of its
   bubble with a spark */
.ai-line-set { display: grid; gap: 10px; }
.ai-line-new { margin-inline-start: 52px; margin-bottom: -6px; }
.ai-line-set > .banner, .ai-line-example { margin-inline-start: 52px; }
.ai-line-example { margin-block: 0; margin-inline-end: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ai-line-example .bubble { align-self: flex-start; max-width: min(100%, 380px); padding-bottom: 8px; }
.ai-line-rest { color: var(--muted); font-style: italic; }
.bubble-line { display: flex; align-items: flex-start; gap: 5px; overflow-wrap: anywhere; }
.bubble-line > .icon { flex: none; color: var(--accent); margin-top: 0.3em; }
.ai-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ai-line-text { display: inline-flex; align-items: flex-start; gap: 5px; min-width: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.ai-line-text > .icon { flex: none; color: var(--accent); margin-top: 0.25em; }
.ai-line.is-dropped .ai-line-text { color: var(--muted); font-weight: 500; }
.ai-line.is-dropped .ai-line-text > .icon { color: var(--muted); }
.ai-line .pill { white-space: normal; border-radius: 8px; line-height: 1.35; padding-block: 3px; }
/* About us: the scopes as chips (each branch with its dot), what comes from the settings in a quiet box, the nine topics,
   then the learned answers (one waiting for an owner has an amber edge) and the questions the bot couldn't answer */
.about-scope { flex-wrap: wrap; }
.about-scope button { display: inline-flex; align-items: center; gap: 6px; }
.about-auto { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; display: grid; gap: 6px; }
.about-auto-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.about-auto-list li { display: flex; align-items: flex-start; gap: 8px; }
.about-auto-list .icon { color: var(--muted); margin-top: 2px; }
.about-auto-list span { display: grid; min-width: 0; }
.about-auto-list small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.about-text { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.about-text.is-muted { color: var(--muted); }
.about-unset { font-style: italic; }
.about-rows .row-static, .about-answers .row-static, .about-unanswered .row-static { align-items: flex-start; }
.about-sub { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.about-sub h3 { font-size: 15px; font-weight: 800; }
.about-answers .row-static.is-waiting { box-shadow: inset 3px 0 0 var(--warn); }
[dir="rtl"] .about-answers .row-static.is-waiting { box-shadow: inset -3px 0 0 var(--warn); }
.about-answers .chip-line { align-items: center; }
.about-warn { display: grid; gap: 4px; }
/* the Inbox: why the bot passed the chat on, under the header; Add this answer to the bot beside Send or Take over */
.conv-handed { display: flex; align-items: flex-start; gap: 8px; padding: 9px 16px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: 13px; }
.conv-handed > .icon { margin-top: 2px; }
.conv-handed span { display: grid; gap: 2px; min-width: 0; }
.reply-send, .bot-note-acts { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
/* on phones Send keeps its place beside Hand back; only with Add this answer to the bot do the two take their own row */
.shell-phone .reply-send:has(.teach-btn), .shell-phone .bot-note-acts:has(.teach-btn) { width: 100%; }
.shell-phone .reply-send:has(.teach-btn) > .btn, .shell-phone .bot-note-acts:has(.teach-btn) > .btn { flex: 1 1 auto; }
/* the team's replies to pick from, in the answer sheet */
.teach-replies { display: grid; gap: 6px; }
.teach-reply { text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; overflow-wrap: anywhere; }
.teach-reply:hover { border-color: var(--accent); }
.teach-reply.on { border-color: var(--accent); background: var(--accent-soft); }
.mini-chip.is-muted { color: var(--muted); font-weight: 500; }
.mini-chip.is-warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
/* in a chat, under the bot's first reply to a typed message AI read: what AI understood (a button for owners) */
.ai-understood { align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; margin-top: -4px; padding: 2px 4px; border: 0; background: none;
  font: inherit; font-size: 11.5px; font-weight: 700; color: var(--accent); }
button.ai-understood { cursor: pointer; border-radius: 6px; }
button.ai-understood:hover { text-decoration: underline; }
/* About us's preview: what customers get, an English and an Arabic chat (side by side once there's room: the sheet is
   wider on laptops while it shows one); the note under a column whose customers get the other language's text */
.about-preview { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); container-type: inline-size; }
.about-preview h4 { margin: 0 0 6px; }
.about-preview-cols { display: grid; gap: 14px; }
@container (min-width: 720px) { .about-preview-cols { grid-template-columns: 1fr 1fr; } }
.about-preview-col { display: grid; gap: 6px; align-content: start; min-width: 0; }
.about-preview-chat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 64px; }
.about-preview-chat .bubble { max-width: 92%; }
.about-preview-fallback { color: var(--warn); }
.about-fallback-note { display: flex; align-items: flex-start; gap: 6px; margin-top: -6px; color: var(--warn); }
.about-fallback-note .icon { flex: none; margin-top: 2px; }
.teach-asked { display: grid; gap: 4px; }
.teach-asked .ai-quote { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 1024px) { .sheet:has(.about-preview) { width: min(800px, 100%); } }
.about-suggest { display: grid; justify-items: start; gap: 6px; margin-top: -6px; }
.about-suggested { display: flex; align-items: flex-start; gap: 8px; margin-top: -6px; }
.about-suggested > .icon { color: var(--accent); margin-top: 2px; }
/* the bot tester: the bot is typing (AI reading a message can take a few seconds) */
.sim-typing { margin-top: 8px; }
.bubble.typing { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding-bottom: 8px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: typing 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
/* FawriChat: what AI replies cost (the charges panel's head and total), a cost with an estimate in it marked; Platform
   settings' limits, then today's spend and Save on one line */
.ai-usage { gap: 12px; }
.jobs-panel { gap: 12px; }
.jobs-list .row-main small { overflow-wrap: anywhere; }
.ai-usage-table td:last-child { font-weight: 700; color: var(--ink); }
.ai-usage-list .row-main small { font-variant-numeric: tabular-nums; }
.ai-est { text-decoration: none; color: var(--warn); font-weight: 800; margin-inline-start: 2px; cursor: help; }
.ai-plat .form-row input { max-width: 200px; }
.ai-plat-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.shell-phone .ai-plat .form-row { grid-template-columns: 1fr; }
/* phones: a topic's Edit stays beside its name (the text under them) */
.shell-phone .rows.about-rows .row-static { flex-wrap: nowrap; }
.shell-phone .rows.about-rows .row-static .row-side { width: auto; }

/* ---------- Opening hours (hours.js): branches' weekly hours, breaks and after midnight, special dates, holidays,
   Ramadan; the same week editor on a team member's sheet ---------- */
.hours-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.hours-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
/* one column (tablets, phones): the cards in the order week, Ramadan, special dates, holidays, from the same tree */
.hours-cols.is-one { display: flex; flex-direction: column; align-items: stretch; }
.hours-cols.is-one .hours-col { display: contents; }
.hours-cols.is-one .hours-week { order: 1; }
.hours-cols.is-one .ram-card { order: 2; }
.hours-cols.is-one .hours-special { order: 3; }
.hours-cols.is-one .hol-card { order: 4; }
.hours-card { min-width: 0; }
.hours-card .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.hours-pick { display: grid; gap: 6px; }
.hours-pick .chips button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.hours-actions { align-items: center; }
.hours-actions .confirm { flex: 1 1 100%; }
.hours-rows .row-static { align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.hours-rows .row-main { flex: 1 1 220px; }
.hours-rows .row-side { margin-inline-start: auto; flex-wrap: wrap; justify-content: flex-end; }
.hours-rows .row-side:has(.confirm) { flex-basis: 100%; } /* Remove's question takes the row's width */
.hours-rows .row-side .confirm { flex: 1; }
.hours .seg { justify-self: stretch; }
/* the bookings outside the opening hours, above the screen */
.out-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.out-banner .icon { flex: none; }
.out-banner .link-btn { margin-inline-start: 0; padding: 0; color: inherit; font-weight: 800; text-decoration: underline; min-height: 32px; }
.out-list { display: grid; gap: 6px; }
.away-why { color: var(--warn) !important; font-weight: 700; }
.away-list .row-static { flex-wrap: wrap; row-gap: 6px; } /* in a narrow card, Message and Change go under the booking */
.away-list .row-main { flex: 1 1 160px; }
.away-list .row-side { margin-inline-start: auto; flex-wrap: wrap; justify-content: flex-end; }

/* the week editor: a row per weekday with its switch, then each of its times (up to three) */
.week-edit .week-day, .week-read .week-day { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: normal; gap: 8px; align-items: start; padding: 10px 12px; }
.week-read .week-day { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); align-items: center; gap: 4px 12px; min-height: 44px; }
.week-read .week-times { color: var(--ink-2); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 32px; }
.week-head .week-name { min-width: 0; cursor: default; }
.week-head .toggle { align-items: center; gap: 8px; font-size: 13px; }
.week-head .toggle-track { margin-top: 0; }
.week-periods { display: grid; gap: 6px; }
.week-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); }
.week-period input[type="time"] { width: auto; min-width: 0; font-variant-numeric: tabular-nums; }
.week-x { width: 32px; height: 32px; }
.week-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.week-tools .link-btn { justify-self: start; color: var(--accent); font-size: 13px; min-height: 32px; padding: 0; }
.week-tools .week-branch { margin-inline-start: auto; }
.chip-next { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.week-warn { display: grid; gap: 4px; justify-items: start; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 12.5px; }
.week-warn .link-btn { color: var(--warn); font-weight: 800; padding: 0; min-height: 32px; text-decoration: underline; }
.week-day .form-error { font-size: 12.5px; }
.shell-phone .week-period input[type="time"] { flex: 1 1 116px; min-width: 116px; height: 44px; }
.shell-phone .week-period input[type="time"]::-webkit-calendar-picker-indicator { display: none; } /* a tap opens the phone's own picker */
.shell-phone .hours-card { padding: 14px; }
.shell-phone .week-edit .week-day, .shell-phone .week-read .week-day { padding-inline: 10px; }
.shell-phone .week-x { width: 44px; height: 44px; }
.shell-phone .week-tools .link-btn { min-height: 44px; }
.shell-phone .week-tools .week-branch { margin-inline-start: 0; }
.shell-phone .hours .seg, .shell-phone .ram-form .off-modes .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.shell-phone .hours .seg button { min-height: 44px; line-height: 1.25; }

/* Ramadan: the card's dates and hours; the set-up's moon note, people's own hours and who works when */
.ram-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ram-hours { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ram-moon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ram-reset { justify-self: start; color: var(--accent); min-height: 32px; padding: 0; }
.ram-person { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ram-person legend { padding-inline: 4px; }
.ram-team { display: grid; gap: 8px; }
.ram-team .row-static { flex-wrap: wrap; align-items: flex-start; }
.ram-team .row-main { flex: 1 1 300px; min-width: 0; } /* a person's times stay whole lines; the button goes under them */
.ram-team .row-main small { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ram-team .row-side .btn { white-space: normal; text-align: start; height: auto; min-height: 32px; padding-block: 4px; }
.shell-phone .ram-team .row-side { width: 100%; }
.shell-phone .ram-team .row-side .btn { min-height: 44px; }

/* holidays: the Qatar list's rows, a branch's own row, choosing the four, a weekday rule's three choices */
.hol-row .row-side { flex-wrap: wrap; justify-content: flex-end; }
.hol-at { display: inline-flex; align-items: center; gap: 6px; }
.hol-pick { cursor: pointer; }
.hol-pick input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.hol-nth { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shell-phone .hol-nth { grid-template-columns: minmax(0, 1fr); }
.shell-phone .hol-nth select, .shell-phone .hours-card select { height: 44px; }

/* a team member's sheet: their special dates; what customers can book where opening hours cut their hours */
.staff-dates .rows { margin-bottom: 4px; }
.clip-note { color: var(--warn) !important; font-weight: 600; }
.clip-notes { display: grid; gap: 4px; font-weight: 600; }

/* Today: the day's special hours under the date, a break in a column, "after midnight" beside a time */
.today-hours { color: var(--ink-2); font-weight: 600; margin-top: -6px; font-variant-numeric: tabular-nums; }
/* the night's pill ("Still Sunday: open until 02:00"): on a phone on its own line under the date, so the date keeps one line */
.today-late { display: inline-flex; }
.shell-phone .topbar-title { flex-wrap: wrap; row-gap: 6px; }
.shell-phone .topbar-title h1 { white-space: nowrap; }
.shell-phone .today-late { flex-basis: 100%; }
/* a branch's opening hours past every team member's hours that day: what customers can book, with a link to their hours */
.week-short { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.week-short p { margin: 0; }
.ram-out-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.name-note { margin-top: -6px; }
.grid-col > .off.break { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); border-block: 1px dashed var(--line-strong); }
.grid-col > .off.break span { top: 50%; transform: translateY(-50%); font-size: 11px; }
.late-mark { color: var(--muted); font-weight: 600; font-size: 11.5px; }
