/*! Copyright © 2026 Future Beacon. UI/UX Architecture & Mobile App Experience engineered and designed by Eng. Abdul Hadi Arwani. */
/* Beacon UX layer (loaded after app.css): colours, type, chat list, chat header, bottom bar and the
   page-to-page transitions. Delete this file and its <link> in base.html to get the old look back. */

/* ------------------------------------------------------------------ font
   IBM Plex Sans Arabic, SIL Open Font License 1.1 (static/fonts/OFL.txt), from github.com/IBM/plex. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/IBMPlexSansArabic-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/IBMPlexSansArabic-Bold.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens
   Light: grouped grey page, white cards. Dark: black page, #1C1C1E cards. Text colours are the
   darker, contrast-safe versions; the bright system colours are used for fills and tints. */
/* app.css's own dark tokens (chart colours...), forced dark: first, so that ux.css's tokens below win the tie */
:root[data-theme="dark"] { --bg: #0b1120; --card: #111827; --ink: #e5e7eb; --muted: #94a3b8; --line: #1f2937; }
:root[data-theme="dark"] {
    --viz-1: #3987e5; --viz-2: #d95926;
    --fn-1: #184f95; --fn-2: #256abf; --fn-3: #3987e5; --fn-4: #6da7ec; --fn-5: #9ec5f4;
  }
:root[data-theme="dark"] { color-scheme: dark; }
:root {
  --bg: #f2f2f7; --card: #ffffff; --ink: #1c1c1e; --muted: #636366; --line: rgba(60, 60, 67, .12);
  --brand: #0f172a; --gold: #c5a059; --accent: #c5a059;
  --blue: #007aff; --blue-solid: #0a66d8; --ok: #248a3d; --ok-solid: #248a3d; --bad: #c8261c; --warn: #b45f06;
  --radius: 18px;
  --late-tint: #fdecea; --wait-tint: #fff3e0; --ok-tint: #e8f5ec; --chip: rgba(118, 118, 128, .12);
  --seg-bg: rgba(118, 118, 128, .12); --seg-on: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, .04);
  --shadow-lift: 0 4px 18px rgba(0, 0, 0, .08); --shadow-float: 0 8px 30px rgba(0, 0, 0, .22);
  --shadow-pop: 0 2px 8px rgba(0, 0, 0, .18); --shadow-seg: 0 1px 3px rgba(0, 0, 0, .14);
  --shadow-knob: 0 2px 4px rgba(0, 0, 0, .25); --shadow-bubble: 0 1px .5px rgb(11 20 26 / .13);
  --shadow-send: 0 2px 6px rgb(18 128 92 / .35);
  --on-fill: #fff; --on-warn: #fff; --chev: #c7c7cc; --tint: color-mix(in srgb, var(--blue) 12%, transparent);
  --note-edge: #d4a72c; --note-on: #f0c64a; --dot-online: #34c759; --dot-busy: #ff9f0a;
  --ch-whatsapp: #1fa855; --ch-instagram: #c13584; --ch-facebook: #1877f2; --ch-tiktok: #111; --ch-website: #0e7490;
  --ch-phone: #7c5a10; --ch-other: #667085;
  --m-new: #c25e00; --m-replied: #0a7c86; --m-booked: #8944ab; --m-done: #248a3d;
  --amber-soft: rgba(255, 159, 10, .12); --amber-text: #9a5200; --ok-text: #1f7a35; --blue-text: #0a66d8; --red-soft: rgba(255, 69, 58, .12); --red-text: #bd2f26;
  --on-viz: #ffffff;
  --st-online-dot: #248a3d; --st-online-text: #196a2e; --st-online-bg: rgba(36, 138, 61, .12);
  --st-busy-dot: #b25000; --st-busy-text: #924d00; --st-busy-bg: rgba(255, 159, 10, .12);
  --st-offline-dot: #c9342b; --st-offline-text: #b32a22; --st-offline-bg: rgba(255, 69, 58, .12);
  --hover: color-mix(in srgb, var(--ink) 5%, var(--card)); --scroll: color-mix(in srgb, var(--ink) 26%, transparent);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --hair: 1px; --glass: rgba(249, 249, 251, .78);
  --top-h: 48px; --rail: 72px;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
}
@media (min-resolution: 2dppx) { :root { --hair: .5px; } }
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --ink: #f2f2f7; --muted: #98989d; --line: rgba(255, 255, 255, .10);
    --brand: #0f172a; --blue: #0a84ff; --blue-solid: #0a6fe0; --ok: #30d158; --bad: #ff453a; --warn: #ff9f0a;
    --late-tint: #3a1512; --wait-tint: #36230a; --ok-tint: #0e2e24; --chip: rgba(118, 118, 128, .24);
    --seg-bg: rgba(118, 118, 128, .24); --seg-on: #636366; --glass: rgba(28, 28, 30, .78);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03);
    --amber-text: #ff9f0a; --red-text: #ff6961; --ok-text: #30d158; --blue-text: #0a84ff; --on-viz: #0b1120;
    --st-online-dot: #30d158; --st-online-text: #a6f5ba; --st-online-bg: rgba(48, 209, 88, .16);
    --st-busy-dot: #ff9f0a; --st-busy-text: #ffe099; --st-busy-bg: rgba(255, 159, 10, .16);
    --st-offline-dot: #ff453a; --st-offline-text: #ffc4be; --st-offline-bg: rgba(255, 69, 58, .16);
    --on-warn: #1c1c1e; --m-new: #ff9f0a; --m-replied: #40c8e0; --m-booked: #bf5af2; --m-done: #30d158;
  }
}
/* forced dark (theme switch) */
:root[data-theme="dark"] {
    --bg: #000000; --card: #1c1c1e; --ink: #f2f2f7; --muted: #98989d; --line: rgba(255, 255, 255, .10);
    --brand: #0f172a; --blue: #0a84ff; --blue-solid: #0a6fe0; --ok: #30d158; --bad: #ff453a; --warn: #ff9f0a;
    --late-tint: #3a1512; --wait-tint: #36230a; --ok-tint: #0e2e24; --chip: rgba(118, 118, 128, .24);
    --seg-bg: rgba(118, 118, 128, .24); --seg-on: #636366; --glass: rgba(28, 28, 30, .78);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03);
    --amber-text: #ff9f0a; --red-text: #ff6961; --ok-text: #30d158; --blue-text: #0a84ff; --on-viz: #0b1120;
    --st-online-dot: #30d158; --st-online-text: #a6f5ba; --st-online-bg: rgba(48, 209, 88, .16);
    --st-busy-dot: #ff9f0a; --st-busy-text: #ffe099; --st-busy-bg: rgba(255, 159, 10, .16);
    --st-offline-dot: #ff453a; --st-offline-text: #ffc4be; --st-offline-bg: rgba(255, 69, 58, .16);
    --on-warn: #1c1c1e; --m-new: #ff9f0a; --m-replied: #40c8e0; --m-booked: #bf5af2; --m-done: #30d158;
  }
body { font-family: var(--font); line-height: 1.6; font-variant-numeric: tabular-nums; letter-spacing: 0; }
h1, h2, h3 { letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

/* ------------------------------------------------------------------ icons (Lucide sprite) */
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .ic-flip { transform: scaleX(-1); }
/* The coloured square. app.css also styles ".tile" (the dashboard cards: padding, border); span.tile resets all of it,
   and the icon is a plain block in the middle. iOS Safari put the icon low and to the side when the square kept the
   cards' padding (5A, 2026-11-14), so nothing here depends on grid centring or the inline baseline. */
span.tile { --tone: #007aff; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  flex: none; flex-direction: row; gap: 0; width: 34px; height: 34px; min-width: 34px; padding: 0; margin: 0; border: 0;
  border-radius: 9px; box-shadow: none; line-height: 0; overflow: hidden; vertical-align: middle;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
span.tile > svg { display: block; flex: none; width: 20px; height: 20px; margin: 0; padding: 0; position: static; inset: auto;
  transform: none; vertical-align: baseline; }
span.tile.t-blue { --tone: #007aff; } span.tile.t-green { --tone: #248a3d; } span.tile.t-orange { --tone: #c25e00; } span.tile.t-red { --tone: #d70015; }
span.tile.t-purple { --tone: #8944ab; } span.tile.t-indigo { --tone: #5856d6; } span.tile.t-teal { --tone: #0a7c86; } span.tile.t-gray { --tone: #636366; }
span.tile.t-gold { --tone: #8a6a1f; }
@media (prefers-color-scheme: dark) {:where(:root:not([data-theme="light"])) span.tile.t-blue { --tone: #0a84ff; }:where(:root:not([data-theme="light"])) span.tile.t-green { --tone: #30d158; }:where(:root:not([data-theme="light"])) span.tile.t-orange { --tone: #ff9f0a; }:where(:root:not([data-theme="light"])) span.tile.t-red { --tone: #ff453a; }:where(:root:not([data-theme="light"])) span.tile.t-purple { --tone: #bf5af2; }:where(:root:not([data-theme="light"])) span.tile.t-indigo { --tone: #7d7aff; }:where(:root:not([data-theme="light"])) span.tile.t-teal { --tone: #40c8e0; }:where(:root:not([data-theme="light"])) span.tile.t-gray { --tone: #aeaeb2; }:where(:root:not([data-theme="light"])) span.tile.t-gold { --tone: #d9b86a; }
}
/* forced dark (theme switch) */
:where(:root[data-theme="dark"]) span.tile.t-blue { --tone: #0a84ff; }
:where(:root[data-theme="dark"]) span.tile.t-green { --tone: #30d158; }
:where(:root[data-theme="dark"]) span.tile.t-orange { --tone: #ff9f0a; }
:where(:root[data-theme="dark"]) span.tile.t-red { --tone: #ff453a; }
:where(:root[data-theme="dark"]) span.tile.t-purple { --tone: #bf5af2; }
:where(:root[data-theme="dark"]) span.tile.t-indigo { --tone: #7d7aff; }
:where(:root[data-theme="dark"]) span.tile.t-teal { --tone: #40c8e0; }
:where(:root[data-theme="dark"]) span.tile.t-gray { --tone: #aeaeb2; }
:where(:root[data-theme="dark"]) span.tile.t-gold { --tone: #d9b86a; }

/* ------------------------------------------------------------------ top bar (slim, navy) */
.top { background: var(--brand); box-shadow: none; view-transition-name: fb-top; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding-block: env(safe-area-inset-top) 0; align-items: center; }
.top .brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; }
.top .brand-mark { border-radius: 7px; }
.top .link { text-decoration: none; border: 1px solid rgb(255 255 255 / .28); border-radius: 999px; padding: 4px 12px;
  font-size: .8rem; font-weight: 600; background: transparent; cursor: pointer; }
.top .top-actions { gap: 8px; }
.top .inline { margin: 0; display: flex; }
.bell { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgb(255 255 255 / .12); color: var(--on-fill); }
.bell .ic { width: 18px; height: 18px; vertical-align: 0; }
.bell .badge { top: -4px; inset-inline-end: -4px; min-width: 18px; text-align: center; }
.lang-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; min-height: 0; padding: 0 11px; border: 0;
  border-radius: 999px; background: rgb(255 255 255 / .12); color: var(--on-fill); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.lang-pill .ic { width: 16px; height: 16px; vertical-align: 0; }

/* ------------------------------------------------------------------ bottom bar / side rail (glass) */
nav.bottom {
  view-transition-name: fb-bottom; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-top: var(--hair) solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { nav.bottom { background: var(--card); } }
@media (prefers-reduced-transparency: reduce) {
  nav.bottom, dialog.sheet .sheet-head { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card); }
}
nav.bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 2px;
  font-size: .68rem; font-weight: 600; color: var(--muted); border-radius: 12px; }
nav.bottom a span.ni { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px;
  transition: background .2s, color .2s; font-size: 0; }
nav.bottom a span.ni .ic { width: 23px; height: 23px; vertical-align: 0; }
nav.bottom a .mi { width: 22px; height: 22px; }
nav.bottom a.on { color: var(--blue); font-weight: 700; }
nav.bottom a.on span.ni { background: color-mix(in srgb, var(--blue) 14%, transparent); }

/* ------------------------------------------------------------------ cards, tabs (segmented control) */
.card { box-shadow: var(--shadow); border: var(--hair) solid var(--line); }
.tabs { display: flex; gap: 2px; margin: 12px 0 8px; padding: 2px; background: var(--seg-bg); border-radius: 11px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; text-align: center; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink); box-shadow: none; font-weight: 500; font-size: .84rem; white-space: nowrap; scroll-snap-align: center; }
.tabs a.on { background: var(--seg-on); color: var(--ink); font-weight: 600;
  box-shadow: var(--shadow-seg), 0 0 0 .5px rgba(0, 0, 0, .04); }
/* a narrow list (the computer layout's 380px column, a phone) fits all five chat tabs without sideways scrolling */
.split-list .tabs a { padding-inline: 7px; font-size: .78rem; }
@media (max-width: 480px) { .tabs a { padding-inline: 9px; font-size: .8rem; } }
.ux .segmented { gap: 2px; padding: 2px; background: var(--seg-bg); border-radius: 11px; }
.ux .segmented form { gap: 2px; }
.ux .seg { background: transparent; border: 0; border-radius: 9px; color: var(--ink); box-shadow: none; font-weight: 500; min-height: 34px; }
.ux .seg.on, .ux .seg.st-online.on, .ux .seg.st-busy.on, .ux .seg.st-offline.on { background: var(--seg-on); color: var(--ink);
  border: 0; font-weight: 600; box-shadow: var(--shadow-seg); }
.ux .status-now.seg.on { view-transition-name: none; box-shadow: none; border-radius: 999px; padding: 4px 14px;
  background: var(--ok-tint); color: var(--ok); }

/* ------------------------------------------------------------------ fields, buttons, press feel, switch */
:where(.ux) :is(input:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=range]), select, textarea) {
  border-radius: 12px; border: var(--hair) solid var(--line); background: var(--card); color: var(--ink); }
:where(.ux) button { border-radius: 12px; }
.ux .primary, .ux button.primary, .ux .button.primary { background: var(--blue-solid); border-color: var(--blue-solid); color: var(--on-fill); }
.ux :is(a.chat-row, .cust-card, button, .icon-btn, .tabs a, .menu-item, .button, .chip-btn, nav.bottom a) {
  transition: transform 90ms ease, opacity 90ms ease, background-color .15s ease; }
.ux :is(a.chat-row, .cust-card, button:not(:disabled), .icon-btn, .tabs a, .menu-item, .button, .chip-btn):active { transform: scale(.985); opacity: .78; }
@media (hover: hover) {
  .ux a.chat-row:hover, .ux .cust-card:hover { background-color: var(--hover); }
  .ux .tabs a:not(.on):hover { background: rgba(120, 120, 128, .12); }
  .ux nav.bottom a:not(.on):hover span.ni { background: var(--chip); }
}
@media (prefers-reduced-motion: reduce) { .ux * { transition: none !important; } .ux :active { transform: none !important; } }
.ux :is(input[type=checkbox].switch, label.check > input[type=checkbox]) { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 51px; height: 31px;
  margin: 0; border-radius: 999px; background: rgba(120, 120, 128, .32); cursor: pointer; transition: background .25s; }
.ux :is(input[type=checkbox].switch, label.check > input[type=checkbox])::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--on-fill); box-shadow: var(--shadow-knob); transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
.ux :is(input[type=checkbox].switch, label.check > input[type=checkbox]):checked { background: var(--ok-solid); }
.ux :is(input[type=checkbox].switch, label.check > input[type=checkbox]):checked::after { transform: translateX(20px); }
[dir=rtl] .ux :is(input[type=checkbox].switch, label.check > input[type=checkbox]):checked::after { transform: translateX(-20px); }
.ux :is(input[type=checkbox].switch, label.check > input[type=checkbox]):disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------------------ toasts (the old .flash messages) */
.ux .flash { position: fixed; z-index: 60; top: calc(var(--top-h) + 10px + env(safe-area-inset-top)); inset-inline: 0; margin: 0 auto;
  width: max-content; max-width: min(92vw, 520px); display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 18px;
  border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-float);
  animation: toast-in .35s cubic-bezier(.22, 1, .36, 1); transition: opacity .3s, transform .3s; }
.ux .flash.ok { background: var(--ink); color: var(--card); }
.ux .flash.error { background: #c8261c; color: var(--on-fill); }
.ux .flash.out { opacity: 0; transform: translateY(-12px); }
.ux.pane .flash { top: 10px; }
.flash-x { display: grid; place-items: center; flex: none; width: 26px; height: 26px; min-height: 0; padding: 0; border: 0;
  border-radius: 50%; background: rgb(255 255 255 / .2); color: inherit; cursor: pointer; }
.flash-x .ic { width: 15px; height: 15px; vertical-align: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-18px); } }
@media (prefers-reduced-motion: reduce) { .ux .flash { animation: none; } }
/* ------------------------------------------------------------------ chat list */
.chat-list { background: transparent; box-shadow: none; border: 0; padding: 0; margin: 0; }
.chat-group { display: flex; align-items: center; gap: 8px; margin: 16px 4px 8px; font-size: .82rem;
  font-weight: 700; color: var(--muted); }
.chat-group::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.chat-group.needs::before { background: var(--bad); }
.chat-group .n { background: var(--chip); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.chat-group.needs .n { background: var(--red-soft); color: var(--red-text); }

.chat-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 12px; padding: 12px 14px; margin: 0 0 8px; background: var(--card); border: var(--hair) solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform 90ms ease, opacity 90ms ease, background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.chat-row:active { transform: scale(.985); opacity: .78; background: var(--chip); }
.chat-row.opening { opacity: .65; }
.chat-row { overflow: hidden; }
.chat-row::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: transparent; }
.chat-row.is-wait .chat-time, .chat-row.is-late .chat-time { display: none; } /* the wait pill says it better */
/* no coloured edge on the rows any more (2026-11-19): the wait pill alone says whose turn it is */

.av { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 1.05rem; color: var(--on-fill); background: hsl(var(--h, 215) 42% 40%); flex: none; }
.av svg.person { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.av .ch { position: absolute; inset-block-end: -3px; inset-inline-end: -3px; width: 19px; height: 19px;
  border-radius: 50%; border: 2px solid var(--card); display: grid; place-items: center; background: var(--ch-other); }
.av .ch svg { width: 10px; height: 10px; fill: var(--on-fill); }
.av .ch.c-whatsapp { background: var(--ch-whatsapp); } .av .ch.c-instagram { background: var(--ch-instagram); }
.av .ch.c-facebook { background: var(--ch-facebook); } .av .ch.c-tiktok { background: var(--ch-tiktok); }
.av .ch.c-website { background: var(--ch-website); } .av .ch.c-phone, .av .ch.c-walk_in { background: var(--ch-phone); }

.chat-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-name .ch-tag { font-weight: 400; font-size: .76rem; color: var(--muted); }
.chat-time { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.chat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: .78rem; color: var(--muted); min-width: 0; }
.chat-meta .who-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.chat-meta .stage { font-size: .72rem; }
.wait-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--amber-soft); color: var(--amber-text); }
.wait-pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.wait-pill.late { background: var(--red-soft); color: var(--red-text); }
.chat-empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.chat-empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* home: a slim status strip for salespeople, and the waiting list inside a card */
.me-slim { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.me-slim h2 { margin: 0; font-size: .95rem; }
.me-slim p { margin: 0; }
.waiting-card { background: transparent; border: 0; box-shadow: none; padding: 0; margin-top: 14px; }
.waiting-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: 1.05rem; }
.waiting-card .chat-row:last-child { margin-bottom: 0; }

/* home: customer cards (today's follow-ups, my customers): the card opens the customer,
   the round buttons open the chat or call */
.cust-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 8px;
  background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
/* (the late customer card has no coloured edge either) */
.cust-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.cust-main .chat-meta .due { font-weight: 700; color: var(--warn); }
.cust-main .chat-meta .due.late { color: var(--red-text); }
.cust-actions { display: flex; gap: 6px; flex: none; }
.cust-actions .act { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; text-decoration: none; }
.cust-actions .act svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cust-actions .chat { background: var(--chip); color: var(--ink); }
.cust-actions .call { background: var(--ok-tint); color: var(--ok); }
.pipeline-small { margin-top: 18px; opacity: .92; }
.act-form { margin: 0; display: contents; }
.cust-actions button.act { min-height: 0; padding: 0; border: 0; cursor: pointer; }
.cust-actions .act.start { background: var(--ok); color: var(--on-fill); }

/* follow-ups and customers (salesperson): quick filters with counts, a search bar, card list */
.tabs a .n { display: inline-block; min-width: 20px; margin-inline-start: 4px; padding: 0 6px; border-radius: 999px;
  background: var(--chip); color: var(--ink); font-size: .74rem; text-align: center; }
.tabs a.on .n { background: var(--chip); color: var(--ink); }
.tabs a.has-late:not(.on) .n { background: var(--red-soft); color: var(--red-text); }
.seek { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.seek input[type=search] { flex: 1; min-width: 0; min-height: 44px; border-radius: 999px; padding: 8px 16px;
  border: var(--hair) solid var(--line); background: var(--card); }
.seek select { min-height: 44px; border-radius: 999px; max-width: 40%; }
.seek .add { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: var(--on-fill); text-decoration: none; }
.seek .add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.list-cards { margin-top: 6px; }
.lead-back { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .86rem; }
.lead-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .lead-back svg { transform: scaleX(-1); }

/* the queue tab keeps the old row but with the new look */
.chat-row .claim-form { margin: 0; }

/* ------------------------------------------------------------------ one chat
   The page still scrolls as a whole (app.js measures window scroll), but the header sticks to the
   top and the dock (window bar, quick replies, composer) to the bottom; 100dvh keeps both in place
   when the phone keyboard opens. The app's own top bar is hidden here, like WhatsApp. */
:root { --paper: var(--bg); --bubble-in: var(--card); --bubble-out: var(--blue-solid); --bubble-note: #fff8db; --tick: #ffffff;
  --chat-ink: var(--ink); --chat-ink-out: #ffffff; --wa-bar: var(--card); --wa-send: var(--blue-solid); }
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) { --paper: var(--bg); --bubble-in: var(--card); --bubble-out: var(--blue-solid); --bubble-note: #3b3112; --tick: #ffffff;
  --chat-ink: var(--ink); --chat-ink-out: #ffffff; --wa-bar: var(--card); --wa-send: var(--blue-solid); }
}
/* forced dark (theme switch) */
:root[data-theme="dark"] { --paper: var(--bg); --bubble-in: var(--card); --bubble-out: var(--blue-solid); --bubble-note: #3b3112; --tick: #ffffff;
  --chat-ink: var(--ink); --chat-ink-out: #ffffff; --wa-bar: var(--card); --wa-send: var(--blue-solid); }
.ux.chat-page .top { display: none; }
.ux.chat-page main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-top: 0; padding-bottom: 0; }
.chat-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 4px;
  margin: 0 -12px; padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--card); border-bottom: var(--hair) solid var(--line); box-shadow: var(--shadow); }
.chat-head .back { display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; font-size: 0; color: var(--ink); background: transparent; transition: background .15s; }
.chat-head .back:active, .icon-btn:active { background: var(--chip); }
.chat-head svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .chat-head .back svg { transform: scaleX(-1); }
.chat-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 2px 4px; margin: 0;
  background: none; border: 0; border-radius: 12px; color: inherit; font: inherit; text-align: start; cursor: pointer; min-height: 0; }
.chat-who:disabled { cursor: default; opacity: 1; }
.chat-who .av { width: 40px; height: 40px; font-size: .95rem; }  /* its view-transition-name is set by theme.js only when the page before named one */
.chat-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.chat-title b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title small { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: .76rem; }
.chat-title .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chat-title .stage { flex: none; font-size: .7rem; padding: 0 8px; }
.head-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.head-actions .pill { padding: 2px 6px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; }
.icon-btn.call { color: var(--ok); }
.icon-btn circle { fill: currentColor; stroke: none; }
.icon-btn svg rect, .icon-btn svg circle[r="2.2"] { fill: none; stroke: currentColor; }

/* the conversation canvas: a quiet pattern of our own (small diamonds), light and dark */
.thread { flex: 1; gap: 2px; padding: 10px 4px 14px; margin: 0 -12px; padding-inline: 10px; background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 9l3 5-3 5-3-5z' fill='%23000' fill-opacity='.035'/%3E%3C/svg%3E");
  background-size: 28px 28px; }
@media (prefers-color-scheme: dark) {:where(:root:not([data-theme="light"])) .thread { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 9l3 5-3 5-3-5z' fill='%23fff' fill-opacity='.03'/%3E%3C/svg%3E"); }
}
/* forced dark (theme switch) */
:where(:root[data-theme="dark"]) .thread { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 9l3 5-3 5-3-5z' fill='%23fff' fill-opacity='.03'/%3E%3C/svg%3E"); }
.day { position: sticky; top: calc(var(--top-h) + 10px + env(safe-area-inset-top)); z-index: 3; align-self: center; margin: 10px 0 6px; }
.day span { display: inline-block; padding: 3px 12px; border-radius: 8px; font-size: .74rem; font-weight: 600;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow); }
.msg { position: relative; max-width: min(82%, 520px); padding: 6px 10px 4px; margin-top: 6px; border: 0; border-radius: 12px;
  box-shadow: var(--shadow-bubble); }
.msg.cont { margin-top: 2px; }
.msg p { line-height: 1.55; unicode-bidi: plaintext; }
.msg .who { display: block; background: none; border: 0; padding: 0; margin: 0 0 1px; border-radius: 0;
  font-size: .74rem; font-weight: 700; color: var(--ok); }
.msg.in { background: var(--bubble-in); border-start-start-radius: 0; }
.msg.out { background: var(--bubble-out); border-start-end-radius: 0; }
.msg.out.auto { background: var(--bubble-out); }
.msg.note { background: var(--bubble-note); border: 1px dashed var(--note-edge); border-start-end-radius: 0; }
.msg.cont.in { border-start-start-radius: 12px; }
.msg.cont.out, .msg.cont.note { border-start-end-radius: 12px; }
/* the little tail on the first bubble of a group; it points to the sender's side (mirrors in RTL) */
.msg.in:not(.cont)::before, .msg.out:not(.cont)::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.msg.in:not(.cont)::before { inset-inline-start: -8px; background: var(--bubble-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg.out:not(.cont)::before { inset-inline-end: -8px; background: var(--bubble-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
[dir=rtl] .msg.in:not(.cont)::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
[dir=rtl] .msg.out:not(.cont)::before { clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg .meta { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 0; font-size: .68rem;
  color: var(--muted); direction: ltr; }
[dir=rtl] .msg .meta { justify-content: flex-start; }
.msg .st svg { width: 16px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.msg .st-read { color: var(--tick); }
.msg img { border-radius: 8px; max-height: 320px; object-fit: cover; }
.msg audio { width: 260px; max-width: 100%; height: 40px; }
.msg.event span { background: var(--card); box-shadow: var(--shadow); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100dvh; }
.lightbox::backdrop { background: rgb(0 0 0 / .88); }
.lightbox img { display: block; max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.to-bottom { position: fixed; z-index: 7; inset-inline-end: 14px; bottom: calc(150px + env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 42px; height: 42px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop); cursor: pointer; }
.to-bottom[hidden] { display: none; }
.to-bottom svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.to-bottom .n { position: absolute; top: -6px; inset-inline-start: -4px; min-width: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--ok); color: var(--on-fill); font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center; }

/* the dock: window bar + quick replies + composer, stuck to the bottom */
.dock { position: sticky; bottom: 0; z-index: 5; margin: 0 -12px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: var(--paper); }
.window-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; padding: 6px 12px;
  border-radius: 10px; background: var(--card); color: var(--muted); font-size: .78rem; box-shadow: var(--shadow); }
.window-bar.closed { background: var(--wait-tint); color: var(--warn); font-weight: 600; }
.window-bar .primary { flex: none; }
.quick { padding: 0 0 6px; gap: 6px; }
.chip-btn { border-radius: 999px; font-weight: 600; background: var(--card); box-shadow: var(--shadow); border: 0; }
.ux .composer { position: static; margin: 0; padding: 0; background: transparent; border: 0; align-items: flex-end; gap: 6px; }
.composer .mode { flex-basis: 100%; display: flex; gap: 6px; padding: 0; margin-bottom: 4px; }
.composer .mode button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 12px; border: 0;
  border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); font: inherit;
  font-size: .78rem; font-weight: 600; cursor: pointer; }
.composer .mode button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.composer .mode [aria-checked="true"][data-mode="reply"] { background: var(--ok); color: var(--on-fill); }
.composer .mode [aria-checked="true"][data-mode="note"] { background: var(--note-on); color: #3b2a00; }
.composer .field { flex: 1; display: flex; align-items: flex-end; gap: 2px; min-width: 0; padding: 2px 4px; border-radius: 24px;
  background: var(--wa-bar); box-shadow: var(--shadow); }
.composer .field textarea, .composer > textarea { flex: 1; min-height: 44px; border: 0; background: transparent; padding: 11px 8px; }
.composer.note-only > textarea { border-radius: 24px; background: var(--bubble-note); padding-inline: 16px; box-shadow: var(--shadow); }
.composer .field textarea:focus { outline: none; }
.composer .field .round.plus { background: transparent; margin: 1px 0; }
.ux .composer.note-on .field { background: var(--bubble-note); box-shadow: 0 0 0 2px var(--note-on); }
.ux .composer.note-on .field textarea { background: transparent; }
.composer .send, .composer .mic { width: 48px; height: 48px; min-height: 48px; margin: 0; border-radius: 50%; }
.composer .send { display: grid; place-items: center; background: var(--wa-send); color: var(--on-fill); border: 0; box-shadow: var(--shadow-send); }
.composer .send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.composer .mic { background: var(--ok); color: var(--on-fill); }
.composer.note-on .send { background: #b88a12; }
/* WhatsApp: the mic when there is nothing to send, ➤ as soon as there is */
.composer.ux-empty .send { display: none; }
.composer:not(.ux-empty) .mic:not([hidden]) { display: none; }
.composer.recording .mic { display: grid !important; }
.ux .composer .note-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ux .composer .file-name:empty { display: none; }

/* bottom sheets: customer card, ⋮ menu, templates */
dialog.sheet { width: 100%; max-width: 560px; max-height: 85dvh; margin: auto auto 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  border: 0; border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink); overflow-y: auto; }
dialog.sheet::backdrop { background: rgb(16 24 40 / .45); }
/* opens and closes with the iOS curve: where the browser can animate a closing <dialog> (transition-behavior), both ways;
   elsewhere the keyframe below opens it and it closes at once */
dialog.sheet[open] { animation: sheet-up 240ms var(--ease-sheet); }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } }
@supports (transition-behavior: allow-discrete) {
  dialog.sheet { opacity: 0; transform: translateY(32px); animation: none;
    transition: opacity 240ms var(--ease-sheet), transform 240ms var(--ease-sheet), overlay 240ms allow-discrete, display 240ms allow-discrete; }
  dialog.sheet[open] { opacity: 1; transform: none; animation: none; }
  @starting-style { dialog.sheet[open] { opacity: 0; transform: translateY(32px); } }
  dialog.sheet::backdrop { opacity: 0; transition: opacity 240ms var(--ease-sheet), overlay 240ms allow-discrete, display 240ms allow-discrete; }
  dialog.sheet[open]::backdrop { opacity: 1; }
  @starting-style { dialog.sheet[open]::backdrop { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { dialog.sheet, dialog.sheet::backdrop { transition: none; animation: none; } }
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 20px; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 0 8px; background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.sheet-head::before { content: ""; position: absolute; top: 6px; inset-inline: 0; margin: auto; width: 40px; height: 4px; border-radius: 4px; background: var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-x { width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.sheet-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.facts div { padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: .72rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts dd.late { color: var(--bad); }
.stage-quick h3 { margin: 4px 0 0; font-size: .9rem; }
.snooze { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.snooze .chip-btn { box-shadow: none; border: var(--hair) solid var(--line); }
.snooze .chip-btn.on { background: var(--brand); color: var(--on-fill); border-color: var(--brand); }
.icon-btn.nudge span { font-size: 1.15rem; line-height: 1; }
.cust-main .chat-meta .quiet { font-weight: 700; font-size: .72rem; padding: 0 8px; border-radius: 999px;
  background: var(--wait-tint); color: var(--warn); }
.stage-quick .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .assign-bar { margin: 12px 0; }
.sheet-link { display: block; text-align: center; margin-top: 12px; }
.menu-list { display: flex; flex-direction: column; padding-bottom: 6px; }
.menu-list form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 6px; margin: 0;
  border: 0; border-bottom: var(--hair) solid var(--line); border-radius: 0; background: none; color: var(--ink);
  font: inherit; font-weight: 600; text-align: start; text-decoration: none; cursor: pointer; list-style: none; }
.menu-item::-webkit-details-marker { display: none; }
.menu-item.muted { color: var(--muted); font-weight: 500; }
.menu-more[open] > .menu-item { border-bottom: 0; }
.menu-more .more-box { padding: 4px 6px 12px; border-bottom: var(--hair) solid var(--line); }
details.tpl { padding: 8px 0; border-bottom: var(--hair) solid var(--line); }
details.tpl summary { cursor: pointer; font-weight: 600; }

/* A row that holds a small form (the customer page: «open chat» + «reassign») wraps on a phone
   instead of pushing the page wider than the screen (found in the audit). */
.ux .row:has(> form.inline) { flex-wrap: wrap; }
.ux .row > form.inline { flex: 1 1 100%; display: flex; gap: 6px; min-width: 0; }
.ux .row > form.inline select { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ inside the chat frame (pane) */
.pane { padding-bottom: 0; }
.pane main { max-width: none; }
.pane .chat-head .back { display: none; }
body.pane-empty { background: var(--bg); }
body.pane-empty main { padding: 0; }
.pane-pick { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center;
  gap: 4px; text-align: center; color: var(--muted); }
.pane-pick svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round;
  stroke-linejoin: round; opacity: .55; margin-bottom: 8px; }
.pane-pick h2 { margin: 0; color: var(--ink); font-size: 1.15rem; }
.pane-pick p { margin: 0; }

/* ------------------------------------------------------------------ computer (>= 1024px)
   A slim side rail replaces the bottom bar, every page keeps clear of it, and the chats page
   splits: the list beside the open chat (a frame). Below 1024px none of this applies. */

@media (min-width: 1024px) {
  body.ux { padding-bottom: 0; }
  .ux nav.bottom { top: var(--top-h); bottom: 0; left: auto; right: auto; inset-inline-start: 0; width: var(--rail);
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 12px 6px; border-top: 0;
    border-inline-end: var(--hair) solid var(--line); background: var(--glass); overflow-y: auto; }
  .ux nav.bottom a { flex: none; width: 100%; padding: 8px 0 6px; font-size: .66rem; }
  .ux nav.bottom a span.ni { width: 48px; }
  .ux:not(.pane) main { max-width: 860px; padding-inline-start: calc(var(--rail) + 12px); }
  .ux:not(.pane) .banner, .ux:not(.pane) .flash { margin-inline-start: var(--rail); }
  .ux:not(.pane) main.split-main { max-width: none; padding: 0; padding-inline-start: var(--rail); }
  .split { display: flex; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
  .split-list { flex: none; width: 380px; overflow-y: auto; padding: 0 12px 24px; background: var(--bg);
    border-inline-end: var(--hair) solid var(--line); }
  .split-pane { flex: 1; min-width: 0; background: var(--paper); }
  .split-pane iframe { display: block; width: 100%; height: 100%; border: 0; }
  .chat-row.active { background: var(--chip); box-shadow: inset 0 0 0 2px var(--accent); }
}

/* ------------------------------------------------------------------ page transitions
   The page fades (root). Only the two bars (they do not move) and the chat avatar keep a name. The active tab / filter pill
   (.tabs a.on, .seg.on) must NOT have one: the dashboard's «آخر 30 يومًا» and the follow-ups' «متأخرة» tab share a name, so the
   browser stretched one into the other and flew the text across (2026-11-20). */
@view-transition { navigation: auto; }
::view-transition-group(fb-top), ::view-transition-group(fb-bottom) { animation-duration: 0s; }
::view-transition-old(root) { animation: fb-out 100ms ease-out both; }
::view-transition-new(root) { animation: fb-in 100ms ease-out both; }
::view-transition-group(fb-av) { animation-duration: .26s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
@keyframes fb-out { to { opacity: 0; } }
@keyframes fb-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .chat-row, nav.bottom a span.ni { transition: none; }
}

/* ================================================================== 4B (2026-11-14): Concept A pages
   Home, lists and the customer page. Wide (up to 1280px) only for lists; forms stay ~720px. */
.ux h1 { font-size: clamp(22px, 6vw, 28px); }
.ux nav.bottom a .lbl-full, .ux nav.bottom a .lbl-short { font-size: inherit; line-height: inherit; }
.ux nav.bottom a .lbl-short { display: none; }
/* the short «العملاء» where the room is tight: a narrow phone and the 72px side rail */
@media (max-width: 419px), (min-width: 1024px) {
  .ux nav.bottom a .lbl-full { display: none; }
  .ux nav.bottom a .lbl-short { display: inline; }
}
@media (max-width: 419px) {
  .ux nav.bottom { gap: 0; padding-inline: 4px; }
  .ux nav.bottom a { font-size: .62rem; min-width: 0; }
  .ux nav.bottom a span.ni { width: 44px; }
}

/* four numbers */
.ux .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.ux .stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; background: var(--card);
  border: var(--hair) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.ux .stat b { font-size: 1.7rem; line-height: 1.2; }
.ux .stat small { color: var(--muted); font-size: .8rem; }
.ux .stat .tile { margin-bottom: 4px; }
.ux .home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.ux .home-grid .g12 .cards { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
.ux .me-slim { margin-top: 10px; }

/* lists: customer cards in columns on a computer */
.ux .list-cards { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }

/* add customer: a narrow grouped form */
.ux .card.narrow { max-width: 720px; margin: 12px auto; }

@media (min-width: 640px) { .ux .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) {
  .ux:not(.pane) main:has(.page-wide, .lead-cols) { max-width: 1280px; }
  .ux .home-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .ux .home-grid > .g7 { grid-column: span 7; }
  .ux .home-grid > .g5 { grid-column: span 5; }
  .ux .home-grid > .g12 { grid-column: span 12; }
  .ux .home-grid .g12 .cards, .ux .list-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ux .lead-cols { column-count: 2; column-gap: 12px; }
  .ux .lead-cols > .card { break-inside: avoid; }
  .ux .lead-cols > .card:first-child { column-span: all; }
}
@media (min-width: 1280px) { .ux .home-grid .g12 .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* customer page: the facts as a tidy two-column list */
.ux .lead-cols dl.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: baseline; }
.ux .lead-cols dl.facts dt { color: var(--muted); font-size: .8rem; }
.ux .lead-cols dl.facts dd { margin: 0; font-weight: 600; }

/* ================================================================== 4B-2: owner / manager home and customers list */
.ux .live-contents { display: contents; }
.ux .home-grid.mgr .o-status { order: -2; margin-top: 0; }
.ux .home-grid.mgr .o-tools { order: -1; }
.ux .home-grid.mgr .o-collect { order: -1; }  /* the owner's «محصّل هذا الشهر», above his rows (2026-11-26) */
.ux .home-grid .g6 { margin-top: 0; }
.ux .row.tool { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ux .row.tool .tx { flex: 1; min-width: 0; font-weight: 600; }
.ux .row.tool .chev { color: var(--chev); width: 18px; height: 18px; vertical-align: 0; }
.ux .row.tool .badge-inline { margin: 0; }
.ux .lead-card { text-decoration: none; color: inherit; }
.ux .lead-card .chat-body { flex: 1; }
.ux .lead-card .chat-meta .ic { width: 14px; height: 14px; vertical-align: -.15em; }
.ux .lead-card .chat-meta .due { font-weight: 700; color: var(--warn); }
.ux .lead-card .chat-meta .due.late { color: var(--red-text); }
.ux .seek.filters button { min-height: 44px; border-radius: 999px; padding-inline: 16px; }
.ux .seek .add .ic { width: 22px; height: 22px; vertical-align: 0; }
.ux .who-now { display: flex; align-items: center; gap: 6px; margin: 8px 4px; font-weight: 600; }
.ux .who-now a { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--chip); }
.ux .who-now a .ic { width: 14px; height: 14px; vertical-align: 0; }
@media (min-width: 1024px) {
  .ux .home-grid .g6 { grid-column: span 6; }
  .ux .home-grid .g7 { grid-column: span 7; }
  .ux .home-grid .g5 { grid-column: span 5; }
  .ux .home-grid .g12 { grid-column: span 12; }
}
.ux .lead-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 8px;
  background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
@media (hover: hover) { .ux .lead-card:hover { background-color: var(--hover); } }
.ux .lead-card:active { transform: scale(.985); opacity: .78; }
.ux .home-grid.mgr .o-status, .ux .home-grid.mgr .o-tools { align-self: start; }
@media (max-width: 639px) {
  .ux .seek.filters { flex-wrap: wrap; }
  .ux .seek.filters input[type=search] { flex: 1 1 100%; }
  .ux .seek.filters select { flex: 1; max-width: none; }
}

/* ================================================================== 4C (2026-11-14): dashboard, Concept A */
.ux .dash { max-width: none; }
.ux .d-head h1 { margin: 6px 0 0; }
.ux .d-presets a, .ux .d-more summary { background: var(--card); border: var(--hair) solid var(--line); }
.ux .d-presets a.on { background: var(--seg-on); border-color: var(--blue); color: var(--blue); }
.ux .d-apply { background: var(--blue-solid); color: var(--on-fill); }
.ux .d-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ux .d-tiles :is(article, a).tile { position: relative; background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; gap: 2px; color: inherit; text-decoration: none; }
.ux .d-tiles .tile.hero { grid-column: 1 / -1; }
.ux .d-tiles span.tile { margin-bottom: 4px; padding: 0; border: 0; box-shadow: none; align-self: flex-start; flex-direction: row; }
.ux .d-tiles .tile .chev { position: absolute; top: 14px; inset-inline-end: 12px; color: var(--chev); width: 18px; height: 18px; vertical-align: 0; }
.ux .d-tiles a.tile { border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
@media (hover: hover) { .ux .d-tiles a.tile:hover { background-color: var(--hover); } }
.ux .d-tiles a.tile:active { transform: scale(.985); opacity: .78; }
.ux .d-card { background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ux .d-list a { text-decoration: none; }
@media (min-width: 640px) { .ux .d-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ux .d-tiles .tile.hero { grid-column: span 3; } }
@media (min-width: 1024px) {
  .ux:not(.pane) main:has(.dash) { max-width: 1280px; }
  .ux .d-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ux .d-tiles .tile.hero { grid-column: span 2; }
  .ux .d-tiles .t-value { font-size: 1.7rem; }
  .ux .d-tiles .tile.hero .t-value { font-size: 2.6rem; }
}

/* ================================================================== 4D (2026-11-14): settings, admin, people, login */
.ux .glabel { margin: 18px 8px 6px; font-size: .8rem; font-weight: 500; color: var(--muted); }
.ux .card.grp { padding: 0 14px; }
.ux .srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 8px 0; margin: 0;
  border: 0; border-bottom: var(--hair) solid var(--line); border-radius: 0; background: none; color: var(--ink);
  font: inherit; text-align: start; text-decoration: none; cursor: pointer; }
.ux .srow:last-child, .ux .grp form > .srow:last-of-type { border-bottom: 0; }
.ux .srow .tx { flex: 1; min-width: 0; font-weight: 500; display: flex; flex-direction: column; line-height: 1.35; }
.ux .srow .tx.one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ux .srow .chev { color: var(--chev); width: 18px; height: 18px; vertical-align: 0; }
.ux .srow.logout .tx { color: var(--bad); font-weight: 600; }
.ux .danger-card { padding: 0 14px; margin-top: 18px; }
.ux .save-row { display: block; width: 100%; margin: 10px 0 12px; min-height: 44px; border-radius: 12px; background: var(--blue-solid);
  border-color: var(--blue-solid); color: var(--on-fill); font-weight: 600; }
.ux .prof { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ux .prof .av { width: 56px; height: 56px; font-size: 1.4rem; }
.ux .prof .tx { display: flex; flex-direction: column; min-width: 0; }
.ux .prof .tx small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux .hint1 { margin: 8px 2px 0; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) { .ux:not(.pane) main:has(.narrow-page) { max-width: 720px; } }
.ux .card.narrow:has(.login-logo) { max-width: 420px; margin-top: 28px; text-align: center; }
.ux .card.narrow:has(.login-logo) form, .ux .card.narrow:has(.login-logo) label { text-align: start; }
.ux .login-logo { width: 120px; height: auto; border-radius: 26px; margin: 4px auto 8px; display: block; }
.ux .card.narrow:has(.login-logo) h1 { font-size: clamp(22px, 6vw, 28px); margin: 6px 0; }
.ux .card.narrow:has(.login-logo) input { min-height: 48px; font-size: 1rem; }
.ux .card.narrow:has(.login-logo) .primary { width: 100%; min-height: 50px; border-radius: 14px; font-size: 1rem; font-weight: 600; }
.ux .team-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; }
.ux .team-row > span:first-of-type { flex: 1 1 140px; min-width: 0; }
.ux .team-row .segmented { flex: 1 1 260px; }
.ux .visit-day { margin: 16px 0 2px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ux .alert { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: var(--hair) solid var(--line); }
.ux .alert:last-child { border-bottom: 0; }
.ux .alert > a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ux .alert.unread > a { position: relative; padding-inline-start: 16px; }
.ux .alert.unread > a::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.ux .alert .ic { width: 1.1em; height: 1.1em; }
.ux .head h2 { font-size: 1.2rem; }
/* waiting list for managers: the row wraps on a phone (the reassign form dropped the page wider than 375px) */
.ux #overdue-live .row { flex-wrap: wrap; gap: 8px 12px; }
.ux #overdue-live .row > span:first-child { flex: 1 1 160px; min-width: 0; }
.ux #overdue-live .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; }
.ux #overdue-live .actions form.inline { flex: 1 1 100%; display: flex; gap: 6px; min-width: 0; }
.ux #overdue-live .actions select { flex: 1; min-width: 0; }
.ux .grp .segmented, .ux .grp form.segmented { margin: 8px 0; width: 100%; }
.ux .grp .segmented .seg { flex: 1; }
.ux label.check { display: flex; align-items: center; gap: 12px; }

/* ================================================================== 5A (2026-11-14) */
/* status: one slim line (48px) */
.ux .status-bar { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; margin-top: 10px; }
.ux .status-bar .av { width: 32px; height: 32px; font-size: .95rem; flex: none; }
.ux .status-bar .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.ux .status-bar .segmented { flex: none; margin: 0; }
.ux .segmented.compact .seg { min-height: 30px; padding: 2px 10px; font-size: .8rem; }
.ux .home-grid.mgr .status-bar { align-self: start; }

/* people: one horizontal rail (avatar, connection dot, red count) */
.ux .who-rail { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; margin: 4px -12px 6px; padding: 6px 12px 8px;
  scrollbar-width: none; scroll-snap-type: x proximity; }
.ux .who-rail::-webkit-scrollbar { display: none; }
.ux .who-rail .who, .ux .who-rail .who.on { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 68px; padding: 0; border: 0; background: none; color: var(--ink); border-radius: 12px; scroll-snap-align: start;
  text-decoration: none; }
.ux .who-rail .av { position: relative; width: 52px; height: 52px; font-size: 1.2rem; overflow: visible; }
.ux .who-rail .who.on .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--blue); }
.ux .who-rail .dot { position: absolute; inset-block-end: -1px; inset-inline-end: -1px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--bg); background: #98989d; }
.ux .who-rail .dot.st-online { background: var(--dot-online); } .ux .who-rail .dot.st-busy { background: var(--dot-busy); }
.ux .who-rail .need, .ux .who-rail .who.on .need { position: absolute; inset-block-start: -5px; inset-inline-start: -6px; display: grid;
  place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--bad); color: var(--on-fill);
  font-size: .74rem; font-weight: 700; border: 2px solid var(--bg); box-sizing: border-box; line-height: 1; }
.ux .who-rail .nm { max-width: 68px; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* customers: stage pills stay under the top bar; two-line cards; the floating «+» */
.ux .tabs.stage-pills { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 4; margin-inline: -12px;
  border-radius: 0; padding: 6px 12px; background: var(--bg); }
.ux .tabs.stage-pills a { background: var(--seg-bg); border-radius: 999px; flex: none; }
.ux .tabs.stage-pills a.on { background: var(--blue-solid); color: var(--on-fill); box-shadow: none; view-transition-name: none; }
.ux .tabs.stage-pills a.on .n { background: rgb(255 255 255 / .25); color: var(--on-fill); }
.ux .tabs.stage-pills { gap: 6px; }
.ux .cust-card .chat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ux .cust-card .chat-top .stage { flex: none; }
.ux .cust-card .chat-meta { gap: 2px 8px; }
.ux .cust-card .brand-tag { padding: 0 8px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: .72rem; font-weight: 600; }
.ux .cust-card .chat-meta .ic { width: 13px; height: 13px; vertical-align: -.15em; }
.ux .fab { position: fixed; z-index: 7; inset-inline-end: 16px; inset-block-end: calc(76px + env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--blue-solid); color: var(--on-fill);
  box-shadow: 0 6px 18px rgba(10, 102, 216, .4); text-decoration: none; }
.ux .fab .ic { width: 26px; height: 26px; vertical-align: 0; display: block; }
.ux .fab:active { transform: scale(.94); }
@media (min-width: 1024px) { .ux .fab { inset-block-end: 24px; } }
.ux .segmented.compact .seg { white-space: nowrap; padding-inline: 8px; font-size: .78rem; }
.ux .status-bar .nm { font-size: .9rem; }
@media (max-width: 380px) { .ux .status-bar .nm { display: none; } .ux .status-bar { justify-content: space-between; } }

/* ================================================================== 5B (2026-11-14): back bar, add customer, dashboard */
.ux .backbar { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 4px 0 0; padding: 0 12px 0 14px;
  color: var(--blue); font-weight: 600; font-size: .95rem; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ux .backbar .ic { width: 22px; height: 22px; vertical-align: 0; display: block; }
.ux .backbar:active { opacity: .55; }
.ux.pane .backbar { display: none; }
.ux .card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ux .x-close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--chip);
  color: var(--ink); text-decoration: none; }
.ux .x-close .ic { width: 18px; height: 18px; vertical-align: 0; display: block; }
.ux .cancel-btn { display: block; width: 100%; margin-top: 8px; min-height: 46px; line-height: 46px; text-align: center; border-radius: 12px;
  text-decoration: none; }

/* dashboard: filters */
.ux .d-filters { margin-bottom: 10px; }
.ux .d-bar { display: flex; align-items: center; gap: 8px; }
.ux .d-presets.segmented { flex: 1; min-width: 0; display: flex; margin: 0; }
.ux .d-presets .seg { flex: 1; display: grid; place-items: center; padding: 4px 4px; font-size: .78rem; white-space: nowrap; text-decoration: none; min-height: 34px; }
/* the active period (آخر 7 أيام / 30 / 90 / هذا الشهر): a solid pill in the accent colour with bold white text, so it reads at a glance
   in both themes (a white pill on the pale grey track was almost invisible in light) */
.ux .d-presets .seg.on { background: var(--blue-solid); color: var(--on-fill); font-weight: 700; box-shadow: none; }
.ux .d-filter-btn { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 38px; padding: 0; border: 0;
  border-radius: 12px; background: var(--seg-bg); color: var(--ink); cursor: pointer; }
.ux .d-filter-btn .ic { width: 20px; height: 20px; vertical-align: 0; display: block; }
.ux .d-filter-btn .dot { position: absolute; top: 6px; inset-inline-end: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.ux .d-sheet-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.ux .d-sheet-body .d-field { grid-column: 1 / -1; }
.ux .d-sheet-body label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.ux .d-sheet-body input, .ux .d-sheet-body select { min-height: 44px; font-size: 1rem; color: var(--ink); }
.ux dialog.sheet .d-apply { display: block; width: 100%; min-height: 48px; border-radius: 12px; font-size: 1rem; }

/* dashboard: the six cards (2x3 on a phone, 3x2 on a tablet, one row on a computer) */
.ux .d-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ux .d-tiles .tile.hero { grid-column: auto; }
.ux .d-tiles .tile.hero .t-value { font-size: 1.9rem; }
.ux .d-tiles .t-value { font-size: 1.9rem; }
.ux .d-tiles .t-spark { height: 30px; margin-top: 2px; }
.ux .d-tiles .tile.urgent.hot { background: var(--red-soft); border-color: transparent; }
.ux .d-tiles .tile.urgent.hot .t-value, .ux .d-tiles .tile.urgent.hot .t-label { color: var(--bad); }
.ux .d-tiles .tile.urgent.warm { background: var(--amber-soft); border-color: transparent; }
.ux .d-tiles .tile.urgent.warm .t-value, .ux .d-tiles .tile.urgent.warm .t-label { color: var(--warn); }
.ux .d-tiles .ring-tile { align-items: flex-start; }
.ux .ring { width: 64px; height: 64px; display: block; margin-bottom: 2px; }
.ux .ring circle { fill: none; stroke-width: 7; }
.ux .ring .ring-bg { stroke: var(--chip); }
.ux .ring .ring-fg { stroke: #8944ab; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 32px 32px; }
.ux .ring text { font-size: 15px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) {:where(:root:not([data-theme="light"])) .ux .ring .ring-fg { stroke: #bf5af2; } }
/* forced dark (theme switch) */
:where(:root[data-theme="dark"]) .ux .ring .ring-fg { stroke: #bf5af2; }
@media (min-width: 640px) { .ux .d-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ux .d-tiles .tile.hero { grid-column: auto; } }
@media (min-width: 1024px) {
  .ux .d-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ux .d-tiles .tile.hero { grid-column: auto; }
  .ux .d-tiles .t-value, .ux .d-tiles .tile.hero .t-value { font-size: 1.7rem; }
}

/* ================================================================== 5C / 5D (2026-11-14) */
#fb-progress { position: fixed; top: 0; inset-inline-start: 0; width: 100%; height: 2px; z-index: 90; background: var(--blue);
  transform: scaleX(0); transform-origin: left; pointer-events: none; opacity: 0; }
[dir=rtl] #fb-progress { transform-origin: right; }
#fb-progress.run { opacity: 1; transform: scaleX(.85); transition: transform 6s cubic-bezier(.1, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { #fb-progress.run { transition: none; transform: scaleX(.6); } }
.ux .notif-fold { margin: 0; }
.ux .notif-fold > summary { list-style: none; cursor: pointer; }
.ux .notif-fold > summary::-webkit-details-marker { display: none; }
.ux .notif-fold[open] > summary .chev { transform: rotate(180deg); }
.ux .notif-fold > summary .chev { transition: transform .2s; }
.ux .quick-acts { display: flex; gap: 8px; margin-top: 12px; }
.ux .quick-acts button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; font-weight: 600; }
.ux .quick-acts .ic { width: 18px; height: 18px; vertical-align: 0; display: block; }
.ux .sheet-open { width: 100%; min-height: 46px; margin-top: 4px; }
.ux dialog.sheet .stack { padding-bottom: 4px; }
.ux dialog.sheet .primary { width: 100%; min-height: 48px; }

/* ================================================================== iOS Safari fixes (2026-11-14, from the iPhone test) */
/* Safari zooms the page when a field under 16px gets focus; phones only (a computer keeps the denser size). */
@media (max-width: 1023px) {
  body.ux input:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=range], [type=submit], [type=button], [type=image], [type=color]),
  body.ux textarea, body.ux select { font-size: 16px; }
}
/* The page behind everything is the page colour (not the navy bar's): when Safari shows the strip below the
   content (after a fold or the keyboard closing) it is the same grey / black as the page. */
html:has(body.ux), html.has-ux { background: var(--bg); }
body.ux { min-height: 100dvh; }

/* ================================================================== desktop tuning (>= 1024px), 2026-11-15
   The manager home: the rows that floated (sales stages, the team circles) sit in cards, the tools card
   spans the row instead of leaving half of it empty, and the side rail is a little wider so its labels fit. */
@media (min-width: 1024px) {
  :root { --rail: 84px; }
  .ux nav.bottom a { font-size: .72rem; }
  .ux .home-grid.mgr .o-tools { grid-column: span 12; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    column-gap: 24px; align-items: start; }
  /* three shortcuts side by side: no bottom line on any of them (the last used to have none and the other two had one, so
     they differed by a pixel), a light vertical divider between them instead */
  .ux .home-grid.mgr .o-tools .row.tool { border-bottom: 0; padding-inline-end: 12px; }
  .ux .home-grid.mgr .o-tools .row.tool:not(:last-child) { border-inline-end: var(--hair) solid var(--line); }
  .ux .home-grid .pipeline.g12 { background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 8px; gap: 0; margin: 0 0 12px; }
  .ux .home-grid .pipeline.g12 .step { background: transparent; border: 0; border-radius: 12px; }
  @media (hover: hover) { .ux .home-grid .pipeline.g12 .step:hover { background: var(--chip); } }
  .ux .home-grid .who-rail.g12 { flex-wrap: wrap; justify-content: space-evenly; overflow: visible; gap: 14px 18px; margin: 0 0 12px;
    padding: 14px 18px 10px; background: var(--card); border: var(--hair) solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); }
  .ux #push-card:not([hidden]) { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 520px; padding: 12px 16px; }
  .ux #push-card button { width: auto; flex: none; }
  .ux #push-card p { margin: 0; flex: 1 1 200px; }
}

/* ------------------------------------------------------------------ chat list: a manager's agent filter (2026-11-15) */
.ux .agent-filter { margin: 0 0 10px; }
.ux .agent-pick { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.ux .agent-pick label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--card);
  border: var(--hair) solid var(--line); border-radius: 999px; min-height: 44px; color: var(--muted); }
.ux .agent-pick select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); min-height: 40px; padding: 0; }
.ux .agent-pick button { min-height: 44px; border-radius: 999px; padding-inline: 14px; }
.js .ux .agent-pick button { display: none; }
.ux .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ux .state-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.ux .state-pills a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: var(--chip);
  color: var(--ink); text-decoration: none; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.ux .state-pills a.on { background: var(--blue-solid); color: var(--on-fill); }
.ux .state-pills .n { background: var(--card); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.ux .state-pills a.needs:not(.on) .n { background: var(--red-soft); color: var(--red-text); }

/* ================================================================== review batch, 2026-11-15 */

/* WebKit: the agent pick draws its own arrow (no grey native box inside the white pill). */
.ux .agent-pick select { -webkit-appearance: none; appearance: none; border-radius: 0; box-shadow: none; outline: none;
  -webkit-tap-highlight-color: transparent;
  padding-inline-end: 22px; min-height: 44px; background-color: transparent; background-repeat: no-repeat;
  background-size: 12px 12px; background-position: right 2px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[dir=rtl] .ux .agent-pick select { background-position: left 2px center; }
.ux .agent-pick label { min-height: 44px; }
/* the focus ring is drawn inside the pill (an outside outline was cut by the scrolling row on Android Chrome) */
.ux .agent-pick label { border-radius: 999px; }
.ux .agent-pick label:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
@supports selector(:has(*)) {
  .ux .agent-pick label:focus-within { box-shadow: none; }
  .ux .agent-pick label:has(select:focus-visible) { box-shadow: inset 0 0 0 2px var(--blue); }
}
/* a sheet's title is focused by script for screen readers; it needs no ring (it is not a control) */
dialog.sheet h2[tabindex]:focus { outline: none; }

/* the arrow chevron in list rows (replaces the text arrow, which pointed the wrong way in Arabic) */
.ux .row .chev, .ux .button .chev { color: var(--chev); width: 18px; height: 18px; vertical-align: -.2em; }
.ux .button .chev { color: inherit; opacity: .6; }
.ux .row.booking > span:last-child { display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* touch targets: 44px on touch screens. The coloured pills grow in height, not in looks. */
@media (pointer: coarse) {
  .ux .tabs a, .ux .state-pills a, .ux .seg, .ux .segmented .seg { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .ux .tabs { align-items: stretch; }
  .ux .bell, .ux .lang-pill { position: relative; }
  .ux .bell::after, .ux .lang-pill::after { content: ""; position: absolute; inset: -6px; }
  .ux .segmented.compact .seg { min-height: 44px; }
  .ux .button.small, .ux button.small { min-height: 44px; }
  .ux .cust-actions .act { width: 44px; height: 44px; }
  .ux .cust-actions { gap: 4px; }
}

/* the chat list's filter on a phone: one scrolling row (agent, then the three pills) */
@media (max-width: 640px) {
  .ux .agent-filter { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 2px -12px 4px;
    padding: 4px 12px; }  /* the padding keeps the pills' focus rings from being cut by the scrolling row */
  .ux .agent-filter::-webkit-scrollbar { display: none; }
  .ux .agent-filter .agent-pick { flex: none; margin: 0; }
  .ux .agent-filter .agent-pick label { flex: none; width: 168px; }
  .ux .agent-filter .state-pills { flex: none; flex-wrap: nowrap; }
}

/* the chat frame: a skeleton while a picked chat loads */
.split-pane { position: relative; }
.pane-skel { display: none; }
.split-pane.loading .pane-skel { display: flex; flex-direction: column; gap: 14px; position: absolute; inset: 0; z-index: 2;
  padding: 18px 24px; background: var(--paper); }
.pane-skel i { display: block; border-radius: 14px; background: linear-gradient(90deg, var(--chip) 25%, transparent 50%, var(--chip) 75%);
  background-size: 200% 100%; animation: pane-shimmer 1.2s linear infinite; }
.pane-skel i.h { height: 52px; border-radius: 12px; margin-bottom: 8px; }
.pane-skel i.b { height: 44px; max-width: 70%; }
.pane-skel i.w1 { width: 60%; } .pane-skel i.w2 { width: 45%; margin-inline-start: auto; } .pane-skel i.w3 { width: 70%; }
@keyframes pane-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pane-skel i { animation: none; } }

/* the empty frame: what is waiting, and a way into the oldest one */
.pane-sum { margin-top: 18px; padding: 16px 20px; background: var(--card); border: var(--hair) solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); display: grid; justify-items: center; gap: 6px; color: var(--ink); }
.pane-sum .n { font-size: 2rem; font-weight: 700; color: var(--bad); line-height: 1.1; }
.pane-sum small { color: var(--muted); }
.pane-sum .button { margin-top: 6px; border-radius: 999px; }
.pane-pick h2 { font-size: 1.25rem; }
.pane-pick p { color: var(--muted); }

/* chat list labels: readable size, and «late» in words, not colour alone */
.chat-name .ch-tag, .chat-meta .who-tag, .chat-meta .brand-tag, .ux .cust-card .brand-tag { font-size: .8125rem; }
.wait-pill .late-txt { font-weight: 700; }

/* home: a shortcut to the picked person's chats */
.ux .who-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ux .who-go a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--card); border: var(--hair) solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.ux .who-go a.need { background: var(--red-soft); color: var(--red-text); border-color: transparent; }
.ux .who-go .n { background: var(--card); border-radius: 999px; padding: 0 8px; font-size: .8rem; }

/* team status on a phone: a name and the three buttons on one line */
@media (max-width: 639px) {
  .ux .team-row { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 6px 0; }
  .ux .team-row > span:first-child { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
  .ux .team-row > span:first-child small { display: block; font-size: .72rem; }
  .ux .team-row .segmented { flex: none; width: auto; margin: 0; }
  .ux .team-row .seg { padding: 0 8px; font-size: .74rem; min-height: 44px; white-space: nowrap; flex: none; }
  .ux .team-row .segmented { gap: 0; }
  .ux .team-row > span:first-child b { font-size: .9rem; overflow-wrap: anywhere; }
}

/* maintenance: a rounded button and stages you can tell apart */
.ux .card > a.button.primary { border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding-inline: 18px; }
.ux .pipeline .step.m-new b { color: var(--m-new); } .ux .pipeline .step.m-replied b { color: var(--m-replied); }
.ux .pipeline .step.m-booked b { color: var(--m-booked); } .ux .pipeline .step.m-done b { color: var(--m-done); }
.ux .pipeline .step[class*=" m-"]:not(.on) { background: var(--card); }
.ux .pipeline .step.m-new:not(.on) { background: var(--wait-tint); } .ux .pipeline .step.m-done:not(.on) { background: var(--ok-tint); }
.ux .pipeline .step.on[class*=" m-"] b, .ux .pipeline .step.on[class*=" m-"] span { color: var(--on-fill); }

/* chat rows: the wait pill sits in the name line (it freed a whole column), so the tags keep their room */
.chat-row .chat-top { align-items: center; }
.chat-row .chat-top .wait-pill { flex: none; margin-inline-start: auto; }
.pane-sum { min-width: 280px; }
.pane-sum .button { white-space: nowrap; padding: 8px 18px; width: auto; height: auto; min-height: 44px; line-height: 1.5; display: inline-flex; align-items: center; }
@media (max-width: 480px) { .ux .cust-card .ch-tag, .chat-row .ch-tag { display: none; } }

/* ------------------------------------------------------------------ team chats («الرسائل», 2026-11-19)
   The list reuses the chat list's rows; «+» opens the people sheet; the chat reuses the chat screen. */
.ux .tm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 2px; }
.ux .tm-head h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.ux .tm-add { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--blue); color: var(--on-fill); }
.ux .tm-add .ic { width: 22px; height: 22px; vertical-align: 0; stroke-width: 2.2; }
.ux .tm-seek input[type=search] { width: 100%; }
.ux .tm-row[hidden], .ux .tm-nomatch[hidden] { display: none; }
.ux .tm-row .chat-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ux .tm-prev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .88rem; }
.ux .tm-row.unread .tm-prev { color: var(--ink); font-weight: 600; }
.ux .tm-row .badge-inline { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--blue); color: var(--on-fill); font-size: .72rem; font-weight: 700; line-height: 1; }
.ux .tm-av .ic { width: 20px; height: 20px; vertical-align: 0; }
.ux .tm-sub { margin: 20px 6px 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ux .tm-sub .count { font-weight: 500; }
.ux .tm-none { text-align: center; padding: 28px 12px; }
.ux .tm-people-list { display: grid; margin: 2px 0 8px; }
.ux .tm-person { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 2px; color: var(--ink); text-decoration: none;
  border-bottom: var(--hair) solid var(--line); }
.ux .tm-person:last-child { border-bottom: 0; }
.ux .tm-person .av { width: 40px; height: 40px; font-size: .95rem; }
.ux .tm-person-tx { flex: 1; min-width: 0; display: grid; }
.ux .tm-person-tx small { font-size: .8rem; }
.ux .tm-person .chev { width: 18px; height: 18px; color: var(--chev); }
.ux .tm-msg .st .ic { width: 1.05em; height: 1.05em; vertical-align: -.2em; }
.ux .tm-msg .st-read { color: var(--tick); }
.ux .tm-cust { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding: 10px 12px;
  border: 0; border-radius: 14px; background: var(--chip); color: inherit; text-decoration: none; }
.ux a.tm-cust:active { background: var(--tint); }
.ux .tm-cust b { font-weight: 600; }
.ux .tm-empty { padding: 24px 12px; }
/* the unread count on the bottom bar's «الرسائل» icon */
.ux nav.bottom a .tab-ic { display: grid; place-items: center; }
.ux .tab-badge { top: -3px; inset-inline-start: auto; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 5px;
  border: 2px solid var(--card); box-sizing: content-box; line-height: 18px; text-align: center; background: var(--bad); color: var(--on-fill);
  font-size: .68rem; font-weight: 700; }

/* ------------------------------------------------------------------ the 2026-11 papers, commission, warnings, files
   They were built in app.css with the old teal/cream colours; here they take the new look's tokens. */
.ux .fv-save, .ux .doc-acts button.send, .ux .plus-menu .ic-quote { background: var(--blue); border-color: var(--blue); color: var(--on-fill); }
.ux .file-view .fv-save { background: var(--blue); }
.ux .file-view .fv-page { box-shadow: var(--shadow-seg); border-radius: 10px; }
.ux .q-qty button { background: var(--chip); color: var(--blue-text); }
.ux .q-line, .ux .q-totals .q-total, .ux .q-share b, .ux .q-pct, .ux .paper-pct, .ux .paper-when.left,
.ux .hero-num b, .ux .comm-facts .f-collected dd { color: var(--blue-text); }
.ux .q-totals .q-total { border-top-color: var(--line); }
.ux .q-discount .chip:has(input:checked), .ux .q-pct-chip[aria-pressed="true"], .ux .comm-levels li.current, .ux .who.on {
  background: var(--blue); border-color: var(--blue); color: var(--on-fill); }
.ux .who.on b { background: rgb(255 255 255 / .22); color: var(--on-fill); }
.ux .q-from, .ux .pill.paper-partial, .ux .paper-tiles .paper-partial, .ux .pct-chip { background: var(--tint); color: var(--blue-text); }
.ux .pp-partial, .ux .paper-row.paper-partial { border-inline-start-color: var(--blue); }
.ux .pp-bar { background: var(--chip); }
.ux .pp-bar i { background: var(--blue); }
.ux .pp-when { border-top-color: var(--line); }
.ux .pp-add > summary { background: var(--tint); border: 0; color: var(--blue-text); border-radius: 12px; }
.ux .ring-track { stroke: var(--chip); }
.ux .ring-value { stroke: var(--blue); }
.ux .ring-tick { stroke: var(--card); }
.ux .comm-level { color: var(--ok-text); }
.ux .comm-facts > div { background: var(--chip); }
.ux .comm-facts .f-collected { background: var(--tint); }
.ux .comm-levels li { border-color: var(--line); }
.ux .comm-levels li.reached { background: var(--ok-tint); border-color: transparent; }
.ux .comm-levels li.current .lv-mark .ic { stroke-width: 2.4; }
.ux .comm-levels .lv-mark .ic { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.ux .perf { --c-contracts: var(--blue); --c-sales: var(--ok); --c-collected: var(--warn); --c-commission: var(--m-booked);
  --perf-track: var(--chip); --perf-done: var(--ok-tint); --perf-tick: var(--ok); }
.ux .loc-sheet { border-radius: 20px 20px 0 0; }
.ux .loc-head h2 { display: flex; align-items: center; gap: 8px; }
.ux .loc-sheet .round { background: var(--chip); color: var(--ink); }
.ux .loc-sheet .round .ic { width: 18px; height: 18px; vertical-align: 0; }
.ux .loc-sheet .primary { width: 100%; min-height: 48px; border-radius: 12px; }

/* warnings: the «الإنذارات» button, the list, the window over the page */
.ux .warn-btn { color: var(--on-fill); }
.ux .warn-green { background: var(--ok); }
.ux .warn-blue { background: var(--blue); }
.ux .warn-yellow { background: var(--warn); color: var(--on-warn); }
.ux .warn-yellow b { background: rgb(0 0 0 / .12); }
.ux .warn-red { background: var(--bad); }
.ux .warn-row span:first-child, .ux .warn-waiting { color: var(--bad); }
.ux .ok-text { color: var(--ok-text); }
.ux .warn-item { border-top: var(--hair) solid var(--line); }
.ux .warn-btn .ic, .ux .warn-item .ic, .ux .warn-waiting .ic, .ux .ok-text .ic { width: 1.05em; height: 1.05em; vertical-align: -.2em; }
.ux .warn-item b .ic { color: var(--bad); }
.ux form.stack button.danger { min-height: 48px; border-radius: 12px; font-size: 1rem; }
.ux .warn-pop { background: rgb(0 0 0 / .5); }
.ux .warn-card { border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-float); }
.ux .warn-card h2 { display: flex; align-items: center; gap: 8px; color: var(--bad); font-size: 1.3rem; }
.ux .warn-meta { color: var(--muted); opacity: 1; }
.ux .warn-text { background: var(--late-tint); color: var(--ink); border-radius: 14px; }
.ux .warn-ok { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px;
  background: var(--blue); color: var(--on-fill); }
.ux .warn-ok .ic { width: 1.1em; height: 1.1em; vertical-align: 0; }


/* ------------------------------------------------------------------ forced dark for app.css's dark rules
   (generated from the @media (prefers-color-scheme: dark) blocks of app.css; they apply when the visitor picks «داكن») */
:where(:root[data-theme="dark"]) .msg.out { background: #134e4a; }
:where(:root[data-theme="dark"]) .msg.out.auto { background: #0c4a6e; }
:where(:root[data-theme="dark"]) .msg.note { background: #422006; }
:where(:root[data-theme="dark"]) .q-qty button { background: #1f3537; color: #cfe3df; }
:where(:root[data-theme="dark"]) .q-discount .chip, :where(:root[data-theme="dark"]) .q-pct-chip { background: #23292b; }
:where(:root[data-theme="dark"]) .q-totals { background: #22282a; color: inherit; border-color: #8f7a52; }
:where(:root[data-theme="dark"]) .q-totals .q-total, :where(:root[data-theme="dark"]) .q-line { color: #8fc2bd; }
:where(:root[data-theme="dark"]) .pp-money { background: #22282a; }
:where(:root[data-theme="dark"]) .pp-bar { background: #2a3133; }
:where(:root[data-theme="dark"]) .pp-when { border-top-color: #2a3133; }
:where(:root[data-theme="dark"]) .pp-bar i { background: #8fc2bd; }
:where(:root[data-theme="dark"]) .pp-overdue .pp-bar i { background: #e3a49a; }
:where(:root[data-theme="dark"]) .pp-paid .pp-bar i { background: #9cc4b1; }
:where(:root[data-theme="dark"]) .pp-ledger .pp-left { color: #d9c08f; }
:where(:root[data-theme="dark"]) .pp-add > summary { background: #1a2a2b; border-color: #35575a; color: #8fc2bd; }
:where(:root[data-theme="dark"]) .pp-admin summary, :where(:root[data-theme="dark"]) .py-cancel summary { color: #e3a49a; }
:where(:root[data-theme="dark"]) .hero-num b, :where(:root[data-theme="dark"]) .comm-facts .f-collected dd { color: #8fc2bd; }
:where(:root[data-theme="dark"]) .comm-level { color: #9cc4b1; }
:where(:root[data-theme="dark"]) .ring-track { stroke: #2a3133; }
:where(:root[data-theme="dark"]) .perf { --perf-track: #222c3a; --perf-done: #1d3a33; --perf-tick: #7fd3bd; }
:where(:root[data-theme="dark"]) .ring-value { stroke: #8fc2bd; }
:where(:root[data-theme="dark"]) .comm-facts .f-measured { background: #1e2a36; }
:where(:root[data-theme="dark"]) .comm-facts .f-contracts { background: #20302a; }
:where(:root[data-theme="dark"]) .comm-facts .f-sales { background: #2e2a20; }
:where(:root[data-theme="dark"]) .comm-facts .f-received { background: #262d1f; }
:where(:root[data-theme="dark"]) .comm-facts .f-collected { background: #1f3537; }
:where(:root[data-theme="dark"]) .comm-facts .f-next { background: #27242f; }
:where(:root[data-theme="dark"]) .comm-levels li.reached { background: #20302a; }
:where(:root[data-theme="dark"]) .comm-levels li.current { background: #8fc2bd; color: #0b1120; }
:where(:root[data-theme="dark"]) .q-from { background: #1f3537; color: #cfe3df; }
:where(:root[data-theme="dark"]) .q-totals .q-pay { color: #9cc4b1; }
:where(:root[data-theme="dark"]) .q-totals .q-left { color: #d9c08f; }
:where(:root[data-theme="dark"]) .pill.paper-quote, :where(:root[data-theme="dark"]) .paper-tiles .paper-quote { background: #1e2a36; color: #a9c2dc; }
:where(:root[data-theme="dark"]) .pill.paper-unpaid { background: #2e2a20; color: #d9c08f; }
:where(:root[data-theme="dark"]) .pill.paper-partial, :where(:root[data-theme="dark"]) .paper-tiles .paper-partial { background: #1f3537; color: #8fc2bd; }
:where(:root[data-theme="dark"]) .pill.paper-overdue, :where(:root[data-theme="dark"]) .paper-tiles .paper-overdue { background: #3a2522; color: #e3a49a; }
:where(:root[data-theme="dark"]) .pill.paper-paid, :where(:root[data-theme="dark"]) .paper-tiles .paper-paid { background: #20302a; color: #9cc4b1; }
:where(:root[data-theme="dark"]) .paper-tiles .tile { background: #1b2126; }
:where(:root[data-theme="dark"]) .paper-row.paper-overdue { background: #2a1e1c; }
:where(:root[data-theme="dark"]) .pr-n { background: #2e2a20; color: #d9c08f; }
:where(:root[data-theme="dark"]) .paper-when.left { color: #8fc2bd; }
:where(:root[data-theme="dark"]) .paper-when.today { color: #d9c08f; }
:where(:root[data-theme="dark"]) .paper-when.late { color: #e3a49a; }
:where(:root[data-theme="dark"]) .paper-when.done { color: #9cc4b1; }
:where(:root[data-theme="dark"]) .paper-pct, :where(:root[data-theme="dark"]) .pct-chip, :where(:root[data-theme="dark"]) .q-share b, :where(:root[data-theme="dark"]) .q-pct { color: #8fc2bd; }
:where(:root[data-theme="dark"]) .pct-chip { background: #1f3537; }
:where(:root[data-theme="dark"]) .q-share { background: #22282a; }
:where(:root[data-theme="dark"]) .pct-after { color: #9cc4b1; }
:where(:root[data-theme="dark"]) .minv-pick > label, :where(:root[data-theme="dark"]) .minv-list li.added .pr::after, :where(:root[data-theme="dark"]) .minv-totals .q-total { color: #9cc4b1; }
:where(:root[data-theme="dark"]) .minv-list li.act { background: #22282a; }
:where(:root[data-theme="dark"]) .minv-custom { background: #1b2126; border-color: #8f7a52; }
:where(:root[data-theme="dark"]) .minv-cadd { background: #2f7a55; border-color: #2f7a55; }
:where(:root[data-theme="dark"]) .minv-row.minv-hit { animation-name: minv-hit-dark; }
:where(:root[data-theme="dark"]) .tm-ava { background: #23393c; color: #a7d3cf; }
:where(:root[data-theme="dark"]) .tm-cust { background: rgb(143 194 189 / .1); border-color: rgb(143 194 189 / .25); }
:where(:root[data-theme="dark"]) .who b { background: #3a2522; color: #e3a49a; }
:where(:root[data-theme="dark"]) .who.who-hr { border-color: #3a3448; }
:where(:root[data-theme="dark"]) .who.who-maint { border-color: #2c3b35; }
:where(:root[data-theme="dark"]) .who.on { background: #8fc2bd; border-color: #8fc2bd; color: #0b1120; }
:where(:root[data-theme="dark"]) .who.on b { background: rgb(11 17 32 / .18); color: #0b1120; }
:where(:root[data-theme="dark"]) .loc-here { color: #4ade80; }
:where(:root[data-theme="dark"]) .handbook .tip { background: #422006; color: #fcd34d; }
:where(:root[data-theme="dark"]) .maint-pill { background: #431407; color: #fdba74; }

/* ------------------------------------------------------------------ theme switch (2026-11-19)
   «تلقائي» follows the phone (prefers-color-scheme); «فاتح» / «داكن» set <html data-theme> (theme.js).
   Every dark block above has a forced copy for [data-theme="dark"] and a guard for [data-theme="light"]. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
/* the opened list of a <select> (the agent pick, brands, people): readable in both themes */
.ux select option, .ux select optgroup { background-color: var(--card); color: var(--ink); }
.ux .theme-btn { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .12); color: var(--on-fill); position: relative; }
.ux .theme-btn .ic { width: 18px; height: 18px; vertical-align: 0; }
.ux .theme-btn::after { content: ""; position: absolute; inset: -6px; }
.ux .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .ux .theme-btn .i-sun { display: inline-block; }
:root[data-theme="dark"] .ux .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .ux .theme-btn .i-sun { display: inline-block; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .ux .theme-btn .i-moon { display: none; }
}
.ux .theme-seg .seg { flex: 1; }

/* ------------------------------------------------------------------ steady, calm, iOS (2026-11-19)
   No hover movement, no jump when a scrollbar appears, no entry animation on what refreshes itself,
   a quiet amber / soft red instead of loud red, and the phone's own ergonomics. */
:root { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.ux :is(.thread, .split-list, .cust-list) { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
/* what refreshes itself (data-live / data-poll) never plays an entry animation, so a refresh is invisible */
.ux :is([data-live], [data-poll], .thread) * { animation: none; }
.ux :is(.chat-row, .cust-card, .lead-card) { min-height: 72px; }
.ux .tm-row { min-height: 68px; }
.ux .pane-skel i { min-height: 56px; }

/* touch: no grey flash, no 300ms wait, and the same press feel on the bottom bar */
.ux { -webkit-tap-highlight-color: transparent; }
.ux :is(a, button, [role=button], label, summary, select, input, textarea) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ux nav.bottom a:active { transform: scale(.985); opacity: .78; }
/* iOS zooms into a field under 16px: every field on a phone is at least 16px */
@media (max-width: 1023.98px) {
  body.ux :is(input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=hidden], [type=color], [type=submit], [type=button]), textarea, select) { font-size: max(16px, 1em); }
}
@media (prefers-reduced-motion: reduce) { .ux :is(a, button, nav.bottom a):active { transform: none; } }

/* quiet states: amber for waiting, a soft red only where it is really late */
.ux .late-card { border-inline-start: 0; }
.ux .status.critical { background: var(--red-soft); color: var(--red-text); }
.ux .status.warning { background: var(--amber-soft); color: var(--amber-text); }
.ux .status.good { background: var(--ok-tint); color: var(--ok); }
.ux #d-waiting { background: var(--card); }
.ux #d-waiting .d-list b { color: var(--ink); }
.ux .d-grid { padding-bottom: 28px; }
.ux .d-card { padding-bottom: 18px; }
.ux .d-all { padding-block: 6px 2px; }

/* WhatsApp's own colours in the chat screens (the customer chat and the team chat) */
.ux .msg.in { color: var(--chat-ink); }
.ux .msg.out { color: var(--chat-ink-out); }
.ux .msg.in .meta { color: color-mix(in srgb, var(--chat-ink) 62%, transparent); }
.ux .msg.out .meta { color: color-mix(in srgb, var(--chat-ink-out) 72%, transparent); }
.ux .composer .mode [aria-checked="true"][data-mode="reply"] { background: var(--wa-send); }

/* the top bar stays dark in both themes, so its buttons stay light */
.ux .top :is(.theme-btn, .bell, .gear, .lang-pill, .brand, .top-back) { color: var(--on-fill); }
.ux .paper-row:hover { box-shadow: none; }
@media (hover: hover) { .ux .paper-row:hover { background-color: var(--hover); } }

/* WhatsApp's own colours: only in WhatsApp chats and the team chat (body.wa-chat). Instagram, Facebook, TikTok, the website,
   phone and walk-in chats get the standard background and a blue sent bubble (the palette in :root), so a chat never looks
   like it comes from the wrong channel. */
.ux.wa-chat { --paper: #efeae2; --bubble-in: #ffffff; --bubble-out: #d9fdd3; --chat-ink: #111b21; --chat-ink-out: #111b21; --wa-bar: #ffffff; --wa-send: #00a884; --tick: #2a8bd8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ux.wa-chat { --paper: #0b141a; --bubble-in: #202c33; --bubble-out: #005c4b; --chat-ink: #e9edef; --chat-ink-out: #e9edef; --wa-send: #00a884; --wa-bar: #202c33; --tick: #53bdeb; }
}
:root[data-theme="dark"] .ux.wa-chat { --paper: #0b141a; --bubble-in: #202c33; --bubble-out: #005c4b; --chat-ink: #e9edef; --chat-ink-out: #e9edef; --wa-send: #00a884; --wa-bar: #202c33; --tick: #53bdeb; }

/* the status bar: the three picks keep one fixed width, so the name and the avatar never move when the pick changes */
.ux .status-bar .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: none; width: min(15.5rem, 64%); }
.ux .status-bar .segmented .seg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

/* contrast fixes from the 2026-11-19 sweep: text on tints and on solid fills passes 4.5:1 in both themes */
.ux .warn-green { background: color-mix(in srgb, var(--ok) 86%, #000); }
.ux .cust-main .chat-meta .quiet, .ux .quiet { color: var(--amber-text); }
.ux .banner.warn { color: var(--on-warn); }
.ux .paper-paid, .ux .paper-paid b, .ux .paper-paid span { color: var(--ok-text); }
.ux .comm-facts dt { color: color-mix(in srgb, var(--ink) 78%, var(--card)); }
.ux .tm-prev, .ux .chat-time { color: color-mix(in srgb, var(--ink) 66%, var(--card)); }
/* home pipeline numbers and chart labels: readable in both themes */
.ux .pipeline .g-new b { color: var(--blue-text); } .ux .pipeline .g-replied b { color: var(--m-booked); }
.ux .pipeline .g-measurement b { color: var(--m-replied); } .ux .pipeline .g-quote_sent b { color: var(--amber-text); }
.ux .pipeline .g-won_lost b, .ux .pipeline .g-contract b, .ux .pipeline .g-paid b { color: var(--ok-text); }
.ux .col-val { color: var(--ink); }
.ux .d-tiles .tile .status { background: color-mix(in srgb, var(--card) 72%, transparent); }
.ux .d-tiles .tile.urgent.hot .t-label { color: var(--red-text); }
.ux .d-tiles .tile.urgent.warm .t-label { color: var(--amber-text); }
.ux button.danger, .ux .button.danger { background: color-mix(in srgb, var(--bad) 80%, #000); border-color: transparent; color: var(--on-fill); }
.ux #overdue-live button.small { color: var(--ink); }
.ux .tabs.stage-pills a.on .n { background: rgb(0 0 0 / .2); color: var(--on-fill); }

/* the status picks (متاح / مشغول / غير متصل): each has its own dot; the active one takes its colour as a soft disc.
   Text colours are chosen for contrast on the tinted disc: 4.5:1 and up in light, 7:1 and up in dark. */
.ux .seg.st-online { --sd: var(--st-online-dot); --sx: var(--st-online-text); --sb: var(--st-online-bg); }
.ux .seg.st-busy { --sd: var(--st-busy-dot); --sx: var(--st-busy-text); --sb: var(--st-busy-bg); }
.ux .seg.st-offline { --sd: var(--st-offline-dot); --sx: var(--st-offline-text); --sb: var(--st-offline-bg); }
.ux .seg[class*="st-"] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ux .seg[class*="st-"]::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sd); }
.ux .seg[class*="st-"].on { background: var(--sb); color: var(--sx); box-shadow: none; }

/* opening a chat: the message list waits (hidden, still laid out) until the page is at the newest message, so the eye never sees
   it at the top and then jump; ux.js lifts it at once, and this animation lifts it by itself if scripts are late */
.fb-chat-pending .thread { visibility: hidden; animation: fb-reveal 0s linear 700ms forwards; }
@keyframes fb-reveal { to { visibility: visible; } }


/* ------------------------------------------------------------------ no sideways page on a narrow phone (2026-11-21)
   A manager's / owner's home (avatar + «الإنذارات» + name + the three status picks, and the 4-step pipeline) was wider than a
   340-360px screen, so the whole page slid left and right on Android. The cause was cells that could not shrink. */
.ux .home-grid > *, .ux .home-grid .card, .ux .home-grid .cards > * { min-width: 0; }
.ux .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ux .pipeline .step { min-width: 0; }
.ux .pipeline .step span { overflow-wrap: anywhere; }
.ux .status-bar { flex-wrap: wrap; }
@media (max-width: 440px) {
  /* the picks get their own line, full width and still three equal cells: nothing is pushed out of the screen */
  .ux .status-bar .segmented { flex: 1 1 100%; width: 100%; order: 5; }
  .ux .status-bar .nm { display: block; flex: 1 1 0; min-width: 0; }
  .ux .pipeline .step { padding-inline: 4px; }
  .ux .pipeline .step span { font-size: .68rem; line-height: 1.25; }
}
/* long words and addresses (a maps link in a visit card) wrap inside their card instead of widening the page */
.ux main :is(.card, .row, .cust-card, li, p, small, a, span, b) { overflow-wrap: anywhere; }
/* a last safety net: nothing can make the page itself scroll sideways (the cause is fixed above; this only keeps a future
   long string from sliding the whole screen) */
html { overflow-x: clip; }

/* «صيانة» (2026-11-24) on the wide manager home: one cell of the tools row, its three under it */
@media (min-width: 1024px) {
  .ux .home-grid.mgr .o-tools details.hub { border-inline-end: var(--hair) solid var(--line); padding-inline-end: 12px; }
  .ux .home-grid.mgr .o-tools details.hub .row.tool { border-inline-end: 0; padding-inline-end: 0; }
  .ux .home-grid.mgr .o-tools details.hub > summary,
  .ux .home-grid.mgr .o-tools details.hub .hub-rows { border-bottom: 0; }
}

/* «القائمة» on a phone (2026-11-29, the rules are in app.css): the new look's colours and icons */
@media (max-width: 1023px) {
  .js .ux .nav-menu-btn { border: var(--hair) solid var(--line); box-shadow: var(--shadow), 0 6px 18px rgba(15, 23, 42, .18); }
  .js .ux #nav-main.open { border: var(--hair) solid var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .js .ux #nav-main a { font-size: .92rem; font-weight: 600; }
  .js .ux #nav-main a span.ni { width: 34px; height: 34px; border-radius: 10px; font-size: 0; }
  .js .ux #nav-main a span.ni .ic { width: 21px; height: 21px; }
  .js .ux #nav-main a:hover { background: var(--chip); }
  .js .ux #nav-main a.on { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
  .js .ux #nav-main a.on span.ni { background: transparent; }
  .js .ux .fab { inset-block-end: calc(14px + env(safe-area-inset-bottom)); }  /* no bar under it now */
}
