/* WI-0111 — the Alpha web application's only stylesheet.
   Redesigned on 17 September 2026 under the owner's visual direction
   (ADR-0007 and the visual redesign note under docs/ux/alpha). Standards-only CSS: no
   framework, no design system, no external font, no image, no CDN, no import
   and no external reference of any kind.
   Fonts are the reader's own installed Persian-capable system fonts, named in a
   fallback stack; this Alpha downloads and selects no typeface (CQ-0026,
   CQ-0027 untouched).

   TWO SHELLS, ONE DOCUMENT. `body[data-shell]` is set by the client from the
   server-derived role -- customer, staff, or entry -- and every colour below is
   a token that the shell redefines. The customer works in a deep forest-green
   shell with focused quote cards; staff work on a light warm-neutral canvas with
   a dark persistent sidebar. Warm gold is the single accent in both. Buy is
   always green and always says "خرید"; sell is always red and always says
   "فروش" -- colour never carries a meaning on its own. */

:root {
  /* UR-20261106 (WP-0, spec §1.3): no typeface is downloaded (CQ-0026); the wide "DejaVu Sans" fallback is no longer
     named, and the monospace stack is kept only for `.idchip` outside tables and the technical folds */
  --font: "Vazirmatn", "Vazir", "IRANSansX", "IRANSans", "Segoe UI", Tahoma,
          "Noto Sans Arabic", "Noto Naskh Arabic", "SF Arabic", "Geeza Pro", sans-serif;
  --mono: "DejaVu Sans Mono", "Consolas", monospace;

  --gold: #c9a24a;
  --gold-soft: #e6cf8a;
  --gold-ink: #6b4f0e;

  --green-950: #0b1c17;
  --green-900: #0f2620;
  --green-800: #153229;
  --green-700: #1c4034;
  --green-600: #245544;

  --buy: #2f9e63;
  --buy-deep: #1f7a4a;
  --sell: #d4523f;
  --sell-deep: #a63a2b;

  --charcoal: #1e2724;
  --charcoal-2: #27322e;

  --canvas: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1c2320;
  --muted: #5f6b65;

  --warn-bg: #fff3d1;
  --warn-line: #d9a441;
  --danger: #9b2f24;
  --danger-soft: #fbe7e4;
  --ok: #2f7a55;

  /* shell tokens, defaulted to the light canvas (entry + staff) */
  --bg: var(--canvas);
  --surface: var(--paper);
  --surface-2: #efeadf;
  --text: var(--ink);
  --text-muted: var(--muted);
  --line: #e1dacb;
  --line-strong: #c9c0ad;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 6px 18px rgba(20, 30, 25, 0.06);
  --wash-ink: rgba(155, 47, 36, 0.085);
  --nav-bg: var(--paper);
  --nav-fg: var(--ink);
  --nav-active-bg: var(--green-800);
  --nav-active-fg: #fff;
  --radius: 12px;
  --radius-sm: 8px;

  /* UR-20261106 (WP-0, spec §1.2): status inks, the spacing scale, pills, shadows and the focus ring */
  --ok-ink: #1f6b45;
  --ok-bg: rgba(47, 122, 85, 0.12);
  --bad-ink: #a63a2b;
  --warn-ink: #6b4f0e;
  --error-ink: #9b2f24;
  --met-ink: #2f7a55;
  --focus: var(--gold);
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --radius-pill: 999px;
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-overlay: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body[data-shell="customer"] {
  --bg: var(--green-900);
  --surface: var(--green-800);
  --surface-2: var(--green-700);
  --text: #f2eee3;
  --text-muted: #b6c4bb;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 24px rgba(0, 0, 0, 0.25);
  --wash-ink: rgba(255, 255, 255, 0.07);
  --nav-bg: var(--green-950);
  --nav-fg: #d9e3dd;
  --nav-active-bg: var(--gold);
  --nav-active-fg: var(--green-950);
  --warn-bg: rgba(201, 162, 74, 0.16);
  --warn-line: var(--gold);
  --danger-soft: rgba(212, 82, 63, 0.18);
  /* UR-20261106 (WP-0, spec §1.2): the same inks, readable on the dark green shell */
  --ok-ink: #8fe0b3;
  --ok-bg: rgba(95, 207, 149, 0.16);
  --bad-ink: #f2a396;
  --warn-ink: #f3d98a;
  --error-ink: #f08a78;
  --met-ink: #5fcf95;
}

body[data-shell="staff"] {
  --nav-bg: var(--charcoal);
  --nav-fg: #d7ddd9;
  --nav-active-bg: var(--gold);
  --nav-active-fg: var(--charcoal);
}

* { box-sizing: border-box; }

/* The `hidden` attribute is the ONE visibility mechanism the client uses, so
   it must beat every layout rule below (a `.navbtn { display: flex }` would
   otherwise out-rank the user agent's `[hidden]` rule and show a control the
   client had hidden). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
}
body { min-height: 100vh; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.35; margin: 0; }
p { margin: 0; }

svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor;
      stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* Latin identifiers and numbers are isolated so RTL punctuation and joining
   never reorder them. `bdi` carries its own direction; the class sets it. */
.ltr, bdi.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* An LTR run placed in an RTL grid or flex box must sit at the INLINE START
   (the right), shrink-wrapped, or its own left-to-right text alignment drags
   the number to the far left of the card. */
.ltr, bdi.ltr, .quote-value, .price-magnitude { justify-self: start; align-self: start; }
.num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.idchip {
  direction: ltr; unicode-bidi: isolate; display: inline-block;
  font-family: var(--mono); font-size: 0.78em;
  padding: 0.05em 0.5em; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-muted);
}

/* ---------------------------------------------------------------- watermark
   P-2 / A22. Two independent carriers, both permanent. The band is a real
   element in the document flow; the wash is a fixed, non-interactive overlay
   across the whole viewport. Neither is written to by any script in this tree,
   neither is behind a class toggle, and the print rules below repeat both. */
.watermark-band {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  align-items: baseline;
  justify-content: center;
  background: #8c2f28;
  color: #fff;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-align: center;
}
.watermark-band strong { letter-spacing: 0.12em; font-family: var(--mono); font-size: 0.78rem; }
@media (max-width: 30rem) { .watermark-band { font-size: 0.72rem; padding: 0.3rem 0.6rem; } }

.watermark-wash {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background-image: repeating-linear-gradient(-45deg, transparent 0 140px, var(--wash-ink) 140px 142px);
}
.watermark-wash::after {
  content: "INTERNAL ALPHA / TEST DATA";
  position: fixed;
  top: 48%;
  right: 50%;
  transform: translate(50%, -50%) rotate(-24deg);
  font-family: var(--mono);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--wash-ink);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- frame */
.app { position: relative; z-index: 35; min-height: calc(100vh - 2.2rem); }
.frame { display: flex; flex-direction: column; min-height: inherit; }
.topbar, .mainnav, main { min-width: 0; }
/* Grid and flex items default to min-width:auto, which lets a wide intrinsic
   child (a <select> with a long option) push a card past the viewport. */
.block, .stat, .fact, .board, .persona-card, .pricebox, .axis { min-width: 0; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.05rem; }
.topbar-sub { color: var(--text-muted); font-size: 0.78rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
/* C05 (P11-F1): the build identity, in the server's words; a quiet line, never a badge */
.build-identity { color: var(--text-muted); font-size: 0.72rem; margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.topbar-session { display: flex; align-items: center; gap: 0.6rem; }
.who { font-size: 0.86rem; color: var(--text-muted); display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.who strong { color: var(--text); font-weight: 700; }

.nonbinding {
  display: inline-block;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: inherit;
  border-radius: 999px;
  padding: 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  vertical-align: middle;
  justify-self: start;   /* never stretched when it lands in a grid */
}

main {
  flex: 1;
  width: 100%;
  max-width: 74rem;
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem;   /* room for the bottom navigation on a phone */
}

/* ---------------------------------------------------------------- nav
   Mobile first: a bottom bar with icons and short labels, every target at
   least 44px tall. Disabled orientation entries are hidden on a phone. */
.mainnav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: space-around;
  background: var(--nav-bg);
  color: var(--nav-fg);
  border-top: 1px solid var(--line-strong);
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom, 0));
}
.mainnav .brand { display: none; }
.navbtn {
  flex: 1 1 0;
  min-height: 56px;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  white-space: nowrap;
}
.navbtn svg { width: 1.45rem; height: 1.45rem; }
.navbtn small { display: none; }
.navbtn[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.navbtn[disabled] { display: none; }

/* ---------------------------------------------------------------- pages */
.view > .page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  justify-content: space-between;
  align-items: flex-end;
  margin: 0.25rem 0 1rem;
}
.page-head h2 { font-size: 1.35rem; line-height: 1.35; }
.page-context { color: var(--text-muted); font-size: 0.86rem; max-width: 46rem; }
.page-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.block-head { margin-bottom: 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; }
.block h3 { font-size: 1.1rem; }
.block h4 { font-size: 1rem; color: var(--text); font-weight: 700; }

.hint { color: var(--text-muted); font-size: 0.84rem; }
.hint.tiny { font-size: 0.84rem; }
.lead { font-size: 0.95rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
label.inline { font-size: 0.86rem; color: var(--text-muted); }

/* ------------------------------------------------ the live look (ADR-0010)
 * Worn ONLY by the owner's evaluation instance, which tells the browser so.
 * Without that, nothing below matches and the application looks as it did. */
body[data-look="live"] #watermark-band,
body[data-look="live"] #watermark-wash,
body[data-look="live"] .nonbinding,
body[data-look="live"] [data-testword] { display: none !important; }
/* 2026-11-09 R6 (owner item 1): the live look's FIRST PAINT. The document's markup is the plain build's entry (its test
 * wording); the live server marks the body data-look="live" before the first byte, and app.js rewrites the page and
 * marks it data-worn="live" (wearLiveLook) once it has arrived. Until then nothing of the frame is painted -- a hard
 * refresh over a slow line shows an empty page and, after a short pause, one quiet ring; never the plain entry. */
body[data-look="live"]:not([data-worn="live"]) .frame { display: none !important; }
body[data-look="live"]:not([data-worn="live"])::after {
  content: ""; position: fixed; top: 50%; left: 50%; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem;
  box-sizing: border-box; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--gold);
  opacity: 0; animation: row-fetch-turn 0.9s linear infinite, look-wait-show 0.2s ease-out 0.3s forwards;
}
@keyframes look-wait-show { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body[data-look="live"]:not([data-worn="live"])::after { animation: look-wait-show 0.2s ease-out 0.3s forwards; }
}
.live-login { max-width: 24rem; margin: 0 auto; display: grid; gap: 0.8rem; text-align: start; }
.live-login .cfg-field input { width: 100%; }
.live-login input[type="password"] {
  font: inherit; padding: 0.5rem 0.7rem; min-height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: inherit; width: 100%;
}
.who small { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

/* ------------------------------------------ phones: rotation and zoom
 * A phone browser enlarges text when it rotates and zooms into any field whose
 * text is under 16px, and then stays zoomed. Both are switched off here. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, select, textarea { font-size: max(16px, 1rem); font-family: inherit; }
body[data-look="live"] .app {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
@media (orientation: landscape) and (max-height: 32rem) {
  .sheet { max-height: 96vh; }
  .topbar { padding-block: 0.3rem; }
}

/* --------------------------------------------------- the price boards */
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0 0.4rem; }
.board-head h3 { font-size: 1rem; }
.board-updated { font-size: 0.84rem; color: var(--text-muted); }
.board-list { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.board-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0.6rem; display: grid; gap: 0.45rem; }
.board-asset { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0.2rem; }
.board-unit { font-size: 0.76rem; color: var(--text-muted); }
.board-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(4.5rem, 0.8fr) minmax(0, 1fr); gap: 0.45rem; align-items: stretch; }
.board-title { display: grid; place-items: center; align-content: center; text-align: center; font-size: 0.86rem; font-weight: 600; line-height: 1.3; }
.boardbtn { display: grid !important; gap: 0.1rem; justify-items: center; padding: 0.5rem 0.3rem; min-height: 56px; width: 100%; position: relative; }
.boardbtn small { font-size: 0.78rem; font-weight: 500; opacity: 0.9; }
.boardbtn .num { font-size: 1.02rem; font-weight: 700; }
.board-arrow { position: absolute; top: 0.2rem; inset-inline-start: 0.4rem; font-size: 0.7rem; }
.boardbtn.flash { animation: boardflash 1.6s ease-out 1; }
@keyframes boardflash { 0% { box-shadow: 0 0 0 0 rgba(201, 162, 74, 0.95); } 100% { box-shadow: 0 0 0 14px rgba(201, 162, 74, 0); } }
.board-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.7rem; }
.board-caption { font-size: 0.84rem; color: var(--text-muted); }
.board-controls .segmented button { border: 0; border-radius: 0; }
.board-controls .segmented button[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }
.board-row.operator { grid-template-columns: minmax(0, 1fr) minmax(4rem, 0.5fr) minmax(0, 1fr); }
.board-edit { display: grid; gap: 0.25rem; padding: 0.4rem; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.board-edit.buy { border-inline-start: 3px solid var(--buy); }
.board-edit.sell { border-inline-start: 3px solid var(--sell); }
.board-edit small { font-size: 0.74rem; color: var(--text-muted); }
.board-editline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.3rem; align-items: center; }
.board-editline input { width: 100%; text-align: center; font-weight: 700; }
.stepbtn { min-width: 44px; font-size: 1.2rem; padding: 0.2rem; }
@media (max-width: 47.99rem) {
  .board-row.operator { grid-template-columns: 1fr; }
  .board-row.operator .board-title { order: -1; justify-items: start; text-align: start; }
}

/* ------------------------------------------------ ONE board, one table */
#trade-board, .board-table { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 1rem; }
#trade-board .board-row, .board-table .board-row { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }
#trade-board .board-row:last-child, .board-table .board-row:last-child { border-bottom: 0; }
.board-headrow { font-size: 0.84rem; color: var(--text-muted); text-align: center; padding-block: 0.35rem !important; background: var(--surface-2); }
.board-title { display: grid; gap: 0.1rem; place-items: center; align-content: center; text-align: center; line-height: 1.25; }
.board-assetname { font-size: 0.9rem; }
.board-term { font-size: 0.84rem; color: var(--text-muted); font-weight: 500; }
.boardbtn { min-height: 64px; }
.boardbtn .num { font-size: 1.05rem; }
/* WI-0126 P08-C2: the server's mesghal display figure first, the unit price second */
.price-secondary { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.price-secondary .num-secondary { font-family: var(--mono); }
.boardbtn .price-per { font-size: 0.78rem; }
.mesghal-basis { display: block; font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; }
.mesghal-basis .mesghal-grams { font-family: var(--mono); }
.board-basis { padding: 0.35rem 0.6rem; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ------------------------------------------------ the customer's panel */
.statgrid { display: grid; gap: 0.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0.9rem; }
.stat-tile { display: grid; gap: 0.2rem; padding: 0.8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.stat-tile-name { font-size: 0.84rem; color: var(--text-muted); }
.stat-tile-value { font-size: 1.25rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-tile-value small { font-size: 0.84rem; font-weight: 500; color: var(--text-muted); }
.block-head.spread { flex-direction: row; justify-content: space-between; align-items: center; }
.filterbar { margin-bottom: 0.8rem; flex-wrap: wrap; }
.filterbar button { border: 0; border-radius: 0; flex: 1 1 auto; }
.filterbar button[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }

/* ------------------------------------------------ the operator's board */
.board-control { display: flex; gap: 0.4rem; align-items: center; }
.opboard { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.opboard-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(7rem, 1fr) minmax(5rem, 0.6fr) minmax(0, 1.5fr); gap: 0.6rem; align-items: center; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.opboard-row:last-child { border-bottom: 0; }
.opboard-head { background: var(--surface-2); font-size: 0.76rem; color: var(--text-muted); text-align: center; padding-block: 0.4rem; }
.opboard-gap { text-align: center; font-weight: 700; color: var(--text); font-family: inherit; }
/* OVERNIGHT-C2: three tracks for −/input/+; the Save (4th child) wraps to its OWN full-width row when visible
   (dirty), so it never steals width from the price input. */
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 0.25rem; align-items: center; }
.stepper input { width: 100%; text-align: center; font-weight: 700; font-size: 1.05rem; border-width: 2px; }
.stepper.buy input { border-color: var(--buy); }
.stepper.sell input { border-color: var(--sell); }
.stepper .stepbtn { min-width: 44px; font-size: 1.3rem; padding: 0; border-radius: 999px; }
/* OVERNIGHT-DB1-C1 section C: a hidden Save must not RESERVE its grid column and clip the price. `visibility:
   hidden` still occupies the `auto` track, squeezing the buy input; `display:none` collapses it so the price
   input takes the freed width, and the control reappears only while editing. */
.stepper .stepsave { display: none; }
/* OVERNIGHT-C2: the JS toggles `dirty` on the .pricecell (the edit cell), not the .stepper — so the Save is
   keyed off the pricecell, and it appears on its own full-width row below −/input/+ (never squeezing the input). */
.pricecell.dirty .stepper .stepsave { display: inline-flex; grid-column: 1 / -1; }
/* The derived SELL side is a SOLE read-only output, not a stepper: it must use the whole cell width (it was
   landing in the 44px first track of the 4-column stepper grid and clipping to a few digits). */
.pricecell.sell .stepper, .pricecell.derived .stepper { grid-template-columns: minmax(0, 1fr); }
/* OVERNIGHT-DB1-C1 section C: wherever the row is tight (a phone, OR a desktop at 125–150% zoom, i.e. an
   effective width up to ~912px) the buy price takes its OWN full-width line ABOVE the −/+ steppers, so a long
   magnitude is never squeezed between the two round buttons. Above this, the inline −/input/+ layout stays. */
@media (max-width: 57rem) {
  .pricecell.buy .stepper { grid-template-columns: 1fr 1fr; }
  .pricecell.buy .stepper input { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 47.99rem) {
  .opboard-head { display: none; }
  .opboard-row { grid-template-columns: 1fr 1fr; grid-template-areas: "title gap" "buy buy" "sell sell"; }
  .opboard-row .board-title { grid-area: title; justify-items: start; text-align: start; }
  .opboard-row .opboard-gap { grid-area: gap; text-align: end; }
  .opboard-row .stepper.buy { grid-area: buy; }
  .opboard-row .stepper.sell { grid-area: sell; }
}

/* ---------------------------- the operator's board looks like the board */
/* UR-20261106 (WP-3, spec §5.D.4, DC-27): neutral cells -- the surface, the text colour and a line border, with a 4px
   side marker at the inline start (buy-deep / sell-deep); a closed side keeps full opacity on the quieter surface */
.pricecell {
  display: grid; gap: 0.3rem; padding: 0.4rem 0.45rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-inline-start-width: 4px;
}
.pricecell.buy { border-inline-start-color: var(--buy-deep); }
.pricecell.sell { border-inline-start-color: var(--sell-deep); }
.pricecell.closed { opacity: 1; background: var(--surface-2); }
.pricecell .stepper input { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.pricecell .stepper input[readonly] { color: var(--text); border-style: dashed; }
.pricecell .stepbtn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.sidegate { min-height: 40px; font-size: 0.82rem; padding: 0.15rem 0.6rem; justify-self: center; }
.opboard-gap input { width: 100%; text-align: center; font-weight: 700; color: var(--text); border: 1px solid var(--line-strong); background: var(--surface); min-height: 40px; }
.togglebtn[aria-pressed="true"] { background: var(--gold); color: var(--green-950); border-color: var(--gold); }
.board-table.preview { pointer-events: none; opacity: 0.95; }

/* ------------------------------------------------ configuration tabs */
.cfg-section { display: grid; gap: 0.8rem; }
.cfg-section .block { margin: 0; }
.fold { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 0.4rem 0.8rem; }
.fold > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.fold .block { border: 0; box-shadow: none; padding: 0.4rem 0 0.6rem; background: transparent; }

/* ------------------------------------------- a quieter page (live look)
 * Fewer words, the same colours. Refusals and outcomes are untouched. */
body[data-look="live"] .page-context,
body[data-look="live"] .block-head .fact-note,
body[data-look="live"] .block-head .hint,
body[data-look="live"] .freshness:not(.stale),
body[data-look="live"] .axis-note,
body[data-look="live"] #reason-limitation,
body[data-look="live"] #action-target,
body[data-look="live"] .ticket-form .fieldrow .fact-note,
body[data-look="live"][data-shell="customer"] [data-byid],
body[data-look="live"][data-shell="customer"] #btn-load-detail { display: none !important; }
body[data-look="live"] .page-head h2 { font-size: 1.35rem; }
body[data-look="live"] .block { padding: 1rem; }
@media (min-width: 48rem) { body[data-look="live"] main > .view > .block { margin-bottom: var(--sp-5); } }

/* ------------------------------------------------ the price board rows */
#trade-assets { display: grid; gap: 0.45rem; }
.boardrow { display: grid !important; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem;
  align-items: center; width: 100%; text-align: start; border-radius: var(--radius); padding: 0.6rem 0.8rem; height: auto; }
.boardrow-name { font-weight: 700; }
.boardrow-price { display: grid; justify-items: end; line-height: 1.25; }
.boardrow-price small { font-size: 0.72rem; opacity: 0.8; font-weight: 500; }
.boardrow-price .num { font-family: var(--mono); font-size: 0.98rem; font-weight: 700; }
.boardrow-price.buy .num { color: #7fd8a7; }
.boardrow-price.sell .num { color: #f2a396; }
.asset-tab.boardrow[aria-selected="true"] .num { color: inherit; }

/* the eye sits INSIDE the password field */
.secret-wrap { position: relative; display: block; }
.secret-wrap input { width: 100%; padding-right: 3rem; padding-left: 0.7rem; text-align: left; }
.secret-eye { position: absolute; right: 0.2rem; left: auto; top: 50%; transform: translateY(-50%); min-height: 44px; min-width: 44px; padding: 0.3rem 0.5rem; border: 0; background: transparent; }

/* ---------------------------------------------------- request cards */
body[data-look="live"] .reqhead { display: none; }
.reqcard:not(tr) { display: grid !important; gap: 0.45rem; width: 100%; text-align: start; padding: 0.8rem 0.9rem; height: auto;
  grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: none !important; justify-items: stretch; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.reqcard:not(tr) > span { grid-area: auto !important; min-width: 0; }
.reqcard-top { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.reqcard-asset { font-size: 1rem; margin-inline-end: auto; }
.reqcard-sum { font-size: 0.92rem; color: var(--text); display: block; }
.reqcard-net { font-weight: 700; }
.reqcard-foot { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); }
.reqcard-who { font-weight: 600; color: var(--text); }
.list-section { font-size: 0.9rem; margin: 0.9rem 0 0.4rem; color: var(--text-muted); }
.reqlist .reqrow + .reqrow { margin-top: 0.5rem; }

/* ------------------------------------------------ the ticket sheet */
.trade-sheet { padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0)); }
.ticket-price { display: grid; gap: 0.2rem; padding: 0.7rem 0.8rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.ticket-price .quote-number { font-size: 1.7rem; font-weight: 700; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; text-align: end; }
.ticket-price .quote-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); }
.kvlist { display: grid; gap: 0.3rem; font-size: 0.86rem; }
.kv { display: flex; justify-content: space-between; gap: 0.8rem; border-bottom: 1px dashed var(--line); padding: 0.25rem 0; }
.kv-name { color: var(--text-muted); flex: 0 0 auto; }
.kv-value { text-align: end; }
.kv-strong { font-weight: 700; font-size: 1rem; border-bottom: 0; }
.kv-strong .kv-name { color: var(--text); }
.secret-wrap { display: flex; gap: 0.3rem; align-items: stretch; }
.secret-wrap input { flex: 1 1 auto; min-width: 0; }
.secret-eye svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secret-eye[aria-pressed="true"] .eye-slash { display: none; }

/* ----------------------------------------------- entered trading (ADR-0008) */
.trade-grid { display: grid; gap: 0.9rem; grid-template-columns: 1fr; margin-bottom: 0.9rem; }
.trade-grid .block { margin: 0; }
.quotepair { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: 0.6rem; }
.quotebox { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem; display: grid; gap: 0.4rem; background: var(--surface-2); min-width: 0; }
.quotebox .quote-side { font-size: 0.84rem; color: var(--text-muted); }
.quotebox .quote-number { font-size: 1.6rem; font-weight: 700; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
body[data-shell="customer"] .quotebox .quote-number { color: var(--gold-soft); }
.quotebox .quote-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; font-size: 0.78rem; color: var(--text-muted); }
.quotebox.unavailable .quote-number { font-size: 1rem; font-family: inherit; color: var(--text-muted); }
.ticket-form { display: grid; gap: 0.7rem; }
.ticket-form .fieldrow { display: grid; gap: 0.3rem; }
.ticket-form .fieldrow label, .cfg-field label { font-size: 0.84rem; color: var(--text-muted); }
.ticket-form input[type="text"] { width: 100%; font-size: 1.25rem; }
.remaining { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.chip.remaining-chip { background: var(--warn-bg); border-color: var(--warn-line); }
.cfg-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; }
.cfg-field { display: grid; gap: 0.25rem; min-width: 0; }
.cfg-field input[type="text"], .cfg-field select { width: 100%; }
.cfg-flags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
button.flag { font-size: 0.82rem; font-weight: 500; }
button.flag[aria-pressed="true"] { background: rgba(47, 122, 85, 0.16); border-color: var(--ok); }
button.flag[aria-pressed="false"] { background: var(--danger-soft); border-color: var(--danger); }
.cfg-term { border-top: 1px dashed var(--line); margin-top: 0.7rem; padding-top: 0.7rem; }
.cfg-term h4 { margin-bottom: 0.3rem; }
.cfg-scope { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem; margin-top: 0.5rem; background: var(--surface-2); }
.cfg-scope-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.4rem; }
.cfg-version { font-size: 0.76rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- controls */
button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.55rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  line-height: 1.2;
}
button.small { min-height: 44px; padding: 0.35rem 0.8rem; font-size: 0.86rem; font-weight: 500; }
button.block { width: 100%; }
button.primary { background: var(--green-800); border-color: var(--green-800); color: #fff; }
body[data-shell="customer"] button.primary { background: var(--gold); border-color: var(--gold); color: var(--green-950); }
button.secondary { background: var(--surface); border-color: var(--line-strong); }
button.ghost { background: transparent; border-color: transparent; color: inherit; }
button.ghost:hover { text-decoration: underline; }
button.danger { background: var(--sell-deep); border-color: var(--sell-deep); color: #fff; }
button.danger-outline { background: transparent; border-color: var(--sell-deep); color: var(--sell-deep); }
body[data-shell="customer"] button.danger-outline { border-color: var(--bad-ink); color: var(--bad-ink); }
button.buy  { background: var(--buy-deep);  border-color: var(--buy-deep);  color: #fff; }
button.sell { background: var(--sell-deep); border-color: var(--sell-deep); color: #fff; }
button.icon { min-width: 44px; min-height: 44px; width: 44px; padding: 0; border-radius: var(--radius-sm); flex: 0 0 auto; }
button.icon svg { width: 1.3rem; height: 1.3rem; }
button[disabled] { opacity: 0.55; cursor: not-allowed; }

select, input[type="text"] {
  font: inherit;
  padding: 0.5rem 0.7rem;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  min-width: 0;
  max-width: 100%;
}
.row select { flex: 1 1 12rem; }
select[dir="ltr"], input[dir="ltr"] { font-family: inherit; font-size: max(16px, 1rem); font-variant-numeric: tabular-nums; }

.segmented { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg { flex: 1 1 0; border: 0; border-radius: 0; background: var(--surface-2); color: var(--text); font-weight: 600; }
.seg + .seg { border-inline-start: 1px solid var(--line-strong); }
.seg.buy[aria-pressed="true"]  { background: var(--buy-deep);  color: #fff; }
.seg.sell[aria-pressed="true"] { background: var(--sell-deep); color: #fff; }

/* ---------------------------------------------------------------- entry */
.view-entry { display: flex; justify-content: center; }
.entry { width: 100%; max-width: 44rem; }
.entry-hero { text-align: center; margin: 0.75rem 0 1.25rem; }
.entry-hero svg { width: 3rem; height: 3rem; color: var(--gold); margin-bottom: 0.25rem; }
.entry-hero h2 { font-size: 1.5rem; margin-bottom: 0.35rem; }
.entry-hero .lead { color: var(--text-muted); max-width: 32rem; margin: 0 auto; }
.persona-cards { display: grid; gap: 1rem; }
.persona-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.persona-card label { font-size: 0.84rem; color: var(--text-muted); margin-top: 0.3rem; }
.persona-card button { margin-top: auto; }
.persona-icon svg { width: 2rem; height: 2rem; color: var(--gold-ink); }
.entry-note { margin-top: 1.2rem; text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* ---------------------------------------------------------------- board */
.board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.asset-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.asset-tab {
  min-height: 44px;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  direction: ltr;
  font-weight: 500;
}
.asset-tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--green-950); font-weight: 700; }

.quote-card { display: grid; gap: 0.35rem; }
.quote-card .quote-label { color: var(--text-muted); font-size: 0.84rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.quote-card .quote-value {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate; display: inline-block;
}
body[data-shell="customer"] .quote-card .quote-value { color: var(--gold-soft); }
.quote-card .quote-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); }
.quote-card .quote-unavailable { font-size: 1.15rem; font-weight: 600; color: var(--text-muted); }

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border-radius: var(--radius-pill); padding: 0.1rem 0.55rem;
  font-size: 0.8rem; font-weight: 600; line-height: 1.5;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  /* review 2026-11-06: a chip that still carries a sentence wraps inside its box (never past the card or the window);
     a chip short by contract stays on one line (the rule below) */
  max-width: 100%; white-space: normal; text-align: start;
}
.data-table .chip:not(.transfer-chip), .pending-line .chip, .page-head .chip,
.chip.buy, .chip.sell, .chip.remaining-chip { white-space: nowrap; }
.chip.buy  { background: rgba(47, 158, 99, 0.16); border-color: var(--buy);  color: var(--buy-deep); }
.chip.sell { background: rgba(212, 82, 63, 0.16); border-color: var(--sell); color: var(--sell-deep); }
body[data-shell="customer"] .chip.buy  { color: #8fe0b3; }
body[data-shell="customer"] .chip.sell { color: #f2a396; }
.chip.state { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.chip.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
.chip.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--bad-ink); }
.chip.attention { background: var(--gold); border-color: var(--gold); color: var(--green-950); }
.chip.neutral { background: var(--surface-2); border-color: var(--line); color: var(--text-muted); }
.chip.muted { opacity: 0.85; }

.trade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 1rem; }
.trade-actions button { min-height: 52px; font-size: 1.05rem; font-weight: 700; }

/* stats */
.stat-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.stat-grid + .stat-grid { margin-top: 0.6rem; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.stat-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.stat-note { font-size: 0.74rem; color: var(--text-muted); }
.stat.withheld, .stat.unavailable { border-style: dashed; }
.stat.withheld .stat-value, .stat.unavailable .stat-value { font-size: 0.95rem; color: var(--text-muted); }
.stat.untrusted { border-color: var(--warn-line); background: var(--warn-bg); }

/* request rows */
.reqlist { display: grid; gap: 0.5rem; }
.reqrow { margin: 0; }
.reqrow-open {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "dir main state" "id id state";
  gap: 0.2rem 0.7rem;
  align-items: center;
  text-align: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  font-weight: 500;
}
.reqrow-open:hover { border-color: var(--gold); }
.reqrow-open .r-dir { grid-area: dir; }
.reqrow-open .r-main { grid-area: main; min-width: 0; overflow-wrap: anywhere; }
.reqrow-open .r-state { grid-area: state; justify-self: end; }
.reqrow-open .r-id { grid-area: id; }
.reqlist .empty { padding: 0.9rem; }
/* B2B-OPERATOR-CUSTOMERS-01: the operator's customer directory and profile */
.page-actions { display: flex; gap: 0.5rem; align-items: center; }
.dir-controls { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin: 0.4rem 0 0.8rem; }
.dir-controls .cfg-field input[type="search"] {
  font: inherit; padding: 0.5rem 0.7rem; min-height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: inherit; width: 100%;
}
.dir-counts { font-size: 0.84rem; color: var(--text-muted); margin: 0 0 0.5rem; }
/* owner 2026-11-05: the directory is a real table (.data-table); these only style its cells. UR-20261106 (WP-4, spec
   §3.1.1): a word is never broken -- the table system wraps text at spaces only */
.dir-row > * { min-width: 0; }
.dir-row .dir-name { font-weight: 700; }
.dir-row .dir-company { color: var(--text-muted); font-size: 0.86rem; }
.dir-group { font-size: 0.9rem; margin: 0.9rem 0 0.3rem; color: var(--text-muted); }
.dir-pager { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.7rem; }
.dir-pager .freshness { margin-inline-start: auto; }
/* UR-20261106 (WP-4, spec §1.7): the profile's facts are one two-column list, never a box per fact */
.profile-facts { margin: 0.4rem 0 0.8rem; }
.profile-fact { min-width: 0; }
.profile-fact .kv-name { color: var(--text-muted); }
.profile-fact.unavailable .kv-value { color: var(--text-muted); }
/* B2B-CUSTOMER-API-UI-01: stale / not-read notes and the history retry sit with the list, not over it */
.fact-note.stale { color: var(--text); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; }
#customers-history-failed { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dir-requests .fact-note { display: inline; }
/* B2B-OPERATOR-INLINE-DECISIONS-01: decide on the card, in the list */
.reqrow-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.35rem 0 0.2rem; }
.reqrow-actions:empty { display: none; }
.reqrow-actions .freshness { flex-basis: 100%; }
.inline-confirm { flex-basis: 100%; border: 1px solid var(--line); border-inline-start: 5px solid var(--gold); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem; background: var(--surface-2); display: grid; gap: 0.35rem; }
.inline-confirm h4 { font-size: 0.98rem; margin: 0; }
.inline-confirm .actions, .inline-outcome .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.3rem; }
.inline-outcome { flex-basis: 100%; margin-top: 0; }
.inline-outcome:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.reqhead { display: none; }
.reqlist.table .reqrow-open { background: var(--surface); }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------------------------------------------------------------- ticket
   A bottom sheet on a phone; a centred card over a scrim on wider screens. */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 46;
  background: rgba(8, 20, 16, 0.55);
}
.sheet {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 47;
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--line-strong);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
  padding: 0.6rem 1rem 1.2rem;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.sheet-head h2 { font-size: 1.1rem; }
.ticket { display: grid; gap: 0.8rem; }
.ticket-row { display: grid; gap: 0.3rem; }
.ticket-row label, .ticket-label { font-size: 0.84rem; color: var(--text-muted); font-weight: 600; }
.ticket-row select { width: 100%; }
.ticket-quote {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.6rem 0.8rem;
  display: grid; gap: 0.15rem;
  font-size: 0.86rem; color: var(--text-muted);
}
.ticket-quote .quote-value { font-size: 1.4rem; font-weight: 700; color: var(--text); direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ticket-actions { display: grid; gap: 0.5rem; }
.ticket .outcome { margin-top: 0; }

/* ---------------------------------------------------------------- detail */
.byid { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.byid input { flex: 1 1 14rem; max-width: 26rem; }
.detail-summary {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center;
  margin-bottom: 0.9rem;
}
.detail-summary .asset { font-weight: 700; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.detail-grid { display: grid; gap: 1rem; }
.detail-grid .block { margin: 0; }

.price-hero { display: grid; gap: 0.7rem; }
.pricebox { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; background: var(--surface-2); }
.pricebox.locked { border-inline-start: 5px solid var(--gold); }
.pricebox.live { border-inline-start: 5px solid var(--line-strong); }
.pricebox > div { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.price-magnitude {
  font-size: 1.8rem; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate; display: inline-block;
}
.pricebox.live .price-magnitude { font-size: 1.2rem; color: var(--text-muted); }
body[data-shell="customer"] .pricebox.locked .price-magnitude { color: var(--gold-soft); }

.axes { display: grid; gap: 0.6rem; }
.axis {
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
}
#axis-sync { border-inline-start-color: #8d76bf; }
#axis-settlement { border-inline-start-color: var(--ok); }
.axis-state { font-size: 1.05rem; font-weight: 700; display: block; }
#axis-approval .axis-state { font-size: 1.25rem; }
.axis-note { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.2rem; }
.notconfirmed {
  display: inline-block;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.74rem;
}

.facts { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.fact {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  background: var(--surface-2);
  display: grid; gap: 0.1rem; min-width: 0;
}
.fact-name { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.fact-value { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.fact-value.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; font-family: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.fact-note { color: var(--text-muted); font-size: 0.84rem; }
/* B2B-APP-INTEGRATION-READY-01: the accounting pilot's own notice and guidance.
   Deliberately NOT .nonbinding / [data-testword], which the live look hides:
   this wording must stay visible in every look. */
.pilot-notice {
  margin: 0 0 0.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--warn-line);
  border-inline-start: 5px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.7;
}
.pilot-guidance { margin: 0.3rem 0 0; font-size: 0.84rem; font-weight: 600; }
.kv.pilot-state .kv-value { font-weight: 700; }
.fact.withheld, .fact.unavailable { border-style: dashed; }
.fact.withheld .fact-value, .fact.unavailable .fact-value { color: var(--text-muted); font-size: 0.9rem; }
.fact.untrusted { border-color: var(--warn-line); background: var(--warn-bg); }

.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0.4rem 0 0.5rem; }
.decision-actions button { min-height: 52px; font-size: 1.02rem; font-weight: 700; }

.messages { margin-top: 0.6rem; display: grid; gap: 0.4rem; }
.message {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem; background: var(--surface-2);
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; font-size: 0.86rem;
}
.subpanel { margin-top: 0.8rem; border-top: 1px dashed var(--line-strong); padding-top: 0.5rem; }
.subpanel summary { cursor: pointer; font-size: 0.86rem; color: var(--text-muted); min-height: 44px; display: flex; align-items: center; }

/* ------------------------------------------------------------- freshness */
.freshness { font-size: 0.84rem; color: var(--text-muted); }
.freshness.stale { color: #e3a26a; font-weight: 700; }
body[data-shell="staff"] .freshness.stale, body[data-shell="entry"] .freshness.stale { color: var(--danger); }

.outcome:empty { display: none; }
.outcome {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  background: var(--surface-2);
  display: grid; gap: 0.25rem;
}
.outcome.bad { border-inline-start-color: var(--sell); }
.outcome.good { border-inline-start-color: var(--buy); }
/* WI-0127 R1 (RT-P9-05): an answer that is neither done nor refused -- UNKNOWN, CONFLICT */
.outcome.warn { border-inline-start-color: var(--warn-line); background: var(--warn-bg); }
.outcome h4 { font-size: 0.98rem; color: var(--text); }
.outcome ul { margin: 0; padding-inline-start: 1.2rem; font-size: 0.86rem; }
.outcome button { justify-self: start; }

/* ---------------------------------------------------------------- tools */
.tools-grid { display: grid; gap: 1rem; }
.debug { margin: 0.5rem 0 1rem; color: var(--text-muted); font-size: 0.85rem; }
.debug summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.debug-log {
  max-height: 22rem;
  overflow: auto;
  background: #10151a;
  color: #cfe3ef;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  direction: ltr;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* UR-20261106 (WP-0, spec §1.10): bottom centre on a desk, under the top bar on a phone (rule in the WP-0 section) */
.toast {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 78;
  background: var(--charcoal);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  max-width: min(32rem, calc(100vw - 2rem));
  box-shadow: var(--shadow-pop);
  text-align: center;
}

/* ================================================================ tablet */
@media (min-width: 48rem) {
  .persona-cards { grid-template-columns: 1fr 1fr; }
  .axes { grid-template-columns: repeat(3, 1fr); }
  .price-hero { grid-template-columns: 3fr 2fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .reqrow-open {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "dir main id state";
    min-height: 52px;
  }
  .reqrow-open .r-id { justify-self: start; }
  .reqhead {
    display: grid; grid-template-columns: auto 1fr auto auto; gap: 0.2rem 0.7rem;
    padding: 0 0.8rem 0.2rem; font-size: 0.76rem; color: var(--text-muted); font-weight: 600;
  }
  .reqhead span:last-child { justify-self: end; }
  main { padding: 1.25rem 1.5rem 2rem; }

  /* the navigation becomes a horizontal bar under the top bar */
  .mainnav {
    position: static;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.25rem;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.35rem 1.25rem;
  }
  .navbtn { flex: 0 0 auto; flex-direction: row; gap: 0.45rem; min-height: 44px; padding: 0.35rem 0.9rem; font-size: 0.88rem; }
  .navbtn svg { width: 1.15rem; height: 1.15rem; }
  .navbtn[disabled] { display: inline-flex; opacity: 0.5; cursor: not-allowed; }
  .navbtn[disabled] small { display: inline; font-size: 0.8rem; opacity: 0.85; }

  /* the ticket becomes a centred card over the board */
  .sheet {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(34rem, calc(100vw - 2rem));
    max-height: 88vh;
    border-radius: var(--radius);
    padding: 0.9rem 1.3rem 1.3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  }
  .ticket-actions { grid-template-columns: 2fr 1fr; }
}

/* ================================================================ desktop */
@media (min-width: 64rem) {
  .trade-sheet { inset-inline: auto; left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(34rem, 92vw); border-radius: var(--radius); }
  .detail-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .detail-grid .price-hero, .detail-grid .axes-block { grid-column: 1 / -1; }
  .board { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tabs tabs" "quote actions"; align-items: end; column-gap: 2rem; }
  .board .asset-tabs { grid-area: tabs; }
  .board .quote-card { grid-area: quote; }
  .board .trade-actions { grid-area: actions; margin-top: 0; min-width: 20rem; }
  .quote-card .quote-value { font-size: 3rem; }

  /* STAFF: the navigation is a persistent sidebar at the inline start (the
     right-hand side in this RTL document), beside the top bar AND the main
     area. The frame becomes a two-column grid; the DOM order is unchanged. */
  body[data-shell="staff"] .frame {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    grid-template-areas: "nav top" "nav main";
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  body[data-shell="staff"] .topbar { grid-area: top; }
  body[data-shell="staff"] main { grid-area: main; max-width: 68rem; }
  body[data-shell="staff"] .mainnav {
    grid-area: nav;
    position: sticky;
    top: 2.2rem;
    height: calc(100vh - 2.2rem);
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.2rem;
    padding: 1rem 0.8rem;
    border: 0;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--nav-bg);
    color: var(--nav-fg);
  }
  body[data-shell="staff"] .mainnav .brand {
    display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i n" "i s";
    column-gap: 0.6rem; align-items: center;
    padding: 0.3rem 0.4rem 1rem; margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gold-soft);
  }
  body[data-shell="staff"] .mainnav .brand svg { grid-area: i; width: 2rem; height: 2rem; color: var(--gold); }
  body[data-shell="staff"] .mainnav .brand span { grid-area: n; font-weight: 700; }
  body[data-shell="staff"] .mainnav .brand small { grid-area: s; font-size: 0.72rem; opacity: 0.75; }
  body[data-shell="staff"] .navbtn {
    width: 100%; justify-content: flex-start; padding: 0.55rem 0.75rem; font-size: 0.92rem;
  }
  body[data-shell="staff"] .navbtn[disabled] { flex-direction: column; align-items: flex-start; gap: 0; }
  body[data-shell="staff"] .navbtn[disabled] small { padding-inline-start: 1.7rem; }
}

/* ------------------------------------------------- WI-0126 (Scenario 2 P08)
   The customer's waiting overlay, the paired price control, the accounting
   section. Below the watermark band (z-index 60) so the band stays visible;
   above the page and its sheets. The ring's fullness is a CSS variable the page
   sets from two server instants; nothing here is a value. */
.wait-overlay {
  position: fixed; inset: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  /* B2B-PRIVATE-C3-20261026 (S01): the customer's STANDBY covers the WHOLE panel -- opaque, not a dimmed page the
     person could read or reach; the page behind it is inert while it stands */
  background: var(--bg);
  overflow-y: auto;
}
.wait-card {
  width: min(26rem, 100%);
  max-height: 92vh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.7rem; align-items: stretch;
}
.wait-card h3 { font-size: 1.05rem; text-align: center; }
.wait-card h3:focus { outline: none; }
.wait-card h3:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wait-ring {
  --wait-share: 0;
  align-self: center;
  width: 9.5rem; height: 9.5rem; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--wait-share) * 1%), var(--line) 0);
  display: flex; align-items: center; justify-content: center;
}
.wait-ring-text {
  width: 7.4rem; height: 7.4rem; border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700; text-align: center;
}
.wait-overlay[data-phase="checking"] .wait-ring-text,
.wait-overlay[data-phase="unavailable"] .wait-ring-text,
.wait-overlay[data-phase="reconciling"] .wait-ring-text,
.wait-overlay[data-phase="submitting"] .wait-ring-text,
.wait-overlay[data-phase="submit-unknown"] .wait-ring-text { font-size: 0.95rem; }
/* C3 (S01): the countdown in SECONDS -- the number, then its unit */
.wait-ring-text { flex-direction: column; gap: 0.1rem; }
.wait-ring-unit { font-size: 0.84rem; font-weight: 400; color: var(--text-muted); }
.wait-account { text-align: center; }
@media (max-width: 30rem) {
  .wait-overlay { align-items: flex-start; padding: 0.75rem; }
  .wait-card { width: 100%; max-height: none; }
}
.wait-status p { margin: 0; }
.wait-final { font-size: 1rem; font-weight: 600; text-align: center; }
.wait-final.good { color: var(--ok-ink); }
.wait-final.bad { color: var(--bad-ink); }
.wait-final.neutral { color: var(--text-muted); }
.wait-card .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.wait-card button { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .wait-ring, .wait-ring-text { transition: none; animation: none; } }

.pricecell.derived input[readonly] { background: transparent; border-style: dashed; cursor: default; }
.board-paired-note { max-width: 32rem; }

.acct-section { display: flex; flex-direction: column; gap: 0.9rem; }
.acct-block .acct-body { display: flex; flex-direction: column; gap: 0.6rem; }
.acct-block > button { align-self: flex-start; margin-block: 0.4rem; min-height: 44px; }
.acct-section button, .acct-profile button { min-height: 44px; }
.acct-case-detail .cfg-grid { margin-top: 0.5rem; }
.acct-queue { display: flex; flex-direction: column; gap: 0.5rem; }
.dir-accounting { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.acct-profile { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }

@media print { .wait-overlay { display: none !important; } }

/* ---------------------------------------------------------------- print
   A22: the watermark survives every print and export path. The band prints at
   the top of every page and the wash prints behind the content. */
@media print {
  body { background: #fff; color: #000; }
  .mainnav, .toast, .debug, button, .sheet-scrim { display: none !important; }
  .watermark-band {
    position: fixed;
    top: 0;
    inset-inline: 0;
    display: flex !important;
    background: #fff;
    color: var(--danger);
    border-bottom: 2px solid var(--danger);
  }
  .watermark-wash {
    display: block !important;
    position: fixed;
    inset: 0;
  }
  .watermark-wash::after { color: rgba(140, 47, 40, 0.16); }
  .block, .board { break-inside: avoid; box-shadow: none; }
}

/* ------------------------------------------------- D2a (B2B-CLAUDE-RETURN-20261024, WI-0126)
   Staff navigation, the Accounting destination and truthful qualifiers in the existing app.
   Presentation only: nothing below hides an authorized action or a confirmation qualifier. */
.nav-short { display: none; }
.build-chip {
  display: inline-block; margin-top: 0.15rem; padding: 0 0.5rem; border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
}
.build-chip .build-label { font-family: var(--mono); }
/* D-1 (D1-DEC-1): the sync state, its simulation marker and the not-confirmed badge on one line */
.axis-line { display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; align-items: center; }
.axis-line .axis-state { display: inline; }
.axis-sim { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.axis-badge { font-weight: 600; }
/* the qualifier is financial meaning, not test wording: the quieter live look keeps it (ADR-0010) */
body[data-look="live"] .axis-note.axis-qualifier { display: block !important; }
.queue-byid { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; width: 100%; }
.queue-byid input { min-height: 44px; max-width: 18rem; flex: 1 1 10rem; }
/* the Accounting destination */
.acct-strip {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; align-items: center; margin: 0 0 0.6rem;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 0.84rem;
}
.acct-strip-name { font-weight: 700; }
.acct-strip-window { color: var(--text-muted); }
.acct-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
.acct-section .kv { flex-wrap: wrap; }
.acct-section .kv-value { min-width: 0; overflow-wrap: break-word; }
.acct-section .cfg-field input[type="file"] { width: 100%; max-width: 100%; min-width: 0; }
.acct-tabs button { white-space: nowrap; }
.acct-count { font-size: 0.72rem; padding: 0 0.35rem; border-radius: 999px; border: 1px solid currentColor; }
.acct-panel { display: grid; gap: 0.8rem; }
.acct-panel[hidden] { display: none; }
.acct-disagreement { margin: 0.2rem 0 0.4rem; font-weight: 600; }
.acct-unavailable { margin: 0; padding-inline-start: 1.1rem; }
.acct-actionable-notes { display: grid; gap: 0.15rem; margin: 0.3rem 0; justify-items: start; }
#cfg-panel[hidden] { display: none; }
@media (max-width: 47.99rem) {
  body[data-look="live"][data-shell="staff"] .navbtn .nav-long { display: none; }
  body[data-look="live"][data-shell="staff"] .navbtn .nav-short { display: inline; }
  /* PD-01 / §8: at phone width پیکربندی is reached from «بیشتر», so the bar keeps five entries */
  body[data-look="live"][data-shell="staff"] #mainnav .navbtn[data-view="config"] { display: none; }
  .topbar-titles .build-chip { margin-top: 0; }
}
/* PD-17 / §8: at phone width the top bar is one row -- the title with its chip, and the session */
@media (max-width: 30rem) {
  body[data-look="live"] .topbar { flex-wrap: nowrap; padding: 0.45rem 0.75rem; gap: 0.5rem; }
  body[data-look="live"] .topbar h1 { font-size: 0.92rem; white-space: nowrap; }
  body[data-look="live"] .topbar-titles { min-width: 0; }
  body[data-look="live"] .topbar-session { flex: 0 1 auto; min-width: 0; gap: 0.3rem; }
  body[data-look="live"] .topbar-session .who { flex-wrap: nowrap; white-space: nowrap; }
  body[data-look="live"] .topbar-session .who small { display: none; }
}
@media (min-width: 64rem) {
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn[data-view="tools"] { margin-top: auto; }
}

/* ------------------------------------------------- D2b (B2B-CLAUDE-RETURN-20261024, WI-0126)
   Customers, the customer side, read-failure states, deep links and focus. Presentation only:
   nothing below hides an authorized action, a refusal or a confirmation qualifier. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* a failed read, said where the content is; the last good content stays and is marked stale */
.read-issue { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; margin: 0 0 0.6rem; }
.read-issue[hidden] { display: none; }
.read-issue-title { font-weight: 700; }
.view[data-stale="yes"] .reqlist,
.view[data-stale="yes"] .statgrid,
.view[data-stale="yes"] .board-table,
.view[data-stale="yes"] .board-list,
.view[data-stale="yes"] #trade-portfolio-body { opacity: 0.62; }
.stat-tile.unread .stat-tile-value { color: var(--text-muted); }
/* the customers list: short chips, the long sentence is the profile's */
.dir-chips { display: flex; flex-wrap: wrap; gap: 0.25rem 0.35rem; align-items: center; }
.dir-chips .chip { white-space: nowrap; }
.add-menu { position: relative; display: inline-grid; gap: 0.35rem; }
/* UR-20261106 (WP-4, spec §5.E.3): the menu lies over the page (it never pushes the heading down) */
.add-menu-list {
  position: absolute; inset-block-start: calc(100% + 0.35rem); inset-inline-end: 0; z-index: 30;
  display: grid; gap: 0.15rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); min-width: 21rem; max-width: calc(100vw - 1.5rem); box-shadow: var(--shadow-pop);
}
.add-menu-list[hidden] { display: none; }
.add-menu-off { display: grid; gap: 0.15rem; }
.add-reason { font-size: 0.78rem; color: var(--text-muted); }
/* B2B-CUSTOMER-IDENTITY-R1-C1 §D: the local-customer create form + the masked identity section */
.dir-create[hidden] { display: none; }
.dir-create { margin: 0.6rem 0; }
.create-form {
  display: grid; gap: 0.6rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); max-width: 34rem;
}
.create-form .cfg-field { display: grid; gap: 0.25rem; }
.create-form label { font-size: 0.85rem; }
.create-form input[type="text"], .create-form select { width: 100%; box-sizing: border-box; }
.create-form .create-checkline { display: flex; gap: 0.4rem; align-items: center; }
.create-form .create-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.create-error:empty { display: none; }
.create-error { color: var(--error-ink); font-size: 0.86rem; }
.create-hint { font-size: 0.84rem; color: var(--text-muted); }
.profile-identity { margin-top: 0.8rem; }
.profile-identity .idchip { word-break: normal; overflow-wrap: break-word; }
.profile-balance-link { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.acct-balance-focus { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }
/* KF-1: the heading that receives focus on a view change shows where the keyboard is, quietly */
.view h2[tabindex="-1"]:focus { outline: none; }
.view h2[tabindex="-1"]:focus-visible { outline: 2px solid var(--gold, #c9a227); outline-offset: 3px; }

/* B2B-PRIVATE-INTEGRATION-20261025 P5 (main session, ADR-0020): technical folds, drafts, the role-mode queue
   summary and the send allowance. Presentation only; existing tokens only. */
.acct-tech { margin-top: 6px; }
.acct-tech > summary { cursor: pointer; font-size: 0.86rem; color: var(--text-muted); min-height: 44px;
  display: flex; align-items: center; }
.acct-queue[data-access="summary"] .kvlist { max-width: 28rem; }
.acct-allowance { margin: 8px 0; }
.draft-dirty { outline: 2px dashed var(--warn-line); outline-offset: 1px; }
.draft-server { display: block; margin-top: 4px; font-size: 0.86rem; color: var(--text-muted);
  background: var(--warn-bg); padding: 4px 8px; border-radius: 6px; }
/* B2B-PRIVATE-C3-20261026 (R06): a draft whose earlier write's outcome is unknown, until the server is read again */
.draft-unknown { display: block; margin-top: 4px; font-size: 0.86rem; color: var(--text-muted);
  background: var(--warn-bg); padding: 4px 8px; border-radius: 6px; border-inline-start: 3px solid var(--warn-line); }
.draft-leave { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.draft-leave button { min-height: 44px; }

/* B2B-PRIVATE-CORRECTION-20261025 (C08 completion): on a phone the fixed bottom navigation must never cover the
   control that has the keyboard -- focus and scrollIntoView keep this margin above it. */
@media (max-width: 47.99rem) {
  html { scroll-padding-bottom: 6.5rem; }
}
.acct-resolve { margin-top: 6px; }
.acct-resolve > summary { cursor: pointer; font-size: 0.9rem; min-height: 44px; display: flex; align-items: center; }

/* ------------------------------------------------------------------ */
/* Direct-owner fix (2026-10-29): operator price table readability.    */
/* Large gold magnitudes (Toman/Rial) were clipped by the board's      */
/* overflow:hidden and by white-space:nowrap in constrained grid cells */
/* ("numbers cut off / out of the box"). Let every price/number cell   */
/* shrink to its column and wrap instead of overflowing, and keep the  */
/* operator's inline edit inputs inside their cell. Additive, scoped.  */
.board-row > *, .board-row.operator > *, .board-editline > *,
.board-group > *, .board-asset > * { min-width: 0; }

.quote-value,
.boardbtn .num,
.price-magnitude,
.price-secondary .num-secondary,
.board-editline .num {
  min-width: 0;
  max-width: 100%;
  white-space: normal;          /* was nowrap: a long magnitude now wraps rather than clipping */
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.board-editline input,
.board-edit input {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* a very long board figure steps down slightly to stay on one line where it fits */
.boardbtn .num { font-size: clamp(0.82rem, 2.6vw, 1.05rem); }

/* B2B-OVERNIGHT-DB1-C4 (B1/B4): the grouped, searchable asset configuration. Local, additive; no existing rule
   is changed. Colours use the existing tokens. */
.cfg-group-head { font-weight: 600; opacity: 0.85; margin: 0 0 0.35rem; }
.cfg-asset-search { margin: 0.5rem 0 0.75rem; }
.cfg-asset-search input[type="search"] { width: 100%; box-sizing: border-box; }
.cfg-asset-row > summary { cursor: pointer; }
.cfg-asset-meta { opacity: 0.75; font-size: 0.86em; }
.cfg-asset-empty { margin: 0.5rem 0; }

/* ------------------------------------------------------------------ */
/* B2B-RESUME-UI-20261103 (owner, 3 Nov 2026). Additive and scoped.    */

/* (3) The pending-request countdown: the NUMERAL's own box sits on the ring's geometric centre; the unit is placed
   separately below it (the pair is no longer centred as a group, and the global `.ltr { align-self: start }` no
   longer moves the numeral). Only the ring changes; general LTR/price rules are untouched. */
.wait-ring-text { position: relative; }
.wait-ring-text > .remaining {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  align-self: auto; justify-self: auto; margin: 0; line-height: 1; white-space: nowrap;
  font-size: 1.7rem; font-variant-numeric: tabular-nums;
}
.wait-ring-text > .wait-ring-unit {
  position: absolute; left: 50%; top: calc(50% + 1.25rem); transform: translateX(-50%);
  white-space: nowrap; line-height: 1;
}

/* (2) Configuration: one compact row per asset; its overlay */
.cfg-asset-search input {
  width: 100%; min-height: 44px; padding: 0 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.cfg-asset-item[hidden] { display: none; }
.cfg-asset-row { text-align: center; }
.cfg-asset-name { font-weight: 700; }
.cfg-asset-open { color: var(--gold); font-size: 0.86rem; white-space: nowrap; }
.cfg-asset-sheet .sheet-head h3:focus { outline: none; }
.cfg-asset-sheet .sheet-head h3:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.cfg-asset-sheet-note { margin: 0 0 0.5rem; }
.cfg-asset-sheet .outcome:empty { display: none; }
@media (min-width: 48rem) { .cfg-asset-sheet { width: min(48rem, calc(100vw - 2rem)); } }

/* (2) The operator board: one header per asset with its customer-visibility control */
.opboard-asset {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem;
  padding: 0.45rem 0.7rem; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.opboard-asset-name strong { font-size: 0.95rem; }
.opboard-asset .visbtn { min-height: 40px; }
.opboard-asset.hidden-from-customer .opboard-asset-name strong { color: var(--text-muted); }
.opboard-row.hidden-from-customer .board-title strong { color: var(--text-muted); }

/* (4)(5) The operator's row: buy FROM the customer (editable base) | title | difference (−/+) | sell TO the customer.
   The difference column holds −, the value and + side by side, so it gets a real minimum width. */
.opboard-row { grid-template-columns: minmax(0, 1.35fr) minmax(7rem, 0.85fr) minmax(11.5rem, 1fr) minmax(0, 1.35fr); }
.pricecell .fact-note { color: var(--text-muted); font-size: 0.84rem; }
.opboard-gap input { font-size: 0.98rem; padding-inline: 0.2rem; }
.pricecell.base .stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.pricecell .stepper.single { grid-template-columns: minmax(0, 1fr); }
.pricecell.dirty .stepper .stepsave { display: inline-flex; grid-column: 1 / -1; }
.gapline { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 0.25rem; align-items: center; }
.gapline .gapbtn { min-width: 40px; min-height: 40px; padding: 0; border-radius: 999px; font-size: 1.2rem; }
.opboard-gap { display: grid; gap: 0.3rem; }
.opboard-gap .manualbtn { justify-self: center; }
.opboard-gap.dirty input, .pricecell.dirty input:not([readonly]) { outline: 2px dashed var(--gold); outline-offset: 1px; }
.opboard-draftnote { margin: 0; font-size: 0.86rem; color: var(--text); }
.opboard-draftnote strong { color: var(--warn-ink); }
.opboard-draftnote[hidden] { display: none; }
@media (max-width: 57rem) {
  .pricecell.base .stepper { grid-template-columns: 1fr 1fr; }
  .pricecell.base .stepper input { grid-column: 1 / -1; order: -1; }
}
/* B2B-RESUME-UI-C1-20261103 (6): on a phone the header row is hidden, so every operator card names its own side and
   the currency; on wider screens the header row alone names the columns (no duplicate label). */
.pricecell-side { display: none; }
@media (max-width: 47.99rem) {
  .pricecell .pricecell-side { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); line-height: 1.4; }
  .opboard-row { grid-template-columns: 1fr; grid-template-areas: "title" "bid" "gap" "ask" "note"; }
  .opboard-row > .board-title { grid-area: title; justify-items: start; text-align: start; }
  .opboard-row > .pricecell.sell { grid-area: bid; }
  .opboard-row > .opboard-gap { grid-area: gap; }
  .opboard-row > .pricecell.buy { grid-area: ask; }
  .opboard-row > .opboard-draftnote { grid-area: note; }
}

/* (4)(6) The customer's board: «بسته» on each button of a closed market (R12, owner 2026-11-12: no action word
   otherwise); on a phone the name takes its own line and the two prices sit side by side, whole -- the layout re-flows
   instead of shrinking the digits without limit. R12: the customer's buy («فروش به شما», ask) is the first column, on
   the right in RTL, as on a desk. */
.boardbtn .board-action { font-size: 0.82rem; font-weight: 700; letter-spacing: 0; }
/* R12: with no action word above the price, a button's figures sit in its middle -- a coin's one price is not pinned
   to the top of its button */
.boardbtn { align-content: center; }
@media (max-width: 30rem) {
  #trade-board .board-row:not(.board-headrow), .board-table .board-row:not(.board-headrow) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "title title" "ask bid";
  }
  #trade-board .board-row > .board-title, .board-table .board-row > .board-title { grid-area: title; }
  /* R41 (ADR-0062): the customer's «خرید» (CUSTOMER_BUY) first, on the right (`ask`); «فروش» on the left (`bid`) */
  #trade-board .board-row > .boardbtn[data-direction="CUSTOMER_BUY"],
  .board-table .board-row > .boardbtn[data-direction="CUSTOMER_BUY"] { grid-area: ask; }
  #trade-board .board-row > .boardbtn[data-direction="CUSTOMER_SELL"],
  .board-table .board-row > .boardbtn[data-direction="CUSTOMER_SELL"] { grid-area: bid; }
  #trade-board .board-headrow, .board-table .board-headrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #trade-board .board-headrow > .board-col:nth-child(2), .board-table .board-headrow > .board-col:nth-child(2) { display: none; }
  .boardbtn .num, .boardbtn .price-mesghal {
    font-size: clamp(1rem, 4.8vw, 1.2rem); white-space: nowrap; overflow-wrap: normal; word-break: keep-all;
  }
  .boardbtn .price-secondary .num-secondary { white-space: nowrap; }
  .boardbtn { padding-inline: 0.25rem; }
}

/* B2B-ACCOUNTING-OPERATOR-20261103 P3: the operator's «فروش به مشتری» card centres its OWN label, price and explanation
   -- manual and derived, phone and desktop; the bid card, the difference column and every other note keep their
   alignment, and no value, side or currency changes. */
.pricecell.buy > .pricecell-side, .pricecell.buy > .fact-note { text-align: center; justify-self: stretch; }
.pricecell.buy .stepper.single input { text-align: center; }

/* P2: incoming requests -- the bell (server-confirmed pending count), its list, and the one popup of a new arrival.
   Presentation only: hiding them decides nothing; the queue stays the decision surface.
   UR-20261106 (WP-0, spec §1.10): the bell sits in the top bar at every width (icon + count); its list is a sheet under
   the top bar with a header row and an X; the arrival pop-up stands in the ONE notification stack (`.notify-stack`). */
.pending-bell { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; min-width: 44px;
  padding: 0.3rem 0.5rem; }
.pending-bell .pending-bell-label { display: none; }
.pending-bell .pending-count { min-width: 1.5rem; padding: 0 0.4rem; border-radius: var(--radius-pill); text-align: center;
  font-size: 0.78rem; font-weight: 700; line-height: 1.5rem; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pending-bell.has-pending .pending-count { background: var(--sell-deep); color: #fff; border-color: var(--sell-deep); }
.pending-bell.stale .pending-count { outline: 2px dashed var(--warn-line); outline-offset: 1px; }
.pending-inbox { position: fixed; inset-block-start: 4rem; inset-inline-end: 1rem; z-index: 72;
  width: min(30rem, calc(100vw - 2rem)); max-height: min(70vh, 34rem); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 0.5rem 0.9rem 0.8rem; display: grid; gap: 0.55rem; }
.pending-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pending-inbox h4 { margin: 0; font-size: 1rem; }
.pending-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: center;
  padding-block: 0.5rem; border-top: 1px solid var(--line); }
.pending-summary { margin: 0; display: grid; gap: 0.15rem; justify-items: start; }
.pending-summary .pending-line { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.pending-summary .pending-figures { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.pending-summary .pending-who { color: var(--text-muted); }
.notify-stack { position: fixed; inset-block-start: 4.5rem; inset-inline-end: 1rem; z-index: 75;
  width: min(26rem, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.notify-stack > * { pointer-events: auto; }
.notify-stack:empty { display: none; }
.pending-popup { position: fixed; inset-block-start: 4.5rem; inset-inline-end: 1rem; z-index: 75;
  width: min(26rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 0.8rem 0.9rem 0.75rem; display: grid; gap: 0.5rem; }
.notify-stack > .pending-popup, .notify-stack > .ob-popup { position: relative; inset: auto; width: auto; z-index: auto; }
.pending-popup h3 { margin: 0; font-size: 1.05rem; padding-inline-end: 2.6rem; display: flex; align-items: center; gap: 0.2rem; }
.pending-popup .pending-live { margin: 0; font-size: 0.86rem; }
.pending-popup .pending-close { position: absolute; inset-block-start: 0.35rem; inset-inline-end: 0.35rem;
  min-width: 44px; min-height: 44px; padding: 0; }
.pending-popup .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 47.99rem) {
  .pending-bell { padding-inline: 0.35rem; }
  .notify-stack, .pending-popup { inset-block-start: 4.25rem; inset-inline: 0.75rem; width: auto; }
  .notify-stack > .pending-popup { inset: auto; }
  .pending-inbox { inset-block-start: 4.25rem; inset-inline: 0.75rem; width: auto; max-height: calc(100vh - 11rem); }
}

/* P1: the customer's transfer state toward the accounting test database (the server's state, in words) */
.transfer-chip { display: inline-block; font-weight: 700; white-space: nowrap; }
.transfer-chip.transfer-ready { border-color: var(--gold); }
.transfer-chip.transfer-linked { border-color: var(--buy); }
.transfer-chip.transfer-conflict, .transfer-chip.transfer-unknown, .transfer-chip.transfer-refused {
  border-color: var(--danger); background: var(--danger-soft); }
.acct-ordinary { display: grid; gap: 0.35rem; }

/* ---------------------------------------------- ADR-0021: user management (the account-roles model only) */
.users-top { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.3rem 0 0.8rem; }
.users-editor { display: grid; gap: 0.8rem; }
.users-editor h3 { margin: 0; }
.users-section { display: grid; gap: 0.5rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); justify-items: start; }
.users-section .cfg-field { width: 100%; }
.users-password-line { display: flex; gap: 0.4rem; align-items: center; width: 100%; }
.users-password-line input {
  font: inherit; padding: 0.5rem 0.7rem; min-height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: inherit; flex: 1 1 auto; min-width: 0;
}
.users-access { display: grid; gap: 0.5rem; width: 100%; }
.users-perms { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0; padding: 0.4rem 0.7rem;
  display: grid; gap: 0.1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.users-perms legend { font-size: 0.85rem; padding: 0 0.3rem; }
.users-perm { display: flex; gap: 0.5rem; align-items: center; min-height: 44px; }
.users-perm input[type="checkbox"] { width: 1.3rem; height: 1.3rem; margin: 0; flex: 0 0 auto; }
.users-perm label { cursor: pointer; }
.users-add { max-width: none; border: 0; padding: 0; background: transparent; }
.users-add input[type="text"] { width: 100%; box-sizing: border-box; }
@media (max-width: 47.99rem) {
  /* the bar keeps five entries: کاربران is reached from «بیشتر», as پیکربندی is */
  body[data-look="live"][data-shell="staff"] #mainnav #nav-users { display: none; }
}

/* ---------------------------------- owner request 2026-11-05: collections as tables, details in a panel
   UR-20261106 (WP-0, spec §3): the ONE table system. Words never break inside a cell: text wraps only at spaces, and
   numbers, dates, ids, chips and buttons stay on one line (`overflow-wrap: anywhere` / `word-break: break-all` are
   never used in or around a cell). A cell's KIND (`col-primary`, `col-text`, `col-num`, `col-date`, `col-id`,
   `col-badge`, `col-status`, `col-note`, `col-actions`, `col-detail`; app.js `columnKinds`) decides its wrapping,
   width and phone placement. Desktop cells stay centred (owner 2026-11-05) with tabular digits; a table wider than its
   column scrolls inside its own wrapper. At <=47.99rem a row becomes a card: the primary cell and the status chip on the
   title line, then label | value lines, then the actions as full-width 48px buttons (`keep-table` keeps a short table
   a table). Area packages add area-scoped table rules only in their own slot at the end of this file. */
.data-table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin: 0.3rem 0 0.8rem; }
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.data-table th, .data-table td {
  text-align: center; vertical-align: middle; padding: 0.6rem 0.7rem; line-height: 1.5;
  border-bottom: 1px solid var(--line); overflow-wrap: normal; word-break: normal; hyphens: none;
}
.data-table thead th {
  font-size: 0.85rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  color: var(--text-muted); background: var(--surface-2);
}
.data-table tbody td { height: 48px; }
.data-table.dense tbody td { height: 40px; padding: 0.45rem 0.6rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr.row-opens { cursor: pointer; }
.data-table tr.row-opens:hover td, .data-table tr.row-opens:focus-within td { background: var(--surface-2); }
.data-table .col-num, .data-table .col-date, .data-table .col-id,
.data-table .col-badge { white-space: nowrap; width: 1%; }
/* the actions column stays on one line per button; with the system's at most two buttons (.row-actions) it is as
   narrow as its buttons, and an area's older wrapping group keeps the room it had */
.data-table .col-actions { white-space: nowrap; }
.data-table td.col-actions:has(> .row-actions) { width: 1%; }
.data-table td.col-primary { min-width: 10rem; font-weight: 600; }
.data-table td.col-text { min-width: 8rem; max-width: 18rem; }
.data-table td.col-note { min-width: 12rem; max-width: 24rem; font-size: 0.86rem; color: var(--text-muted); }
.data-table td.col-id { font-size: 0.86rem; color: var(--text-muted); }
.data-table td.col-status .chip { white-space: nowrap; }
.data-table td .chip:not(.transfer-chip), .data-table .ltr, .data-table bdi.ltr, .data-table .num { white-space: nowrap; }
.data-table .idchip, .data-table .ob-exact {
  font-family: inherit; background: none; border: 0; padding: 0; font-size: 0.86rem;
  color: var(--text-muted); white-space: nowrap;
}
.data-table .cell-sub { display: block; font-size: 0.82rem; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.data-table .cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.data-table .row-actions { display: inline-flex; flex-wrap: nowrap; gap: 0.4rem; justify-content: center; align-items: center; }
.data-table .row-actions button { white-space: nowrap; }
.data-table .row-open {
  border: 0; background: transparent; min-height: 44px; padding: 0.2rem 0; display: inline-flex;
  align-items: center; justify-content: center; gap: 0.45rem; font: inherit; font-weight: 700; color: var(--text);
}
.data-table .row-open:hover { text-decoration: underline; }
.data-table .row-open.has-sub { flex-direction: column; gap: 0; }
.data-table .row-open .cell-sub { font-weight: 400; }
.data-table tr.row-extra td { background: var(--surface-2); text-align: start; white-space: normal; height: auto; }
.data-table tr.row-quiet td.col-num { opacity: 0.6; }
.data-table tr.just-decided td { background: var(--warn-bg); transition: background 0.6s; }
/* compatibility until each area adopts `row-open` / `row-actions` / `row-extra` (spec §3.5): the existing open
   buttons, action groups and kept-outcome rows read as the system's own */
.data-table .reqrow-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.2rem 0.45rem; flex-wrap: wrap;
  width: auto; min-height: 44px; padding: 0.2rem 0.3rem; grid-template-columns: none; grid-template-areas: none;
  background: transparent; border: 0; text-align: center; font-weight: 700; color: var(--text);
}
.data-table .reqrow-open:hover { text-decoration: underline; border-color: transparent; }
/* review 2026-11-06: a hovered or focused row shows no old card box inside its own hover colour (focus keeps a ring);
   the old list's white button (`.reqlist.table .reqrow-open`) is outranked here */
.data-table .reqrow-open:hover, .data-table .reqrow-open:focus-visible,
.reqlist.table .data-table .reqrow-open { background: transparent; }
/* review 2026-11-06: the side chip sits ABOVE the product name, so a name has the cell's width and wraps at most once */
.data-table .reqrow-open { flex-direction: column; flex-wrap: nowrap; }
.data-table .reqrow-open .reqcard-asset { white-space: normal; min-width: 9rem; margin-inline-end: 0; }
.data-table .reqcard-mesghal { display: block; color: var(--text-muted); font-size: 0.82rem; }
.data-table .reqcard-state { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; justify-content: center; white-space: normal; max-width: 10rem; }
.data-table td.col-badge p { white-space: normal; min-width: 10rem; }
.data-table .acct-row-actions { display: inline-flex; flex-wrap: nowrap; gap: 0.4rem; justify-content: center; margin: 0; }
/* review 2026-11-06: the queue's decision group stacks (as it did before the table system), so the column is as
   narrow as ONE button; an open confirmation or a kept outcome keeps that column narrow and wraps its own lines */
.data-table .req-actions-cell .reqrow-actions {
  display: inline-flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0.4rem;
  justify-content: center; margin: 0;
}
.data-table .req-actions-cell .reqrow-actions .freshness { flex-basis: auto; white-space: normal; max-width: 12rem; }
.data-table .req-actions-cell .inline-confirm, .data-table .req-actions-cell .inline-outcome {
  text-align: start; white-space: normal; width: min-content; min-width: 9rem; max-width: 16rem; padding-inline: 0.6rem;
}
.data-table .req-actions-cell .inline-confirm .kv,
.data-table .req-actions-cell .inline-outcome .kv { display: block; text-align: start; }
.data-table .req-actions-cell .inline-confirm .kv-name { margin-inline-end: 0.4rem; }
.data-table .req-actions-cell .inline-confirm .kv-value,
.data-table .req-actions-cell .inline-confirm .ltr,
.data-table .req-actions-cell .inline-outcome .ltr { white-space: normal; text-align: start; }
.data-table .req-actions-cell .inline-confirm .actions button,
.data-table .req-actions-cell .inline-outcome .actions button { flex: 1 1 auto; white-space: nowrap; }
.data-table td > .dir-chips, .data-table td > .reqrow-actions { justify-content: center; }
.data-table .acct-outcome-row td { background: var(--surface-2); text-align: start; white-space: normal; height: auto; }
.data-table tr.acct-balance-focus td { outline: 0; background: var(--surface-2); }
.data-table .acct-balance-field { color: var(--text-muted); }
/* a holdings row keeps the .kv class (its old name): as a table row it is laid out by the table */
.data-table tr.kv { display: table-row; border: 0; padding: 0; }
.data-table tr.kv .kv-name { color: var(--text); }
/* review 2026-11-06 (spec §3.1): on a desk a cell may break between a figure and its unit, or between a date and its
   time -- at a space, never inside a number, a date, an id or a word. A narrower window drops the columns a request's
   overlay repeats, so the request tables fit their column instead of pushing their last columns out of view: the id
   (every request table) and, for staff, the unit price below 96rem (a 1536px window); for staff also the time below
   80rem (1280px, where the menu becomes a rail). The countdown stays in «وضعیت», and the overlay shows all three.
   (Media queries count 16px to the rem.) */
@media (min-width: 48rem) {
  .data-table td.col-num, .data-table td.col-date, .data-table td.col-date bdi.ltr { white-space: normal; }
  .data-table td.col-num .reqcard-mesghal { white-space: nowrap; }
}
@media (min-width: 48rem) and (max-width: 95.99rem) {
  .data-table.req-table .col-id,
  body[data-shell="staff"] .data-table.req-table th[data-col="قیمت واحد"],
  body[data-shell="staff"] .data-table.req-table td[data-label="قیمت واحد"] { display: none; }
}
@media (min-width: 48rem) and (max-width: 79.99rem) {
  body[data-shell="staff"] .data-table.req-table .col-date { display: none; }
}
@media (max-width: 47.99rem) {
  .data-table:not(.keep-table), .data-table:not(.keep-table) tbody { display: block; width: 100%; }
  .data-table:not(.keep-table) thead { display: none; }
  .data-table:not(.keep-table) tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.75rem;
    padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--line); text-align: start;
  }
  .data-table:not(.keep-table) tbody tr:last-child { border-bottom: 0; }
  /* review 2026-11-06: a hovered or focused card is painted as ONE surface (each cell painted alone showed the grid's
     gaps as stripes) */
  .data-table:not(.keep-table) tr.row-opens:is(:hover, :focus-within) { background: var(--surface-2); }
  .data-table:not(.keep-table) tr.row-opens:is(:hover, :focus-within) td { background: transparent; }
  .data-table:not(.keep-table) td {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr);
    gap: 0.5rem; align-items: baseline; height: auto; padding: 0; border: 0; width: auto;
    text-align: start; white-space: normal; min-width: 0; max-width: none;
  }
  .data-table:not(.keep-table) td[data-label]::before { content: attr(data-label); font-size: 0.8rem; color: var(--text-muted); }
  .data-table:not(.keep-table) td:not([data-label]) { display: block; }
  .data-table:not(.keep-table) td.col-primary { grid-column: 1; grid-row: 1; display: block; min-width: 0; font-weight: 700; }
  .data-table:not(.keep-table) td.col-badge { grid-column: 2; grid-row: 1; display: block; justify-self: end; }
  .data-table:not(.keep-table) td.col-primary::before,
  .data-table:not(.keep-table) td.col-badge::before,
  .data-table:not(.keep-table) td.col-actions::before { display: none; }
  .data-table:not(.keep-table) td.col-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
  .data-table:not(.keep-table) td.col-actions .row-actions,
  .data-table:not(.keep-table) td.col-actions .reqrow-actions,
  .data-table:not(.keep-table) td.col-actions .acct-row-actions {
    display: flex; flex-wrap: wrap; width: 100%; flex-direction: row;
  }
  .data-table:not(.keep-table) td.col-actions button { flex: 1 1 0; min-height: 48px; }
  .data-table:not(.keep-table) td.col-detail,
  .data-table:not(.keep-table) tr.row-opens td.col-id { display: none; }
  .data-table:not(.keep-table) tr.row-extra,
  .data-table:not(.keep-table) tr.acct-outcome-row { display: block; }
  .data-table:not(.keep-table) .row-open,
  .data-table:not(.keep-table) .reqrow-open { justify-content: flex-start; text-align: start; flex-wrap: wrap; }
  .data-table:not(.keep-table) .reqrow-open { flex-direction: row; }
  .data-table:not(.keep-table) td.col-badge .chip { margin-inline-start: 0.2rem; }
  .data-table:not(.keep-table) td.col-actions .inline-confirm,
  .data-table:not(.keep-table) td.col-actions .inline-outcome {
    min-width: 0; flex-basis: 100%; width: auto; max-width: none;
  }
}

.view.has-panel, main.has-panel { position: relative; }
/* the page's own heading (its buttons and their menus) stays above a panel laid over the list */
.view.has-panel > .page-head { position: relative; z-index: 21; }
.panel {
  position: absolute; z-index: 20; inset-inline: 0; top: var(--panel-top, 0px);
  min-height: calc(100% - var(--panel-top, 0px));
  display: grid; align-content: start; gap: 0.7rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  padding: 0.9rem 1rem 1.4rem;
}
main > .view.panel { inset-inline: 1rem; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 0.5rem;
}
.panel-head h3 { margin: 0; }
.panel-body { display: grid; gap: 0.8rem; }
@media (max-width: 47.99rem) {
  .panel { padding: 0.75rem 0.75rem 6rem; }   /* the last lines clear the fixed bottom navigation */
  main > .view.panel { inset-inline: 0; }
}


/* ---------------------------------- ADR-0022 (owner 2026-11-06, design §6): true overlays, live look only
   Every detail view stands centred above the page, scrolling inside itself and fitting a 360px phone. One
   full-window backdrop blurs the page behind it; the page, the top bar and the menu are inert. A request opened
   over another detail lies on top; the one under it stays under the backdrop. The customer's standby and the
   pending pop-up are on the body, above the whole application, and stay above this. */
.overlay-backdrop {
  position: fixed; inset: 0; z-index: 51;
  background: rgba(8, 20, 16, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.overlay-backdrop[hidden] { display: none; }
body[data-look="live"] .overlay,
body[data-look="live"] main > .view.overlay {
  position: fixed; z-index: 52; inset: 0; margin: auto; transform: none;
  width: min(56rem, calc(100vw - 1.5rem)); height: fit-content; min-height: 0;
  max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-overlay);
  padding: 0.9rem 1rem 1.2rem;
}
/* UR-20261106 (WP-0, spec §1.7): an overlay that holds a table is wider, so its columns are not squeezed */
body[data-look="live"] .overlay:has(.data-table-wrap),
body[data-look="live"] main > .view.overlay:has(.data-table-wrap) { width: min(72rem, calc(100vw - 1.5rem)); }
body[data-look="live"] .overlay.overlay-under { z-index: 50; }
body[data-look="live"] .overlay > .page-head,
body[data-look="live"] .overlay > .panel-head,
body[data-look="live"] .overlay > .sheet-head { align-items: center; }
/* behind the backdrop while an overlay stands: the bell and its list (inert there); a question that asks before
   leaving stands above it, so it can be answered */
body[data-overlay="open"] .pending-bell,
body[data-overlay="open"] .pending-inbox { z-index: 44; }
body[data-overlay="open"] #draft-leave {
  position: fixed; z-index: 53; inset-inline: 0.75rem; top: 0.75rem;
  background: var(--surface); box-shadow: var(--shadow);
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .overlay,
  body[data-look="live"] main > .view.overlay {
    width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem);
    padding: 0.75rem 0.75rem 1rem;
  }
}
/* the X close: an icon, at least 44px, named «بستن» */
button.icon-close {
  min-width: 44px; min-height: 44px; padding: 0.35rem;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
button.icon-close svg { width: 1.4rem; height: 1.4rem; }

/* ---------------------------------- ADR-0022 (design §5): «؟» -- a needed explanation, behind a help button
   UR-20261106 (WP-0, spec §1.9): a quiet 26px circle drawn inside the 44px button (the hit area), placed about 4px after
   the text it explains; on a desk the note has a caret, on a phone it is a bottom sheet with its own «بستن». */
.help { position: relative; display: inline-flex; vertical-align: middle; margin-block: -9px; margin-inline: -5px -9px; }
button.help-btn {
  position: relative; min-width: 44px; width: 44px; min-height: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-pill); background: transparent;
  font-size: 0.85rem; font-weight: 700; line-height: 1; color: var(--text-muted);
}
button.help-btn::before {
  content: ""; position: absolute; inset: 9px; border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); z-index: -1;
}
button.help-btn { isolation: isolate; }
button.help-btn:hover::before, button.help-btn[aria-expanded="true"]::before { border-color: var(--gold); }
button.help-btn[aria-expanded="true"] { color: var(--text); }
.help-tip {
  position: absolute; z-index: 30; top: calc(100% + 0.25rem); inset-inline-start: 0;
  width: max-content; max-width: min(20rem, calc(100vw - 2rem));
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  padding: 0.55rem 0.75rem; font-size: 0.86rem; font-weight: 400; line-height: 1.7; text-align: start;
  white-space: normal;
}
.help-tip::before {
  content: ""; position: absolute; inset-block-start: -6px; inset-inline-start: 16px; width: 10px; height: 10px;
  background: var(--surface); border-inline-start: 1px solid var(--line-strong); border-block-start: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.help-tip[hidden] { display: none; }
.help-tip .help-close { display: none; }
.block-head .help, h3 .help, h4 .help { margin-inline-start: -5px; }
@media (max-width: 30rem) {
  .help-tip {
    position: fixed; z-index: 80; top: auto; inset-inline: 0.75rem; inset-block-end: calc(5rem + env(safe-area-inset-bottom, 0px));
    width: auto; max-width: none; padding: 0.8rem 0.9rem 0.6rem; font-size: 0.95rem; transform: none !important;
  }
  .help-tip::before { display: none; }
  .help-tip .help-close { display: flex; margin-block-start: 0.4rem; margin-inline-start: auto; }
}

/* ---------------------------------- ADR-0022 (design §7): the home shows a few rows OF the market board */
.home-excerpt .home-all-prices { min-height: 44px; white-space: nowrap; }

/* ADR-0022 (design §5): in the live look the top bar carries no build chip; staff find the version in «بیشتر» */
body[data-look="live"] #build-chip { display: none; }

/* ---------------------------------- ADR-0022 (owner 2026-11-06, design §1, §3): customer onboarding, live look only
   The customer's own onboarding page (no menu while it holds), the staff's registrations sub-tab, the invitation and
   its one-time result, the count badge on «مشتریان» and its pop-up. Existing tokens only. */
.view-onboarding { max-width: 40rem; margin-inline: auto; }
.onboarding-body { display: grid; gap: 0.8rem; }
.ob-lead { margin: 0; }
.ob-form { max-width: none; }
.ob-form input[type="password"], .ob-form input[type="text"], .ob-form input[type="tel"], .ob-form textarea, .ob-form select {
  width: 100%; box-sizing: border-box;
}
.ob-form input[readonly] { background: transparent; }
.ob-rules-title { margin: 0; font-size: 0.85rem; }
.ob-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.2rem; font-size: 0.85rem; }
.ob-rule { display: flex; gap: 0.5rem; align-items: baseline; color: var(--text-muted); }
.ob-rule-mark { flex: 0 0 1.2rem; text-align: center; font-weight: 700; }
.ob-rule[data-met="yes"] { color: var(--text); }
.ob-rule[data-met="yes"] .ob-rule-mark { color: var(--met-ink); }
.ob-field-error:empty { display: none; }
.ob-outcome:empty { display: none; }
.ob-note-text { white-space: pre-wrap; overflow-wrap: break-word; }
.ob-exact { font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
#ob-result-password { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.1em; }
.ob-secret-line { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.ob-message { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.ob-actions { display: grid; gap: 0.8rem; }
.ob-confirm { display: grid; gap: 0.5rem; }
.ob-confirm[hidden] { display: none; }
.ob-plan .cfg-field { width: 100%; }
.customers-tabs { margin: 0 0 0.8rem; }
.customers-tabs[hidden] { display: none; }
#view-customers[data-sub="registrations"] > #customers-directory,
#view-customers[data-sub="registrations"] > #customers-create,
#view-customers[data-sub="registrations"] > #customers-status,
#view-customers[data-sub="matching"] > #customers-directory,
#view-customers[data-sub="matching"] > #customers-create,
#view-customers[data-sub="matching"] > #customers-status { display: none; }
.registrations { display: grid; gap: 1rem; }
.registrations[hidden] { display: none; }
.ob-chips { flex-wrap: wrap; width: fit-content; max-width: 100%; }
.ob-chips button { min-height: 44px; white-space: nowrap; }
.ob-fields { justify-items: stretch; }
.ob-table .ob-exact, .ob-table button { white-space: nowrap; overflow-wrap: normal; }
.ob-table .dir-name { overflow-wrap: normal; font-weight: 700; }
.ob-registration .kvlist, .ob-review .ob-facts, .ob-result .ob-facts { width: 100%; }
.ob-chip-count { font-weight: 700; }
.ob-fields-title { margin: 0; display: flex; align-items: center; gap: 0.2rem; }
@media (max-width: 47.99rem) {
  .ob-secret-line { justify-content: flex-start; }
}

/* ---------------------------------- ADR-0022 (owner 2026-11-06, design §4.4 - §4.6): Tahesab matching, live look only
   A sub-tab of «مشتریان» for holders of «تطبیق با ته‌حساب»: the last comparison, its classes as filters, the Tahesab
   rows with the server's own actions, the app's customers Tahesab does not have, and the three dialogs. */
.matching { display: grid; gap: 0.8rem; }
.matching[hidden] { display: none; }
.mt-not-configured { margin: 0; }
.mt-snapshot { margin: 0; }
.mt-progress:empty { display: none; }
.mt-refresh { margin: 0; }
.mt-pager .mt-page { margin-inline-start: auto; font-size: 0.78rem; color: var(--text-muted); }
/* ADR-0022 follow-up: the registrations pager and status stay visible in the live look (not .freshness) */
.ob-pager .ob-page { margin-inline-start: auto; font-size: 0.78rem; color: var(--text-muted); }
.ob-status { font-size: 0.78rem; color: var(--text-muted); }
.mt-actions { display: flex; flex-wrap: nowrap; gap: 0.4rem; justify-content: center; align-items: center; }
.mt-actions button { min-height: 44px; white-space: nowrap; }
.mt-status { display: grid; gap: 0.25rem; justify-items: center; }
.mt-reason { margin: 0; font-size: 0.8rem; color: var(--text-muted); max-width: 18rem; }
.mt-table .ob-exact { white-space: nowrap; overflow-wrap: normal; }
/* a name, a group or a customer breaks between words, never inside one (the table scrolls sideways instead) */
.mt-table td { overflow-wrap: normal; }
.mt-table th { overflow-wrap: normal; white-space: nowrap; }
.mt-hints { font-size: 0.85rem; }
.mt-app-title { margin: 0.4rem 0 0; }
.mt-outcome:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.mt-dialog .mt-facts, .mt-dialog .kvlist { width: 100%; }
.mt-picker-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.mt-picker-form .cfg-field { flex: 1 1 14rem; }
.mt-picker-form button { min-height: 44px; }
.mt-picker-list { width: 100%; max-height: 18rem; overflow-y: auto; }
.mt-picker-list .users-perm label { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: baseline; }
.mt-question { margin: 0; }
/* owner 2026-11-06 (items 2, 3): a linked row's ID comparison, the national-ID form, a balance answer's shape */
.mt-id { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; justify-content: center; }
.mt-id .mt-id-status { white-space: nowrap; font-size: 0.78rem; }
.mt-id-note { margin: 0; }
.mt-id-form .cfg-field { width: 100%; }
.mt-id-kind { margin: 0.2rem 0 0; font-size: 0.8rem; }
/* review 2026-11-06: the national-ID dialog says the ID is lasting, and a linked row's invalid Tahesab ID */
.mt-id-lasting, .mt-id-held { margin: 0.25rem 0; }
.acct-read-state { display: grid; gap: 0.25rem; }
.acct-read-help { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.acct-shape .kv-value bdi { overflow-wrap: break-word; }
.acct-value-notes { margin: 0.2rem 0 0; }
.ob-tahesab-warning p, .ob-tahesab-warning { margin: 0; }

/* ===== UR-20261106 WP-0 foundation (spec §1, §2, §3, §5.A) =====
   The shared shell, navigation, notifications, forms, overlays, sign-in and the live-look overrides that stop words
   from breaking and numbers from wearing a monospace face. Area packages do not edit this section: an area override
   goes in that area's slot below. Presentation only -- nothing here hides an authorized action, a refusal or a
   financial qualifier. */

/* --- shell: the frame, the top bar and the sidebar --- */
body[data-look="live"] .app { min-height: 100vh; }
.topbar-brand { display: none; align-items: center; color: var(--gold); }
.topbar-brand svg { width: 24px; height: 24px; }
body[data-look="live"] .topbar-titles { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
body[data-look="live"] .topbar-session { gap: 0.4rem; }
body[data-look="live"] #btn-exit { min-width: 44px; }
body[data-look="live"][data-shell="entry"] #who { display: none; }
@media (max-width: 30rem) {
  body[data-look="live"] .topbar { flex-wrap: nowrap; padding: 0.4rem 0.75rem; gap: 0.5rem; }
  body[data-look="live"] .topbar-titles { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  body[data-look="live"]:not([data-shell="entry"]) .topbar h1 { display: none; }
  body[data-look="live"]:not([data-shell="entry"]) .topbar-brand { display: inline-flex; }
  body[data-look="live"] .topbar-session { flex: 1 1 auto; min-width: 0; justify-content: space-between; }
  body[data-look="live"] .topbar-session .who { min-width: 0; overflow: hidden; flex: 0 1 auto; }
  body[data-look="live"] .topbar-session .who strong {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  body[data-look="live"] #btn-exit { width: 44px; padding: 0; }
  body[data-look="live"] #btn-exit > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
}
/* the guard, after the real fix above: a stray wide node can never scroll the whole page sideways. Review 2026-11-06:
   on the root only, so the page still measures what overflows (a test can find it) and the body never cuts a line */
html:has(> body[data-look="live"]) { overflow-x: clip; }
@media (min-width: 48rem) {
  body[data-look="live"][data-shell="customer"] .topbar,
  body[data-look="live"][data-shell="customer"] .mainnav {
    padding-inline: max(1.5rem, calc((100% - 74rem) / 2 + 1.5rem));
  }
}
@media (min-width: 64rem) {
  body[data-look="live"][data-shell="staff"] .mainnav { top: 0; height: 100vh; height: 100dvh; }
  body[data-look="live"][data-shell="staff"] .topbar h1 { display: none; }
  body[data-look="live"][data-shell="staff"] main { max-width: 96rem; }
}
/* review 2026-11-06: on a narrower desk (64rem - 80rem: a 1024px - 1279px window) the staff menu is an icon rail, so
   a page has the room its tables need; each item keeps its word for a screen reader and in its title, the count stays
   a dot on the icon, and the brand's name moves to the top bar */
@media (min-width: 64rem) and (max-width: 79.99rem) {
  body[data-look="live"][data-shell="staff"] .frame { grid-template-columns: 4.75rem minmax(0, 1fr); }
  body[data-look="live"][data-shell="staff"] .mainnav { padding: 0.75rem 0.5rem; align-items: center; }
  body[data-look="live"][data-shell="staff"] .mainnav .brand {
    grid-template-columns: auto; grid-template-areas: "i"; justify-content: center; width: 100%; padding-inline: 0;
  }
  body[data-look="live"][data-shell="staff"] .mainnav .brand span,
  body[data-look="live"][data-shell="staff"] .mainnav .brand small { display: none; }
  body[data-look="live"][data-shell="staff"] .navbtn {
    width: 3.25rem; min-width: 0; justify-content: center; padding: 0.55rem 0;
  }
  body[data-look="live"][data-shell="staff"] .navbtn > span:not(.nav-badge) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  body[data-look="live"][data-shell="staff"] .navbtn .nav-badge {
    position: absolute; inset-block-start: 0.1rem; inset-inline-start: calc(50% + 0.3rem); margin: 0;
  }
  body[data-look="live"][data-shell="staff"] .topbar h1 { display: block; }
}

/* --- navigation: the count badge on a menu item (spec §1.10) --- */
.navbtn { position: relative; }
.nav-badge {
  position: absolute; inset-block-start: 0.15rem; inset-inline-start: calc(50% + 0.4rem);
  min-width: 1.25rem; padding: 0 0.3rem; border-radius: var(--radius-pill);
  background: var(--sell-deep); color: #fff; font-size: 0.78rem; font-weight: 700; line-height: 1.25rem;
  text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.nav-badge[hidden] { display: none; }
@media (min-width: 48rem) {
  .nav-badge { position: static; margin-inline-start: auto; }
}
.navbtn[aria-current="page"] .nav-badge { background: var(--green-950); color: var(--gold); }
body[data-look="live"] .navbtn > span:not(.nav-badge) { white-space: nowrap; }
@media (max-width: 47.99rem) {
  body[data-look="live"] #tools-title .nav-long { display: none; }
  body[data-look="live"] #tools-title .nav-short { display: inline; }
}

/* --- «بیشتر» on a phone: a list of the places the bar has no room for; hidden on a desk (spec §5.A.9) --- */
body[data-look="live"] #more-links .block-head { display: none; }
body[data-look="live"] #more-links { padding: 0.25rem 0; }
body[data-look="live"] #more-links .row { display: grid; gap: 0; margin: 0; }
body[data-look="live"] #more-links .row button {
  width: 100%; min-height: 48px; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent; color: var(--text); font-size: 1rem; font-weight: 600; padding: 0.6rem 1rem;
}
body[data-look="live"] #more-links .row button:last-child { border-bottom: 0; }
body[data-look="live"] #more-links .row button:not(#btn-more-exit)::after { content: "‹"; color: var(--text-muted); font-weight: 400; }
@media (min-width: 48rem) {
  body[data-look="live"] #more-links { display: none !important; }
}
/* final review 2026-11-07: the version is a row of the «درباره» list; its sentence sits in the «جزئیات فنی» fold */
.about-version-line { margin: 0; }
#debug .build-identity { font-size: 0.85rem; margin: 0.25rem 0 0.5rem; }
/* the request log stays recorded in the document (it never carries a customer id) but is not drawn in the live look:
   its raw server codes would put engineering words on screen whenever the version's fold is opened */
body[data-look="live"] #debug .debug-body { display: none; }
/* a technical fold says it opens: a chevron that turns when open */
body[data-look="live"] #debug > summary::after,
.refusal-tech > summary::after,
body[data-look="live"] .about-version > summary::after {
  content: "‹"; display: inline-block; margin-inline-start: 0.5rem; transition: transform 0.15s; color: var(--text-muted);
}
body[data-look="live"] #debug[open] > summary::after,
.refusal-tech[open] > summary::after,
body[data-look="live"] .about-version[open] > summary::after { transform: rotate(-90deg); }
body[data-look="live"] .tools-grid { grid-template-columns: minmax(0, 40rem); }
.about-version-line .build-label { font-weight: 700; }

/* --- notifications: the registration pop-up (built by the customers package) wears the pending pop-up's look; inside
   the notification stack it is in flow, and until it is moved there it steps to the bottom while a request pop-up
   stands (spec §1.10) --- */
.ob-popup { position: fixed; inset-block-start: 4.5rem; inset-inline-end: 1rem; z-index: 75;
  width: min(26rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 0.8rem 0.9rem 0.75rem; display: grid; gap: 0.5rem; }
.ob-popup[hidden] { display: none; }
.ob-popup h3 { margin: 0; font-size: 1.05rem; }
.ob-popup-line { margin: 0; font-size: 0.86rem; }
.ob-popup .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
body:has(.notify-stack .pending-popup:not([hidden])) > .ob-popup { inset-block-start: auto; inset-block-end: 1.25rem; }
@media (max-width: 47.99rem) {
  .ob-popup { inset-block-start: 4.25rem; inset-inline: 0.75rem; width: auto; }
  body:has(.notify-stack .pending-popup:not([hidden])) > .ob-popup { inset-block-end: 5.5rem; }
}
.notify-stack > .ob-popup { position: relative; inset: auto; width: auto; z-index: auto; }

/* --- notifications: the toast under the top bar on a phone (spec §1.10) --- */
@media (max-width: 47.99rem) {
  .toast { inset-block-start: 4.25rem; inset-block-end: auto; inset-inline: 0.75rem; width: auto; margin-inline: 0; }
}

/* --- forms (spec §1.6) --- */
body[data-look="live"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-look="live"] select,
body[data-look="live"] textarea { font-size: max(16px, 1rem); font-family: inherit; }
[aria-invalid="true"] { border-color: var(--error-ink) !important; box-shadow: inset 0 0 0 1px var(--error-ink); }
input[readonly] { background: transparent; border-style: dashed; color: var(--text-muted); }
.create-error::before { content: "✕ "; font-weight: 700; }
.create-error:empty::before { content: none; }
.create-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.create-actions button { white-space: nowrap; }
body[data-look="live"] .overlay .create-actions { border-top: 1px solid var(--line); padding-top: 0.6rem; }

/* --- overlays: facts as a two-column list, a sticky decision bar, quiet heading focus (spec §1.7) --- */
body[data-look="live"] .overlay .kv:not(tr),
.acct-section .kv:not(tr) {
  display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); gap: 0.75rem;
  justify-content: start; text-align: start; align-items: baseline;
}
body[data-look="live"] .overlay .kv:not(tr) .kv-value,
.acct-section .kv:not(tr) .kv-value { text-align: start; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .overlay .kv:not(tr),
  .acct-section .kv:not(tr) { grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr); }
}
.decision-bar {
  position: sticky; bottom: 0; z-index: 2; background: var(--bg); border-top: 1px solid var(--line);
  padding: 0.6rem 0; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.decision-bar button { white-space: nowrap; }
h2:focus, h3:focus { outline: none; }
h2:focus-visible, h3:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* --- states: empty, a failed read beside a stale marker (spec §1.8) --- */
body[data-look="live"] .empty {
  border: 0; background: none; padding: 0.75rem 0; color: var(--text-muted); font-size: 0.95rem; text-align: start;
}
.empty-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.4rem 0 0.8rem; }
.empty-state .empty { margin: 0; }
.view:has(.read-issue[data-failed]:not([hidden])) .page-actions .freshness.stale { display: none; }
body[data-look="live"] .page-actions button.icon { color: var(--text-muted); }
body[data-look="live"] .page-actions button.icon:hover { color: var(--text); }

/* --- row actions outside a table, and the «بیشتر» popover of a row (spec §3.1.5) --- */
.row-actions { display: inline-flex; flex-wrap: nowrap; gap: 0.4rem; align-items: center; }
details.row-more { position: relative; display: inline-block; }
details.row-more > summary {
  list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 0.86rem; white-space: nowrap;
}
details.row-more > summary::-webkit-details-marker { display: none; }
.row-more-menu {
  position: absolute; z-index: 30; inset-block-start: calc(100% + 0.25rem); inset-inline-end: 0;
  min-width: 12rem; display: grid; gap: 0.3rem; padding: 0.4rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.row-more-menu button { width: 100%; justify-content: flex-start; }

/* --- sign-in (spec §5.A.12) --- */
body[data-look="live"] .view-entry { padding-top: 8vh; }
body[data-look="live"] .entry-hero { margin-bottom: 1rem; }
.entry-hero .lead:empty { display: none; }
body[data-look="live"] .live-login {
  max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem;
}
body[data-look="live"] .live-login form { display: grid; gap: 0.8rem; margin: 0; }
body[data-look="live"] #entry-notice { max-width: 24rem; margin: 0 auto 0.9rem; }
/* review 2026-11-06: the notice above the card is exactly as wide as the card (24rem both), so their edges line up */
body[data-look="live"] #entry-notice, body[data-look="live"] .live-login { width: 100%; }
body[data-look="live"] #entry-notice p { margin: 0; }

/* --- the live look: no word breaks inside a table, no monospace for numbers or names (spec §3.1.1, §5.A.4-5) --- */
body[data-look="live"] .data-table th,
body[data-look="live"] .data-table td,
body[data-look="live"] .data-table td *,
body[data-look="live"] .dir-row > *,
body[data-look="live"] .mt-table td,
body[data-look="live"] .ob-table td { overflow-wrap: normal; word-break: normal; }
body[data-look="live"] .stat-value,
body[data-look="live"] .fact-value,
body[data-look="live"] .profile-fact,
body[data-look="live"] .profile-identity .idchip,
body[data-look="live"] .ob-exact,
body[data-look="live"] .acct-section .kv-value,
body[data-look="live"] .acct-shape .kv-value bdi,
body[data-look="live"] .boardbtn .num,
body[data-look="live"] .board-editline .num,
body[data-look="live"] .quote-value,
body[data-look="live"] .price-magnitude,
body[data-look="live"] .price-secondary .num-secondary,
body[data-look="live"] .quotebox .quote-number,
body[data-look="live"] .reqrow-open .r-main,
body[data-look="live"] .pending-summary,
body[data-look="live"] .build-identity,
body[data-look="live"] .ob-note-text { overflow-wrap: break-word; word-break: normal; }
body[data-look="live"] .fact-value.ltr,
body[data-look="live"] .detail-summary .asset,
body[data-look="live"] .quote-number,
body[data-look="live"] .ticket-price .quote-number,
body[data-look="live"] .quotebox .quote-number,
body[data-look="live"] .remaining,
body[data-look="live"] .ob-exact,
body[data-look="live"] .price-secondary .num-secondary,
body[data-look="live"] .mesghal-basis .mesghal-grams,
body[data-look="live"] .boardrow-price .num,
body[data-look="live"] .asset-tab,
body[data-look="live"] .opboard-gap,
body[data-look="live"] .build-chip .build-label,
body[data-look="live"] .nonbinding { font-family: inherit; font-variant-numeric: tabular-nums; }
body[data-look="live"] .boardbtn .price-secondary,
body[data-look="live"] .boardbtn .price-per { color: rgba(255, 255, 255, 0.88); }
body[data-look="live"][data-shell="customer"] .boardbtn:not(.buy):not(.sell) .price-secondary { color: var(--text-muted); }
/* --- headings (spec §2.1, §2.2; review 2026-11-06): ONE heading on the customer's «قیمت‌ها» (the board's own h3 is not
   shown; its last-update line stays), and «تنظیمات» carries no eyebrow above its tabs --- */
body[data-look="live"][data-shell="customer"] #view-trade .board-head h3 { display: none; }
body[data-look="live"] #view-config .cfg-group-head { display: none; }
/* --- final review 2026-11-07 (spec §1.1: one look per control) ---
   every fold says it opens: the same «‹» that turns as the technical folds (a flex summary has no marker of its own) */
body[data-look="live"] .fold > summary { list-style: none; }
body[data-look="live"] .fold > summary::-webkit-details-marker { display: none; }
body[data-look="live"] .fold > summary::after {
  content: "‹"; display: inline-block; margin-inline-start: 0.5rem; transition: transform 0.15s; color: var(--text-muted);
  font-weight: 400;
}
body[data-look="live"] .fold[open] > summary::after { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { body[data-look="live"] .fold > summary::after { transition: none; } }
/* radios and checkboxes in the palette, not the browser's blue; the search field's clear «×» in grey */
input[type="radio"], input[type="checkbox"] { accent-color: var(--green-800); }
body[data-shell="customer"] input[type="radio"], body[data-shell="customer"] input[type="checkbox"] { accent-color: var(--gold); }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.6); cursor: pointer; }
/* a highlighted phone card (a registration waiting for review, a request just decided) is painted as ONE surface */
@media (max-width: 47.99rem) {
  body .data-table:not(.keep-table) tr.just-decided,
  body .data-table.ob-table:not(.keep-table) tr[data-state="submitted"] { background: var(--warn-bg); }
  body[data-look] .data-table.req-table:not(.keep-table) tr.just-decided td,
  body .data-table:not(.keep-table) tr.just-decided td,
  body .data-table.ob-table:not(.keep-table) tr[data-state="submitted"] td { background: transparent; }
}
/* ===== UR-20261106 WP-0 foundation: end ===== */

/* ===== UR-20261106 slots (spec §7.2). Each area package puts its NEW rules only between its own two markers. ===== */
/* ===== UR-20261106 slot WP-1 customer: begin ===== */
/* --- headings (spec §5.B.3, §5.B.6): the page title with its quiet companion beside it -- «به‌روزرسانی: …» on
   «قیمت‌ها», the market chip on «خانه»; the board's own heading row is not shown in the live customer look --- */
#view-trade .page-title-line, #view-home .page-title-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem;
}
#view-trade .page-title-line .board-updated { white-space: nowrap; }
#view-home .home-market { display: inline-flex; align-self: center; }
body[data-look="live"][data-shell="customer"] #view-trade .board-head { display: none; }
body[data-look="live"][data-shell="customer"] #view-trade #trade-board { margin-top: 0.4rem; }

/* --- the board (spec §5.B.3, SC-30): whole figures; R43 (ADR-0064): a card per product, the product named once in the
   card's head (the live card rules stand in the R26 slot, block 40) --- */
#trade-board .board-title .board-term:only-child { font-size: 0.92rem; font-weight: 600; color: var(--text); }
body[data-look="live"] .boardbtn .num,
body[data-look="live"] .boardbtn .price-mesghal,
body[data-look="live"] .boardbtn .price-secondary,
body[data-look="live"] .boardbtn .num-secondary { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.boardbtn .board-action { font-size: 0.84rem; }
/* a closed market (spec §5.B.4, SC-31): the prices stay readable, the buttons go quiet and say «بسته» */
.board-closed .boardbtn { filter: saturate(0.25); opacity: 0.8; }
.board-closed .boardbtn[aria-disabled="true"] { cursor: not-allowed; }
.board-closed .boardbtn.flash { animation: none; }

/* --- the ticket (spec §5.B.5, SC-32): the action and the term under the title, the quantity right after the price
   with its unit beside it and the allowed range under it, the estimate's figures on one line --- */
#trade-ticket-context {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin-bottom: 0.6rem;
  font-size: 0.9rem; color: var(--text-muted);
}
.ticket-form .qty-wrap {
  display: flex; align-items: stretch; min-height: 48px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); overflow: hidden;
}
.ticket-form .qty-wrap:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.ticket-form .qty-wrap input[type="text"] {
  flex: 1 1 auto; min-width: 0; width: auto; border: 0; border-radius: 0; background: transparent; outline: none;
}
.ticket-form .qty-wrap input[type="text"]:focus-visible { outline: none; }
.ticket-form .qty-unit {
  display: flex; align-items: center; padding-inline: 0.85rem; white-space: nowrap; font-size: 0.92rem;
  color: var(--text-muted); background: var(--surface-2); border-inline-start: 1px solid var(--line);
}
.ticket-form .qty-limits { font-size: 0.84rem; color: var(--text-muted); }
#trade-preview .kv-value, #trade-preview .kv-value .num { white-space: nowrap; }
#trade-preview h4 { margin-bottom: 0.2rem; }
/* the ticket is an overlay: its facts are a two-column list, read from the start (spec §1.7) */
.ticket-form > .kvlist .kv { display: grid; grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr); gap: 0.75rem; }
.ticket-form > .kvlist .kv-value { text-align: start; }
.ticket-price .quote-meta { align-items: baseline; }
.ticket-price .quote-meta .ltr { align-self: baseline; }

/* --- the waiting screen (spec §5.B.1 - 2, W06, SC-28, SC-29): the result circle, the request in one line, one short
   paragraph with its «؟» --- */
.wait-result {
  align-self: center; width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; border: 3px solid currentColor;
}
.wait-result svg { width: 38px; height: 38px; stroke-width: 2.4; }
.wait-result.good { color: var(--ok-ink); background: var(--ok-bg); }
.wait-result.bad { color: var(--bad-ink); background: var(--danger-soft); }
.wait-result.neutral { color: var(--text-muted); background: var(--surface-2); }
.wait-summary {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.3rem 0.65rem;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center;
}
.wait-summary .chip { white-space: nowrap; }
.wait-summary-asset { font-weight: 700; }
.wait-summary-figure { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wait-summary-figure .num { font-weight: 700; }
.wait-card .kv-value { font-variant-numeric: tabular-nums; }
.wait-card .wait-status > p { text-align: center; }
.wait-card .wait-note { text-align: start; line-height: 1.7; }
.wait-card .wait-note .help { vertical-align: middle; }

/* --- «خانه» (spec §5.B.6, SC-33): three figures in a row on a desk; on a phone the first spans the row --- */
.home-block-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; min-width: 0; }
.home-excerpt .block-head.spread { gap: 0.4rem 0.8rem; flex-wrap: wrap; }
@media (max-width: 47.99rem) {
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statgrid > .stat-tile:first-child { grid-column: 1 / -1; }
}

/* --- «درخواست‌ها» (spec §5.B.7, SC-34): filters with their counts; a compact bar on a desk, a 2 x 2 grid on a phone
   (every rule here names this page's own bar: the other packages' .filterbar rows keep their own wrapping) --- */
#requests-filter button { white-space: nowrap; }
#requests-filter .filter-count { font-variant-numeric: tabular-nums; opacity: 0.85; }
@media (min-width: 48rem) {
  #requests-filter.filterbar { display: inline-flex; }
  #requests-filter.filterbar[hidden] { display: none; }
}
@media (max-width: 47.99rem) {
  #requests-filter.filterbar {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-strong);
  }
  #requests-filter.filterbar[hidden] { display: none; }
}

/* --- «دارایی‌ها» (spec §5.B.8, SC-35): tiles, the cash estimate first --- */
.holding-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-bottom: 0.6rem; }
.holding-tile {
  display: grid; gap: 0.25rem; align-content: start; min-width: 0; padding: 0.85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.holding-name { font-size: 0.86rem; color: var(--text-muted); }
.holding-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.holding-value .num { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: baseline; }
.holding-unit { font-size: 0.86rem; color: var(--text-muted); white-space: nowrap; }
.holding-note { margin: 0; }
@media (max-width: 47.99rem) {
  .holding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .holding-cash, .holding-grid > .holding-tile:nth-child(even):last-child { grid-column: 1 / -1; }   /* no orphan */
}

/* --- «پروفایل» (spec §5.B.9, SC-36): one card, a switch for the price sound, a quiet sign-out -- every rule under
   #profile-body, so the staff profile's .profile-* family and any other switch keep their own look --- */
#profile-body .profile-card { max-width: 40rem; }
#profile-body .profile-card .kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.75rem; text-align: start; }
#profile-body .profile-card .kv-value { text-align: start; }
#profile-body .profile-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--line);
}
#profile-body .profile-switch-text { display: grid; gap: 0.15rem; min-width: 0; }
#profile-body .profile-switch-label { font-weight: 700; }
#profile-body .profile-switch-hint { font-size: 0.86rem; color: var(--text-muted); }
#profile-body button.switch {
  flex: 0 0 auto; width: 56px; min-height: 44px; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
}
#profile-body button.switch .switch-track {
  position: relative; display: block; width: 44px; height: 26px; border-radius: var(--radius-pill);
  background: var(--line-strong); transition: background 0.15s;
}
#profile-body button.switch .switch-thumb {
  position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: inset-inline-start 0.15s;
}
#profile-body button.switch[aria-checked="true"] .switch-track { background: var(--gold); }
#profile-body button.switch[aria-checked="true"] .switch-thumb { inset-inline-start: 21px; }
/* integration 2026-11-07: this switch draws its own thumb, so the board switch's knob (WP-3's .switch-track::after) is
   not drawn a second time here */
#profile-body button.switch .switch-track::after { content: none; }
#profile-body button.switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: var(--radius-pill); }
#profile-body .profile-actions { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
@media (prefers-reduced-motion: reduce) { #profile-body button.switch .switch-track, #profile-body button.switch .switch-thumb { transition: none; } }
/* --- final review 2026-11-07: the waiting screen's figures take their own line under the product, the quantity and
   the amount apart by a quiet «·»; the request number the customer reads out to staff is body-size, not a small
   monospace chip; on a phone the ticket's facts put the name above the value --- */
.wait-summary-figures {
  flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.2rem 0.5rem;
}
.wait-summary-sep { color: var(--text-muted); }
.wait-card .idchip { font-size: 0.9rem; font-family: inherit; font-variant-numeric: tabular-nums; }
@media (max-width: 30rem) {
  .ticket-form > .kvlist .kv { grid-template-columns: 1fr; gap: 0.1rem; }
  .ticket-form > .kvlist .kv-name { color: var(--text-muted); font-size: 0.86rem; }
}
/* ===== UR-20261106 slot WP-1 customer: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261106 slot WP-2 requests: begin ===== */
/* WP-2 (spec §5.C, §3.5 rows 1-4 and 6, §6 «کارتابل» / request overlays): the queue, its search and its decisions, the
   request overlay for staff and for a customer, the countdown. Presentation only: no rule here hides a decision a
   person may take, a refusal or a financial qualifier. */

/* --- «کارتابل»: the heading with «فقط مشاهده», the search row, the result banner, the section titles --- */
body[data-look="live"] #view-queue .page-head > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.queue-readonly[hidden] { display: none; }
body[data-look="live"] .queue-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; width: 100%;
  margin: 0 0 0.75rem; padding: 0;
}
body[data-look="live"] .queue-toolbar[hidden] { display: none; }
body[data-look="live"] .queue-toolbar label { font-size: 0.9rem; color: var(--text-muted); white-space: nowrap; }
body[data-look="live"] .queue-toolbar input { flex: 1 1 14rem; max-width: 24rem; min-height: 44px; }
/* integration 2026-11-07: a search field is not an input[type="text"], so it takes the same field look here as the
   customers' and users' search fields */
body[data-look="live"] .queue-toolbar input[type="search"] {
  font: inherit; font-size: max(16px, 1rem); padding: 0.5rem 0.7rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: inherit; min-width: 0; box-sizing: border-box;
}
/* an empty search box reads right to left (its placeholder is Persian); a typed number turns it left to right */
body[data-look="live"] .queue-toolbar input:placeholder-shown { direction: rtl; }
body[data-look="live"] .queue-toolbar button { white-space: nowrap; }
.queue-outcome { display: grid; gap: 0.5rem; margin: 0 0 0.75rem; }
.queue-outcome[hidden] { display: none; }
.queue-outcome-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  padding: 0.55rem 0.85rem; border: 1px solid var(--line); border-inline-start: 4px solid var(--buy);
  border-radius: var(--radius-sm); background: var(--surface);
}
.queue-outcome-line.bad { border-inline-start-color: var(--sell); }
/* a rejection that was recorded (or a request that ended) is an ended fact, not a refusal: neutral, as its chip */
.queue-outcome-line.neutral { border-inline-start-color: var(--text-muted); }
.queue-outcome-line.warn { border-inline-start-color: var(--warn-line); background: var(--warn-bg); }
.queue-outcome-line:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.queue-outcome-line .queue-outcome-text { font-weight: 700; }
.queue-outcome-line .queue-outcome-why { color: var(--text-muted); font-size: 0.9rem; }
.queue-outcome-line .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-inline-start: auto; }
.queue-outcome-line .refusal-tech { flex-basis: 100%; }
body[data-look="live"] #view-queue .list-section { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1rem 0 0.4rem; }
body[data-look="live"] #view-queue .list-section:first-child { margin-top: 0.25rem; }
body[data-look="live"] #view-queue .empty-state .fact-note { flex-basis: 100%; margin: -0.4rem 0 0; }
.queue-more { margin: 0 0 1rem; }

/* --- the request tables: the open button (side chip above the product, the number under it), figures and times --- */
body[data-look="live"] .data-table.req-table .row-open.reqrow-open { flex-direction: column; flex-wrap: nowrap; gap: 0.2rem; }
body[data-look="live"] .data-table.req-table .reqrow-open .chip { font-size: 0.78rem; }
body[data-look="live"] .data-table.req-table .reqrow-open .cell-sub { font-size: 0.8rem; }
body[data-look="live"] .data-table.req-table .req-figure { white-space: nowrap; }
@media (min-width: 48rem) { body[data-look="live"] .data-table.req-table .cell-unit { display: none; } }
body[data-look="live"] .data-table.req-table .reqcard-net { font-weight: 700; }
body[data-look="live"] .data-table.req-table .reqcard-mesghal { display: block; white-space: nowrap; color: var(--text-muted); font-size: 0.8rem; }
body[data-look="live"] .data-table.req-table .reqcard-when bdi { display: block; white-space: nowrap; }
body[data-look="live"] .data-table.req-table .reqcard-when .cell-time { color: var(--text-muted); font-size: 0.86rem; }
body[data-look="live"] .data-table.req-table .reqcard-state { max-width: none; }
/* the decided list's «تصمیم»: the date and time on one line where the column allows, who decided under them */
body[data-look="live"] .data-table.req-table .reqcard-decided .cell-time { color: var(--text-muted); }
body[data-look="live"] .data-table.req-table .reqcard-decided .reqcard-decider { margin-top: 0.15rem; font-size: 0.86rem; }
body[data-look="live"] .data-table.req-table td.col-actions > .reqrow-actions { margin: 0; flex-direction: row; }
body[data-look="live"] .data-table.req-table button.inline-accept {
  min-width: 5.5rem; background: var(--buy-deep); border-color: var(--buy-deep); color: #fff; font-weight: 600;
}
body[data-look="live"] .data-table.req-table button.inline-reject {
  min-width: 4.5rem; background: transparent; border-color: var(--sell-deep); color: var(--sell-deep); font-weight: 600;
}
body[data-look="live"][data-shell="customer"] .data-table.req-table button.inline-reject { color: #f2a396; border-color: #f2a396; }
body[data-look="live"] .data-table.req-table button[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--focus); }
/* a closed request reads quieter; the highlight of the row a decision just moved fades out */
body[data-look="live"] .data-table.req-table tr.row-quiet td.col-num { opacity: 1; }
body[data-look="live"] .data-table.req-table tr.row-quiet td.col-num > * { opacity: 0.6; }
body[data-look="live"] .data-table.req-table tr.just-decided td { background: var(--warn-bg); }

/* --- the queue's confirmation: ONE line under its request, as wide as the table, never widening a column --- */
body[data-look="live"] .data-table tr.req-inline-row td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); }
body[data-look="live"] .inline-confirm.inline-confirm-line {
  contain: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  border: 0; border-inline-start: 4px solid var(--gold); border-radius: 0; padding: 0.2rem 0.75rem; background: transparent;
  text-align: start;
}
body[data-look="live"] .inline-confirm-line .inline-question { font-weight: 700; white-space: nowrap; }
body[data-look="live"] .inline-confirm-line .inline-summary { color: var(--text); }
/* a part of the summary (and of an overlay value: «کالا», «تحویل», a date with its time) is one run: it moves to the
   next line whole, and wraps inside itself only when it is longer than a whole line (review 2026-11-06) */
body[data-look="live"] .inline-confirm-line .inline-summary .nowrap,
body[data-look="live"] #view-detail .nowrap { display: inline-block; max-width: 100%; }
body[data-look="live"] .inline-confirm-line .inline-id { color: var(--text-muted); }
body[data-look="live"] .inline-confirm-line .inline-note { color: var(--text-muted); font-size: 0.86rem; }
body[data-look="live"] .inline-confirm-line .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; margin-inline-start: auto; }
body[data-look="live"] .inline-confirm-line .actions button { white-space: nowrap; }
body[data-look="live"] .inline-confirm-line .outcome { flex-basis: 100%; margin: 0; }

/* --- the countdown: «14:46 مانده»; the last two minutes in the warning tones --- */
body[data-look="live"] .chip.remaining-chip {
  background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body[data-look="live"] .chip.remaining-chip[data-urgent] { background: var(--danger-soft); border-color: var(--danger); color: var(--bad-ink); }
body[data-look="live"] .chip.remaining-chip .remaining { font-family: inherit; font-weight: 700; }
.chip.expiry-chip { font-size: 0.75rem; }

/* --- the request overlay (live look): a staff overlay is a reading width, a customer's narrower (spec §1.7) --- */
body[data-look="live"] main > #view-detail.overlay { width: min(48rem, calc(100vw - 1.5rem)); }
body[data-look="live"][data-shell="customer"] main > #view-detail.overlay { width: min(40rem, calc(100vw - 1.5rem)); }
body[data-look="live"] #view-detail [data-byid],
body[data-look="live"] #view-detail #btn-load-detail,
body[data-look="live"] #view-detail .price-hero,
body[data-look="live"] #view-detail .detail-facts-block,
body[data-look="live"] #view-detail .axes-block > .block-head,
body[data-look="live"] #view-detail .decision > .block-head { display: none !important; }
body[data-look="live"] #view-detail .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
body[data-look="live"] #view-detail .detail-grid .block {
  border: 0; box-shadow: none; background: transparent; padding: 0; margin: 0;
}
body[data-look="live"] #view-detail .block-head h3 { font-size: 1rem; margin: 0 0 0.5rem; }
body[data-look="live"] #view-detail .detail-summary { gap: 0.4rem 0.6rem; margin: -0.2rem 0 1rem; }
body[data-look="live"] #view-detail .detail-product { font-size: 1.1rem; font-weight: 700; }
body[data-look="live"] #view-detail .detail-number { color: var(--text-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
/* facts as name | value lines, without a box each */
body[data-look="live"] #view-detail .detail-kv { display: grid; gap: 0.55rem; font-size: 1rem; }
body[data-look="live"] #view-detail .detail-kv .kv,
body[data-look="live"] #view-detail .amount-parts .kv { border: 0; padding: 0; }
body[data-look="live"] #view-detail .detail-kv .kv-value { font-weight: 600; overflow-wrap: break-word; }
body[data-look="live"] #view-detail .detail-kv .kv-name { color: var(--text-muted); }
body[data-look="live"] #view-detail .kv-note { display: block; font-size: 0.84rem; font-weight: 400; color: var(--text-muted); }
body[data-look="live"] #view-detail .detail-price .num,
body[data-look="live"] #view-detail .detail-board-now .num { font-weight: 700; }
body[data-look="live"] #view-detail .detail-board-now { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
/* the amount: on a staff overlay one strong line of the list; on a customer's, the card the overlay leads with */
body[data-look="live"] #view-detail .detail-amount { margin-top: 0.6rem; display: grid; gap: 0.35rem; }
body[data-look="live"] #view-detail .detail-amount:empty { display: none; }
body[data-look="live"] #view-detail .amount-hero {
  display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); gap: 0.75rem; align-items: baseline;
  padding-top: 0.6rem; border-top: 1px solid var(--line);
}
body[data-look="live"] #view-detail .amount-hero-name { color: var(--text-muted); }
body[data-look="live"] #view-detail .amount-hero-value { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
body[data-look="live"] #view-detail .amount-parts { display: grid; gap: 0.3rem; font-size: 0.92rem; }
body[data-look="live"] #view-detail .detail-amount .fact-note { margin: 0; }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-overview { display: flex; flex-direction: column; }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-amount { order: -1; margin: 0 0 1rem; }
body[data-look="live"] #view-detail[data-reader="customer"] .amount-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
body[data-look="live"] #view-detail[data-reader="customer"] .amount-hero-value { font-size: 1.6rem; font-weight: 800; }
body[data-look="live"][data-shell="customer"] #view-detail .amount-hero-value { color: var(--gold-soft, var(--gold)); }
/* a request that was not carried out: its amount is quiet -- nothing is paid or received */
body[data-look="live"] #view-detail .amount-hero.closed .amount-hero-value { color: var(--text-muted); font-weight: 700; }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1.5rem; }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv .kv {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.1rem; text-align: start;
}
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv .kv-name,
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv .kv-value { text-align: start; }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv .kv-name { font-size: 0.86rem; }
@media (max-width: 30rem) {
  body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv { grid-template-columns: minmax(0, 1fr); }
}
/* the three facts (INV-060), each one line of the same list */
body[data-look="live"] #view-detail .axes-lines .axes {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.55rem; padding-top: 0.6rem; border-top: 1px solid var(--line);
}
body[data-look="live"] #view-detail .axes-lines .axis {
  display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); gap: 0.75rem; align-items: baseline;
  border: 0; border-radius: 0; padding: 0; background: transparent;
}
body[data-look="live"] #view-detail .axes-lines .axis[hidden] { display: none; }
body[data-look="live"] #view-detail .axes-lines .axis h4 { margin: 0; font-size: inherit; font-weight: 400; color: var(--text-muted); }
body[data-look="live"] #view-detail .axes-lines .axis-state,
body[data-look="live"] #view-detail .axes-lines #axis-approval .axis-state { display: inline; font-size: 1rem; font-weight: 600; }
body[data-look="live"] #view-detail .axes-lines .axis-said { display: block; color: var(--text-muted); font-size: 0.9rem; }
body[data-look="live"] #view-detail .axes-lines .axis-line { gap: 0.3rem 0.5rem; }
@media (max-width: 47.99rem) {
  body[data-look="live"] #view-detail .axes-lines .axis { grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr); }
  /* the amount keeps its whole width and the name wraps beside it («مبلغ پرداختی به مشتری (انجام نشد)» once pushed
     the figure past the overlay's edge; review 2026-11-06) */
  body[data-look="live"] #view-detail .amount-hero { grid-template-columns: minmax(0, 1fr) auto; }
}
/* the decision bar: sticky at the overlay's foot while the request waits (spec §1.7); hidden once there is nothing
   to decide and no result to show */
body[data-look="live"] #view-detail .decision.decision-bar {
  position: sticky; bottom: 0; z-index: 3; margin: 0; padding: 0.7rem 0 0.2rem;
  background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 12px -10px rgba(0, 0, 0, 0.25);
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
body[data-look="live"] #view-detail .decision.decision-bar.is-idle { display: none !important; }
body[data-look="live"] #view-detail .decision-actions { display: flex; gap: 0.5rem; margin: 0; flex: 1 1 16rem; }
body[data-look="live"] #view-detail .decision-actions button { flex: 1 1 0; min-height: 48px; font-size: 1rem; }
body[data-look="live"] #view-detail .decision-actions button[hidden] { display: none; }
body[data-look="live"] #view-detail #btn-reject { background: transparent; border-color: var(--sell-deep); color: var(--sell-deep); }
body[data-look="live"] #view-detail #decision-outcome { flex-basis: 100%; margin: 0; }
body[data-look="live"] #view-detail #decision-outcome .detail-outcome-line { margin: 0; }
body[data-look="live"] #view-detail #decision-outcome .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* «جزئیات بیشتر»: closed by default; the number, the times, the integration and the audit */
body[data-look="live"] #view-detail .detail-more { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0.2rem 0 0; }
body[data-look="live"] #view-detail .detail-more[hidden] { display: none; }
body[data-look="live"] #view-detail .detail-more > summary { color: var(--text-muted); }
body[data-look="live"] #view-detail .detail-more[open] > summary { margin-bottom: 0.4rem; }
body[data-look="live"] #view-detail .detail-more > .block { margin-top: 1rem; }
body[data-look="live"] #view-detail .detail-more .facts { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
body[data-look="live"] #view-detail .detail-more .fact {
  display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); gap: 0.75rem; align-items: baseline;
  border: 0; padding: 0; background: transparent;
}
body[data-look="live"] #view-detail .detail-more .fact-name { font-size: inherit; font-weight: 400; }
body[data-look="live"] #view-detail .detail-more .messages { margin-top: 0.4rem; }
body[data-look="live"] #view-detail .audit-block h3 { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .queue-toolbar label { flex-basis: 100%; }
  body[data-look="live"] .queue-toolbar input { flex: 1 1 8rem; max-width: none; }
  /* WP-0's actions width (1% of a table cell) would squeeze a phone card's buttons: a card's actions are a full row */
  body[data-look="live"] .data-table.req-table td.col-actions { width: auto; }
  body[data-look="live"] .queue-outcome-line .actions { margin-inline-start: 0; width: 100%; }
  body[data-look="live"] .queue-outcome-line .actions button { flex: 1 1 0; min-height: 48px; }
  body[data-look="live"] .data-table.req-table .row-open.reqrow-open { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
  body[data-look="live"] .data-table.req-table .reqrow-open .cell-sub { flex-basis: 100%; }
  body[data-look="live"] .data-table.req-table .reqcard-when bdi { display: inline; }
  body[data-look="live"] .data-table.req-table .reqcard-mesghal { display: inline; margin-inline-start: 0.4rem; }
  body[data-look="live"] .inline-confirm.inline-confirm-line { padding-inline: 0.2rem; border-inline-start-width: 3px; }
  body[data-look="live"] .inline-confirm-line .actions { width: 100%; margin-inline-start: 0; }
  body[data-look="live"] .inline-confirm-line .actions button { flex: 1 1 0; min-height: 48px; }
  /* a long fact name («وضعیت هماهنگی (بدون ثبت در حسابداری)») wraps in its own 40%; the value keeps the rest, so no
     word of it is cut (review 2026-11-06) */
  body[data-look="live"] #view-detail .detail-more .fact { grid-template-columns: minmax(6.5rem, 40%) minmax(0, 1fr); }
}
/* ===== UR-20261106 slot WP-2 requests: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261106 slot WP-3 pricing and settings: begin ===== */
/* The pricing board (قیمت‌گذاری) and the settings (تنظیمات), spec §5.D. Presentation only: no rule here hides an
   authorized control, a refusal or a financial qualifier. */

/* --- the switch (spec §1.4; DC-26, DC-28, DC-30): a small track and its words; the whole button is the target --- */
button.switch {
  min-height: 44px; padding: 0.3rem 0.75rem; gap: 0.5rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); background: var(--surface); color: var(--text);
  font-size: 0.86rem; font-weight: 600; white-space: nowrap;
}
.switch-track {
  position: relative; flex: 0 0 auto; width: 2.1rem; height: 1.2rem; border-radius: var(--radius-pill);
  background: var(--line-strong); transition: background 0.15s;
}
.switch-track::after {
  content: ""; position: absolute; inset-block-start: 0.15rem; inset-inline-start: 0.15rem;
  width: 0.9rem; height: 0.9rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: inset-inline-start 0.15s;
}
button.switch[aria-checked="true"] .switch-track { background: var(--ok); }
button.switch[aria-checked="true"] .switch-track::after { inset-inline-start: 1.05rem; }
button.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.switch.sidegate { min-height: 40px; padding: 0.15rem 0.6rem; font-size: 0.82rem; }
button.switch.sidegate[aria-checked="false"] { background: var(--surface-2); }

/* --- the board's toolbar: the market (a chip, then its own button; closing asks inline), the step with its caption,
   and the switches (spec §5.D.1, §5.D.5, §5.D.7) --- */
#board-controls.board-controls { gap: 0.6rem 1.25rem; align-items: center; }
.board-market { display: flex; align-items: center; gap: 0.6rem; }
.board-market .chip { font-size: 0.86rem; }
.board-controls .inline-confirm.board-confirm { flex: 1 1 100%; max-width: 34rem; }
.inline-confirm.board-confirm p, .inline-confirm.cfg-confirm p { margin: 0; font-weight: 600; }
.inline-confirm.board-confirm .create-actions, .inline-confirm.cfg-confirm .create-actions { margin-top: 0.2rem; }
.board-step { flex-wrap: wrap; gap: 0.5rem; }
.board-step .board-caption { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.board-step-note { font-size: 0.84rem; color: var(--text-muted); }
.board-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.board-switches .chip { white-space: nowrap; }

/* --- the board's rows: a product group, then one row per delivery term (spec §5.D.6 - §5.D.8) --- */
.opboard-head .opboard-col { display: inline-flex; align-items: center; justify-content: center; gap: 0.15rem; }
.opboard-head { font-size: 0.85rem; font-weight: 600; }
.opboard-head .help { margin-block: -0.6rem; }
.opboard-asset-name strong { font-size: 1rem; }
.opboard-asset .board-term { font-size: 0.84rem; color: var(--text-muted); }
.opboard-asset .visstate { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.86rem; color: var(--text-muted); }
.board-termname { font-size: 0.95rem; font-weight: 700; white-space: nowrap; }
.board-titletext { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.3rem; }
.pricecell .stepper input { font-weight: 600; padding-inline: 0.35rem; }
.opboard-gap input { font-weight: 600; padding-inline: 0.35rem; }
.opboard-gap-side { display: none; }
.switch-side { display: none; font-weight: 700; }
.side-closed { gap: 0.3rem; }
button.chipbtn {
  min-height: 36px; padding: 0.1rem 0.75rem; border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
button.chipbtn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--green-950); }
.opboard-draftbar {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem;
  padding: 0.5rem 0.7rem; border: 1px solid var(--warn-line); border-radius: var(--radius-sm); background: var(--warn-bg);
}
.opboard-draftbar .opboard-draftnote { flex: 1 1 20rem; }
.opboard-guard { flex: 1 1 100%; margin: 0; font-weight: 700; color: var(--bad-ink); }
.opboard-draftacts { margin-inline-start: auto; }
.opboard-draftacts button { white-space: nowrap; }

/* a desk: the title and difference cells lay their parts out in the row -- the term in the middle column; each side's
   switch, and «ورود دستی», on a short second line under its own column */
@media (min-width: 48rem) {
  .opboard-row:not(.opboard-head) {
    grid-template-areas: "bid title gap ask" "gbid . gman gask" ". . gnote ." "bar bar bar bar"; row-gap: 0;
  }
  .opboard-row:not(.opboard-head) > .pricecell.sell { grid-area: bid; }
  .opboard-row:not(.opboard-head) > .pricecell.buy { grid-area: ask; }
  .opboard-row:not(.opboard-head) > .board-title,
  .opboard-row:not(.opboard-head) > .opboard-gap { display: contents; }
  .opboard-row:not(.opboard-head) .board-titletext { grid-area: title; justify-self: center; text-align: center; }
  .opboard-row:not(.opboard-head) .gapline { grid-area: gap; }
  .opboard-row:not(.opboard-head) .manualbtn { grid-area: gman; justify-self: center; margin-top: 0.35rem; }
  .opboard-row:not(.opboard-head) .opboard-gap > .fact-note { grid-area: gnote; margin-top: 0.2rem; text-align: center; }
  .opboard-row:not(.opboard-head) .gate-bid { grid-area: gbid; justify-self: center; margin-top: 0.35rem; }
  .opboard-row:not(.opboard-head) .gate-ask { grid-area: gask; justify-self: center; margin-top: 0.35rem; }
  .opboard-row:not(.opboard-head) > .opboard-draftbar { grid-area: bar; margin-top: 0.5rem; }
  .opboard-row:not(.opboard-head) button.switch.sidegate { min-height: 36px; }
  .opboard-row:not(.opboard-head) .manualbtn { min-height: 36px; }
}

/* a phone: one compact card per delivery term -- the term with both side switches on one line, the buy price with its
   −/+, then the difference and the sell price (side by side while each figure shows whole: fits-two, boardFitsCut) */
@media (max-width: 47.99rem) {
  .opboard-row:not(.opboard-head) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.25rem 0.45rem; padding: 0.35rem 0.5rem;
    grid-template-areas: "title title" "bid bid" "gap gap" "ask ask" "bar bar";
  }
  .opboard-row > .board-title {
    grid-area: title; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0.3rem;
    text-align: start;
  }
  .opboard-row .board-titletext { flex: 1 1 auto; justify-content: flex-start; }
  .opboard-row .switch-side { display: inline; }
  .opboard-row .board-title button.switch.sidegate { min-height: 32px; padding: 0 0.3rem; gap: 0.25rem; font-size: 0.8rem; }
  .opboard-row .board-title .switch-track { width: 1.8rem; height: 1.05rem; }
  .opboard-row .board-title .switch-track::after { width: 0.75rem; height: 0.75rem; }
  .opboard-row .board-title button.switch[aria-checked="true"] .switch-track::after { inset-inline-start: 0.9rem; }
  .opboard-row > .pricecell.sell { grid-area: bid; }
  .opboard-row > .opboard-gap { grid-area: gap; }
  .opboard-row > .pricecell.buy { grid-area: ask; }
  .opboard-row > .opboard-draftbar { grid-area: bar; }
  .opboard-row > .pricecell { padding: 0.2rem 0.4rem; gap: 0.1rem; }
  .opboard-row > .pricecell > .pricecell-side { line-height: 1.25; }
  .opboard-row > .pricecell.sell > .fact-note { grid-column: 1 / -1; }
  .pricecell .stepper:not(.single) { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .pricecell .stepper:not(.single) input { grid-column: auto; order: 0; }
  .pricecell .stepper.single { grid-template-columns: minmax(0, 1fr); }
  .pricecell .stepper input { min-height: 40px; padding-block: 0.3rem; padding-inline: 0.25rem; }
  .pricecell .stepper .stepbtn { min-width: 40px; min-height: 40px; }
  .opboard-gap {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "word manual" "line line";
    align-items: center; gap: 0.15rem 0.4rem;
  }
  .opboard-gap .opboard-gap-side { display: block; grid-area: word; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-align: start; }
  .opboard-gap .manualbtn { grid-area: manual; min-height: 28px; padding-block: 0; }
  /* a phone field is read at 16px at least (spec §6); the difference keeps its whole figure in view */
  .opboard-gap input { min-height: 40px; font-size: max(16px, 1rem); padding-block: 0.3rem; padding-inline: 0.25rem; }
  .opboard-gap .gapline { grid-area: line; }
  .opboard-gap .fact-note { grid-column: 1 / -1; }
  .opboard-draftacts { margin-inline-start: 0; width: 100%; }
  .opboard-draftacts button { flex: 1 1 0; min-height: 44px; }
  /* the toolbar on a phone (review): the market, the step with its «؟», the caption close under it, and both switches
     on one line */
  #board-controls.board-controls { gap: 0.4rem 0.75rem; }
  .board-step { row-gap: 0.15rem; }
  .board-step .board-step-note { flex: 1 1 100%; }
  .board-switches { gap: 0.4rem; }
  .board-switches button.switch { min-height: 40px; padding-inline: 0.5rem; gap: 0.35rem; font-size: 0.8rem; }
  .board-switches .switch-track { width: 1.8rem; height: 1.05rem; }
  .board-switches .switch-track::after { width: 0.75rem; height: 0.75rem; }
  .board-switches button.switch[aria-checked="true"] .switch-track::after { inset-inline-start: 0.9rem; }
  /* a product's header: its name with the customer-visibility switch on one line, the unit and count under the name */
  .opboard-asset { flex-wrap: nowrap; padding: 0.35rem 0.6rem; }
  .opboard-asset-name { min-width: 0; }
  .opboard-asset-name .board-term { display: block; }
  .opboard-asset-name .board-term-sep { display: none; }
  .opboard-asset button.switch.visbtn { flex: 0 0 auto; min-height: 36px; padding-inline: 0.5rem; gap: 0.35rem; font-size: 0.8rem; }
}
@media (min-width: 22.5rem) and (max-width: 47.99rem) {
  /* side by side, the difference's −/+ are 36px wide (40px high) so its figure keeps its room; the sell price's label
     may wrap at its space rather than leave its card */
  .opboard-row.fits-two:not(.opboard-head) { grid-template-areas: "title title" "bid bid" "gap ask" "bar bar"; }
  .opboard-row.fits-two .gapline { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 0.2rem; }
  .opboard-row.fits-two .gapline .gapbtn { min-width: 36px; }
  .opboard-row.fits-two > .pricecell.buy { align-content: space-between; padding-inline: 0.3rem; }
  .opboard-row.fits-two > .pricecell.buy > .pricecell-side { white-space: normal; }
}
@media (min-width: 24rem) and (max-width: 47.99rem) { .pricecell .pricecell-side { white-space: nowrap; } }

/* --- settings: the tab row is one line that scrolls sideways on a phone (spec §2.4, DC-32) --- */
body[data-look="live"] .cfg-tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
body[data-look="live"] .cfg-tabs::-webkit-scrollbar { display: none; }
body[data-look="live"] .cfg-tabs > button { flex: 1 0 auto; white-space: nowrap; }
@media (min-width: 48rem) { body[data-look="live"] .cfg-tabs > button { flex: 1 1 auto; } }
.cfg-hint { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.cfg-tab-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
/* only this area's folds (review: an unscoped rule restyled the «درباره» version fold); :where keeps the weight of a
   plain .fold, so a fold's own rule below (a term's «ویرایش») still wins */
:where(#view-config, .cfg-asset-sheet, #cfg-calendar-panel) .fold {
  border-style: solid; border-color: var(--line); background: var(--surface);
}

/* «بازار و مهلت» (spec §5.D.10, DC-33) */
.cfg-timeout-grid { grid-template-columns: minmax(0, 16rem) auto; justify-content: start; align-items: center; }
.cfg-timeout-help { font-size: 0.86rem; color: var(--text-muted); min-height: 1.4em; }
.cfg-market-state {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem;
  margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line);
}
.cfg-market-word { font-weight: 600; }
button.cfg-link { padding-inline: 0.35rem; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 30rem) { .cfg-timeout-grid { grid-template-columns: minmax(0, 1fr); } }

/* «مبلغ و کارمزد» (spec §5.D.11, DC-34): two groups of three, one column on a phone; the note in view */
.cfg-money-note { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--text-muted); }
.cfg-money-sets { display: grid; gap: 0.9rem; }
.cfg-set { margin: 0; min-width: 0; padding: 0.5rem 0.9rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cfg-set > legend { padding: 0 0.35rem; font-size: 0.95rem; font-weight: 700; }
.cfg-grid.cfg-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cfg-money-actions { margin-top: 0.9rem; }
@media (max-width: 47.99rem) { .cfg-grid.cfg-grid3 { grid-template-columns: minmax(0, 1fr); } }
.cfg-grid > .cfg-confirm { grid-column: 1 / -1; }

/* «کالاها» (spec §3.5 row 16, DC-35) and the product sheet (spec §5.D.12, DC-36 - DC-38) */
.data-table.cfg-asset-list td.col-primary { min-width: 12rem; }
body[data-look="live"] .cfg-version { display: none; }
@media (min-width: 48rem) {
  body[data-look="live"] .cfg-asset-sheet.overlay { width: min(62rem, calc(100vw - 1.5rem)); }
}
.cfg-sheet-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; margin: 0; }
.cfg-sheet-title .idchip { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); background: none; border: 0; padding: 0; }
.cfg-sheet-block { display: grid; gap: 0.6rem; }
.cfg-sheet-block > .cfg-grid { margin-bottom: 0.2rem; }
.cfg-sheet-section { margin: 0.6rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 1rem; }
.cfg-sheet-block > .cfg-sheet-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.cfg-switches { margin: 0; gap: 0.5rem; }
.cfg-missing { margin: 0; font-size: 0.88rem; color: var(--warn-ink); }
.cfg-sheet-block .cfg-term { margin-top: 0.2rem; padding-top: 0.6rem; }
.cfg-term-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; margin: 0; font-size: 0.95rem; }
.cfg-term-name .idchip { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); background: none; border: 0; padding: 0; }
.cfg-term-rule { margin: 0.15rem 0 0.2rem; font-size: 0.86rem; color: var(--text-muted); }
.data-table.cfg-term-table td.col-primary { min-width: 0; }
.data-table.cfg-term-table td.cfg-limit input { width: 7.5rem; max-width: 100%; text-align: center; }
/* a delivery term's editor: room for a whole name in each field; its buttons on their own line (review) */
.cfg-grid.cfg-term-form { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.cfg-grid.cfg-term-form > .cfg-term-acts { grid-column: 1 / -1; margin: 0; }
.data-table.cfg-term-table .row-actions { justify-content: center; }
.cfg-danger { margin-top: 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--danger-soft); border-radius: var(--radius-sm); display: grid; gap: 0.5rem; justify-items: start; }
.cfg-danger .inline-confirm { justify-self: stretch; }
.cfg-new-asset { display: grid; gap: 0.6rem; }
.cfg-new-asset .create-actions { margin-top: 0.2rem; }
.cfg-new-asset .block-head { margin: 0; }
/* inside an overlay the sections sit on the overlay itself -- no card inside the card (spec §1.7) */
.cfg-asset-sheet .cfg-sheet-block,
#cfg-calendar-panel .cfg-calendar-editor { border: 0; box-shadow: none; background: transparent; padding: 0; margin: 0; }
.data-table tr.cfg-scope { background: none; border: 0; }
.cfg-term > .fold { border: 0; background: none; padding: 0; margin-top: 0.3rem; }
.cfg-term > .fold > summary {
  display: inline-flex; width: fit-content; min-height: 40px; padding: 0.2rem 0.85rem; list-style: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.86rem;
}
.cfg-term > .fold > summary::-webkit-details-marker { display: none; }
.cfg-term > .fold[open] > summary { margin-bottom: 0.5rem; }
@media (max-width: 47.99rem) {
  .data-table.cfg-term-table td.cfg-limit input { width: 100%; }
  /* a dense table's 40px row height is for the desk table; a phone card grows with its content */
  .data-table.cfg-term-table tbody td, .data-table.cfg-asset-list tbody td,
  .data-table.cfg-calendar-list tbody td { height: auto; padding: 0.1rem 0; }
  /* a product's card starts its name and code at the line's start (spec §3.1.10) */
  .data-table.cfg-asset-list .row-open.has-sub { align-items: flex-start; text-align: start; }
  /* the shared ".data-table td.col-actions:has(> .row-actions) { width: 1% }" (a desk rule) outranks the card's width:auto */
  .data-table.cfg-term-table td.col-actions:has(> .row-actions) { width: auto; }
  .data-table.cfg-term-table td.col-actions .row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .data-table.cfg-term-table td.col-actions button { width: 100%; min-height: 44px; }
  .cfg-sheet-block > .cfg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cfg-sheet-block > .cfg-grid > .cfg-field:first-child,
  .cfg-sheet-block > .cfg-grid > button { grid-column: 1 / -1; }
}

/* «تقویم» (spec §3.5 row 17, §5.D.13, DC-39, DC-40) */
.cfg-calendar-card { display: grid; gap: 0.5rem; justify-items: start; max-width: 32rem; }
.cfg-calendar-card h3 { margin: 0; }
.cfg-calendar-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0; }
.cfg-calendar-facts dt { color: var(--text-muted); }
.cfg-calendar-facts dd { margin: 0; font-weight: 600; }
.cfg-calendar-editor { display: grid; gap: 0.5rem; }
.cfg-calendar-editor h4 { margin: 0.4rem 0 0; }
.cfg-weekdays { margin: 0; }
.cfg-weekdays button.flag[aria-pressed="true"] { background: var(--danger-soft); border-color: var(--sell-deep); color: var(--bad-ink); }
.cfg-weekdays button.flag[aria-pressed="false"] { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.cfg-legend { margin: 0; font-size: 0.86rem; color: var(--text-muted); }
.cfg-holidays { margin: 0; }
button.cfg-holiday { gap: 0.4rem; }
.cfg-holiday-x { font-size: 0.8rem; color: var(--text-muted); }
.cfg-holiday-add { grid-template-columns: minmax(0, 16rem) auto; justify-content: start; }
@media (max-width: 30rem) { .cfg-holiday-add { grid-template-columns: minmax(0, 1fr); } }
/* ===== UR-20261106 slot WP-3 pricing and settings: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261106 slot WP-4 customers: begin ===== */
/* --- the page head: its actions follow the tab -- «افزودن مشتری» on the list, «دعوت مشتری» on «ثبت‌نام‌ها», neither on the
   comparison (spec §5.E.4); the count of registrations waiting sits on their tab (spec §2.4) --- */
#view-customers[data-sub] #customers-add { display: none; }
#view-customers:not([data-sub="registrations"]) #btn-ob-regs-invite { display: none; }
#view-customers > .page-head .page-actions { position: relative; }
.customers-tabs .tab-count {
  display: inline-block; min-width: 1.35rem; margin-inline-start: 0.4rem; padding: 0 0.35rem;
  border-radius: var(--radius-pill); background: var(--sell-deep); color: #fff;
  font-size: 0.78rem; font-weight: 700; line-height: 1.35rem; text-align: center; font-variant-numeric: tabular-nums;
}
.customers-tabs button[aria-pressed="true"] .tab-count { background: var(--green-950); color: var(--gold); }
.customers-tabs .tab-count[hidden] { display: none; }
.customers-tabs button { white-space: nowrap; }
@media (max-width: 47.99rem) {
  .customers-tabs, .ob-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .customers-tabs::-webkit-scrollbar, .ob-chips::-webkit-scrollbar { display: none; }
  .customers-tabs button { flex: 1 0 auto; }
  .ob-chips { width: auto; }
  .ob-chips button { flex: 0 0 auto; }
}
/* a row of chips that scrolls on a phone never widens the page: the panels' grid items may shrink */
.registrations > *, #customers-directory > * { min-width: 0; }

/* --- «افزودن مشتری»: each way with the line that says what it does (spec §5.E.3) --- */
button.add-menu-item {
  display: grid; gap: 0.1rem; justify-items: start; justify-content: stretch; align-content: center; width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  text-align: start; white-space: normal; font: inherit;
}
button.add-menu-item:hover, button.add-menu-item:focus-visible { background: var(--surface-2); }
button.add-menu-item[hidden] { display: none; }
.add-menu-title { font-weight: 700; }
.add-menu-note { font-size: 0.84rem; font-weight: 400; color: var(--text-muted); }

/* --- the customer list: the search and the Tahesab filter in one row; the pager row with «تعداد در صفحه»
   (spec §5.E.2) --- */
#customers-form.dir-controls { grid-template-columns: minmax(14rem, 2fr) minmax(10rem, 1fr); max-width: 48rem; }
.dir-counts { font-variant-numeric: tabular-nums; }
.dir-pager-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.7rem;
}
.dir-pager-row[hidden], .dir-pager[hidden], .dir-page-size[hidden] { display: none; }
.dir-pager-row .dir-pager { margin-top: 0; }
.dir-pager .dir-page { font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dir-page-size { display: inline-grid; grid-template-columns: auto minmax(5.5rem, auto); align-items: center; gap: 0.5rem; }
.dir-page-size label { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.dir-page-size select { min-height: 44px; }
.data-table.dir-table td.dir-requests { min-width: 0; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dir-table .muted-word { color: var(--text-muted); }
.dir-table .dir-chips { display: inline-flex; flex-wrap: nowrap; justify-content: center; }
@media (max-width: 47.99rem) {
  #customers-form.dir-controls { grid-template-columns: minmax(0, 1fr); }
  .data-table.dir-table td > .dir-chips { justify-content: flex-start; }
  /* a customer's card: the name with its company under it at the start, then three short lines (spec §3.4) */
  .data-table.dir-table:not(.keep-table) tr { gap: 0.2rem 0.75rem; padding: 0.5rem 0.85rem; }   /* final review: room per line */
  .data-table.dir-table .row-open.has-sub, .data-table.ob-table .row-open.has-sub { align-items: flex-start; }
  .data-table.dir-table:not(.keep-table) td { line-height: 1.35; }
  .data-table.dir-table:not(.keep-table) td .chip { line-height: 1.5; }                        /* final review 2026-11-07 */
  /* a chip in a card's value column keeps its own width */
  .data-table.dir-table:not(.keep-table) td > .chip, .data-table.ob-table:not(.keep-table) td > .chip {
    justify-self: start; width: fit-content;
  }
  /* the row's buttons fill the card (the desk's 1% actions column must not hold on a phone) */
  .data-table.ob-table:not(.keep-table) td.col-actions { width: auto; }
  /* a registration that waits for nobody: «جزئیات» sits beside its deadline, not on a line of its own */
  .data-table.ob-table:not(.keep-table) tr:not([data-state="submitted"]) td[data-label="مهلت"] {
    grid-column: 1; grid-row: 2; align-self: center;            /* final review 2026-11-07: level with «جزئیات» */
  }
  .data-table.ob-table:not(.keep-table) tr:not([data-state="submitted"]) td.col-actions {
    grid-column: 2; grid-row: 2; margin-top: 0; align-self: center;
  }
  .data-table.ob-table:not(.keep-table) tr:not([data-state="submitted"]) td.col-actions button { flex: 0 0 auto; }
}

/* --- the profile overlay: the name, its chips and at most two actions; one list of facts (spec §5.E.5) --- */
#customer-profile > .profile-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem; margin: 0 0 0.4rem;
  border-bottom: 1px solid var(--line); padding-bottom: 0.6rem;
}
#customer-profile .profile-titles { flex: 1 1 16rem; min-width: 0; display: grid; gap: 0.4rem; }
#customer-profile .profile-titles h3 { margin: 0; font-size: 1.15rem; }
.profile-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.profile-actions { flex-wrap: wrap; align-self: center; }
.profile-actions[hidden] { display: none; }
#customer-profile > .profile-head #btn-customers-back { margin-inline-start: auto; }
.profile-approval { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.profile-balance-link .notconfirmed { font-size: 0.84rem; color: var(--warn-ink); font-weight: 600; }
.profile-identity-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.profile-identity-head .list-section { margin: 0.6rem 0 0.3rem; }
.identity-edit-form[hidden] { display: none; }
#customer-profile .create-form { max-width: 40rem; border: 0; padding: 0; background: transparent; }
#customer-profile .cfg-clear { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; font-size: 0.85rem; }
/* the identity form: two fields a row on a desk, each with its «پاک شود» beside the box */
#customer-profile .identity-edit-form:not([hidden]) {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.6rem 1.25rem; max-width: none;
}
#customer-profile .identity-edit-form > :not(.cfg-field) { grid-column: 1 / -1; }
#customer-profile .identity-edit-form .cfg-field:has(> .cfg-clear) {
  grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 0.6rem;
}
#customer-profile .identity-edit-form .cfg-field:has(> .cfg-clear) > label:first-child { grid-column: 1 / -1; }
#customer-profile .identity-edit-form .dir-edit-more .cfg-field { max-width: 24rem; }
.dir-edit-more > summary { font-size: 0.9rem; }

/* --- the add, invitation and result overlays: a form's width, no frame inside an overlay (spec §5.E.6, §5.E.7) --- */
body[data-look="live"] .overlay.dir-create-panel,
body[data-look="live"] .overlay.ob-invite { width: min(40rem, calc(100vw - 1.5rem)); }
body[data-look="live"] .overlay.ob-result { width: min(46rem, calc(100vw - 1.5rem)); }
body[data-look="live"] .overlay.ob-invite .create-form,
body[data-look="live"] .overlay.dir-create-panel .create-form { border: 0; padding: 0; background: transparent; max-width: none; }
#ob-invite-form .cfg-field input[type="text"], .dir-create-form .cfg-field input[type="text"] { max-width: 28rem; }
#create-national-id, #ob-invite-identifier, #ob-plan-code { max-width: 16rem; }
.ob-days-line input[type="text"] { width: 6rem; flex: 0 0 6rem; }
.ob-review textarea, .ob-message, #customer-profile textarea {
  width: 100%; box-sizing: border-box; font: inherit; padding: 0.5rem 0.7rem; min-height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
body[data-look="live"] .overlay .ob-confirm .create-actions { border-top: 0; padding-top: 0.2rem; }
.ob-decision-bar[hidden] { display: none; }
.ob-regs-checked { margin: 0; }
.ob-intro { margin: 0; }
label.is-required::after { content: " *"; color: var(--error-ink); font-weight: 700; }
.dir-create-group { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.dir-create-group[hidden] { display: none; }
.dir-contact { padding-block: 0.2rem 0.6rem; }
.dir-contact > .dir-create-group { margin-top: 0.4rem; }
.dir-match-result:empty { display: none; }
.dir-match-result { margin: 0.15rem 0 0; }
.ob-kind-field select, .dir-kind-field select { max-width: 14rem; }
.ob-days-line { display: inline-flex; align-items: center; gap: 0.5rem; }
.ob-days-line input { width: 6rem; text-align: center; }
.ob-days-unit { color: var(--text-muted); }
.ob-hint { margin: 0; }

/* --- the one-time result: the warning first, the password on its own line on a phone, the whole message shown --- */
.ob-result-warning { margin: 0; }
.ob-result-warning p { margin: 0; font-weight: 600; }
#ob-result-password { font-family: inherit; letter-spacing: 0.08em; }
.ob-message { resize: none; line-height: 1.7; field-sizing: content; }
.ob-result-tahesab { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.ob-copy-status:empty { display: none; }
@media (max-width: 47.99rem) {
  .ob-secret-line { display: grid; gap: 0.4rem; width: 100%; }
  .ob-secret-line button { width: 100%; min-height: 48px; }
}

/* --- «ثبت‌نام‌ها»: count pills, the desk's turn in a strong pill and a tinted row (spec §5.E.9) --- */
.ob-chips .ob-chip-count {
  display: inline-block; min-width: 1.35rem; padding: 0 0.35rem; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 0.78rem; line-height: 1.25rem;
  text-align: center; font-variant-numeric: tabular-nums;
}
.ob-chips #ob-chip-submitted .ob-chip-count { background: var(--sell-deep); color: #fff; }
.ob-chips button[aria-pressed="true"] .ob-chip-count { background: var(--green-950); color: var(--gold); }
.ob-status:empty { display: none; }
.ob-status { margin: 0; }
.ob-table tr[data-state="submitted"] td { background: var(--warn-bg); }
.ob-table .ob-who { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35rem; }
.ob-table .ob-tahesab-cell { display: grid; justify-items: center; gap: 0.1rem; }
.ob-table .ob-tahesab-cell .cell-sub { white-space: normal; max-width: 14rem; }
.ob-table .dir-company { color: var(--text-muted); font-size: 0.8rem; }
@media (max-width: 47.99rem) {
  .ob-table .ob-who { justify-content: flex-start; }
  .ob-table .ob-tahesab-cell { justify-items: start; }
}
.ob-card.ob-fields { display: grid; gap: 0.6rem; justify-items: start; padding: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); }
.ob-check-list { border: 0; margin: 0; padding: 0; display: grid; gap: 0.1rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); width: 100%; }
.ob-check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.ob-check input[type="checkbox"] { width: 1.3rem; height: 1.3rem; margin: 0; flex: 0 0 auto; }
.ob-check label { cursor: pointer; }
button.ob-fields-save { width: auto; }

/* --- the review overlay: sections without frames, the state's chip beside the name, the choice as one column, and
   only the state's actions in the sticky bar (spec §1.7, §5.E.10) --- */
.ob-review-titles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; flex: 1 1 auto; }
.ob-section { display: grid; gap: 0.45rem; }
.ob-section h4 { margin: 0; font-size: 1rem; }
.ob-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ob-tahesab-line { margin: 0; }
.ob-tahesab-checked, .ob-tahesab-plan { margin: 0; }
.ob-registration-empty { margin: 0; }
.ob-plan { border: 0; margin: 0; padding: 0; display: grid; gap: 0.1rem; width: 100%; }
.ob-plan legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 0.25rem; }
.ob-plan-choice { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; }
.ob-plan-choice input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0; flex: 0 0 auto; }
.ob-plan-choice label { cursor: pointer; }
.ob-plan-code { max-width: 16rem; }
.ob-plan-code[hidden] { display: none; }
.ob-days-lead { margin: 0; font-weight: 600; }
.ob-days-hints { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 0.15rem; font-size: 0.86rem; color: var(--text-muted); }
.ob-confirm { border-inline-start: 4px solid var(--gold); background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; }
.ob-confirm-line { margin: 0; font-weight: 600; }
.ob-reject-box { border-inline-start-color: var(--sell-deep); }
.ob-decision-bar { margin-top: 0.2rem; }
@media (min-width: 48rem) {
  .ob-review .ob-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
}

/* --- the registration pop-up in the notification stack: its title and its ✕ (spec §1.10) --- */
.ob-popup .ob-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ob-popup .ob-popup-head h3 { margin: 0; }
/* --- WP-4 review: the review's approval note steps aside while the return note or the reject question is open; the
   refusal box can hold focus; the profile's way to a customer's row of the comparison highlights the row it found --- */
.ob-section[hidden] { display: none; }
#ob-review-outcome:focus { outline: none; }
#ob-review-outcome:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#customers-matching .data-table tr.dir-found td { background: var(--warn-bg); }
#customers-matching .data-table tr.dir-found:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 47.99rem) {
  #customers-matching .data-table:not(.keep-table) tr.dir-found { background: var(--warn-bg); }
  #customers-matching .data-table:not(.keep-table) tr.dir-found td { background: transparent; }
}
/* a registration's phone card: the state chip sits level with the name's 44px line beside it */
@media (max-width: 47.99rem) {
  .data-table.ob-table:not(.keep-table) td.col-badge { align-self: center; }
}
/* the review's sticky bar sits on the overlay's own bottom edge (its padding is under the bar, not the form showing
   through below it) */
body[data-look="live"] .overlay.ob-review .ob-decision-bar { bottom: -1.2rem; margin-bottom: -1.2rem; padding-bottom: 1.8rem; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .overlay.ob-review .ob-decision-bar { bottom: -1rem; margin-bottom: -1rem; padding-bottom: 1.6rem; }
}
/* ===== UR-20261106 slot WP-4 customers: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261106 slot WP-5 onboarding and users: begin ===== */
/* --- customer onboarding (spec §5.F): the three steps of the way, «۱ رمز عبور · ۲ فرم ثبت‌نام · ۳ بررسی» --- */
.ob-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4rem;
  font-size: 0.86rem; color: var(--text-muted); }
.ob-step { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; min-width: 0; }
.ob-step + .ob-step::before { content: ""; display: block; flex: 0 0 auto; width: clamp(0.75rem, 4vw, 2.5rem); height: 2px;
  border-radius: 1px; background: var(--line-strong); }
.ob-step-mark { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: var(--radius-pill); display: inline-grid;
  place-items: center; border: 1.5px solid var(--line-strong); font-size: 0.8rem; font-weight: 700; line-height: 1; }
.ob-step[data-step="current"] { color: var(--text); font-weight: 700; }
body[data-shell="customer"] .ob-step[data-step="current"] { color: var(--gold); }
.ob-step[data-step="current"] .ob-step-mark { background: var(--gold); border-color: var(--gold); color: var(--green-950); }
.ob-step[data-step="done"] { color: var(--text); }
.ob-step[data-step="done"] .ob-step-mark { border-color: var(--met-ink); color: var(--met-ink); }

/* --- the forms: one look for every field, errors in the error ink with a ✕, the read-only value plainly read-only --- */
.onboarding-body > .outcome { margin-top: 0; }
.ob-form input[type="tel"],
.ob-form textarea,
.ob-form .secret-wrap input,
.users-secret .secret-wrap input,
.users-tools input[type="search"] {
  font: inherit; font-size: max(16px, 1rem); padding: 0.5rem 0.7rem; min-height: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: inherit; min-width: 0; box-sizing: border-box;
}
.ob-form .secret-wrap input,
.users-secret .secret-wrap input { width: 100%; padding: 0.5rem 3rem 0.5rem 0.7rem; text-align: left; }
.ob-form textarea { resize: vertical; line-height: 1.6; }
.ob-form input[type="tel"]::placeholder { color: var(--text-muted); opacity: 0.55; }
.ob-form .secret-eye, .users-secret .secret-eye { color: var(--text-muted); }
.ob-form .secret-eye:hover, .users-secret .secret-eye:hover { color: var(--text); text-decoration: none; }
.ob-required { color: var(--gold); font-weight: 700; }
body[data-shell="staff"] .ob-required, body[data-shell="entry"] .ob-required { color: var(--gold-ink); }
.ob-optional { color: var(--text-muted); font-size: 0.8rem; }
.ob-pair { display: grid; gap: 0.6rem; }
@media (min-width: 48rem) { .ob-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ob-form .create-hint { margin: 0; }
.ob-form .create-actions { margin-top: 0.2rem; }
body[data-shell="customer"] .view-onboarding .outcome.bad p,
body[data-shell="customer"] .ob-outcome.bad p { color: var(--error-ink); }
.view-onboarding .outcome.bad p::before { content: "✕ "; font-weight: 700; }
.ob-form[data-tried="yes"] .ob-rule[data-met="no"],
.ob-form[data-tried="yes"] .ob-rule[data-met="no"] .ob-rule-mark { color: var(--error-ink); }
.ob-rules { gap: 0.15rem; }

/* --- the returned registration: the desk's note, then the deadline --- */
.ob-note h4 { margin: 0; }
.ob-note-label { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--text-muted); }
.ob-note .ob-note-text { margin: 0; }
.ob-note-until { margin: 0; font-size: 0.86rem; color: var(--text-muted); }

/* --- the waiting page: one card with the way so far and two separate buttons --- */
.view-onboarding .ob-card { display: grid; gap: 0.9rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.view-onboarding .ob-card .ob-lead { margin: 0; }
.ob-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ob-track-step { position: relative; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.65rem;
  align-items: start; padding: 0.3rem 0 0.55rem; color: var(--text-muted); }
.ob-track-step:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: calc(0.8rem - 1px);
  inset-block-start: 2.05rem; inset-block-end: 0; width: 2px; background: var(--line-strong); }
.ob-track-mark { width: 1.6rem; height: 1.6rem; border-radius: var(--radius-pill); display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); font-size: 0.8rem; font-weight: 700; line-height: 1; }
.ob-track-text { padding-top: 0.1rem; }
.ob-track-step[data-step="done"] { color: var(--text); }
.ob-track-step[data-step="done"] .ob-track-mark { color: var(--met-ink); border-color: var(--met-ink); }
.ob-track-step[data-step="current"] { color: var(--text); font-weight: 700; }
.ob-track-step[data-step="current"] .ob-track-mark { color: var(--gold); border-color: var(--gold); }
.ob-track-sub { display: block; margin-top: 0.1rem; font-size: 0.84rem; font-weight: 400; color: var(--text-muted); }
.ob-check-status { margin: 0; }
.ob-check-status:empty { display: none; }
.view-onboarding .ob-card .create-actions { padding-top: 0.75rem; border-top: 1px solid var(--line); }
@media (max-width: 30rem) {
  .view-onboarding .ob-card .create-actions button { flex: 1 1 auto; min-height: 48px; }
  .ob-steps { gap: 0.3rem; }
  .ob-step { gap: 0.3rem; }
}

/* --- «کاربران»: the toolbar, the filter and the search over the listing (spec §5.F.7) --- */
.users-room { font-size: 0.86rem; color: var(--text-muted); white-space: nowrap; }
.users-room[hidden] { display: none; }
.users-room[data-none] { color: var(--warn-ink); }
.users-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 0.6rem; }
.users-tools .users-filter { flex: 0 0 auto; margin: 0; }
.users-tools .users-filter button { flex: 0 0 auto; min-height: 44px; padding-inline: 0.9rem; white-space: nowrap; }
.users-filter-count { font-size: 0.8rem; font-weight: 600; opacity: 0.75; font-variant-numeric: tabular-nums; }
.users-tools input[type="search"] { flex: 1 1 14rem; max-width: 24rem; }
@media (max-width: 47.99rem) {
  .users-tools .users-filter { flex: 1 1 100%; }
  .users-tools .users-filter button { flex: 1 1 0; padding-inline: 0.4rem; }
  .users-tools input[type="search"] { flex-basis: 100%; max-width: none; }
}
.users-table .users-name { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.2rem 0.45rem; }
.users-table .users-you { font-weight: 600; }
.users-role-customer { color: var(--text-muted); }
@media (max-width: 47.99rem) { .users-table .users-name { justify-content: flex-start; } }

/* --- the editor: one form and one main button, the password apart; the permissions as a table --- */
body[data-look="live"] #users-panel.overlay { width: min(46rem, calc(100vw - 1.5rem)); }
@media (max-width: 47.99rem) { body[data-look="live"] #users-panel.overlay { width: calc(100vw - 1rem); } }
.users-kind { margin: 0; }
.users-form { width: 100%; box-sizing: border-box; }
.users-section-title { margin: 0; font-size: 1rem; }
.users-form .create-hint { margin: 0; }
.users-form .create-actions, .users-add .create-actions { width: 100%; }
.users-perm-title { display: flex; align-items: center; gap: 0.15rem; margin: 0.3rem 0 0; font-size: 0.85rem; font-weight: 600; }
.users-access .data-table-wrap { margin: 0.1rem 0 0.2rem; }
.users-perm-table th, .users-perm-table td { padding: 0.3rem 0.6rem; }
.users-perm-table th[data-col="دیدن"], .users-perm-table th[data-col="انجام کار"] { width: 6.5rem; }
.data-table.users-perm-table td.col-primary { min-width: 0; font-weight: 600; }
.data-table.users-perm-table tbody td { height: 44px; }
.users-perm-table label.cell-sub { cursor: pointer; }
.users-checks { display: inline-flex; }
.users-perm-hit { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  cursor: pointer; }
.users-perm-hit input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0; flex: 0 0 auto; cursor: pointer; }
@media (max-width: 30rem) {
  .users-perm-table th, .users-perm-table td { padding: 0.25rem 0.35rem; }
  .users-perm-table th[data-col="دیدن"], .users-perm-table th[data-col="انجام کار"] { width: 4.5rem; }
}
/* final review 2026-11-07: the sign-in lead (the register variant's two-line hint) is as wide as the card under it */
body[data-look="live"] .entry-hero .lead { max-width: 24rem; margin-inline: auto; }
/* ===== UR-20261106 slot WP-5 onboarding and users: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261106 slot WP-6 accounting and matching: begin ===== */
/* --- matching «مشتریان › تطبیق با ته‌حساب» (spec §5.G): the comparison bar, the chips, the two tables, the dialogs --- */
.mt-snapshot-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.mt-snapshot-bar.mt-snapshot-old, .mt-snapshot-bar.mt-snapshot-partial { background: var(--warn-bg); border-color: var(--warn-line); }
.mt-snapshot-facts { display: grid; gap: 0.15rem; min-width: 0; flex: 1 1 16rem; }
.mt-snapshot-bar .mt-snapshot { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-snapshot-old-note { margin: 0; color: var(--warn-ink); font-weight: 600; font-size: 0.9rem; }
.mt-snapshot-hint { margin: 0; }
.mt-snapshot-bar #btn-mt-refresh { flex: 0 0 auto; white-space: nowrap; }
/* final review 2026-11-07: not set up -- the same card as «حسابداری» (a title, then the muted next step) */
.mt-off { display: grid; gap: 0.35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); }
.mt-off .mt-not-configured { font-weight: 700; font-size: 1.05rem; margin: 0; }
.mt-off .fact-note { margin: 0; }
.mt-chip-row { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.mt-chip-row .mt-chips { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; margin: 0; }
.mt-chip-divider { align-self: stretch; width: 1px; min-height: 1.75rem; background: var(--line-strong); margin-inline: 0.2rem; }
/* review 2026-11-06: tighter chips, and the divider with the settled classes as one group that wraps together */
.mt-chip-row .mt-chips > button, .mt-chips-done > button { padding-inline: 0.55rem; }
.mt-chips-done { display: flex; flex: 1 1 auto; flex-wrap: nowrap; align-items: stretch; min-width: 0; }
.mt-chips-done > button { flex: 1 1 auto; }
.mt-legend .help-tip { white-space: pre-line; }
.mt-name { display: grid; gap: 0.15rem; justify-items: center; }
.mt-name .cell-sub { font-weight: 400; }
.mt-table td.col-badge { white-space: normal; min-width: 8rem; }
.mt-linked { display: grid; gap: 0.2rem; justify-items: center; }
.mt-table .mt-status { justify-items: center; }
.mt-table .mt-reason { max-width: 13rem; margin: 0; font-size: 0.8rem; line-height: 1.5; white-space: normal; }
/* a narrower desk: the mobile is in the row's dialogs, so its column steps aside (spec §3.5 row 10, kind detail) */
@media (max-width: 90rem) { .mt-table th.col-detail, .mt-table td.col-detail { display: none; } }
.mt-id { display: inline-grid; gap: 0.2rem; justify-items: center; }
.mt-id-line { display: inline-flex; align-items: center; gap: 0.15rem; white-space: nowrap; }
.mt-id-none { color: var(--text-muted); }
.mt-fix-note { font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; align-self: center; }
.mt-app-actions { display: grid; gap: 0.35rem; justify-items: center; }
.mt-row-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; }
.mt-create-state { display: inline-grid; gap: 0.15rem; justify-items: center; }
.mt-app-head { display: flex; align-items: center; gap: 0.2rem; margin-top: 0.4rem; }
.mt-app-head .mt-app-title { margin: 0; }
.mt-app-hint, .mt-incomplete-note { margin: 0; }
.mt-outcome { position: relative; }
.mt-outcome:has(.mt-outcome-close) { padding-inline-end: 3.2rem; }
.mt-outcome-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.4rem; }
.mt-outcome-actions:not(:has(button:not(.mt-outcome-close))) { margin: 0; }
.mt-outcome-close { position: absolute; inset-block-start: 0.3rem; inset-inline-end: 0.3rem; min-width: 44px; }
.mt-outcome-close::before { content: "✕"; font-weight: 700; }
.mt-question { display: grid; gap: 0.5rem; }
.mt-question-line { margin: 0; font-weight: 600; }
.mt-question-note { margin: 0; }
/* review 2026-11-06: each row as tall as its label (an auto row squeezed to the 44px minimum let a two-line label
   spill over its neighbours and above the list's top, out of reach of the scroll) */
.mt-picker-list {
  border: 0; padding: 0; margin: 0; display: grid; gap: 0.2rem; max-height: 18rem; overflow-y: auto;
  grid-auto-rows: max-content; align-content: start;
}
.mt-pick { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.3rem 0.5rem; border-radius: var(--radius-sm); }
.mt-pick:hover { background: var(--surface-2); }
.mt-pick input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: 0; }
.mt-pick label { display: grid; gap: 0.05rem; flex: 1 1 auto; cursor: pointer; justify-items: start; }
.mt-pick-name { font-weight: 600; }
.mt-pick-sub { font-size: 0.82rem; color: var(--text-muted); }
.mt-pick-taken label { cursor: default; color: var(--text-muted); }
@media (max-width: 47.99rem) {
  .mt-chip-row { align-items: flex-start; }
  .mt-chip-row .mt-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mt-chip-row .mt-chips > * { flex: 0 0 auto; }
  .mt-table.data-table:not(.keep-table) td.col-badge { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
  .mt-table .mt-status, .mt-name, .mt-id, .mt-app-actions, .mt-create-state { justify-items: start; }
  .mt-table .mt-reason { max-width: none; }
  .mt-row-chips { justify-content: flex-start; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions.row-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; width: 100%;
  }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions button { min-width: 0; white-space: normal; flex: none; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions > :only-child { grid-column: 1 / -1; }
  .mt-linked { justify-items: start; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions > button.primary:first-child { grid-column: 1 / -1; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions details.row-more,
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions details.row-more > summary { width: 100%; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions .mt-fix-note { grid-column: 1 / -1; }
}
/* --- «حسابداری» (spec §5.H): tabs, the strip, the connection card, balances, lookup, create history, cases --- */
.acct-strip { flex-wrap: wrap; gap: 0.35rem 0.75rem; }
.acct-strip .chip { font-size: 0.86rem; }
.acct-strip-check { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.acct-strip button { margin-inline-start: auto; }
.acct-tabs .acct-count {
  display: inline-block; min-width: 1.35rem; padding: 0 0.4rem; border: 0; border-radius: var(--radius-pill);
  background: var(--sell-deep); color: #fff; font-size: 0.78rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}
.acct-tabs .acct-count[hidden] { display: none; }
.acct-tabs [aria-selected="true"] .acct-count { background: var(--green-950, #10261c); color: var(--gold); }
.acct-health-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.2rem 0 0.4rem; }
.acct-health-result:empty { display: none; }
.acct-health-result p { margin: 0; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); font-weight: 600; line-height: 1.7; }
.acct-health-result.acct-health-ok p { background: var(--ok-bg); color: var(--ok-ink); }
.acct-health-result.acct-health-ok p::before { content: "✓ "; font-weight: 700; }
.acct-health-result.acct-health-bad p {
  background: var(--warn-bg); color: var(--text); border: 1px solid var(--warn-line); border-inline-start-width: 5px;
}
.acct-conn-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.acct-conn-line .acct-conn-chip { font-size: 1.05rem; padding: 0.15rem 0.7rem; }
.acct-conn-check { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.acct-capabilities { list-style: none; margin: 0.2rem 0; padding: 0; display: grid; gap: 0.2rem; }
.acct-capabilities li { display: flex; gap: 0.45rem; align-items: baseline; }
.acct-cap-mark { font-weight: 700; min-width: 1rem; text-align: center; }
.acct-cap-on .acct-cap-mark { color: var(--ok-ink); }
.acct-cap-off { color: var(--text-muted); }
.acct-cap-off .acct-cap-mark { color: var(--bad-ink); }
.acct-qualifier, .acct-durability-once { margin: 0.2rem 0 0; }
.acct-connection-tech .acct-pilot-block { margin-top: 0.6rem; box-shadow: none; }
.acct-banner {
  margin: 0 0 0.6rem; padding: 0.55rem 0.75rem; border: 1px solid var(--warn-line); border-inline-start-width: 5px;
  border-radius: var(--radius-sm); background: var(--warn-bg); font-weight: 600; line-height: 1.7;
}
.acct-create-line { margin: 0 0 0.4rem; font-weight: 600; }
.acct-create-line.acct-create-on::before { content: "✓ "; color: var(--ok-ink); }
.acct-create-line.acct-create-off { color: var(--text-muted); }
.acct-create-pointer { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; }
.acct-lookup-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin: 0.2rem 0 0.4rem; }
.acct-lookup-field input { max-width: 14rem; width: 100%; }
.acct-lookup-row > button { min-height: 44px; }
.acct-preview-card h4 { margin: 0 0 0.4rem; }
.acct-link-box { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.acct-link-head { display: flex; align-items: center; gap: 0.2rem; }
.acct-link-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.acct-link-row .cfg-field { flex: 1 1 16rem; min-width: 0; }
.acct-link-row select { width: 100%; }
.acct-picker input[type="search"] { margin-bottom: 0.3rem; }
.acct-link-confirm { display: grid; gap: 0.4rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.acct-link-confirm[hidden] { display: none; }
.acct-link-question { margin: 0; font-weight: 600; }
.acct-create-local { margin-top: 0.4rem; }
.acct-balance-figures { display: grid; gap: 0.15rem; justify-items: center; }
/* review 2026-11-06: the figure itself never breaks; its name may wrap at a space on a narrow card */
.acct-figure { white-space: normal; }
.acct-figure .num, .acct-figure .notconfirmed { white-space: nowrap; }
.acct-figure .acct-balance-field { font-size: 0.82rem; color: var(--text-muted); }
.acct-figure .notconfirmed, .acct-figure-value .notconfirmed { font-size: 0.78rem; font-weight: 600; color: var(--warn-ink); }
.data-table .acct-read-state { justify-items: center; }
.acct-read-state .acct-read-text { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; max-width: 16rem; }
.data-table td.col-badge .acct-read-state { white-space: normal; }
.acct-read-text { margin: 0.2rem 0; }
.acct-shape-lead { margin: 0.3rem 0 0; }
.data-table .transfer-chip { white-space: nowrap; margin: 0; }
.acct-summary-line { display: flex; align-items: center; gap: 0.2rem; margin: 0; }
.acct-case-reason { margin: 0.2rem 0; }
.acct-case-go { justify-self: start; margin: 0.3rem 0; }
.acct-file-head { display: flex; align-items: center; gap: 0.2rem; }
.acct-detail-open { color: var(--text-muted); }
.acct-maintenance-fold { margin-top: 0.8rem; }
@media (max-width: 47.99rem) {
  .acct-tabs { display: grid; grid-template-columns: repeat(var(--acct-tab-count, 4), minmax(0, 1fr)); overflow: visible; }
  .acct-tabs button { white-space: normal; line-height: 1.3; min-height: 48px; padding-inline: 0.25rem; }
  .acct-strip button { margin-inline-start: 0; }
  .acct-balance-figures, .data-table .acct-read-state { justify-items: start; }
  .acct-read-state .acct-read-text { max-width: none; }
  .acct-lookup-row > button { flex: 1 1 auto; }
}
.acct-digest-fold > summary { cursor: pointer; font-size: 0.86rem; color: var(--text-muted); min-height: 44px; display: flex; align-items: center; }
.acct-section .outcome:empty, .acct-section .ob-outcome:empty { display: none; }
#acct-item-panel .cfg-scope { border: 0; background: none; padding: 0; box-shadow: none; }
.data-table td.col-badge .acct-read-state { min-width: 9rem; }
.acct-section .block-head h3 .help, .matching .block-head h3 .help { vertical-align: middle; }
@media (max-width: 47.99rem) {
  .acct-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; }
  .acct-balance-table.data-table:not(.keep-table) td.col-badge { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
  .acct-table.data-table:not(.keep-table) td.col-actions,
  .mt-table.data-table:not(.keep-table) td.col-actions { display: block; }
  .acct-table.data-table:not(.keep-table) td.col-actions .acct-row-actions.row-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; width: 100%;
  }
  .acct-table.data-table:not(.keep-table) td.col-actions .acct-row-actions > button {
    min-width: 0; width: 100%; white-space: normal; flex: none;
  }
  .acct-table.data-table:not(.keep-table) td.col-actions .acct-row-actions > :only-child { grid-column: 1 / -1; }
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions button,
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions details.row-more { width: 100%; }
}
@media (max-width: 47.99rem) {
  /* the desk's «width: 1%» of an actions cell (WP-0, `td.col-actions:has(> .row-actions)`) must not narrow a phone card */
  .acct-table.data-table:not(.keep-table) td.col-actions:has(> .row-actions),
  .mt-table.data-table:not(.keep-table) td.col-actions:has(> .row-actions) { width: auto; }
}
.mt-create-off { margin: 0; color: var(--warn-ink); }
/* review 2026-11-06: an accounting fold says it opens -- a chevron that turns, as WP-0's technical folds do; «بستن این
   مورد» (the only way to close a case) looks like a secondary button */
.acct-tech > summary::-webkit-details-marker, .acct-resolve > summary::-webkit-details-marker { display: none; }
.acct-tech > summary::after, .acct-resolve > summary::after {
  content: "‹"; display: inline-block; margin-inline-start: 0.5rem; transition: transform 0.15s; color: var(--text-muted);
}
.acct-tech[open] > summary::after, .acct-resolve[open] > summary::after { transform: rotate(-90deg); }
.acct-tech > summary { width: fit-content; }
.acct-resolve > summary {
  width: fit-content; min-height: 44px; padding: 0.4rem 0.9rem; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-weight: 600; list-style: none;
}
.acct-resolve > summary:hover { background: var(--surface-2); }
.acct-resolve[open] > summary { margin-bottom: 0.5rem; }
.acct-queue-head { display: flex; align-items: center; gap: 0.2rem; }
.acct-queue-head h4 { margin: 0; }
.acct-durability-raw { margin: 0.4rem 0 0; }
.acct-durability-raw[hidden] { display: none; }
/* review 2026-11-06: a long matching dialog title wraps and its ✕ stays at the end of the first line */
.mt-dialog > .panel-head { flex-wrap: nowrap; align-items: flex-start; }
.mt-dialog > .panel-head .panel-title { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.mt-dialog > .panel-head > button { flex: 0 0 auto; }
@media (max-width: 47.99rem) {
  /* review 2026-11-06: a registration chip on a phone card is a pill at the start of its value, never a bar */
  .mt-app-table.data-table:not(.keep-table) td.col-status > .chip,
  .mt-app-table.data-table:not(.keep-table) td.col-status > .mt-login { justify-self: start; width: auto; }
  /* a full-width primary and one more control: that one is full width too, not half a line beside an empty cell */
  .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions > button.primary:first-child + :last-child { grid-column: 1 / -1; }
}
/* integration 2026-11-07: in the live look the matching panel's heading is for a screen reader only (the tab names the
   panel), so its otherwise empty head row is taken out of the grid as well -- no blank gap under the tab row */
body[data-look="live"] .matching > .block-head:has(> h3.sr-only):has(> #mt-status:empty) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
/* --- final review 2026-11-07 --- */
/* a notice that takes the keyboard after an action shows its ring only for a keyboard user (spec §1.7) */
.mt-outcome:focus:not(:focus-visible) { outline: none; }
.mt-outcome:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the comparison's status cell has room for its reason line, so it does not wrap to four lines beside a roomy action cell */
@media (min-width: 48rem) {
  .mt-table.data-table td[data-label="وضعیت"] { width: 12rem; min-width: 12rem; }   /* a cell's width is its floor here */
}
/* the case card's ONE action row: the moved «دیدم», its «؟», the one way there */
.acct-case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.acct-case-actions > .acct-panel-actions { display: contents; }
.acct-case-actions .acct-case-go { margin: 0; }
/* one tab alone is a quiet label, not a full-width bar that looks like a button */
.acct-tabs[data-single="yes"] { display: inline-flex; width: fit-content; border: 0; background: transparent; overflow: visible; }
.acct-tabs[data-single="yes"] button[role="tab"] {
  flex: 0 0 auto; background: transparent; color: var(--text); font-weight: 700; border-radius: 0;
  border-bottom: 2px solid var(--gold); padding-inline: 0.2rem;
}
@media (max-width: 47.99rem) {
  .acct-tabs[data-single="yes"] { display: inline-flex; grid-template-columns: none; }
  .acct-tabs[data-single="yes"] button[role="tab"] { flex-direction: row; gap: 0.35rem; padding-inline: 0.2rem; }
}
/* «پیوند حساب»: no blank band between the create line and its fold; the way to matching reads as a link */
#accounting-intents-body > .acct-create-line { margin: 0; }
#accounting-intents-body > .acct-create-line + .acct-tech { margin-top: -0.6rem; }
.acct-create-pointer #btn-acct-to-matching {
  color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; padding-inline: 0.3rem;
}
/* ===== UR-20261106 slot WP-6 accounting and matching: end ===== */
/* ---- separator ---- */
/* ---- separator ---- */
/* ===== UR-20261107 slot U0 foundation: begin ===== */
/* Owner items 1, 2 and 4 (2026-11-07): a row's details stand in ONE overlay above the page (rowDetails / detailsOpen,
   app.js "UR-20261107 (U0 ..."), a retrieval is one compact button, an acknowledgement is a quiet check, and a page's
   «؟» sits right after its heading. Presentation only. */

/* the details overlay: the shared overlay (ADR-0022) at a reading width, wider when it holds a table */
body[data-look="live"] .overlay.row-details { width: min(44rem, calc(100vw - 1.5rem)); }
body[data-look="live"] .overlay.row-details:has(.data-table-wrap) { width: min(72rem, calc(100vw - 1.5rem)); }
.row-details > .panel-head { flex-wrap: nowrap; align-items: flex-start; }
.row-details > .panel-head .panel-title { flex: 1 1 auto; min-width: 0; }
.row-details > .panel-head > button { flex: 0 0 auto; }
/* a row without a .row-open of its own takes the keyboard itself */
.data-table tr.row-opens[tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* the retrieve-then-view action: four compact states (data-state). Review 2026-11-07: its four words share ONE grid
   cell and only the current one is visible, so the button is as wide as the widest word in every state */
button.row-fetch {
  display: inline-grid; grid-template-areas: "word"; align-items: center; justify-items: center; white-space: nowrap;
}
button.row-fetch > .row-fetch-word {
  grid-area: word; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; visibility: hidden;
}
button.row-fetch > .row-fetch-word.current { visibility: visible; }
button.row-fetch[data-state="busy"] { cursor: progress; color: var(--text-muted); }
button.row-fetch > .row-fetch-word[data-word="busy"]::before {
  content: ""; width: 0.9em; height: 0.9em; flex: 0 0 auto; box-sizing: border-box; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: row-fetch-turn 0.8s linear infinite;
}
button.row-fetch[data-state="failed"] { color: var(--bad-ink); border-color: var(--bad-ink); }
@keyframes row-fetch-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button.row-fetch > .row-fetch-word[data-word="busy"]::before { animation: none; }
}
/* a failed retrieval's overlay: the reason in words, then «تلاش دوباره» */
.row-details .row-fetch-reason { margin: 0 0 0.8rem; color: var(--text); }
.row-details .row-fetch-wait { margin: 0; color: var(--text-muted); }

/* the acknowledgement («ثبت مشاهده»): a quiet button, a check in the ok ink, two words; once recorded a neutral chip */
button.ack-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; color: var(--text); justify-self: start;
}
button.ack-btn svg { width: 1.1rem; height: 1.1rem; stroke: var(--ok-ink); stroke-width: 2.2; }
.chip.ack-chip { white-space: nowrap; justify-self: start; }

/* the page's one «؟», on the heading's line */
body[data-look="live"] .page-head h2:has(~ .page-help) { display: inline-block; vertical-align: middle; }
body[data-look="live"] .page-head .page-help { vertical-align: middle; margin-inline-start: 0.1rem; }

/* the bell's list: each item is ONE button -- its summary and a quiet «‹» (no «بررسی» repeated on every item) */
body[data-look="live"] .pending-item { grid-template-columns: minmax(0, 1fr); padding-block: 0.1rem; }
body[data-look="live"] .pending-item > .pending-open {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; width: 100%;
  min-height: 44px; padding: 0.5rem 0.45rem; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
body[data-look="live"] .pending-item > .pending-open:hover,
body[data-look="live"] .pending-item > .pending-open:focus-visible { background: var(--surface-2); }
body[data-look="live"] .pending-open-go { color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
/* ===== UR-20261107 slot U0 foundation: end ===== */

/* ===== UR-20261107 slot UC customers, requests and users: begin ===== */
/* owner item 7 (posting design §8.3, §8.4): a trade's accounting document is a quiet chip in its «حسابداری» column (the
 * accounting package's chip; the posting-chip-line / posting-number pair only where that package is absent), with the
 * document's number once posted; in the request overlay the chip comes first, then the reason in muted words and the
 * way to its fix */
.chip.posting-chip { white-space: nowrap; justify-self: start; }
.posting-chip-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.posting-number { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 47.99rem) {
  /* on a phone card the chip is a pill at the start of its value, never a bar */
  .data-table:not(.keep-table) td.col-status > .chip.posting-chip,
  .data-table:not(.keep-table) td.col-status > .posting-chip-line,
  .req-table.data-table:not(.keep-table) td.col-status > .pst-chip-line { justify-self: start; width: auto; }
}
body[data-look="live"] #view-detail .posting-line { align-items: baseline; }
body[data-look="live"] #view-detail .posting-line .posting-said { color: var(--text-muted); font-size: 0.9rem; }
body[data-look="live"] #view-detail .posting-line .posting-next { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
/* ===== UR-20261107 slot UC customers, requests and users: end ===== */

/* ===== UR-20261107 slot UB settings and pricing: begin ===== */
/* Owner items 5 and 6 (2026-11-07), app.js "UR-20261107 (UB ...": a product's controls show the server's effective
   state as a standing state (a switch that cannot take effect is disabled with its reason and ONE resolving action; one
   that is on without effect is "held"), and Settings › «اتصال‌ها» lists the outside connections as cards. Presentation
   only: nothing here hides an authorized control, a refusal or a qualifier. */

/* --- a control on without effect: an amber switch; one an inactive product cannot take: plainly unavailable --- */
button.switch.held[aria-checked="true"] .switch-track { background: var(--warn-line); }
button.switch.held { border-color: var(--warn-line); }
button.switch.locked { border-style: dashed; }
.chip.held { white-space: nowrap; }

/* --- the standing line: why the customer does not see a product, or why an open side does not take effect --- */
.eff-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; padding: 0.45rem 0.7rem;
  border-inline-start: 4px solid var(--warn-line); background: var(--warn-bg); color: var(--text);
}
.eff-line .eff-text { flex: 1 1 18rem; margin: 0; font-size: 0.88rem; line-height: 1.6; }
.eff-line .eff-text strong { color: var(--warn-ink); font-weight: 700; }
.eff-line button.eff-resolve { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
.eff-line.ok { border-inline-start-color: var(--ok); background: var(--ok-bg); }
.eff-line.ok .eff-text { color: var(--ok-ink); font-weight: 600; }
.opboard-held { border-bottom: 1px solid var(--line); }
.cfg-effect { border-radius: var(--radius-sm); }
.cfg-scope-state { display: inline-flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.data-table .cfg-scope-state .cell-sub { white-space: normal; text-align: center; }
.cfg-visible-cell { display: inline-flex; flex-direction: column; gap: 0.05rem; }
.cfg-state-cell { align-items: center; }
#board-deadline-state { white-space: nowrap; }
@media (max-width: 47.99rem) {
  /* UR-20261107 (UB review): on a phone the side switches stay on the term's line on every row -- a long term name
     wraps inside its own space before a switch («باز · بی‌اثر») is pushed to a line of its own */
  .opboard-row > .board-title > .board-titletext { flex: 1 1 0; min-width: 4.5rem; }
  .opboard-row > .board-title > .board-titletext .board-termname { white-space: normal; }
  .opboard-row > .board-title > .sidegate, .opboard-row > .board-title > .side-held { flex: 0 0 auto; }
  /* both sides held: the term takes the first line and the two switches the next, on every such row alike */
  .opboard-row > .board-title:has(> .held + .held) > .board-titletext { flex-basis: 100%; }
  .eff-line { padding: 0.4rem 0.55rem; }
  .eff-line button.eff-resolve { flex: 1 1 100%; min-height: 44px; }
  .cfg-scope-state { align-items: flex-start; }
  .data-table .cfg-scope-state .cell-sub { text-align: start; }
}

/* --- Settings › «اتصال‌ها»: the set-up cards, then the ones awaiting set-up --- */
.integ-list { display: grid; gap: 1.1rem; }
.integ-group { display: grid; gap: 0.6rem; }
.integ-group-title { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-muted); }
.integ-card {
  display: grid; gap: 0.6rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); min-width: 0;
}
.integ-card.integ-pending { border-style: dashed; box-shadow: none; background: transparent; }
.integ-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.8rem; }
.integ-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; min-width: 0; }
.integ-name h4 { margin: 0; font-size: 1.05rem; }
.integ-purpose { font-size: 0.86rem; color: var(--text-muted); }
.chip.integ-status { white-space: nowrap; }
.integ-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.8rem; font-size: 0.86rem; color: var(--text-muted); }
.integ-line, .integ-note { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.integ-outcome:empty { display: none; }
.integ-caps { list-style: none; margin: 0; padding: 0; display: grid; }
.integ-cap {
  display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.15rem 0.6rem;
  padding: 0.45rem 0; border-top: 1px solid var(--line); min-height: 44px;
}
.integ-cap:first-child { border-top: 0; }
.integ-cap-mark { grid-column: 1; font-weight: 700; text-align: center; }
.integ-cap-ready .integ-cap-mark { color: var(--ok-ink); }
.integ-cap-held .integ-cap-mark { color: var(--warn-ink); }
.integ-cap-pending .integ-cap-mark, .integ-cap-pending .integ-cap-name, .integ-cap-pending .integ-cap-state { color: var(--text-muted); }
.integ-cap-name { grid-column: 2; display: inline-flex; align-items: center; gap: 0.1rem; font-weight: 600; min-width: 0; }
.integ-cap-name .help { margin-block: -0.5rem; }
.integ-cap-state { grid-column: 3; font-size: 0.86rem; white-space: nowrap; }
.integ-cap-ready .integ-cap-state { color: var(--ok-ink); }
.integ-cap-held .integ-cap-state { color: var(--warn-ink); }
.integ-control { grid-column: 4; display: inline-flex; align-items: center; gap: 0.4rem; }
.integ-select { min-height: 40px; max-width: 12rem; }
.integ-cap-sub { grid-column: 2 / -1; font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; }
.integ-cap-sub.integ-interim { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; color: var(--warn-ink); }
/* UR-20261107 (UB review): a reason several capabilities share, said once under the card's head; the way to «سندها» */
.integ-shared { margin: 0; font-size: 0.86rem; line-height: 1.6; color: var(--warn-ink); }
.integ-cap-sub.integ-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; }
.integ-confirm p.integ-ask-text { font-weight: 400; }
.integ-confirm p.integ-ask-text strong { font-weight: 700; }
.integ-cap > .integ-confirm { grid-column: 1 / -1; }
.integ-summary .integ-interim-head {
  margin: 0 0 0.8rem; padding: 0.4rem 0.6rem; border-inline-start: 4px solid var(--warn-line); background: var(--warn-bg);
  font-size: 0.88rem; color: var(--warn-ink);
}
.integ-summary .integ-summary-facts { margin-bottom: 0.9rem; }
@media (max-width: 47.99rem) {
  .integ-card { padding: 0.75rem 0.8rem; }
  .integ-cap { grid-template-columns: 1.4rem minmax(0, 1fr) auto; }
  .integ-cap-state { white-space: normal; text-align: end; }
  .integ-control { grid-column: 2 / -1; }
  .integ-select { max-width: none; flex: 1 1 auto; }
}
/* ===== UR-20261107 slot UB settings and pricing: end ===== */

/* ===== UR-20261107 slot UA accounting and matching: begin ===== */
/* Owner items 1, 3, 4 and 7 (2026-11-07), package UA: the accounting rows open their card in U0's overlay (no «جزئیات»
   button), a balance is one compact retrieve-then-view action, the matching rows open their details, the periodic
   comparison's quiet line and «جدید», and «سندها» -- the accounting documents of trades. Presentation only. */

/* an accounting row's first cell is its open button: the row's own words, not a muted link */
.data-table .row-open.acct-detail-open { color: var(--text); }
#acct-item-panel .acct-panel-actions { margin: 0.4rem 0; }

/* balances: one compact action per row; the card's figures under one heading with its «؟», then «دریافت دوباره» */
.data-table .acct-balance-actions { display: inline-flex; justify-content: center; }
.acct-figures-head { display: flex; align-items: center; gap: 0.2rem; margin-top: 0.6rem; }
.acct-figures-head h4 { margin: 0; }
.acct-balance-detail > .cfg-scope-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.acct-balance-detail .acct-balance-again { margin: 0.6rem 0 0.4rem; }
.acct-balance-detail .acct-balance-again[aria-busy="true"] { cursor: progress; color: var(--text-muted); }
.acct-balance-detail .row-fetch-wait { margin: 0.5rem 0; color: var(--text-muted); }

/* matching: the periodic comparison's line, the quiet «جدید», «ثبت مشاهدهٔ همه» beside the chips, a row's details */
.mt-snapshot-bar .mt-auto {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.3rem; font-variant-numeric: tabular-nums;
}
.mt-snapshot-bar .mt-auto-fail { color: var(--warn-ink); font-weight: 600; }
.chip.mt-new-chip {
  background: transparent; border-color: var(--gold); color: var(--text); font-size: 0.74rem; padding-block: 0;
  white-space: nowrap;
}
.mt-chip-row #btn-mt-reviewed { flex: 0 0 auto; }
.mt-chips .mt-chip-new { border-color: var(--gold); }
.mt-name .row-open { max-width: 100%; }
.mt-name .row-open .row-open-text, .mt-name .row-open .mt-text { white-space: normal; overflow-wrap: anywhere; }
.mt-details-head .mt-status { display: grid; gap: 0.25rem; justify-items: start; }
.mt-details-head .mt-reason { margin: 0; }
.mt-details .mt-facts { margin-top: 0.6rem; }
@media (max-width: 47.99rem) {
  .mt-chip-row { flex-wrap: wrap; }
  .mt-chip-row .mt-chips { flex: 1 1 100%; }
}

/* «سندها»: the status card, the sample's guided card, the overdue documents, the filters and the table */
.pst-status {
  display: grid; gap: 0.4rem; margin-bottom: 0.6rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.pst-status.pst-off { background: var(--surface); }
.pst-status p { margin: 0; }
.pst-off-title { font-weight: 700; }
.pst-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; }
.pst-auto { color: var(--text-muted); }
.pst-status-line .pst-config-open { margin-inline-start: auto; }
.pst-halted, .pst-run { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.pst-halted p, .pst-run p { font-weight: 600; }
.pst-halted p { color: var(--bad-ink); }
.pst-status .acct-banner { margin: 0; }
.pst-canary {
  display: grid; gap: 0.5rem; margin-bottom: 0.6rem; padding: 0.75rem 0.9rem; border: 1px solid var(--warn-line);
  border-inline-start-width: 5px; border-radius: var(--radius-sm); background: var(--warn-bg);
}
.pst-canary-head { display: flex; align-items: center; gap: 0.2rem; }
.pst-canary-head h4 { margin: 0; }
.pst-canary p { margin: 0; }
.pst-steps { margin: 0; padding-inline-start: 1.4rem; display: grid; gap: 0.2rem; line-height: 1.7; }
.pst-step[data-done="yes"] { color: var(--text-muted); }
.pst-step[data-done="yes"]::after { content: " ✓"; color: var(--ok-ink); font-weight: 700; }
.pst-step[aria-current="step"] { font-weight: 700; }
.pst-canary-trade { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; }
.pst-canary-trade .row-open {
  display: inline-flex; flex-direction: column; align-items: flex-start; min-height: 44px; padding: 0.2rem 0;
  border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); cursor: pointer;
}
.pst-canary-trade .row-open:hover { text-decoration: underline; }
.pst-canary-trade .row-open .cell-sub { font-weight: 400; font-size: 0.82rem; color: var(--text-muted); }
.pst-checks {
  border: 0; padding: 0; margin: 0; display: grid; gap: 0 0.8rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.pst-checks legend, .pst-exclude-reasons legend { padding: 0; margin-bottom: 0.2rem; font-weight: 600; }
.pst-check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; cursor: pointer; }
.pst-check input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: 0; }
.pst-canary-actions, .pst-trade-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pst-confirm {
  display: grid; gap: 0.45rem; margin-top: 0.5rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.pst-confirm p { margin: 0; }
.pst-confirm-line { font-weight: 600; }
.pst-exclude-reasons { border: 0; padding: 0; margin: 0; display: grid; }
.pst-exclude .cfg-field input { max-width: 12rem; }
.pst-exclude .pst-exclude-field[hidden] { display: none; }
.pst-next .pst-to-matching { text-decoration: underline; text-underline-offset: 3px; padding-inline: 0.3rem; }
.pst-backlog { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin-bottom: 0.6rem; }
.pst-backlog-line { margin: 0; font-weight: 600; }
.pst-filters { margin: 0.2rem 0 0.5rem; }
.data-table .pst-asset { display: inline-grid; justify-items: center; }
.data-table .pst-reason { display: inline-block; max-width: 16rem; font-size: 0.85rem; color: var(--text-muted); white-space: normal; }
.pst-chip-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.pst-number { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pst-more { margin: 0.4rem 0 0; }
.pst-trade-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.pst-trade-reason { font-weight: 600; }
.pst-next { margin: 0.3rem 0 0; }
.pst-trade-outcome { margin: 0.5rem 0; }
.pst-trade-actions { margin: 0.6rem 0; }
.pst-facts { margin-top: 0.4rem; }
.pst-preview { margin-top: 0.7rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.pst-preview h4 { display: inline-block; margin: 0 0 0.3rem; }
.pst-interim {
  margin: 0 0 0.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--warn-line); border-radius: var(--radius-sm);
  background: var(--warn-bg); font-weight: 600;
}
.pst-history { margin: 0.5rem 0 0; padding-inline-start: 1.3rem; display: grid; gap: 0.2rem; font-size: 0.88rem; }
.pst-history .cell-sub { color: var(--text-muted); font-size: 0.8rem; }
.pst-preview-lead { margin: 0 0 0.5rem; }
.pst-preview-blocked { margin: 0.3rem 0; padding-inline-start: 1.2rem; color: var(--text-muted); }
.pst-config .kvlist { margin-bottom: 0.6rem; }
body[data-look="live"] .overlay.row-details.pst-trade-overlay { width: min(44rem, calc(100vw - 1.5rem)); }
.data-table .pst-quantity, .data-table .pst-money { white-space: nowrap; }
.pst-preview-head { display: flex; align-items: center; gap: 0.2rem; }
.pst-preview-head h4 { margin: 0; }
.pst-outcome { position: relative; }
.pst-outcome:has(.pst-outcome-close) { padding-inline-end: 3.2rem; }
.pst-outcome .pst-outcome-close { position: absolute; inset-block-start: 0.2rem; inset-inline-end: 0.2rem; min-width: 44px; min-height: 44px; }
@media (max-width: 47.99rem) {
  .pst-status-line .pst-config-open { margin-inline-start: 0; }
  /* review 2026-11-07: the six filters wrap on a phone (as the matching chips do) -- none is cut or off screen */
  .ob-chips.pst-filters { flex-wrap: wrap; overflow-x: visible; width: fit-content; }
  .ob-chips.pst-filters button { flex: 1 1 auto; }
  .data-table .pst-asset { justify-items: start; }
  .data-table .pst-reason { max-width: none; }
  /* five accounting tabs on a phone: the words wrap inside each cell, a little smaller */
  .acct-tabs button { font-size: 0.86rem; }
}
/* ===== UR-20261107 slot UA accounting and matching: end ===== */

/* ===== UR-20261107 slot F4 final fixes: begin ===== */
/* final review 2026-11-07 (owner item 7): the document preview's figure, the trade's own figure and the factor under it */
.pst-converted { display: inline-grid; justify-items: start; gap: 0.1rem; }
.pst-from { color: var(--text-muted); font-size: 0.82rem; font-weight: 400; }
.pst-preview-basis { margin: 0 0 0.3rem; }
/* «تغییر در تنظیمات ›» beside «ثبت خودکار: …» */
.pst-status-line .pst-auto-settings { margin-inline-start: -0.4rem; }
/* owner item 4: a notice's X «بستن» (closeIconInto) beside its verb -- never stretched across a phone's row */
.queue-outcome-line .actions button.icon-close,
#decision-outcome .actions button.icon-close { flex: 0 0 auto; min-width: 44px; }
/* owner item 5: a not-set-up card's quiet way to «تنظیمات › اتصال‌ها» */
.integ-setup-way { justify-self: start; align-self: flex-start; margin-top: 0.2rem; }
/* owner item 4: «تطبیق با ته‌حساب» is the link inside its own sentence -- it sits between its «» with no gap */
.pst-next .pst-to-matching { padding-inline: 0.05rem; }
#accounting-not-configured .acct-not-configured { margin: 0; font-weight: 700; font-size: 1.05rem; }
/* Settings › «اتصال‌ها» on a phone: a capability's name keeps its line and its state reads under it -- a long state
 * («خاموش — …») no longer squeezes the name word by word or runs under its «؟» */
@media (max-width: 47.99rem) {
  .integ-cap { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .integ-cap-state { grid-column: 2; text-align: start; }
}
/* owner item 4: «درباره» on a desk -- the page heading already says it; the card's own title is not repeated */
@media (min-width: 48rem) {
  body[data-look="live"][data-shell="staff"] #view-tools section.block:has(> #about-facts) > .block-head { display: none; }
}
/* ===== UR-20261107 slot F4 final fixes: end ===== */

/* ===== 2026-11-09 R5 slot: the accounting connection in Settings: begin ===== */
/* Owner item 1 (2026-11-09): «حسابداری» shows the connection's state only -- the chip, when it was last checked and,
   while it is not connected, ONE sentence whose «تنظیمات › اتصال‌ها» is the link (a viewer who cannot check it there
   is asked to tell the manager or the accountant); the check, its answer and its technical details are in the Tahesab
   card of Settings › «اتصال‌ها». Presentation only. */
.acct-strip .acct-settings-way { flex: 1 1 100%; margin: 0; font-size: 0.9rem; line-height: 1.7; color: var(--text); }
.acct-settings-way .acct-settings-place { white-space: nowrap; }
/* the link keeps its 44px target without opening the sentence's lines */
.acct-settings-way button.acct-to-settings { margin-inline-start: 0; margin-block: -0.7rem; padding-inline: 0.05rem; vertical-align: baseline; }
.integ-tech .acct-durability-once { margin: 0.2rem 0 0.4rem; }
.integ-tech .acct-durability-once p { margin: 0 0 0.2rem; }
/* a server's long word (e.g. the store's evidence) wraps inside the card on a phone */
.integ-tech bdi.ltr { max-width: 100%; overflow-wrap: anywhere; }
.outcome .acct-settings-way, .acct-read-help.acct-settings-way { margin: 0.2rem 0 0; }
/* review of R5: a balance read refused for the connection -- the sentence in the row's overlay and in the card */
.row-fetch-reason.acct-settings-way, .acct-balance-detail > .acct-settings-way { line-height: 1.7; }
.acct-balance-detail > .acct-settings-way { margin: 0.2rem 0 0.4rem; }
.integ-tech .acct-recovery-host:empty { display: none; }
.integ-tech .acct-recovery-host { margin-top: 0.6rem; }
/* the Tahesab card: «بررسی سلامت اتصال» and its answer under the head; one closed «جزئیات فنی» at the foot */
.integ-check { display: grid; gap: 0.4rem; min-width: 0; }
.integ-check .acct-health-bar { margin: 0; }
.integ-check .acct-health-bar button { min-height: 44px; }
.integ-tech { border-top: 1px solid var(--line); padding-top: 0.4rem; min-width: 0; }
.integ-tech > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 0.9rem; color: var(--text-muted); }
.integ-tech .kv { flex-wrap: wrap; }
.integ-tech .kv-value { min-width: 0; overflow-wrap: anywhere; }
.integ-tech .acct-pilot-block { margin-top: 0.6rem; padding: 0.6rem 0.7rem; box-shadow: none; }
.integ-tech .acct-pilot-block .fieldrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.integ-tech .outcome:empty { display: none; }
@media (max-width: 47.99rem) {
  .integ-check .acct-health-bar button { flex: 1 1 100%; }
}
/* ===== 2026-11-09 R5 slot: the accounting connection in Settings: end ===== */

/* ===== 2026-11-09 R6 slot: products mapped to Tahesab's: begin ===== */
/* Owner item 2 (2026-11-09; design docs/product/PRODUCT-TAHESAB-MAPPING-20261109.md section 4): «کالای متناظر در ته‌حساب»
   in «کالای تازه» and in a product's sheet, the list's «ته‌حساب» cell, the lock line and the counts question.
   Presentation only. */
.prd-section { display: grid; gap: 0.5rem; min-width: 0; }
.prd-fields { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); align-items: start; }
.prd-fields .cfg-field[hidden] { display: none; }
.prd-list { grid-column: 1 / -1; min-width: 0; }
.prd-list-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.prd-list-row select { flex: 1 1 16rem; min-width: 0; max-width: 100%; }
.prd-list-state { margin: 0.2rem 0 0; }
.prd-list-state.warn { color: var(--warn-ink); }
.prd-facts .kv-value bdi { overflow-wrap: anywhere; }
.prd-none { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.prd-fold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.prd-fold-body { display: grid; gap: 0.6rem; padding-top: 0.4rem; }
.prd-fold-body > button.primary { justify-self: start; }
.prd-history { margin: 0.3rem 0 0; padding-inline-start: 1.2rem; display: grid; gap: 0.2rem; font-size: 0.9rem; }
.prd-cell { display: inline-flex; flex-direction: column; gap: 0.15rem; }
.prd-mapping bdi { overflow-wrap: anywhere; }
.chip.prd-chip { white-space: nowrap; }
.opboard-asset-name .chip.prd-chip { margin-inline-start: 0.4rem; }
.prd-lock { display: grid; gap: 0.4rem; }
.prd-lock .eff-text { margin: 0; }
.prd-lock button.prd-resolve, .outcome button.prd-resolve { justify-self: start; min-height: 44px; }
.prd-unmapped { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; }
.prd-unmapped button.prd-unmapped-go { padding-inline: 0.2rem; }
.prd-ask .actions button { min-height: 44px; }
@media (max-width: 47.99rem) {
  .prd-fields { grid-template-columns: 1fr; }
  .prd-list-row button.prd-refresh { flex: 1 1 100%; }
}
/* ===== 2026-11-09 R6 slot: products mapped to Tahesab's: end ===== */
/* ===== 2026-11-09 R6 slot: Zaryar prices: begin ===== */
/* Owner item 3 (2026-11-09; docs/integrations/ZARYAR-TRADING-WORKFLOW-DESIGN-20261109.md §10, worker A): the «قیمت زریار»
   card of Settings › «اتصال‌ها» (its chip, the last price's age, «دریافت قیمت», «بررسی اتصال», its closed «جزئیات فنی»
   with the dealer's items) and «قیمت‌گذاری»'s quiet reference line under each price cell of a mapped row, the row's
   «خودکار از زریار» with «خودکار» and its margins. Presentation only. */
.zr-card .zr-why { margin: 0.1rem 0 0; color: var(--text); }
.zr-card .zr-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.zr-card .zr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.zr-card .zr-controls button { min-height: 44px; }
.zr-card .zr-check-answer:empty { display: none; }
.zr-card .zr-check-answer p { margin: 0; }
.zr-tech .zr-interim { margin: 0.2rem 0 0.4rem; color: var(--text-muted); font-size: 0.86rem; }
.zr-tech .zr-items-wrap { max-width: 100%; overflow-x: auto; }
.zr-tech .zr-items { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.zr-tech .zr-items th, .zr-tech .zr-items td { padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--line); text-align: start;
  vertical-align: top; }
.zr-tech .zr-items .zr-num { white-space: nowrap; }
.zr-tech .zr-items .zr-units { text-align: center; }
.zr-tech .zr-items .zr-item-id { color: var(--text-muted); }
.zr-tech .zr-items .zr-per-unit-line { display: block; }
/* R9 (2026-11-11, stage 1): «فهرست اقلام زریار» under the mapped items, and the balance line under the check's answer */
.zr-tech .zr-dealer { margin-top: 0.8rem; }
.zr-tech .zr-dealer-title { margin: 0 0 0.2rem; font-size: 0.95rem; }
.zr-tech .zr-dealer-when, .zr-tech .zr-dealer-note { margin: 0.2rem 0; }
.zr-tech .zr-dealer-list .zr-dealer-market { white-space: nowrap; }
.zr-card .zr-check-answer .zr-balance { margin-top: 0.2rem; }
/* the board: one quiet line under a price cell; a loss in the bad style */
.pricecell .zr-ref { margin-top: 0.25rem; font-size: 0.8rem; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.pricecell .zr-ref.zr-ref-loss { color: var(--bad-ink); font-weight: 600; }
.pricecell .zr-ref .zr-below { margin-inline-start: 0.35rem; font-size: 0.74rem; padding-block: 0; }
.zr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin-top: 0.3rem; }
.zr-row .zr-margins { font-size: 0.8rem; color: var(--text-muted); }
.zr-row .zr-withdrawn { flex: 1 1 100%; font-size: 0.8rem; color: var(--bad-ink); }
.opboard-row[data-computed="yes"] .pricecell input { border-style: dotted; }
#zr-board-chip { white-space: nowrap; }
@media (max-width: 47.99rem) {
  .zr-card .zr-controls > * { flex: 1 1 100%; }
}
/* ===== 2026-11-09 R6 slot: Zaryar prices: end ===== */
/* ===== 2026-11-09 R6 slot: Zaryar hedging: begin ===== */
/* Owner item 3 (2026-11-09; docs/integrations/ZARYAR-TRADING-WORKFLOW-DESIGN-20261109.md §10.1, §10.3, §10.4, worker B):
   «معاملات زریار» (its modes, the stops, today's counts, the last orders, the rules), the request overlay's «پوشش در
   زریار» and the queue's alert filter and row badges. Presentation only. */
.zr-trade-card .zr-modes-box { margin-top: 0.45rem; }
.zr-trade-card .zr-modes { flex-wrap: wrap; }
.zr-trade-card .zr-modes button { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 0; }
.zr-trade-card .zr-modes button[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }
.zr-trade-card .zr-auto-locked { margin: 0.25rem 0 0; }
.zr-trade-card .zr-today { margin-top: 0.45rem; align-items: center; }
.zr-trade-card .zr-trade-answer:empty { display: none; }
.zr-trade-card .zr-trade-answer p { margin: 0; }
.zr-recent { margin-top: 0.5rem; }
.zr-recent-title { margin: 0 0 0.25rem; font-size: 0.9rem; }
.zr-recent-list { list-style: none; margin: 0; padding: 0; }
.zr-recent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; padding: 0.2rem 0;
  border-bottom: 1px solid var(--line); }
.zr-rules .zr-rules-list { margin: 0.3rem 0; }
.zr-rules .zr-rule-item { margin: 0.2rem 0; overflow-wrap: anywhere; }
.detail-zaryar .block-head.spread { flex-wrap: wrap; gap: 0.3rem 0.6rem; }
.detail-zaryar .block-head.spread h3 { margin-bottom: 0; }
.detail-zaryar .zr-hedge-why { margin: 0.2rem 0 0.4rem; }
.detail-zaryar .zr-hedge-profit-line { display: block; }
.detail-zaryar .zr-hedge-alerts { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0; }
.detail-zaryar .zr-hedge-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.45rem; }
.detail-zaryar .zr-hedge-actions button { min-height: 44px; }
.detail-zaryar .zr-hedge-actions #btn-zr-hedge-stop { margin-inline-start: auto; }
.detail-zaryar .zr-hedge-ask { margin-top: 0.5rem; }
.detail-zaryar .zr-risk { margin: 0 0 0.4rem; font-weight: 600; }
.detail-zaryar .zr-canary-check { display: block; margin: 0.2rem 0; }
.detail-zaryar .zr-resolution { min-height: 44px; margin-inline-start: 0.4rem; }
.detail-zaryar .zr-hedge-answer:empty { display: none; }
.zr-queue-filter { display: flex; margin: 0.3rem 0 0.5rem; }
.zr-queue-filter button { min-height: 44px; border-color: var(--bad-ink); color: var(--bad-ink); }
.zr-queue-filter button[aria-pressed="true"] { background: var(--bad-ink); color: #fff; }
.reqcard-state .zr-row-badge { margin-inline-start: 0.3rem; font-size: 0.74rem; padding-block: 0; }
.zr-inline-wait { white-space: nowrap; }
@media (max-width: 47.99rem) {
  .detail-zaryar .zr-hedge-actions > * { flex: 1 1 100%; }
  .zr-trade-card .zr-modes button { flex: 1 1 45%; }
}
/* ===== 2026-11-09 R6 slot: Zaryar hedging: end ===== */
/* ===== 2026-11-10 R7 slots (ADR-0026, WP-0): one section per item, each package writes only between its own two
   markers, in this order. ===== */
/* R7-balance */
/* R7 item 1 (ADR-0026): the customer's own balance from accounting («حساب من», the home tiles) and the staff card's
   interpreted lines. The side chips use the existing state tokens, so light and dark follow them. */
.chip.side-owes { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); white-space: nowrap; }
.chip.side-credit { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); white-space: nowrap; }
.chip.side-settled { background: var(--surface-2); border-color: var(--line); color: var(--text-muted); white-space: nowrap; }
.own-balance { display: grid; gap: 0.5rem; }
.own-balance > .block-head h3 { margin: 0; }
.own-balance-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.own-balance-tile .holding-value .num { white-space: normal; overflow-wrap: anywhere; }
.own-balance-sentence { margin: 0; font-size: 0.9rem; }
.own-balance-sentence .num { white-space: normal; overflow-wrap: anywhere; }
.own-balance-absent { color: var(--text-muted); }
.own-balance-state { margin: 0; }
.own-balance-time, .own-balance-coins, .own-balance-unposted { margin: 0; }
.own-balance-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.own-balance-ack { margin: 0; }
.own-balance-home .stat-tile-value { white-space: normal; overflow-wrap: anywhere; }
.own-balance-home .chip { justify-self: start; }
.own-balance-short { font-size: 1rem; color: var(--text-muted); }
.acct-meaning-grid { margin-top: 0.4rem; }
@media (max-width: 47.99rem) {
  .own-balance-grid { grid-template-columns: minmax(0, 1fr); }
  .own-balance-grid > .holding-tile:nth-child(even):last-child { grid-column: auto; }
}
/* R7-balance: end */
/* R7-vip */
/* 2026-11-10 R7 item 2 (ADR-0026, WP-D2): the «ویژه» chip, the profile's «دستهٔ قیمت» line, the customer's quiet chip and
   the «قیمت‌های ویژه» tab of «قیمت‌گذاری» with its panel. Tokens only; a phone keeps the 16px gutter (no new width). */
.chip.vip { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); white-space: nowrap; }
.chip.pcat-own-chip { white-space: nowrap; font-weight: 500; }
.reqcard-asset + .pcat-chip { margin-inline-start: 0.3rem; }
.pcat-regular, .pcat-profile .muted-word, .pcat-unset-word { color: var(--text-muted); }
.pcat-profile { display: grid; gap: 0.35rem; justify-items: start; min-width: 0; }
.pcat-assign-line { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pcat-choice { display: inline-flex; }
.pcat-choice .seg { flex: 0 0 auto; padding-inline: 0.85rem; }
.pcat-choice .seg[aria-pressed="true"], .pcat-tabs .seg[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }
.pcat-assign-outcome { display: grid; gap: 0.25rem; justify-items: start; }
.pcat-assign-outcome p { margin: 0; }
.pcat-ack { font-weight: 600; }
.pcat-tabs { display: inline-flex; max-width: 100%; margin-bottom: 0.7rem; }
.pcat-tabs .seg { flex: 0 1 auto; padding-inline: 1rem; min-height: 40px; }
.pcat-lead { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.6rem; }
.pcat-count { color: var(--text-muted); font-size: 0.86rem; }
.pcat-figure { white-space: nowrap; }
.pcat-states { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; justify-content: center; }
.pcat-price .pcat-level { margin-inline-start: 0.3rem; }
.pcat-details .pcat-side { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; margin-bottom: 0.6rem; }
.pcat-details .pcat-side.buy { border-inline-start: 3px solid var(--buy); }
.pcat-details .pcat-side.sell { border-inline-start: 3px solid var(--sell); }
.pcat-details .pcat-side h4 { margin: 0 0 0.3rem; }
.pcat-field { display: grid; gap: 0.25rem; margin-top: 0.4rem; }
.pcat-field input { width: 100%; max-width: 16rem; box-sizing: border-box; }
.pcat-actions { margin: 0.4rem 0; }
@media (max-width: 40rem) {
  .pcat-tabs { display: flex; }
  .pcat-tabs .seg { flex: 1 1 0; }
  .pcat-field input { max-width: none; }
}
/* R7-vip: end */
/* R7-presence */
/* R7 item 3 (ADR-0026 §3): the «حضور» cell of «مشتریان» and the profile's row -- a quiet 8 px dot (nothing pulses) beside
   the word, which carries the meaning; offline adds the last moment under the word (the table's own .cell-sub). */
.prs-cell, .prs-fact { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.prs-cell { justify-content: center; }
.presence-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.presence-dot.on { background: var(--ok); }
.presence-dot.off { background: var(--line-strong); }
.prs-cell .prs-word { font-weight: 600; }
.prs-cell .presence-dot.off + .prs-word { color: var(--text-muted); font-weight: 400; }
.data-table .prs-cell .cell-sub { flex-basis: 100%; text-align: center; }
.prs-stale { opacity: 0.7; }
/* R7-presence: end */
/* R7-alert */
/* R7 item 4 (ADR-0026 §4): the customer's price-change alert. A changed price keeps a gold outline and an arrow pill for
 * its hold (the ring plays once); the price notice has a gold edge; reduced motion keeps only the static marks. */
.boardbtn.changed { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the keyboard's ring stays its own while a price is marked (WCAG 2.4.7): wider and further out, the mark kept inside */
.boardbtn.changed:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; box-shadow: inset 0 0 0 2px var(--gold); }
.boardbtn .board-arrow.price-mark,
.ticket-price .board-arrow.price-mark {
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 0 0.32rem;
  line-height: 1.45;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.board-arrow.price-mark.up { color: var(--buy-deep); }
.board-arrow.price-mark.down { color: var(--sell-deep); }
.ticket-price.changed { position: relative; outline: 2px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-sm); }
/* the pill sits at the empty end of the side label's row, never over the label («فروش به شما · تومان») */
.ticket-price .board-arrow.price-mark { top: 0.3rem; inset-inline-start: auto; inset-inline-end: 0.3rem; }
.toast.toast-price { border-inline-start: 4px solid var(--gold); animation: price-toast-in 200ms ease-out 1; }
@keyframes price-toast-in { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
.price-fresh { animation: price-fresh-line 1.6s ease-out 1; }
@keyframes price-fresh-line { 0% { box-shadow: inset 0 -2px 0 var(--gold); } 100% { box-shadow: inset 0 -2px 0 transparent; } }
#profile-body .profile-switch-note { margin: 0.25rem 0 0; font-size: 0.8rem; }
@media (prefers-reduced-motion: reduce) {
  .boardbtn.changed, .boardbtn.flash, .ticket-price.changed, .toast.toast-price, .price-fresh { animation: none; }
}
/* R7-alert: end */
/* ===== 2026-11-11 slot: one card system (owner 2026-11-11, «cards»): begin ===== */
/* The owner, 2026-11-11: reorganize every card into one clear, consistent structure and layout. ONE card, ONE head,
   ONE key-value list, ONE figure tile, ONE status line, ONE notice, ONE chip, ONE fold, ONE action order. Every rule is
   under body[data-look="live"] (the owner's sites), so the plain test build keeps its look. Pinned selectors stay in
   their own slots above; this slot only overrides them from later in the file. No external resource of any kind and
   no stacking order is set here. Area packages write ONLY inside their own sub-slot (C1 .. C5) at the end. */

/* ---- C0.1 tokens. On body, NOT :root: a token that reads a shell colour (var(--surface) ...) must resolve on the same
   element as body[data-shell]'s own overrides, or the dark customer shell would get the light values. ---- */
body[data-look="live"] {
  --gutter: 16px;
  --grid-gap: 16px;
  --section-gap: 24px;
  --card-pad: 20px;
  --card-gap: 12px;
  --card-radius: var(--radius);
  --well-radius: var(--radius-sm);
  --card-bg: var(--surface);
  --card-line: var(--line);
  --card-shadow: 0 1px 2px rgba(20, 30, 25, 0.06);
  --well-bg: var(--surface-2);
  --rule: 1px solid var(--line);
  --edge: 4px;
  --tap: 44px;
  --chip-h: 1.6rem;
  --kv-name: 11rem;
  --measure: 48rem;
  --fs-note: 0.8rem;
  --fs-meta: 0.86rem;
  --fs-body: 0.95rem;
  --fs-sub: 0.95rem;
  --fs-card: 1.1rem;
  --fs-page: 1.35rem;
  --fs-figure: 1.4rem;
  --fs-hero: 1.75rem;
}
body[data-look="live"][data-shell="customer"] {
  --card-pad: 24px;
  --card-gap: 16px;
  --card-shadow: none;
  --kv-name: 9.5rem;
  --fs-figure: 1.6rem;
}
@media (max-width: 47.99rem) {
  body[data-look="live"],
  body[data-look="live"][data-shell="customer"] {
    --card-pad: 16px; --card-gap: 12px; --section-gap: 16px; --grid-gap: 12px; --kv-name: 7.5rem; --fs-figure: 1.3rem;
  }
}
@media (prefers-contrast: more) {
  body[data-look="live"] { --card-line: var(--line-strong); --rule: 1px solid var(--line-strong); }
}

/* ---- C0.2 the page frame: 16px phone gutters, one page head, one group label ---- */
@media (max-width: 47.99rem) { body[data-look="live"] main { padding-inline: var(--gutter); } }
body[data-look="live"] .view > .page-head { align-items: center; margin: 0 0 16px; }
body[data-look="live"] .view > .page-head h2 { font-size: var(--fs-page); }
body[data-look="live"] .view > .outcome:not(:empty) { margin: 0 0 16px; }
body[data-look="live"] :is(.integ-group-title, .list-section, .section-label) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin: 0 0 8px; font-size: var(--fs-sub); font-weight: 700; line-height: 1.5; color: var(--text-muted);
}
body[data-look="live"] #view-queue .list-section {
  font-size: var(--fs-sub); color: var(--text-muted); margin: var(--section-gap) 0 8px;
}
body[data-look="live"] #view-queue .list-section:first-child { margin-top: 0; }
/* inside a card or an overlay the same heading is a section title: the text colour */
body[data-look="live"] :is(.overlay, .block, .integ-card) .list-section { color: var(--text); margin: 8px 0 0; }

/* ---- C0.3 the card. .block IS the card (static html + ~25 builders); the integration card, the matching card, the
   onboarding card and a top-level form are the same card. .block is also a BUTTON class (full-width buttons), hence
   :where(div, section, article, form). Inside an overlay, a sheet or a fold there is no second frame. ---- */
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) {
  display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0;
  margin: 0 0 var(--section-gap); padding: var(--card-pad);
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) > * {
  margin-block: 0; min-width: 0;
}
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) > :where(div, p, ul, section):empty {
  display: none;
}
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) > :is(button, .chip, .help) {
  align-self: flex-start;
}
/* a card inside a card, an overlay, a sheet or a fold is a SECTION of it: no frame of its own */
body[data-look="live"] :is(.block, .integ-card, .mt-off, .ob-card, .overlay, .sheet, details) :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form, .users-section) {
  margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
/* ... with a hairline above it when it follows another section */
body[data-look="live"] :is(.block, .integ-card, .ob-card) > :where(div, section, article, form):is(.block, .create-form, .users-section, .ob-section) ~ :where(div, section, article, form):is(.block, .create-form, .users-section, .ob-section) {
  border-top: var(--rule); padding-top: var(--card-gap);
}
body[data-look="live"] :is(.overlay, .panel-body, .detail-grid) > :where(div, section, article, form):is(.block, .create-form, .users-section, .ob-section) ~ :where(div, section, article, form):is(.block, .create-form, .users-section, .ob-section) {
  border-top: var(--rule); padding-top: var(--card-gap); margin-top: var(--card-gap);
}
/* ... and where the host is not a card: the users editor's two forms, the technical fold's sample account (it follows
   the fold's sentence, so it opens with the hairline and its own column) */
body[data-look="live"] .users-editor { gap: 16px; }
body[data-look="live"] .users-editor > .users-section ~ .users-section { border-top: var(--rule); padding-top: 16px; }
body[data-look="live"] .acct-pilot > :where(div).block {
  display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0;
  margin-top: var(--card-gap); padding-top: var(--card-gap); border-top: var(--rule);
}
body[data-look="live"] .acct-pilot > :where(div).block > * { margin-block: 0; min-width: 0; }
body[data-look="live"] .acct-pilot > :where(div).block > :is(button, .chip, .help) { align-self: flex-start; }
/* a card in a host that spaces its children with a gap (the connection groups, a settings or accounting tab, the
   registrations, the tools page, a card grid) has no margin of its own: grid margins never collapse, so margin + gap
   would double the space */
body[data-look="live"] :is(.integ-list, .integ-group, .cfg-section, .acct-panel, .registrations, .tools-grid, .card-grid) > :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form) {
  margin: 0;
}
body[data-look="live"] .integ-list { gap: var(--section-gap); }
body[data-look="live"] :is(.cfg-section, .acct-panel) { gap: var(--grid-gap); }
body[data-look="live"] .integ-group { gap: 0; }
body[data-look="live"] .integ-group > :where(div, section, article, form):is(.block, .integ-card) ~ :where(div, section, article, form):is(.block, .integ-card) {
  margin-top: var(--grid-gap);
}
/* awaiting set-up: the same card, quieter -- solid hairline, the well colour, no shadow (never dashed) */
body[data-look="live"] .integ-card.integ-pending { border-style: solid; background: var(--well-bg); box-shadow: none; }

/* ---- C0.4 the head: title, optional sub-title, «؟», ONE status chip right after them; head tools at the far end ---- */
body[data-look="live"] :is(.card-head, .block-head, .integ-head) {
  display: flex; flex-flow: row wrap; align-items: center; justify-content: flex-start;
  gap: 4px 12px; margin: 0; min-height: var(--chip-h);
}
body[data-look="live"] :is(.card-head, .block-head, .integ-head) :is(h3, h4),
body[data-look="live"] .home-block-title h3 {
  margin: 0; font-size: var(--fs-card); font-weight: 700; line-height: 1.4;
}
body[data-look="live"] :is(.integ-name, .home-block-title) {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0;
}
body[data-look="live"] :is(.card-sub, .integ-purpose, .board-updated) {
  font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted);
}
body[data-look="live"] :is(.card-head, .block-head, .integ-head) > :is(button, .card-tools, .own-balance-actions) {
  margin-inline-start: auto;
}
body[data-look="live"] .card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* a heading INSIDE a card or an overlay is a section title (the overlay's own head is the card head) */
body[data-look="live"] .overlay :is(.block-head, .card-head) :is(h3, h4),
body[data-look="live"] .overlay .panel-body h4,
body[data-look="live"] :is(.block, .integ-card) h4:not(:is(.block-head, .integ-head, .integ-name, .card-head) > h4) {
  margin: 0; font-size: var(--fs-sub); font-weight: 700;
}

/* ---- C0.5 the overlay is the card: the card surface, one head with a hairline, ONE close look (bordered 44px) ---- */
body[data-look="live"] .overlay,
body[data-look="live"] main > .view.overlay { background: var(--card-bg); }
body[data-look="live"] .overlay .decision-bar { background: var(--card-bg); }
body[data-look="live"] :is(.overlay > .panel-head, .overlay > .page-head, .overlay > .sheet-head) {
  display: flex; flex-flow: row wrap; align-items: center; gap: 4px 12px;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: var(--rule);
}
body[data-look="live"] :is(.overlay > .panel-head, .overlay > .page-head, .overlay > .sheet-head) :is(h2, h3, .panel-title) {
  margin: 0; font-size: var(--fs-card); font-weight: 700; line-height: 1.4;
}
body[data-look="live"] :is(.overlay > .panel-head, .overlay > .page-head, .overlay > .sheet-head) > button.icon-close {
  order: 99; margin-inline-start: auto;
}
body[data-look="live"] button.icon-close {
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
/* the card root an overlay shows (the accounting cards: div.cfg-scope.*-detail) lays out like a card, frameless */
body[data-look="live"] .overlay :where(div).cfg-scope { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] .overlay :where(div).cfg-scope > * { margin-block: 0; min-width: 0; }
body[data-look="live"] .overlay :where(div).cfg-scope > :is(button, .chip) { align-self: flex-start; }

/* ---- C0.6 the ONE key-value list: name | value, the value starts right beside its name, one hairline between rows,
   a reading measure. The same for the customer and staff, in pages, cards and overlays. Lists inside a table (the
   queue's inline confirmation) keep their own lines. ---- */
body[data-look="live"] :where(.kvlist) { display: grid; gap: 0; font-size: var(--fs-body); max-width: var(--measure); }
body[data-look="live"] #view-detail .detail-kv,
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; font-size: var(--fs-body); max-width: var(--measure);
}
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr),
body[data-look="live"] #view-detail .detail-kv > .kv,
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv > .kv,
body[data-look="live"] #profile-body .profile-card .kvlist > .kv {
  display: grid; grid-template-columns: minmax(0, var(--kv-name)) minmax(0, 1fr); gap: 4px 16px;
  align-items: baseline; justify-content: start; text-align: start;
  margin: 0; padding: 8px 0; border: 0; border-top: var(--rule); font-size: var(--fs-body); font-weight: 400;
}
/* the hairline is BETWEEN shown rows: the first shown row has none, even after a hidden row («نسخه» in «درباره») */
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr):not(.kv:not([hidden]) ~ .kv),
body[data-look="live"] #view-detail .detail-kv > .kv:not(.kv:not([hidden]) ~ .kv),
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv > .kv:not(.kv:not([hidden]) ~ .kv),
body[data-look="live"] #profile-body .profile-card .kvlist > .kv:not(.kv:not([hidden]) ~ .kv) { border-top: 0; }
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr) > .kv-name,
body[data-look="live"] #view-detail .detail-kv > .kv > .kv-name,
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv > .kv > .kv-name {
  display: block; color: var(--text-muted); font-size: var(--fs-meta); font-weight: 400;
}
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr) > .kv-value,
body[data-look="live"] #view-detail .detail-kv > .kv > .kv-value,
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv > .kv > .kv-value {
  min-width: 0; text-align: start; overflow-wrap: anywhere; font-weight: 500; font-variant-numeric: tabular-nums;
}
body[data-look="live"] :is(.kvlist, .detail-kv) > .kv:not(tr) > .kv-value .chip { vertical-align: middle; }
/* the row the reader must notice (the amount payable): the same chains as above plus .kv-strong, so it out-ranks them */
body[data-look="live"] .kvlist:not(.data-table *) > .kv.kv-strong:not(tr) > .kv-name,
body[data-look="live"] #view-detail .detail-kv > .kv.kv-strong > .kv-name { color: var(--text); font-weight: 700; }
body[data-look="live"] .kvlist:not(.data-table *) > .kv.kv-strong:not(tr) > .kv-value,
body[data-look="live"] #view-detail .detail-kv > .kv.kv-strong > .kv-value { font-size: var(--fs-card); font-weight: 700; }
body[data-look="live"] .kv-note { display: block; font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted); }
/* technical values (server words, stamps) inside «جزئیات فنی» read as code, quietly */
body[data-look="live"] :is(.acct-tech, .integ-tech) .kv-value bdi.ltr { font-family: var(--mono); font-size: var(--fs-note); }

/* ---- C0.7 figures. ONE tile: the name and its chip on one line, the figure with its unit, then any note. On a page a
   tile is a small card; inside a card or an overlay the tiles share ONE well with hairline dividers. ---- */
body[data-look="live"] .statgrid {
  display: grid; gap: var(--grid-gap); margin: 0 0 var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
@media (min-width: 48rem) {
  /* the home row holds up to four tiles (10rem each fits four in 720px): 3 tiles = 3 columns, 4 = 4, never 3 + 1 */
  body[data-look="live"] #home-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
}
body[data-look="live"] :is(.stat-tile, .holding-tile) {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(var(--chip-h), auto) auto;
  grid-template-areas: "name chip" "fig fig"; align-content: start; gap: 4px 8px; min-width: 0; margin: 0;
  padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
body[data-look="live"] :is(.stat-tile-name, .holding-name) {
  grid-area: name; align-self: center; font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted);
}
body[data-look="live"] :is(.stat-tile, .holding-tile) > .chip { grid-area: chip; align-self: center; justify-self: end; white-space: nowrap; }
body[data-look="live"] :is(.stat-tile-value, .holding-value) {
  grid-area: fig; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 0;
  font-size: var(--fs-figure); font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums;
}
body[data-look="live"] :is(.stat-tile-value, .holding-value) .num { font-size: inherit; }
body[data-look="live"] :is(.stat-tile-value small, .holding-unit) { font-size: var(--fs-meta); font-weight: 500; color: var(--text-muted); }
body[data-look="live"] :is(.stat-tile, .holding-tile) > :not(.stat-tile-name, .holding-name, .chip, .stat-tile-value, .holding-value) {
  grid-column: 1 / -1; margin: 0; font-size: var(--fs-meta); color: var(--text-muted);
}
/* a state word in a figure's place («راه‌اندازی نشده») is drawn as a state, never as a figure */
body[data-look="live"] .stat-tile-value.own-balance-short {
  justify-self: start; display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-2);
  font-size: var(--fs-note); font-weight: 600; color: var(--text-muted);
}
body[data-look="live"] .own-balance-absent { font-size: var(--fs-body); font-weight: 600; color: var(--text-muted); }
/* the in-card well: tiles side by side with a hairline between them, never boxes inside the card */
body[data-look="live"] .holding-grid {
  display: grid; gap: 1px; margin: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--card-line); border: 1px solid var(--card-line); border-radius: var(--well-radius); overflow: hidden;
}
/* the customer's dark shell: the divider in the stronger line, or it all but vanishes on green */
body[data-look="live"][data-shell="customer"] .holding-grid { background: var(--line-strong); }
body[data-look="live"] .holding-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
body[data-look="live"] .holding-grid > .holding-tile {
  padding: 16px; background: var(--well-bg); border: 0; border-radius: 0; box-shadow: none;
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-look="live"] #home-stats > .stat-tile { grid-column: auto; }
  /* home: each balance tile (or the one state / unread tile of an odd set) has the row; the two counts share one */
  body[data-look="live"] #home-stats > :is(.own-balance-home, :first-child:nth-last-child(odd)) { grid-column: 1 / -1; }
  body[data-look="live"] .holding-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-look="live"] :is(.stat-tile, .holding-grid > .holding-tile) { padding: 12px; }
}

/* ---- C0.8 the ONE status line (a state for the whole card or page: chip + words + its link): a well, one row ---- */
body[data-look="live"] :is(.card-status, .acct-strip, .pst-status, .mt-snapshot-bar, .cfg-market-state, div.cfg-scope > .cfg-scope-head) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0;
  padding: 8px 12px; background: var(--well-bg); border: 0; border-radius: var(--well-radius);
  font-size: var(--fs-meta); color: var(--text);
}
/* the posting status holds several lines (the status line, a halt, the laptop's gate, a run): the same well, stacked,
   with room before the sample notice / the overdue documents that follow it in the same host. By its id: the :is()
   above weighs as its heaviest entry (div.cfg-scope > .cfg-scope-head), which a class alone would not out-rank. */
body[data-look="live"] #pst-status { flex-direction: column; align-items: stretch; gap: 8px; margin: 0 0 12px; text-align: start; }
body[data-look="live"] :is(.card-status, .acct-strip, .pst-status, .mt-snapshot-bar, .cfg-market-state) > :is(button.ghost, .card-tools):last-child {
  margin-inline-start: auto;
}
body[data-look="live"] :is(.mt-snapshot-old, .mt-snapshot-partial) { background: var(--warn-bg); }
/* a quiet meta line right under a head (when it was checked, the last price): no well */
body[data-look="live"] :is(.card-meta, .integ-meta) {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; font-size: var(--fs-meta); color: var(--text-muted);
}

/* ---- C0.9 the ONE notice (an answer, a warning, a question): a tinted well with ONE 4px stripe at the start. Each
   keeps its own display; four tones. The Tahesab ✓ banner, the Zaryar answer and «ثبت شد.» are the same thing. ---- */
body[data-look="live"] :is(.outcome, .queue-outcome-line, .acct-banner, .pilot-notice, .pst-interim, .pst-canary,
  .integ-interim-head, .ob-confirm, .pst-confirm, .acct-link-confirm, .inline-confirm:not(.inline-confirm-line, .data-table *),
  .acct-health-result > p) {
  padding: 10px 12px; border: 0; border-inline-start: var(--edge) solid var(--gold); border-radius: var(--well-radius);
  background: var(--well-bg); color: var(--text); font-size: var(--fs-body); font-weight: 400; line-height: 1.7;
}
body[data-look="live"] :is(.outcome.good, .queue-outcome-line:not(.bad, .warn, .neutral), .acct-health-ok > p) {
  border-inline-start-color: var(--ok); background: var(--ok-bg);
}
body[data-look="live"] :is(.outcome.bad, .queue-outcome-line.bad, .ob-confirm.ob-reject-box) {
  border-inline-start-color: var(--sell); background: var(--danger-soft);
}
body[data-look="live"] :is(.outcome.warn, .queue-outcome-line.warn, .acct-banner, .pilot-notice, .pst-interim, .pst-canary,
  .integ-interim-head, .acct-health-bad > p) {
  border-inline-start-color: var(--warn-line); background: var(--warn-bg);
}
body[data-look="live"] .queue-outcome-line.neutral { border-inline-start-color: var(--line-strong); }
body[data-look="live"] :is(.outcome, .pst-canary, .ob-confirm, .inline-confirm) h4 { margin: 0; font-size: var(--fs-sub); font-weight: 700; }
/* an empty notice is never drawn (re-asserted: the rule above out-ranks .outcome:empty) */
body[data-look="live"] :is(.outcome, .queue-outcome-line, .acct-banner, .pilot-notice, .pst-interim, .inline-confirm):empty { display: none; }
/* the destructive zone of a sheet («خارج کردن از معامله»): tinted, so it stays apart on the card surface */
body[data-look="live"] .cfg-danger { background: var(--danger-soft); border-color: var(--danger-soft); border-radius: var(--well-radius); }
/* an empty state: one quiet sentence in the card, never a box inside the card */
body[data-look="live"] :is(.block, .integ-card) :is(.empty, .empty-state, .acct-not-configured) {
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text-muted); font-size: var(--fs-body);
}
/* the accounting caveat («تأییدنشده · ...») is a qualifier beside its value, not a second chip: quiet warn text */
body[data-look="live"] .notconfirmed {
  display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none;
  font-size: var(--fs-meta); font-weight: 600; color: var(--warn-ink); white-space: normal;
}

/* ---- C0.10 chips and counts: ONE pill size; ONE count badge ---- */
body[data-look="live"] .chip {
  min-height: var(--chip-h); padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-note); font-weight: 600; line-height: 1.4; vertical-align: middle;
}
body[data-look="live"] .chip.notconfirmed { min-height: 0; padding: 0; border: 0; background: none; }
body[data-look="live"] :is(.acct-count, .tab-count, .ob-chip-count) {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 6px;
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---- C0.11 actions. Head tools (refresh, «همه ... ‹») at the head's end; a TOOLBAR right under the head for the controls
   that act on a page card's subject (a check, a switch, a mode, a stop) with its answer right under it; a FOOT for a
   form's commit (save, confirm) and for an overlay's actions. RTL order: the one primary first (rightmost), then
   secondary, then ghost links; a destructive verb alone at the far end. ---- */
body[data-look="live"] :is(.card-bar, .card-foot, .create-actions, .own-balance-actions, .acct-panel-actions, .acct-case-actions,
  .pst-trade-actions, .pst-canary-actions, .mt-outcome-actions, .cfg-money-actions, .pcat-actions, .zr-controls) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px;
}
body[data-look="live"] :is(.card-bar, .card-foot, .create-actions, .acct-panel-actions, .acct-case-actions, .pst-trade-actions,
  .cfg-money-actions, .zr-controls, .ob-decision-bar) > :is(.danger, .danger-outline):not(:first-child) {
  margin-inline-start: auto;
}
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) > :is(.card-foot, .create-actions, .cfg-money-actions) {
  margin-top: auto; padding-top: 12px; border-top: var(--rule);
}
/* the customer profile's foot («خروج از حساب») spans the card: the card is a column now, so the old centring would
   shrink it to a pill */
body[data-look="live"] #profile-body .profile-actions { align-self: stretch; }
/* an acknowledgement in a row («✓ ثبت مشاهده») is a button like the row's other actions, not a text link */
body[data-look="live"] button.ack-btn { border: 1px solid var(--line-strong); background: var(--surface); }

/* ---- C0.12 tables. A collection on a page keeps its own frame; a table inside a card or an overlay has none (one
   frame); a phone row-card reads like a key-value list; filter bars wrap into pills instead of clipping. Desk cells
   stay centred (owner 2026-11-05; TP-1). ---- */
body[data-look="live"] :is(.block, .integ-card, .overlay) .data-table-wrap { margin: 0; }
body[data-look="live"] :is(.block, .integ-card, .overlay) .data-table { border: 0; border-radius: 0; background: transparent; }
body[data-look="live"] :is(.block, .integ-card, .overlay) .data-table thead th:first-child { border-start-start-radius: var(--well-radius); border-end-start-radius: var(--well-radius); }
body[data-look="live"] :is(.block, .integ-card, .overlay) .data-table thead th:last-child { border-start-end-radius: var(--well-radius); border-end-end-radius: var(--well-radius); }
body[data-look="live"] :is(.block, .integ-card, .overlay) .data-table thead th { border-bottom: 0; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .data-table:not(.keep-table) td[data-label] { grid-template-columns: minmax(0, var(--kv-name)) minmax(0, 1fr); }
  /* a line an area marked empty («—», data-empty="yes") is dropped from the phone card; the desk table keeps it */
  body[data-look="live"] .data-table:not(.keep-table) td[data-empty="yes"]:not(.col-primary, .col-badge, .col-actions) { display: none; }
  body[data-look="live"] .segmented.filterbar:not(.acct-tabs, .cfg-tabs, .customers-tabs, .zr-modes) {
    flex-wrap: wrap; overflow: visible; gap: 6px; border: 0; border-radius: 0; background: transparent;
  }
  body[data-look="live"] .segmented.filterbar:not(.acct-tabs, .cfg-tabs, .customers-tabs, .zr-modes) > button {
    flex: 0 1 auto; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  }
}

/* ---- C0.13 folds: ONE «جزئیات» fold -- 44px summary, quiet, the turning «‹», a hairline above it, always the last part ---- */
body[data-look="live"] :is(.acct-tech, .integ-tech, .prd-fold, .acct-digest-fold, .dir-edit-more) > summary {
  display: flex; align-items: center; gap: 8px; width: fit-content; min-height: var(--tap); cursor: pointer;
  list-style: none; font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted);
}
body[data-look="live"] :is(.acct-tech, .integ-tech, .prd-fold, .acct-digest-fold, .dir-edit-more) > summary::-webkit-details-marker { display: none; }
body[data-look="live"] :is(.acct-tech, .integ-tech, .prd-fold, .acct-digest-fold, .dir-edit-more) > summary::after {
  content: "‹"; display: inline-block; margin: 0; transition: transform 0.15s; color: var(--text-muted); font-weight: 400;
}
body[data-look="live"] :is(.acct-tech, .integ-tech, .prd-fold, .acct-digest-fold, .dir-edit-more)[open] > summary::after { transform: rotate(-90deg); }
body[data-look="live"] :is(.block, .integ-card, div.cfg-scope, .panel-body) > :is(.acct-tech, .integ-tech):last-child {
  border-top: var(--rule); padding-top: 4px;
}
body[data-look="live"] :is(.acct-tech, .integ-tech) :is(.acct-tech, .integ-tech) { border-top: 0; padding-inline-start: 12px; }
@media (prefers-reduced-motion: reduce) {
  body[data-look="live"] :is(.acct-tech, .integ-tech, .prd-fold, .acct-digest-fold, .dir-edit-more) > summary::after { transition: none; }
}

/* ---- C0.14 grids and strips: peer cards side by side with equal heights; a strip with ONE tab is a title ---- */
body[data-look="live"] .card-grid {
  display: grid; gap: var(--grid-gap); align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
body[data-look="live"] .card-grid > * { margin: 0; }
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs):not(:has(> button:not([hidden]) ~ button:not([hidden]))) {
  overflow: visible; border: 0; background: none;
}
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs):not(:has(> button:not([hidden]) ~ button:not([hidden]))) > button {
  flex: 0 0 auto; padding-inline: 0; border: 0; background: none; color: var(--text);
  font-size: var(--fs-sub); font-weight: 700; cursor: default;
}

/* ---- C0.15 forced colours keep every edge ---- */
@media (forced-colors: active) {
  body[data-look="live"] :is(.block, .integ-card, .stat-tile, .holding-grid, .chip, .outcome, .acct-banner, .pst-canary) {
    border: 1px solid CanvasText;
  }
}

/* ---- C0.16 shared changes the area packages asked for (integration): a full-width button is a button, not a card;
   a figure and its unit share one baseline in every tile; a row's details overlay keeps its X on the title's line, the
   title centred on the X like every other overlay head (critique round 1, B1) ---- */
body[data-look="live"] button.block { margin-bottom: 0; padding-block: 8px; box-shadow: none; }
body[data-look="live"] :is(.stat-tile-value, .holding-value) > .num { align-self: baseline; }
body[data-look="live"] .overlay.row-details > .panel-head { flex-wrap: nowrap; align-items: center; }
body[data-look="live"] .overlay.row-details > .panel-head .panel-title { flex: 1 1 auto; min-width: 0; }
body[data-look="live"] .overlay.row-details > .panel-head > button { flex: 0 0 auto; }
/* a «؟» written inside a card's title («سوابق ساخت در ته‌حساب») keeps the same gap from the words as a «؟» beside the
   title (the head's 12px gap less the «؟»'s own -5px), never touching them (critique round 2, n5) */
body[data-look="live"] :is(.block-head, .card-head) > :is(h3, h4) > .help:last-child { margin-inline-start: 7px; }

/* ---- area sub-slots: each package writes ONLY between its own begin / end lines (keep the blank spacer lines) ---- */
/* --- C1 customer pages (package P1): begin --- */
/* a head tool (refresh, «همه ... ‹») keeps its 44px hit area but does not make the head taller than its title: the
   title sits at the card's top padding and the body follows one gap under it */
body[data-look="live"] :is(#view-home, #view-wallet) .block-head > button.small,
body[data-look="live"] #own-balance #btn-own-balance-refresh { margin-block: -10px; }

/* the home tiles: the figure and its unit on ONE baseline (the global .ltr { align-self: start } would lift the unit) */
body[data-look="live"] #home-stats .stat-tile-value > .num,
body[data-look="live"] #own-balance .holding-value > .num { align-self: baseline; }
@media (min-width: 48rem) {
  /* two balance tiles and the two counts: the balances get the room their figure and unit need on one line */
  body[data-look="live"] #home-stats:has(> .own-balance-home ~ .own-balance-home) {
    grid-template-columns: minmax(0, 3fr) minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr);
  }
}

/* the home's «قیمت‌ها»: the board is the card's body, not a second frame inside it (frame properties only -- the rows,
   their grid, the buttons and every figure keep their own rules: RUI-6, UR0-5). Its heading row is the same rounded
   tinted strip as a table's head in a card; the basis line is a quiet note under the last row. */
/* its sub-title says how many prices it shows; a VIP customer's chip follows it (one head order: title, sub-title, chip) */
body[data-look="live"] .home-block-title > #home-board-count-pcat { order: 1; align-self: center; }
body[data-look="live"] .home-excerpt > #home-board {
  margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
body[data-look="live"] .home-excerpt > #home-board > .board-headrow {
  border-bottom: 0; border-radius: var(--well-radius); background: var(--well-bg);
}
body[data-look="live"] .home-excerpt > #home-board > .board-basis {
  padding: 8px 0 0; border-top: 0; background: transparent;
}

/* «حساب من»: «به‌روزرسانی» at the head's end and its acknowledgement right under the head (DOM unchanged: J2) */
body[data-look="live"] #own-balance {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--card-gap) 12px; align-items: center;
}
body[data-look="live"] #own-balance > *,
body[data-look="live"] #own-balance > .own-balance-actions > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
body[data-look="live"] #own-balance > .block-head { grid-column: 1; grid-row: 1; }
body[data-look="live"] #own-balance > .own-balance-actions { display: contents; }
body[data-look="live"] #own-balance #btn-own-balance-refresh { grid-column: 2; grid-row: 1; justify-self: end; }
body[data-look="live"] #own-balance .own-balance-ack { grid-row: 2; font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] #own-balance > :is(.own-balance-time, .own-balance-coins, .own-balance-unposted) {
  font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.6;
}
/* the quiet notes under the well read as one group: a small step between them, the card's gap above the first */
body[data-look="live"] #own-balance > :is(.own-balance-time, .own-balance-state, .own-balance-coins, .own-balance-unposted) + :is(.own-balance-coins, .own-balance-unposted) {
  margin-top: -10px;
}
body[data-look="live"] #own-balance > .own-balance-state { font-size: var(--fs-body); color: var(--text); }
/* in the well each tile is name + side chip, then the figure and its unit, then its sentence */
body[data-look="live"] #own-balance .holding-tile { row-gap: 8px; }
body[data-look="live"] #own-balance .own-balance-sentence { font-size: var(--fs-meta); color: var(--text-muted); }

/* the ticket: one overlay head (title, then the bordered 44px close at its end, a hairline under it), the facts in the
   one list with a name column that fits the ticket's words, the estimate as the hero well (not a gold-striped notice) */
body[data-look="live"] #trade-ticket > .sheet-head {
  gap: 12px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: var(--rule);
}
body[data-look="live"] #trade-ticket > .sheet-head h3 { margin: 0; font-size: var(--fs-card); font-weight: 700; line-height: 1.4; }
body[data-look="live"] #btn-close-ticket {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-width: var(--tap); min-height: var(--tap); padding: 0; margin-inline-start: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
body[data-look="live"] #btn-close-ticket svg { width: 22px; height: 22px; }
body[data-look="live"] #trade-ticket { --kv-name: 8.5rem; }
/* a little wider on a desk, so the cut-off sentence («مهلت ثبت») keeps one line */
@media (min-width: 48rem) { body[data-look="live"] #trade-ticket { width: min(36rem, calc(100vw - 2rem)); } }
/* the ticket's lists: the name column as wide as its longest name (no more), so a fact's sentence keeps its line */
body[data-look="live"] #trade-ticket .kvlist { grid-template-columns: fit-content(11rem) minmax(0, 1fr); column-gap: 16px; max-width: none; }
body[data-look="live"] #trade-ticket .kvlist > .kv { grid-column: 1 / -1; grid-template-columns: subgrid; }
body[data-look="live"] #trade-preview {
  padding: 12px 16px; border: 0; border-radius: var(--well-radius); background: var(--well-bg);
}
body[data-look="live"] #trade-preview:not(:empty) { display: grid; gap: 4px; }
body[data-look="live"] #trade-preview > * { margin: 0; }
body[data-look="live"] #trade-preview > .kvlist { max-width: none; }
body[data-look="live"] #trade-preview > .fact-note { font-size: var(--fs-meta); color: var(--text-muted); }
/* the amount payable is the hero: its name, then the figure large under it */
body[data-look="live"] #trade-preview .kvlist > .kv.kv-strong > :is(.kv-name, .kv-value) { grid-column: 1 / -1; }
body[data-look="live"] #trade-preview .kvlist > .kv.kv-strong > .kv-value { font-size: var(--fs-hero); line-height: 1.3; }
/* a phone (critique round 2, A): the whole ticket, «می‌خرم / می‌فروشم — ثبت درخواست» included, fits a 390 x 844 screen
   without scrolling the sheet -- each rule's name over its sentence, the sentence one quiet line (as before the card
   system); the amount payable on its name's line, bold in the card-title size (a long amount puts its unit under it);
   no double space above the estimate; a closer head */
@media (max-width: 47.99rem) {
  body[data-look="live"] #trade-ticket > .sheet-head { margin-bottom: 8px; }
  body[data-look="live"] #btn-close-ticket { margin-block: -4px; }
  body[data-look="live"] #trade-ticket .ticket-form > .kvlist { grid-template-columns: minmax(0, 1fr); }
  body[data-look="live"] #trade-ticket .ticket-form > .kvlist > .kv { grid-template-columns: minmax(0, 1fr); row-gap: 2px; padding-block: 6px; }
  body[data-look="live"] #trade-ticket .ticket-form > .kvlist > .kv > .kv-value { font-size: var(--fs-meta); line-height: 1.6; }
  body[data-look="live"] #trade-preview { margin-top: 0; padding-inline: 12px; }
  body[data-look="live"] #trade-preview > .kvlist,
  body[data-look="live"] #trade-preview > .kvlist > .kv { column-gap: 12px; }
  body[data-look="live"] #trade-preview .kvlist > .kv.kv-strong > .kv-name { grid-column: 1; }
  body[data-look="live"] #trade-preview .kvlist > .kv.kv-strong > .kv-value {
    grid-column: 2; font-size: var(--fs-card); line-height: 1.4; white-space: normal;
  }
}

/* «درخواست‌ها»: the status filter is the same wrapping pill row as every staff filter (critique round 1, M6) -- on a
   desk and on a phone (it was a segmented box on a desk and a 2 x 2 grid of cells on a phone) */
body[data-look="live"] #requests-filter.filterbar:not([hidden]) {
  display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; width: auto;
  border: 0; border-radius: 0; background: transparent;
}
body[data-look="live"] #requests-filter.filterbar > button {
  flex: 0 0 auto; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
}
body[data-look="live"] #requests-filter.filterbar > button[aria-pressed="true"] { border-color: var(--gold); }

/* the home's «قیمت‌ها» on a phone with the VIP chip (m9): the count steps aside so «همهٔ قیمت‌ها ‹» keeps the title's line */
@media (max-width: 47.99rem) {
  body[data-look="live"] .home-block-title:has(> #home-board-count-pcat) > #home-board-count { display: none; }
}
/* «دستهٔ قیمت: ویژه» in «پروفایل» is the same chip staff see for a VIP customer (m10); the row only exists for one */
body[data-look="live"] #profile-body .profile-card .kvlist > .kv:nth-child(3) > .kv-value {
  display: inline-flex; align-items: center; justify-self: start; width: fit-content; min-height: var(--chip-h);
  padding: 0 10px; border: 1px solid var(--gold); border-radius: var(--radius-pill); background: var(--gold-soft);
  color: var(--gold-ink); font-size: var(--fs-note); font-weight: 600; line-height: 1.4;
}

/* «پروفایل»: full width; facts | switches on a desk; a quiet foot */
body[data-look="live"] #profile-body .profile-card { max-width: none; }
body[data-look="live"] #profile-body .profile-card > .profile-switch { margin: 0; padding-top: var(--card-gap); }
body[data-look="live"] #profile-body .profile-switch-label { font-size: var(--fs-body); font-weight: 600; }
body[data-look="live"] #profile-body .profile-switch-hint { font-size: var(--fs-meta); line-height: 1.6; }
body[data-look="live"] #profile-body .profile-card > .profile-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding-top: 16px; border-top: var(--rule);
}
/* its buttons are buttons («secondary block»), not cards: no card margin, shadow or padding from .block */
body[data-look="live"] #profile-body .profile-card > .profile-actions > button {
  margin: 0; padding-block: 0; min-height: var(--tap); box-shadow: none; font-size: var(--fs-body);
}
@media (min-width: 48rem) {
  body[data-look="live"] #profile-body .profile-card > .profile-actions > button { width: auto; flex: 0 0 auto; padding-inline: 24px; }
}
@media (min-width: 64rem) {
  body[data-look="live"] #profile-body .profile-card {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; row-gap: var(--card-gap);
    align-items: start;
  }
  body[data-look="live"] #profile-body .profile-card > .kvlist { grid-column: 1; grid-row: 1 / span 3; }
  body[data-look="live"] #profile-body .profile-card > :is(.profile-switch, .profile-switch-note) { grid-column: 2; }
  body[data-look="live"] #profile-body .profile-card > .kvlist + .profile-switch { border-top: 0; padding-top: 0; }
  body[data-look="live"] #profile-body .profile-card > .profile-actions { grid-column: 1 / -1; }
}
/* --- C1 customer pages (package P1): end --- */

/* --- C2 requests, queue, price board and VIP prices (package P2): begin --- */
/* The request overlay (both readers), the decision queue, the pricing toolbar and the «قیمت‌های ویژه» panel. Layout
   only: no word, control, order of the markup or behaviour changes; every value below is a token of the slot. */

/* -- the request overlay: the customer reads the staff's list; the leading amount is the hero well (spec §10.5) -- */
body[data-look="live"] #view-detail[data-reader="customer"] .detail-kv > .kv > .kv-name {
  display: block; font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted);
}
body[data-look="live"] #view-detail[data-reader="customer"] .amount-hero {
  padding: 12px 16px; border: 0; border-radius: var(--well-radius); background: var(--well-bg); box-shadow: none;
}
body[data-look="live"] #view-detail[data-reader="customer"] .amount-hero-value { font-size: var(--fs-hero); }
body[data-look="live"] #view-detail[data-reader="customer"] .detail-amount { gap: 8px; margin: 0 0 12px; }
body[data-look="live"] #view-detail .detail-more > summary {
  min-height: var(--tap); font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted);
}
/* the sections of the overlay follow one another with their own spacing (no grid gap: the status lines continue the
   list right under it, with the list's own hairline) */
body[data-look="live"] #view-detail .detail-grid { gap: 0; }
body[data-look="live"] #view-detail .detail-grid > .detail-overview { gap: 0; }
/* «وضعیت / حسابداری / تسویه» (INV-060, each its own line): rows of the SAME name | value list -- the list's name
   column, its hairline between rows, its value weight -- for the customer and for staff (CRITIQUE-P0 R9) */
body[data-look="live"] #view-detail .axes-block.axes-lines { margin: 0; padding: 0; border: 0; background: transparent; }
body[data-look="live"] #view-detail .axes-block.axes-lines .axes {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; border: 0; max-width: var(--measure);
}
body[data-look="live"] #view-detail .axes-block.axes-lines .axis {
  display: grid; grid-template-columns: minmax(0, var(--kv-name)) minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  margin: 0; padding: 8px 0; border: 0; border-top: var(--rule); border-radius: 0; background: transparent;
}
body[data-look="live"] #view-detail .axes-block.axes-lines .axis[hidden] { display: none; }
body[data-look="live"] #view-detail .axes-block.axes-lines .axis > h4 {
  margin: 0; font-size: var(--fs-meta); font-weight: 400; line-height: inherit; color: var(--text-muted);
}
body[data-look="live"] #view-detail .axes-block.axes-lines .axis-body { min-width: 0; font-size: var(--fs-body); }
body[data-look="live"] #view-detail .axes-block.axes-lines :is(.axis-state, #axis-approval .axis-state) {
  font-size: var(--fs-body); font-weight: 500;
}
body[data-look="live"] #view-detail .axes-block.axes-lines .axis-said { font-size: var(--fs-meta); }
/* staff: the amount is the list's strong row (the name column, the hairline), its lock note under the value */
body[data-look="live"] #view-detail[data-reader="staff"] .detail-amount { gap: 0; margin: 0; }
body[data-look="live"] #view-detail[data-reader="staff"] .amount-hero {
  grid-template-columns: minmax(0, var(--kv-name)) minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  padding: 8px 0; border-top: var(--rule); max-width: var(--measure);
}
body[data-look="live"] #view-detail[data-reader="staff"] .amount-hero-name { font-size: var(--fs-meta); font-weight: 700; color: var(--text); }
body[data-look="live"] #view-detail[data-reader="staff"] .amount-hero-value { font-size: var(--fs-card); }
body[data-look="live"] #view-detail[data-reader="staff"] .detail-amount > .fact-note {
  margin: -4px 0 0; padding: 0 0 8px; padding-inline-start: calc(var(--kv-name) + 16px); font-size: var(--fs-meta);
}
/* the amount's parts (gross, commission, tax): rows of the same list */
body[data-look="live"] #view-detail .detail-amount .amount-parts { gap: 0; font-size: var(--fs-body); max-width: var(--measure); }
body[data-look="live"] #view-detail .detail-amount .amount-parts > .kv { padding: 8px 0; }
body[data-look="live"] #view-detail[data-reader="staff"] .detail-amount .amount-parts > .kv,
body[data-look="live"] #view-detail .detail-amount .amount-parts > .kv + .kv { border-top: var(--rule); }
/* the Zaryar block of a request (staff): its own section after the request's list, right above the decision --
   head (title + its ONE chip), the facts, ONE toolbar with the destructive stop at its far end, the answer under it */
body[data-look="live"] #view-detail .detail-grid > .detail-zaryar { order: 1; }
body[data-look="live"] #view-detail .detail-grid > .decision { order: 2; }
body[data-look="live"] #view-detail .detail-grid > .detail-more { order: 3; }
body[data-look="live"] #view-detail .detail-grid > .block.detail-zaryar:not([hidden]) {
  display: flex; flex-direction: column; gap: var(--card-gap);
  margin: 16px 0 0; padding: 16px 0 0; border: 0; border-top: var(--rule);
}
body[data-look="live"] #view-detail .detail-zaryar > * { margin: 0; min-width: 0; }
body[data-look="live"] #view-detail .detail-zaryar > .block-head.spread { justify-content: flex-start; gap: 4px 12px; }
body[data-look="live"] #view-detail .detail-zaryar > .block-head h3 { margin: 0; }
body[data-look="live"] #view-detail .detail-zaryar .zr-hedge-why { font-size: var(--fs-body); color: var(--text); }
body[data-look="live"] #view-detail .zr-hedge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body[data-look="live"] #view-detail .zr-hedge-actions > :is(.danger, .danger-outline):not(:first-child) { margin-inline-start: auto; }
body[data-look="live"] #view-detail .zr-hedge-actions > button { min-height: var(--tap); padding-inline: 16px; }
/* the decision bar on the overlay's own surface (the page colour made a band); the fold «جزئیات بیشتر» last */
body[data-look="live"] #view-detail .decision.decision-bar { margin-top: 16px; background: var(--card-bg); }
body[data-look="live"] #view-detail .detail-grid > .detail-more { margin-top: 16px; }
body[data-look="live"] #view-detail .detail-more > .block { margin-top: 16px; padding-top: 12px; border-top: var(--rule); }
body[data-look="live"] #view-detail .detail-more > .block > .block-head h3 { margin: 0 0 8px; }
/* «ارسال به زریار» is a step (secondary), not the overlay's commit: the decision bar under the section holds the one
   filled primary; the filled stop stands alone at the row's far end, on a phone too (critique round 1, M4) */
body[data-look="live"] #view-detail .detail-zaryar .zr-hedge-actions > * { flex: 0 0 auto; }

/* -- the decision queue: a group label sits 8px over its own table and a section's gap after the one before (R14) -- */
body[data-look="live"] #queue-list { gap: 0; }
body[data-look="live"] #queue-list > .data-table-wrap { margin: 0; }
body[data-look="live"] #view-queue #queue-list > .list-section { margin: var(--section-gap) 0 8px; }
body[data-look="live"] #view-queue #queue-list > .list-section:first-of-type { margin-top: 0; }
body[data-look="live"] #queue-list > .queue-more { justify-self: start; margin-top: 12px; }
/* the waiting and the decided tables share their leading columns' widths, so the request, the quantity, the amount and
   the customer line up from one table to the next (critique round 1, M7). Every column is given its share (the state
   chip and the action cells carry a 1% width of their own, which made every column a percentage one, so a partial set
   was scaled differently in each table). Preferred widths only: the table keeps its automatic layout, so a wide cell
   still gets its room (UR0-1) */
@media (min-width: 48rem) {
  body[data-look="live"] .data-table.queue-table th[data-col="درخواست"] { width: 18%; }
  body[data-look="live"] .data-table.queue-table th[data-col="مقدار"] { width: 11%; }
  body[data-look="live"] .data-table.queue-table th[data-col="مبلغ"] { width: 13%; }
  body[data-look="live"] .data-table.queue-table th[data-col="مشتری"] { width: 19%; }
  body[data-look="live"] .data-table.queue-table th.col-date[data-col="زمان ثبت"] { width: 12%; }
  body[data-look="live"] .data-table.queue-table th.col-text[data-col="تصمیم"] { width: 15%; }
  body[data-look="live"] .data-table.queue-table th[data-col="وضعیت"] { width: 24%; }
  body[data-look="live"] .data-table.queue-table:has(th.col-actions) th[data-col="وضعیت"] { width: 10%; }
  body[data-look="live"] .data-table.queue-table th.col-actions { width: 17%; }
  body[data-look="live"] .data-table.queue-table:has(th[data-col="حسابداری"]) th[data-col="وضعیت"] { width: 12%; }
  body[data-look="live"] .data-table.queue-table th[data-col="حسابداری"] { width: 13%; }
}
@media (min-width: 80rem) {
  /* a wide desk: a product's and a customer's name each keep ONE line (UR2-7); the column takes the room it needs */
  body[data-look="live"] .data-table.queue-table :is(.reqcard-asset, .reqcard-who) { white-space: nowrap; }
}
@media (min-width: 48rem) and (max-width: 79.99rem) {
  /* the waiting table's time column steps aside here (a staff desk rule): its share goes to the decision cell */
  body[data-look="live"][data-shell="staff"] .data-table.queue-table th.col-actions { width: 29%; }
}

/* -- «قیمت‌گذاری»: the controls over the board are ONE toolbar -- the market, the step (its note under it) and the
   switches side by side, wrapping whole groups; no change to any board row, cell or figure (UR0-5, RUI-6) -- */
body[data-look="live"] #board-controls.board-controls:not([hidden]) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
  margin: 0 0 16px; padding: 12px 16px;
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
}
body[data-look="live"] #board-controls > :is(.board-market, .board-step, .board-switches) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; min-width: 0;
}
body[data-look="live"] #board-controls > .board-step { flex: 0 1 auto; row-gap: 4px; }
/* the step's note is its own line under the step, and never widens the group (width 0, at least the group's width) */
body[data-look="live"] #board-controls > .board-step > .board-step-note {
  flex: 0 0 auto; width: 0; min-width: 100%; font-size: var(--fs-meta);
}
/* the switches take the row's remaining room at its far end; a chip that does not fit beside them (the Zaryar price's
   age, the generator's state) goes under them inside the group, not the whole group to a second toolbar line */
body[data-look="live"] #board-controls > .board-switches { flex: 1 1 26rem; justify-content: flex-end; gap: 8px; }
body[data-look="live"] #board-controls > .inline-confirm.board-confirm { flex: 1 1 100%; margin: 0; }
body[data-look="live"] #view-board > .pcat-tabs { margin: 0 0 12px; }
/* «قیمت‌های ویژه»: the lead line is a status line */
body[data-look="live"] .pcat-lead {
  padding: 8px 12px; margin: 0 0 12px; border-radius: var(--well-radius); background: var(--well-bg); font-size: var(--fs-meta);
}
body[data-look="live"] #board-body > .pcat-lead + .data-table-wrap { margin-top: 0; }
body[data-look="live"] .pcat-lead > .pcat-count { margin-inline-start: auto; }
@media (max-width: 47.99rem) {
  /* a phone: each group its own line, a hairline between them */
  body[data-look="live"] #board-controls.board-controls:not([hidden]) { gap: 12px; padding: 12px; }
  body[data-look="live"] #board-controls > :is(.board-market, .board-step, .board-switches) { flex: 1 1 100%; justify-content: flex-start; }
  body[data-look="live"] #board-controls > :is(.board-step, .board-switches) { padding-top: 12px; border-top: var(--rule); }
}

/* -- the «قیمت‌های ویژه» panel: the two sides side by side, each a well with the side's stripe; «ثبت» in a foot -- */
body[data-look="live"] .pcat-details > .panel-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* its head keeps the X beside a long title on a phone (the title wraps, the X never drops under it); the title is
   centred on the X like every other overlay head (critique round 1, B1) */
body[data-look="live"] .overlay.pcat-details > .panel-head { flex-wrap: nowrap; align-items: center; }
body[data-look="live"] .overlay.pcat-details > .panel-head > .panel-title { flex: 1 1 auto; min-width: 0; }
body[data-look="live"] .pcat-details .pcat-side {
  --kv-name: 6.5rem;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  margin: 0; padding: 12px; border: 0; border-inline-start: var(--edge) solid var(--line-strong);
  border-radius: var(--well-radius); background: var(--well-bg);
}
body[data-look="live"] .pcat-details .pcat-side.buy { border-inline-start-color: var(--buy); }
body[data-look="live"] .pcat-details .pcat-side.sell { border-inline-start-color: var(--sell); }
body[data-look="live"] .pcat-details .pcat-side > h4 { margin: 0; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .pcat-details .pcat-side > .kvlist { max-width: none; }
body[data-look="live"] .pcat-details .pcat-field { margin: 0; padding-top: 8px; border-top: var(--rule); gap: 4px; }
body[data-look="live"] .pcat-details .pcat-amount-label { font-size: var(--fs-meta); font-weight: 600; }
body[data-look="live"] .pcat-details .pcat-field input { max-width: none; min-height: var(--tap); background: var(--card-bg); }
body[data-look="live"] .pcat-details .pcat-field .fact-note { font-size: var(--fs-meta); }
body[data-look="live"] .pcat-details .pcat-actions { margin: 0; padding-top: 12px; border-top: var(--rule); }
body[data-look="live"] .pcat-details .pcat-actions > button { min-height: var(--tap); padding-inline: 24px; }
body[data-look="live"] .pcat-details .pcat-outcome { margin: 0; }
@media (min-width: 48rem) {
  body[data-look="live"] .pcat-details > .panel-body {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: stretch;
  }
  body[data-look="live"] .pcat-details > .panel-body > :not(.pcat-side) { grid-column: 1 / -1; }
}
/* a request's phone card: the state chip on the far side stands centred on the title's line (critique round 2, n7 --
   it sat at the top of the 44px opener, about 9px above the side chip and the name), like the other phone cards; two
   chips (a waiting request's state and its time left) stack at the far edge, so the name keeps the room it needs */
@media (max-width: 47.99rem) {
  body[data-look="live"] .data-table.req-table:not(.keep-table) td.col-badge { align-self: center; max-width: 11rem; }
  body[data-look="live"] .data-table.req-table:not(.keep-table) td.col-badge .reqcard-state { justify-content: flex-end; }
}
/* --- C2 requests, queue, price board and VIP prices (package P2): end --- */

/* --- C3 customers, registrations, matching, presence, users (package P3): begin --- */
/* «مشتریان» › فهرست: ONE toolbar -- the search grows (as wide as the «کاربران» search), the «ته‌حساب» filter keeps its
   own width beside it; a phone stacks them full width */
body[data-look="live"] #customers-form.dir-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; max-width: none; margin: 0 0 12px;
}
body[data-look="live"] #customers-form.dir-controls > .cfg-field { flex: 0 1 14rem; min-width: 0; }
body[data-look="live"] #customers-form.dir-controls > #customers-query-field { flex: 1 1 20rem; max-width: 32rem; }
body[data-look="live"] #customers-directory > .dir-counts { margin: 0 0 8px; font-size: var(--fs-meta); }
/* «ورود» and «دسته»: every state is a chip (the words unchanged) */
body[data-look="live"] .data-table :is(.dir-login-word, .pcat-regular) {
  display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-2);
  font-size: var(--fs-note); font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
body[data-look="live"] .data-table .dir-login-word:not(.muted-word) { color: var(--text); }
/* «حضور»: the last-seen words one quiet line beside the state */
body[data-look="live"] .data-table .prs-cell { flex-wrap: nowrap; gap: 0 6px; }
body[data-look="live"] .data-table .prs-cell .cell-sub {
  flex-basis: auto; font-size: var(--fs-note); color: var(--text-muted); white-space: nowrap;
}
@media (max-width: 47.99rem) {
  body[data-look="live"] #customers-form.dir-controls > :is(.cfg-field, #customers-query-field) { flex: 1 1 100%; max-width: none; }
  /* the requests count is a line of the card like the others (the desk's 1% column width must not hold here) */
  body[data-look="live"] .data-table.dir-table:not(.keep-table) td.dir-requests { width: auto; white-space: normal; }
  body[data-look="live"] .data-table.dir-table:not(.keep-table) .prs-cell { justify-content: flex-start; flex-wrap: wrap; }
  body[data-look="live"] .data-table.dir-table:not(.keep-table) .prs-cell .cell-sub { white-space: normal; }
  /* a chip in a card's value column keeps its own width, at the start of the column */
  body[data-look="live"] .data-table.dir-table:not(.keep-table) td > :is(.dir-login-word, .pcat-regular) {
    justify-self: start; width: fit-content;
  }
}

/* the profile overlay's head: the name with its chips on one line, its actions just before the X, the X last */
body[data-look="live"] #customer-profile > .page-head.profile-head { align-items: center; }
body[data-look="live"] #customer-profile .profile-titles { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
body[data-look="live"] #customer-profile .profile-titles h3 { font-size: var(--fs-card); line-height: 1.4; }
body[data-look="live"] #customer-profile .profile-chips { gap: 6px; }
body[data-look="live"] .overlay > .page-head.profile-head > .profile-actions { order: 98; margin-inline-start: auto; }
body[data-look="live"] .overlay > .page-head.profile-head > .profile-actions ~ button.icon-close { margin-inline-start: 0; }
/* its facts run the overlay's width (the hairlines end at the panel's edge, not part-way) */
body[data-look="live"] #customer-profile .kvlist { max-width: none; }
body[data-look="live"] #customer-profile > .profile-facts { margin: 0; }
/* «سابقهٔ درخواست‌ها» opens a section of its own */
body[data-look="live"] #customer-profile > .list-section { margin: 8px 0 0; padding-top: 16px; border-top: var(--rule); }
/* «دستهٔ قیمت»: the choice and its «ثبت» on one line; «ثبت» stays quiet until the choice changes */
body[data-look="live"] #customer-profile .pcat-assign-line { gap: 8px; }
body[data-look="live"] #customer-profile #btn-pcat-assign:disabled {
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-muted); opacity: 1;
}

/* «ثبت دستی مشتری»: the fields on a grid -- kind | national code, the name across, the name parts side by side; the
   optional contact a section of the form (no dashed box) */
body[data-look="live"] #customer-create-form .cfg-field :is(input[type="text"], select) { max-width: none; }
body[data-look="live"] #customer-create-form > .dir-contact {
  margin: 0; padding: 4px 0 0; border: 0; border-top: var(--rule); border-radius: 0; background: transparent;
}
@media (min-width: 48rem) {
  body[data-look="live"] #customer-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  body[data-look="live"] #customer-create-form > * { grid-column: 1 / -1; }
  body[data-look="live"] #customer-create-form > :is(.dir-kind-field, .cfg-field:has(#create-national-id)) { grid-column: auto; }
  body[data-look="live"] #customer-create-form .dir-create-group { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
}

/* the registration review: the facts are the one list (not two columns), across the overlay; the form's section
   opens with the same hairline as the sections after it */
body[data-look="live"] .ob-review .ob-facts { grid-template-columns: minmax(0, 1fr); }
body[data-look="live"] #ob-review .kvlist { max-width: none; }
body[data-look="live"] #ob-review .panel-body > .ob-facts + .ob-section {
  border-top: var(--rule); padding-top: var(--card-gap); margin-top: var(--card-gap);
}
body[data-look="live"] #ob-review .ob-section-head { min-height: var(--chip-h); }

/* «ثبت‌نام‌ها»: the list and the fields card a section apart; the fields an even grid, «ذخیره» in the card's foot */
body[data-look="live"] #customers-registrations { gap: var(--section-gap); }
body[data-look="live"] .ob-fields .ob-fields-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-card); }
body[data-look="live"] .ob-fields .ob-fields-set {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 8px 16px;
  padding-bottom: 12px; border-bottom: var(--rule);
}
body[data-look="live"] .ob-fields .ob-fields-set > legend { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  body[data-look="live"] .ob-fields .ob-fields-set { grid-template-columns: repeat(3, minmax(0, 16rem)); justify-content: start; }
}

/* the count chips of «ثبت‌نام‌ها» and «تطبیق با ته‌حساب»: pills that wrap (as on a phone), never a clipped strip */
body[data-look="live"] :is(#ob-chips, #mt-chips) {
  flex-wrap: wrap; gap: 6px; overflow: visible; width: auto; border: 0; border-radius: 0; background: transparent;
}
body[data-look="live"] :is(#ob-chips, #mt-chips) button {
  flex: 0 0 auto; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
}
body[data-look="live"] :is(#ob-chips, #mt-chips) button[aria-pressed="true"] { border-color: var(--gold); }
body[data-look="live"] #mt-chips .mt-chips-done { display: inline-flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 6px; }
body[data-look="live"] #mt-chips .mt-chip-divider { align-self: center; min-height: 28px; margin-inline: 4px; }

/* «تطبیق با ته‌حساب»: ONE toolbar -- the chips, their «؟» and «ثبت مشاهدهٔ همه» at the row's end */
body[data-look="live"] #customers-matching .mt-chip-row { flex-wrap: wrap; align-items: center; gap: 8px 12px; }
body[data-look="live"] #customers-matching .mt-chip-row > #mt-chips { flex: 1 1 24rem; }
/* the action cells: centred, one gap */
body[data-look="live"] .mt-table td.col-actions .mt-actions { justify-content: center; gap: 8px; }
/* the Tahesab accounts' table (critique round 1, M7): every row's buttons start on ONE edge of a column as wide as the
   widest set, so one, two or three buttons no longer zigzag down the page; the status sentence has the room for two
   lines and is held to two (the whole sentence stays in the row's details overlay) */
body[data-look="live"] .mt-table .mt-reason {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
@media (min-width: 48rem) {
  body[data-look="live"] #mt-table.mt-table td.col-actions { width: 18rem; }
  body[data-look="live"] #mt-table.mt-table td.col-actions .mt-actions { display: flex; justify-content: flex-start; }
  body[data-look="live"] #mt-table.mt-table td[data-label="وضعیت"] { width: 16rem; min-width: 16rem; }
  body[data-look="live"] #mt-table.mt-table .mt-reason { max-width: 16rem; }
}
@media (max-width: 47.99rem) {
  /* a phone card's actions in one row of up to three */
  body[data-look="live"] .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions.row-actions {
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 8px;
  }
  body[data-look="live"] .mt-table.data-table:not(.keep-table) td.col-actions .mt-actions > button.primary:first-child { grid-column: auto; }
  /* every value of a phone card starts where its column starts (the national code was drawn mid-column) */
  body[data-look="live"] .mt-table.data-table:not(.keep-table) td > :is(.mt-id, .mt-status, .mt-linked, .mt-create-state) { justify-self: start; }
  body[data-look="live"] #customers-matching .mt-chip-row { align-items: center; }
}

/* «کاربران»: the filter and the search on one toolbar row (the search as wide as the customers' one) */
body[data-look="live"] .users-tools { gap: 12px 16px; margin: 0 0 12px; }
body[data-look="live"] .users-tools input[type="search"] { flex: 1 1 20rem; max-width: 32rem; }
/* its filter («همه / کارمندان / مشتریان») is the same wrapping pill row as every staff filter, on a desk too (critique
   round 2, B: it was the last segmented box on a desk, pills only on a phone) */
body[data-look="live"] #users-filter.filterbar:not([hidden]) {
  display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; width: auto;
  border: 0; border-radius: 0; background: transparent;
}
body[data-look="live"] #users-filter.filterbar > button {
  flex: 0 0 auto; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
}
body[data-look="live"] #users-filter.filterbar > button[aria-pressed="true"] { border-color: var(--gold); }
@media (max-width: 47.99rem) {
  body[data-look="live"] .users-tools input[type="search"] { flex-basis: 100%; max-width: none; }
  /* a user's phone card: the name and the role on one line */
  body[data-look="live"] .data-table.users-table:not(.keep-table) td[data-label="نقش"] {
    grid-column: 2; grid-row: 1; display: block; align-self: center; justify-self: end;
    font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap;
  }
  body[data-look="live"] .data-table.users-table:not(.keep-table) td[data-label="نقش"]::before { display: none; }
}
/* the editor: name and user name side by side on a desk, the role as wide as one of them */
@media (min-width: 48rem) {
  body[data-look="live"] #users-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
  body[data-look="live"] #users-edit-form > :not(.cfg-field) { grid-column: 1 / -1; }
  body[data-look="live"] #users-edit-form .users-access > .cfg-field { max-width: calc(50% - 8px); }
}
/* a wide desk (critique round 1, m3): name | user name | role on ONE row (the role no longer alone on a half-empty
   row); the permissions title and table run the form's width under them. The kind («کارمند» / «مشتری») is the
   overlay head's sub-title (usersPanelRender) */
@media (min-width: 64rem) {
  body[data-look="live"] #users-edit-form:has(> .users-access) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-look="live"] #users-edit-form > .users-access { display: contents; }
  body[data-look="live"] #users-edit-form > .users-access > * { grid-column: 1 / -1; }
  body[data-look="live"] #users-edit-form .users-access > .cfg-field { grid-column: auto; max-width: none; }
}
body[data-look="live"] .overlay > .panel-head > .users-kind { margin: 0; }
/* --- C3 customers, registrations, matching, presence, users (package P3): end --- */

/* --- C4 accounting (package P4): begin --- */
/* «حسابداری» (owner 2026-11-11, one card system). The page: the connection strip (a status line), the tabs, ONE card
   per tab. A card whose title only repeats its tab keeps the title for a screen reader (J10). The overlay cards
   (balance, case, create request, a trade's document): ONE status line, the facts as the one list, section titles,
   the actions as one row near the end, «جزئیات فنی» last. Presentation only. */

/* -- the page: strip, tabs and the tab's card, evenly spaced (the section's own gap would add to their margins) -- */
body[data-look="live"] .acct-section { gap: 0; }
body[data-look="live"] #acct-strip { margin: 0 0 16px; }
body[data-look="live"] .acct-section > .acct-tabs { margin: 0 0 16px; }
body[data-look="live"] .acct-section > #accounting-failed { margin: 0 0 12px; }
body[data-look="live"] #acct-strip .acct-strip-check { color: var(--text-muted); }
/* tabs never break their word; on a phone the count stands beside the word, so every tab is one line high */
body[data-look="live"] .acct-tabs > [role="tab"] { white-space: nowrap; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .acct-tabs { flex-wrap: wrap; }
  body[data-look="live"] .acct-tabs:not([data-single="yes"]) { grid-template-columns: repeat(var(--acct-tab-count, 4), auto); }
  body[data-look="live"] .acct-tabs:not([data-single="yes"]) > [role="tab"] {
    flex-direction: row; gap: 4px; min-height: var(--tap); padding-inline: 4px; font-size: var(--fs-meta); line-height: 1.3;
  }
  body[data-look="live"] .acct-tabs:not([data-single="yes"]) .acct-count { min-width: 1.15rem; height: 1.15rem; padding: 0 4px; font-size: 0.7rem; }
}
/* the card head that holds only a screen reader's title takes no line (the tab above names the card) */
body[data-look="live"] .acct-block > .block-head:has(> h3.sr-only:only-child) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
body[data-look="live"] .acct-block .acct-body { gap: var(--card-gap); }
/* a list's «جزئیات فنی» is the last part of its body, with the fold's hairline (critique round 1, m2) */
body[data-look="live"] .acct-block .acct-body > .acct-tech:last-child { padding-top: 4px; border-top: var(--rule); }
/* «سوابق ساخت در ته‌حساب»: the way to create is the card's quiet line under its title (critique round 2, m2 -- its
   «جزئیات فنی» is then the card's last part); the link keeps its 44px hit area without making the line taller */
body[data-look="live"] #accounting-intents > #acct-create-pointer {
  margin-top: calc(4px - var(--card-gap)); font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] #acct-create-pointer > #btn-acct-to-matching { margin-block: -10px; }

/* -- «کارهای باز»: each queue a section of the card (title, then its table or its one sentence) -- */
body[data-look="live"] #accounting-queues-body > .acct-queue { gap: 8px; }
body[data-look="live"] #accounting-queues-body > .acct-queue + .acct-queue { padding-top: var(--card-gap); border-top: var(--rule); }
body[data-look="live"] .acct-queue-head { gap: 4px 8px; min-height: var(--chip-h); }
body[data-look="live"] .acct-queue-head > .list-section { margin: 0; }
body[data-look="live"] .acct-queue > .acct-summary-line { gap: 4px 8px; }

/* -- not set up: one sentence in the card, never a box inside it -- */
body[data-look="live"] #accounting-not-configured .acct-not-configured,
body[data-look="live"] #pst-status.pst-off #pst-not-configured {
  margin: 0; font-size: var(--fs-body); font-weight: 600; color: var(--text);
}
body[data-look="live"] .pst-body > #pst-status.pst-off { gap: 4px; padding: 0; background: transparent; }

/* -- «سندها»: status line, the guided sample / the overdue documents, the filters, the table -- one even column -- */
body[data-look="live"] .pst-body { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] .pst-body > * { margin-block: 0; min-width: 0; }
body[data-look="live"] .pst-body > #pst-status { margin: 0; }
body[data-look="live"] .pst-body > .pst-filters { align-self: flex-start; max-width: 100%; }
body[data-look="live"] #pst-status .pst-status-line { gap: 4px 12px; }
body[data-look="live"] #pst-status :is(.pst-halted, .pst-run) { gap: 4px 12px; }
body[data-look="live"] #pst-status :is(.pst-halted, .pst-run) > button { margin-inline-start: auto; }
body[data-look="live"] #pst-status > :is(.fact-note, .acct-settings-way) { margin: 0; }
/* «جزئیات تنظیمات» at the status line's end is a link, drawn like «تغییر در تنظیمات ›» (critique round 1, m5) */
body[data-look="live"] #pst-status button.pst-config-open {
  padding-inline: 6px; color: var(--text); text-decoration: underline; text-underline-offset: 3px;
}
/* the overdue documents: a warn notice with its button at its end */
body[data-look="live"] .pst-backlog {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 0;
  border-inline-start: var(--edge) solid var(--warn-line); border-radius: var(--well-radius); background: var(--warn-bg);
}
body[data-look="live"] .pst-backlog > .pst-backlog-line { flex: 1 1 16rem; margin: 0; line-height: 1.7; }
body[data-look="live"] .pst-backlog > button { margin-inline-start: auto; }
/* the guided sample card: the notice, its steps evenly spaced */
body[data-look="live"] .pst-canary { gap: 8px; margin: 0; }
body[data-look="live"] .pst-canary-head { gap: 4px 8px; }
@media (max-width: 47.99rem) {
  /* a row's state chip stands centred on its name's line (the link history, the documents) */
  body[data-look="live"] :is(.pst-table, .acct-table).data-table:not(.keep-table) td.col-badge { align-self: center; }
  /* a trade's card on a phone: its name on the same right edge as the lines under it */
  body[data-look="live"] :is(.pst-table, .acct-table).data-table:not(.keep-table) td.col-primary .row-open.has-sub {
    align-items: flex-start; padding-inline: 0;
  }
}

/* -- a trade's document (overlay): status line, the next step, the actions with their answer under them, the facts,
      the document as a section with its title, «جزئیات فنی» last -- */
body[data-look="live"] .pst-trade-overlay > .panel-body { gap: var(--card-gap); }
body[data-look="live"] .pst-trade-overlay > .panel-body > * { margin-block: 0; }
body[data-look="live"] .pst-trade-overlay .pst-trade-head {
  gap: 4px 12px; padding: 8px 12px; border-radius: var(--well-radius); background: var(--well-bg); font-size: var(--fs-meta);
}
body[data-look="live"] .pst-trade-overlay .pst-trade-reason { font-size: var(--fs-body); }
body[data-look="live"] .pst-trade-overlay > .panel-body > .pst-trade-outcome { order: 1; }
body[data-look="live"] .pst-trade-overlay > .panel-body > :is(.pst-facts, .pst-facts ~ *) { order: 2; }
body[data-look="live"] .pst-trade-overlay .pst-facts { padding-top: 4px; border-top: var(--rule); }
/* right under a shown answer («ثبت شد.») the facts open without a rule (none above a list's first row: m6) */
body[data-look="live"] .pst-trade-overlay > .panel-body:has(> .pst-trade-outcome:not(:empty)) .pst-facts { padding-top: 0; border-top: 0; }
body[data-look="live"] .pst-trade-overlay .pst-preview {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding-top: var(--card-gap); border-top: var(--rule);
}
body[data-look="live"] .pst-trade-overlay .pst-preview > * { margin: 0; }
body[data-look="live"] .pst-trade-overlay .pst-preview-head { gap: 4px 8px; }
/* the actions stand on the status well's row, at its far end (critique round 2, n4) -- not alone between the well and
   the answer; the answer («ثبت شد.») follows under both. Where a next-step line comes first they keep their own row
   after it; on a phone only a single action joins the well (several would squeeze its words) */
body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions > :only-child) {
  grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
}
body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions > :only-child) > * { grid-column: 1 / -1; }
body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions > :only-child) > .pst-trade-head { grid-column: 1; }
body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions > :only-child) > .pst-trade-actions { grid-column: 2; }
@media (min-width: 48rem) {
  body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions) {
    grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  }
  body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions) > * { grid-column: 1 / -1; }
  body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions) > .pst-trade-head { grid-column: 1; }
  body[data-look="live"] .pst-trade-overlay > .panel-body:not(:has(> .pst-next)):has(> .pst-trade-head ~ .pst-trade-actions) > .pst-trade-actions { grid-column: 2; }
}

/* -- «مانده‌ها»: a row's read state on one line; on a phone the state and the read share one row under the name -- */
body[data-look="live"] .data-table .acct-read-state { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
body[data-look="live"] .data-table .acct-read-state .acct-read-text { white-space: nowrap; }
@media (max-width: 47.99rem) {
  /* the same phone card as the other lists (critique round 1, m8): the name with its state chip on ONE line, the
     labelled lines under it, the button at the start of its own line */
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) tr { align-items: center; row-gap: 8px; }
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) td.col-badge {
    grid-column: 2; grid-row: 1; justify-self: end; align-self: center;
  }
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) td.col-actions {
    grid-column: 1 / -1; display: flex; margin: 0; align-self: center; justify-content: flex-start;
  }
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) td.col-actions .acct-balance-actions { width: auto; justify-content: flex-start; }
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) td.col-badge .acct-read-state { min-width: 0; }
  body[data-look="live"] .acct-balance-table.data-table:not(.keep-table) td.col-actions button { flex: 0 0 auto; min-height: var(--tap); }
}

/* -- the overlay cards: the status line holds the state (a lone chip is not put in a well), the moved actions as the
      card's foot row, the section titles with a hairline above -- */
body[data-look="live"] .overlay div.cfg-scope > .cfg-scope-head:not(:has(> :not(.chip))) { padding: 0; background: none; }
body[data-look="live"] #acct-item-panel .acct-panel-actions { margin: 0; }
/* «جزئیات فنی» of an overlay card opens with the hairline even where a quiet note follows it (a create request) */
body[data-look="live"] .overlay div.cfg-scope > .acct-tech { padding-top: 4px; border-top: var(--rule); }
/* the transfer state chip («ساخته و پیوند شد»): its words centred in the one chip height, like every chip */
body[data-look="live"] .chip.transfer-chip { display: inline-flex; align-items: center; }
/* a part with nothing shown (the case's notes when they hold only the hidden test label) takes no gap */
body[data-look="live"] .overlay div.cfg-scope > .acct-actionable-notes:not(:has(> :not(.nonbinding))) { display: none; }
body[data-look="live"] .acct-balance-detail > .acct-figures-head {
  gap: 4px 8px; margin: 0; padding-top: var(--card-gap); border-top: var(--rule);
}
body[data-look="live"] .acct-balance-detail > .acct-read-text { margin: 0; }
/* the balance card says «تأییدنشده» once (critique round 1, m1): the read's own words are a quiet note right under the
   status well (not a third style), and the account's facts («کد ته‌حساب», a stale reason) are the first rows of the
   one «ارقام ته‌حساب» list -- by order only (DOM unchanged): the heading, those rows, then the figures, one hairline
   between every row */
body[data-look="live"] .acct-balance-detail > .cfg-scope-head + .acct-read-text:not(.acct-now-connected) {
  margin-top: calc(8px - var(--card-gap)); padding-inline: 12px; font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] .acct-balance-detail:has(> .acct-figures-head + .kvlist) > .acct-figures-head { order: 1; }
body[data-look="live"] .acct-balance-detail:has(> .acct-figures-head + .kvlist) > .acct-balance-about { order: 2; }
body[data-look="live"] .acct-balance-detail:has(> .acct-figures-head + .kvlist) > .acct-figures-head ~ * { order: 3; }
body[data-look="live"] .acct-balance-detail:has(> .acct-figures-head + .kvlist):has(> .acct-balance-about) > .acct-figures-head + .kvlist {
  margin-top: calc(-1 * var(--card-gap));
}
body[data-look="live"] .acct-balance-detail:has(> .acct-figures-head + .kvlist):has(> .acct-balance-about) > .acct-figures-head + .kvlist > .kv:first-child {
  border-top: var(--rule);
}
/* the case card: its actions are ONE foot under ONE hairline (critique round 1, M5) -- the moved «ثبت مشاهده» bordered,
   its «؟», the one way there, and «بستن این مورد» on the same row at its far end (its closing form opens across the
   card under them). DOM unchanged: the card wraps as a row, every part takes the full row except the action row and the
   closed «بستن این مورد» after it (a hidden notes part may stand between them); the hairline is the list's bottom edge, so it spans the card on a phone too. */
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail { flex-flow: row wrap; column-gap: 8px; }
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail > * { flex: 1 1 100%; }
body[data-look="live"] .acct-case-detail > .kvlist:has(+ .acct-case-actions) { max-width: none; padding-bottom: 12px; border-bottom: var(--rule); }
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail > .acct-case-actions { flex: 1 1 auto; gap: 8px; margin: 0; }
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail > .acct-case-actions ~ .acct-resolve:not([open]) { flex: 0 0 auto; }
body[data-look="live"] .acct-case-detail > .acct-resolve { margin-block: 0; }
body[data-look="live"] .acct-resolve > summary {
  min-height: var(--tap); padding: 0.35rem 0.8rem; font-size: 0.86rem; font-weight: 500; border-radius: var(--radius-sm);
}
/* its state opens its status line (critique round 2, n3): the chip and the case's sentence share ONE row in ONE well --
   the same status line as a trade's document -- instead of the chip standing alone on a row above the sentence. DOM
   unchanged (the chip stays in the card, whose words it is); the two parts draw the one well, the chip on the first line */
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail > .acct-case-head:has(+ .acct-case-reason) {
  flex: 0 0 auto; align-self: stretch; align-items: flex-start; margin: 0; padding: 8px 12px; padding-inline-end: 0;
  background: var(--well-bg); border-radius: 0;
  border-start-start-radius: var(--well-radius); border-end-start-radius: var(--well-radius);
}
body[data-look="live"] .overlay div.cfg-scope.acct-case-detail > .acct-case-head + .acct-case-reason {
  flex: 1 1 12rem; min-width: 0; margin: 0; margin-inline-start: -8px; padding: 8px 12px; line-height: 1.6;
  background: var(--well-bg); border-radius: 0;
  border-start-end-radius: var(--well-radius); border-end-end-radius: var(--well-radius);
}

/* -- «پیوند حساب»: ONE width for the whole card (critique round 1, M3) -- the lookup row, the account read for a code
      (a well) and the link forms all run the card's width, so their edges line up; only the well's list keeps the
      reading measure (SPEC §3.1: the measure is on lists, never on containers). The code field grows like the link
      rows' fields, its button at the row's far end the same size as theirs -- */
body[data-look="live"] .acct-section .outcome.acct-preview-card {
  display: flex; flex-direction: column; gap: 8px; max-width: none; padding: 12px 16px; border: 0;
  border-radius: var(--well-radius); background: var(--well-bg); box-shadow: none;
}
body[data-look="live"] .acct-preview-card > * { margin: 0; }
body[data-look="live"] .acct-preview-card .kvlist { max-width: var(--measure); }
body[data-look="live"] .acct-preview-card > .acct-tech { padding-top: 4px; border-top: var(--rule); }
body[data-look="live"] .acct-section :is(.acct-link-box, .acct-create-local, .acct-lookup-row) { max-width: none; margin: 0; }
body[data-look="live"] .acct-section .acct-lookup-row > .acct-lookup-field { flex: 1 1 12rem; min-width: 0; margin: 0; }
body[data-look="live"] .acct-section .acct-lookup-field input { max-width: none; }
body[data-look="live"] .acct-section :is(.acct-link-row, .acct-create-local, .acct-lookup-row) > button { min-width: 8rem; min-height: var(--tap); }
/* -- «سندها»'s count chips are the same component as «ثبت‌نام‌ها» / «تطبیق با ته‌حساب» (P3): pills that wrap (integration) -- */
body[data-look="live"] #pst-filters {
  flex-wrap: wrap; gap: 6px; overflow: visible; width: auto; border: 0; border-radius: 0; background: transparent;
}
body[data-look="live"] #pst-filters button {
  flex: 0 0 auto; min-height: 40px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
}
body[data-look="live"] #pst-filters button[aria-pressed="true"] { border-color: var(--gold); }
/* --- C4 accounting (package P4): end --- */

/* --- C5 settings, connections, Zaryar and «درباره» (package P5): begin --- */
/* P5 (owner 2026-11-11, «cards»): Settings (every tab), «اتصال‌ها» (Tahesab, Zaryar, the awaiting cards), «درباره».
   Only tokens of the slot above; every selector under body[data-look="live"]. */

/* ---- «اتصال‌ها»: a capability line is name | state chip | its control, side by side at the start (never 900px
   apart); the ✓ / ! / ○ mark is hidden (the chip says it once); sub-lines span under the line ---- */
body[data-look="live"] .integ-cap {
  grid-template-columns: minmax(10rem, 18rem) minmax(0, max-content) minmax(0, 1fr);
  align-items: center; column-gap: 16px; row-gap: 6px; padding: 10px 0; min-height: var(--tap);
  border-top: var(--rule);
}
body[data-look="live"] .integ-cap:first-child { border-top: 0; }
body[data-look="live"] .integ-cap > .integ-cap-mark { display: none; }
body[data-look="live"] .integ-cap > .integ-cap-name { grid-column: 1; font-size: var(--fs-body); font-weight: 600; color: var(--text); }
body[data-look="live"] .integ-cap > .integ-cap-state { grid-column: 2; }
body[data-look="live"] .integ-cap > .integ-control { grid-column: 3; justify-self: start; }
body[data-look="live"] .integ-cap > :is(.integ-cap-sub, .integ-confirm) { grid-column: 1 / -1; }
body[data-look="live"] .integ-cap > .integ-cap-state {
  display: inline-flex; align-items: center; justify-self: start; max-width: 100%; min-height: var(--chip-h);
  padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-2);
  font-size: var(--fs-note); font-weight: 600; line-height: 1.4; white-space: normal; text-align: start; color: var(--text-muted);
}
body[data-look="live"] .integ-cap-ready > .integ-cap-state { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
body[data-look="live"] .integ-cap-held > .integ-cap-state { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
/* the posting line's sub-lines: one quiet line each, its link at the line's end */
body[data-look="live"] .integ-cap > .integ-cap-sub { font-size: var(--fs-meta); line-height: 1.6; color: var(--text-muted); }
body[data-look="live"] .integ-cap > .integ-cap-sub.integ-interim { color: var(--warn-ink); }
body[data-look="live"] .integ-cap > .integ-confirm { margin-top: 4px; }
body[data-look="live"] .integ-control .integ-select { min-height: 40px; }
body[data-look="live"] .integ-shared { font-size: var(--fs-meta); }
/* a link inside a sub-line keeps its 44px target without opening the lines */
body[data-look="live"] .integ-cap > .integ-cap-sub button.cfg-link { margin-block: -10px; }
@media (max-width: 47.99rem) {
  /* a phone: the name and its chip share a line while they fit (a long state wraps under the name); the control and
     the sub-lines take their own lines */
  body[data-look="live"] .integ-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  body[data-look="live"] .integ-cap > :is(.integ-cap-name, .integ-cap-state) { flex: 0 1 auto; }
  body[data-look="live"] .integ-cap > :is(.integ-control, .integ-cap-sub, .integ-confirm) { flex: 1 1 100%; }
}

/* the Tahesab check: its button a toolbar row right under the meta line, its answer right under it */
body[data-look="live"] .integ-check { gap: 8px; }
body[data-look="live"] .integ-check .acct-health-bar { gap: 8px; }

/* R14 (P2 review): the connection groups (#integ-ready, #integ-waiting) gave way to ONE table -- their rules went */
body[data-look="live"] .integ-card.integ-pending > .integ-line { color: var(--text-muted); font-size: var(--fs-body); }

/* the technical fold: «حساب نمونه» a titled section; its facts the one list, not a striped box inside the fold */
body[data-look="live"] .integ-tech .acct-pilot-block > .block-head h3 { font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .integ-tech .acct-pilot-block > .outcome:not(:empty) {
  padding: 0; border: 0; background: transparent; border-radius: 0;
}
body[data-look="live"] .integ-tech .acct-pilot-block > .outcome > .fact-note { font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .integ-tech .acct-pilot-block .fieldrow { gap: 8px; }

/* ---- Zaryar: the purpose sentence is the sub-line, the counters a status line, the controls one toolbar ---- */
body[data-look="live"] .zr-card .zr-why { margin: 0; font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .zr-card .zr-controls { margin: 0; gap: 8px; }
body[data-look="live"] .zr-card .zr-today {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 8px 12px;
  border-radius: var(--well-radius); background: var(--well-bg); font-size: var(--fs-meta); color: var(--text);
}
body[data-look="live"] .zr-card .zr-balance { margin: 4px 0 0; }
body[data-look="live"] .zr-trade-card .zr-modes-box { display: grid; gap: 6px; margin: 0; min-width: 0; }
body[data-look="live"] .zr-trade-card .zr-auto-locked { margin: 0; font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .zr-recent { margin: 0; }
body[data-look="live"] .zr-recent-title { margin: 0 0 4px; font-size: var(--fs-sub); font-weight: 700; }
@media (min-width: 48rem) {
  /* the trade card's toolbar: the four modes, and the stop at the far end of the same row */
  body[data-look="live"] .integ-card.zr-trade-card:has(> .zr-modes-box) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; column-gap: 16px; align-items: start;
  }
  body[data-look="live"] .integ-card.zr-trade-card:has(> .zr-modes-box) > * { grid-column: 1 / -1; }
  body[data-look="live"] .integ-card.zr-trade-card:has(> .zr-modes-box) > .zr-modes-box { grid-column: 1; }
  body[data-look="live"] .integ-card.zr-trade-card:has(> .zr-modes-box) > .zr-controls { grid-column: 2; justify-content: flex-end; }
}
/* the fold's tables: the dealer's list and our items read as sections of the fold */
body[data-look="live"] .zr-tech .zr-dealer { margin: 12px 0 0; padding-top: 12px; border-top: var(--rule); }
body[data-look="live"] .zr-tech .zr-dealer-title { margin: 0 0 4px; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .zr-tech :is(.zr-dealer-when, .zr-dealer-note) { font-size: var(--fs-meta); color: var(--text-muted); }
/* the items on a phone: one block per item, each value under its heading (J7) -- both tables */
@media (max-width: 47.99rem) {
  body[data-look="live"] .zr-tech .zr-items-wrap { overflow-x: visible; }
  body[data-look="live"] .zr-tech .zr-items, body[data-look="live"] .zr-tech .zr-items tbody { display: block; width: 100%; }
  body[data-look="live"] .zr-tech .zr-items thead { display: none; }
  body[data-look="live"] .zr-tech .zr-items tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 0; border-bottom: var(--rule);
  }
  body[data-look="live"] .zr-tech .zr-items tbody tr:last-child { border-bottom: 0; }
  body[data-look="live"] .zr-tech .zr-items td {
    display: block; min-width: 0; padding: 0; border: 0; text-align: start; white-space: normal; overflow-wrap: anywhere;
  }
  body[data-look="live"] .zr-tech #zr-items td:nth-child(-n+2) { grid-column: 1 / -1; }
  body[data-look="live"] .zr-tech #zr-items td:first-child,
  body[data-look="live"] .zr-tech #zr-dealer-list td.zr-dealer-name { font-weight: 700; }
  body[data-look="live"] .zr-tech .zr-items td.zr-units { text-align: start; }
  body[data-look="live"] .zr-tech .zr-items td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: var(--fs-note); font-weight: 400; color: var(--text-muted);
  }
}

/* ---- «بازار و مهلت»: the field, then «ذخیرهٔ مهلت» in the foot (J3); the market's state a status well ---- */
body[data-look="live"] .cfg-market .cfg-timeout-grid { margin: 0; }
body[data-look="live"] .cfg-market > .card-foot { margin-top: 0; }
body[data-look="live"] .cfg-market > .cfg-market-state { margin: 0; padding: 10px 12px; border-top: 0; }

/* ---- «مبلغ و کارمزد»: the groups are sections of the card (title, fields; a hairline above the second), not boxes ---- */
body[data-look="live"] .block .cfg-money-sets { gap: 16px; }
body[data-look="live"] .block .cfg-set { margin: 0; padding: 0; border: 0; border-radius: 0; min-width: 0; }
body[data-look="live"] .block .cfg-set ~ .cfg-set { padding-top: 16px; border-top: var(--rule); }
/* the legend floats so it is an ordinary title line inside the section (a rendered legend would sit in the border) */
body[data-look="live"] .block .cfg-set > legend {
  float: inline-start; width: 100%; padding: 0 0 8px; font-size: var(--fs-sub); font-weight: 700; color: var(--text);
}
body[data-look="live"] .block .cfg-set > legend + * { clear: both; }
body[data-look="live"] .cfg-money-note { font-size: var(--fs-meta); color: var(--text-muted); }

/* ---- «تقویم»: full width; the facts are the one name | value list; «ویرایش تقویم» in a foot (a hairline above) ---- */
body[data-look="live"] .cfg-calendar-card { max-width: none; justify-items: stretch; }
body[data-look="live"] .cfg-calendar-card > h3 { order: 1; margin: 0; font-size: var(--fs-card); font-weight: 700; line-height: 1.4; }
body[data-look="live"] .cfg-calendar-card > .cfg-calendar-facts { order: 2; }
body[data-look="live"] .cfg-calendar-card::after { content: ""; order: 3; align-self: stretch; border-top: var(--rule); }
body[data-look="live"] .cfg-calendar-card > button { order: 4; }
body[data-look="live"] .cfg-calendar-facts {
  display: grid; grid-template-columns: minmax(0, var(--kv-name)) minmax(0, 1fr); gap: 0; margin: 0;
  max-width: var(--measure); font-size: var(--fs-body);
}
/* one line height for the name and the value, so the two halves of a row share their hairline and their line */
body[data-look="live"] .cfg-calendar-facts > :is(dt, dd) { margin: 0; padding: 8px 0; border-top: var(--rule); line-height: 1.6rem; }
body[data-look="live"] .cfg-calendar-facts > dt { padding-inline-end: 16px; }
body[data-look="live"] .cfg-calendar-facts > :is(dt, dd):nth-child(-n+2) { border-top: 0; }
body[data-look="live"] .cfg-calendar-facts > dt { font-size: var(--fs-meta); color: var(--text-muted); font-weight: 400; }
body[data-look="live"] .cfg-calendar-facts > dd { font-weight: 500; }
/* R12 (owner item 3, 2026-11-12): what the days off decide -- one quiet sentence right under the card's title */
body[data-look="live"] .cfg-calendar-card > .cfg-calendar-note { order: 1; max-width: var(--measure); line-height: 1.8; }
body[data-look="live"] .cfg-section > .cfg-calendar-note { max-width: var(--measure); line-height: 1.8; }

/* ---- the product sheet: the term's «ویرایش» a quiet link under its table, «افزودن زمان تحویل» a section of the sheet,
   the retire zone the bad-tone notice ---- */
body[data-look="live"] .cfg-term { border-top-style: solid; }
body[data-look="live"] .cfg-term > .fold > summary {
  min-height: 40px; padding-inline: 0; border: 0; background: none; color: var(--text); font-weight: 600;
  font-size: var(--fs-meta);
}
body[data-look="live"] .cfg-term > .fold > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
body[data-look="live"] .cfg-asset-sheet-body > #cfg-add-term-fold {
  margin: 12px 0 0; padding: 4px 0 0; border: 0; border-top: var(--rule); border-radius: 0; background: none;
}
body[data-look="live"] .cfg-asset-sheet-body > #cfg-add-term-fold > summary { font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .cfg-danger {
  margin: 12px 0 0; padding: 10px 12px; border: 0; border-inline-start: var(--edge) solid var(--sell);
  border-radius: var(--well-radius); background: var(--danger-soft);
}

/* ---- «بیشتر / درباره»: peer cards fill the row (one card = full width); the stray fold is the card's last part (J8) ---- */
body[data-look="live"] #view-tools .tools-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--grid-gap); }
body[data-look="live"] #view-tools .tools-grid > * { margin: 0; }
body[data-look="live"] #view-tools .block > #debug { margin: 0; padding-top: 4px; border-top: var(--rule); font-size: var(--fs-meta); }
body[data-look="live"] #view-tools .block > #debug > summary {
  width: fit-content; min-height: var(--tap); font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted);
}
/* --- C5 settings, connections, Zaryar and «درباره» (package P5): end --- */
/* ===== 2026-11-11 slot: one card system: end ===== */
/* ===== R12 term visibility (owner item 2): begin ===== */
/* Owner item 2 (2026-11-12): each delivery term's own «نمایش به مشتری» on «قیمت‌گذاری», beside the product's. A desk:
   the switch stands in the empty cell under the term's name (its second line, beside the side switches and
   «ورود دستی»); the Zaryar row of a mapped term moves one cell down in the same column. A phone (a term card stays
   short): the term line's eye -- the page's own icon, slashed while the term is hidden; the words stay its accessible
   name. A hidden term's row keeps its quiet look and says «پنهان از مشتری» beside its name. Presentation only. */
button.switch.termvis { min-height: 36px; padding: 0.15rem 0.6rem; font-size: 0.82rem; }
button.switch.termvis[aria-checked="false"] { background: var(--surface-2); }
.termvis .termvis-eye { display: none; }
.chip.termvis-hidden { white-space: nowrap; }
@media (min-width: 48rem) {
  .opboard-row:not(.opboard-head) {
    grid-template-areas: "bid title gap ask" "gbid gvis gman gask" ". gzr gnote ." "bar bar bar bar";
  }
  .opboard-row:not(.opboard-head) .termvis { grid-area: gvis; justify-self: center; margin-top: 0.35rem; }
  .opboard-row:not(.opboard-head) .zr-row { grid-area: gzr; }
}
@media (max-width: 47.99rem) {
  .opboard-row > .board-title > button.switch.termvis {
    flex: 0 0 auto; min-height: 32px; min-width: 36px; padding: 0 0.3rem; gap: 0.25rem; font-size: 0.8rem;
    justify-content: center;
  }
  .opboard-row > .board-title > button.switch.termvis:not(.termvis-words) > .switch-track,
  .opboard-row > .board-title > button.switch.termvis:not(.termvis-words) > .switch-text { display: none; }
  .opboard-row > .board-title > button.switch.termvis > .termvis-eye { display: block; width: 1.25rem; height: 1.25rem; }
  .opboard-row > .board-title > button.switch.termvis[aria-checked="true"] .eye-slash { display: none; }
  .opboard-row > .board-title > button.switch.termvis[aria-checked="false"] { color: var(--text-muted); }
  .opboard-row .board-titletext > .chip.termvis-hidden { min-height: 0; padding: 0 0.4rem; font-size: 0.72rem; }
}
/* ===== R12 term visibility (owner item 2): end ===== */
/* ===== R12 treasury: begin ===== */
/* R12 (owner request 2026-11-12 item 4): «صندوق دارایی‌ها» -- the estimate's status line, the holding cards (a figures
   well of two tiles, the breakdown, the foot), the pending table, the history fold, the form overlay and the «کارتابل»
   summary card. Every selector is under the live look; the card system's tokens only; nothing external, no stacking. */
body[data-look="live"] #view-treasury .tsy-body > * { margin-top: 0; }
body[data-look="live"] #view-treasury .tsy-status { margin: 0 0 16px; justify-content: flex-start; line-height: 1.7; }
body[data-look="live"] #view-treasury .tsy-status > .tsy-status-words { flex: 1 1 24rem; min-width: 0; }
body[data-look="live"] #view-treasury .tsy-status > .tsy-today { margin-inline-start: auto; white-space: nowrap; font-weight: 600; }
body[data-look="live"] #view-treasury .tsy-body > .outcome { margin: 0 0 16px; }
body[data-look="live"] #view-treasury .tsy-grid { margin: 0 0 var(--section-gap); }
body[data-look="live"] .tsy-holding { --kv-name: 8.5rem; }
/* the figures well holds one figure per row: a holding's amount (a cash one has ten digits and more) is never cut */
body[data-look="live"] .tsy-holding .tsy-figures { grid-template-columns: minmax(0, 1fr); }
body[data-look="live"] .tsy-holding .tsy-figures > .holding-tile { align-content: start; }
body[data-look="live"] :is(.tsy-figures, .tsy-strip) .holding-value > bdi.num { min-width: 0; overflow-wrap: anywhere; }
body[data-look="live"] .tsy-facts :is(.tsy-when, .tsy-by) { white-space: nowrap; }
body[data-look="live"] .tsy-facts .tsy-nothing { color: var(--text-muted); font-weight: 400; }
body[data-look="live"] :is(.tsy-holding, .tsy-summary) .tsy-none {
  justify-self: start; display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
  font-size: var(--fs-note); font-weight: 600; color: var(--text-muted);
}
body[data-look="live"] :is(.tsy-holding, .tsy-summary) .tsy-negative .holding-value { color: var(--bad-ink); }
body[data-look="live"] .tsy-facts .tsy-fact { display: block; min-width: 0; }
body[data-look="live"] .tsy-amount { white-space: nowrap; }
body[data-look="live"] .tsy-amount > bdi.ltr { font-variant-numeric: tabular-nums; }
body[data-look="live"] .tsy-amount > .tsy-unit { font-size: var(--fs-meta); font-weight: 500; color: var(--text-muted); }
body[data-look="live"] .tsy-pending-table tr.tsy-same-date td.col-date { color: var(--text-muted); }
body[data-look="live"] .tsy-history-table .tsy-note { white-space: normal; overflow-wrap: anywhere; }
body[data-look="live"] .tsy-summary .tsy-strip {
  display: grid; gap: 1px; margin: 0; padding: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  background: var(--card-line); border: 1px solid var(--card-line); border-radius: var(--well-radius); overflow: hidden;
}
body[data-look="live"] .tsy-summary .tsy-strip > .holding-tile {
  padding: 12px 16px; background: var(--well-bg); border: 0; border-radius: 0; box-shadow: none;
}
body[data-look="live"] .tsy-summary .tsy-card-note { margin: 0; }
body[data-look="live"] .tsy-form { display: grid; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] .tsy-form > * { margin: 0; min-width: 0; }
body[data-look="live"] .tsy-form .tsy-ask { font-size: var(--fs-body); }
body[data-look="live"] .tsy-form .cfg-field { max-width: var(--measure); }
body[data-look="live"] .tsy-form .cfg-field input[type="text"] { width: 100%; max-width: 24rem; min-height: var(--tap); box-sizing: border-box; }
body[data-look="live"] .tsy-form .tsy-group-name { font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .tsy-pills { display: flex; flex-wrap: wrap; gap: 8px; }
body[data-look="live"] .tsy-pills .tsy-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
  font-size: var(--fs-body); cursor: pointer;
}
body[data-look="live"] .tsy-pills .tsy-pill:has(input:checked) { border-color: var(--gold); background: var(--well-bg); font-weight: 600; }
body[data-look="live"] .tsy-pills .tsy-pill input { margin: 0; }
@media (max-width: 47.99rem) {
  /* the bar keeps five entries: «صندوق دارایی‌ها» is reached from «بیشتر», as «کاربران» is */
  body[data-look="live"][data-shell="staff"] #mainnav #nav-treasury { display: none; }
  body[data-look="live"] #view-treasury .tsy-status > .tsy-today { margin-inline-start: 0; }
  body[data-look="live"] .tsy-summary .tsy-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-look="live"] .tsy-summary .tsy-strip > .holding-tile { padding: 12px; }
  body[data-look="live"] .tsy-holding { --kv-name: 7.5rem; }
  /* the cash (always first) has the row; the products share rows, a last one alone has its row too */
  body[data-look="live"] .tsy-summary .tsy-strip > :first-child,
  body[data-look="live"] .tsy-summary .tsy-strip > :last-child:nth-child(even) { grid-column: 1 / -1; }
  body[data-look="live"] :is(.tsy-holding, .tsy-form) .card-foot > button { flex: 1 1 100%; min-height: var(--tap); }
  body[data-look="live"] .tsy-form .cfg-field input[type="text"] { max-width: none; }
  body[data-look="live"] .tsy-amount { white-space: normal; }
}
/* ===== R12 treasury: end ===== */
/* ===== R11 zaryar mapping and catalog causes: begin ===== */
/* R11 (owner 2026-11-12 items 2 and 4; the R11 spec, package P-B): «قلم متناظر در زریار» at the end of a product's sheet
   (a section of the overlay: no frame, the section title's hairline above), its status line, its table of delivery
   terms, ONE editor at a time (pills, the ratio, the preview well, the units notice, the foot) and the Tahesab list's
   «جزئیات فنی». Every selector is under the live look; the card system's tokens only. */
body[data-look="live"] .zrl-section { display: grid; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] .zrl-section > * { margin: 0; min-width: 0; }
body[data-look="live"] .zrl-status { justify-content: flex-start; }
body[data-look="live"] .zrl-status > button { margin-inline-start: auto; }
body[data-look="live"] .zrl-table .zrl-term { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
body[data-look="live"] .zrl-table .zrl-item bdi.ltr,
body[data-look="live"] .zrl-list bdi.ltr { font-variant-numeric: tabular-nums; }
body[data-look="live"] .zrl-editor {
  display: grid; gap: var(--card-gap); min-width: 0; padding-top: var(--card-gap); border-top: var(--rule);
}
body[data-look="live"] .zrl-editor > * { margin: 0; min-width: 0; }
body[data-look="live"] .zrl-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
body[data-look="live"] .zrl-editor-title { margin: 0; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .zrl-part { display: grid; gap: 8px; min-width: 0; }
body[data-look="live"] .zrl-part > * { margin: 0; min-width: 0; }
body[data-look="live"] .zrl-part-title { margin: 0; font-size: var(--fs-meta); font-weight: 700; color: var(--text); }
body[data-look="live"] .zrl-search { width: 100%; max-width: 24rem; min-height: var(--tap); box-sizing: border-box; }
body[data-look="live"] .zrl-group-name { font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .zrl-field-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
body[data-look="live"] .zrl-field { max-width: var(--measure); }
body[data-look="live"] .zrl-field input[type="text"],
body[data-look="live"] .zrl-field input[type="date"] { max-width: 24rem; min-height: var(--tap); box-sizing: border-box; }
body[data-look="live"] .zrl-list .zrl-radio {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap);
  cursor: pointer;
}
body[data-look="live"] .zrl-list .zrl-radio input { width: 20px; height: 20px; margin: 0; }
body[data-look="live"] .zrl-list td.col-primary { min-width: 0; width: 1%; }
body[data-look="live"] .zrl-pills { display: flex; flex-wrap: wrap; gap: 8px; }
body[data-look="live"] .zrl-pills .zrl-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
  font-size: var(--fs-body); cursor: pointer;
}
body[data-look="live"] .zrl-pills .zrl-pill:has(input:checked) { border-color: var(--gold); background: var(--well-bg); font-weight: 600; }
body[data-look="live"] .zrl-pills .zrl-pill input { margin: 0; }
body[data-look="live"] .zrl-pills[aria-invalid="true"] .zrl-pill { border-color: var(--sell); }
body[data-look="live"] .zrl-ratio {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  max-width: 24rem;
}
body[data-look="live"] .zrl-ratio input { width: 100%; min-height: var(--tap); box-sizing: border-box; }
body[data-look="live"] .zrl-ratio-bar { font-weight: 700; color: var(--text-muted); }
body[data-look="live"] .zrl-preview {
  display: grid; gap: 6px; min-width: 0; padding: 12px 16px; background: var(--well-bg); border-radius: var(--well-radius);
  font-size: var(--fs-body);
}
body[data-look="live"] .zrl-preview > * { margin: 0; min-width: 0; }
body[data-look="live"] .zrl-preview bdi.ltr { overflow-wrap: anywhere; word-break: break-word; }
body[data-look="live"] .zrl-preview .zrl-formula { font-family: var(--mono); font-size: var(--fs-note); }
body[data-look="live"] .zrl-preview .zrl-cross { padding-inline-start: 8px; border-inline-start: var(--edge) solid var(--gold); }
body[data-look="live"] .zrl-preview .zrl-preview-warn { color: var(--warn-ink); font-weight: 600; }
body[data-look="live"] .zrl-ask,
body[data-look="live"] .zrl-units:not(:empty) {
  padding: 10px 12px; border-inline-start: var(--edge) solid var(--gold); border-radius: var(--well-radius);
  background: var(--well-bg); font-size: var(--fs-body); line-height: 1.7;
}
body[data-look="live"] .zrl-units:not(:empty) { display: grid; gap: 8px; }
body[data-look="live"] .zrl-units > * { margin: 0; min-width: 0; }
body[data-look="live"] .zrl-units > button { justify-self: start; }
body[data-look="live"] .zrl-units.zrl-units-confirmed { border-inline-start-color: var(--ok); background: var(--ok-bg); }
body[data-look="live"] .zrl-units .zrl-check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); }
body[data-look="live"] .zrl-units .zrl-check input { width: 20px; height: 20px; margin: 0; }
body[data-look="live"] .zrl-units-done { overflow-wrap: anywhere; }
body[data-look="live"] .zrl-foot-rule { display: none; }
body[data-look="live"] .zrl-history-list { margin: 0; padding-inline-start: 18px; font-size: var(--fs-meta); }
body[data-look="live"] .zrl-tech .kv-value bdi.ltr { font-family: var(--mono); font-size: var(--fs-note); overflow-wrap: anywhere; }
/* R11 polish: the card's way to the mapping is a quiet line under its toolbar (no longer inside «جزئیات فنی») */
body[data-look="live"] .zr-map-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] .zr-map-line > .zr-map-hint { margin: 0; flex: 1 1 18rem; min-width: 0; }
/* R11 polish: the section after «افزودن زمان تحویل»; the feed-ON line in the warn tint; a raw Zaryar price with its
   grouped digits beside it; the units date's choice; the coin list's technical words; a list line that hides rows */
body[data-look="live"] .cfg-asset-sheet-body > .zrl-section { margin: 12px 0 0; }
body[data-look="live"] .zrl-section > div.card-status.zrl-feed-on { background: var(--warn-bg); color: var(--warn-ink); }
body[data-look="live"] .zrl-raw .zrl-grouped { color: var(--text-muted); font-size: var(--fs-note); white-space: nowrap; }
body[data-look="live"] .zrl-list .zrl-raw .zrl-grouped { display: block; }
body[data-look="live"] .zrl-field select { width: 100%; max-width: 24rem; min-height: var(--tap); box-sizing: border-box; }
body[data-look="live"] .prd-cause .prd-cause-note { margin: 0 0 4px; font-size: var(--fs-note); color: var(--text-muted); }
body[data-look="live"] .prd-dropped.warn { color: var(--warn-ink); }
body[data-look="live"] .prd-cause > summary { min-height: var(--tap); }
body[data-look="live"] .prd-cause .prd-cause-line {
  margin: 0; font-family: var(--mono); font-size: var(--fs-note); text-align: left; overflow-wrap: anywhere;
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .zrl-status > button { flex: 1 1 100%; margin-inline-start: 0; }
  body[data-look="live"] .zrl-search,
  body[data-look="live"] .zrl-field input[type="text"],
  body[data-look="live"] .zrl-field input[type="date"],
  body[data-look="live"] .zrl-field select,
  body[data-look="live"] .zrl-ratio { max-width: none; }
  body[data-look="live"] .zrl-list td.col-primary { grid-column: 1 / -1; }
  body[data-look="live"] .zrl-foot > button { flex: 1 1 100%; min-height: var(--tap); }
  body[data-look="live"] .zrl-section button:not(.help-btn, .help-close) { min-height: var(--tap); }
  body[data-look="live"] .zrl-list td.col-primary { width: auto; }
  body[data-look="live"] .zrl-foot > .zrl-foot-rule { display: block; flex: 1 1 100%; height: 0; border-top: var(--rule); }
  body[data-look="live"] .zrl-foot > .danger-outline { margin-inline-start: 0; }
}
/* ===== R11 zaryar mapping and catalog causes: end ===== */
/* ===== R12 new-request pop-up decisions: begin ===== */
/* owner item 5 (2026-11-12): «پذیرش» and «رد» beside «بررسی» in the new-request pop-up -- the one primary first, the
   secondary next, the destructive verb alone at the far end (the card system's action rule); the busy line and the
   answer are said in place, between the summary and the buttons, and an empty line takes no room */
body[data-look="live"] .pending-popup .actions > .pending-reject { margin-inline-start: auto; }
body[data-look="live"] .pending-popup .pending-decision { margin: 0; }
body[data-look="live"] .pending-popup .pending-decision:empty { display: none; }
body[data-look="live"] .pending-popup .pending-decision > :is(p, h4) { margin: 0; }
body[data-look="live"] .pending-popup .pending-decision.neutral { border-inline-start-color: var(--line-strong); }
body[data-look="live"] .pending-popup :is(.pending-busy, .pending-note) { font-size: var(--fs-meta); color: var(--text-muted); }
/* review: a verb that is off keeps its slot (invisible, not removed), so «بررسی» never moves into its place; the
   decision's line holds the keyboard while a decision runs */
body[data-look="live"] .pending-popup .actions > .pending-verb-off { visibility: hidden; }
body[data-look="live"] .pending-popup .pending-summary .pending-countdown-gone { visibility: hidden; }
body[data-look="live"] .pending-popup .pending-decision:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* ===== R12 new-request pop-up decisions: end ===== */
/* ===== R13 customer home tabs: begin ===== */
/* owner 2026-11-14: the home's «قیمت‌ها» card shows its prices by delivery term -- one pill per term above the table (a
   tablist; the chosen pill filled, as the chosen filter of «درخواست‌ها» is); the pills wrap on a phone, so nothing
   scrolls sideways; the table stays the card's body. The old count line is gone: its empty anchor (where a VIP
   customer's chip goes) takes no room. */
body[data-look="live"] .home-excerpt > .home-term-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
body[data-look="live"] .home-term-tabs > .home-term-tab {
  flex: 0 1 auto; max-width: 100%; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); background: transparent; color: var(--text);
  font-size: var(--fs-body); font-weight: 600; white-space: normal; overflow-wrap: anywhere; text-align: center;
}
body[data-look="live"] .home-term-tabs > .home-term-tab:hover { border-color: var(--gold); }
body[data-look="live"] .home-term-tabs > .home-term-tab[aria-selected="true"] {
  border-color: var(--gold); background: var(--gold); color: var(--green-950);
}
body[data-look="live"] .home-block-title > #home-board-count:empty { display: none; }
/* a tab's row names its product and, under the name, what its prices are per (the chosen tab names the term) */
body[data-look="live"] #home-board .board-title > .board-assetper {
  font-size: var(--fs-meta); font-weight: 500; color: var(--text-muted);
}
/* «قیمت‌ها» on a phone: the refresh keeps the title's line (the update time wraps under the title, not the button);
   a failed refresh says «به‌روز نیست — …» beside the button: then the head wraps and the words wrap too (review M2) */
@media (max-width: 47.99rem) {
  body[data-look="live"][data-shell="customer"] #view-trade > .page-head { flex-wrap: nowrap; align-items: flex-start; }
  body[data-look="live"][data-shell="customer"] #view-trade > .page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
  body[data-look="live"][data-shell="customer"] #view-trade > .page-head > .page-actions { flex: 0 0 auto; }
  body[data-look="live"][data-shell="customer"] #view-trade > .page-head:has(.freshness.stale) { flex-wrap: wrap; }
  body[data-look="live"][data-shell="customer"] #view-trade > .page-head:has(.freshness.stale) > .page-actions {
    flex: 0 1 auto; min-width: 0;
  }
}
/* ===== R13 customer home tabs: end ===== */
/* ===== R13 product sheet: begin ===== */
/* R13 (owner 2026-11-14: "all parts of an asset details can be presented in a collapsable presentation for more
   clearity"): every part of a product's sheet is a fold, and all of them look the same -- a full-width 44px header
   (the part's title, its one quiet summary, the turning «‹» at the far end), a hairline between parts, the body right
   under its header. On a phone the summary takes the line under the title. The removal (contract item 4): «حذف کالا»
   is the sheet's last part (its body the bad-tone well), «حذف» stands on each delivery term's line, the question is an
   overlay (one head, one close), and what was removed is listed read only in a quiet fold. Presentation only. */
body[data-look="live"] .cfg-asset-sheet .cfg-sheet-block { gap: 0; }
body[data-look="live"] .sheet-fold {
  display: block; margin: 0; padding: 0; border: 0; border-top: var(--rule); border-radius: 0; background: none;
}
body[data-look="live"] .sheet-fold > .sheet-fold-heading { width: 100%; margin: 0; padding: 0; border: 0; font-size: inherit; }
body[data-look="live"] .sheet-fold-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; row-gap: 2px;
  justify-content: stretch; width: 100%; min-height: var(--tap); margin: 0; padding: 8px 0; box-sizing: border-box;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-weight: 400;
  line-height: 1.4; text-align: start; cursor: pointer;
}
body[data-look="live"] .sheet-fold-head:hover .sheet-fold-title { text-decoration: underline; text-underline-offset: 3px; }
body[data-look="live"] .sheet-fold-head:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
body[data-look="live"] .sheet-fold-title { grid-column: 1; grid-row: 1; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .sheet-fold-sum {
  grid-column: 2; grid-row: 1; min-width: 0; font-size: var(--fs-meta); color: var(--text-muted); overflow-wrap: anywhere;
}
body[data-look="live"] .sheet-fold-sum:empty { display: none; }
body[data-look="live"] .sheet-fold-head::after {
  content: "‹"; grid-column: 3; grid-row: 1; align-self: center; color: var(--text-muted); transition: transform 0.15s;
}
body[data-look="live"] .sheet-fold[open] > .sheet-fold-heading > .sheet-fold-head::after { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { body[data-look="live"] .sheet-fold-head::after { transition: none; } }
body[data-look="live"] .sheet-fold > .sheet-fold-body:not([hidden]) { display: grid; gap: 12px; min-width: 0; padding: 0 0 16px; }
body[data-look="live"] .sheet-fold > .sheet-fold-body > * { margin: 0; min-width: 0; }
body[data-look="live"] .sheet-fold .cfg-part-body,
body[data-look="live"] .sheet-fold .prd-sheet-body,
body[data-look="live"] .sheet-fold .zrl-body { display: grid; gap: 12px; min-width: 0; }
body[data-look="live"] :is(.cfg-part-body, .prd-sheet-body, .zrl-body) > * { margin: 0; min-width: 0; }
/* the parts after the terms' block stand as its siblings: the same hairline, no older margins or frames */
body[data-look="live"] .cfg-asset-sheet-body > #cfg-add-term-fold.sheet-fold,
body[data-look="live"] .cfg-asset-sheet-body > .zrl-section.sheet-fold { margin: 0; padding: 0; border: 0; border-top: var(--rule); }
body[data-look="live"] .zrl-section > .sheet-fold-body > .zrl-body > div.card-status.zrl-feed-on {
  background: var(--warn-bg); color: var(--warn-ink);
}
/* «زمان‌های تحویل»: the first term right under the header (no hairline of its own); a term's line holds its «حذف» */
body[data-look="live"] .cfg-part-body > .cfg-term:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
body[data-look="live"] .cfg-term-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
body[data-look="live"] .cfg-term-head > .cfg-term-name { flex: 1 1 12rem; min-width: 0; }
body[data-look="live"] .cfg-term-head > .cfg-term-remove { flex: 0 0 auto; margin-inline-start: auto; }
/* «حذف کالا»: the last part; its title in the sell ink, its body the bad-tone well (the button not stretched); its
   header spans the row as every other part's (the older zone rule put its children at the start) */
body[data-look="live"] .sheet-fold.cfg-danger {
  display: block; justify-items: normal; margin: 0; padding: 0; border: 0; border-top: var(--rule); border-radius: 0;
  background: none;
}
body[data-look="live"] .sheet-fold.cfg-danger .sheet-fold-title { color: var(--sell-deep); }
body[data-look="live"] .sheet-fold.cfg-danger > .sheet-fold-body:not([hidden]) {
  margin-bottom: 16px; padding: 10px 12px; border-inline-start: var(--edge) solid var(--sell);
  border-radius: var(--well-radius); background: var(--danger-soft);
}
body[data-look="live"] .cfg-remove-zone { display: grid; gap: 8px; justify-items: start; }
body[data-look="live"] .cfg-remove-zone > .cfg-remove-lead { margin: 0; font-size: var(--fs-body); line-height: 1.8; }
/* what was removed: a quiet fold, read only -- under the products list, and at the end of «زمان‌های تحویل» (a fold
   inside a fold: no hairline of its own, indented 12px) */
body[data-look="live"] .sheet-fold.cfg-removed-fold .sheet-fold-title {
  font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted);
}
body[data-look="live"] .sheet-fold-body .sheet-fold { border-top: 0; margin-inline-start: 12px; }
body[data-look="live"] #cfg-panel > .sheet-fold.cfg-removed-fold { margin-top: var(--section-gap); border-top: 0; }
body[data-look="live"] .cfg-removed-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
body[data-look="live"] .cfg-removed-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: var(--fs-body); line-height: 1.6;
}
body[data-look="live"] :is(.cfg-removed-name, .cfg-remove-name) {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px;
}
body[data-look="live"] .cfg-removed-name { font-weight: 600; }
body[data-look="live"] :is(.cfg-removed-name, .cfg-remove-name) .idchip {
  padding: 0; border: 0; background: none; font-size: var(--fs-note); font-weight: 500; color: var(--text-muted);
}
body[data-look="live"] .cfg-removed-when { font-size: var(--fs-meta); color: var(--text-muted); }
/* the removal's question: a narrow overlay -- what happens as a short list, then «انصراف» and «حذف …» */
body[data-look="live"] .overlay.cfg-remove-panel { width: min(34rem, calc(100vw - 1.5rem)); }
body[data-look="live"] .cfg-remove-panel .cfg-remove-facts {
  display: grid; gap: 6px; margin: 0; padding-inline-start: 20px; font-size: var(--fs-body); line-height: 1.8;
}
body[data-look="live"] .cfg-remove-panel .card-foot { margin-top: 16px; padding-top: 12px; border-top: var(--rule); }
@media (max-width: 47.99rem) {
  body[data-look="live"] .sheet-fold-head { grid-template-columns: minmax(0, 1fr) auto; }
  body[data-look="live"] .sheet-fold-sum { grid-column: 1; grid-row: 2; }
  body[data-look="live"] .sheet-fold-head::after { grid-column: 2; grid-row: 1 / span 2; }
  /* «مشخصات» as before its fold: the name on its own line, the unit and the decimals side by side, the save its row */
  body[data-look="live"] .cfg-sheet-block .cfg-part-body > .cfg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body[data-look="live"] .cfg-sheet-block .cfg-part-body > .cfg-grid > .cfg-field:first-child,
  body[data-look="live"] .cfg-sheet-block .cfg-part-body > .cfg-grid > button { grid-column: 1 / -1; }
  /* the question's head: its title and the close on the first line, the name and code on the next */
  body[data-look="live"] .cfg-remove-panel > .panel-head > .cfg-remove-name { order: 100; flex-basis: 100%; }
  body[data-look="live"] .cfg-term-head > .cfg-term-remove,
  body[data-look="live"] .cfg-remove-zone > button { min-height: var(--tap); }
  body[data-look="live"] .cfg-remove-panel .card-foot > button { flex: 1 1 100%; min-height: var(--tap); margin-inline-start: 0; }
}
/* ===== R13 product sheet: end ===== */
/* ===== R13 connections and settings: begin ===== */
/* R13 package U1b (owner 2026-11-14: "I still need cleaner UI, for example all parts of an asset details can be
   presented in a collapsable presentation for more clearity. Even for connections, it can be happen. Everywhere else is
   welcomed to be cleaner."). Every selector under body[data-look="live"]; no external resource, no stacking order.
   (1) Settings › «اتصال‌ها»: a set-up connection card folds. Its head is the fold -- the name is the button, then the
   ONE chip, the turning «‹» at the far end and, on its own line, one quiet summary (the card's meta line, moved in); a
   closed card is its head alone. */
body[data-look="live"] .integ-card.integ-folds[data-fold="closed"] > :not(.integ-head) { display: none; }
body[data-look="live"] .integ-fold-head { position: relative; padding-inline-end: 32px; cursor: pointer; }
body[data-look="live"] .integ-fold-head > .integ-name { min-width: 0; }
body[data-look="live"] .integ-fold-title { margin: 0; min-width: 0; }
body[data-look="live"] button.integ-fold {
  min-height: var(--tap); max-width: 100%; padding: 0; border: 0; border-radius: var(--well-radius);
  background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: start;
  justify-content: flex-start;
}
body[data-look="live"] .integ-fold-head:hover button.integ-fold { text-decoration: underline; text-underline-offset: 5px; }
/* the turning «‹» keeps the head's far end on the name's line, however the head wraps on a phone */
body[data-look="live"] .integ-fold-head::after {
  content: "‹"; position: absolute; inset-inline-end: 0; top: 0; display: flex; align-items: center; justify-content: center;
  width: 28px; height: var(--tap); font-size: var(--fs-card); font-weight: 400; line-height: 1; color: var(--text-muted);
  transition: transform 0.2s;
}
body[data-look="live"] .integ-card[data-fold="open"] > .integ-fold-head::after { transform: rotate(-90deg); }
body[data-look="live"] .integ-fold-head > .integ-fold-sum { flex: 1 1 100%; margin: 0; }
/* «معاملات زریار»: its counters are the quiet summary in the head, not a well in the card; its alerts' way reads as one */
body[data-look="live"] .integ-fold-head > .zr-today { padding: 0; border-radius: 0; background: none; color: var(--text-muted); }
body[data-look="live"] .integ-fold-head > .zr-today > .zr-alerts-link {
  margin-block: -10px; padding-inline: 0; color: var(--warn-ink); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  body[data-look="live"] .integ-fold-head::after { transition: none; }
}
/* (2) a phone: a card's toolbar controls share a row while they fit (each keeps its 44px), not a column of full-width
   buttons */
@media (max-width: 47.99rem) {
  body[data-look="live"] .zr-card .zr-controls > * { flex: 0 1 auto; }
}
/* (3) the Tahesab «جزئیات فنی»: its parts -- the server's facts, «حساب نمونه», the start-time recovery -- one after
   another, each opened by one hairline (the sample account's own line goes: the part's line is above its sentence) */
body[data-look="live"] #accounting-connection-tech > :is(.acct-pilot, .acct-recovery-host:not(:empty)) {
  margin-top: 12px; padding-top: 12px; border-top: var(--rule);
}
body[data-look="live"] #accounting-connection-tech > .acct-pilot > .block { border-top: 0; }
/* (4) «تقویم»: the explanation shows its first lines (three on a phone) until «ادامهٔ توضیح»; the whole text stays */
body[data-look="live"] .cfg-calendar-note.cfg-note-short {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .cfg-calendar-note.cfg-note-short { -webkit-line-clamp: 3; }
}
body[data-look="live"] .cfg-calendar-card > .cfg-calendar-more { order: 1; align-self: flex-start; margin-block: -10px -4px; }
body[data-look="live"] .cfg-section > .cfg-calendar-more { justify-self: start; margin-block: -10px -4px; }
/* (5) «بازار و مهلت»: the market's state is the tab's own status line above the card; its way to «قیمت‌گذاری» keeps
   its 44px target without making the line a tall box */
body[data-look="live"] .cfg-section > .cfg-market-state > button.cfg-link { margin-block: -10px; }
/* ===== R13 connections and settings: end ===== */
/* ===== R13 work pages: begin ===== */
/* R13 (owner 2026-11-14: «I still need cleaner UI ... a collapsable presentation for more clarity ... Everywhere else
   is welcomed to be cleaner»), package U4 -- the staff work pages: «کارتابل» (the decided list and the treasury card are
   folds), the request overlay («جزئیات بیشتر» says what it holds), «مشتریان» (a profile's identity and request history,
   the registration form's fields) and «صندوق دارایی‌ها» (each holding's breakdown, the records' history). Every one is
   the app's ONE part fold (foldable with opts, the product sheet's own): a full-width header button -- the title at the
   level of what it heads, ONE quiet summary, the turning «‹» at its far end -- a hairline above it, its body right under
   it; a header row's one tool (the way to a page, «ویرایش مشخصات») stands at the row's far end. Presentation only:
   every selector under the live look, the card system's tokens, nothing external, no stacking order. */

/* -- the one part fold, at zero weight: the product sheet's R13 slot draws the same fold and, where it is present, its
   rules decide; these keep the work pages right on their own -- */
body[data-look="live"] :where(.sheet-fold) {
  display: block; margin: 0; padding: 0; border: 0; border-top: var(--rule); border-radius: 0; background: none;
}
body[data-look="live"] :where(.sheet-fold > .sheet-fold-heading) { margin: 0; padding: 0; border: 0; font-size: inherit; }
body[data-look="live"] :where(.sheet-fold-head) {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; row-gap: 2px;
  justify-content: stretch; width: 100%; min-height: var(--tap); margin: 0; padding: 8px 0; box-sizing: border-box;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-weight: 400;
  line-height: 1.4; text-align: start; cursor: pointer;
}
body[data-look="live"] :where(.sheet-fold-head:hover .sheet-fold-title) { text-decoration: underline; text-underline-offset: 3px; }
body[data-look="live"] :where(.sheet-fold-head:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
body[data-look="live"] :where(.sheet-fold-title) { grid-column: 1; grid-row: 1; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] :where(.sheet-fold-sum) {
  grid-column: 2; grid-row: 1; min-width: 0; font-size: var(--fs-meta); color: var(--text-muted); overflow-wrap: anywhere;
}
body[data-look="live"] :where(.sheet-fold-sum:empty) { display: none; }
body[data-look="live"] :where(.sheet-fold-head)::after {
  content: "‹"; grid-column: 3; grid-row: 1; align-self: center; color: var(--text-muted); transition: transform 0.15s;
}
body[data-look="live"] :where(.sheet-fold[open] > .sheet-fold-heading > .sheet-fold-head)::after { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { body[data-look="live"] :where(.sheet-fold-head)::after { transition: none; } }
body[data-look="live"] :where(.sheet-fold > .sheet-fold-body:not([hidden])) {
  display: grid; gap: 12px; min-width: 0; padding: 0 0 16px;
}
body[data-look="live"] :where(.sheet-fold > .sheet-fold-body > *) { margin: 0; min-width: 0; }
@media (max-width: 47.99rem) {
  body[data-look="live"] :where(.sheet-fold-head) { grid-template-columns: minmax(0, 1fr) auto; }
  body[data-look="live"] :where(.sheet-fold-sum) { grid-column: 1; grid-row: 2; }
  body[data-look="live"] :where(.sheet-fold-head)::after { grid-column: 2; grid-row: 1 / span 2; }
}

/* -- a work page's fold: its header's row stands in the middle of its 44px -- the title and its summary on one
   baseline, the «‹» on their middle -- */
body[data-look="live"] .sheet-fold.work-fold > .sheet-fold-heading > .sheet-fold-head { align-content: center; }
/* a problem the closed fold would hide («کد نادرست», «دریافت نشد», «2 منفی») is said in the warning ink */
body[data-look="live"] .sheet-fold.work-fold .sheet-fold-sum .fold-flag { color: var(--warn-ink); font-weight: 600; }
/* a part of the summary («3 معامله در انتظار تسویه», «1 منفی») moves to the next line whole; on a phone the cash figure
   alone may wrap rather than run past the window */
body[data-look="live"] .sheet-fold.work-fold .sheet-fold-sum .nowrap { white-space: nowrap; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .sheet-fold.work-fold .sheet-fold-sum .tsy-card-cash { white-space: normal; }
}

/* -- a fold that IS a card's head (the treasury card, the records' history, the form's fields): no hairline above, the
   card title's size, its body ending at the card's padding -- */
body[data-look="live"] :is(#queue-treasury, #treasury-history, #ob-fields) > .sheet-fold.work-fold { border-top: 0; }
body[data-look="live"] :is(#queue-treasury, #treasury-history, #ob-fields) > .sheet-fold.work-fold > .sheet-fold-heading .sheet-fold-title {
  font-size: var(--fs-card);
}
body[data-look="live"] :is(#queue-treasury, #treasury-history, #ob-fields) > .sheet-fold.work-fold > .sheet-fold-heading > .sheet-fold-head {
  padding-block: 0;
}
body[data-look="live"] :is(#queue-treasury, #treasury-history, #ob-fields, .tsy-holding) > .sheet-fold.work-fold > .sheet-fold-body:not([hidden]) {
  gap: var(--card-gap); padding: var(--card-gap) 0 0;
}
/* a header row's one tool (the way to a page, «ویرایش مشخصات») follows the fold's heading in the reading and tab
   order and stands at the row's far end: the fold is two columns -- the heading (its header button filling the room
   the tool leaves), the tool -- and its body runs across both */
body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
}
body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold > .sheet-fold-heading {
  grid-column: 1; grid-row: 1; width: auto; min-width: 0;
}
body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold > .fold-tool {
  grid-column: 2; grid-row: 1; justify-self: end; margin: 0;
}
body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold > .sheet-fold-body { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  /* on a desk the row's far end is the tool's: the «‹» follows the summary, apart from the tool's own arrow */
  body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold > .sheet-fold-heading > .sheet-fold-head {
    grid-template-columns: auto auto auto; justify-content: start;
  }
}

/* -- «کارتابل»: the decided list is a group like the waiting one, its header the group's label -- */
body[data-look="live"] #queue-list > .queue-decided-fold { margin: var(--section-gap) 0 0; border-top: 0; }
body[data-look="live"] #queue-list > .queue-decided-fold > .sheet-fold-heading .sheet-fold-title { color: var(--text-muted); }
body[data-look="live"] #queue-list > .queue-decided-fold > .sheet-fold-heading > .sheet-fold-head {
  min-height: 0; padding: 0 0 8px;
}
body[data-look="live"] #queue-list > .queue-decided-fold > .sheet-fold-body:not([hidden]) { display: block; padding: 0; }
body[data-look="live"] .queue-decided-body > .data-table-wrap { margin: 0; }
body[data-look="live"] .queue-decided-body > .queue-more { margin: 12px 0 0; }

/* -- «کارتابل»: the treasury card -- its head is the fold's header; open, the strip and its note say the rest, so the
   summary (the cash in hand) is said only while the card is put away -- */
body[data-look="live"] #queue-treasury > .tsy-card-fold[open] > .sheet-fold-heading .sheet-fold-sum { display: none; }
body[data-look="live"] #queue-treasury .tsy-card-body { display: grid; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] #queue-treasury .tsy-card-body > * { margin: 0; min-width: 0; }

/* -- «صندوق دارایی‌ها»: two holdings a row on a desk; a holding's breakdown is its card's last part, a quiet fold under
   a hairline -- */
@media (min-width: 48rem) {
  /* each card its own height: a breakdown opened in one card never stretches its neighbour with an empty band */
  body[data-look="live"] #view-treasury .tsy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
body[data-look="live"] .tsy-holding > .tsy-facts-fold > .sheet-fold-heading .sheet-fold-title {
  font-size: var(--fs-meta); font-weight: 600; color: var(--text-muted);
}
body[data-look="live"] .tsy-holding > .tsy-facts-fold > .sheet-fold-heading > .sheet-fold-head { padding-bottom: 0; }
body[data-look="live"] .tsy-holding > .tsy-facts-fold .tsy-facts { max-width: none; }

/* -- a customer's profile: the identity (reference, closed at first) and the request history are sections of the
   overlay, each headed by its fold -- */
body[data-look="live"] #customer-profile > .profile-identity { margin: 0; }
body[data-look="live"] #customer-profile > .profile-identity > .profile-review-case { margin: 4px 0 0; }
body[data-look="live"] #customer-profile > .profile-history-fold > .sheet-fold-body:not([hidden]) { display: block; padding: 0; }

/* -- «ثبت‌نام‌ها»: the form's fields -- inside, the list's caption (with its «؟»), the boxes, «ذخیره» and the answer -- */
body[data-look="live"] #ob-fields .ob-fields-body {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0;
}
body[data-look="live"] #ob-fields .ob-fields-body > * { margin: 0; }
body[data-look="live"] #ob-fields .ob-fields-body > :is(.ob-fields-set, .ob-outcome) { align-self: stretch; }
body[data-look="live"] #ob-fields .ob-fields-body > .ob-outcome:empty { display: none; }
/* the caption floats so it is an ordinary first line of the list (a rendered legend would sit in the border) */
body[data-look="live"] #ob-fields .ob-fields-set > .ob-fields-legend {
  float: inline-start; width: 100%; padding: 0 0 4px; font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted);
}

/* -- the request overlay: «جزئیات بیشتر» says, quietly, what it holds -- */
body[data-look="live"] #view-detail .detail-more > summary > .fold-sum {
  margin-inline-start: 8px; font-weight: 400; color: var(--text-muted);
}

@media (max-width: 47.99rem) {
  body[data-look="live"] :is(#queue-treasury, #profile-identity) > .sheet-fold.work-fold { column-gap: 8px; }
}
/* ===== R13 work pages: end ===== */
/* ===== R13 vip limits: begin ===== */
/* R13 package U3b (the owner's message of 2026-11-14: «the trade limitations be different for VIPs and regulars»): the
   product sheet's VIP bounds -- under each side's row of a delivery term's table, a quiet row of its own («ویژه» and
   the side, what a VIP customer is held to now, «حداقل ویژه» / «حداکثر ویژه», «ذخیرهٔ حدود ویژه»); a VIP range left
   empty is the warning tone on that row. «وضعیت» says who sees the product (a status line with its way to «قیمت‌گذاری»)
   and each delivery term's head its own audience. The customer's ticket says a quantity outside its allowed range in
   the estimate's place. Presentation only; no stacking order, no outside resource. */
body[data-look="live"] .cfg-part-body > .cfg-vip-hint { font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.7; }
body[data-look="live"] .cfg-part-body > .cfg-vip-hint + .cfg-term { margin-top: 0; padding-top: 0; border-top: 0; }
body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip > td { background: var(--well-bg); }
body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip.vip-crossed > td { background: var(--warn-bg); }
body[data-look="live"] .cfg-vip-who {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; min-width: 0;
}
body[data-look="live"] .cfg-vip-who > .cfg-vip-side { font-size: var(--fs-meta); color: var(--text-muted); }
body[data-look="live"] .cfg-vip-state { font-size: var(--fs-meta); line-height: 1.5; }
body[data-look="live"] .cfg-vip-state.cfg-vip-crossed {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
}
body[data-look="live"] .data-table .cfg-vip-state.cfg-vip-crossed > .cell-sub {
  max-width: 12rem; white-space: normal; text-align: center; color: var(--warn-ink);
}
body[data-look="live"] .cfg-limit input::placeholder { font-size: var(--fs-meta); color: var(--text-muted); opacity: 1; }
body[data-look="live"] .cfg-audience-line > .cfg-audience-seen { color: var(--text-muted); }
body[data-look="live"] .cfg-term-name > .chip.cfg-audience { font-weight: 600; }
body[data-look="live"] #trade-preview > .ticket-bounds-said { font-size: var(--fs-body); font-weight: 600; color: var(--warn-ink); }
@media (max-width: 47.99rem) {
  /* a phone card per row: the VIP row reads as its side's second card, its first line the «ویژه» chip and the side */
  body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip {
    background: var(--well-bg); border-radius: var(--well-radius);
  }
  body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip.vip-crossed { background: var(--warn-bg); }
  body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip > td,
  body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip.vip-crossed > td { background: transparent; }
  body[data-look="live"] .data-table .cfg-vip-state.cfg-vip-crossed > .cell-sub { max-width: none; text-align: start; }
  body[data-look="live"] .cfg-vip-who { justify-content: flex-start; }
  body[data-look="live"] .cfg-vip-state.cfg-vip-crossed { align-items: flex-start; }
  body[data-look="live"] .data-table.cfg-term-table tr.cfg-scope-vip td.col-actions .row-actions { grid-template-columns: 1fr; }
}
/* ===== R13 vip limits: end ===== */
/* ===== R13 pricing board: begin ===== */
/* R13 (owner 2026-11-14), package U3a: «قیمت‌گذاری». (1) Each product is the app's one part fold: its header strip holds
   the fold's own header (the name, one quiet summary, the turning «‹») and, at the strip's far end, the product's tools
   -- the audience «همه / فقط ویژه / پنهان» with its line «مشتری عادی: … · ویژه: …», or a reader's statement; its held
   line runs under the strip and its delivery terms' rows are its body. (2) The audience is a segmented radio group: the
   choice in force filled by its kind (every customer: the ok tone; VIP customers only: the VIP gold; nobody: a quiet
   well), amber when no customer can see it, faint when it cannot be chosen. (3) A term's audience stands under the
   term's name on a desk; on a phone or a narrow desk the term keeps one eye that opens the three choices (a closed card
   stays as short as it was). (4) «ترتیب نمایش به مشتری»: the arrange card -- the products numbered, each with its
   delivery terms indented under it, «بالا» / «پایین» at each line's far end, the foot «ذخیرهٔ ترتیب» / «انصراف».
   Presentation only: no row, cell, figure or font of the price editor changes (UR0-5, RUI-6); live look only. */

/* -- (1) a product's fold -- */
body[data-look="live"] .opboard > .sheet-fold.opboard-fold {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0; margin: 0; border-top: 0;
}
body[data-look="live"] .opboard > .opboard-fold > :is(.sheet-fold-heading, .opboard-tools) {
  grid-row: 1; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading { grid-column: 1; width: auto; min-width: 0; }
body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading > .sheet-fold-head {
  min-height: var(--tap); padding: 6px 12px; align-content: center;
}
body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading .sheet-fold-title { font-size: 1rem; }
body[data-look="live"] .opboard > .opboard-fold.hidden-from-customer > .sheet-fold-heading .sheet-fold-title {
  color: var(--text-muted);
}
body[data-look="live"] .opboard > .opboard-fold .sheet-fold-sum .fold-flag { color: var(--warn-ink); font-weight: 600; }
body[data-look="live"] .opboard > .opboard-fold > .opboard-tools {
  grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: flex-end;
  gap: 4px 8px; min-width: 0; padding: 6px 12px;
}
body[data-look="live"] .opboard > .opboard-fold > .opboard-tools > .aud-seen {
  flex: 1 0 100%; margin: 0; font-size: var(--fs-note); color: var(--text-muted); text-align: end;
}
body[data-look="live"] .opboard > .opboard-fold > .opboard-tools > .visstate {
  display: inline-flex; align-items: center; gap: 0.2rem; font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] .opboard > .opboard-fold > :is(.opboard-held, .sheet-fold-body) { grid-column: 1 / -1; }
body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-body:not([hidden]) { display: block; gap: 0; padding: 0; }
/* the last row of a product is followed by the next product's strip: one hairline between them */
body[data-look="live"] .opboard > .opboard-fold:not(:last-child) .opboard-terms > .opboard-row:last-child {
  border-bottom: 1px solid var(--line);
}
body[data-look="live"] .opboard > .opboard-fold:last-child:not([open]):not(:has(> .opboard-held)) > :is(.sheet-fold-heading, .opboard-tools),
body[data-look="live"] .opboard > .opboard-fold:last-child:not([open]) > .opboard-held { border-bottom: 0; }
@media (min-width: 48rem) {
  /* on a desk the «‹» follows the summary; the strip's far end is the tools' */
  body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading > .sheet-fold-head {
    grid-template-columns: auto auto auto; justify-content: start;
  }
}
@media (max-width: 47.99rem) {
  /* a phone: the name and its summary on the strip's first line, the tools on the next, the line under the control --
     one strip */
  body[data-look="live"] .opboard > .sheet-fold.opboard-fold { grid-template-columns: minmax(0, 1fr); }
  body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading { border-bottom: 0; }
  body[data-look="live"] .opboard > .opboard-fold > .opboard-tools {
    grid-column: 1; grid-row: 2; justify-content: flex-start; padding: 0 12px 8px;
  }
  body[data-look="live"] .opboard > .opboard-fold > .opboard-tools > .aud-seen { text-align: start; }
  body[data-look="live"] .opboard > .opboard-fold > .sheet-fold-heading > .sheet-fold-head { padding: 6px 12px 4px; }
}

/* -- (2) the audience: one segmented radio group -- */
body[data-look="live"] .audience {
  display: inline-flex; flex-wrap: nowrap; align-items: stretch; gap: 2px; max-width: 100%; margin: 0; padding: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
}
body[data-look="live"] .audience > button.aud-choice {
  min-width: 40px; min-height: 34px; margin: 0; padding: 0 8px; border: 0; border-radius: var(--radius-pill);
  background: none; box-shadow: none; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; line-height: 1.2;
  white-space: nowrap;
}
body[data-look="live"] .audience > button.aud-choice:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
body[data-look="live"] .audience > button.aud-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
body[data-look="live"] .audience > button.aud-choice[aria-checked="true"][data-audience="all"] {
  background: var(--ok-bg); color: var(--ok-ink); box-shadow: inset 0 0 0 1px var(--ok);
}
body[data-look="live"] .audience > button.aud-choice[aria-checked="true"][data-audience="vip"] {
  background: var(--gold-soft); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold);
}
body[data-look="live"] .audience > button.aud-choice[aria-checked="true"][data-audience="none"] {
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong);
}
body[data-look="live"] .audience > button.aud-choice.held[aria-checked="true"] {
  background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-line);
}
body[data-look="live"] .audience > button.aud-choice[aria-checked="true"]:disabled { opacity: 1; }
body[data-look="live"] .audience > button.aud-choice.locked { opacity: 0.5; }

/* -- (3) a delivery term's audience: under its name on a desk; an eye that opens it on a phone or a narrow desk -- */
body[data-look="live"] .opboard-row .termaud { min-width: 0; max-width: 100%; }
body[data-look="live"] .opboard-row .chip.termaud-vip { white-space: nowrap; }
@media (min-width: 64rem) {
  body[data-look="live"] .opboard-row:not(.opboard-head) .termaud {
    grid-area: gvis; justify-self: center; display: grid; justify-items: center; margin-top: 0.35rem;
  }
  body[data-look="live"] .opboard-row:not(.opboard-head) button.aud-toggle { display: none; }
}
@media (max-width: 63.99rem) {
  body[data-look="live"] .opboard-row button.aud-toggle {
    flex: 0 0 auto; min-width: 36px; min-height: 32px; padding: 0 0.35rem; border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill); background: var(--surface); color: var(--text);
  }
  body[data-look="live"] .opboard-row button.aud-toggle > svg { width: 1.25rem; height: 1.25rem; }
  body[data-look="live"] .opboard-row button.aud-toggle:not([data-audience="none"]) .eye-slash { display: none; }
  body[data-look="live"] .opboard-row button.aud-toggle[data-audience="none"] { background: var(--surface-2); color: var(--text-muted); }
  body[data-look="live"] .opboard-row button.aud-toggle[data-audience="vip"] {
    border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink);
  }
  body[data-look="live"] .opboard-row button.aud-toggle.held {
    border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink);
  }
  body[data-look="live"] .opboard-row button.aud-toggle[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--text); }
  body[data-look="live"] .opboard-row .termaud:not(.open) { display: none; }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  body[data-look="live"] .opboard-row:not(.opboard-head) button.aud-toggle { grid-area: gvis; justify-self: center; margin-top: 0.35rem; }
  body[data-look="live"] .opboard-row:not(.opboard-head) .termaud.open {
    grid-column: 1 / -1; justify-self: center; display: grid; justify-items: center; margin-top: 0.4rem;
  }
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .opboard-row > .board-title > .termaud.open { display: grid; flex: 1 1 100%; order: 2; }
  body[data-look="live"] .opboard-row > .board-title > .termaud.open > .audience { display: flex; width: 100%; }
  body[data-look="live"] .opboard-row > .board-title > .termaud.open > .audience > button.aud-choice { flex: 1 1 0; min-height: 40px; }
}

/* -- (4) «ترتیب نمایش به مشتری»: the arrange card -- */
body[data-look="live"] #board-arrange :is(.arrange-list, .arrange-terms) { margin: 0; padding: 0; list-style: none; }
body[data-look="live"] #board-arrange .arrange-asset { display: grid; gap: 6px; padding: 12px 0; border-top: var(--rule); }
body[data-look="live"] #board-arrange .arrange-asset:first-child { border-top: 0; padding-top: 0; }
body[data-look="live"] #board-arrange .arrange-terms { display: grid; gap: 6px; }
body[data-look="live"] #board-arrange .arrange-line { display: flex; align-items: center; gap: 8px 12px; min-height: 40px; }
body[data-look="live"] #board-arrange .arrange-place {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--well-bg); color: var(--text-muted); font-size: var(--fs-meta); font-weight: 600;
}
body[data-look="live"] #board-arrange .arrange-name {
  flex: 1 1 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0;
}
body[data-look="live"] #board-arrange .arrange-moves { flex: 0 0 auto; display: inline-flex; gap: 8px; }
body[data-look="live"] #board-arrange .arrange-moves > button { min-width: 4.5rem; min-height: 40px; padding-block: 0; }
body[data-look="live"] #board-arrange .arrange-terms {
  margin-inline-start: 13px; padding-inline-start: 23px; border-inline-start: 2px solid var(--line);
}
body[data-look="live"] #board-arrange .arrange-term .arrange-place { width: 24px; height: 24px; font-size: var(--fs-note); }
body[data-look="live"] #board-arrange .board-arrange-status.warn { background: var(--warn-bg); color: var(--warn-ink); }
body[data-look="live"] #board-arrange .board-arrange-foot {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding-top: 12px; border-top: var(--rule);
}
@media (max-width: 47.99rem) {
  body[data-look="live"] #board-arrange .arrange-terms { margin-inline-start: 11px; padding-inline-start: 11px; }
  body[data-look="live"] #board-arrange .arrange-moves { gap: 4px; }
  body[data-look="live"] #board-arrange .arrange-moves > button { min-width: 3.25rem; padding-inline: 0.5rem; }
  body[data-look="live"] #board-arrange .board-arrange-foot > button { flex: 1 1 0; }
}
/* ===== R13 pricing board: end ===== */
/* ===== R14 treasury table: begin ===== */
/* R14 (owner 2026-11-15 item 2): «صندوق دارایی‌ها» -- the holdings as ONE table whose rows open the holding's overlay
   (the card system's row-details overlay; it carries the R12 holding class, so the R12 rules for the figures well, the
   breakdown and the foot hold in it), the form standing over that overlay. Desk cells stay centred; a phone reads each
   row as a stacked card. Every selector is under the live look; the card system's tokens only; nothing external, no
   stacking. */
body[data-look="live"] #view-treasury .tsy-holdings { margin: 0 0 var(--section-gap); }
/* R14 review: the table never scrolls sideways inside its wrap on a narrow desk (1024) -- a long heading takes two
   lines, a figure may put its unit under it (at the space only; a number never breaks), the flags wrap; and only
   there: its columns take their natural width (not the shrink-to-fit 1% of a figure column), so a wide desk keeps
   every heading and every figure on one line */
body[data-look="live"] .tsy-holdings-table :is(th, td):is(.col-num, .col-badge) { width: auto; }
body[data-look="live"] .tsy-holdings-table thead th { white-space: normal; }
body[data-look="live"] .tsy-holdings-table td.col-num { white-space: normal; }
body[data-look="live"] .tsy-holdings-table .tsy-amount { white-space: normal; }
body[data-look="live"] .tsy-holdings-table td.tsy-negative .tsy-amount > bdi.num { color: var(--bad-ink); font-weight: 700; }
body[data-look="live"] .tsy-holdings-table td.col-badge { white-space: normal; }
body[data-look="live"] .tsy-holdings-table .tsy-flags {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 18rem; vertical-align: middle;
}
body[data-look="live"] .tsy-holdings-table .tsy-net { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
body[data-look="live"] .tsy-holdings-table .tsy-net > .cell-sub { font-size: var(--fs-note); color: var(--text-muted); }
/* the holding's overlay: as wide as its figures and its records need, the parts a card's parts apart */
body[data-look="live"] .overlay.row-details.tsy-holding-overlay { width: min(56rem, calc(100vw - 1.5rem)); }
/* R14 review: the overlay's live region (between its head and its body) is never display:none, so what is written into
   it is announced -- empty, it has no box at all */
body[data-look="live"] .overlay.tsy-holding-overlay > .tsy-holding-said { margin: 0 0 var(--card-gap); }
body[data-look="live"] .overlay.tsy-holding-overlay > .tsy-holding-said:empty {
  display: block; margin: 0; padding: 0; border: 0; min-height: 0; background: none; box-shadow: none;
}
body[data-look="live"] .overlay.tsy-holding-overlay > .panel-body { display: grid; gap: var(--card-gap); }
body[data-look="live"] .overlay.tsy-holding-overlay > .panel-body > * { margin: 0; min-width: 0; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-figures > .holding-tile:only-child { grid-column: 1 / -1; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-holding-flags { justify-content: flex-start; gap: 6px; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-section {
  display: grid; gap: 8px; min-width: 0; padding-top: 12px; border-top: var(--rule);
}
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-section > h4 { margin: 0; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-section .tsy-facts { max-width: none; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-holding-records { display: grid; gap: 8px; min-width: 0; }
body[data-look="live"] .overlay.tsy-holding-overlay .tsy-holding-records > p { margin: 0; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .tsy-holdings-table td.col-badge[data-empty="yes"] { display: none; }
  body[data-look="live"] .tsy-holdings-table .tsy-flags { justify-content: flex-end; max-width: 11rem; }
  body[data-look="live"] .tsy-holdings-table .tsy-net { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  body[data-look="live"] .overlay.tsy-holding-overlay .tsy-figures { grid-template-columns: minmax(0, 1fr); }
}
/* ===== R14 treasury table: end ===== */
/* ===== R14 pricing board: begin ===== */
/* R14 (owner 2026-11-15 items 5 and 6), package P3: «قیمت‌گذاری». (1) The page is ONE centred table -- a row per product
   and delivery term: the name and term (the row's way in), «فروش به مشتری» then «خرید از مشتری» (whole figures, one
   line, a closed side's price quiet), who sees it and its state as chips with their reasons under them; on a phone each
   row is a card with the two prices side by side. (2) A row opens its product in the details overlay, wide enough for
   the price editor's four columns: its summary, its tools strip (the audience with its caption and its line, or a
   reader's statement; «بدون نگاشت» and the way to its settings at the strip's end), its held line, the step and the
   editor's rows -- the editor's own rows, cells and figures unchanged (UR0-5, RUI-6). (3) «ترتیب نمایش به مشتری»: a
   grip at each line's start (44px, the only place a drag starts; it alone takes a finger's touch, so the page scrolls
   anywhere else), the line lifted while it is dragged, a gold drop line where it lands, a held line (keyboard) marked.
   Live look only. */

/* -- (1) the page's table -- */
body[data-look="live"] #board-lines .opboard-line-price .num {
  font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
body[data-look="live"] #board-lines .opboard-line-price .num.closed-price { color: var(--text-muted); font-weight: 500; }
body[data-look="live"] #board-lines :is(.line-state, .line-aud) {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; max-width: 16rem;
}
body[data-look="live"] #board-lines :is(.line-state, .line-aud) > .cell-sub { flex: 1 0 100%; white-space: normal; }
body[data-look="live"] #board-lines .chip.line-aud-chip.held {
  background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line);
}
body[data-look="live"] #board-lines td.col-primary .prd-chip { margin-inline-start: 6px; }
body[data-look="live"] #board-lines tr.opboard-line.hidden-from-customer .row-open-text { color: var(--text-muted); }
@media (max-width: 47.99rem) {
  /* a card: the name with its state at the far end, then the two prices side by side, then who sees it */
  body[data-look="live"] #board-lines tr.opboard-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body[data-look="live"] #board-lines tr.opboard-line > td.opboard-line-price {
    grid-column: auto; grid-template-columns: minmax(0, 1fr); gap: 0;
  }
  body[data-look="live"] #board-lines tr.opboard-line > td.opboard-line-price::before { font-size: 0.75rem; }
  body[data-look="live"] #board-lines .line-state { justify-content: flex-end; max-width: none; text-align: end; }
  body[data-look="live"] #board-lines .line-aud { justify-content: flex-start; max-width: none; }
}

/* -- (2) the product's overlay -- */
@media (min-width: 48rem) {
  body[data-look="live"] .overlay.row-details.board-sheet { width: min(72rem, calc(100vw - 1.5rem)); }
}
@media (max-width: 47.99rem) {
  /* a phone: a bottom sheet -- the full width, anchored to the window's bottom (no gap under it), its sides the page's
     own gutter so the editor's cards are as wide as they were on the page */
  body[data-look="live"] .overlay.row-details.board-sheet {
    inset: auto 0 0 0; margin: 0; width: 100vw; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
    padding-inline: var(--gutter); border-inline-width: 0; border-bottom-width: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}
/* R14 review (H1): a failed read -- the overlay says it above its answers and its editor is dimmed as the page's is */
body[data-look="live"] .view[data-stale="yes"] .board-sheet .opboard-product { opacity: 0.6; }
body[data-look="live"] .board-sheet > .panel-body { display: flex; flex-direction: column; gap: var(--card-gap); }
body[data-look="live"] .board-sheet > .panel-body > #board-outcome:empty { display: none; }
body[data-look="live"] .board-sheet .opboard-product { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
body[data-look="live"] .board-sheet .board-sheet-sum { margin: 0; color: var(--text-muted); font-size: var(--fs-meta); }
body[data-look="live"] .board-sheet .board-sheet-sum .fold-flag { color: var(--warn-ink); font-weight: 600; }
body[data-look="live"] .board-sheet .opboard-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px;
  border-radius: var(--well-radius); background: var(--well-bg);
}
body[data-look="live"] .board-sheet .opboard-tools .opboard-tools-caption {
  font-size: var(--fs-meta); font-weight: 600; color: var(--text);
}
body[data-look="live"] .board-sheet .opboard-tools > .aud-seen {
  flex: 1 0 100%; order: 9; margin: 0; font-size: var(--fs-note); color: var(--text-muted);
}
body[data-look="live"] .board-sheet .opboard-tools > .prd-chip { order: 1; }
body[data-look="live"] .board-sheet .opboard-tools > .cfg-link { order: 2; margin-inline-start: auto; }
body[data-look="live"] .board-sheet .opboard-tools > .visstate {
  display: inline-flex; align-items: center; gap: 0.2rem; font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] .board-sheet .opboard-held { margin: 0; }
body[data-look="live"] .board-sheet .board-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
body[data-look="live"] .board-sheet .board-step .segmented button { border: 0; border-radius: 0; }
body[data-look="live"] .board-sheet .board-step .segmented button[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }
body[data-look="live"] .board-sheet .opboard { margin: 0; }
/* the delivery term whose row opened the overlay: a gold edge at its start (RTL: the right) */
body[data-look="live"] .board-sheet .opboard-row.sheet-term:not(.opboard-head) { box-shadow: inset -4px 0 0 var(--gold); }
body[data-look="live"] .board-sheet .board-titletext:focus { outline: none; }
body[data-look="live"] .board-sheet .board-titletext:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
body[data-look="live"] .board-sheet .board-sheet-empty { margin: 0; }

/* -- (3) «ترتیب نمایش به مشتری»: the grip, the drag, the drop line -- */
body[data-look="live"] #board-arrange .board-arrange-keys { font-size: var(--fs-note); }
body[data-look="live"] #board-arrange button.arrange-grip {
  flex: 0 0 auto; display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap);
  margin: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
body[data-look="live"] #board-arrange button.arrange-grip:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
body[data-look="live"] #board-arrange button.arrange-grip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
body[data-look="live"] #board-arrange button.arrange-grip:disabled { cursor: default; opacity: 0.5; }
body[data-look="live"] #board-arrange button.arrange-grip[aria-pressed="true"] {
  border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink);
}
body[data-look="live"] #board-arrange .arrange-grip-dots {
  display: block; width: 4px; height: 16px; border-inline: 4px dotted currentColor;
}
body[data-look="live"] #board-arrange li.dragging {
  position: relative; border-radius: var(--radius-sm); background: var(--card-bg); box-shadow: var(--shadow-pop);
}
body[data-look="live"] #board-arrange li.dragging button.arrange-grip { cursor: grabbing; }
body[data-look="live"] #board-arrange li.drop-before { box-shadow: 0 -3px 0 0 var(--gold); }
body[data-look="live"] #board-arrange li.drop-after { box-shadow: 0 3px 0 0 var(--gold); }
body[data-look="live"] #board-arrange li.grabbed > .arrange-line {
  border-radius: var(--radius-sm); background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold);
}
@media (forced-colors: active) {
  body[data-look="live"] #board-arrange li.drop-before { border-top: 3px solid Highlight; }
  body[data-look="live"] #board-arrange li.drop-after { border-bottom: 3px solid Highlight; }
}
/* ===== R14 pricing board: end ===== */
/* ===== R14 connections table: begin ===== */
/* R14 package P2 (owner 2026-11-15 items 3, 4 and 8): Settings › «اتصال‌ها» is ONE table whose row opens the
   connection in the shared overlay; «قیمت‌های دریافتی از زریار» is a section of «قیمت زریار». Every selector under
   body[data-look="live"]; no external resource, no stacking order.
   (1) a connection that needs a person: its row tinted, ONE stripe at its start, the reason in warn ink */
body[data-look="live"] #integ-table tr.integ-row[data-attention="yes"] > td { background: var(--warn-bg); }
body[data-look="live"] #integ-table tr.integ-row[data-attention="yes"] > td:first-child {
  box-shadow: inset calc(-1 * var(--edge)) 0 0 var(--warn-line);
}
body[data-look="live"] #integ-table .integ-sum {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
}
body[data-look="live"] #integ-table .integ-reason { color: var(--warn-ink); font-weight: 600; }
body[data-look="live"] #integ-table .integ-row-stop { margin-inline-start: 8px; }
/* an awaiting provider: a quiet row with nothing to open */
body[data-look="live"] #integ-table tr.integ-row:not(.row-opens) > td { color: var(--text-muted); }
@media (max-width: 47.99rem) {
  /* a phone: the row is one card -- tinted as one surface, the stripe on the card's start */
  body[data-look="live"] #integ-table tr.integ-row[data-attention="yes"] {
    background: var(--warn-bg); box-shadow: inset calc(-1 * var(--edge)) 0 0 var(--warn-line);
  }
  body[data-look="live"] #integ-table tr.integ-row[data-attention="yes"] > :is(td, td:first-child) {
    background: transparent; box-shadow: none;
  }
  body[data-look="live"] #integ-table .integ-sum { justify-content: flex-start; }
  body[data-look="live"] #integ-table .integ-row-stop { margin: 8px 0 0; }
}
/* (2) the overlay: the connection's content is ONE column of parts, spaced by one gap (it was the card's own) */
body[data-look="live"] .integ-detail > .panel-body > .integ-card {
  display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0;
}
body[data-look="live"] .integ-detail > .panel-body > .integ-card > * { margin-block: 0; min-width: 0; }
body[data-look="live"] .integ-detail > .panel-body > .integ-card > :where(div, p, ul, section):empty { display: none; }
body[data-look="live"] .integ-detail > .panel-body > .integ-card > :is(button, .chip, .help) { align-self: flex-start; }
body[data-look="live"] .integ-detail .integ-state-line > .integ-meta { flex: 1 1 auto; min-width: 0; }
/* the checklist in the overlay's narrower column: a shorter name column, so a line's control stays inside it */
@media (min-width: 48rem) {
  body[data-look="live"] .integ-detail .integ-cap {
    grid-template-columns: minmax(8rem, 13rem) minmax(0, max-content) minmax(0, 1fr);
  }
}
body[data-look="live"] .integ-detail .integ-detail-title > .integ-purpose { margin-inline-start: 4px; }
/* «معاملات زریار»'s way to its alerts, in its status line: read as the warning it is */
body[data-look="live"] .integ-state-line .zr-alerts-link {
  color: var(--warn-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
/* (3) «قیمت‌های دریافتی از زریار»: a section of the overlay -- its title, the reading's time, the table, the balance */
body[data-look="live"] .integ-detail .integ-card > .zr-prices {
  display: flex; flex-direction: column; gap: 8px; padding-top: var(--card-gap); border-top: var(--rule);
}
body[data-look="live"] .zr-prices > .zr-prices-title { margin: 0; font-size: var(--fs-sub); font-weight: 700; }
body[data-look="live"] .zr-prices > :is(.zr-dealer-when, .zr-dealer-note, .zr-convention) {
  margin: 0; font-size: var(--fs-meta); color: var(--text-muted);
}
body[data-look="live"] .zr-prices > .zr-convention { color: var(--warn-ink); }
body[data-look="live"] .zr-prices > .zr-balance { margin: 0; font-weight: 600; }
body[data-look="live"] .zr-prices > .zr-balance > .zr-balance-when { font-size: var(--fs-meta); font-weight: 400; color: var(--text-muted); }
@media (min-width: 48rem) {
  body[data-look="live"] .zr-prices #zr-dealer-list td.zr-num bdi { white-space: nowrap; }
}
/* (4) the product sheet: the bounds as typed, read back grouped, on a line of their own under today's price */
body[data-look="live"] #zrl-bounds-hint > .zrl-bounds-typed { display: block; }
/* ===== R14 connections table: end ===== */
/* ===== R14 icons and tooltips: begin ===== */
/* (owner item 7, 2026-11-15) a converted button (app.js iconInto / iconButton): the icon alone in a 44px square, or
   the icon + its short word; the words stay for a screen reader (aria-label, span.sr-only). Icons are drawn like the
   menu's (24x24, the same stroke). */
body[data-look="live"] button.icon-btn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* the button is what a pointer meets (an elementFromPoint, a handler's event.target), never its icon or its word */
body[data-look="live"] button.icon-btn > * { pointer-events: none; }
body[data-look="live"] button.icon-btn > svg { width: 1.3rem; height: 1.3rem; flex: none; }
body[data-look="live"] button.icon-btn.icon-only {
  min-width: 44px; width: 44px; min-height: 44px; padding: 0; flex: 0 0 auto; gap: 0;
}
body[data-look="live"] button.icon-btn.icon-only.ghost:hover { text-decoration: none; background: var(--well-bg); }
body[data-look="live"] button.icon-btn .icon-word { white-space: nowrap; }
/* a read in flight keeps the button's shape: the icon dimmed, the busy words its name and tooltip */
body[data-look="live"] button.icon-btn[aria-busy="true"] { opacity: 0.55; cursor: progress; }
/* the queue row's two decisions keep the table inside a 1280 / 1024 desk (UR0-1): a smaller icon, a tighter fit */
body[data-look="live"] button.icon-btn:is(.inline-accept, .inline-reject) { gap: 4px; padding-inline: 0.55rem; }
body[data-look="live"] button.icon-btn:is(.inline-accept, .inline-reject) > svg { width: 1.05rem; height: 1.05rem; }
/* the ONE tooltip (div#icon-tip): in the top layer where the browser has one, never catching the pointer; its colours
   are the shell's own text and page colours swapped, so it reads on the light staff and the dark customer shell */
body[data-look="live"] .icon-tip {
  position: fixed; inset: auto; margin: 0; padding: 4px 10px; border: 0; overflow: visible;
  width: max-content; height: auto; max-width: min(18rem, calc(100vw - 16px));
  border-radius: var(--well-radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop);
  font-size: var(--fs-note); font-weight: 600; line-height: 1.6; text-align: center; white-space: normal;
  pointer-events: none;
}
@media (forced-colors: active) {
  body[data-look="live"] .icon-tip { border: 1px solid CanvasText; }
}
/* ===== R14 icons and tooltips: end ===== */
/* ===== R15 pricing board: begin ===== */
/* R15 (owner 2026-11-16, ADR-0034): «قیمت‌گذاری». The product's overlay is ONE table whose rows have one height on a
   desk: «زمان تحویل», «فروش به مشتری» (the typed price, on the right), «اختلاف» (a negative one amber), «خرید از
   مشتری», «نمایش به مشتری», «باز برای مشتری» (the two sides' switches), Zaryar where the product has a pair, and the
   row's actions («ثبت» and «انصراف» only while a price is typed; «ورود دستی» an icon). Its rows and cells reset what
   the R12 grid editor gave `.opboard-row` and its cells; a typed row's line stands under the table. On a phone each row
   is the app's table card. The page's table puts «فروش به مشتری» before «خرید از مشتری» (the JS order). Live look only. */
@media (min-width: 48rem) {
  body[data-look="live"] .overlay.row-details.board-sheet:has(.opboard-table) { width: min(96rem, calc(100vw - 1.5rem)); }
}
body[data-look="live"] .opboard-sheet-table { display: grid; gap: 0.4rem; }
body[data-look="live"] .opboard-sheet-table > .data-table-wrap.opboard {
  border: 0; border-radius: 0; background: transparent; overflow-x: auto; overflow-y: visible; margin: 0;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.board-title {
  border-radius: 0; background: transparent; box-shadow: none; gap: 0; border-inline-start-width: 0;
  border-inline-end: 0; border-top: 0;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row.sheet-term > td { background: var(--gold-soft); }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row.hidden-from-customer .board-termname { color: var(--text-muted); }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper {
  display: grid; grid-template-columns: 30px minmax(9.75rem, 1fr) 30px; gap: 0.15rem; align-items: center;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper.single {
  grid-template-columns: minmax(9.25rem, 1fr);
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .gapline {
  display: grid; grid-template-columns: 30px minmax(5rem, 1fr) 30px; gap: 0.15rem; align-items: center;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper input,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .gapline input {
  grid-column: auto; order: 0; min-height: 36px; padding-block: 0.2rem; padding-inline: 0.3rem; font-size: 0.95rem;
  font-weight: 600; text-align: center; width: 100%;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepbtn {
  min-width: 30px; min-height: 32px; padding: 0; font-size: 1.05rem;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell.base input:not([readonly]) {
  border-color: var(--buy-deep);
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap.negative input {
  border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink);
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .zr-ref {
  margin-top: 0.1rem; font-size: 0.74rem; line-height: 1.3; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 16rem;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.board-title .board-titletext {
  display: inline-flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0.3rem; white-space: nowrap;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-sides {
  white-space: nowrap;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-sides > * { margin: 0 0.1rem; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud .audience > button.aud-choice {
  padding-inline: 0.35rem; font-size: 0.8rem;
}
body[data-look="live"] table.opboard-table > thead th { padding-inline: 0.3rem; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-sides .switch-side {
  display: inline; font-size: 0.78rem; margin-inline-end: 0.2rem;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-sides button.switch.sidegate {
  min-height: 32px; padding: 0 0.25rem; gap: 0.2rem; font-size: 0.78rem;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .opboard-acts { gap: 0.2rem; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .opboard-acts > button {
  min-height: 34px; padding-inline: 0.4rem;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .opboard-acts > button.icon-only {
  min-width: 34px; padding-inline: 0;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .opboard-acts.idle > .stepsave,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .opboard-acts.idle > .stepcancel {
  visibility: hidden;
}
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .manualbtn[aria-pressed="true"] {
  border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink);
}
body[data-look="live"] .opboard-notes { display: grid; gap: 0.25rem; }
body[data-look="live"] .opboard-notes:not(:has(> :not([hidden]))) { display: none; }
body[data-look="live"] .opboard-notes > .opboard-draftbar {
  display: grid; gap: 0.15rem; margin: 0; padding: 0.35rem 0.6rem; border: 1px dashed var(--gold);
  border-radius: var(--radius-sm); background: var(--surface);
}
body[data-look="live"] .opboard-notes > .opboard-draftbar[hidden] { display: none; }
body[data-look="live"] .opboard-notes .opboard-draftnote,
body[data-look="live"] .opboard-notes .opboard-guard,
body[data-look="live"] .opboard-notes .opboard-unpaired { margin: 0; font-size: 0.86rem; }
body[data-look="live"] .opboard-notes .opboard-guard { color: var(--warn-ink); font-weight: 600; }
body[data-look="live"] .opboard-notes .opboard-noteterm { font-weight: 700; }
@media (min-width: 48rem) {
  /* a desk: a real table row of one height -- the R12 grid editor's row and cell layout reset */
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row {
    display: table-row; padding: 0; border: 0; background: transparent; grid-template-areas: none;
    grid-template-columns: none;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td {
    display: table-cell; height: 4.25rem; padding: 0.25rem; vertical-align: middle; white-space: nowrap;
    border-bottom: 1px solid var(--line);
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row:last-child > td { border-bottom: 0; }
  /* the R12 editor laid its title and difference out as `display: contents` grid parts -- here they are cells */
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.board-title,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell { display: table-cell; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .termaud {
    display: inline-grid; margin: 0; justify-items: center;
  }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .termaud:not(.open) { display: none; }
}
@media (max-width: 47.99rem) {
  /* a phone: one short card per delivery term -- the term and its two sides' switches, the sell price with its −/+, the
     difference and the buy price side by side, then its audience's eye and its actions (each price named above it) */
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.3rem 0.45rem;
    grid-template-areas: "title sides" "ask ask" "gap bid" "aud acts"; padding: 0.4rem 0.5rem; align-items: center;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.board-title,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell {
    display: block; height: auto; padding: 0; border: 0; min-width: 0; width: auto; margin: 0; text-align: start;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td::before { display: none; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell::before,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap::before {
    display: block; content: attr(data-label); font-size: 0.72rem; line-height: 1.2; color: var(--text-muted);
    margin-bottom: 0.1rem;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.board-title { grid-area: title; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-sides { grid-area: sides; justify-self: end; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell.buy { grid-area: ask; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-gap { grid-area: gap; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.pricecell.sell { grid-area: bid; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud { grid-area: aud; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud:has(.termaud.open) { grid-column: 1 / -1; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud .termaud.open { display: grid; width: 100%; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud .termaud.open > .audience { display: flex; width: 100%; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-aud .termaud.open > .audience > button.aud-choice {
    flex: 1 1 0; min-height: 40px;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.col-actions { grid-area: acts; justify-self: end; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.opboard-zr { grid-column: 1 / -1; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.col-actions .opboard-acts {
    display: inline-flex; width: auto; flex-wrap: nowrap;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td.col-actions .opboard-acts button {
    flex: 0 0 auto; min-height: 36px;
  }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper.single,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .gapline { grid-template-columns: 34px minmax(0, 1fr) 34px; }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper.single { grid-template-columns: minmax(0, 1fr); }
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper input,
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .gapline input {
    min-height: 36px; font-size: max(16px, 1rem); padding-inline: 0.2rem;
  }
}
@media (max-width: 23.99rem) {
  /* a narrow phone: the difference and the buy price each on its own line, so a long figure shows whole */
  body[data-look="live"] table.opboard-table > tbody > tr.opboard-row {
    grid-template-areas: "title sides" "ask ask" "gap gap" "bid bid" "aud acts";
  }
}
/* ===== R15 pricing board: end ===== */
/* ===== R15 balances: begin ===== */
/* R15 (owner 2026-11-16, ADR-0034): a customer's balance shown without a press -- a short summary (each line its figure,
   unit and side; «≈» on an estimate's rounded gold) in «مانده‌ها», the customers' list and the profile, with
   «هنوز در حسابداری تأیید نشده» under it while trades are counted in; the card's estimate part (its tiles, its count, the
   trades it counts) and the customer's flag line. Live look only. */
body[data-look="live"] .bal-sum { display: inline-grid; gap: 0.1rem; justify-items: center; line-height: 1.35; }
body[data-look="live"] .bal-sum .bal-figures { display: inline-flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; justify-content: center; }
body[data-look="live"] .bal-sum .bal-line { white-space: nowrap; font-size: 0.86rem; }
body[data-look="live"] .bal-sum .bal-line .num { font-weight: 700; }
body[data-look="live"] .bal-side { color: var(--text-muted); font-size: 0.8rem; }
body[data-look="live"] .bal-side.bal-side-customer_owes { color: var(--bad-ink); }
body[data-look="live"] .bal-side.bal-side-customer_credit { color: var(--ok-ink, var(--text)); }
body[data-look="live"] .bal-flag { color: var(--warn-ink); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
body[data-look="live"] .bal-sum[data-pending="yes"] .bal-figures .num { color: var(--warn-ink); }
body[data-look="live"] .profile-balance-link .bal-sum { margin-inline-end: 0.5rem; justify-items: start; }
body[data-look="live"] .profile-balance-link .bal-sum .bal-figures { justify-content: flex-start; }
body[data-look="live"] .bal-unconfirmed {
  display: grid; gap: 0.35rem; margin-block: 0.5rem; padding: 0.5rem 0.6rem; border: 1px dashed var(--warn-line);
  border-radius: var(--radius-sm); background: var(--warn-bg);
}
body[data-look="live"] .bal-unconfirmed .acct-figures-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
body[data-look="live"] .bal-unconfirmed .acct-figures-head h4 { margin: 0; }
body[data-look="live"] .bal-unconfirmed p { margin: 0; }
body[data-look="live"] .bal-unconfirmed .data-table-wrap { margin: 0.2rem 0 0; }
body[data-look="live"] .bal-unconfirmed-tile .holding-value { color: var(--warn-ink); }
body[data-look="live"] .stat-tile.bal-unconfirmed-tile .bal-flag { display: block; margin-top: 0.15rem; }
body[data-look="live"] .own-balance-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
body[data-look="live"] .own-balance-confirmed .bal-line { white-space: nowrap; }
/* ===== R15 balances: end ===== */
/* ===== R17 entry units: begin ===== */
/* R17 (owner 2026-11-16, ADR-0036): the ticket's «گرم» · «مثقال» · «تومان» choice above the amount field. Live look only. */
body[data-look="live"] #trade-ticket-body .entry-basis { display: inline-flex; margin-block: 0.25rem 0.35rem; }
body[data-look="live"] #trade-ticket-body .entry-basis > button[role="radio"] { min-height: 36px; padding-inline: 0.8rem; }
body[data-look="live"] #trade-ticket-body .entry-basis > button[aria-checked="true"] {
  background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold);
}
/* ===== R17 entry units: end ===== */
/* ===== R17 zaryar differences: begin ===== */
/* R17 (owner 2026-11-16, ADR-0036): «تفاوت با قیمت زریار» -- its own small table under a product's table on «قیمت‌گذاری»:
   per delivery term the two differences (fixed toman per unit), the customer prices the server previews, «ثبت».
   Live look only. */
body[data-look="live"] .zrv-part { display: grid; gap: 0.3rem; margin-top: 0.5rem; }
body[data-look="live"] .zrv-part .zrv-head { display: flex; align-items: center; gap: 0.4rem; }
body[data-look="live"] .zrv-part .zrv-head h4 { margin: 0; font-size: 0.95rem; }
body[data-look="live"] .zrv-part .data-table-wrap { margin: 0; }
body[data-look="live"] .zrv-part td.zrv-diff input {
  width: 9rem; min-height: 34px; text-align: center; font-weight: 600; padding-inline: 0.3rem;
}
body[data-look="live"] .zrv-part .zrv-preview { white-space: nowrap; font-size: 0.86rem; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .zrv-part td.zrv-diff input { width: 100%; font-size: max(16px, 1rem); }
}
/* ===== R17 zaryar differences: end ===== */
/* ===== R18 board price unit: begin ===== */
/* R18 (owner 2026-11-16): «واحد قیمت» -- the board's prices of weighed products typed and shown per gram or per mesghal;
   beside the step in a product's overlay, in the toolbar on the page. Live look only. */
body[data-look="live"] .board-sheet-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
body[data-look="live"] .board-unit { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
body[data-look="live"] .opboard-unitnote { margin: 0 0 0.4rem; }
body[data-look="live"] .opboard-line-price .line-price { display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1.2; }
/* ===== R18 board price unit: end ===== */
/* ===== R20 home price cards: begin ===== */
/* R20 (owner 2026-11-16): the customer's home shows a price snapshot -- one card per product, its two prices as the
   board's own buttons (per mesghal first, per gram second), «همهٔ قیمت‌ها ‹» to the whole board. Live look only. */
body[data-look="live"] #home-board.home-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 0.75rem;
}
body[data-look="live"] .home-card {
  display: grid; gap: 0.55rem; padding: 0.75rem; border: 1px solid var(--surface-2); border-radius: 12px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
body[data-look="live"] .home-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
body[data-look="live"] .home-card-name { font-size: 1rem; }
body[data-look="live"] .home-card-term { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
body[data-look="live"] .home-card-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
body[data-look="live"] .home-card-side { display: grid; gap: 0.25rem; align-content: start; }
body[data-look="live"] .home-card-word { font-size: 0.78rem; color: var(--muted); text-align: center; }
body[data-look="live"] .home-card .boardbtn { min-height: 76px; border-radius: 10px; }
body[data-look="live"] .home-card-basis { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
/* ===== R20 home price cards: end ===== */
/* ===== R23 phone tables: begin ===== */
/* R23 (owner 2026-11-17, UI-GUIDELINES.md §4): a table stays a table at every width -- its card scrolls sideways and the
   page never does. A grid or flex item does not shrink below its content by default, so the card and every box that
   holds one may shrink to the window (the card then scrolls inside). Live look only. */
body[data-look="live"] .data-table-wrap { max-width: 100%; min-width: 0; position: relative; }   /* an absolute child (a
   screen-reader word, a tooltip) is clipped by the card instead of widening the page */
body[data-look="live"] main :has(.data-table-wrap) { min-width: 0; }
/* one line per cell (ui-design): a row's name and its second words never wrap -- a long one ends in «…», the whole of it
   in the button's tooltip -- so every row of a table keeps its height */
body[data-look="live"] .data-table .row-open :is(.row-open-text, .cell-sub, .dir-name) {
  display: block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* a fixed line box per line, so a name's glyphs never make one row a few pixels taller than the next */
body[data-look="live"] .data-table .row-open :is(.row-open-text, .dir-name) { line-height: 1.4rem; }
body[data-look="live"] .data-table .row-open .cell-sub { line-height: 1.2rem; }
@media (max-width: 47.99rem) {
  /* the one exception: the pricing editor in a product's overlay keeps its per-term edit cards on a phone (R15) --
     editing happens in the row's overlay (ui-design), not in a list -- so its heading row stays hidden there */
  body[data-look="live"] table.opboard-table > thead { display: none; }
}
/* ===== R23 phone tables: end ===== */
/* ===== R26 professional minimal: begin ===== */
/* R26 (owner 2026-11-19: «make our current app really professional, both in UI and UX … I rather a pro, minimal
   design»). ONE light, neutral look for both shells, after `.claude/rules/ui-design.md` and UI-GUIDELINES.md §10:
   white cards with a hairline, a calm neutral canvas, one brand green, gold kept for the mark alone; the type scale
   20 / 14 / 14 / 12.5 / 11 px; tables of 44 px rows with one line per cell; 20 px chips in the seven tones; 36 px
   controls (44 px on a phone); the staff menu in named groups with the person card at its foot; the customer's
   board as plain figures. Live look only: every rule is under body[data-look="live"] -- BOTH shells again since R39
   (owner 2026-11-26, ADR-0060: «make the customer panel theme white … now i want it back»; R27 had excluded the
   customer shell with :where(:not([data-shell="customer"]))). Nothing here reads or sends. */

/* ---- 1. tokens: the neutral palette, the brand, the status inks (separate from the brand) ---- */
body[data-look="live"],
body[data-look="live"][data-shell="staff"],
body[data-look="live"][data-shell="entry"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --text: #111827;
  --text-2: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand-700: #1e4d3b;
  --brand-600: #25614a;
  --brand-100: #d7e8de;
  --brand-50: #edf5f0;
  --gold: #c9a24a;
  /* R40 (owner 2026-11-26, ADR-0061): the colour follows the DEALER's word -- «خرید» (the dealer buys: CUSTOMER_SELL,
     class .sell) is green, «فروش» (CUSTOMER_BUY, class .buy) is red. The class names keep the canonical direction; the
     two tokens carry the swapped colours, so every side-keyed rule follows at once. */
  --buy: #be123c;      --buy-deep: #be123c;    --buy-bg: #fff1f2;
  --sell: #047857;     --sell-deep: #047857;   --sell-bg: #ecfdf5;
  --ok: #047857;       --ok-ink: #047857;      --ok-bg: #ecfdf5;
  --danger: #be123c;   --bad-ink: #be123c;     --danger-soft: #fff1f2;   --error-ink: #be123c;
  --warn-ink: #b45309; --warn-bg: #fffbeb;     --warn-line: #fde68a;
  --info-ink: #1d4ed8; --info-bg: #eff6ff;
  --system-ink: #4338ca; --system-bg: #eef2ff;
  --special-ink: #6d28d9; --special-bg: #f5f3ff;
  --met-ink: #047857;
  --green-800: var(--brand-700); --green-950: #0f2a20; --green-900: var(--brand-700); --green-700: var(--brand-600);
  --charcoal: #ffffff; --charcoal-2: #f9fafb;
  --nav-bg: #ffffff; --nav-fg: #374151; --nav-active-bg: var(--brand-50); --nav-active-fg: var(--brand-700);
  --shadow: none; --card-shadow: none;
  --shadow-pop: 0 10px 30px rgba(17, 24, 39, 0.12), 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-overlay: 0 24px 60px rgba(17, 24, 39, 0.22);
  --wash-ink: rgba(17, 24, 39, 0.04);
  --focus: var(--brand-600);
  --radius: 12px; --radius-sm: 8px;
  --card-bg: #ffffff; --card-line: #e5e7eb; --well-bg: #f9fafb; --rule: 1px solid #e5e7eb;
  --fs-note: 11px; --fs-meta: 12px; --fs-body: 14px; --fs-sub: 14px; --fs-card: 14px; --fs-page: 20px;
  --fs-figure: 20px; --fs-hero: 24px;
  --card-pad: 20px; --card-gap: 12px; --section-gap: 20px; --grid-gap: 16px;
  --chip-h: 20px; --tap: 44px;
  --nav-w: 15.5rem;
}
@media (max-width: 47.99rem) {
  body[data-look="live"] { --card-pad: 16px; --section-gap: 16px; }
}
body[data-look="live"] { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
body[data-look="live"] .watermark-wash::after { display: none; }
body[data-look="live"] h1, body[data-look="live"] h2, body[data-look="live"] h3, body[data-look="live"] h4 { color: var(--text); }
body[data-look="live"] :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- 2. the page: the head (title 20 px, «؟» a quiet circle, the tools at the end), the canvas gutters ---- */
body[data-look="live"] main { padding: 24px 28px 96px; }
@media (max-width: 47.99rem) { body[data-look="live"] main { padding: 16px 16px 88px; } }
body[data-look="live"] .view > .page-head { align-items: center; margin: 0 0 16px; gap: 8px 16px; }
body[data-look="live"] .view > .page-head h2, body[data-look="live"] .page-head h2 {
  font-size: var(--fs-page); font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: 0;
}
body[data-look="live"] .page-head .page-help, body[data-look="live"] .page-help {
  width: 22px; height: 22px; min-height: 0; min-width: 0; padding: 0; border: 1px solid var(--line-strong);
  border-radius: 999px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600;
  line-height: 1; margin-inline-start: 4px; vertical-align: middle;
}
body[data-look="live"] .page-head .page-help:hover { background: var(--surface-2); color: var(--text); }
body[data-look="live"] .page-actions { gap: 8px; }
body[data-look="live"] .page-actions .freshness.stale { font-size: 12px; }
body[data-look="live"] .board-updated { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] #view-trade .board-head { display: none; }     /* «تابلوی قیمت» under «قیمت‌ها»: said once */
body[data-look="live"] .view > .outcome:not(:empty) { margin: 0 0 16px; }

/* ---- 3. cards: white, a hairline, 12 px corners, no shadow; the head a 14 px title ---- */
body[data-look="live"] :where(div, section, article, form):is(.block, .integ-card, .mt-off, .ob-card, .create-form):not(.overlay *, .sheet *, details *) {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none;
  padding: var(--card-pad);
}
body[data-look="live"] :is(.card-head, .block-head, .integ-head) :is(h3, h4), body[data-look="live"] .home-block-title h3 {
  font-size: var(--fs-card); font-weight: 600; line-height: 1.4;
}
body[data-look="live"] .integ-card.integ-pending { background: var(--well-bg); }
body[data-look="live"] .statgrid { gap: 12px; }
body[data-look="live"] .stat-tile {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none;
}
body[data-look="live"] .stat-tile-name { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .stat-tile-value { font-size: 20px; font-weight: 700; }
body[data-look="live"] .holding-tile { background: var(--surface); border-color: var(--line); }

/* ---- 4. controls: 36 px on a desk, 44 px on a phone; 8 px corners; one primary ---- */
body[data-look="live"] button, body[data-look="live"] .btn {
  min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 500; line-height: 1.2; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
body[data-look="live"] button:hover { background: var(--surface-2); }
body[data-look="live"] button.small { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
body[data-look="live"] button.primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
body[data-look="live"] button.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
body[data-look="live"] button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text-2); }
body[data-look="live"] button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
body[data-look="live"] button.ghost:hover { background: var(--surface-2); text-decoration: none; }
body[data-look="live"] button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
body[data-look="live"] button.danger-outline { background: transparent; border-color: var(--danger); color: var(--danger); }
body[data-look="live"] button.danger-outline:hover { background: var(--danger-soft); }
body[data-look="live"] button.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
body[data-look="live"] button.sell { background: var(--sell); border-color: var(--sell); color: #fff; }
body[data-look="live"] button.icon, body[data-look="live"] .page-actions button.icon {
  width: 36px; min-width: 36px; padding: 0; color: var(--text-muted);
}
body[data-look="live"] button[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 47.99rem) {
  body[data-look="live"] button, body[data-look="live"] .btn { min-height: 44px; font-size: 14px; }
  body[data-look="live"] button.small { min-height: 40px; }
  body[data-look="live"] button.icon, body[data-look="live"] .page-actions button.icon { width: 44px; min-width: 44px; }
}
body[data-look="live"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.4;
}
body[data-look="live"] textarea { padding: 8px 12px; }
body[data-look="live"] :is(input, select, textarea):focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
@media (min-width: 48rem) { body[data-look="live"] :is(input, select, textarea) { font-size: 14px; } }
@media (max-width: 47.99rem) {
  body[data-look="live"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { min-height: 44px; font-size: 16px; }
}
body[data-look="live"] :is(.ticket-form .fieldrow label, .cfg-field label, label.inline) { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- 5. chips: 20 px, 10.5 px medium, no border, one tone per meaning (ui-design) ---- */
body[data-look="live"] .chip {
  height: var(--chip-h); padding: 0 8px; gap: 4px; border: 0; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--surface-2); color: #4b5563;
}
body[data-look="live"] .chip + .chip { margin-inline-start: 6px; }
/* R40: the chips follow the dealer's word too -- .sell («خرید از مشتری») green, .buy («فروش به مشتری») red */
body[data-look="live"] .chip.sell, body[data-look="live"] .chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
body[data-look="live"] .chip.buy, body[data-look="live"] .chip.bad { background: var(--danger-soft); color: var(--bad-ink); }
body[data-look="live"] .chip.state, body[data-look="live"] .chip.remaining-chip { background: var(--warn-bg); color: var(--warn-ink); }
body[data-look="live"] .chip.attention { background: #fbbf24; color: #111827; }
body[data-look="live"] .chip.neutral, body[data-look="live"] .chip.muted { background: var(--surface-2); color: #4b5563; opacity: 1; }
body[data-look="live"] .chip.info { background: var(--info-bg); color: var(--info-ink); }
body[data-look="live"] .chip.system { background: var(--system-bg); color: var(--system-ink); }
body[data-look="live"] .chip.special, body[data-look="live"] .chip.pcat-chip { background: var(--special-bg); color: var(--special-ink); }
body[data-look="live"] .nonbinding { display: none; }

/* ---- 6. tables: a 40 px head on grey, 44 px rows, one line per cell, 12.5 px, centred; the card scrolls ---- */
body[data-look="live"] .data-table-wrap {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto;
}
body[data-look="live"] .data-table { border: 0; border-radius: 0; background: transparent; font-size: 12.5px; line-height: 1.25rem; }
body[data-look="live"] .data-table thead th {
  height: 40px; padding: 0 12px; background: #f9fafb; color: var(--text-muted); font-size: 11.5px; font-weight: 500;
  white-space: nowrap; border-bottom: 1px solid var(--line); box-shadow: none;
}
body[data-look="live"] .data-table tbody td, body[data-look="live"] .data-table.dense tbody td {
  height: 44px; padding: 0 12px; white-space: nowrap; line-height: 1.25rem; border-bottom: 1px solid #f1f2f4;
  font-variant-numeric: tabular-nums; vertical-align: middle;
}
body[data-look="live"] .data-table tbody tr:last-child td { border-bottom: 0; }
body[data-look="live"] .data-table tfoot td { height: 40px; padding: 0 12px; background: #f9fafb; font-weight: 600; }
body[data-look="live"] .data-table tr.row-opens:hover td, body[data-look="live"] .data-table tr.row-opens:focus-within td { background: #f9fafb; }
body[data-look="live"] .data-table td.col-primary { font-weight: 600; text-align: start; }
body[data-look="live"] .data-table th.col-primary { text-align: start; }
body[data-look="live"] .data-table td.col-note { font-size: 12px; }
body[data-look="live"] .data-table td.col-id, body[data-look="live"] .data-table .idchip { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .data-table tr.row-extra td { background: var(--well-bg); height: auto; padding: 12px; white-space: normal; }
body[data-look="live"] .data-table tr.just-decided td { background: var(--warn-bg); }
/* the primary cell's open button: the kind chip, the name and its second words on ONE line (never a second line) */
body[data-look="live"] .data-table .row-open {
  min-height: 0; padding: 0; font-weight: 600; color: var(--text); justify-content: flex-start; gap: 8px; text-align: start;
}
body[data-look="live"] .data-table .row-open:hover { text-decoration: none; }
body[data-look="live"] .data-table .row-open.has-sub, body[data-look="live"] .data-table.req-table .row-open.reqrow-open {
  flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px;
}
body[data-look="live"] .data-table .row-open.has-sub .cell-sub, body[data-look="live"] .data-table .row-open .cell-sub {
  display: inline-block; line-height: 1.25rem; font-size: 11px; font-weight: 400; color: var(--text-muted);
}
body[data-look="live"] .data-table .row-open :is(.row-open-text, .dir-name, .reqcard-asset) { line-height: 1.25rem; }
body[data-look="live"] .data-table :is(.reqcard-when, .reqcard-decided, .cell-date, .cell-time) { display: inline; white-space: nowrap; }
body[data-look="live"] .data-table .reqcard-decided .cell-sub.reqcard-decider { display: inline; }
body[data-look="live"] .data-table .reqcard-decided .cell-sub.reqcard-decider::before { content: " · "; color: var(--text-faint); }
body[data-look="live"] .data-table .reqcard-quantity { white-space: nowrap; }
body[data-look="live"] .data-table .reqcard-quantity .reqcard-mesghal { display: inline; margin-inline-start: 6px; font-size: 11px; color: var(--text-muted); }
body[data-look="live"] .data-table .reqcard-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
body[data-look="live"] .data-table .reqrow-actions, body[data-look="live"] .data-table .row-actions { gap: 6px; }
body[data-look="live"] .data-table .reqrow-actions > button.small, body[data-look="live"] .data-table .row-actions > button.small {
  min-height: 30px; padding: 0 10px; font-size: 12px;
}
body[data-look="live"] .data-table .reqrow-actions > button.primary.inline-accept { background: var(--ok); border-color: var(--ok); }
body[data-look="live"] .data-table .reqrow-actions > button.danger.inline-reject { background: transparent; color: var(--danger); border-color: var(--danger); }
body[data-look="live"] .data-table .reqrow-actions > button.danger.inline-reject:hover { background: var(--danger-soft); }
@media (max-width: 47.99rem) {
  body[data-look="live"] .data-table .reqrow-actions > button.small, body[data-look="live"] .data-table .row-actions > button.small { min-height: 40px; }
}
body[data-look="live"] .data-table .empty, body[data-look="live"] .empty-state .empty { font-size: 12.5px; color: var(--text-muted); }
body[data-look="live"] #queue-list > .empty-state, body[data-look="live"] .reqlist > .empty-state {
  display: block; padding: 28px 16px; margin: 0; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
body[data-look="live"] #queue-list > .empty-state .fact-note { margin: 4px 0 0; font-size: 12px; color: var(--text-faint); }

/* ---- 7. the queue («کارتابل»): ONE card -- the toolbar (the tabs with their counts, the alert filter, the search) ---- */
body[data-look="live"] #queue-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px;
}
body[data-look="live"] #queue-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
body[data-look="live"] #queue-bar .zr-queue-filter { margin: 0; }
body[data-look="live"] #queue-toolbar #queue-byid.queue-toolbar {
  margin: 0; flex: 0 1 22rem; display: flex; align-items: center; gap: 6px; min-width: 0;
}
body[data-look="live"] #queue-byid label.inline { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
body[data-look="live"] #queue-byid input[type="search"] { flex: 1 1 auto; min-width: 0; }
body[data-look="live"] #queue-byid #btn-queue-open { min-height: 36px; }
body[data-look="live"] #queue-list { gap: 0; }
body[data-look="live"] #queue-list > .queue-decided-body { display: grid; gap: 12px; }
body[data-look="live"] #queue-list > .queue-decided-body > .queue-more, body[data-look="live"] #queue-list > .queue-more { justify-self: start; margin: 0; }
@media (max-width: 47.99rem) {
  body[data-look="live"] #queue-toolbar #queue-byid.queue-toolbar { flex: 1 1 100%; }
}

/* ---- 8. segmented filters (pill group) and page tabs (underline) ---- */
body[data-look="live"] .segmented:not(.cfg-tabs, .acct-tabs, .customers-tabs) {
  display: inline-flex; gap: 2px; padding: 2px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); overflow: visible;
}
body[data-look="live"] .segmented:not(.cfg-tabs, .acct-tabs, .customers-tabs) > button {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; flex: 0 0 auto;
}
body[data-look="live"] .segmented:not(.cfg-tabs, .acct-tabs, .customers-tabs) > button:hover { color: var(--text); background: transparent; }
body[data-look="live"] .segmented:not(.cfg-tabs, .acct-tabs, .customers-tabs) > button[aria-pressed="true"] {
  background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}
body[data-look="live"] .segmented .filter-count, body[data-look="live"] .segmented .tab-count { color: var(--text-faint); font-weight: 400; }
body[data-look="live"] #requests-filter.filterbar { display: inline-flex; margin-bottom: 12px; }
@media (max-width: 47.99rem) {
  body[data-look="live"] #requests-filter.filterbar { display: flex; width: 100%; gap: 2px; background: var(--surface-2); }
  body[data-look="live"] #requests-filter.filterbar > button { flex: 1 1 0; padding: 0 6px; }
}
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs).segmented {
  display: flex; gap: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  overflow-x: auto; margin: 0 0 16px;
}
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs).segmented > button {
  flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  margin-bottom: -1px; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 500; white-space: nowrap;
}
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs).segmented > button:hover { color: var(--text); background: transparent; }
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs).segmented > button[aria-pressed="true"] {
  color: var(--brand-700); border-bottom-color: var(--brand-700); background: transparent;
}
body[data-look="live"] :is(.cfg-tabs, .acct-tabs, .customers-tabs) .acct-count {
  font-size: 10.5px; padding: 0 6px; border: 0; border-radius: 999px; background: #fbbf24; color: #111827; line-height: 18px; min-width: 18px;
}

/* ---- 9. the staff shell: a white sidebar in named groups, the person card at its foot; no top bar on a desk ---- */
body[data-look="live"] .nav-label {
  display: none; margin: 14px 12px 4px; font-size: 11px; font-weight: 600; color: var(--text-faint); white-space: nowrap;
}
body[data-look="live"] .nav-label:first-of-type { margin-top: 4px; }
@media (min-width: 64rem) {
  body[data-look="live"][data-shell="staff"] .frame { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  body[data-look="live"][data-shell="staff"] .mainnav {
    gap: 2px; padding: 16px 12px 88px; background: var(--surface); color: var(--nav-fg);
    border-inline-end: 1px solid var(--line); box-shadow: none;
  }
  body[data-look="live"][data-shell="staff"] .mainnav .brand {
    display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; margin: 0 0 8px; border-bottom: 1px solid var(--line); color: var(--text);
  }
  body[data-look="live"][data-shell="staff"] .mainnav .brand svg { width: 26px; height: 26px; color: var(--gold); }
  body[data-look="live"][data-shell="staff"] .mainnav .brand span { font-size: 15px; font-weight: 700; white-space: nowrap; }
  body[data-look="live"][data-shell="staff"] .mainnav .brand small { display: none; }
  body[data-look="live"][data-shell="staff"] .nav-label:not([hidden]) { display: block; }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn {
    width: 100%; min-height: 36px; padding: 0 10px; gap: 10px; justify-content: flex-start; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--nav-fg); font-size: 13.5px; font-weight: 500;
  }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn svg { width: 18px; height: 18px; color: var(--text-muted); }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn:hover { background: var(--surface-2); color: var(--text); }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn[aria-current="page"] {
    background: var(--brand-50); color: var(--brand-700); box-shadow: inset 2px 0 0 0 var(--brand-700);
  }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn[aria-current="page"] svg { color: var(--brand-700); }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn[data-view="tools"] { margin-top: auto; }
  /* the person card: the top bar's own session group, fixed at the foot of the menu column */
  body[data-look="live"][data-shell="staff"] .topbar {
    position: fixed; inset-inline-start: 0; inset-block-end: 0; z-index: 46; width: var(--nav-w); margin: 0;
    padding: 12px 14px; background: var(--surface); border: 0; border-top: 1px solid var(--line); border-inline-end: 1px solid var(--line);
    flex-wrap: nowrap;
  }
  body[data-look="live"][data-shell="staff"] .topbar-titles { display: none; }
  body[data-look="live"][data-shell="staff"] .topbar-session { flex: 1 1 auto; min-width: 0; gap: 8px; justify-content: flex-start; }
  body[data-look="live"][data-shell="staff"] .topbar-session .who {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; align-items: flex-start; font-size: 13px; line-height: 1.3;
  }
  body[data-look="live"][data-shell="staff"] .topbar-session .who strong { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  body[data-look="live"][data-shell="staff"] .topbar-session .who small { display: block; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-exit { min-height: 32px; padding: 0 8px; font-size: 12px; color: var(--text-muted); }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-exit:hover { color: var(--danger); background: var(--danger-soft); }
  body[data-look="live"][data-shell="staff"] .pending-bell { min-height: 32px; min-width: 32px; padding: 0 4px; color: var(--text-muted); }
}
@media (min-width: 64rem) and (max-width: 79.99rem) {
  body[data-look="live"][data-shell="staff"] { --nav-w: 4.75rem; }
  body[data-look="live"][data-shell="staff"] .mainnav { padding: 12px 8px 128px; }
  body[data-look="live"][data-shell="staff"] .nav-label { display: none !important; }
  body[data-look="live"][data-shell="staff"] .mainnav .navbtn { width: 48px; min-width: 0; justify-content: center; padding: 0; }
  body[data-look="live"][data-shell="staff"] .topbar { padding: 10px 8px; }
  body[data-look="live"][data-shell="staff"] .topbar-session { flex-direction: column; align-items: center; gap: 6px; }
  body[data-look="live"][data-shell="staff"] .topbar-session .who { display: none; }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-exit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}
body[data-look="live"] .nav-badge {
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; font-size: 10px; font-weight: 600; background: #fbbf24; color: #111827;
}
body[data-look="live"] .navbtn[aria-current="page"] .nav-badge { background: #fbbf24; color: #111827; }
body[data-look="live"] .pending-bell .pending-count { font-size: 10.5px; font-weight: 600; min-width: 18px; line-height: 18px; padding: 0 5px; border: 0; background: var(--surface-2); color: var(--text-muted); }
body[data-look="live"] .pending-bell.has-pending .pending-count { background: #fbbf24; color: #111827; border: 0; }

/* ---- 10. the top bar on a phone and for a customer; the customer's menu as text tabs; the phone's bottom bar ---- */
body[data-look="live"] .topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; min-height: 52px; }
body[data-look="live"] .topbar h1 { font-size: 15px; font-weight: 700; }
body[data-look="live"] .topbar-brand { color: var(--gold); }
body[data-look="live"] .topbar-session .who { font-size: 13px; }
body[data-look="live"] .topbar-session .who strong { font-weight: 600; }
body[data-look="live"] #btn-exit { color: var(--text-muted); }
@media (min-width: 48rem) {






}
@media (max-width: 47.99rem) {
  body[data-look="live"] .mainnav {
    background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -1px 0 0 var(--line);
  }
  body[data-look="live"] .mainnav .navbtn {
    min-height: 50px; padding: 4px 2px; gap: 3px; border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--text-muted); font-size: 10.5px; font-weight: 500;
  }
  body[data-look="live"] .mainnav .navbtn svg { width: 22px; height: 22px; }
  body[data-look="live"] .mainnav .navbtn[aria-current="page"] { background: transparent; color: var(--brand-700); }
  body[data-look="live"] .mainnav .navbtn[aria-current="page"] svg { color: var(--brand-700); }
  body[data-look="live"] .nav-badge { inset-block-start: 2px; inset-inline-start: calc(50% + 6px); }
  body[data-look="live"] .mainnav .brand, body[data-look="live"] .nav-label { display: none !important; }
}

/* ---- 11. overlays and sheets: white, 16 px corners, a quiet backdrop; the head a 16 px title with the X ---- */
body[data-look="live"] .overlay-backdrop { background: rgba(17, 24, 39, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
body[data-look="live"] .overlay, body[data-look="live"] main > .view.overlay {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-overlay); padding: 20px 24px 24px;
}
body[data-look="live"] .overlay > :is(.page-head, .panel-head, .sheet-head) { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
body[data-look="live"] .overlay :is(.panel-title, .page-head h2, .sheet-head h3) { font-size: 16px; font-weight: 600; }
body[data-look="live"] .overlay .panel-head > button, body[data-look="live"] .overlay .sheet-head > button { color: var(--text-muted); }
body[data-look="live"] .sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-overlay); }
body[data-look="live"] .pending-inbox, body[data-look="live"] .notify-stack > *, body[data-look="live"] .toast {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); color: var(--text);
}
@media (max-width: 47.99rem) {
  body[data-look="live"] .overlay, body[data-look="live"] main > .view.overlay { padding: 16px 16px 20px; border-radius: 12px; }
}

/* ---- 12. the customer's board and home: plain figures in white cells (the number is the button) ---- */
body[data-look="live"] #trade-board.board-list, body[data-look="live"] #home-board.home-cards { gap: 0; }
body[data-look="live"] #trade-board.board-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
body[data-look="live"] #trade-board .board-row { padding: 8px 12px; border-bottom: 1px solid #f1f2f4; gap: 12px; }
body[data-look="live"] #trade-board .board-row:last-child { border-bottom: 0; }
body[data-look="live"] #trade-board .board-headrow { background: #f9fafb; font-size: 11.5px; color: var(--text-muted); padding-block: 10px !important; border-bottom: 1px solid var(--line); }
body[data-look="live"] .board-title { font-size: 13px; font-weight: 500; color: var(--text-2); }
body[data-look="live"] .board-title .board-term { font-size: 12px; color: var(--text-muted); font-weight: 400; }
body[data-look="live"] .boardbtn, body[data-look="live"] .boardbtn.buy, body[data-look="live"] .boardbtn.sell {
  min-height: 56px; padding: 6px 8px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); box-shadow: none;
}
body[data-look="live"] .boardbtn .num, body[data-look="live"] .boardbtn .price-mesghal { font-size: 15px; font-weight: 700; }
body[data-look="live"] .boardbtn.buy .num, body[data-look="live"] .boardbtn.buy .price-mesghal { color: var(--buy); }
body[data-look="live"] .boardbtn.sell .num, body[data-look="live"] .boardbtn.sell .price-mesghal { color: var(--sell); }
body[data-look="live"] .boardbtn :is(small, .price-per, .price-secondary, .nonbinding) { font-size: 11px; font-weight: 400; color: var(--text-muted); opacity: 1; }
body[data-look="live"] .boardbtn .price-secondary .num-secondary { font-size: 11px; font-weight: 500; color: var(--text-2); }
body[data-look="live"] .boardbtn.buy:hover:not([disabled]) { background: var(--buy-bg); border-color: #fecdd3; }
body[data-look="live"] .boardbtn.sell:hover:not([disabled]) { background: var(--sell-bg); border-color: #a7f3d0; }
body[data-look="live"] .boardbtn[disabled], body[data-look="live"] .boardbtn[aria-disabled="true"] { background: #f9fafb; color: var(--text-faint); opacity: 1; }
body[data-look="live"] .boardbtn[disabled] .num, body[data-look="live"] .boardbtn[aria-disabled="true"] .num,
body[data-look="live"] .boardbtn[aria-disabled="true"] .price-mesghal { color: var(--text-faint); }
body[data-look="live"] .boardbtn .board-action { font-size: 11px; font-weight: 600; color: var(--text-muted); }
body[data-look="live"] .boardbtn .board-arrow { font-size: 10px; }
body[data-look="live"] .home-card-basis, body[data-look="live"] .board-basis { font-size: 11px; color: var(--text-muted); }
body[data-look="live"] #home-board.home-cards { gap: 12px; }
body[data-look="live"] .home-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; gap: 10px; }
body[data-look="live"] .home-card-name { font-size: 14px; font-weight: 600; }
body[data-look="live"] .home-card-term { font-size: 11px; color: var(--text-muted); }
body[data-look="live"] .home-card-word { font-size: 11px; color: var(--text-muted); }
body[data-look="live"] .home-card .boardbtn { min-height: 60px; }
body[data-look="live"] .home-all-prices, body[data-look="live"] #btn-home-requests { font-size: 12.5px; color: var(--text-muted); }
body[data-look="live"] #home-title { font-size: var(--fs-page); }
body[data-look="live"] .home-market .chip { vertical-align: middle; }

/* ---- 13. key-value lists, folds, notices: quieter ---- */
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr) > .kv-name { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .kvlist:not(.data-table *) > .kv:not(tr) > .kv-value { font-size: 13.5px; }
body[data-look="live"] .sheet-fold-title { font-size: 13.5px; font-weight: 600; }
body[data-look="live"] .sheet-fold-sum { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .sheet-fold-head:hover .sheet-fold-title { text-decoration: none; }
body[data-look="live"] .fact-note, body[data-look="live"] .hint { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .outcome { border-radius: var(--radius-sm); font-size: 13px; }
body[data-look="live"] .freshness.stale { color: var(--warn-ink); font-weight: 500; }
body[data-look="live"] .read-issue { font-size: 12.5px; }
body[data-look="live"] .idchip { font-family: inherit; font-size: 12px; color: var(--text-muted); background: transparent; border: 0; padding: 0; }

/* ---- 14. the sign-in page ---- */
body[data-look="live"] .entry-hero svg { width: 40px; height: 40px; color: var(--gold); }
body[data-look="live"] .entry-hero h2 { font-size: var(--fs-page); }
body[data-look="live"] .live-login { gap: 12px; }

/* ---- 15. after the first measured pass (the screenshots of 2026-11-19) ---- */
/* the queue's columns size themselves to their one-line content (the older shares pushed the decision column out of
   the card on a desk); a long name or customer ends in «…» (its whole in the tooltip); the date and its time stay on
   one line; the countdown chip is one line; on a desk the decision buttons are the icon alone (their names are
   «پذیرش درخواست …» / «رد درخواست …»); the request number steps aside below 1440 px (the overlay says it) */
body[data-look="live"][data-shell="staff"] .data-table.queue-table th:is([data-col], .col-actions, .col-date[data-col], .col-text[data-col]) { width: auto; }
body[data-look="live"] .data-table.queue-table :is(.reqcard-asset, .reqcard-who), body[data-look="live"] .data-table .reqcard-asset {
  display: inline-block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; line-height: 1.25rem;
}
body[data-look="live"] .data-table .reqcard-who { display: inline-block; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
body[data-look="live"] .data-table.req-table .reqcard-when bdi, body[data-look="live"] .data-table.req-table .reqcard-decided bdi { display: inline; }
body[data-look="live"] .data-table.req-table .reqcard-when .cell-time, body[data-look="live"] .data-table.req-table .reqcard-decided .cell-time { font-size: 12px; margin-inline-start: 4px; }
body[data-look="live"] .data-table.req-table .reqcard-decided .reqcard-decider { margin-top: 0; font-size: 11px; }
body[data-look="live"] .chip.remaining-chip { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 3px; white-space: nowrap; }
body[data-look="live"] .chip.remaining-chip .remaining { display: inline; font-weight: 600; }
body[data-look="live"] .data-table .reqcard-quantity .reqcard-mesghal { display: none; }
@media (min-width: 48rem) {
  body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn { width: 32px; min-width: 32px; padding: 0; gap: 0; }
  body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn .icon-word {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn svg { width: 16px; height: 16px; }
}
@media (max-width: 89.99rem) { body[data-look="live"] .data-table.req-table .row-open.reqrow-open .cell-sub { display: none; } }
/* the «؟»: one 22 px quiet circle (the ring drawn behind the old 44 px button is gone) */
body[data-look="live"] .help { margin: 0 0 0 0; }
body[data-look="live"] .page-head .page-help { width: auto; height: auto; border: 0; background: transparent; margin-inline-start: 6px; }
body[data-look="live"] button.help-btn {
  width: 22px; min-width: 22px; height: 22px; min-height: 22px; padding: 0; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600;
}
body[data-look="live"] button.help-btn::before { display: none; }
body[data-look="live"] button.help-btn:hover, body[data-look="live"] button.help-btn[aria-expanded="true"] { border-color: var(--text-muted); color: var(--text); background: var(--surface-2); }
/* the person card: the name and the company on their own line, the bell and «خروج» under them */
@media (min-width: 80rem) {
  body[data-look="live"][data-shell="staff"] .topbar-session { flex-wrap: wrap; row-gap: 6px; }
  body[data-look="live"][data-shell="staff"] .topbar-session .who { flex: 1 1 100%; order: -1; }
  body[data-look="live"][data-shell="staff"] .topbar-session .who strong { max-width: none; }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-exit { width: auto; padding: 0 8px; margin-inline-start: auto; }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-exit > span { position: static; width: auto; height: auto; clip: auto; font-size: 12px; }
}
/* the old accents: everything that pressed, focused or highlighted in gold now does so in the brand green (the gold
   tokens are remapped, the mark alone keeps its gold through --mark); a word on a filled accent is white */

body[data-look="live"][data-shell="staff"] .mainnav .brand svg, body[data-look="live"] .topbar-brand, body[data-look="live"] .entry-hero svg { color: var(--mark); }
body[data-look="live"] .board-sheet .board-step .segmented button[aria-pressed="true"] { background: var(--brand-700); color: #fff; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row.sheet-term > td { background: var(--brand-50); }
body[data-look="live"] .board-sheet .opboard-row.sheet-term:not(.opboard-head) { box-shadow: inset -3px 0 0 var(--brand-700); }
body[data-look="live"] .chip.vip { background: var(--special-bg); color: var(--special-ink); }
/* the pending list opens beside the bell's column (above the person card), not at the far corner */
@media (min-width: 64rem) {
  body[data-look="live"][data-shell="staff"] .pending-inbox {
    inset-block-start: auto; inset-block-end: 5.5rem; inset-inline-start: calc(var(--nav-w) + 1rem); inset-inline-end: auto;
  }
}
/* the customer's request filters: the same pill group as every other filter of one list */
body[data-look="live"] #requests-filter.filterbar {
  display: inline-flex; gap: 2px; padding: 2px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); margin: 0 0 12px;
}
body[data-look="live"] #requests-filter.filterbar > button {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; flex: 0 0 auto;
}
body[data-look="live"] #requests-filter.filterbar > button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08); border-color: transparent; }
body[data-look="live"] #requests-filter .filter-count { color: var(--text-faint); font-weight: 400; opacity: 1; }
@media (max-width: 47.99rem) {
  body[data-look="live"] #requests-filter.filterbar { display: flex; width: 100%; }
  body[data-look="live"] #requests-filter.filterbar > button { flex: 1 1 0; padding: 0 6px; }
}
/* ---- 16. the touch rule stands everywhere (UI-GUIDELINES §4): 44 px controls; only a table row's own actions are
   32 px (ui-design: small icon buttons at the row's end); collections stay centred (§4) ---- */
body[data-look="live"] button, body[data-look="live"] .btn, body[data-look="live"] button.small { min-height: 44px; }
body[data-look="live"] button.icon, body[data-look="live"] .page-actions button.icon { width: 44px; min-width: 44px; }
body[data-look="live"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { min-height: 44px; }
body[data-look="live"] .data-table .reqrow-actions > button.small, body[data-look="live"] .data-table .row-actions > button.small { min-height: 32px; }
body[data-look="live"] .data-table td.col-primary, body[data-look="live"] .data-table th.col-primary { text-align: center; }
body[data-look="live"] .data-table .row-open { justify-content: center; }
body[data-look="live"] button.help-btn {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; isolation: isolate;
}
body[data-look="live"] button.help-btn::before {
  display: block; content: ""; position: absolute; inset: 11px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); z-index: -1;
}
body[data-look="live"] button.help-btn:hover, body[data-look="live"] button.help-btn[aria-expanded="true"] { background: transparent; }
body[data-look="live"] button.help-btn:hover::before, body[data-look="live"] button.help-btn[aria-expanded="true"]::before { border-color: var(--text-muted); background: var(--surface-2); }
body[data-look="live"] .help { margin-block: -11px; margin-inline: -6px -10px; }
body[data-look="live"] .page-head .page-help { margin-inline-start: 0; }
/* ---- 17. a narrower desk (under 1280 px: the icon rail): the queue's rows still fit their card on one line -- shorter
   name boxes, 10 px cell padding, and who decided steps into the cell's tooltip (the overlay says it) ---- */
@media (min-width: 48rem) and (max-width: 79.99rem) {
  body[data-look="live"] .data-table.queue-table :is(th, td) { padding: 0 10px; }
  body[data-look="live"] .data-table.queue-table :is(.reqcard-asset, .reqcard-who) { max-width: 8rem; }
  body[data-look="live"] .data-table.req-table .reqcard-decided .reqcard-decider { display: none; }
}
/* ---- 18. after the full regression: the row's open button is a 44 px target (the cell has no vertical padding, so
   the row stays 44 px); the phone's top bar is 8 px shorter (the pending list opens under it); a field inside a table
   keeps 6 px of padding so a fifteen-digit price still fits ---- */
body[data-look="live"] .data-table .row-open { min-height: 44px; }
@media (max-width: 47.99rem) { body[data-look="live"] .topbar { padding: 8px 16px; min-height: 48px; } }
body[data-look="live"] .data-table :is(input:not([type="checkbox"]):not([type="radio"]), select) { padding: 0 6px; }
body[data-look="live"] .boardbtn.changed:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-600); }   /* its own ring (R7) */
/* ---- 19. the row hairline is drawn inside the cell (a border under a 44 px button made the row 45 px) ---- */
body[data-look="live"] .data-table tbody td, body[data-look="live"] .data-table.dense tbody td {
  border-bottom: 0; box-shadow: inset 0 -1px 0 0 #f1f2f4;
}
body[data-look="live"] .data-table tbody tr:last-child td { box-shadow: none; }
body[data-look="live"] .data-table tr.row-opens:hover td, body[data-look="live"] .data-table tr.row-opens:focus-within td {
  background: #f9fafb; box-shadow: inset 0 -1px 0 0 #f1f2f4;
}
body[data-look="live"] .data-table tr.row-opens:last-child:hover td { box-shadow: none; }
/* ---- 20. the pricing editor's cells keep their room: 6 px cell padding and a 10 rem price track, so a fifteen-digit
   price (the R4 check) still fits its field on a desk ---- */
body[data-look="live"] table.opboard-table > thead > tr > th,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td { padding-inline: 6px; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper:not(.single) { grid-template-columns: 30px minmax(10rem, 1fr) 30px; }
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .stepper input,
body[data-look="live"] table.opboard-table > tbody > tr.opboard-row > td .gapline input { padding-inline: 0.2rem; font-size: 0.9rem; }
/* ---- 21. collapsible parts (owner 2026-11-19: «a redundant whole line with wrong direction arrow»): a chevron before
   the title -- down while closed, up while open -- on a compact header; the same mark on the browser's own folds ---- */
body[data-look="live"] .sheet-fold-head {
  grid-template-columns: 14px auto minmax(0, 1fr); column-gap: 8px; align-items: center; min-height: 36px; padding: 6px 0;
}
body[data-look="live"] .sheet-fold-head::after { display: none; }
body[data-look="live"] .sheet-fold-head::before {
  content: ""; grid-column: 1; grid-row: 1; justify-self: center; width: 7px; height: 7px; margin-top: -4px;
  border-inline-end: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg); transition: transform 0.15s;
}
body[data-look="live"] .sheet-fold[open] > .sheet-fold-heading > .sheet-fold-head::before { transform: rotate(-135deg); margin-top: 3px; }
body[data-look="live"] .sheet-fold-title { grid-column: 2; font-size: 13.5px; font-weight: 600; }
body[data-look="live"] .sheet-fold-sum { grid-column: 3; font-size: 12px; }
body[data-look="live"] .sheet-fold-head:hover .sheet-fold-title { text-decoration: none; color: var(--brand-700, var(--text)); }
@media (max-width: 47.99rem) {
  body[data-look="live"] .sheet-fold-head { grid-template-columns: 14px minmax(0, 1fr); }
  body[data-look="live"] .sheet-fold-sum { grid-column: 2; grid-row: 2; }
}
body[data-look="live"] .fold > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; }
body[data-look="live"] .fold > summary::after { display: none; }
body[data-look="live"] .fold > summary::before {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-top: -4px; border-inline-end: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted); transform: rotate(45deg); transition: transform 0.15s;
}
body[data-look="live"] .fold[open] > summary::before { transform: rotate(-135deg); margin-top: 3px; }
@media (prefers-reduced-motion: reduce) {
  body[data-look="live"] .sheet-fold-head::before, body[data-look="live"] .fold > summary::before { transition: none; }
}
/* ---- 22. the product's sheet as a structured form (owner 2026-11-19): sections shown whole, a plain title with its
   summary, a hairline between sections, no chevron, no pointer; a term's own fields under its table ---- */
body[data-look="live"] .sheet-fold.cfg-part-static > .sheet-fold-heading > .sheet-fold-head {
  grid-template-columns: auto minmax(0, 1fr); cursor: default; min-height: 40px; padding: 10px 0 4px;
}
body[data-look="live"] .sheet-fold.cfg-part-static > .sheet-fold-heading > .sheet-fold-head::before { display: none; }
body[data-look="live"] .sheet-fold.cfg-part-static .sheet-fold-title { grid-column: 1; font-size: 14px; font-weight: 600; }
body[data-look="live"] .sheet-fold.cfg-part-static .sheet-fold-sum { grid-column: 2; }
body[data-look="live"] .sheet-fold.cfg-part-static > .sheet-fold-heading > .sheet-fold-head:hover .sheet-fold-title { color: var(--text); }
body[data-look="live"] .sheet-fold.cfg-part-static > .sheet-fold-body:not([hidden]) { padding: 4px 0 20px; }
body[data-look="live"] .cfg-term-edit { display: grid; gap: 8px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--well-bg); }
body[data-look="live"] .cfg-term-edit-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-muted); }
body[data-look="live"] .cfg-term { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
body[data-look="live"] .cfg-term-rule { margin: 0; font-size: 12px; color: var(--text-muted); }
/* ---- 24. the queue as ONE list (R28, owner 2026-11-19): the counts as two quiet chips; a row that arrived since the
   operator looked is tinted, says «تازه» and pulses three times as it comes (no motion for a reader who asks for
   none); the two decision buttons stand level, their icon and word centred ---- */
body[data-look="live"] #queue-counts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
body[data-look="live"] .chip.queue-count { height: 24px; padding: 0 10px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-muted); }
body[data-look="live"] .chip.queue-count-waiting:not([data-count="0"]) { background: var(--warn-bg); color: var(--warn-ink); }
body[data-look="live"] .chip.fresh-chip { background: var(--warn-bg); color: var(--warn-ink); margin-inline-end: 6px; }
body[data-look="live"] .data-table.queue-table tr.row-new td { background: var(--warn-bg); }
body[data-look="live"] .data-table.queue-table tr.row-new.row-opens:hover td { background: var(--warn-bg); filter: brightness(0.97); }
body[data-look="live"] .data-table.queue-table tr.row-arrived td { animation: queue-arrive 0.8s ease-in-out 3; }
@keyframes queue-arrive { 0%, 100% { background: var(--warn-bg); } 50% { background: var(--warn-line); } }
@media (prefers-reduced-motion: reduce) {
  body[data-look="live"] .data-table.queue-table tr.row-arrived td { animation: none; }
}
body[data-look="live"] .data-table.queue-table .reqcard-decided-short { white-space: nowrap; }
body[data-look="live"] .data-table.queue-table .reqcard-decided-short .reqcard-decider {
  display: inline-block; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; margin: 0 6px 0 0; font-size: 11px;
}
@media (max-width: 90rem) {
  body[data-look="live"] .data-table.queue-table .reqcard-decided-short .reqcard-decider { display: none; }
}
/* the product with its term reads whole on a wide desk; a 1280-1440 px desk gives the name 13 rem, the customer 8 rem
   and keeps the request number in the tooltip, so the one list still needs no sideways scroll */
@media (min-width: 90.01rem) {
  body[data-look="live"] .data-table.queue-table .reqcard-asset { max-width: 18rem; }
}
@media (min-width: 85rem) and (max-width: 90rem) {
  body[data-look="live"] .data-table.queue-table .reqcard-asset { max-width: 13rem; }
}
@media (min-width: 80rem) and (max-width: 84.99rem) {
  /* a 1280-1359 px desk: the one list's widest decided row fits with the 10 px cell padding of the narrower desk */
  body[data-look="live"] .data-table.queue-table :is(th, td) { padding: 0 10px; }
}
@media (min-width: 80rem) and (max-width: 90rem) {
  body[data-look="live"] .data-table.queue-table .reqcard-who { max-width: 8rem; }
  body[data-look="live"] .data-table.queue-table .row-open.reqrow-open .cell-sub { display: none; }
}
body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn { align-items: center; }
body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn > svg { display: block; }
body[data-look="live"] .data-table .reqrow-actions > button.small.icon-btn .icon-word { line-height: 1; }
/* ---- 25. «نوع معامله» (R29): the staff tables' side as one short chip in its own column ---- */
body[data-look="live"] .data-table .chip.side-short { min-width: 3.25rem; justify-content: center; }
/* ---- 26. the Zaryar trading card's readiness line (R30): what a mode needs, before any press ---- */
body[data-look="live"] .zr-ready { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-muted); }
body[data-look="live"] .zr-ready strong { color: var(--text); font-weight: 600; }
body[data-look="live"] .zr-ready.zr-ready-none .zr-ready-word { color: var(--warn-ink); font-weight: 600; }
/* ---- 27. «قیمت‌گذاری» (R32, owner 2026-11-21): every row of the board and of a product's sheet keeps ONE line -- the
   reasons live in tooltips, «خودکار» and the unit are chips; the Zaryar cell and the side switches never wrap ---- */
body[data-look="live"] #board-lines :is(.line-state, .line-aud) { flex-wrap: nowrap; white-space: nowrap; }
body[data-look="live"] #board-lines .chip.line-auto { background: #eef2ff; color: #4338ca; }
body[data-look="live"] #board-lines .chip.line-unit { background: var(--surface-2); color: var(--text-muted); }
body[data-look="live"] table.opboard-table .zr-row { flex-wrap: nowrap; margin-top: 0; gap: 6px; white-space: nowrap; }
body[data-look="live"] table.opboard-table .zr-row .chip { white-space: nowrap; }
body[data-look="live"] table.opboard-table :is(.zr-row, .opboard-sides) .switch-text { white-space: nowrap; }
/* ---- 28. the SMS card (R33, ADR-0053): the five event switches on one wrapping line, the last sends compact ---- */
body[data-look="live"] .sms-card .sms-events { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
body[data-look="live"] .sms-card .sms-events .switch-text { white-space: nowrap; }
body[data-look="live"] .sms-card #sms-last { margin-top: 10px; }
/* ---- 29. the sign-in's second step (R34): the code form keeps the login form's rhythm; its two small actions on one line ---- */
.live-code-form .live-code-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 8px; }
/* ---- 30. the pair sheet's auto-trading values (R37, ADR-0057): the count rules in a two-column grid, the three kinds per
   side as one compact table with an input per cell, the actions on one line ---- */
body[data-look="live"] .zrl-trading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
@media (max-width: 640px) {
  body[data-look="live"] .zrl-trading-grid { grid-template-columns: minmax(0, 1fr); }
}
body[data-look="live"] .zrl-trading-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 10px; font-size: 12.5px; color: var(--text-muted); }
body[data-look="live"] #zrl-trading-sides input { width: 100%; min-width: 6.5rem; height: 36px; text-align: center; font-variant-numeric: tabular-nums; }
body[data-look="live"] #zrl-trading-sides td { padding: 4px 8px; }
body[data-look="live"] .zrl-trading-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
/* ---- 31. the product sheet's parts under tabs (R38, ADR-0058): the tab row first in the body, one part shown; a dot on a
   tab whose part holds an unsaved change; the trading part's group titles ---- */
body[data-look="live"] .cfg-asset-sheet-body > .sheet-tabs { margin: 0 0 12px; }
body[data-look="live"] .cfg-asset-sheet-body > .sheet-tabs > button { display: inline-flex; align-items: center; gap: 6px; }
body[data-look="live"] .sheet-tabs .tab-flag { color: var(--warn-ink); font-weight: 700; line-height: 1; }
body[data-look="live"] .zrl-trading .zrl-trading-group { margin-top: 12px; }
/* ---- 23. the Zaryar trading card's rejection rule (R27) ---- */
body[data-look="live"] .zr-reject-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
body[data-look="live"] .zr-reject-label { font-size: 13px; color: var(--text-2); }
/* ---- 32. the product sheet keeps ONE height (R39, ADR-0060; owner: changing the tabs «cause resizing the overlayed page»): 92 % of the
   screen tall below 48rem, 88 % from it; the head, the note, the outcome and the tab row stay, the part scrolls inside ---- */
body[data-look="live"] .cfg-asset-sheet.overlay { height: 92vh; height: 92dvh; max-height: none; display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 48rem) { body[data-look="live"] .cfg-asset-sheet.overlay { height: 88vh; height: 88dvh; } }
body[data-look="live"] .cfg-asset-sheet.overlay > :is(.sheet-head, .cfg-asset-sheet-note, .outcome) { flex: 0 0 auto; }
body[data-look="live"] .cfg-asset-sheet.overlay > .cfg-asset-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body[data-look="live"] .cfg-asset-sheet-body > #cfg-sheet-tabs { position: sticky; top: 0; z-index: 2; background: var(--card-bg); }

/* ---- 33. the customer's balances in brief above the board (R39, ADR-0060): one row of small tiles; «حساب من ›» at its end ---- */
body[data-look="live"] #trade-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 var(--section-gap); }
body[data-look="live"] #trade-stats:empty { display: none; }
body[data-look="live"] #trade-stats > .stat-tile { flex: 0 1 auto; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; margin: 0; padding: 8px 12px; background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--radius-sm); }
body[data-look="live"] #trade-stats > .stat-tile .stat-tile-name { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] #trade-stats > .stat-tile .stat-tile-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
body[data-look="live"] #trade-stats > .trade-stats-way { margin-inline-start: auto; }

/* ---- 34. the request form's two lines (R39, ADR-0060): the amount in the product's unit and the amount in toman, each filling the other ---- */
body[data-look="live"] .entry-lines { display: grid; gap: 10px; }
body[data-look="live"] .entry-lines .entry-link { display: block; font-size: 11px; color: var(--text-muted); }

/* ---- 35. the customer's profile (R39, ADR-0060): the facts as a list, the address form, the change request and its state ---- */
body[data-look="live"] .profile-form { display: grid; gap: 10px; }
@media (min-width: 48rem) {
  body[data-look="live"] .profile-form.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body[data-look="live"] .profile-form.two > .profile-field.wide, body[data-look="live"] .profile-form.two > .create-actions,
  body[data-look="live"] .profile-form.two > .outcome { grid-column: 1 / -1; }
}
body[data-look="live"] .profile-field { display: grid; gap: 4px; min-width: 0; }
body[data-look="live"] .profile-field > label { font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .profile-field > :is(input, textarea) { width: 100%; box-sizing: border-box; }
body[data-look="live"] .profile-change-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
body[data-look="live"] .profile-change-note { margin: 0; font-size: 12px; color: var(--text-muted); }
body[data-look="live"] .ob-change-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
body[data-look="live"] .ob-change-head > h4 { margin: 0; }
body[data-look="live"] .ob-change-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
body[data-look="live"] .ob-state-pair { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
/* ---- 36. the product sheet's two tabs and a delivery term's own overlay (R40, ADR-0061): «مشخصات» holds «وضعیت» and «حذف
   کالا» as inner sections, «زمان‌های تحویل» its rows and «افزودن زمان تحویل»; a row opens its term ABOVE the sheet, one
   height like the sheet, its body scrolling; the backdrop, Escape and its X close it alone ---- */
body[data-look="live"] .sheet-fold-body .sheet-fold.cfg-inner { margin-inline-start: 0; border-top: var(--rule); padding-top: 12px; }
/* a term's ROW keeps the class of R13's term section (the tests count it) but none of the section's layout */
body[data-look="live"] tr.cfg-term.cfg-term-row { display: table-row; gap: 0; margin: 0; padding: 0; border-top: 0; }
body[data-look="live"] .cfg-inner > .sheet-fold-heading > .sheet-fold-head { padding-top: 0; }
body[data-look="live"] .cfg-terms-table .cfg-term-name { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; }
body[data-look="live"] .cfg-terms-table .cfg-term-sides { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
body[data-look="live"] .cfg-terms-table .cfg-term-side { display: inline-flex; align-items: center; gap: 4px; }
body[data-look="live"] .overlay.row-details.cfg-term-panel {
  width: min(60rem, calc(100vw - 1.5rem)); height: 92vh; height: 92dvh; max-height: none;
  display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 48rem) { body[data-look="live"] .overlay.row-details.cfg-term-panel { height: 88vh; height: 88dvh; } }
body[data-look="live"] .cfg-term-panel > .panel-head { flex: 0 0 auto; }
body[data-look="live"] .cfg-term-panel > .panel-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 12px; align-content: start;
}
body[data-look="live"] .cfg-term-panel .cfg-term-title { display: inline-flex; align-items: baseline; gap: 8px; }
body[data-look="live"] .cfg-term-panel .cfg-term-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
body[data-look="live"] .cfg-term-panel .cfg-term-rule { margin: 0; }
body[data-look="live"] .cfg-term-panel .cfg-term-edit,
body[data-look="live"] .cfg-term-panel .cfg-term-remove-zone { border-top: var(--rule); padding-top: 12px; }
body[data-look="live"] .cfg-term-panel .cfg-term-edit-title { margin: 0 0 8px; font-size: var(--fs-sub); font-weight: 600; }

/* ---- 37. the market's working hours (R40, ADR-0061): the card in Settings › «بازار و مهلت»; the hours chip on «قیمت‌گذاری» ---- */
body[data-look="live"] .cfg-hours > .switch { margin: 0 0 12px; }
body[data-look="live"] .cfg-hours-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body[data-look="live"] .cfg-hours-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
body[data-look="live"] .cfg-hours-stale { margin: 8px 0 0; color: var(--warn-ink); font-size: var(--fs-note); }
body[data-look="live"] .hours-span { font-variant-numeric: tabular-nums; }
@media (max-width: 47.99rem) {
  body[data-look="live"] .cfg-hours-grid { grid-template-columns: minmax(0, 1fr); }
  /* the term rows' «حذف» icon and the term overlay's buttons keep the 44 px tap (every row grows alike) */
  body[data-look="live"] .data-table.cfg-terms-table .row-actions > button.small.cfg-term-remove,
  body[data-look="live"] .cfg-term-panel .cfg-term-remove-zone > button { min-height: var(--tap); min-width: var(--tap); }
}

/* ---- 38. «قیمت‌های ویژه» inside the product's overlay (R40, ADR-0061): under the opened term's table ---- */
body[data-look="live"] .pcat-sheet { border-top: var(--rule); padding-top: 12px; margin-top: 12px; display: grid; gap: 8px; }
body[data-look="live"] .pcat-sheet > .block-head { margin: 0; }
body[data-look="live"] .pcat-sheet > .block-head h4 { margin: 0; font-size: var(--fs-sub); }
body[data-look="live"] .pcat-sheet .pcat-lead { margin: 0; }
body[data-look="live"] .pcat-sheet .pcat-details { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* R41 (ADR-0062): the two side cards side by side, each half the width; the step, «ثبت» and the answer span both */
body[data-look="live"] .pcat-sheet .pcat-details > :not(.pcat-side) { grid-column: 1 / -1; }
body[data-look="live"] .pcat-sheet .pcat-details > .pcat-side { margin: 0; }
@media (max-width: 47.99rem) { body[data-look="live"] .pcat-sheet .pcat-details { grid-template-columns: minmax(0, 1fr); } }

/* ---- 39. the customer's own seat (R41, ADR-0062, owner 2026-11-26): «خرید» (the customer buys, CUSTOMER_BUY) green and first on
   the right, «فروش» red; the board's buttons FILLED with the side's colour (the whole button, white figures); the ticket's button
   and the chips alike. The staff shell keeps R40's dealer-word colouring; the staff's preview of the customer board follows the
   customer. A closed board greys the buttons. ---- */
body[data-look="live"][data-shell="customer"], body[data-look="live"] .board-table.preview {
  --buy: #047857; --buy-deep: #065f46; --buy-bg: #ecfdf5; --sell: #be123c; --sell-deep: #9f1239; --sell-bg: #fff1f2;
}
body[data-look="live"][data-shell="customer"] .chip.buy { background: var(--ok-bg); color: var(--ok-ink); }
body[data-look="live"][data-shell="customer"] .chip.sell { background: var(--danger-soft); color: var(--bad-ink); }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn.sell { background: var(--sell); border-color: var(--sell); color: #fff; }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn:is(.buy, .sell) :is(.num, .price-mesghal) { color: #fff; }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn:is(.buy, .sell)
  :is(small, .price-per, .price-secondary, .nonbinding, .num-secondary, .board-action) { color: rgba(255, 255, 255, 0.88); }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn.buy:hover:not([disabled]) { background: var(--buy-deep); border-color: var(--buy-deep); }
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn.sell:hover:not([disabled]) { background: var(--sell-deep); border-color: var(--sell-deep); }
body[data-look="live"] :is(#trade-board, .board-table.preview).board-closed .boardbtn:is(.buy, .sell),
body[data-look="live"] :is(#trade-board, .board-table.preview) .boardbtn:is(.buy, .sell)[disabled] {
  background: #e5e7eb; border-color: var(--line); color: var(--text-muted); filter: none; opacity: 1;
}
body[data-look="live"] :is(#trade-board, .board-table.preview).board-closed .boardbtn:is(.buy, .sell)
  :is(.num, .price-mesghal, small, .price-per, .price-secondary, .nonbinding, .num-secondary, .board-action) { color: var(--text-muted); }
body[data-look="live"] .integ-products-way { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; }

/* ---- 40. the board as product cards (R42 + R43 + R44, ADR-0063/0064/0065, owner 2026-11-27): the product's name (the
   currency after it) and what its prices are per ONCE in the card's head; under it a row per term -- the customer's «خرید»
   (narrow) on the right, the term's name in the middle, «فروش» (narrow) on the left, at EVERY width; «هر مثقال» is not on
   the buttons; a side without a price keeps its colour and shows dashes. ---- */
body[data-look="live"] :is(#trade-board, .board-table) { --board-cols: minmax(7.5rem, 13.5rem) minmax(7rem, 1fr) minmax(7.5rem, 13.5rem); }
body[data-look="live"] :is(#trade-board, .board-table) .board-headrow { grid-template-columns: var(--board-cols); }
body[data-look="live"] :is(#trade-board, .board-table) .board-asset { display: block; padding: 0; border-bottom: 1px solid var(--line); }   /* not the old flex row */
body[data-look="live"] :is(#trade-board, .board-table) .board-asset:last-child,
body[data-look="live"] :is(#trade-board, .board-table) .board-asset:has(+ .board-basis) { border-bottom: 0; }
body[data-look="live"] :is(#trade-board, .board-table) .board-assethead {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px;
  padding: 8px 12px; background: #f9fafb; border-bottom: 1px solid #f1f2f4; text-align: center;
}
body[data-look="live"] :is(#trade-board, .board-table) .board-assethead .board-assetname { font-size: 14px; font-weight: 700; color: var(--text); }
body[data-look="live"] :is(#trade-board, .board-table) .board-assethead .board-assetcurrency { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
body[data-look="live"] :is(#trade-board, .board-table) .board-assethead .board-assetper { font-size: 11.5px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row { grid-template-columns: var(--board-cols); }
body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row:last-child { border-bottom: 0; }
body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row > .board-title { min-width: 0; padding: 0 8px; }
body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row > .board-title .board-term {
  font-size: 13.5px; font-weight: 600; color: var(--text); white-space: normal; overflow-wrap: anywhere; text-wrap: balance;
}
/* a side without a price: the side's colour stays and the figures are dashes; a closed board greys it with the rest */
body[data-look="live"] :is(#trade-board, .board-table.preview):not(.board-closed) .boardbtn.empty.buy[disabled] {
  background: var(--buy); border-color: var(--buy); color: #fff; cursor: not-allowed;
}
body[data-look="live"] :is(#trade-board, .board-table.preview):not(.board-closed) .boardbtn.empty.sell[disabled] {
  background: var(--sell); border-color: var(--sell); color: #fff; cursor: not-allowed;
}
body[data-look="live"] :is(#trade-board, .board-table.preview):not(.board-closed) .boardbtn.empty:is(.buy, .sell)[disabled] .num { color: #fff; }
body[data-look="live"] :is(#trade-board, .board-table.preview):not(.board-closed) .boardbtn.empty:is(.buy, .sell)[disabled]
  :is(small, .price-secondary, .num-secondary) { color: rgba(255, 255, 255, 0.88); }
@media (max-width: 30rem) {
  /* the phone (R44, ADR-0065, owner 2026-11-27): the SAME three columns -- the term's name BETWEEN the two buttons of its
     row, never above them; the head above its rows. A button keeps whole digits (7.3 rem at least, 4 px inside), the
     middle takes the rest and its words wrap; the heading row shares the columns. */
  body[data-look="live"] :is(#trade-board, .board-table) { --board-cols-phone: minmax(7.3rem, 1fr) minmax(2rem, 0.55fr) minmax(7.3rem, 1fr); }
  body[data-look="live"] :is(#trade-board, .board-table) .board-headrow { grid-template-columns: var(--board-cols-phone); gap: 4px; padding: 6px 8px !important; }
  body[data-look="live"] :is(#trade-board, .board-table) .board-headrow > .board-col:nth-child(2) { display: block; }
  body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row {
    grid-template-columns: var(--board-cols-phone); grid-template-areas: none; gap: 4px; padding: 6px 8px;
  }
  body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row > .board-title { grid-area: auto; padding: 0 2px; }
  body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row > .board-title .board-term { font-size: 12px; }
  body[data-look="live"] :is(#trade-board, .board-table) .board-asset > .board-row > .boardbtn { grid-area: auto; padding-inline: 4px; }
}

/* ---- 41. R46 (ADR-0067, owner 2026-11-28): the owner's brand, the staff's sound button, the old balance's chip ---- */
body[data-look="live"].branded .entry-hero > svg, body[data-look="live"].branded .topbar-brand > svg,
body[data-look="live"].branded #mainnav .brand > svg { display: none; }
body[data-look="live"] .brand-logo { width: 168px; height: 108px; margin: 0 auto 8px; background: var(--brand-logo) center / contain no-repeat; }
body[data-look="live"] .brand-mark { display: inline-block; width: 28px; height: 28px; vertical-align: middle; background: var(--brand-mark) center / contain no-repeat; }
body[data-look="live"] #mainnav .brand .brand-mark { width: 32px; height: 32px; }
body[data-look="live"] #btn-sound { min-width: var(--tap); min-height: var(--tap); padding: 0 8px; color: var(--text-2); }
body[data-look="live"] #btn-sound[aria-pressed="false"] { color: var(--text-muted); }
body[data-look="live"] #btn-sound svg { width: 20px; height: 20px; }
/* the staff's person card is FIXED at the foot of the menu column: its controls stay 32 px (like the bell and «خروج»),
   so the card keeps its height, and the menu's bottom padding clears the card at both widths (the last button, «درباره»,
   sits against it) */
@media (min-width: 64rem) {
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-sound { min-height: 32px; min-width: 32px; padding: 0 4px; color: var(--text-muted); }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-sound svg { width: 18px; height: 18px; }
  body[data-look="live"][data-shell="staff"] .topbar-session #btn-sound[aria-pressed="true"] { color: var(--text-2); }
}
@media (min-width: 80rem) {
  body[data-look="live"][data-shell="staff"] .mainnav { padding-bottom: 116px; }
}
@media (min-width: 64rem) and (max-width: 79.99rem) {
  body[data-look="live"][data-shell="staff"] .mainnav { padding-bottom: 156px; }
}
body[data-look="live"] .own-balance-stale-chip, body[data-look="live"] .bal-stale-chip { background: #f3f4f6; color: #4b5563; margin-inline-start: 8px; }
body[data-look="live"] .own-balance-stale { color: var(--warn-ink); }

/* ===== R26 professional minimal: end ===== */

/* ---- 42. R47 (owner 2026-11-29, ADR-0068): the customer groups -- the sheet's block per group, the settings card ---- */
.chip.group { background: var(--surface-2); border-color: var(--line); color: var(--text); white-space: nowrap; }
.pcat-group { border-top: 1px solid var(--line); padding-top: 0.6rem; margin-top: 0.6rem; }
.pcat-group:first-of-type { border-top: 0; margin-top: 0; }
.pcat-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.pcat-group-head .pcat-visible { margin-inline-start: auto; }
.pcat-basis { font-weight: 500; }
.cfg-groups .block-head { display: flex; align-items: center; gap: 0.5rem; }
.cfg-groups-table td, .cfg-groups-table th { white-space: nowrap; }
.cfg-groups-foot { display: flex; justify-content: flex-start; margin-top: 0.6rem; }
.cfg-group-editor { display: grid; gap: 0.6rem; padding: 0.5rem 0; }
.cfg-group-grid { grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr); }
.cfg-group-hours { display: grid; gap: 0.5rem; }
tr.tbl-detail.cfg-group-detail > td { height: auto; padding: 0.5rem 0.75rem; white-space: normal; text-align: start; background: var(--surface-2); }
@media (max-width: 47.99rem) {
  .cfg-group-grid { grid-template-columns: 1fr; }
}
