/* /demo/: the app as the product screenshots show it, in the Seyaqi look. The
   colours are the app's own brand tokens (app/src/shared/theme/seyaqi.css, from
   brand/colour/tokens.json) and its surfaces (seyaqi-surfaces.css: the green
   table band, the linen stripe, the saffron row edge and page-header line); the
   faces are the site's (IBM Plex Sans and Plex Sans Arabic, Alexandria for
   headings, Plex Mono for codes). Light and dark follow the site: the
   reader's system, or data-theme on <html> once they choose. */

:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --fg: #15201a;
  --card: #ffffff;
  --muted: #e9eee6;
  --muted-fg: #59665e;
  --body-fg: #3c4941;
  --primary: #1c5a42;
  --on-primary: #ffffff;
  --border: #d6ddd3;
  --field: #717c74;
  --ring: #1c5a42;
  --brand: #8a5b00;
  --point: #e8a922;
  --ok: #1c5a42;
  --ok-soft: #daf2e6;
  --warn: #8a5b00;
  --warn-soft: #feedd7;
  --bad: #b0352a;
  --bad-soft: #feebe8;
  --info: #3f6f86;
  --info-soft: #e2eef3;
  --stripe: color-mix(in oklab, var(--muted) 60%, var(--card));
  --band: #123d2d;
  --band-ink: #efe9e1;
  --band-muted: #c2e0d1;
  --cta: #e8a922;
  --cta-ink: #14110e;
  --toast: #15201a;
  --toast-ink: #f4f6f1;
  --backdrop: rgba(21, 32, 26, 0.45);
  --shadow: 0 1px 2px rgba(21, 32, 26, 0.05), 0 10px 30px rgba(21, 32, 26, 0.1);
  --logo-ink: #15201a;
  --logo-mark: #1c5a42;
  --font:
    'IBM Plex Sans',
    'IBM Plex Sans Arabic',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  --font-h: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --rail: 15rem;
  --tap: 2rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #14110e;
    --fg: #efe9e1;
    --card: #241f1a;
    --muted: #2f2922;
    --muted-fg: #a79b8c;
    --body-fg: #d0c7bc;
    --primary: #73c79e;
    --on-primary: #0f1a14;
    --border: #3a3229;
    --field: #877c6f;
    --ring: #73c79e;
    --brand: #f2b946;
    --ok: #73c79e;
    --ok-soft: #112d21;
    --warn: #f2b946;
    --warn-soft: #32230f;
    --bad: #e77262;
    --bad-soft: #381f1b;
    --info: #7fb2cc;
    --info-soft: #0f2a36;
    --stripe: color-mix(in oklab, var(--muted) 80%, var(--card));
    --band: #0e2a1f;
    --toast: #efe9e1;
    --toast-ink: #14110e;
    --backdrop: rgba(0, 0, 0, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.45);
    --logo-ink: #efe9e1;
    --logo-mark: #efe9e1;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14110e;
  --fg: #efe9e1;
  --card: #241f1a;
  --muted: #2f2922;
  --muted-fg: #a79b8c;
  --body-fg: #d0c7bc;
  --primary: #73c79e;
  --on-primary: #0f1a14;
  --border: #3a3229;
  --field: #877c6f;
  --ring: #73c79e;
  --brand: #f2b946;
  --ok: #73c79e;
  --ok-soft: #112d21;
  --warn: #f2b946;
  --warn-soft: #32230f;
  --bad: #e77262;
  --bad-soft: #381f1b;
  --info: #7fb2cc;
  --info-soft: #0f2a36;
  --stripe: color-mix(in oklab, var(--muted) 80%, var(--card));
  --band: #0e2a1f;
  --toast: #efe9e1;
  --toast-ink: #14110e;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.45);
  --logo-ink: #efe9e1;
  --logo-mark: #efe9e1;
}
/* A finger needs a bigger target than a pointer (44 px). */
@media (pointer: coarse) {
  :root {
    --tap: 2.75rem;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang='ar'] body {
  line-height: 1.7;
}
h1,
h2,
h3,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ic {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic .pt,
.ic .d {
  fill: currentColor;
  stroke: none;
}
[dir='rtl'] .flip {
  transform: scaleX(-1);
}
.muted {
  color: var(--muted-fg);
}
.small {
  font-size: 12px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.93em;
}
.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}
.strong,
.strong th,
.strong td {
  font-weight: 700;
}
.skip {
  position: fixed;
  inset-inline-start: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ── The logo ─────────────────────────────────────────────────────────────── */
.wm-i {
  fill: var(--logo-ink);
}
.wm-a,
.wm-md {
  fill: var(--point);
}
.wm-m {
  stroke: var(--logo-mark);
}
.wm-v {
  stroke: var(--border);
}
.lg {
  display: block;
  height: 26px;
  width: auto;
}
html[lang='ar'] .lg-en,
html:not([lang='ar']) .lg-ar {
  display: none;
}
.lg-mark {
  display: block;
  width: 26px;
  height: 26px;
}

/* ── The demo banner: the one thing that isn't the app ───────────────────── */
.demo-bar {
  position: relative;
  z-index: 30;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 6px 16px;
  background: var(--band);
  color: var(--band-ink);
  font-size: 13px;
}
.db-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 500;
}
.db-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--point);
  box-shadow: 0 0 0 3px rgba(232, 169, 34, 0.25);
}
.db-short {
  display: none;
}
.db-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.db-btn,
.db-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: max(28px, var(--tap));
  padding: 0 10px;
  border: 1px solid rgba(239, 233, 225, 0.35);
  border-radius: 8px;
  background: transparent;
  color: var(--band-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.db-btn:hover {
  background: rgba(239, 233, 225, 0.1);
}
/* Inline, not flex, so the underline runs on under "Back to seyaqi.com". */
.db-link {
  display: inline-block;
  border-color: transparent;
  line-height: calc(max(28px, var(--tap)) - 2px);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.db-cta {
  border-color: var(--cta);
  background: var(--cta);
  color: var(--cta-ink);
  font-weight: 600;
}
.db-cta:hover {
  background: #fdc96e;
}
.demo-bar :focus-visible {
  outline-color: var(--band-ink);
}
.toasts {
  position: fixed;
  z-index: 60;
  inset-inline: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 34rem;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--toast);
  color: var(--toast-ink);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  pointer-events: auto;
}
.toast .btn {
  color: var(--toast-ink);
  text-decoration: underline;
}

/* ── The shell ────────────────────────────────────────────────────────────── */
.app {
  flex: 1;
  min-height: 0;
  display: flex;
}
.col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  outline: none;
}
.nojs {
  display: grid;
  gap: 16px;
  justify-items: start;
  max-width: 36rem;
  margin: 48px auto;
  padding: 24px;
}

/* The rail */
.rail {
  flex: none;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--border);
  background: var(--card);
  transition: width 0.2s ease;
}
.r-logo {
  display: flex;
  align-items: center;
  padding: 12px 10px 4px;
}
.r-mark {
  display: none;
}
.r-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.r-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: max(28px, var(--tap));
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted-fg);
  font-size: 12.5px;
  text-align: start;
}
.r-search:hover {
  background: var(--muted);
}
.r-search .ic {
  width: 14px;
  height: 14px;
}
.r-search kbd {
  margin-inline-start: auto;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 11px var(--font);
}
.r-scroll {
  flex: 1;
  overflow-y: auto;
}
.rail-nav > ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}
.r-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: max(44px, var(--tap));
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted-fg);
  font-size: 14.5px;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
}
.r-row:hover {
  background: var(--muted);
  color: var(--fg);
}
.r-row.is-on,
.r-row[aria-expanded='true'] {
  background: var(--muted);
  color: var(--fg);
}
.r-row.has-on {
  color: var(--fg);
}
.r-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  background: var(--muted);
  color: var(--fg);
}
.r-row.is-on .r-tile,
.r-row[aria-expanded='true'] .r-tile {
  background: var(--card);
}
.r-row.is-on .pt,
.r-kid.is-on .pt {
  fill: var(--point);
}
.r-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r-chev {
  color: var(--muted-fg);
  transition: transform 0.15s ease;
}
.r-row[aria-expanded='true'] .r-chev {
  transform: rotate(90deg);
}
/* The brand's saffron point on what the demo draws (demo.js livePoint). */
.r-live {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--point);
}
/* Close to its label, so the longest name keeps its room. */
.r-row .r-live {
  margin-inline-start: -6px;
}
.r-row .r-live + .r-chev {
  margin-inline-start: -6px;
}
/* The key, at the top of the list, so it is read before the first click. */
.r-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 8px 0;
  padding: 0 10px;
  color: var(--muted-fg);
  font-size: 12.5px;
}
.r-kids {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.r-gh {
  padding: 8px 10px 2px 36px;
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[dir='rtl'] .r-gh {
  padding: 8px 36px 2px 10px;
  letter-spacing: 0;
}
.r-kid {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: max(32px, var(--tap));
  padding: 6px 10px 6px 36px;
  border-radius: 8px;
  color: var(--muted-fg);
  font-size: 14px;
  text-decoration: none;
}
[dir='rtl'] .r-kid {
  padding: 6px 36px 6px 10px;
}
.r-kid .ic {
  width: 14px;
  height: 14px;
}
.r-kid:hover {
  background: var(--muted);
  color: var(--fg);
}
.r-kid.is-on {
  background: var(--muted);
  color: var(--fg);
  font-weight: 500;
}
.r-foot {
  position: relative;
  padding: 6px;
  border-top: 1px solid var(--border);
}
.r-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: max(44px, var(--tap));
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: start;
}
.r-profile:hover {
  background: var(--muted);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}
.r-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.35;
}
.r-who b {
  font-size: 13px;
  font-weight: 600;
}
.r-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-fg);
}
.r-profile > .ic {
  color: var(--muted-fg);
}
.r-ver {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  color: var(--muted-fg);
  font-size: 12px;
  text-align: center;
}
.pmenu {
  position: absolute;
  z-index: 40;
  inset-inline: 6px;
  bottom: calc(100% + 4px);
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.pmenu hr {
  width: 100%;
  margin: 2px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.pm-h {
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[lang='ar'] .pm-h {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}
.pm-row {
  display: flex;
  gap: 4px;
}
.pm-opt {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: max(30px, var(--tap));
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 12.5px;
}
.pm-opt[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.pm-opt .ic {
  width: 14px;
  height: 14px;
}
.pm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: max(32px, var(--tap));
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: start;
}
.pm-item:hover {
  background: var(--muted);
}

/* The rail, folded to its icons */
.rail.is-collapsed {
  --rail: 3.5rem;
}
.rail.is-collapsed .r-logo {
  justify-content: center;
  padding-inline: 0;
}
.rail.is-collapsed .lg {
  display: none;
}
.rail.is-collapsed .r-mark {
  display: block;
}
.rail.is-collapsed .r-head {
  flex-direction: column;
}
.rail.is-collapsed .r-search {
  justify-content: center;
}
.rail.is-collapsed
  :is(.r-label, .r-chev, kbd, .r-who, .r-kids, .r-ver, .r-profile > .ic) {
  display: none !important;
}
.rail.is-collapsed .rail-nav > ul {
  padding: 8px 6px;
}
.rail.is-collapsed .r-row {
  justify-content: center;
  padding-inline: 0;
}
.rail.is-collapsed .r-row {
  position: relative;
}
.rail.is-collapsed .r-row .r-live {
  position: absolute;
  top: 7px;
  inset-inline-end: 9px;
  box-shadow: 0 0 0 2px var(--card);
}
.rail.is-collapsed .r-key {
  display: none;
}

/* The top bar */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.topbar .tb-menu,
.topbar .tb-mark {
  display: none;
}
.tb-adv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: max(32px, var(--tap));
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  font-weight: 600;
  text-decoration: none;
}
.tb-adv:hover {
  background: var(--muted);
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.tb-end {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-inline-start: auto;
}
.tb-loc,
.f-loc {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted-fg);
}
.sel {
  position: relative;
  display: inline-flex;
  min-width: 0;
}
.sel select {
  appearance: none;
  min-width: 0;
  max-width: 100%;
  min-height: max(32px, var(--tap));
  padding: 0 32px 0 10px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font-size: 14.5px;
  text-overflow: ellipsis;
}
[dir='rtl'] .sel select {
  padding: 0 10px 0 32px;
}
.sel .ic {
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted-fg);
  pointer-events: none;
}
.tb-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: max(32px, var(--tap));
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 15px;
  font-weight: 600;
}
.tb-org:hover {
  background: var(--muted);
}
.tb-org > .ic {
  color: var(--muted-fg);
}
.org-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 13px;
}
.org-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Buttons, chips, badges ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: max(32px, var(--tap));
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--primary) 85%, black);
}
.btn-outline {
  border-color: var(--border);
  background: var(--card);
}
.btn-outline:hover,
.btn-ghost:hover {
  background: var(--muted);
}
.btn-outline[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--ok-soft);
  color: var(--ok);
}
.btn-ghost {
  color: var(--fg);
}
.btn-lg {
  min-height: max(42px, var(--tap));
  padding: 0 16px;
  font-size: 15px;
}
.btn-sm {
  min-height: max(28px, var(--tap));
  padding: 0 10px;
  font-size: 12.5px;
}
.btn-xs {
  min-height: max(24px, var(--tap));
  padding: 0 8px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max(32px, var(--tap));
  height: max(32px, var(--tap));
  flex: none;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg);
}
.icon-btn:hover {
  background: var(--muted);
}
.linkish {
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  min-height: max(28px, var(--tap));
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  font-size: 13px;
  font-weight: 500;
}
.chip:hover {
  background: var(--muted);
}
.chip[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .ic {
  width: 12px;
  height: 12px;
}
.b-info {
  background: var(--info-soft);
  color: var(--info);
}
.b-muted {
  background: var(--muted);
  color: var(--fg);
  font-weight: 500;
}
.tag {
  display: inline-flex;
  gap: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  border-radius: 5px;
  background: var(--muted);
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 400;
}
.tag b {
  color: var(--fg);
  font-weight: 600;
}
.count + .count,
.badge + .badge {
  margin-inline-start: 6px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.delta .ic {
  width: 12px;
  height: 12px;
}
.d-good {
  background: var(--muted);
  color: var(--fg);
}
.d-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.chip-warn,
.chip-muted {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-muted {
  background: var(--muted);
  color: var(--muted-fg);
}
[lang='ar'] :is(.chip-warn, .chip-muted) {
  letter-spacing: 0;
  text-transform: none;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */
.crumbs {
  padding: 8px 16px 0;
  font-size: 12.5px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-fg);
}
.crumbs a {
  display: inline-block;
  padding-block: 2px;
  line-height: max(20px, calc(var(--tap) - 4px));
  color: var(--primary);
  font-weight: 500;
  text-underline-offset: 3px;
}
.crumbs .ic {
  width: 12px;
  height: 12px;
}
.crumbs [aria-current] {
  color: var(--fg);
  font-weight: 600;
}
.ph {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 16px 16px 14px;
  background: var(--card);
  box-shadow: inset 0 -2px 0 var(--point);
}
.crumbs + .ph {
  margin-top: 8px;
}
.ph-main {
  flex: 1;
  min-width: 12rem;
}
.ph-tl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ph-icon {
  display: inline-flex;
  padding: 7px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok);
}
.ph h1 {
  font: 600 17px/1.3 var(--font-h);
  outline: none;
}
.ph-sub {
  margin-top: 4px;
  margin-inline-start: 42px;
  color: var(--muted-fg);
  font-size: 12.5px;
}
.ph-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 6px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
}
.scope-chip .ic {
  width: 12px;
  height: 12px;
}
.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 80rem;
  margin: 0 auto;
  padding: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.sec-h {
  margin: 4px 0 8px;
  color: var(--muted-fg);
  font: 600 12px/1.4 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[lang='ar'] .sec-h {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.card.flush {
  padding: 0;
  overflow: clip;
}
.card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font: 600 15px/1.3 var(--font-h);
}
.card-hrow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card-hrow .card-h {
  margin-bottom: 0;
}
.kv {
  display: grid;
  gap: 6px;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.kv dt {
  color: var(--muted-fg);
}
.kv dd {
  font-weight: 500;
  text-align: end;
}
.kv-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 16px;
}
.kv-grid > div {
  flex-direction: column;
  gap: 2px;
}
.kv-grid dt {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[lang='ar'] .kv-grid dt {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}
.kv-grid dd {
  font-size: 15px;
  text-align: start;
}
.note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.note .ic {
  margin-top: 2px;
}
.note-info {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--ok-soft) 45%, var(--bg));
}
.note-warn {
  border: 1px solid color-mix(in oklab, var(--point) 35%, transparent);
  background: var(--warn-soft);
}
.note-warn > .ic {
  color: var(--warn);
}
.note-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.empty-line {
  padding: 24px 16px;
  text-align: center;
}
.kpis {
  display: grid;
  gap: 12px;
}
.kpis-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpis-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
}
.kpi-l {
  color: var(--muted-fg);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[lang='ar'] .kpi-l {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}
.kpi-v {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi-s {
  color: var(--muted-fg);
  font-size: 12px;
}
.kpi-ic {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
}
.kpi-ic > :not(.kpi-i) {
  grid-column: 2;
}
.kpi-i {
  grid-row: span 3;
  display: inline-flex;
  padding: 8px;
  border-radius: 9px;
  background: var(--muted);
  color: var(--fg);
}
.kpi-link {
  position: relative;
}
.kpi-link .kpi-i {
  position: absolute;
  inset-inline-end: 14px;
  top: 14px;
}
.kpi-link:hover {
  border-color: var(--primary);
}

/* Filters (the report screens' top card) */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.f-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.f-dates .err {
  flex-basis: 100%;
}
.fld {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-fg);
  font-size: 13px;
}
.in-ic,
.ro {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: max(36px, var(--tap));
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font-size: 14.5px;
}
.ro {
  gap: 20px;
  padding: 0 10px;
  border-color: var(--border);
}
.in-ic input {
  width: 9.5rem;
  min-height: inherit;
  padding: 0 34px 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
}
[dir='rtl'] .in-ic input {
  padding: 0 10px 0 34px;
  text-align: end;
}
.in-ic .ic {
  position: absolute;
  inset-inline-end: 10px;
  color: var(--muted-fg);
  pointer-events: none;
}
.ro .ic {
  color: var(--muted-fg);
}
input[aria-invalid='true'] {
  outline: 2px solid var(--bad);
}
.err {
  color: var(--bad);
  font-size: 12.5px;
}
.err:empty {
  display: none;
}
.f-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.f-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-inline-start: auto;
}
.f-inline .chips {
  margin-inline-start: 8px;
}
.facet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.facet-l {
  color: var(--muted-fg);
  font-size: 13px;
}
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: max(26px, var(--tap));
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
a.fchip:hover {
  background: var(--muted);
}
.fchip.is-on {
  border-color: var(--primary);
  background: var(--ok-soft);
  color: var(--ok);
}

/* ── Tables: the green band, the linen stripe, the saffron row ───────────── */
.tbl-wrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
.tbl th,
.tbl td {
  padding: 9px 12px;
  text-align: start;
  vertical-align: middle;
}
.tbl .num {
  text-align: end;
}
.tbl thead th,
.tbl thead td {
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid color-mix(in oklab, var(--ok) 25%, transparent);
}
[lang='ar'] .tbl thead th {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.tbl tbody th {
  font-weight: 500;
}
.tbl > tbody > tr:nth-child(even) {
  background: var(--stripe);
}
.tbl > tbody > tr:hover {
  background: var(--warn-soft);
  box-shadow: inset 3px 0 0 var(--point);
}
[dir='rtl'] .tbl > tbody > tr:hover {
  box-shadow: inset -3px 0 0 var(--point);
}
.tbl tfoot th,
.tbl tfoot td,
.tbl tr.sub th,
.tbl tr.sub td {
  font-weight: 700;
}
.tbl tfoot tr {
  border-top: 1px solid var(--border);
}
.tbl-plain thead th {
  background: none;
  color: var(--muted-fg);
  border-bottom: 1px solid var(--border);
}
.tbl-plain > tbody > tr:nth-child(even),
.tbl-plain > tbody > tr:hover {
  background: none;
  box-shadow: none;
}
.code-link {
  display: inline-flex;
  align-items: center;
  min-height: max(20px, var(--tap));
  color: var(--primary);
  font-weight: 600;
  text-underline-offset: 3px;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: max(20px, var(--tap));
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
.num .th-sort {
  flex-direction: row-reverse;
}
.sort-ic {
  width: 12px;
  height: 12px;
}
.d1,
.d2,
.it-n,
.it-m {
  display: block;
}
.d2,
.it-m {
  font-size: 12.5px;
}
.it-n {
  font-weight: 500;
}

/* Profit and loss */
.stmt {
  padding: 0;
  overflow: clip;
}
.stmt-scope {
  padding: 12px 14px 4px;
}
.pl {
  margin: 0 4px 4px;
  width: calc(100% - 8px);
}
.pl .c-code {
  width: 5.5rem;
}
.pl tr.sec th {
  padding-block: 6px;
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
  color: var(--muted-fg);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[lang='ar'] .pl tr.sec th {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.pl > tbody > tr.sec:hover {
  box-shadow: none;
}
.pl tr.sub th,
.pl tr.key th {
  font-weight: 700;
}
.pl tr.sub i {
  font-weight: 400;
  color: var(--muted-fg);
}
.pl tr.key th,
.pl tr.key td {
  font-weight: 700;
  border-top: 1px solid var(--border);
}
.pl .c-share,
.pl .c-prior {
  color: var(--muted-fg);
}
.pl tbody td.num:first-of-type {
  font-weight: 600;
}
.pl tfoot :is(th, td) {
  position: sticky;
  bottom: 0;
  background: var(--card);
  box-shadow: 0 -1px 0 var(--border);
  font-size: 15px;
}
.pl-months tbody td.num {
  font-weight: 400;
}

/* Account postings */
.c-mod {
  white-space: nowrap;
}
.more {
  padding: 12px;
  text-align: center;
}

/* Journal entry */
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  align-items: start;
}
.two-wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
.je td {
  vertical-align: top;
}
.je-a {
  display: block;
  font-weight: 600;
}
.je-code {
  color: var(--brand);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.note-card .nc-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.note-card p:last-child {
  font-size: 13px;
  line-height: 1.6;
}
.mini-lines {
  display: grid;
  gap: 4px;
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.mini-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.inv {
  margin-top: 12px;
}
.footbar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}

/* Stock on hand */
.searchrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: max(38px, var(--tap));
  padding: 0 12px;
  border: 1px solid var(--field);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted-fg);
}
.search input {
  flex: 1;
  min-width: 0;
  min-height: inherit;
  border: 0;
  background: none;
  color: var(--fg);
  outline: none;
}
.search:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.pop-wrap {
  position: relative;
}
.popover {
  position: absolute;
  z-index: 20;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 4px;
  min-width: 15rem;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: max(30px, var(--tap));
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.stock .c-x,
.slips .c-x {
  width: 3rem;
  text-align: end;
}
.stock td.num b {
  font-weight: 700;
}
.lots-row > td {
  padding: 4px 12px 12px;
  background: var(--card);
}
.lots-row:hover {
  box-shadow: none !important;
}
.lots {
  border: 1px solid var(--border);
  border-radius: 10px;
}
.row-x.is-open {
  background: var(--muted) !important;
}
.pager {
  padding: 10px 16px;
  font-size: 13px;
}
.pager:empty {
  display: none;
}

/* Advisor */
.adv {
  display: flex;
  flex-direction: column;
  max-width: 80rem;
  margin: 0 auto;
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--border);
}
.tabs [role='tab'] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: max(36px, var(--tap));
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted-fg);
  font-weight: 500;
  text-decoration: none;
}
.tabs [role='tab'][aria-selected='true'] {
  border-bottom-color: var(--fg);
  color: var(--fg);
}
.tabs-line {
  padding: 0;
}
.adv-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 16px;
}
.adv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--muted);
}
.seg button {
  min-height: max(30px, var(--tap));
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 500;
}
.seg button[aria-pressed='true'] {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.adv-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.adv-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.4fr);
  min-height: 34rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: clip;
}
.adv-list {
  border-inline-end: 1px solid var(--border);
  background: var(--card);
}
.tg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 16px;
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
  color: var(--muted-fg);
  font-size: 12.5px;
}
.tg b {
  color: var(--fg);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[lang='ar'] .tg b {
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}
.tg .btn {
  margin-inline-start: auto;
}
.tg-week {
  background: var(--warn-soft);
  color: var(--warn);
}
.tg-week b {
  color: var(--warn);
}
.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  text-align: start;
}
.task:hover {
  background: var(--stripe);
}
.task.is-sel {
  background: var(--muted);
  box-shadow: inset 3px 0 0 var(--point);
}
[dir='rtl'] .task.is-sel {
  box-shadow: inset -3px 0 0 var(--point);
}
.task-t {
  font-weight: 600;
}
.task-n {
  font-weight: 700;
  text-align: end;
}
.task-m {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted-fg);
  font-size: 12.5px;
}
.task-m b {
  color: var(--fg);
  font-weight: 500;
}
.task-v {
  color: var(--muted-fg);
  font-size: 13px;
  text-align: end;
}
.adv-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dt-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.dt-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.dt-title {
  margin-bottom: 2px;
  font: 600 19px/1.35 var(--font-h);
}
.dt-n {
  font: 700 22px/1 var(--font-h);
}
.dt-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 20px;
}
.dt-body > p {
  max-width: 38rem;
  color: var(--body-fg);
  font-size: 15px;
  line-height: 1.6;
}
.dt-body .kv {
  max-width: 30rem;
}
.dt-body .kv > div {
  justify-content: flex-start;
}
.dt-body .kv dt {
  width: 6rem;
  flex: none;
}
.dt-body .kv dd {
  text-align: start;
}
.dt-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.dt-more {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-inline-start: auto;
}
.dt-clears {
  font-size: 13px;
}
.empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  min-height: 18rem;
  padding: 32px;
  text-align: center;
}
.empty > .ic {
  width: 40px;
  height: 40px;
  color: var(--ok);
}
.empty h2 {
  font: 600 18px/1.3 var(--font-h);
}
.link-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: max(28px, var(--tap));
  margin-top: 6px;
  color: var(--primary);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Home, the hub, and the not-in-the-demo panel */
.navcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 12px;
}
.navcard {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  height: 100%;
  padding: 16px;
  padding-inline-end: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
}
.navcard:hover {
  border-color: var(--primary);
}
.nc-i {
  grid-row: span 2;
  display: inline-flex;
  align-self: start;
  padding: 8px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok);
}
.is-soon .nc-i {
  background: var(--muted);
  color: var(--muted-fg);
}
.nc-t {
  font-weight: 600;
}
.nc-d {
  color: var(--muted-fg);
  font-size: 13px;
}
.nc-go {
  position: absolute;
  inset-inline-end: 14px;
  top: 18px;
  color: var(--muted-fg);
}
.nid {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 40rem;
  margin: 24px auto;
  padding: 32px 24px;
  text-align: center;
}
.nid-mark .lg-mark {
  width: 44px;
  height: 44px;
}
.nid h2 {
  font: 600 20px/1.3 var(--font-h);
}
.nid h3 {
  margin-top: 12px;
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[lang='ar'] .nid h3 {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.nid-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.nid-try {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.nid-try a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: max(32px, var(--tap));
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.nid-try a:hover {
  background: var(--muted);
}

/* Payroll */
.hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.timeline {
  display: grid;
  gap: 14px;
}
.timeline li {
  position: relative;
  display: grid;
  padding-inline-start: 24px;
}
.tl-dot {
  position: absolute;
  inset-inline-start: 2px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

/* ── Dialogs: the bill, the search, the phone's menu ─────────────────────── */
dialog {
  padding: 0;
  border: 0;
  color: var(--fg);
}
dialog::backdrop {
  background: var(--backdrop);
}
.modal {
  width: min(42rem, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dlg {
  display: flex;
  flex-direction: column;
}
.dlg-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.dlg-h h2 {
  font: 600 18px/1.35 var(--font-h);
}
.done-h {
  display: flex;
  align-items: center;
  gap: 10px;
}
.done-h .ic {
  width: 28px;
  height: 28px;
  color: var(--ok);
}
.dlg-b {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
}
.dlg-f {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.fields .fld {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.fields input {
  min-height: max(36px, var(--tap));
  padding: 0 10px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--card);
  font-family: var(--mono);
}
.fields output {
  display: flex;
  align-items: center;
  min-height: max(36px, var(--tap));
  color: var(--fg);
}
.posts summary {
  min-height: max(28px, var(--tap));
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.posts .tbl {
  margin-top: 8px;
}
.effects {
  display: grid;
  gap: 10px;
}
.effects li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
}
.effects .ic {
  margin-top: 3px;
  color: var(--ok);
}
.palette {
  margin-top: 12vh;
  width: min(36rem, calc(100vw - 32px));
}
.pal {
  padding: 12px;
}
.pal-in {
  margin-bottom: 8px;
}
.pal-list {
  max-height: 55vh;
  overflow-y: auto;
}
.pal-list .pm-h {
  padding: 8px 6px 4px;
}
.pal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: max(36px, var(--tap));
  padding: 0 8px;
  border-radius: 8px;
  text-decoration: none;
}
.pal-item:hover,
.pal-item:focus-visible {
  background: var(--muted);
}
.pal-none {
  padding: 16px;
  text-align: center;
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  inset-inline-end: auto;
  width: min(17rem, 86vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dr-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.dr-panel .r-head .r-search {
  min-height: var(--tap);
}

/* ── Who are you? The chooser at /demo/ ──────────────────────────────────── */
/* Before a role is chosen there is no app yet: no rail, no top bar. One list,
   the app's own row idiom (the To do's, the tables' saffron edge), not
   cards. */
.app.is-choosing .rail,
.app.is-choosing .topbar {
  display: none;
}
.chooser {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
  gap: 48px;
  align-items: center;
  max-width: 74rem;
  min-height: 100%;
  margin: 0 auto;
  padding: 48px 32px;
}
.ch-intro {
  display: grid;
  gap: 14px;
}
.ch-mark .lg-mark {
  width: 56px;
  height: 56px;
}
.ch-co {
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[lang='ar'] .ch-co {
  font-size: 13px;
  letter-spacing: 0;
}
.ch-intro h1 {
  font: 700 44px/1.1 var(--font-h);
  letter-spacing: -0.015em;
  outline: none;
}
[lang='ar'] .ch-intro h1 {
  line-height: 1.35;
  letter-spacing: 0;
}
.ch-sub {
  max-width: 28rem;
  color: var(--body-fg);
  font-size: 17px;
  line-height: 1.55;
}
.ch-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted-fg);
  font-size: 13px;
}
.ch-note .ic {
  margin-top: 3px;
}
.ch-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  overflow: clip;
}
.ch-list li + li {
  border-top: 1px solid var(--border);
}
.ch-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 18px;
  padding: 20px 22px;
  text-decoration: none;
}
.ch-row:hover {
  background: var(--warn-soft);
  box-shadow: inset 3px 0 0 var(--point);
}
[dir='rtl'] .ch-row:hover {
  box-shadow: inset -3px 0 0 var(--point);
}
.ch-row:focus-visible {
  border-radius: 0;
  outline-offset: -3px;
}
.ch-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font: 700 16px/1 var(--font-h);
}
.ch-row[data-v='owner'] .ch-av {
  background: var(--point);
  color: var(--cta-ink);
}
.ch-row[data-v='ops'] .ch-av {
  background: var(--band);
  color: var(--band-ink);
}
.ch-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.ch-role {
  font: 600 19px/1.3 var(--font-h);
}
.ch-name {
  font-size: 13.5px;
  font-weight: 500;
}
.ch-see {
  max-width: 34rem;
  color: var(--body-fg);
  font-size: 14px;
  line-height: 1.5;
}
.ch-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* The banner's role switch, and its menu */
.db-role {
  position: relative;
  margin-inline-start: auto;
}
.db-role + .db-acts {
  margin-inline-start: 0;
}
.db-who {
  gap: 8px;
  padding-inline: 5px 10px;
}
.db-who b {
  font-weight: 600;
}
.db-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: var(--point);
  color: var(--cta-ink);
  font-size: 10.5px;
  font-weight: 700;
}
.db-menu {
  position: absolute;
  z-index: 50;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 2px;
  min-width: 17.5rem;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.db-menu hr {
  width: 100%;
  margin: 2px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.db-mi {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: max(40px, var(--tap));
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: start;
}
.db-mi:hover,
.db-mi:focus-visible {
  background: var(--muted);
}
.demo-bar .db-menu :focus-visible {
  outline-color: var(--ring);
}
.db-mi .db-av {
  width: 28px;
  height: 28px;
  background: var(--muted);
  color: var(--fg);
  font-size: 11px;
}
.db-mi[aria-checked='true'] .db-av {
  background: var(--point);
  color: var(--cta-ink);
}
.db-mt {
  flex: 1;
  display: grid;
  line-height: 1.35;
}
.db-mt span {
  color: var(--muted-fg);
  font-size: 12.5px;
}
.db-tick {
  color: var(--primary);
}

/* Pieces the roles added to every screen */
.task-who {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.task-who .ic {
  width: 12px;
  height: 12px;
}
.adv-none {
  padding: 16px;
}
.pm-who {
  display: grid;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}
.pm-who b {
  font-size: 13px;
}
.pm-who span {
  color: var(--muted-fg);
  font-size: 12px;
}
.nid h1 {
  font: 600 20px/1.3 var(--font-h);
  outline: none;
}
.nid-lock .ic {
  width: 40px;
  height: 40px;
  color: var(--muted-fg);
}
.ph-wait h1 {
  color: var(--muted-fg);
}
.b-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.b-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.kpi-v.is-bad,
.neg,
.late,
.tbl td.is-late {
  color: var(--bad);
}
.late {
  font-weight: 600;
}
.pos {
  color: var(--ok);
}
/* ── Narrower screens ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .two,
  .two-wide {
    grid-template-columns: minmax(0, 1fr);
  }
  .chooser {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-content: start;
    max-width: 44rem;
  }
  .ch-intro h1 {
    font-size: 36px;
  }
}
@media (max-width: 1023px) {
  .rail {
    display: none;
  }
  .topbar {
    gap: 8px;
    padding: 6px 12px;
  }
  .topbar .tb-menu,
  .topbar .tb-mark {
    display: inline-flex;
  }
  .tb-adv {
    padding: 0 10px;
  }
  .tb-adv-l {
    display: none;
  }
  .tb-adv,
  .tb-org {
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .code-link {
    min-width: 44px;
    min-height: 44px;
  }
  .tb-end {
    gap: 6px;
  }
  .tb-loc .sel select {
    max-width: 11rem;
  }
  .org-name,
  .tb-org > .ic {
    display: none;
  }
  .kpis-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .adv-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .adv-list {
    border-inline-end: 0;
    border-bottom: 1px solid var(--border);
  }
  .pl .c-prior,
  .pl .c-vs {
    display: none;
  }
}
@media (max-width: 720px) {
  .db-long {
    display: none;
  }
  .db-short {
    display: inline;
  }
  /* On a phone the banner is two short rows: what this is, then the four
     ways out, the reset as its icon and the way back as the address alone
     (both keep their full names for a screen reader). */
  .demo-bar {
    gap: 4px;
    padding: 4px 12px 6px;
  }
  .db-acts {
    flex-wrap: nowrap;
    margin-inline-start: 0;
    width: 100%;
  }
  .db-pre {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .db-btn[data-act='reset'] {
    padding: 0;
    min-width: max(32px, var(--tap));
    justify-content: center;
  }
  .db-link {
    padding: 0 4px;
    margin-inline-start: auto;
  }
  .content {
    padding: 12px;
    gap: 12px;
  }
  .ph {
    padding: 12px;
  }
  .ph-sub {
    margin-inline-start: 0;
  }
  .kpis-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .dlg-h,
  .dlg-b,
  .dlg-f {
    padding-inline: 14px;
  }
  .dlg .tbl :is(th, td) {
    padding-inline: 4px;
  }
  .pl .c-share,
  .stock :is(.c-lots, .c-low, .c-exp),
  .slips .c-ded,
  .c-mod {
    display: none;
  }
  .pl .c-code {
    width: 4rem;
  }
  .tbl th,
  .tbl td {
    padding: 8px;
  }
  .f-acts {
    margin-inline-start: 0;
  }
  .in-ic input {
    width: 8.5rem;
  }
  .dt-top,
  .dt-body,
  .dt-foot {
    padding-inline: 14px;
  }
  .dt-more {
    margin-inline-start: 0;
  }
  .tb-loc .sel select {
    max-width: 8.5rem;
    font-size: 14px;
  }
  /* The chooser, one column; each person's way in under their name. */
  .chooser {
    padding: 20px 16px 28px;
    gap: 20px;
  }
  .ch-intro {
    gap: 10px;
  }
  .ch-mark .lg-mark {
    width: 40px;
    height: 40px;
  }
  .ch-intro h1 {
    font-size: 30px;
  }
  .ch-sub {
    font-size: 15.5px;
  }
  .ch-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    padding: 16px 14px;
  }
  .ch-av {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .ch-go {
    grid-column: 2;
  }
}
@media (max-width: 480px) {
  .kpis-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  /* A phone keeps each journal line's account, words and amounts; its tags
     would take a column of their own. */
  .je .tags {
    display: none;
  }
  .tb-loc > .ic {
    display: none;
  }
  .db-btn,
  .db-link {
    padding: 0 8px;
    font-size: 12.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
