/* Better House — navy dashboard (the navy of the logo): floating rounded panels, white cards, pill buttons, one typeface (NRT) for every language. */


/* NRT is the font of every text (the owner states a bought licence, 2026-12-01; docs/DEPLOY.md, "Contract fonts"). Its files are not in public/: only this app's
   route /fonts/nrt/{file} serves them. The fonts below draw what NRT lacks (Arabic vowel marks, accented Latin letters, ellipsis, arrows, ticks): self-hosted,
   SIL Open Font License (fonts/OFL-NOTICE.txt); nothing is loaded from Google, so visitors' addresses stay here. */
@font-face { font-family: 'NRT'; unicode-range: U+0000-00B6, U+00B8-10FFFF; src: url('/fonts/nrt/NRT-Reg.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'NRT'; unicode-range: U+0000-00B6, U+00B8-10FFFF; src: url('/fonts/nrt/NRT-Bd.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
/* Arabic only: NRT draws the hamza standing alone (ء) as a small raised mark, so that one letter comes from Noto */
@font-face { font-family: 'Arabic Hamza'; src: url('fonts/NotoSansArabic-arabic.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0621; }
/* the vault system (docs/vault-system.md): a banner in its own colour above every page, so nobody books agency money there; white on a deep violet in both themes */
.vault-bar { margin: 0; padding: 7px 16px; background: #4C1D95; color: #FFFFFF; font-weight: 700; font-size: 13px; line-height: 1.4; text-align: center; letter-spacing: .02em; overflow-wrap: anywhere; }
.vault-rates .big { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
@font-face { font-family: 'Hanken Grotesk'; src: url('fonts/HankenGrotesk-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; src: url('fonts/HankenGrotesk-latin-ext.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Noto Sans Arabic'; src: url('fonts/NotoSansArabic-arabic.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Noto Naskh Arabic'; src: url('fonts/NotoNaskhArabic-arabic.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

:root {
  /* NRT first in every language; its digits all have one width, so money columns line up */
  --f-body: 'NRT', 'Hanken Grotesk', 'Noto Sans Arabic', system-ui, sans-serif;
  --f-num: 'NRT', 'Hanken Grotesk', system-ui, sans-serif;

  --bg: #E8ECF0;
  --shell: #FFFFFF;
  --panel: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F0F3F6;
  --ink: #0F1722;
  --ink-2: #3E4F61;
  --ink-3: #52647A;
  --line: #E1E6EB;
  --line-strong: #C9D1DA;
  --edge: #7D8895; /* the edge of a text box, a list and a text area: 3:1 against the surface (WCAG 1.4.11); --line-strong is for rules and decoration */

  --accent: #264058;
  --accent-dark: #162B3E;
  --accent-light: #7C9BB8;
  --accent-soft: #E4EBF2;
  --accent-ink: #1A3249;
  --btn: #264058;

  --pos: #17693A;
  --neg: #B3261E;
  --warn: #8A5600;
  --pos-bg: #E1F1E8;
  --neg-bg: #FCE9E6;
  --warn-bg: #FFF1D9;
  --orange: #E8590C;

  --c-cloth: #D23F7A;
  --c-realty: #2D7FD8;
  --c-cafe: #E09B17;
  --cur-usd: #264058;
  --cur-iqd: #7C9BB8;
  --cur-eur: #E09B17;

  --hero: linear-gradient(155deg, #34556F 0%, #264058 45%, #172B3D 100%);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 34, .04);
  --shadow-md: 0 16px 32px -16px rgba(15, 23, 34, .28);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #070B10;
  --shell: #0D131A;
  --panel: #121A22;
  --surface: #17212B;
  --surface-2: #1C2833;
  --ink: #E8EEF4;
  --ink-2: #B0BFCD;
  --ink-3: #8294A6;
  --line: #202C38;
  --line-strong: #2F4150;
  --edge: #617589;

  --accent: #7FA9D4;
  --accent-dark: #2B4D6C;
  --accent-light: #A3C3E2;
  --accent-soft: #1A2C3E;
  --accent-ink: #A0C3E6;
  --btn: #6C9AC8;

  --pos: #4DCB88;
  --neg: #F27A6E;
  --warn: #EBB04A;
  --pos-bg: rgba(77, 203, 136, .14);
  --neg-bg: rgba(242, 122, 110, .15);
  --warn-bg: rgba(235, 176, 74, .15);
  --orange: #FF8A4C;

  --c-cloth: #F0689A;
  --c-realty: #5FA8F2;
  --c-cafe: #F0B545;
  --cur-usd: #7FA9D4;
  --cur-iqd: #46678A;
  --cur-eur: #F0B545;

  --hero: linear-gradient(155deg, #2C4A66 0%, #1D3349 50%, #111F2D 100%);
  --shadow-sm: none;
  --shadow-md: 0 18px 36px -18px rgba(0, 0, 0, .75);
}

html[lang='ar'] { --f-body: 'Arabic Hamza', 'NRT', 'Hanken Grotesk', 'Noto Sans Arabic', system-ui, sans-serif; }
textarea, code, kbd, pre, samp { font-family: inherit; }
html[dir='rtl'] * { letter-spacing: 0 !important; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  padding: 18px;
  overflow-x: hidden;
}
html[lang='ar'] body { line-height: 1.65; font-size: 15px; }
html[lang='ckb'] body { line-height: 1.7; font-size: 15.5px; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
#pageTitle:focus-visible { outline: none; }
.muted { color: var(--ink-3); }
.mod-lines { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.mod-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mod-lines .mod-amt { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; }
.skip:focus { top: 12px; }
.num { direction: ltr; unicode-bidi: isolate; font-family: var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- layout: outer shell with three floating panels ---------- */
.app {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px;
  background: var(--shell); border-radius: 34px; padding: 16px; min-height: calc(100vh - 36px);
  box-shadow: 0 40px 80px -50px rgba(15, 23, 34, .5);
}
.side {
  position: sticky; top: 34px; height: calc(100vh - 68px); overflow-y: auto;
  background: var(--panel); border-radius: 24px; display: flex; flex-direction: column; padding: 20px 0 16px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 22px 14px; flex: none; }
.brand .mark { width: 38px; height: 38px; flex: none; border-radius: 10px; }.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.brand-name { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

#nav { padding: 0 14px; flex: 1; }
.nav-g { font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 14px 10px 6px; }
@media (max-height: 860px) { .concept { display: none; } }
html[dir='rtl'] .nav-g { text-transform: none; font-size: 13.5px; }
.nav-a {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px;
  background: none; border: 0; border-radius: 12px; color: var(--ink-3); font-weight: 500; font-size: 15px; text-align: start;
}
.nav-a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.nav-a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.nav-a[aria-current='page'] .ic { color: var(--accent); }
.nav-a[aria-current='page']::before {
  content: ''; position: absolute; inset-inline-start: -14px; top: 5px; bottom: 5px; width: 6px; background: var(--accent);
  border-start-end-radius: 6px; border-end-end-radius: 6px;
}
.nav-a .ic { flex: none; }
.badge { margin-inline-start: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--accent-dark); color: #fff; border-radius: 8px; min-width: 24px; height: 22px; padding: 0 7px; display: grid; place-items: center; }

.side-foot { padding: 0 14px; display: grid; gap: 10px; flex: none; }
.concept { font-size: 12px; color: var(--ink-3); padding: 0 6px; text-align: center; }
.side-link { margin: 0; font-size: 13px; text-align: center; padding: 2px 6px; }
.side-link a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.side-link a:hover { color: var(--ink); }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.top {
  position: sticky; top: 34px; z-index: 30; display: flex; align-items: center; gap: 14px;
  background: var(--panel); border-radius: 24px; padding: 10px 14px 10px 14px; min-height: 66px;
}
.controls { display: flex; gap: 10px; align-items: center; margin-inline-start: auto; }
.ctl { display: flex; align-items: center; gap: 8px; }
.ctl-l { font-size: 12.5px; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.seg button { border: 0; background: none; padding: 6px 13px; min-height: 34px; border-radius: 999px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] { background: var(--btn); color: #fff; font-weight: 600; }
html[data-theme='dark'] .seg button[aria-pressed='true'], html[data-theme='dark'] .seg button[aria-selected='true'] { color: #0A1420; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.menu-btn { display: none; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--btn); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; border: 2px solid var(--panel); }
html[data-theme='dark'] .bell .dot { color: #0A1420; }
.profile { display: flex; align-items: center; gap: 12px; padding-inline-start: 6px; min-width: 0; }
.profile .meta b { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.profile .meta small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* group > business > branch switcher */
.scope-wrap { position: relative; min-width: 0; flex: 0 1 auto; }
.scope-btn { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 16px; min-height: 46px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 15px; font-weight: 600; color: var(--ink); text-align: start; }
.scope-btn:hover { background: var(--accent-soft); }
.scope-btn[aria-expanded='true'] { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.scope-btn .ic { flex: none; color: var(--ink-3); }
.scope-btn .path { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.scope-btn .path .sep { color: var(--ink-3); font-weight: 400; }
.scope-btn .path > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.scope-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); width: min(310px, 86vw); max-height: min(72vh, 560px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); padding: 8px; z-index: 60; }
.scope-panel[hidden] { display: none; }
.side-l { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 6px 12px 6px; }
.sc-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; border: 0; background: none; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.sc-item:hover { background: var(--surface-2); color: var(--ink); }
.sc-item[aria-current='true'] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sc-item .ic { flex: none; color: var(--ink-3); }
.sc-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sc-child { padding-inline-start: 32px; font-size: 14.5px; }
.sc-child::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); flex: none; margin-inline-start: -2px; }
.side-note { font-size: 12.5px; color: var(--ink-3); padding: 8px 12px 6px; line-height: 1.45; }

.stage { background: var(--panel); border-radius: 24px; padding: 26px 28px 14px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page { flex: 1; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
h1 { font-size: 34px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
html[dir='rtl'] h1 { font-size: 30px; font-weight: 700; }
html[lang='ckb'] h1 { font-size: 31px; }
.page-sub { color: var(--ink-3); font-size: 15.5px; margin-top: 6px; }
/* the title and its words take the room that is left and wrap, so the buttons stay on the title's line; wrapped under it they keep to the far end, where the Export menu opens from */
.page-h > :first-child { flex: 1 1 360px; min-width: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-inline-start: auto; }
.page-actions:empty { display: none; }
/* one height for every button of the header, the Export button among them */
.page-actions { align-items: center; }
.page-actions .rb.rb-solo { margin: 0; }
.page-actions .btn, .page-actions .rb-tools .btn { min-height: 44px; padding: 6px 18px; font-size: 14.5px; }
.view { outline: none; }
.foot { padding: 18px 4px 6px; color: var(--ink-3); font-size: 12.5px; }

/* ---------- form controls ---------- */
select, input[type='text'], input[type='number'], input[type='date'], input[type='search'], input[type='tel'] {
  width: 100%; padding: 8px 14px; min-height: 44px; border: 1px solid var(--edge); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 34px; width: auto;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23778a7e' stroke-width='1.8' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
html[dir='rtl'] select { background-position: left 12px center; }
.field select { width: 100%; }
select:disabled { opacity: .5; cursor: not-allowed; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input.ltr { direction: ltr; text-align: start; }
html[dir='rtl'] input.ltr { text-align: right; }

/* date box: a text box (DD/MM/YYYY, always left to right) with a calendar button inside its far end, and a native date box kept out of sight that only opens the picker.
   The text box is forced left to right, so its padding is written with left and right; the button follows the direction of the page. */
.dt { position: relative; display: block; min-width: 0; }
.dt .dt-in { padding-right: 44px; }
html[dir='rtl'] .dt .dt-in { padding-right: 14px; padding-left: 44px; }
.dt-cal { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); display: grid; place-items: center; }
html[dir='rtl'] .dt-cal { right: auto; left: 4px; }
.dt-cal:hover { background: var(--accent-soft); color: var(--accent-ink); }
.dt-in:disabled + .dt-cal, .dt-cal:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.dt > input.dt-nat { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reveal { animation: fade .28s ease both; }
.still .reveal { animation: none; }
.btn, .icon-btn, .seg button, .sc-item, .nav-a, .row-btn, .rem, .filters button, .br-card, .deal, .staff, .scope-btn, .go-btn {
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s, transform .15s;
}

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; }
.card-h .btn { margin-inline-start: auto; }
.eyebrow { font-size: 13px; color: var(--ink-3); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1.7; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip.ok { background: var(--pos-bg); color: var(--pos); }
.chip.bad { background: var(--neg-bg); color: var(--neg); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.brass { background: var(--accent-soft); color: var(--accent-ink); }
.chip.mute { background: transparent; color: var(--ink-3); padding-inline: 0; }
.chip.code { font-size: 12px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--line); background: var(--surface); font-family: var(--f-num); border-radius: 8px; padding-inline: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 8px 22px; font-weight: 500; font-size: 15px; border: 1.5px solid var(--btn); background: var(--btn); color: #fff; min-height: 46px; }
html[data-theme='dark'] .btn { color: #0A1420; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
html[data-theme='dark'] .btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--btn); }
html[data-theme='dark'] .btn.ghost { color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--btn); }
.btn.sm { padding: 3px 16px; min-height: 34px; font-size: 13.5px; }
.btn.icon { padding: 0; width: 34px; }
.btn.ok { background: var(--pos); border-color: var(--pos); color: #fff; }
.btn.bad { background: transparent; border-color: var(--line-strong); color: var(--neg); }
.btn.bad:hover { background: var(--neg-bg); border-color: var(--neg); }
.btn.block { width: 100%; }
.btn.light { background: #fff; border-color: #fff; color: var(--accent-dark); font-weight: 600; }
.btn.light:hover { background: #E6EDF4; border-color: #E6EDF4; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.go-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: var(--ink); background: transparent; }
.go-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.flip { }
html[dir='rtl'] .flip { transform: scaleX(-1); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid2.wide { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.row3 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }

.dl { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12.5px; padding: 1px 8px; border-radius: 8px; line-height: 1.6; }
.dl.pos { color: var(--pos); background: var(--pos-bg); }
.dl.neg { color: var(--neg); background: var(--neg-bg); }

/* ---------- overview ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-h h3 { font-size: 16.5px; font-weight: 600; line-height: 1.3; padding-top: 6px; }
.kpi-v { font-size: clamp(24px, 2.3vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; margin-top: 2px; }
.kpi-v.long { font-size: clamp(19px, 1.7vw, 26px); }
.kpi-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: auto; }
.kpi.hero { color: #fff; border-color: transparent; background: var(--accent-dark); }
.kpi.hero .kpi-f { color: rgba(255, 255, 255, .8); }
.kpi.hero .go-btn { background: #fff; border-color: #fff; color: var(--accent-dark); }
.kpi.hero .go-btn:hover { background: #E6EDF4; }
.kpi.hero .dl.pos { background: rgba(255, 255, 255, .18); color: #C6F5D8; }
.kpi.hero .dl.neg { background: rgba(255, 255, 255, .18); color: #FFD1CB; }
.curmini { display: grid; gap: 6px; }
.curbar { display: flex; gap: 3px; height: 8px; direction: ltr; }
.curbar i { flex: var(--f) 1 0; min-width: 4px; background: var(--c); border-radius: 4px; }
.kpi.hero .curbar i:nth-child(1) { background: #fff; }
.kpi.hero .curbar i:nth-child(2) { background: #A3C3E2; }
.kpi.hero .curbar i:nth-child(3) { background: #F2C46A; } /* the third part exists only while an old euro balance is not zero */
.cur-legend { font-size: 12px; color: rgba(255, 255, 255, .78); display: flex; gap: 10px; flex-wrap: wrap; }

.chart { width: 100%; max-width: 520px; height: auto; margin-inline: auto; direction: ltr; display: block; }
.chart .ax { fill: var(--ink-3); font-size: 12px; font-family: var(--f-num); }
.chart .ax.cur { fill: var(--ink); font-weight: 600; }
.chart .p-profit { fill: var(--accent); }
.chart .p-exp { fill: var(--edge); }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart .col:hover { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); display: inline-block; }
.sw.exp { background: var(--edge); }
.sw.trk { background: var(--line-strong); }

.row-btn { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 9px 6px; border-radius: 14px; cursor: pointer; }
.row-btn:hover:not([disabled]) { background: var(--surface-2); }
.row-btn[disabled] { cursor: default; }
.row-btn:focus-visible { outline: 2px solid var(--accent); }
.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); flex: none; }
.row-txt b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.row-txt small { display: block; font-size: 12.5px; color: var(--ink-3); }
.row-val { text-align: end; font-weight: 600; }
.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; position: relative; }
.bar > i { position: absolute; inset-block: -1px; inset-inline-start: -1px; width: var(--w); background: var(--c, var(--accent)); border-radius: inherit; }
.bar > b { position: absolute; inset-block: -5px; inset-inline-start: var(--p); width: 2px; background: var(--ink); border-radius: 1px; }
.bar.lg { height: 12px; }

.feat-t { font-size: 25px; font-weight: 600; line-height: 1.25; color: var(--accent); letter-spacing: -.01em; }
html[data-theme='dark'] .feat-t { color: var(--accent-light); }
html[lang='ckb'] .feat-t, html[lang='ar'] .feat-t { font-size: 22px; }
.feat-s { color: var(--ink-3); margin: 6px 0 16px; }
.rem { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-radius: 14px; }
.rem:hover { background: var(--surface-2); }
.rem .ri { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.rem .ri.warn { background: var(--warn-bg); color: var(--warn); }
.rem .ri.bad { background: var(--neg-bg); color: var(--neg); }
.rem span.t { flex: 1; font-size: 14px; line-height: 1.4; }
.rem .ic.go { color: var(--ink-3); }
.feat .rem-list { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }

.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.li .who-t b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.li .who-t small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.li .who-t small b { display: inline; font-size: inherit; font-weight: 600; color: var(--ink-2); }

.gauge-wrap { position: relative; margin-top: 4px; }
.gauge { width: 100%; max-width: 300px; margin-inline: auto; display: block; direction: ltr; }
.g-trk { fill: none; stroke: var(--line-strong); stroke-width: 28; }
.g-val { fill: none; stroke: var(--accent); stroke-width: 28; stroke-linecap: round; }
.gauge-c { position: absolute; inset-inline: 0; bottom: 4px; text-align: center; }
.gauge-c b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.gauge-c small { display: block; color: var(--ink-3); font-size: 13.5px; }
.g-legend { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.g-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw.g1 { background: var(--accent); }

.rates {
  position: relative; overflow: hidden; border-radius: var(--radius); color: #fff; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  background: var(--accent-dark);
}
.rates h3 { font-size: 18px; font-weight: 600; }
.rates .big { font-size: 46px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-top: 10px; font-family: var(--f-num); direction: ltr; text-align: start; }
html[dir='rtl'] .rates .big { text-align: right; }
.rates p { color: rgba(255, 255, 255, .8); font-size: 13.5px; }
.rates .acts { display: flex; gap: 10px; margin-top: auto; padding-top: 16px; align-items: center; flex-wrap: wrap; }
.rates .round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--accent-dark); display: grid; place-items: center; }
.rates .round:hover { background: #E6EDF4; }
.rates .btn.line { background: transparent; border-color: rgba(255, 255, 255, .7); color: #fff; }
.rates .btn.line:hover { background: rgba(255, 255, 255, .14); }

/* ---------- structure ---------- */
.gnode {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap; color: #fff; border-color: transparent; position: relative; overflow: hidden;
  background: var(--hero);
}
.gnode h2 { font-size: 24px; font-weight: 600; }
.gnode .muted { color: rgba(255, 255, 255, .72); }
.gnode .gstat p:first-child { font-size: 13px; color: rgba(255, 255, 255, .72); }
/* light theme: secondary text on the green panels reaches 4.5:1 (the dark theme already does) */
html:not([data-theme='dark']) .kpi.hero .kpi-f, html:not([data-theme='dark']) .cur-legend, html:not([data-theme='dark']) .rates p,
html:not([data-theme='dark']) .gnode .muted, html:not([data-theme='dark']) .gnode .gstat p:first-child { color: rgba(255, 255, 255, .92); }
.gnode .gstat .num { font-size: 22px; font-weight: 600; }
.biz { margin-top: 24px; }
.biz-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.biz-h h3 { font-size: 18px; font-weight: 600; }
.biz-sw { width: 12px; height: 12px; background: var(--bc); border-radius: 4px; flex: none; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.br-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 4px solid var(--bc); display: grid; gap: 6px; align-content: start; box-shadow: var(--shadow-sm); }
.br-card h4 { font-size: 16.5px; font-weight: 600; }
.br-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.br-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.br-card dt { font-size: 12.5px; color: var(--ink-3); }
.br-card dd { font-size: 15px; font-weight: 600; margin: 0; }
/* the read-only line of an old euro balance (shown only while it is not zero) */
.br-card dl .old { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.br-card dl .old dd { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.br-card.ghost { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 150px; color: var(--ink-3); font-weight: 500; text-align: center; gap: 4px; }
.br-card.ghost:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.br-card:not(.ghost):hover, .deal:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.br-spark { --sc: var(--bc); margin: 2px 0 4px; }
.spark { width: 100%; height: 30px; direction: ltr; display: block; }
.spark-line { fill: none; stroke: var(--sc, var(--accent)); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-fill { fill: var(--sc, var(--accent)); opacity: .12; }
.spark-dot { fill: none; stroke: var(--sc, var(--accent)); stroke-width: 6px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.note-card { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-color: transparent; }
.note-card p { max-width: 72ch; }
.ic-box { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; flex: none; color: var(--accent); }
/* the team of a branch (Structure page) and the sign-in mark (also on the Staff page); docs/branch-team.md */
.team { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; min-width: 0; }
.team-h { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; }
.team-h h5 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.team-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; align-items: center; }
.team-list .av { grid-row: 1 / span 2; }
.team-who { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.team-who b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.team-who small { font-size: 12.5px; color: var(--ink-3); }
.team-state { grid-column: 2; min-width: 0; font-size: 12.5px; }
.team-empty { font-size: 13.5px; }
.team-more { justify-self: start; }
.chip.login { max-width: 100%; }
.chip.login > span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 620px; }
.tbl th { font-size: 13px; font-weight: 600; text-align: start; color: var(--ink-3); padding: 10px 14px; background: var(--surface-2); white-space: nowrap; }
.tbl th:first-child { border-start-start-radius: 12px; border-end-start-radius: 12px; }
.tbl th:last-child { border-start-end-radius: 12px; border-end-end-radius: 12px; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: end; white-space: nowrap; }
.tbl .nw { white-space: nowrap; }
.tbl small { display: block; color: var(--ink-3); font-size: 12.5px; }
.tbl tfoot td { border-top: 3px double var(--ink); border-bottom: 0; font-weight: 600; padding-top: 14px; }
.amt { font-weight: 600; }
.amt.in { color: var(--pos); }
.amt.out { color: var(--neg); }
.dir-ic { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.dir-ic.in { background: var(--pos-bg); color: var(--pos); }
.dir-ic.out { background: var(--neg-bg); color: var(--neg); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; min-width: 0; max-width: 100%; }
.filters button { border: 1.5px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 3px 15px; min-height: 34px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.filters button:hover { background: var(--surface-2); }
.filters button[aria-pressed='true'] { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
html[data-theme='dark'] .filters button[aria-pressed='true'] { color: #0A1420; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-3); }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form.cols { grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > .lbl, .lbl-row > label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .err { color: var(--neg); font-size: 12.5px; }
.field .err:empty { display: none; }
.calc-out { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); padding: 4px 14px; }
.calc-out div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.calc-out div:last-child { border-bottom: 0; border-top: 3px double var(--ink); margin-top: 2px; font-weight: 600; }
.rate-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rate-list div:last-child { border-bottom: 0; }

/* ---------- invoices ---------- */
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.aging > div { border-inline-start: 4px solid var(--c); padding-inline-start: 12px; border-radius: 2px; }
.aging p.lbl { font-size: 13.5px; color: var(--ink-3); }
.aging p.v { font-size: 22px; font-weight: 600; }
.stackbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 4px 0 16px; background: var(--line); direction: ltr; gap: 2px; }
.stackbar i { background: var(--c); flex: var(--f) 1 0; min-width: 0; }

/* ---- S2 invoices: the phone number and the category of an invoice (ui-invoice) ---- */
/* the line above a box that has a small link at its end ("Add category"); the link sits at the end of the line in both directions */
.lbl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.lbl-row > label { min-width: 0; }
.lbl-row .lk { font-size: 12.5px; white-space: nowrap; }
/* the category filter: a pill among the filter buttons */
.filters select { width: auto; min-width: 0; max-width: 100%; text-overflow: ellipsis; min-height: 34px; padding-block: 3px; padding-inline-start: 15px; border: 1.5px solid var(--line-strong); border-radius: 999px; background-color: transparent; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.filters select:hover { background-color: var(--surface-2); }
.tbl td.cat { white-space: nowrap; }
.tbl td small + small { margin-top: 2px; }
/* the list of categories in its dialog */
.icat-list { list-style: none; margin: 0; padding: 0; display: grid; }
.icat-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.icat-list li:last-child { border-bottom: 0; }
.icat-list .nm { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.icat-list li.is-off .nm { color: var(--ink-3); }
.icat-list .chip { flex: none; }
/* a small dialog opened over another one (the form behind it keeps what was typed in it) */
.dlg.mini { width: min(420px, calc(100vw - 24px)); }
.dlg.mini .dlg-grid { grid-template-columns: 1fr; }

/* ---------- people ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
/* a person: the name beside the picture, then the chips and the department across the whole card, then the buttons in one row */
.staff { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.staff h4 { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.staff > .av + div { flex: 1 1 0; min-width: 0; margin-inline-start: 4px; overflow-wrap: anywhere; }
.staff > .rcr-sdept { flex: 0 0 100%; margin: 0; }
.staff > .staff-act:empty { display: none; } /* its buttons moved into the "..." menu */
.staff .meta { flex: 0 0 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.searchbox { position: relative; max-width: 340px; flex: 1; }
.searchbox input { padding-inline-start: 40px; border-radius: 999px; }
.searchbox .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.ct-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.leave-item { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.leave-item:last-child { border-bottom: 0; }
.leave-item .row { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
/* item 5 of the messages and phone fixes: the reason of a rejection, under the result (leave, the requests of Approvals and controls, My pay, Bonus and penalty) */
.dec-why { white-space: normal; overflow-wrap: anywhere; }
.tbl small.dec-why { max-width: 32ch; margin-top: 4px; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }

/* ---------- customers (kanban) ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; align-content: start; min-height: 220px; }
.kcol-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px 10px; border-bottom: 2px solid var(--sc); }
.kcol-h b { font-size: 15px; font-weight: 600; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; border-inline-start: 4px solid var(--bc); box-shadow: var(--shadow-sm); }
.deal h4 { font-size: 15px; font-weight: 600; }
.deal .btns { margin-top: 4px; justify-content: space-between; }

/* ---------- people & company initials ---------- */
.av { --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: calc(var(--s) * .42); font-weight: 700; line-height: 1; background: hsl(var(--h) 55% 90%); color: hsl(var(--h) 50% 28%); }
html[data-theme='dark'] .av { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 82%); }
/* a branch letter in its own colour is too faint on the dark tile: the colour is lightened */
html[data-theme='dark'] .ico { color: color-mix(in srgb, var(--c) 55%, var(--ink)); }
.av.sm { --s: 30px; }
.av.lg { --s: 46px; grid-row: span 2; }
.profile .av { --s: 46px; }
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.who > span:last-child, .who > h4 { min-width: 0; line-height: 1.3; }
.deal .who { margin-bottom: 2px; }

/* ---------- contracts ---------- */
.ct-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ct-layout .form-card { position: sticky; top: 118px; max-height: calc(100vh - 140px); overflow-y: auto; }
.sheet { background: #FFFFFF; color: #15181E; border: 1px solid var(--line-strong); border-radius: 12px; padding: clamp(24px, 5vw, 48px); box-shadow: 0 10px 28px -18px rgba(0, 0, 0, .35); }
.sheet-inner[lang='en'] { font-family: 'NRT', 'Hanken Grotesk', system-ui, sans-serif; font-size: 15px; line-height: 1.75; }
.sheet-inner[lang='ar'] { font-family: 'Arabic Hamza', 'NRT', 'Noto Naskh Arabic', 'Noto Sans Arabic', serif; font-size: 18px; line-height: 2; }
.sheet-inner[lang='ckb'] { font-family: 'NRT', 'Noto Naskh Arabic', 'Noto Sans Arabic', serif; font-size: 16px; line-height: 2.05; }
.sheet-inner h2 { font-size: 1.7em; font-weight: 700; text-align: center; margin: 4px 0 2px; font-family: inherit; }
.sheet-inner .sheet-ref { text-align: center; font-size: .8em; color: #6B7484; direction: ltr; }
.sheet-inner .sheet-sub { text-align: center; color: #6B7484; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #E5E8ED; }
.sheet-inner ol { margin: 14px 0; padding-inline-start: 1.5em; display: grid; gap: 6px; }
.sheet-inner li::marker { font-weight: 700; }
mark.fill { background: #E4EBF2; color: inherit; font-weight: 600; padding: 0 3px; border-radius: 3px; }
.blank { display: inline-block; min-width: 96px; height: 1em; border-bottom: 1.5px dotted #8791A2; vertical-align: -2px; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 44px; text-align: center; }
.sig-line { display: block; border-bottom: 1.5px solid #15181E; height: 38px; margin-bottom: 6px; }
.sig-name { font-size: .85em; color: #6B7484; }
.sched div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum-strip { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); }

/* ---------- goals ---------- */
.goal { display: grid; gap: 12px; }
.goal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.goal h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.goal-v { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--ink-2); }
.goal-v .big { font-size: 26px; color: var(--ink); font-weight: 600; }
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.budget-row { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.budget-row:last-child { border-bottom: 0; }
.budget-row .top-r { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .bar { flex: 1; }
.pctl { font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-width: 42px; text-align: end; }

/* ---------- controls ---------- */
.ap { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ap:last-child { border-bottom: 0; }
.ap h4 { font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.lock-card.locked { border-color: var(--warn); }
.lock-big { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.locked .lock-big { background: var(--warn-bg); color: var(--warn); }
.audit { list-style: none; padding: 0; display: grid; position: relative; }
.audit li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 0 0 16px; position: relative; }
.audit li::before { content: ''; position: absolute; inset-inline-start: 7px; top: 14px; bottom: 0; width: 1px; background: var(--line-strong); }
.audit li:last-child::before { display: none; }
.audit i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); margin: 5px 3px 0; }
.audit small { color: var(--ink-3); font-size: 12.5px; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; }
.perm { min-width: 54px; justify-content: center; }
.audit .chg { display: block; margin-top: 2px; overflow-wrap: anywhere; } /* an address is quoted whole (up to 255 characters): one long word must wrap, not widen the page */
.audit .chg .flip { display: inline-block; vertical-align: middle; margin-inline: 4px; }

/* ---------- moderation and administration ---------- */
.tabs-bar { margin-bottom: 14px; }
.tabs { max-width: 100%; overflow-x: auto; }
.tabs button { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.matrix .l, .matrix th.l { text-align: start; }
.tbl.users { min-width: 780px; }
.tbl.roles { min-width: 1080px; }
.tbl.roles td:first-child { min-width: 150px; }
.tbl.roles td.l { min-width: 270px; }
.tbl.roles .chips { margin-top: 4px; }
.tbl.rules { min-width: 520px; }
.tbl.mod { min-width: 800px; }
.tbl.mod td { vertical-align: top; }
.tbl.mod td:first-child { min-width: 170px; }
.tbl.mod td.acts .btns { max-width: 214px; margin-inline-start: auto; }
.tbl .mod-note { white-space: normal; max-width: 38ch; }
.tbl tr.is-off td:not(.acts):not(.keep) { opacity: .6; } /* keep: a cell that stays at full strength in a dimmed row (the status of a cancelled document must stay readable) */
.tbl input.thr { width: 130px; }
.card-h > p.muted { flex: 1 1 280px; max-width: 72ch; }
.rule-hints { display: grid; gap: 2px; font-size: 13px; margin-bottom: 14px; }
.tgl { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 999px; border: 0; background: var(--line-strong); cursor: pointer; transition: background-color .15s; }
.tgl::before { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: inset-inline-start .15s; }
.tgl:checked { background: var(--btn); }
.tgl:checked::before { inset-inline-start: 21px; }
input.tgl:focus { box-shadow: none; }
input.tgl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dlg-sec { grid-column: 1 / -1; font-size: 16px; font-weight: 700; color: var(--ink); padding-top: 10px; border-top: 1px solid var(--line); }
.dlg-grid > .dlg-sec:first-child { border-top: 0; padding-top: 0; }
.secret { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-2); }
.secret-v { flex: 1 1 200px; min-width: 0; font-family: var(--f-num); font-size: 18px; font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; user-select: all; overflow-wrap: anywhere; }

/* ---------- dialog: forms and confirmations ---------- */
.dlg { padding: 0; margin: auto; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); text-align: start; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-md); overflow: hidden; }
.dlg[open] { display: flex; flex-direction: column; animation: fade .2s ease both; }
@media (pointer: coarse) { .dlg[open] { animation: none; } } /* iPhone: a window that fades in from nothing while the keyboard rises can be left out of sight */
.dlg::backdrop { background: rgba(7, 11, 16, .55); }
.dlg-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 6px; flex: none; }
.dlg-h h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.icon-btn.sm { width: 38px; height: 38px; background: var(--surface-2); }
/* the fieldset only hands "disabled" to every control while a form is being sent; it must not be a box: Chrome does not pass the dialog's height limit through a flex fieldset, so .dlg-b grew past the dialog (overflow:hidden) and Save/Cancel were cut off */
.dlg-set { border: 0; margin: 0; padding: 0; display: contents; }
.dlg-set:disabled > .dlg-b, .dlg-set:disabled > .dlg-f { opacity: .8; }
.dlg-b { display: grid; gap: 14px; align-content: start; overflow-y: auto; flex: 1; min-height: 0; padding: 10px 24px 14px; }
.dlg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dlg-grid .field.full { grid-column: 1 / -1; }
.dlg-msg { color: var(--ink-2); }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 24px 20px; border-top: 1px solid var(--line); flex: none; }
.field[hidden], .form-err[hidden] { display: none; }
.field .req { color: var(--neg); }
.hint { color: var(--ink-3); font-size: 12.5px; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.chk input { width: 20px; height: 20px; accent-color: var(--btn); flex: none; }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--neg); }
input[aria-invalid='true']:focus, select[aria-invalid='true']:focus { box-shadow: 0 0 0 4px var(--neg-bg); }
input:disabled { opacity: .6; cursor: not-allowed; }
.err { color: var(--neg); font-size: 12.5px; }
.err:empty { display: none; }
.form-err { background: var(--neg-bg); color: var(--neg); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.btn.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn.danger:hover { background: var(--neg); border-color: var(--neg); filter: brightness(.92); }
html[data-theme='dark'] .btn.danger { color: #1B0805; }
.btn[aria-busy='true'] { cursor: progress; }
.btn[aria-busy='true']::after { content: ''; width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tbl tr.is-reversed td { opacity: .55; }
.tbl tr.is-reversed .amt { text-decoration: line-through; }
.feat-t.calm { font-size: 19px; line-height: 1.45; }
.feat .rem-list.solo { margin-top: 0; padding-top: 0; border-top: 0; }
.fatal { max-width: 520px; margin: 40px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
@media (max-width: 520px) {
  .dlg-grid { grid-template-columns: 1fr; }
  .dlg-h, .dlg-b, .dlg-f { padding-inline: 18px; }
  .dlg-f .btn { flex: 1; }
  .dlg .kv { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px 14px; } /* the facts of a window in two columns */
}

/* ---------- properties, leases and statements ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (min-width: 1100px) { .stats:has(> :nth-child(7):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi.stat { gap: 6px; }
.kpi.stat .kpi-h h3 { font-size: 14.5px; font-weight: 600; color: var(--ink-2); padding-top: 0; }
.tbl.wide { min-width: 940px; }
.tbl.wide th, .tbl.wide td { padding-inline: 10px; }
.tbl.wide td small { white-space: normal; }
.tbl.wide td:first-child { min-width: 170px; }
.tbl.wide td:nth-child(2) { min-width: 120px; }
.tbl.wide td:nth-child(5) { min-width: 140px; }
.tbl.wide td:nth-child(7) { min-width: 110px; }
html[data-theme='dark'] .btn.bad { color: var(--neg); }
.tbl.slim { min-width: 0; }
.tbl td.acts { min-width: 150px; }
.tbl td.acts .btns { justify-content: flex-end; }
.dlg-sum { display: grid; gap: 8px; }
.dlg-sum:empty { display: none; }
.dlg-sum .err { margin: 0; }
.stm-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.stm-bar .field { flex: 1 1 170px; max-width: 260px; }
.stm tr.sec td { padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-bottom: 0; }
.stm tr.sub td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.stm tbody tr:hover { background: transparent; }
.stm-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; }
.stm-check .ic { flex: none; margin-top: 3px; }
.stm-check.ok { background: var(--pos-bg); color: var(--pos); }
.stm-check.bad { background: var(--neg-bg); color: var(--neg); }
.stm-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 13px; }
.stm-note .ic { flex: none; margin-top: 3px; }
/* ===== year-end, the first step: the day the financial year starts, beside the two profit lines of the balance sheet ===== */
.stm .ye-since { font-size: 12px; font-weight: 400; margin-inline-start: 4px; }
.stm-note.ye-note { margin-top: 6px; }
/* ===== end year-end, the first step ===== */

/* ---------- ledger, journal, opening balances, chart of accounts ---------- */
.lk { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent-ink); text-align: start; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; cursor: pointer; }
.lk:hover { text-decoration-color: currentColor; }
.lk .ic { vertical-align: -2px; transition: transform .15s; }
.lk[aria-expanded='false'] .ic { transform: rotate(-90deg); }
html[dir='rtl'] .lk[aria-expanded='false'] .ic { transform: rotate(90deg); }
.stm-bar .field.wide { flex: 2 1 260px; max-width: 380px; }
.dlg.wide { width: min(900px, calc(100vw - 24px)); }
.tbl.led { min-width: 840px; }
.tbl.led td { vertical-align: top; }
.tbl tr.is-click { cursor: pointer; }
.tbl tr.led-sum td { background: var(--surface-2); font-weight: 600; border-bottom: 0; }
.tbl.led tfoot tr + tr td { border-top: 0; padding-top: 4px; }
.tbl.jrn td { vertical-align: top; }
.tbl.jrn tr.jrn-lines > td { background: var(--surface-2); padding: 4px 14px 16px; }
.jrn-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tbl.coa td small { margin-top: 2px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; }
.kv > div { min-width: 0; }
.kv dt { font-size: 12.5px; color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv dd small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.op-help { display: grid; gap: 8px; padding: 14px 18px; margin-bottom: 16px; border-radius: var(--radius-md); background: var(--accent-soft); }
.op-help ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 4px; }
#opDone:not(:empty) { margin-bottom: 14px; }
#opDone:focus-visible { outline: none; } /* focus moves here after a post so the result is read; it is not a control */
#opDone .stm-check { margin-top: 0; }

/* opening records: a table of rows to type or import; every cell holds one or more controls */
.rec-h { font-size: 15px; font-weight: 600; margin: 4px 0 10px; }
.rec-batch { display: grid; gap: 2px; margin: 8px 0 4px; }
.rec-batch:empty { display: none; }
.rec-imp { display: grid; gap: 12px; padding: 14px 16px; margin: 16px 0; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
.rec-imp h3 { font-size: 15px; font-weight: 600; }
.rec-imp textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.rec-imp textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rec-imp input[type='file'] { width: 100%; font: inherit; color: var(--ink); }
.rec-imp .btns { margin-top: 2px; }
.tbl.rec-tbl { width: max-content; min-width: 100%; }
.rec-tbl th, .rec-tbl td { padding: 8px; vertical-align: top; }
.rec-tbl th { position: relative; } /* the hidden label of the remove column (.ln-l) is placed from its own cell, so the scrolling grid clips it: from the page it sat beyond the right edge of a wide grid and made the whole page scroll sideways on a phone */
.rec-tbl tbody th.rec-n { background: transparent; border-radius: 0; text-align: end; color: var(--ink-3); font-weight: 600; padding-inline-end: 4px; }
.rec-tbl select, .rec-tbl input { min-height: 38px; padding: 4px 10px; font-size: 14px; }
.rec-tbl select { padding-inline-end: 30px; }
.rec-tbl .dt { min-width: 126px; }
.rec-tbl .dt .dt-in { padding: 4px 34px 4px 10px; }
html[dir='rtl'] .rec-tbl .dt .dt-in { padding: 4px 10px 4px 34px; }
.rec-tbl .dt-cal { width: 28px; height: 28px; right: 3px; }
html[dir='rtl'] .rec-tbl .dt-cal { right: auto; left: 3px; }
.rec-c { display: grid; gap: 4px; }
.rec-l { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.rec-tbl td.w-s { min-width: 96px; }
.rec-tbl td.w-m { min-width: 132px; }
.rec-tbl td.w-l { min-width: 190px; }
.rec-tbl tr.is-bad th, .rec-tbl tr.is-bad td { background: var(--neg-bg); }
.rec-note small.err { color: var(--neg); white-space: normal; }
.hint.err { color: var(--neg); }
.hint.warn { color: var(--warn); font-weight: 500; }
.rec-set { border: 0; margin: 0; padding: 0; min-width: 0; display: block; }
.rec-set:disabled { opacity: .75; }
.rec-f { display: grid; gap: 4px; }
.rec-f[hidden] { display: none; }
#recInfo:focus-visible { outline: none; } /* focus moves here after a file was read, so the result is announced; it is not a control */
.ln-add + .dlg-sum, #recGrid + .dlg-sum { margin-top: 14px; }

/* the lines of a journal: a row of controls per line, a card per line on narrow screens */
.ln-wrap { display: grid; gap: 10px; }
.ln-wrap .dlg-sec { border-top: 0; padding-top: 4px; }
.ln-grid { display: grid; gap: 10px; container-type: inline-size; }
.ln-h, .ln-r { display: grid; grid-template-columns: minmax(0, 2.4fr) 112px 132px 92px 112px 38px; gap: 8px; align-items: start; }
.ln-h { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding-inline: 2px; }
.ln-r .field { gap: 4px; min-width: 0; }
.ln-r select, .ln-r input { padding-inline: 10px; }
.ln-r select { padding-inline-end: 30px; }
.ln-a { gap: 6px; }
.ln-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ln-x { display: grid; place-items: center; min-height: 44px; }
.ln-add { justify-self: start; }
@container (max-width: 720px) {
  .ln-h { display: none; }
  .ln-r { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
  .ln-r .ln-a { grid-column: 1 / -1; }
  .ln-l { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; font-size: 13px; font-weight: 600; color: var(--ink-2); }
  .ln-x { grid-column: 1 / -1; justify-self: end; min-height: 0; }
}

/* documents: the register, the numbered papers, the number series */
.filters.doc-kinds { margin-inline-start: 0; }
.filters button .cnt { margin-inline-start: 4px; font-weight: 600; opacity: .85; }
.stm-bar .field.find { flex: 1.4 1 300px; max-width: 420px; }
.doc-find { display: flex; gap: 8px; align-items: stretch; }
.doc-find input { flex: 1 1 auto; min-width: 0; }
.doc-find .btn { flex: none; min-height: 44px; }
/* the three tables fit a laptop (an 817px card at 1280px): no fixed minimum, closer cells, the text cells give way first, the buttons wrap */
.tbl.docs, .tbl.docp, .tbl.docs-ser { min-width: 0; }
.tbl.docs th, .tbl.docs td, .tbl.docp th, .tbl.docp td, .tbl.docs-ser th, .tbl.docs-ser td { padding-inline: 10px; }
.tbl.docs td, .tbl.docp td, .tbl.docs-ser td { vertical-align: top; }
.tbl td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 90px; max-width: 340px; }
.tbl td.tt { min-width: 130px; max-width: 380px; }
.tbl.docs-ser .chips { flex-direction: column; align-items: flex-start; } /* the two status chips one above the other: they would take the width of both */
.tbl.docp td.acts, .tbl.docs-ser td.acts { min-width: 0; }
.tbl.docp td.acts .btns { flex-direction: column; align-items: flex-end; max-width: 150px; margin-inline-start: auto; }
.tbl.docp td.acts .btn { white-space: normal; text-align: center; border-radius: 16px; line-height: 1.3; padding: 5px 14px; }
.tbl.docp td.acts .btn .ic { display: none; } /* the words say it; the icon would take a line of the narrow button */
.tbl.docs-ser td.acts .btn { white-space: normal; padding-inline: 12px; }
.doc-cap { margin-top: 10px; font-size: 13.5px; text-align: center; }
.tbl .doc-last { font-size: 13.5px; }
.tbl tr.hit td { background: var(--accent-soft); }
.tbl tr[tabindex='-1']:focus { outline: none; }
#regBody:focus, #papBody:focus { outline: none; }
.field textarea { width: 100%; padding: 10px 14px; min-height: 84px; border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field textarea[aria-invalid='true'] { border-color: var(--neg); }
.field textarea[aria-invalid='true']:focus { box-shadow: 0 0 0 4px var(--neg-bg); }
.field input[type='file'] { width: 100%; padding: 8px; border: 1px dashed var(--edge); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: inherit; } /* the file box of a form (openForm type file: the PDF of a new vault document) */
.field input[type='file']::file-selector-button { margin-inline-end: 10px; padding: 5px 14px; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; } /* the app's button, not the browser's grey one */
.field input[type='file'][aria-invalid='true'] { border-color: var(--neg); }
textarea:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 700px) {
  #docPanel .stm-bar .field, #docPanel .stm-bar .field.wide, #docPanel .stm-bar .field.find { flex: 1 1 100%; max-width: none; }
}

/* agency contracts: the page "Contract list" (rent and sell tabs, one table, a window for one contract) */
.seg.tabs button .cnt { margin-inline-start: 6px; font-weight: 600; opacity: .85; }
.tbl.agy { min-width: 0; }
.tbl.agy th, .tbl.agy td { padding-inline: 10px; vertical-align: top; }
.tbl.agy td.acts { min-width: 216px; }
.tbl.agy td.acts .btn.sm { padding-inline: 12px; }
.tbl.agy td.acts .btns { justify-content: flex-end; max-width: 230px; margin-inline-start: auto; }
.tbl.agy td.acts .btn .ic { display: none; } /* the words say it; the icons would widen the buttons of a narrow column */
.tbl.agy td.acts .btn.bad { white-space: normal; line-height: 1.3; }
.agy-print { display: inline-flex; align-items: center; gap: 4px; }
.agy-print select { min-height: 34px; padding: 2px 24px 2px 10px; font-size: 13px; border-radius: 999px; background-position: right 8px center; background-size: 10px; }
html[dir='rtl'] .agy-print select { padding: 2px 10px 2px 24px; background-position: left 8px center; }
.dlg-f .agy-print select { min-height: 46px; padding: 6px 30px 6px 14px; font-size: 15px; }
html[dir='rtl'] .dlg-f .agy-print select { padding: 6px 14px 6px 30px; }
.agy-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
#agyBody:focus { outline: none; }
.agy-sr { display: inline-block; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; vertical-align: top; } /* read by screen readers only; not positioned, so it cannot widen the page from inside the scrolling table */
@media (max-width: 700px) {
  #agyPanel .stm-bar .field, #agyPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
}

/* the books check card (Controls page) */
.chk-sum { font-weight: 600; margin: 0 0 8px; }
.chk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chk-items { margin: 6px 0 0; padding-inline-start: 22px; font-size: 13.5px; display: grid; gap: 4px; overflow-wrap: anywhere; }

/* ---------- toast ---------- */
.toast { position: fixed; inset-inline: 0; bottom: 28px; margin-inline: auto; width: max-content; max-width: min(92vw, 520px); background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 999px; font-weight: 500; z-index: 250; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
/* while a form window is open the message is a popover in the top layer, above the window and its backdrop (app.js toastOnTop): the browser's own popover
   look (centred on the screen, a border) is put back to the box above; .toast.err below keeps its marked edge */
.toast[popover] { inset-block-start: auto; border: 0; overflow: visible; }
/* phone (live check of the messages fix): a message shown over an open form window sits at the top of the screen, so it never lies on the
   form's Save and Cancel at the bottom; with no window open it stays the plain box at the bottom */
@media (max-width: 700px) {
  .toast[popover] { inset-block-start: max(12px, env(safe-area-inset-top)); inset-block-end: auto; transform: translateY(-12px); }
  .toast[popover].show { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1480px) {
  .profile .meta { display: none; }
  .grid2.wide { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .top { flex-wrap: wrap; }
  .scope-wrap { flex: 1; }
  .controls { width: 100%; margin: 0; justify-content: flex-end; }
}
@media (max-width: 1280px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :first-child { grid-column: 1 / -1; }
  .ctl-l { display: none; }
}
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.hero { grid-column: 1 / -1; }
  .grid2, .grid2.even, .grid2.wide { grid-template-columns: 1fr; }
  .ct-layout { grid-template-columns: 1fr; }
  .ct-layout .form-card { position: static; max-height: none; }
}
@media (max-width: 920px) {
  body { padding: 0; }
  .app { grid-template-columns: 1fr; border-radius: 0; padding: 10px; gap: 10px; box-shadow: none; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(310px, 88vw); height: 100vh; height: 100dvh; border-radius: 0 24px 24px 0; transform: translateX(-105%); visibility: hidden; transition: transform .25s, visibility 0s .25s; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  html[dir='rtl'] .side { border-radius: 24px 0 0 24px; transform: translateX(105%); }
  body.nav-open .side { transform: none; visibility: visible; transition: transform .25s, visibility 0s; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .top { top: 10px; padding: 8px 10px; }
  .stage { padding: 18px 14px 10px; }
  .main { gap: 10px; }
  h1 { font-size: 28px; }
  .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.hero { grid-column: 1 / -1; }
  .row3 { grid-template-columns: 1fr; }
  .form.cols { grid-template-columns: 1fr; }
  .sigs { grid-template-columns: 1fr; }
  .top { height: auto; flex-wrap: wrap; gap: 8px; }
  .menu-btn { order: 1; }
  .scope-wrap { order: 2; flex: 1; }
  .controls { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
  .seg button { padding: 4px 7px; font-size: 12px; min-height: 32px; }
  .icon-btn { width: 40px; height: 40px; }
  .profile .meta { display: none; }
}
@media (max-width: 440px) { .kpis { grid-template-columns: 1fr; } }

/* ---------- S2 (property and phones): the Add property window in three columns, the "i" tip, the address and note in the property list, the Phone numbers page ---------- */
/* openForm({wide: true, cols: 3}): the whole Add property form is on one screen at 1366x650 and on a tablet, so the spacing is tighter than in the other windows.
   Only the block padding is changed here: the side padding stays the one of .dlg-b / .dlg-h / .dlg-f (and their phone rule). A phone may scroll. */
.dlg-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.dlg-grid.c3 .field.full { grid-column: 1 / -1; }
.dlg.dlg-c3 .dlg-h { padding-block: 14px 2px; }
.dlg.dlg-c3 .dlg-h h2 { font-size: 18px; }
.dlg.dlg-c3 .icon-btn.sm { width: 34px; height: 34px; }
.dlg.dlg-c3 .dlg-b { padding-block: 6px 10px; gap: 10px; }
.dlg.dlg-c3 .dlg-f { padding-block: 10px 14px; }
.dlg.dlg-c3 .dlg-f .btn { min-height: 42px; }
.dlg.dlg-c3 .field { gap: 4px; }
.dlg.dlg-c3 .field > label, .dlg.dlg-c3 .lbl-tip > label { line-height: 1.3; }
.dlg.dlg-c3 select, .dlg.dlg-c3 input[type='text'], .dlg.dlg-c3 input[type='number'] { min-height: 40px; padding-block: 5px; }
.dlg.dlg-c3 .field textarea { min-height: 54px; height: 54px; padding-block: 7px; }
/* dir="auto" reads an empty box as left to right: on an Arabic or Kurdish screen the example words of the address and the note would sit on the left with their full stop in front */
html[dir='rtl'] #f_address:placeholder-shown, html[dir='rtl'] #f_note:placeholder-shown { direction: rtl; text-align: right; }
@media (max-width: 640px) { .dlg-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .dlg-grid.c3 { grid-template-columns: 1fr; }
  .dlg.dlg-c3 select, .dlg.dlg-c3 input[type='text'], .dlg.dlg-c3 input[type='number'] { min-height: 44px; }
  .dlg.dlg-c3 .field textarea { min-height: 72px; height: 72px; }
}
/* f.tip: a small "i" beside a label; its words show on hover, keyboard focus and tap (.open) and stay in the page for a screen reader */
.lbl-tip { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.lbl-tip > label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.tip { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: help; }
.tip:hover, .tip:focus-visible, .lbl-tip.open .tip { background: var(--accent-soft); color: var(--accent-ink); }
.tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tip-t { display: none; position: absolute; inset-inline: 0; top: calc(100% + 2px); z-index: 6; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 400; line-height: 1.45; box-shadow: var(--shadow-md); pointer-events: none; }
.tip:hover + .tip-t, .tip:focus-visible + .tip-t, .lbl-tip.open .tip-t { display: block; }
/* the address (it wraps) and the folded internal note under the name of a property */
.tbl .pr-addr { white-space: normal; overflow-wrap: anywhere; color: var(--ink-2); max-width: 40ch; }
.tbl .pr-addr.none { color: var(--ink-3); }
.pr-note { margin-top: 3px; font-size: 12.5px; }
.pr-note summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; color: var(--accent-ink); font-weight: 500; border-radius: 6px; }
.pr-note summary::-webkit-details-marker { display: none; }
.pr-note summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-note p { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 36ch; }
/* the Phone numbers page: five columns; on a phone the source and the branch move under the customer and the invoice, and the table needs no sideways scrolling */
#phBody:focus { outline: none; }
.ph-hint { display: block; margin-top: 6px; }
.ph-hint.warn { color: var(--warn); }
.ph-tel { display: inline-block; padding-block: 6px; color: var(--accent-ink); font-weight: 600; direction: ltr; unicode-bidi: isolate; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.ph-tel:hover { text-decoration-color: currentColor; }
.ph-tbl { min-width: 560px; }
.ph-tbl .ph-m { display: none; }
@media (max-width: 700px) {
  .ph-bar .field, .ph-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .ph-tbl { min-width: 0; }
  .ph-tbl .ph-d { display: none; }
  .ph-tbl small.ph-m { display: block; }
  .ph-tbl a.ph-m { display: block; padding-block: 4px; }
  .ph-tbl td, .ph-tbl th { padding-inline: 8px; }
}

/* the Log page (S5): the filters wrap, the changed columns are small chips, the table scrolls sideways inside its own box on a phone */
#alogBody:focus { outline: none; }
.alog-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-bottom: 16px; }
.alog-bar .field { min-width: 0; max-width: none; }
.alog-bar select { width: 100%; }
.alog-bar + .ct-tools { justify-content: space-between; gap: 10px 16px; }
.alog-bar + .ct-tools small { flex: 1 1 280px; max-width: 78ch; }
.alog-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 34ch; }
.alog-tbl { min-width: 720px; }
.alog-tbl td small { display: block; color: var(--ink-3); }
.alog-more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- S3: the report bar (time selector, Export menu), the "as of today" label and the change labels of the dashboard ---------- */
/* .rb is one bar at the top of a page or of a tab: the period (a select, a month list or two date boxes), the range it stands for in words, the Export menu.
   It stands alone on a page and sits inside the card of a tab; it wraps on a phone and uses logical properties only, so right-to-left mirrors by itself. */
.rb { position: relative; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card > .rb { background: var(--surface-2); box-shadow: none; }
.rb.rb-solo, .card > .rb.rb-solo { padding: 0; background: none; border: 0; box-shadow: none; } /* a bar with no period is just its buttons, at the end of the line */
.rb.rb-solo { margin-bottom: 12px; }
.rb .btn[aria-disabled='true'] { opacity: .65; cursor: progress; }
.rb-p { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; min-width: 0; }
.rb .field { min-width: 0; }
.rb select { width: auto; max-width: 100%; min-height: 44px; }
.rb-m[hidden], .rb-custom[hidden], .rb-bad[hidden], .rb-menu[hidden] { display: none; }
.rb-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; min-width: 0; }
.rb-custom .field { flex: 0 1 158px; min-width: 150px; }
.rb-custom .btn { min-height: 44px; }
.rb-range { align-self: flex-end; margin: 0; padding-block: 11px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.rb-bad { flex: 1 1 100%; margin: 0; }
.rb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-inline-start: auto; }
.rb-tools .btn { min-height: 44px; }
.rb-x { position: relative; display: inline-flex; }
.rb-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; display: grid; gap: 2px; min-width: 230px; max-width: min(340px, 86vw); padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); }
.rb-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-align: start; }
.rb-menu button:hover, .rb-menu button:focus-visible { background: var(--surface-2); color: var(--ink); }
.rb-menu button .ic { flex: none; color: var(--ink-3); }
.rb-menu .rb-mh { margin: 0; padding: 8px 12px 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rb-menu hr { height: 0; margin: 4px 6px; border: 0; border-top: 1px solid var(--line); }
/* the change against the period before: a neutral label when there is nothing to divide by; "As of today" on the figures the period does not move */
.dl.neu { color: var(--ink-3); background: var(--surface-2); }
.kpi.hero .dl.neu { background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .92); }
.asof { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.kpi.hero .asof { background: rgba(255, 255, 255, .18); color: #fff; }
.card-h .asof { margin-inline-start: 2px; }
@media (max-width: 700px) {
  .rb { gap: 10px; padding: 12px; }
  .rb-p, .rb-custom, .rb-tools { flex: 1 1 100%; }
  .rb-p .field { flex: 1 1 150px; }
  .rb-p select { width: 100%; }
  .rb-custom .field { flex: 1 1 140px; }
  .rb-range { flex: 1 1 100%; align-self: auto; padding-block: 0; }
  .rb-tools { margin-inline-start: 0; justify-content: flex-end; }
}
/* the calendar button of a date box in the bar: a hit area of 42 px (not the 36 px of the other forms) where a finger is used */
@media (max-width: 700px), (pointer: coarse) {
  .rb .dt-cal { width: 42px; height: 42px; right: 1px; }
  html[dir='rtl'] .rb .dt-cal { right: auto; left: 1px; }
}
@media print { .rb, .rb-menu { display: none !important; } }

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

/* ---------- print: the printed list of requests (the lease paper prints from the server: GET /contracts/leases/{no}/print) ---------- */
@media print {
  /* R1: the list of requests prints alone, with number, wants, kind, place, area, budget and date; never the name or the phone of the client */
  html.printing-wanted body * { visibility: hidden; }
  html.printing-wanted #wantedPrint, html.printing-wanted #wantedPrint * { visibility: visible; }
  html.printing-wanted #wantedPrint { display: block; position: absolute; inset: 0 0 auto 0; padding: 12px; background: #fff; color: #000; }
  html.printing-wanted .wnt-client, html.printing-wanted .lst-ph { display: none !important; }
}

/* ---------- S4 (permissions and roles): the note in the users table where a person cannot be changed from here ---------- */
.tbl.users td.acts .u-locked { display: inline-block; max-width: 200px; white-space: normal; text-align: end; font-size: 12.5px; line-height: 1.4; }
.u-mail { -webkit-user-select: all; user-select: all; } /* a press selects the address alone, not the words of the cells beside it (iPhone needs the -webkit- name) */

/* ---------- S4b (permissions and roles): an ability the role's reach cannot use is shown locked, not ticked ---------- */
.chip.cap-off { position: relative; background: transparent; color: var(--ink-3); border: 1px dashed var(--line); text-decoration: line-through; gap: 4px; }
.chip.cap-off .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chk input:disabled + span { color: var(--ink-3); }

/* ---------- S9: complaints and resignation ---------- */
/* the person who has only the Complaints page gets empty lists: the parts of the frame that need that data are not shown (class set in app.js) */
html.complain-only #scopeWrap, html.complain-only .controls .ctl, html.complain-only #bellBtn, html.complain-only .nav-g { display: none; }
/* text that people typed: line breaks stay, long words wrap */
.cmp-text, .s9-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#cmpOne:focus, #cmpList:focus, #cmpBody:focus, #rsgBody:focus { outline: none; }
/* complaints: the form and my list, the inbox, one complaint with its conversation */
.filters.cmp-status { margin-inline-start: 0; }
.cmp-grid { align-items: start; }
.cmp-form { display: grid; gap: 16px; margin-top: 14px; }
.cmp-form .field textarea { min-height: 150px; }
.cmp-ok { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--pos-bg); color: var(--pos); font-weight: 500; }
.cmp-ok .ic { flex: none; margin-top: 3px; }
.cmp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmp-row { display: grid; gap: 4px; width: 100%; text-align: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cmp-row:hover { background: var(--surface-2); }
.cmp-r1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.cmp-sub { overflow-wrap: anywhere; }
.cmp-r3 { color: var(--ink-3); font-size: 12.5px; }
.tbl.cmp { min-width: 0; }
.tbl.cmp th, .tbl.cmp td { padding-inline: 10px; vertical-align: top; }
.cmp-back { margin-bottom: 14px; }
.cmp-back .ic { transform: scaleX(-1); }
html[dir='rtl'] .cmp-back .ic { transform: none; }
.cmp-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; }
.cmp-head h2 { font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cmp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.cmp-stsel { min-width: 180px; }
.cmp-from, .cmp-note { margin-top: 12px; }
.cmp-body { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cmp-h { font-size: 15px; font-weight: 600; margin: 22px 0 10px; color: var(--ink-2); }
.cmp-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cmp-msg { max-width: 760px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cmp-msg.hr { background: var(--accent-soft); border-color: transparent; }
.cmp-mh { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cmp-mh small { color: var(--ink-3); font-size: 12.5px; }
.cmp-reply { max-width: 760px; margin-top: 18px; }
.cmp-closed { margin-top: 16px; }
@media (max-width: 700px) { #cmpPanel .stm-bar .field, #cmpPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; } }
/* resignations: one card for each */
.rsg-list { display: grid; gap: 14px; }
.rsg { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.rsg-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rsg-who { flex: 1 1 200px; min-width: 0; }
.rsg-who h3 { font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.rsg-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rsg-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.rsg-dl dt { font-size: 12.5px; color: var(--ink-3); }
.rsg-dl dd { margin: 0; font-weight: 500; }
.rsg-note, .rsg-sn { color: var(--ink-2); }
.rsg-sn { display: block; font-size: 12.5px; }
.rsg-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rsg-steps li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.rsg-steps li .ic { flex: none; margin-top: 3px; }
.rsg-steps li.done .ic { color: var(--pos); }
.rsg-steps li.wait { color: var(--ink-3); }
.rsg-closed { display: grid; gap: 2px; }
.rsg-closed.bad > span { color: var(--neg); font-weight: 500; }
.rsg-closed small { color: var(--ink-2); font-size: 12.5px; }
.rsg-chk small { display: block; margin-bottom: 4px; color: var(--ink-3); }
.rsg-acts { padding-top: 4px; }
/* ---------- S6: approvals, limits and contract approval ---------- */
/* the strip on the payments page that leads to the person's own requests */
.s6-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 16px; border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn); font-weight: 600; min-height: 46px; }
.s6-strip > span:nth-child(2) { flex: 1; min-width: 0; }
.s6-strip:hover { filter: brightness(.97); }
/* who approved a payment or a contract, and the reason of a rejection */
.tbl small.s6-appr { display: flex; align-items: flex-start; gap: 5px; color: var(--pos); white-space: normal; max-width: 26ch; }
.tbl td.r small.s6-appr { margin-inline-start: auto; justify-content: flex-end; text-align: end; }
.s6-appr .ic { flex: none; margin-top: 3px; }
.tbl small.s6-why { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* one line in a list; the whole reason is in its title and on the Approvals page */
@media (max-width: 920px) { .tbl small.s6-why { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; } } /* item 5: a phone or a tablet shows no hover title: the whole reason wraps under the chip */
/* the Approvals page: a money request (tier and direction) and the line of a payment that is already booked */
.s6-tier { margin-top: 6px; }
.tbl small.s6-booked { display: flex; align-items: flex-start; gap: 5px; margin-top: 6px; white-space: normal; max-width: 32ch; color: var(--warn); }
.s6-booked .ic { flex: none; margin-top: 3px; }
/* contracts waiting for approval */
.s6-cts { list-style: none; padding: 0; display: grid; gap: 10px; }
.s6-ct { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 8px 18px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.s6-ct p { margin: 0 0 4px; }
.s6-ct small { display: block; color: var(--ink-3); font-size: 12.5px; }
.s6-ct-who { font-weight: 500; overflow-wrap: anywhere; }
.s6-ct-side { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.s6-ct .btns { justify-content: flex-end; }
/* the Limits page */
.s6-note { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); }
.s6-note .ic { flex: none; margin-top: 3px; color: var(--accent); }
.s6-limh { margin: -6px 0 12px; font-size: 13.5px; }
.s6-none { padding: 4px 0 2px; font-size: 14px; }
.s6-lims { list-style: none; padding: 0; display: grid; gap: 10px; }
.s6-lim { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto; gap: 10px 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.s6-lim.is-off .s6-c:not(.s6-cs) { opacity: .65; }
.s6-c { min-width: 0; }
.s6-c small { display: block; color: var(--ink-3); font-size: 12.5px; }
.s6-cap { display: block; font-size: 12px; color: var(--ink-3); }
.s6-lscope b { overflow-wrap: anywhere; }
.s6-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.s6-btns { grid-column: 1 / -1; justify-content: flex-end; }
@media (max-width: 860px) {
  .s6-lim { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s6-lscope { grid-column: 1 / -1; }
  .s6-cs { justify-self: end; }
}
@media (max-width: 700px) {
  .s6-ct { grid-template-columns: 1fr; }
  .s6-ct .btns { justify-content: flex-start; }
  .s6-btns { justify-content: flex-start; }
}
@media (max-width: 440px) {
  .s6-lim { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s6-cs { grid-column: 1 / -1; justify-self: start; }
}
/* ---------- commissions and referrals (S7) ---------- */
/* The page Commissions: two reminder cards, then the list (one card for each commission, laid out by the width of the list, so a phone gets one column), the window
   of one commission, the referral lines of its form and the card under an agency contract. Shared tokens and buttons; right-to-left comes from logical properties. */
#cmBody:focus { outline: none; }
.cm-tot { margin: 0 0 6px; color: var(--ink-2); font-size: 14px; }
.cm-rl { list-style: none; margin: 0; padding: 0; display: grid; }
.cm-rr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.cm-rl > .cm-rr:first-child { border-top: 0; }
.cm-main { min-width: 0; display: grid; justify-items: start; gap: 1px; }
.cm-main small { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.cm-side { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 10px; margin-inline-start: auto; }
.cm-no { padding-block: 4px; }
.cm-grp { padding: 10px 0; border-top: 1px solid var(--line); }
.cm-rl > .cm-grp:first-child { border-top: 0; padding-top: 0; }
.cm-gh { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.cm-gh .who b { overflow-wrap: anywhere; }
.cm-gt { color: var(--ink-2); font-size: 13.5px; }
.cm-grp > .cm-rl { margin-inline-start: 38px; }
.cm-more { margin-top: 10px; }

.cm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; container-type: inline-size; }
.cm-row { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px 18px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.cm-row.is-off { opacity: .7; }
.cm-id, .cm-deal { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.cm-id small, .cm-deal small { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.cm-money { display: grid; gap: 6px; min-width: 0; }
.cm-money > div, .cm-refs-box { display: grid; gap: 1px; min-width: 0; align-content: start; }
.cm-l { color: var(--ink-3); font-size: 12px; line-height: 1.3; }
.cm-refs-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.cm-refs-l li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; overflow-wrap: anywhere; }
.cm-refs-l .cm-l { flex-basis: 100%; }
.cm-acts { display: flex; justify-content: flex-end; }
@container (max-width: 860px) {
  .cm-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-refs-box, .cm-acts { grid-column: 1 / -1; }
}
@container (max-width: 460px) {
  .cm-row { grid-template-columns: minmax(0, 1fr); }
}

/* one commission: who shares it, and the buttons of each share */
.cm-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.cm-ln { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.cm-lines > .cm-ln:first-child { border-top: 0; }
.cm-lw { min-width: 0; display: grid; gap: 1px; }
.cm-lw b { overflow-wrap: anywhere; }
.cm-lw small { color: var(--ink-3); font-size: 12.5px; }
.cm-lr { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; margin-inline-start: auto; }

/* the form: a line for each referral (type, employee or name, amount, remove); two columns in a narrow window */
.cm-rows { display: grid; gap: 10px; container-type: inline-size; }
.cm-r { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px 44px; gap: 8px 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.cm-r .field { gap: 4px; min-width: 0; }
.cm-r select, .cm-r input { padding-inline: 10px; }
.cm-r select { padding-inline-end: 30px; }
.cm-x { display: grid; place-items: center; min-height: 44px; }
.cm-r .icon-btn.sm { width: 44px; height: 44px; }
.cm-add { justify-self: start; }
@container (max-width: 600px) {
  .cm-r { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cm-r .cm-f-type { order: 1; }
  .cm-r .cm-f-amount { order: 2; }
  .cm-r .cm-f-who { order: 3; grid-column: 1 / -1; }
  .cm-r .cm-x { order: 4; grid-column: 1 / -1; justify-self: end; min-height: 0; }
}

/* the card under an agency contract */
.cm-agy-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; }
.cm-agy > div > .btn { margin-top: 8px; } /* the Record button under its sentence (the Open button sits in .cm-agy-row) */

@media (max-width: 700px) {
  .cm-bar .field, .cm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .cm-grp > .cm-rl { margin-inline-start: 0; }
}
/* a finger needs 44px */
@media (pointer: coarse) {
  .cm-no, .cm-more, .cm-add, .cm-agy .btn, .cm-row .btn.sm, .cm-rr .btn.sm, .cm-ln .btn.sm, .cm-agy-row .btn.sm { min-height: 44px; }
}
/* S10 lending: the Lending page (loans, overdue installments, reminders, the loan card) and the new-loan window */
.lend-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.lend-bar .filters { margin-inline-start: 0; }
.lend-note { margin: -4px 0 14px; max-width: 72ch; }
.lend-body:focus, #lendBody:focus { outline: none; }
.lend-backrow { margin-bottom: 14px; }
.chk input.tgl { width: 42px; height: 24px; }
.lend-tot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.lend-t { min-width: 0; padding-inline-start: 12px; border-inline-start: 4px solid var(--c, var(--line-strong)); border-radius: 2px; }
.lend-t.out { --c: var(--pos); }
.lend-t.in { --c: var(--orange); }
.lend-t .lbl { font-size: 13.5px; color: var(--ink-3); }
.lend-t .v { font-size: 20px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.lend-cur { display: block; }
.tbl .lend-cur { white-space: nowrap; }
.lend-tbl { min-width: 760px; }
.lend-tbl td { vertical-align: top; }
.lend-tbl tr.sec td { padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-bottom: 0; }
.lend-tbl tr.jrn-lines > td { background: var(--surface-2); padding: 4px 14px 16px; }
.lend-tbl .ph-tel { padding-block: 2px; white-space: nowrap; }
.lend-h { font-size: 16px; font-weight: 600; margin: 24px 0 10px; }
.lend-acts { margin: 18px 0 4px; gap: 10px; }
.lend-ents { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lend-ents li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.lend-ents li > span { color: var(--ink-3); font-size: 13.5px; min-width: 110px; }
.stm-check.warn { background: var(--warn-bg); color: var(--warn); }
.lend-prev { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); padding: 10px 14px; }
.lend-prev-h { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.lend-prev-b { max-height: 230px; overflow: auto; }
.lend-prev .tbl { background: transparent; }
.lend-prev .tbl td { padding-block: 7px; }
.lend-prev .tbl tfoot td { padding-top: 9px; }
@media (max-width: 700px) {
  #lendPanel .stm-bar .field, #lendPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .lend-tot { grid-template-columns: 1fr; }
  .lend-acts .btn { flex: 1 1 100%; }
}
/* a long preview must never be wider than the window: the grid of the dialog body gives a child its content width unless the child may shrink */
.dlg-b > .dlg-sum, .dlg-sum, .lend-prev { min-width: 0; max-width: 100%; }
.lend-prev-b { max-width: 100%; }
.lend-tbl small.lend-m { display: none; }
@media (max-width: 700px) {
  /* the phone layout of the three tables (as the Phone numbers page): the type and the next installment move under the person, their columns go */
  .lend-tbl { min-width: 0; }
  .lend-tbl .lend-d { display: none; }
  .lend-tbl small.lend-m { display: block; }
  .lend-tbl td, .lend-tbl th { padding-inline: 8px; }
  .lend-tbl td.acts { min-width: 0; }
}
.lend-prev .tbl th, .lend-prev .tbl td { padding-inline: 6px; }
.lend-prev .tbl th { white-space: normal; }
@media (max-width: 520px) { .lend-prev { padding: 8px; } }
@media (max-width: 700px) { .lend-tbl td.wrap { min-width: 0; } }
@media (max-width: 700px) { .lend-tbl td small { white-space: normal; } }
/* ===== R2: People (docs/hr-attendance.md 5.1) ===== */
.r2-left { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--neg); border-radius: var(--radius); background: var(--neg-bg); color: var(--neg); font-size: 14px; font-weight: 600; }
.r2-left .ic { flex: 0 0 auto; }
.stf-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.stf-card output { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; unicode-bidi: isolate; word-break: break-all; }
@media (max-width: 600px) {
  .stf-card .btn { flex: 1 1 100%; justify-content: center; }
}
/* st-staff: the photo and the copies of the ID card in the Edit window (docs/staff-record.md) */
.stf-more-x { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.stf-photo { margin: 0; flex: 0 0 auto; }
.stf-photo img { display: block; width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--soft, transparent); }
.stf-idc { margin: 0; flex: 1 1 200px; min-width: 0; }
/* ===== end R2 People ===== */
/* R2: the leaver checklist after "End employment" */
.r2-check { margin: 12px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; }

/* ---- R3: security forms and tenants ---- */
/* the pages "Security forms" and "Tenants": filters and chips, one table each that becomes a list of cards on a phone; the window of a form, the parts of its form, the owner's switch */
#secBody:focus, #tenBody:focus { outline: none; }
.sec-bar .field { min-width: 0; }
.sec-chips.filters, .ten-chips.filters { margin-inline-start: 0; margin-top: 14px; }
/* the two reminders are red and amber chips among the others: not returned in time, old drafts */
.filters button.sec-late { border-color: var(--neg); color: var(--neg); }
.filters button.sec-late:hover { background: var(--neg-bg); }
.filters button.sec-late[aria-pressed='true'] { background: var(--neg); border-color: var(--neg); color: #fff; }
html[data-theme='dark'] .filters button.sec-late[aria-pressed='true'] { color: #1B0805; }
.filters button.sec-old { border-color: var(--warn); color: var(--warn); }
.filters button.sec-old:hover { background: var(--warn-bg); }
.filters button.sec-old[aria-pressed='true'] { background: var(--warn); border-color: var(--warn); color: #fff; }
html[data-theme='dark'] .filters button.sec-old[aria-pressed='true'] { color: #1B0805; }
.sec-nopr { white-space: normal; line-height: 1.4; padding-block: 2px; }
.ct-tools .sec-nopr + small { flex: 1 1 220px; }
/* the tables: a number, a date and a phone never break; names and places have room to wrap; the actions are a small block of two columns */
.tbl.sec, .tbl.ten { min-width: 0; }
.tbl.sec th, .tbl.sec td, .tbl.ten th, .tbl.ten td { padding-inline: 8px; vertical-align: top; }
.tbl.sec td.nw, .tbl.sec td.sec-no small, .tbl.ten td.nw { white-space: nowrap; }
.tbl.sec td.wrap, .tbl.ten td.wrap { min-width: 84px; overflow-wrap: anywhere; }
.tbl.ten td .btn.sm { white-space: nowrap; }
.tbl.sec td.sec-st { min-width: 112px; }
.sec-nm { font-weight: 600; }
.tbl.sec td small + small, .tbl.ten td small + small { margin-top: 2px; }
.tbl.sec .sec-flags:not(:empty) { margin-top: 4px; }
.tbl.sec td.sec-st > .chip + small, .tbl.sec td.sec-st > small { margin-top: 4px; }
.tbl.sec td.acts { min-width: 0; width: 1%; }
.tbl.sec td.acts .btns { display: grid; grid-template-columns: auto; gap: 4px; justify-content: end; max-width: none; margin-inline-start: auto; }
.tbl.sec td.acts .btn.sm { min-height: 30px; padding: 2px 8px; font-size: 12.5px; white-space: nowrap; text-align: center; justify-content: center; }
.sec-hid { font-size: 12px; font-weight: 400; }
.tbl.sec tr.is-off td.keep { opacity: 1; }
.tbl.ten tr.is-off td.keep, .tbl.ten tr.is-off td.ten-days { opacity: 1; }
.ten-rent { font-size: 13px; }
.ten-form .chip { margin-inline-start: 6px; }
.ten-form .lk { white-space: nowrap; }
.ten-note { margin-top: 12px; font-size: 13px; }
/* a form in a window */
.sec-win .dlg-b { gap: 12px; }
.sec-tabs { justify-self: start; overflow: visible; flex: none; } /* a grid item that scrolls may shrink to nothing when the window is short: this one keeps its height */
.sec-acts { margin: 2px 0 4px; }
.sec-id { direction: ltr; unicode-bidi: isolate; display: inline-block; letter-spacing: .1em; color: var(--ink-2); }
.sec-idv { display: inline-block; direction: ltr; unicode-bidi: isolate; padding: 2px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--f-num); font-weight: 600; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
.sec-idbtn dd { display: grid; gap: 4px; justify-items: start; }
.sec-idbtn small[data-sec-left] { font-weight: 400; }
.sec-blk { order: -1; flex: 1 1 100%; text-align: end; color: var(--warn); font-size: 13px; } /* the hint stands above the buttons of the window, not between them */
.sec-hist td { vertical-align: top; }
.sec-hist .chg { margin-top: 2px; }
/* the form: the previous tenant starts closed; the search of a rent contract sits under its number */
.sec-prev { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
.sec-prev > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 32px; display: list-item; }
.sec-prev[open] > summary { margin-bottom: 12px; }
.sec-prev > .dlg-grid { margin-top: 2px; }
.sec-pick { display: grid; gap: 8px; margin-top: 6px; }
.sec-pick .btns { justify-content: flex-start; }
.sec-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sec-pick-list[hidden] { display: none; }
.sec-pick-list > li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.sec-pick-list > li > div { min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.sec-pick-list > li small { display: block; color: var(--ink-3); font-size: 12.5px; }
.sec-pick-list.big { max-height: 46vh; overflow-y: auto; }
/* Administration: the owner's switch */
.sec-sw { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sec-sw-t { flex: 1 1 320px; min-width: 0; }
.sec-sw-t p { margin: 0 0 6px; }
@media (max-width: 700px) {
  #secPanel .stm-bar .field, #secPanel .stm-bar .field.wide, #tenPanel .stm-bar .field, #tenPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .sec-chips.filters, .ten-chips.filters { gap: 4px; }
  /* the table becomes a list of cards: number and status (or tenant and days left) on the first line, the rest under it with its name; the head stays for a screen reader */
  .tbl.sec thead, .tbl.ten thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl.sec, .tbl.sec tbody, .tbl.ten, .tbl.ten tbody { display: block; width: 100%; }
  .tbl.sec tr, .tbl.ten tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .tbl.sec tbody tr:hover, .tbl.ten tbody tr:hover { background: var(--surface); }
  .tbl.sec td, .tbl.ten td { display: block; grid-column: 1 / -1; min-width: 0; padding: 3px 0; border: 0; text-align: start; white-space: normal; }
  .tbl.sec td.wrap, .tbl.ten td.wrap { min-width: 0; }
  .tbl.sec td.sec-no { grid-column: 1; grid-row: 1; }
  .tbl.sec td.sec-st { grid-column: 2; grid-row: 1; min-width: 0; text-align: end; }
  .tbl.sec td.sec-st .chips { justify-content: flex-end; }
  .tbl.ten td:first-child { grid-column: 1; grid-row: 1; }
  .tbl.ten td.ten-days { grid-column: 2; grid-row: 1; text-align: end; }
  .tbl.sec td[data-l]:not(.sec-no):not(.sec-st)::before, .tbl.ten td[data-l]:not(:first-child):not(.ten-days)::before { content: attr(data-l) ': '; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
  .tbl.sec td.acts { min-width: 0; width: auto; padding-top: 8px; }
  .tbl.sec td.acts .btns { display: flex; flex-wrap: wrap; justify-content: flex-start; margin-inline-start: 0; }
  .tbl.sec td.acts .btn.sm { min-height: 34px; padding-inline: 14px; font-size: 13px; }
  .tbl.ten td.ten-form { padding-top: 6px; }
  .sec-hist { min-width: 0; }
}
/* ---- end R3: security forms and tenants ---- */
/* ===== Mulk A: photos of listings ===== */
.lst-th { position: relative; display: block; width: 64px; height: 48px; margin-bottom: 6px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); }
.lst-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lst-th-n { position: absolute; inset-block-end: 2px; inset-inline-end: 2px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.ph-strip { display: flex; gap: 8px; overflow-x: auto; min-height: 104px; padding-block: 2px 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.ph-tile { flex: 0 0 auto; width: 120px; height: 90px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--accent-soft); cursor: zoom-in; scroll-snap-align: start; }
.ph-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-mgr { display: grid; gap: 10px; grid-column: 1 / -1; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ph-grid > p { grid-column: 1 / -1; margin: 0; }
.ph-t { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ph-t img, .ph-ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--accent-soft); }
.ph-ph { display: grid; place-items: center; color: var(--ink-3); }
.ph-t figcaption { display: flex; justify-content: space-between; gap: 4px; padding: 4px; }
.ph-t .icon-btn.sm { min-width: 34px; min-height: 34px; }
.ph-cover { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; }
.ph-sure { font-size: 12px; padding-inline: 4px; white-space: nowrap; }
.ph-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-arrow { display: inline-block; font-size: 22px; line-height: 1; font-weight: 600; }
/* the arrows are U+2039 and U+203A, which the bidi algorithm mirrors by itself on a right-to-left screen: no flip here (a flip would undo it) */
dialog.ph-light { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; max-height: 100dvh; height: 100dvh; overflow: hidden; }
dialog.ph-light::backdrop { background: rgba(8, 14, 22, .86); }
.ph-light-in { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.ph-light-in img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 6px; background: #fff; }
.ph-light .icon-btn { position: absolute; width: 44px; height: 44px; border-radius: 22px; background: rgba(255, 255, 255, .92); color: #111; }
.ph-x { inset-block-start: 12px; inset-inline-end: 12px; }
.ph-prev { inset-inline-start: 12px; inset-block-start: 50%; transform: translateY(-50%); }
.ph-next { inset-inline-end: 12px; inset-block-start: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .tbl.lst td.lst-no { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
  .tbl.lst td.lst-no .lst-th { grid-row: 1 / span 3; grid-column: 1; width: 72px; height: 54px; margin: 0; }
  .tbl.lst td.lst-no > :not(.lst-th) { grid-column: 2; }
  .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-tile { width: 104px; height: 78px; }
  .ph-strip { min-height: 92px; }
}
/* ===== end Mulk A photos ===== */

/* ===== Mulk D: clients and the showroom ===== */
.cl-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cl-tbl td small { display: block; color: var(--ink-3); max-width: 30ch; overflow-wrap: anywhere; }
/* the login that holds only the capability `showroom`: the office's screen for a visitor. No menu, no scope switch, no money, no title bar: the language switch and the page. */
html.showroom-only .side, html.showroom-only .scrim, html.showroom-only .menu-btn, html.showroom-only #scopeWrap, html.showroom-only .controls .ctl, html.showroom-only #bellBtn,
html.showroom-only #themeBtn, html.showroom-only #userChip, html.showroom-only .page-h, html.showroom-only .nav-g { display: none !important; }
html.showroom-only .app { grid-template-columns: minmax(0, 1fr); border-radius: 0; padding: 10px; }
html.showroom-only .top { justify-content: flex-end; }
.shr { display: grid; gap: 16px; }
.shr-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.shr-h { margin: 0; font-size: 28px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.shr-btn { min-height: 56px; padding-inline: 22px; font-size: 18px; gap: 10px; }
.shr-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.shr-chip { min-height: 52px; padding-inline: 24px; font-size: 17px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.shr-chip[aria-pressed='true'] { background: var(--btn); color: #fff; border-color: var(--btn); }
.shr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.shr-tile, .shr-card { display: flex; flex-direction: column; padding: 0; text-align: start; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; min-height: 56px; }
.shr-tile:active, .shr-card:active { transform: scale(.99); }
.shr-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.shr-nopic { display: grid; place-items: center; color: var(--ink-3); }
.shr-cap { display: grid; gap: 6px; padding: 14px 16px 18px; }
.shr-cap b { font-size: 20px; }
.shr-cap small, .shr-sub { color: var(--ink-3); font-size: 15px; }
.shr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shr-price { font-size: 22px; }
.shr-zones .shr-img { aspect-ratio: 16 / 10; }
.shr-profile { display: grid; gap: 16px; }
.shr-main { position: relative; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.shr-big { display: block; width: 100%; max-height: 70vh; object-fit: contain; aspect-ratio: 16 / 10; background: var(--surface-2); }
/* a property with no photo: the accent's tint, the drawing of its kind and the kind word, in the box of the picture (after .shr-img and .shr-big, whose size it keeps) */
.shr-blank { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; padding: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; text-align: center; }
.shr-blank svg { flex: 0 1 96px; width: 60%; min-height: 0; }
.shr-blank.shr-big svg { flex-basis: 168px; }
.shr-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(15, 23, 34, .62); color: #fff; display: grid; place-items: center; cursor: pointer; }
.shr-nav:disabled { opacity: .3; cursor: default; }
.shr-nav.prev { inset-inline-start: 12px; }
.shr-nav.next { inset-inline-end: 12px; }
html[dir='rtl'] .shr-nav .ic { transform: scaleX(-1); }
.shr-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.shr-th { flex: none; width: 96px; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: none; cursor: pointer; }
.shr-th[aria-pressed='true'] { border-color: var(--btn); }
.shr-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shr-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.shr-fact { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.shr-fact dt { color: var(--ink-3); font-size: 14px; }
.shr-fact dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; }
.shr-desc { margin: 0; font-size: 18px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }
@media (max-width: 700px) {
  .shr-bar { grid-template-columns: 1fr auto; }
  .shr-h { grid-column: 1 / -1; grid-row: 1; font-size: 22px; }
  .shr-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .shr-nav { width: 52px; height: 52px; }
  .cl-act { justify-content: flex-start; }
}
/* from the review: the chips in the dark theme, the way the back arrow points, touch targets on the showroom login, the clients table on a small screen */
.shr-chip:hover { background: var(--surface-2); color: var(--ink); }
.shr-chip[aria-pressed='true']:hover { background: var(--btn); color: #fff; }
html[data-theme='dark'] .shr-chip, html[data-theme='dark'] .shr-chip:hover { color: var(--ink); }
html[data-theme='dark'] .shr-chip[aria-pressed='true']:hover { color: #0A1420; }
html[data-theme='dark'] .shr-chip[aria-pressed='true'] { color: #0A1420; }
.shr-backic { display: inline-block; transform: scaleX(-1); }
html[dir='rtl'] .shr-backic { transform: none; }
html.showroom-only .seg button, html.showroom-only .shr-out { min-height: 44px; min-width: 44px; }
.cl-first { min-width: 220px; }
.cl-first .cl-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: flex-start; }
/* ===== end Mulk D: clients and the showroom ===== */
/* ===== R3b and the money papers (REP-01, UX-04): the print links of a payment or an invoice row ===== */
.ppr-btns { justify-content: flex-end; flex-wrap: nowrap; }
@media (max-width: 700px) { .ppr-btns { flex-wrap: wrap; } }
/* ===== end R3b and the money papers ===== */


/* ===== R5 agency reports and renewals ===== */
/* the page "Agency reports": four tabs, a bar with Filters / CSV / Print, the filters, the tables, the message buttons; the strip on the Overview; the printed report */
#agrBody:focus { outline: none; }
.agr-fbtn { display: none; } /* the button that opens the filters is for a phone */
.agr-filters .stm-bar { margin-bottom: 4px; }
.stm-bar .field.agr-pf { flex: 3 1 460px; max-width: none; min-width: 0; }
.filters.agr-periods, .filters.agr-chips { margin-inline-start: 0; }
.filters.agr-chips { margin-bottom: 14px; }
.agr-range { margin: 0; align-self: end; padding-bottom: 10px; font-size: 13.5px; }
.agr-kinds { margin-bottom: 14px; }
.agr-chiprow { margin-top: 10px; }
.agr-drill { gap: 6px; padding-inline-end: 4px; }
.agr-x { border: 0; background: none; padding: 2px; border-radius: 50%; color: inherit; display: inline-grid; place-items: center; min-width: 22px; min-height: 22px; }
.agr-x:hover { background: var(--line); }
.agr-money { margin: 0 0 12px; font-size: 13.5px; }
.agr-money .ic { vertical-align: -2px; }
.agr-relink { margin: 14px 0 0; }
.agr-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.agr-warn .ic { flex: none; margin-top: 3px; }
.agr-totals { gap: 6px 18px; margin-bottom: 8px; }
.agr-notes { margin: 14px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
/* the tables: the first column is the one that is kept when the table scrolls sideways */
.tbl.agr { min-width: 720px; }
.tbl.agr.agr-end { min-width: 860px; }
.tbl.agr th, .tbl.agr td { padding-inline: 10px; vertical-align: top; }
.tbl.agr th small { font-weight: 400; white-space: normal; }
.tbl.agr td.wrap { min-width: 120px; }
.tbl.agr td.acts { min-width: 150px; }
.tbl.agr td.acts .btns { justify-content: flex-end; max-width: 230px; margin-inline-start: auto; }
.tbl.agr td.acts .btn .ic { display: none; } /* the words say it; the icons would widen a narrow column */
.tbl.agr td.acts .hint { flex: 1 1 100%; text-align: end; white-space: normal; }
.tbl.agr tfoot td { vertical-align: top; }
.agr-c { min-width: 120px; }
.agr-m { font-weight: 500; color: var(--ink-2); }
.agr-th { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 30px; }
.agr-th:hover { color: var(--ink); }
.agr-arr { font-size: 12px; }
.agr-n { border: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 15px; min-width: 40px; min-height: 32px; padding: 2px 10px; border-radius: 999px; }
.agr-n:hover { box-shadow: 0 0 0 2px var(--accent); }
html[data-theme='dark'] .agr-n { color: var(--ink); }
.agr-sel { display: inline-flex; min-height: 0; gap: 0; margin-inline-end: 8px; vertical-align: middle; }
.agr-d .chip { margin-top: 2px; } /* the badge of the first column: one line (the block "labels on one line") */
.agr-who small, .agr-fu small { overflow-wrap: anywhere; }
.agr-btns { margin-top: 6px; gap: 4px; }
.agr-msg { min-height: 30px; padding: 2px 10px; font-size: 12.5px; gap: 5px; }
.agr-msg span { white-space: nowrap; }
.agr-who .agr-btns { flex-wrap: wrap; flex-direction: row; } /* the three buttons of a person sit in one row: icons, the word stays for a screen reader */
.agr-who .agr-msg { padding: 2px 8px; min-width: 34px; justify-content: center; gap: 0; }
.agr-who .agr-msg span { display: inline-block; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; vertical-align: top; } /* not positioned (see .agy-sr): it cannot widen the page from inside the scrolling table */
.agr-note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.agr-looks { color: var(--warn); }
.agr-lnk { min-height: 26px; padding: 0 10px; }
.agr-fu .chip { margin-top: 2px; }
/* the strip on the Overview: the same cards as the finance ones, one row above them */
.kpis.agr-strip { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.kpis.agr-strip.agr-n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* six cards (listings and requests too): three and three */
@media (max-width: 920px) { .kpis.agr-strip.agr-n6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.agr-strip[hidden] { display: none; }
.agr-strip .kpi-h h3 { font-size: 15.5px; }
/* six months, oldest first: in the direction of the page, so on a right-to-left screen the row reads from the right */
.agr-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.agr-bars i { flex: 1 1 0; max-width: 18px; height: var(--h); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--accent-light); }
.agr-bars i:last-child { background: var(--accent); }
/* the printed report: alone on a landscape page of its own name, so the lease sheet and the list of requests print as before */
#reportSheet { display: none; }
@page report { size: A4 landscape; margin: 12mm; }
@media print {
  html.printing-report body > :not(#reportSheet) { display: none !important; }
  html.printing-report #reportSheet { display: block; page: report; color: #000; background: #fff; font-size: 11px; }
  #reportSheet h1 { font-size: 18px; margin: 0 0 2px; }
  #reportSheet h2 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
  #reportSheet p { margin: 0 0 6px; }
  #reportSheet .table-wrap { overflow: visible; margin: 0; padding: 0; }
  #reportSheet .tbl { min-width: 0; width: 100%; font-size: 10.5px; }
  #reportSheet .tbl thead { display: table-header-group; }
  #reportSheet .tbl tr { break-inside: avoid; page-break-inside: avoid; }
  #reportSheet .tbl th, #reportSheet .tbl td { padding: 4px 6px; border-bottom: 1px solid #999; background: none; color: #000; }
  #reportSheet .tbl tfoot td { border-top: 2px solid #000; }
  #reportSheet .tbl small, #reportSheet .agr-note { color: #333; }
  #reportSheet .chip { border: 1px solid #666; background: none; color: #000; padding-inline: 6px; }
  #reportSheet .agr-foot { margin-top: 10px; font-size: 10px; }
}
@media (max-width: 700px) {
  .agr-fbtn { display: inline-flex; }
  .agr-filters { display: none; } /* the filters stack under the one Filters button */
  .agr-filters.is-open { display: block; }
  #agrPanel .stm-bar .field, #agrPanel .stm-bar .field.wide, #agrPanel .stm-bar .field.agr-pf { flex: 1 1 100%; max-width: none; }
  #agrPanel .btn, #agrPanel .btn.sm, .agr-msg, .agr-lnk, .agr-n, .agr-th { min-height: 44px; } /* a thumb-sized target */
  .filters.agr-periods button, .filters.agr-chips button, .agr-kinds button { min-height: 44px; }
  .agr-x { min-width: 32px; min-height: 32px; }
  .tbl.agr th:first-child, .tbl.agr td:first-child { position: sticky; inset-inline-start: 0; z-index: 1; max-width: 150px; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .tbl.agr th:first-child { background: var(--surface-2); z-index: 2; }
  html[dir='rtl'] .tbl.agr th:first-child, html[dir='rtl'] .tbl.agr td:first-child { box-shadow: -1px 0 0 var(--line); }
}
@media (max-width: 440px) { .kpis.agr-strip, .kpis.agr-strip.agr-n6 { grid-template-columns: 1fr; } }
/* ===== end R5 agency reports and renewals ===== */

/* ===== release D1: where the kept part of a deposit goes (end-lease dialog and the approval item) ===== */
.dep-plan { display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.dep-plan .dlg-sec { margin: 8px 0 0; }
.dep-plan .mod-lines { margin: 0; gap: 6px; }
.dep-plan .mod-lines li { justify-content: space-between; align-items: center; }
.dep-plan .hint { display: block; }
.dep-plan .chk { min-width: 0; }
@media (max-width: 480px) { .dep-plan .mod-lines .mod-amt { margin-inline-start: 0; flex-basis: 100%; } }
/* ===== end D1 ===== */

/* ===== Mulk F: employee warnings (docs/employee-warnings.md) ===== */
.staff.wrn-red { border-inline-start: 5px solid var(--neg); }
.staff.wrn-amber { border-inline-start: 5px solid var(--warn); }
.chip.wrn-flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.btn.wrn-btn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.btn.wrn-btn:hover { background: var(--warn-bg); border-color: var(--warn); }
html[data-theme='dark'] .btn.ghost.wrn-btn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
html[data-theme='dark'] .btn.ghost.wrn-btn:hover { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.wrn-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.wrn-n { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.wrn-n b { font-size: 20px; line-height: 1.2; }
.wrn-n span { font-size: 12.5px; color: var(--ink-2); }
.wrn-n.bad { border-color: var(--neg); background: var(--neg-bg); }
.wrn-n.bad b { color: var(--neg); }
.wrn-n.warn { border-color: var(--warn); background: var(--warn-bg); }
.wrn-n.warn b { color: var(--warn); }
.wrn.wrn-off { border-style: dashed; }
.wrn-sum { margin: 0 0 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wrn-prev { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.wrn-prev li.off { color: var(--ink-2); }
.wrn-fine { font-size: 12.5px; }
#wrnBody:focus, #wrnMine:focus { outline: none; }
/* ===== end Mulk F employee warnings ===== */
/* ===== R4: letters and paper templates ===== */
/* the Papers tab (drafts, the number just issued, chips, Print), writing a paper (a full-width section), the window of a paper, the Templates tab (list, read view, editor). Logical properties only: right to left follows */
.pw [hidden], .te [hidden], #docPanel .pw-drafts [hidden] { display: none !important; }
.pw .hint:empty, .tv-prev .hint:empty { display: none; }
.pw-note { margin: 0 0 12px; overflow-wrap: anywhere; }
.pw-note.pw-warn { color: var(--warn); }
.pw-note .btn { margin-inline-start: 6px; }
.pw-sec { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 18px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; min-width: 0; }
.pw-grid .field { min-width: 0; }
.pw-grid .field.full, .pw-grid .full { grid-column: 1 / -1; }
.pw textarea, .te textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; min-width: 0; }
.pw textarea:focus, .te textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pw textarea[aria-invalid='true'], .te textarea[aria-invalid='true'] { border-color: var(--neg); }
.pw-tpl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; overflow-wrap: anywhere; }
.pw-money { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pw-money select { width: auto; }
.pw-cnt { text-align: end; }
.pw-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
/* the list of templates to write from, the list of templates of the tab */
.pw-tlist, .tpl-list, .pw-dlist, .tv-vers, .tv-fields { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pw-tlist > li, .tpl-list > li, .pw-dlist > li, .tv-vers > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.pw-tt, .pw-dt, .tpl-tt, .tv-vers > li > div:first-child { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; display: grid; gap: 4px; }
.tpl-list > li { display: grid; gap: 8px; justify-content: stretch; }
.tpl-list > li .btns, .tv-vers .btns, .pw-dlist .btns { justify-content: flex-end; }
.pw-dt small, .tv-vers small, .tv-fields small { display: block; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
/* the record a template fills from */
.prec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prec-list:empty { display: none; }
.prec-list > li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.prec-list > li > div, .prec-picked > div { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.prec-list small, .prec-picked small { display: block; color: var(--ink-3); font-size: 12.5px; }
.prec-picked { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
/* the Papers tab */
.pw-drafts { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; }
.pw-drafts h3 { font-size: 15px; font-weight: 600; }
.pw-drafts .pw-dlist > li { background: var(--surface); }
.pw-issued { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--pos-bg); color: var(--pos); font-weight: 600; }
.pw-rc { margin-top: 4px; }
.pw-lc { font-family: inherit; font-weight: 500; letter-spacing: 0; }
.pw-priv .ic { flex: none; }
.chk.pw-text, .chk.pw-plain { min-height: 34px; font-size: 13.5px; }
.ct-tools .chk.pw-plain { margin-inline-start: auto; }
.tbl.docp td.acts a.btn { white-space: normal; text-align: center; border-radius: 16px; line-height: 1.3; padding: 5px 14px; }
/* the window of a paper: the frozen text, laid out simply */
.pv-win .dlg-f { align-items: center; }
.pv-doc { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; overflow-wrap: anywhere; min-width: 0; }
.pv-t, .pv-h { text-align: center; font-weight: 700; color: var(--accent-ink); }
.pv-t { font-size: 17px; }
.pv-h { font-size: 15px; margin-top: 4px; }
.pv-line { margin: 0; }
.pv-l { color: var(--ink-3); font-size: 12.5px; }
.pv-p, .pv-c, .pv-li { margin: 0; white-space: pre-line; text-align: justify; }
.pv-n { font-weight: 600; font-family: var(--f-num); }
.pv-li::before { content: '– '; }
.pv-kv { display: grid; gap: 4px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); margin: 0; }
.pv-kv > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; }
.pv-kv dt { color: var(--ink-3); font-size: 12.5px; }
.pv-kv dd { margin: 0; font-weight: 600; }
.pv-sig { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.pv-sig > div { display: grid; gap: 4px; text-align: center; }
.pv-sig small { color: var(--ink-3); }
.pv-sig i { display: block; height: 48px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.pv-sp { height: 12px; }
.pv-br { border: 0; border-top: 2px dashed var(--line-strong); margin: 6px 0; }
.pv-foot { text-align: center; color: var(--ink-3); font-size: 13px; margin: 0; }
/* the Templates tab: the chips of a placeholder, the read view */
.chip.pw-ph { background: var(--accent-soft); color: var(--accent-ink); vertical-align: baseline; }
.tv-chips { margin: 0 0 12px; }
.tv-note, .tv-acts { margin-bottom: 12px; }
.tv-acts { justify-content: flex-start; }
.tv-prev { display: grid; gap: 10px; }
.tv-prev .btns { justify-content: flex-start; }
.tv-langs, .te-langs { margin-bottom: 12px; justify-self: start; }
.tv-doc { display: grid; gap: 8px; min-width: 0; }
.tv-line, .tv-blocks > li { display: grid; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.tv-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tv-t { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.tv-x { white-space: pre-line; overflow-wrap: anywhere; }
.tv-hx { font-weight: 700; }
.tv-kv { display: grid; gap: 4px; margin: 0; }
.tv-kv > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tv-kv dd { margin: 0; }
.tv-sig { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tv-sig > div { display: grid; gap: 2px; overflow-wrap: anywhere; }
.tv-fields > li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.tv-fields .chips { display: inline-flex; margin-inline-start: 6px; vertical-align: middle; }
/* the editor of a draft */
.te { display: grid; gap: 12px; min-width: 0; }
.te .card-h { margin-bottom: 0; }
.te-sec { min-width: 0; }
.te-set { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.te-set > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 32px; display: list-item; }
.te-set[open] > summary { margin-bottom: 12px; }
.te-set .btns { margin-top: 12px; justify-content: flex-start; }
.te-langs button.te-off { opacity: .6; }
.te-lines { margin-bottom: 12px; }
.te-uses { margin: 0; font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.te-uses:empty { display: none; }
.te-ul { font-weight: 600; }
.te-blocks, .te-fields { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.te-b, .te-f { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.te-bh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.te-bh select { flex: 1 1 160px; min-width: 0; }
.te-bn { min-width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.te-mvs { display: flex; gap: 6px; margin-inline-start: auto; }
.te-mv { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.te-mv:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); }
.te-mv:disabled { opacity: .4; cursor: not-allowed; }
.te-kv { display: grid; gap: 8px; }
.te-kvr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.te-kv > .btn, .te-sig > .btn, .te-opts > .btn { justify-self: start; }
.te-sig { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.te-sigc, .te-opt { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.te-sigc legend, .te-opt legend { font-size: 12.5px; color: var(--ink-3); padding: 0 4px; }
.te-opts { display: grid; gap: 8px; }
.te-ol { font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin: 0; }
.te-more { justify-content: flex-start; margin-bottom: 8px; }
/* Insert field and Bold stay at hand at the foot of the screen while the blocks are scrolled */
.te-tools { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 0 -4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.te-tools select { flex: 1 1 200px; min-width: 0; max-width: 100%; }
.te-langx { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; justify-content: space-between; }
.te-copy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.te-copy label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.te-none { display: grid; gap: 10px; }
.te-none .btns { justify-content: flex-start; }
.te-errs, .te-warn { border-radius: 12px; padding: 10px 14px; font-size: 14px; overflow-wrap: anywhere; }
.te-errs { background: var(--neg-bg); color: var(--neg); }
.te-warn { background: var(--warn-bg); color: var(--warn); }
.te-errs ul, .te-warn ul { margin: 6px 0 0; padding-inline-start: 18px; }
.te-errs .lk { color: inherit; text-decoration: underline; }
.te-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.te-dirty { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 700px) {
  #docPanel .stm-bar .field, .pw .stm-bar .field, .pw .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .pw-acts .btn, .te-bar .btn { flex: 1 1 100%; }
  .te-kvr { grid-template-columns: minmax(0, 1fr) auto; }
  .te-kvr > input, .te-kvr > .err { grid-column: 1; }
  .te-kvr > .te-mv { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .pv-kv > div, .tv-kv > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
/* ===== end R4: letters and paper templates ===== */
/* ===== R1 listings and requests ===== */
/* the page "Listings": three tabs, filters, one table that becomes a list of cards on a phone; the windows of a listing and of a request; the panel of the Controls page */
#lstBody:focus, #viewsBody:focus { outline: none; }
.lst-slot { display: contents; }
.lst-bar .field { min-width: 0; }
/* a range (price, area): two boxes and, for the price, the currency; the row wraps inside its field, so nothing sticks out of the card on a phone or in right-to-left */
.stm-bar .field.lst-rangef { flex: 2 1 290px; max-width: 400px; min-width: 0; }
.lst-range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; max-width: 100%; }
.lst-range input { flex: 1 1 90px; min-width: 90px; width: auto; }
.lst-range select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 100%; }
.lst-chips.filters { margin-inline-start: 0; margin-top: 14px; }
.tbl.lst { min-width: 0; }
.tbl.lst th, .tbl.lst td { padding-inline: 8px; vertical-align: top; }
/* at 1366 px with the menu open the whole row fits: a number, an area, a price and a phone never break; the owner has room for its name; the actions are one small column */
.tbl.lst td.lst-no, .tbl.lst td.lst-price, .tbl.lst td.nw, .tbl.lst td.lst-no small, .tbl.lst td.lst-price small { white-space: nowrap; }
.tbl.lst .ph-tel, .tbl.lst .lst-mask, .tbl.lst .lst-show { white-space: nowrap; }
.tbl.lst td.lst-owner { min-width: 150px; }
.tbl.lst td.lst-agent { min-width: 84px; }
.tbl.lst .lst-flags { flex-direction: column; align-items: flex-start; }
.tbl.lst td.acts { min-width: 0; width: 1%; }
.tbl.lst td.acts .btn.sm { min-height: 30px; padding: 2px 10px; font-size: 12.5px; }
.tbl.lst td.acts .btns { flex-direction: column; align-items: stretch; gap: 4px; max-width: none; margin-inline-start: 0; }
.tbl.lst td.acts .btn .ic { display: none; } /* the words say it; the icons would widen the buttons of a narrow column */
.tbl.lst td .chips { margin-top: 4px; }
.tbl.lst td small + small, .tbl.lst td small + .chips { margin-top: 2px; }
.tbl.lst tr.is-off td.keep { opacity: 1; }
.lst-ph { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lst-mask { direction: ltr; unicode-bidi: isolate; color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; }
.lst-ph .ph-tel { white-space: nowrap; } /* a number is never broken in the middle */
.lst-show { min-height: 30px; padding-block: 2px; }
.lst-show .ic { margin-inline-end: 4px; }
.lst-hid { font-size: 12px; font-weight: 400; }
/* a listing or a request in a window */
.lst-win .dlg-b { gap: 12px; }
.lst-win .kv dd .chips { margin-top: 4px; }
.lst-desc { display: grid; gap: 10px; }
.lst-desc .seg.tabs { justify-self: start; }
.lst-desc p { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.lst-desc p[hidden] { display: none; }
.lst-win .dlg-f { align-items: center; }
.lst-blk { flex: 1 1 100%; text-align: end; color: var(--warn); }
.lst-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lst-list > li { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.lst-list > li > div { min-width: 0; overflow-wrap: anywhere; }
.lst-list > li small { display: block; color: var(--ink-3); font-size: 12.5px; }
.lst-m { display: grid; gap: 6px; justify-items: end; min-width: 150px; }
.lst-m .chips { justify-content: flex-end; }
.lst-score { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; margin-inline-end: 8px; }
.lst-score i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--accent); }
.lst-hist { list-style: none; margin: 0; padding: 0; padding-inline-start: 14px; display: grid; gap: 10px; border-inline-start: 2px solid var(--line); }
.lst-hist > li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: start; }
.lst-hist small { display: block; color: var(--ink-3); font-size: 12.5px; }
.lst-hist .flip { display: inline-block; vertical-align: middle; margin-inline: 4px; }
.lst-hd { color: var(--ink-3); font-size: 12.5px; }
.lst-sum { margin: 0; font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lst-dups > li > div { flex: 1 1 220px; }
.lst-views td { vertical-align: top; }
#wantedPrint { display: none; }
#wantedPrint h1 { font-size: 20px; margin: 0 0 4px; }
#wantedPrint p { margin: 0 0 10px; }
#wantedPrint .tbl { min-width: 0; }
#wantedPrint .tbl th, #wantedPrint .tbl td { padding: 6px 8px; border-bottom: 1px solid #999; background: none; color: #000; }
@media (max-width: 700px) {
  #lstPanel .stm-bar .field, #lstPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .lst-chips.filters { gap: 4px; }
  /* the table becomes a list of cards: number and price on the first line, the rest under it with its name; the head stays for a screen reader */
  .tbl.lst thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl.lst, .tbl.lst tbody { display: block; width: 100%; }
  .tbl.lst tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .tbl.lst tbody tr:hover { background: var(--surface); }
  .tbl.lst td { display: block; grid-column: 1 / -1; min-width: 0; padding: 3px 0; border: 0; text-align: start; white-space: normal; }
  .tbl.lst td.lst-no { grid-column: 1; grid-row: 1; }
  .tbl.lst td.lst-price { grid-column: 2; grid-row: 1; text-align: end; font-size: 18px; }
  .tbl.lst td[data-l]:not(.lst-no):not(.lst-price):not(.lst-prop):not(.lst-st)::before { content: attr(data-l) ': '; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
  .tbl.lst td.lst-owner, .tbl.lst td.lst-agent { min-width: 0; }
  .lst-range select { flex: 1 1 100%; } /* the currency on a line of its own under the two boxes */
  .tbl.lst td.acts { min-width: 0; width: auto; padding-top: 8px; }
  .tbl.lst td.acts .btns { flex-direction: row; align-items: center; justify-content: flex-start; max-width: none; margin-inline-start: 0; }
  .tbl.lst td.acts .btn.sm { min-height: 34px; padding-inline: 14px; font-size: 13px; }
  .tbl.lst .lst-flags { flex-direction: row; }
  .lst-hist > li { grid-template-columns: 1fr; gap: 2px; }
  .lst-m { justify-items: start; min-width: 0; }
  .lst-m .chips { justify-content: flex-start; }
  /* the window of a listing or a request on a phone: many buttons stay low, one line each, so the facts keep the screen */
  .lst-win .dlg-f { gap: 6px; padding-block: 10px 14px; }
  .lst-win .dlg-f .btn { flex: 1 1 auto; min-height: 44px; padding: 4px 12px; font-size: 13.5px; white-space: nowrap; }
  .lst-win .dlg-f .btn .ic { display: none; }
}
/* R1b: the note next to Save when the check of a long form fails (it cannot scroll out of sight); on a phone it takes a line of its own above the buttons */
.dlg-f .dlg-fix { margin: 0; margin-inline-end: auto; align-self: center; font-size: 13px; font-weight: 600; color: var(--neg); text-align: start; }
.dlg-f .dlg-fix[hidden] { display: none; }
/* the form of a listing has two "i" beside labels in rows of three: the plain labels of those rows are as tall as the ones with the "i" (24 px), so the boxes line up */
.dlg-grid.c3:has([data-f='placeCkb'] .lbl-tip) .field > label { min-height: 24px; display: flex; align-items: center; }
@media (max-width: 640px) { .dlg-f .dlg-fix { flex: 1 1 100%; margin-inline-end: 0; } }
.lst-prop > b ~ .chip { margin-inline-start: 6px; }
/* ===== end R1 listings and requests ===== */

/* ===== S4c: deals lost, deals and goals archived or cancelled ===== */
.arch-bar { margin-bottom: 8px; }
.arch-sw { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
/* five columns, narrower than the old four so that the Lost column is on screen at 1366 px (180 px each); below that the board scrolls sideways inside its own box, as it did with four */
.kanban { grid-template-columns: repeat(5, minmax(176px, 1fr)); }
.kcol.is-lost { background: transparent; border: 1px dashed var(--line-strong); padding: 11px; }
.deal.is-lost h4, .deal.is-arch h4 { color: var(--ink-2); }
.deal.is-lost, .deal.is-arch { box-shadow: none; }
.deal.is-arch { border-style: dashed; border-inline-start-style: solid; }
.deal-why { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.deal-tags { margin: 2px 0 0; }
.deal .btns.deal-act { justify-content: flex-start; margin-top: 6px; }
.goal-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.goal.is-off { background: var(--surface-2); }
.goal.is-off h3, .goal.is-off .goal-v .big { color: var(--ink-2); }
.goal.is-off .chip { background: var(--surface); }
@media (max-width: 700px) {
  .deal .btns.deal-act .btn.sm, .goal .btns .btn.sm { flex: 1 1 auto; }
}
/* ===== end S4c: deals lost, deals and goals archived or cancelled ===== */

/* ===== departments and recruitment (recruitment.js, docs/recruitment.md) ===== */
.rcr-cv { display: flex; align-items: center; gap: 6px; margin: 4px 2px 12px; font-size: 13px; }
.rcr-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.rcr-tools .field { min-width: 160px; }
.rcr-vh { margin-bottom: 14px; }
.rcr-vh h2 { font-size: 18px; margin-bottom: 4px; }
.kanban.rcr-board { grid-template-columns: repeat(6, minmax(200px, 1fr)); }
.rcr-card .btns.deal-act { flex-wrap: wrap; }
.rcr-notes { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rcr-ivs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.rcr-ivs small { display: block; color: var(--ink-3); overflow-wrap: anywhere; }
.rcr-tbl { min-width: 560px; }
.rcr-rep h3 { font-size: 15px; margin: 18px 0 8px; }
.rcr-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.rcr-kpi { display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); min-width: 160px; }
.rcr-kpi b { font-size: 22px; font-weight: 600; }
.rcr-stagechips { display: flex; flex-wrap: wrap; gap: 6px; }
.rcr-deptf select { min-width: 170px; }
.rcr-sdept { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.rcr-sdept select { flex: 1 1 auto; min-width: 0; }
@media (max-width: 700px) {
  .rcr-tools .field, .rcr-deptf, .rcr-deptf select { width: 100%; }
  .rcr-card .btns.deal-act .btn.sm { flex: 1 1 auto; }
}
/* ===== end departments and recruitment ===== */

/* ===== retail point of sale (public/assets/pos.js, docs/retail-pos.md): the till page and its receipt ===== */
.pos-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pos-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pos-inline input, .pos-inline select, .pos-sale input, .pos-sale select, .pos-top select { max-width: 14em; }
.pos-lines, .pos-docs { width: 100%; border-collapse: collapse; }
.pos-lines td, .pos-lines th, .pos-docs td, .pos-docs th { padding: 4px 6px; text-align: start; border-bottom: 1px solid var(--line); }
.pos-lines input[data-f='qty'] { width: 5em; }
.pos-total { font-size: 1.2em; }
.pos-msg { color: var(--neg); }
.pos-receipt { display: none; }
@media print {
  @page receipt { size: 80mm auto; margin: 4mm; }
  html.printing-receipt body > *:not(#posReceipt) { display: none !important; }
  html.printing-receipt #posReceipt { display: block; page: receipt; width: 72mm; font-size: 9pt; line-height: 1.35; color: #000; }
  #posReceipt h1 { font-size: 12pt; text-align: center; margin: 0 0 2mm; }
  #posReceipt table { width: 100%; border-collapse: collapse; }
  #posReceipt td { padding: 1mm 0; border-bottom: 1px dashed #999; vertical-align: top; }
  #posReceipt td.am { text-align: end; white-space: nowrap; }
  #posReceipt .pr-row { display: flex; justify-content: space-between; margin: 1mm 0; }
  #posReceipt .pr-total { font-weight: 700; font-size: 11pt; border-top: 1px solid #000; padding-top: 1mm; }
  #posReceipt .pr-head, #posReceipt .pr-foot { text-align: center; margin: 1mm 0 2mm; }
}
/* ===== end retail point of sale ===== */
/* ===== MULK E: PDF attachments (docs/attachments.md) ===== */
.att { margin-top: 4px; border-radius: 14px; }
.att.att-drop { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }
.att-in { display: grid; gap: 10px; min-width: 0; }
.att-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
.att-bar .att-kind { min-width: 180px; flex: 1 1 180px; max-width: 320px; }
.att-bar .btn { flex: none; }
.att-hint { font-size: 12.5px; margin: 0; }
.att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.att-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.att-ic { display: inline-grid; place-items: center; color: var(--ink-3); }
.att-t { min-width: 0; overflow-wrap: anywhere; }
.att-t small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink-3); font-size: 12.5px; }
.att-t .att-flag { margin-top: 4px; }
.att-row .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.att-none { padding: 14px 10px; }
.att-open { margin-inline-start: 6px; vertical-align: middle; }
.att-win .att-in { min-height: 120px; }
@media (max-width: 560px) {
  .att-row { grid-template-columns: auto minmax(0, 1fr); }
  .att-row .btns { grid-column: 1 / -1; justify-content: flex-start; }
  .att-bar .att-kind { max-width: none; flex: 1 1 100%; }
  .att-bar .btn { flex: 1 1 100%; }
}
.cl-act .att-open { margin-inline-start: 0; }   /* the action line already has its own gap */
.att-pf-h { display: flex; align-items: center; gap: 6px; }   /* the profile card: the round's heading and its paperclip side by side, the button outside the heading text */
.att-pf-h .att-open { margin-inline-start: 0; }
/* ===== end Mulk E attachments ===== */
/* ===== Mulk B: locked price, Missed, sale approval ===== */
/* the Missed tab of the Listings page (report "Where are we weak" and the list of what was lost), the card of sales waiting for approval on the Approvals page, the line of a sale in the window */
#mkBody:focus, #mkReport:focus { outline: none; }
.mk-h { margin: 22px 0 10px; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.mk-bar { margin-bottom: 4px; }
.mk-stats { margin: 0 0 10px; }
.mk-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; font-size: 13px; }
.mk-note .ic { flex: none; margin-top: 3px; }
.mk-deals { margin: 0 0 6px; }
.tbl.mk-rep-t { min-width: 0; }
.tbl.mk-rep-t th, .tbl.mk-rep-t td { padding-inline: 8px; }
.tbl.mk-rep-t td.mk-sh { white-space: nowrap; }
.tbl.mk-rep-t td.mk-c1 { min-width: 110px; overflow-wrap: anywhere; }
.mk-share { width: 64px; margin-inline-end: 6px; }
.mk-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 640px; }
.mk-reasons li { display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(70px, 2fr) auto; gap: 12px; align-items: center; }
.mk-reasons li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.mk-rbar { display: block; width: 100%; margin: 0; }
.tbl.mk-tbl td.lst-agent { min-width: 84px; }
.mk-sale-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 13.5px; }
.mk-sale-line .ic { flex: none; margin-top: 3px; color: var(--pos); }
.mk-sale-line.mk-wait .ic { color: var(--warn); }
.mk-sales .btns { flex-wrap: wrap; }
@media (max-width: 700px) {
  #lstPanel .mk-bar .field, #lstPanel .mk-bar .field.wide { flex: 1 1 100%; max-width: none; }
  /* the report tables become cards: the place (or the agent) first, then each figure with its name */
  .tbl.mk-rep-t thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl.mk-rep-t, .tbl.mk-rep-t tbody { display: block; width: 100%; }
  .tbl.mk-rep-t tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .tbl.mk-rep-t tbody tr:hover { background: var(--surface); }
  .tbl.mk-rep-t td { display: block; min-width: 0; padding: 3px 0; border: 0; text-align: start; white-space: normal; }
  .tbl.mk-rep-t td.mk-c1 { min-width: 0; font-weight: 600; font-size: 15.5px; }
  .tbl.mk-rep-t td[data-l]:not(.mk-c1)::before { content: attr(data-l) ': '; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
  .tbl.mk-rep-t td.mk-sh { white-space: normal; }
}
@media (max-width: 440px) {
  .mk-reasons li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .mk-reasons li > .mk-rbar { grid-column: 1 / -1; grid-row: 2; }
}
/* ===== end Mulk B: locked price, Missed, sale approval ===== */
/* ===== S8: payroll and expenses ===== */
/* The Salary, Early pay, Bonus and penalty, Targets and Expenses pages (docs/payroll.md, docs/expenses.md) reuse the tables, chips, bars and windows above; only what they add is here.
   Logical properties only, so the pages read the same from right to left. */
.s8-bar .field { flex: 1 1 170px; max-width: 220px; }
.s8-bar .field.wide { flex: 2 1 240px; max-width: 360px; }
.tbl.s8:not(.slim) { min-width: 640px; }
.tbl.s8 td { vertical-align: top; }
.tbl.s8 td.acts { min-width: 124px; }   /* the buttons wrap under each other instead of widening the table past its card */
.tbl.s8 td.acts .btn.sm { padding-inline: 12px; }
.tbl.s8 td.acts .btns { justify-content: flex-end; flex-wrap: wrap; margin-inline-start: auto; }
.tbl.s8 tfoot tr + tr td { border-top: 0; padding-top: 4px; }
.tbl.s8 td.wrap { min-width: 150px; max-width: 360px; }
.tbl.s8 td.wrap bdi { overflow-wrap: anywhere; }
.s8-notes { white-space: normal; overflow-wrap: anywhere; color: var(--ink-2); }
.s8-meter { width: 110px; height: 8px; margin-top: 6px; margin-inline-start: auto; }
/* the steps of a payslip: draft, reviewed, approved, paid */
.s8-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.s8-steps li { padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1.7; background: var(--surface-2); color: var(--ink-3); }
.s8-steps li.done { background: var(--accent-soft); color: var(--accent-ink); }
.s8-steps li.cur { background: var(--btn); color: #fff; font-weight: 600; }
html[data-theme='dark'] .s8-steps li.cur { color: #0A1420; }
.s8-steps li.s8-sep { display: inline-flex; padding: 0; background: none; color: var(--ink-3); }
.s8-who { padding-block: 4px; }
.s8-who small { display: block; font-size: 12.5px; color: var(--ink-3); }
.tbl.s8-lines td { padding-block: 9px; }
.tbl.s8-lines tfoot td { font-size: 16px; }
.s8-skip { margin: 0 0 12px; font-size: 13.5px; }
.s8-skip summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--accent-ink); font-weight: 500; border-radius: 6px; }
.s8-skip summary::-webkit-details-marker { display: none; }
.s8-skip summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.s8-skip ul { margin: 6px 0 0; padding-inline-start: 22px; display: grid; gap: 3px; overflow-wrap: anywhere; }
/* targets: a card per branch, then the findings and the rule table */
.s8-tgt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; margin-top: 14px; }
.s8-tgt { display: grid; gap: 10px; align-content: start; }
.s8-tgt .card-h { margin-bottom: 0; }
.s8-tgt-now { font-weight: 600; }
.s8-rules td { vertical-align: middle; }
.s8-rules input[type='number'], .s8-rules input[data-num-box] { width: 96px; min-height: 38px; padding: 4px 10px; }
.s8-rules select { min-height: 38px; padding-block: 4px; }
/* expenses: the payments of a bill under its row, and the two levels of the categories */
.tbl tr.s8-sub td { padding-block: 8px; background: var(--surface-2); }
.s8-pays { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.s8-pays li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.s8-cats .s8-subcat { padding-inline-start: 24px; }
@media (max-width: 700px) {
  .s8-bar .field, .s8-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .tbl.s8:not(.slim) { min-width: 560px; }
}
/* ===== end S8: payroll and expenses ===== */
/* ===== property maintenance (maintenance.js, docs/property-maintenance.md) ===== */
.mt-pick { max-width: 320px; margin-bottom: 12px; }
.mt-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; align-items: end; margin: 0 0 16px; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; }
.mt-form h3 { grid-column: 1 / -1; margin: 0; font-size: 15px; }
.mt-form .mt-wide { grid-column: 1 / -1; }
.mt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mt-col h3 { font-size: 14px; margin: 0 0 8px; }
.mt-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--surface, #fff); }
.mt-card small { color: var(--muted, #666); }
.mt-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mt-close { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-close input { width: 110px; }
.mt-due { margin-bottom: 12px; }
/* ===== end property maintenance ===== */

/* ===== Mulk C: zones, the property file and its profile ===== */
.pf-top { margin: 0 0 12px; }
.pf-head .pf-sum { margin: 0 0 12px; color: var(--ink-2); }
.pf-nophoto { margin: 0; }
/* the photos of the current round: a strip that scrolls sideways, never wider than its card */
.pf-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; max-width: 100%; }
.pf-photos a { flex: 0 0 auto; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pf-photos img { display: block; height: 140px; width: auto; max-width: 70vw; object-fit: cover; background: var(--surface-2); }
.tbl.pf-rounds tr.is-now td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pf-file-acts { margin-top: 10px; }
.pf-hist > li > div { min-width: 0; overflow-wrap: anywhere; }
.pf-hist .chip { margin-inline-start: 4px; }
.lst-round { white-space: normal; }
a.lst-round { text-decoration: none; }
a.lst-round:hover, a.lst-round:focus-visible { text-decoration: underline; }
.chip.lst-zone { max-inline-size: 100%; margin-inline-end: 6px; }   /* a zone name may be long: it ends in "…" (the block "labels on one line") */
.zn-note { margin: 12px 0 0; }
.tbl.zn td small { white-space: normal; }
@media (max-width: 700px) {
  .pf-photos img { height: 110px; }
  .tbl.pf-rounds tr.is-now { border-color: var(--accent); }
}
/* ===== end Mulk C ===== */
/* ===== One-place entry (inline-create.js) ===== */
.ic-pending { display: grid; gap: 6px; margin-top: 6px; min-width: 0; }
.ic-pending[hidden] { display: none; }
.ic-chip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.ic-btns { display: inline-flex; gap: 14px; flex: none; }
.ic-dup { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }
.ic-dup ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.ic-dup .btn { justify-self: start; }
.field > .lbl-row { width: 100%; }
@media (max-width: 480px) {
  .ic-chip { flex-direction: column; align-items: flex-start; }
}
/* ===== end One-place entry ===== */
/* ===== R6: contacts ===== */
/* the page "Contacts": the bar, the role chips, one table that becomes a list of cards under 768 px; the window of a contact; the phone rows of the form; the Review; the picker of the contract form */
#r6Body:focus, #r6RvBody:focus { outline: none; }
.r6-bar .field { min-width: 0; }
.stm-bar .field.r6-arch { flex: 0 1 auto; }
.r6-rv:empty, .r6-exact:empty { display: none; }
.tbl.r6-tbl { min-width: 0; }
.tbl.r6-tbl th, .tbl.r6-tbl td { padding-inline: 10px; vertical-align: top; }
.r6-first { min-width: 200px; }
.r6-name { padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; font-weight: 600; text-align: start; cursor: pointer; min-height: 32px; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
.r6-name:hover { text-decoration-color: currentColor; }
.r6-tbl td small { display: block; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.r6-tbl td .chips { margin-top: 4px; }
.r6-tbl .ph-tel, .r6-tbl .lst-mask { white-space: nowrap; }
.r6-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-inline-start: 4px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--accent-ink); cursor: pointer; vertical-align: middle; }
.r6-mark:hover { background: var(--surface-2); }
/* the window of a contact */
.r6-win .dlg-b { gap: 12px; }
.r6-other { margin: 0; color: var(--ink-3); overflow-wrap: anywhere; }
.r6-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.r6-phl { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.r6-phl li small { display: inline; margin-inline-start: 8px; }
.r6-h4 { margin: 4px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.r6-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.r6-sugs > li > .r6-card { flex: 1 1 260px; border: 0; padding: 0; }
.r6-ul { margin: 0 0 6px; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 14px; }
.r6-warn { margin: 6px 0 0; font-weight: 600; color: var(--neg); }
/* the form: the numbers, one row each (number, kind, remove) */
.r6-phs { display: grid; gap: 8px; }
.r6-ph { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.r6-ph-x { margin-top: 26px; }
.r6-phadd { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.r6-phadd [hidden] { display: none; }
.r6-phm { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
/* the Review */
.r6-rvh .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.r6-rvh .btns .btn { margin-inline-start: 0; }
.r6-rvp { margin: 0 0 12px; font-size: 13.5px; }
.r6-rvl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.r6-rv { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.r6-rv .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.r6-why { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.r6-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.r6-card { display: grid; gap: 4px; align-content: start; justify-items: start; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.r6-card.is-kept { border-color: var(--pos); box-shadow: inset 0 0 0 1px var(--pos); }
.r6-card small { color: var(--ink-3); font-size: 12.5px; }
/* the picker of the contract form: the list sits under the box (not over the window), the chip of the linked contact under it */
.r6-cb { margin: 4px 0 0; padding: 4px; list-style: none; max-height: 264px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.r6-cb[hidden] { display: none; }
.r6-cb li { display: grid; gap: 2px; min-height: 44px; padding: 8px 10px; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.r6-cb li:hover, .r6-cb li[aria-selected='true'] { background: var(--surface-2); }
.r6-cb li[aria-selected='true'] { box-shadow: inset 0 0 0 2px var(--btn); }
.r6-cb li small { color: var(--ink-3); font-size: 12.5px; }
.r6-cb .r6-cb-none { cursor: default; color: var(--ink-3); }
.r6-cb .r6-cb-new { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent-ink); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.r6-cb .r6-cb-new .ic { flex: none; }
.r6-link { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r6-link:empty { display: none; }
.r6-chip { max-width: 100%; }
.r6-x { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.r6-x:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.r6-off { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r6-off small { flex: 1 1 100%; color: var(--warn); }
.r6-save-f[hidden] { display: none; }
@media (max-width: 767px) {
  #r6Panel .stm-bar .field, #r6Panel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
  /* every row is a card; the head stays for a screen reader */
  .tbl.r6-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl.r6-tbl, .tbl.r6-tbl tbody { display: block; width: 100%; }
  .tbl.r6-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .tbl.r6-tbl tbody tr:hover { background: var(--surface); }
  .tbl.r6-tbl td { display: block; min-width: 0; padding: 3px 0; border: 0; text-align: start; white-space: normal; }
  .tbl.r6-tbl td[data-l]:not(.r6-first)::before { content: attr(data-l) ': '; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
  .r6-first { min-width: 0; }
  /* touch targets of 44 px */
  .r6-name, .r6-tbl .ph-tel { display: inline-flex; align-items: center; min-height: 44px; }
  .r6-mark, .r6-x { width: 44px; height: 44px; }
  #r6Panel .btn.sm, .r6-win .btn.sm, .r6-link .btn.sm, #r6Panel .filters button, #r6Panel .seg button { min-height: 44px; }
  .r6-pair { grid-template-columns: minmax(0, 1fr); }
  .r6-ph { grid-template-columns: minmax(0, 1fr) auto; }
  .r6-ph > .field:first-child { grid-column: 1 / -1; }
  .r6-ph-x { margin-top: 22px; width: 44px; height: 44px; }
}
@media (pointer: coarse) { .r6-mark, .r6-x { width: 44px; height: 44px; } }
/* ===== end R6: contacts ===== */

/* ===== reports pack (reports.js, docs/reports-and-export.md "Reports pack"): six ageing buckets, who owes most, cash and bank today, commission by person ===== */
.aging.ag6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rp-debt { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.rp-debt h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.rp-debt ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rp-debt li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.rp-debt li .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rp-debt li .who > span { display: flex; flex-direction: column; min-width: 0; }
.rp-debt li small { font-size: 12.5px; color: var(--ink-3); }
.rp-debt li .amt { white-space: nowrap; }
.rp-note { margin-top: 10px; font-size: 13px; }
.rp-cash-t tfoot td, .rp-ppl-t tfoot td { border-top: 2px solid var(--line); }
@media (max-width: 1180px) { .aging.ag6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 920px) { .aging.ag6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ===== end reports pack ===== */
/* ===== payments search (M9, docs/payments-search.md) ===== */
#psRoot select, #psRoot input[type='time'] { width: 100%; }
#psRoot input[type='time'] { padding: 8px 14px; min-height: 44px; border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
.ps-bar .field { flex: 1 1 150px; max-width: 210px; }
.ps-bar .field.wide { flex: 2 1 260px; max-width: 380px; }
.stm-bar.fls-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.fls-bar .field { max-width: none; min-width: 0; }
.fls-bar select { width: 100%; }
.fls-bar + [data-act="filesclear"] { margin-top: 12px; }
.fls-bar + [data-act="filesclear"][hidden] { display: none; }
.ps-hint { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 13px; }
.ps-hint .ic { flex: none; margin-top: 2px; }
.ps-at { color: var(--ink-3); }
@media (max-width: 700px) {
  #psRoot .ps-bar .field, #psRoot .ps-bar .field.wide { flex: 1 1 100%; max-width: none; }
}
/* ===== end payments search ===== */
/* ===== attendance ===== */
/* The Attendance page (attendance.js, docs/hr-attendance.md section 9). Classes are atn-* (the att-* names belong to the PDF attachments). Colours come from the tokens of both themes only,
   every status has a letter as well as a colour, and the sides are written with logical properties so right-to-left mirrors by itself. Raw lines use the number font of the page (one font).
   Nothing here widens the page: the month grid scrolls inside its own box, and under 600 px it becomes a list of cards. */
.atn { min-width: 0; }
.atn-bar { margin-bottom: 14px; }
.atn-bar .field { flex: 1 1 160px; max-width: 240px; min-width: 0; }
.atn-bar .field.wide { flex: 2 1 220px; max-width: 340px; }
.atn-bar .field.atn-now { flex: 0 0 auto; align-self: end; }
.atn-bar .field.atn-now .btn { min-height: 44px; }
.atn-bar .atn-btns, .atn-bar2 .atn-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-inline-start: auto; }
.atn-bar .atn-btns .btn { margin-inline-start: 0; }
.atn-bar2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 12px 0 14px; }
.atn-bar2 .filters, .filters.atn-nomargin { margin-inline-start: 0; }
.atn-upd { margin: 0; align-self: center; font-size: 13px; }
.atn-monthnav { display: flex; align-items: center; gap: 6px; }
.atn-monthnav select { width: auto; min-width: 120px; }
.atn-flip { transform: scaleX(-1); }
html[dir='rtl'] .atn-flip { transform: none; }
html[dir='rtl'] .atn-arrow { display: inline-block; transform: scaleX(-1); }
.atn-info { margin: 12px 0 0; font-size: 13px; }
.atn-sub { margin: 4px 0 12px; font-size: 13.5px; }
.atn-link { border: 0; background: none; padding: 2px 0; min-height: 24px; font: inherit; font-weight: 600; text-align: start; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.atn-link:hover { text-decoration-color: currentColor; }
.atn-raw { font-family: var(--f-num); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; tab-size: 4; }
.atn-pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-family: var(--f-num); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; direction: ltr; text-align: start; }
.atn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.atn-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* the colour and the letter of a day (P present, L late, E left early, I incomplete, A absent, V leave, H holiday, R rest, X excused, N not in yet, - not counted) */
.atn-c { position: relative; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; line-height: 1; border-radius: 6px; text-align: center; }
.atn-s-P { background: var(--pos-bg); color: var(--pos); }
.atn-s-L { background: var(--warn-bg); color: var(--warn); }
.atn-s-E { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1.5px currentColor; }
.atn-s-I { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1.5px currentColor; }
.atn-s-A { background: var(--neg-bg); color: var(--neg); }
.atn-s-V { background: var(--accent-soft); color: var(--accent-ink); }
.atn-s-H { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.atn-s-R { background: var(--surface-2); color: var(--ink-3); }
.atn-s-X { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px currentColor; }
.atn-s-N { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.atn-s-na { background: transparent; color: var(--ink-3); }
.atn-c .atn-dot, .atn-cd .atn-dot { position: absolute; top: 3px; inset-inline-end: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.atn-chip { gap: 6px; padding-inline: 4px 10px; }
.chip.atn-chip.mute { background: var(--surface-2); padding-inline: 4px 10px; }
.atn-l { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding-inline: 2px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px currentColor; font-size: 11.5px; font-weight: 700; line-height: 1; }
.atn-fl { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.atn-note { display: inline-flex; color: var(--accent-ink); }
.atn-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-3); }
.atn-legend li { display: inline-flex; align-items: center; gap: 6px; }
.atn-legend .atn-c { width: 20px; height: 20px; font-size: 11px; }

/* Today: the six tiles and the list, problems first */
.atn-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.atn-banner .btn { margin-inline-start: auto; }
.atn-tiles { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; padding: 0; }
.atn-tile { --tone: var(--ink-3); display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); border-inline-start: 4px solid var(--tone); }
.atn-tile.ok { --tone: var(--pos); }
.atn-tile.warn { --tone: var(--warn); }
.atn-tile.bad { --tone: var(--neg); }
.atn-tile.brass { --tone: var(--accent); }
.atn-tile b { font-size: 26px; font-weight: 600; line-height: 1.1; }
.atn-tile span { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.atn-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.atn-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(110px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.atn-row:hover { background: var(--surface-2); }
.atn-main { display: grid; gap: 2px; min-width: 0; }
.atn-main b { font-weight: 600; overflow-wrap: anywhere; }
.atn-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-3); font-size: 12.5px; }
.atn-times { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.atn-st { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; }

/* the month sheet: a grid that scrolls inside its own box (the name column stays), and under 600 px a list of cards */
.atn-gridwrap { max-width: 100%; margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.atn-grid { border-collapse: collapse; font-size: 12px; }
.atn-grid th, .atn-grid td { padding: 0; }
.atn-grid thead th { padding-block: 6px; font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); text-align: center; }
.atn-grid .atn-nm { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 150px; max-width: 220px; padding: 6px 10px; text-align: start; font-weight: 500; background: var(--surface); border-inline-end: 1px solid var(--line); }
.atn-grid thead .atn-nm { z-index: 2; background: var(--surface-2); }
.atn-grid .atn-nm small { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 400; }
.atn-grid td.atn-c { display: table-cell; width: 27px; min-width: 27px; height: 30px; border: 2px solid var(--surface); background-clip: padding-box; vertical-align: middle; }
.atn-grid .atn-d { min-width: 27px; }
.atn-grid .atn-t { min-width: 46px; padding-inline: 6px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; border-inline-start: 1px solid var(--line); }
.atn-grid tbody .atn-t { font-size: 12.5px; }
.atn-cards { display: none; list-style: none; gap: 12px; margin: 12px 0 0; padding: 0; }
.atn-card { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.atn-card-h { display: flex; align-items: center; gap: 10px; }
.atn-card-t { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; }
.atn-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 0; }
.atn-strip .atn-c { width: 20px; height: 22px; font-size: 10.5px; }

/* Punches, unmapped numbers and imports */
.atn-grid2 { align-items: start; margin-top: 0; }
.atn-main-col, .atn-side { min-width: 0; }
.atn-side .card-h h3 { font-size: 16px; font-weight: 600; }
.atn-unl { list-style: none; margin: 0; padding: 0; }
.atn-un { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.atn-un:last-child { border-bottom: 0; }
.atn-un-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.atn-un small { font-size: 12.5px; }
.atn-un .btns { margin-top: 4px; }
.atn-tbl td small { display: block; }
.atn-tbl .atn-why { white-space: normal; max-width: 36ch; overflow-wrap: anywhere; }
.atn-ptbl { min-width: 0; }
.atn-ptbl tr.bad td { background: var(--neg-bg); }
html[data-theme='dark'] .btn.ghost.bad { color: var(--neg); }

/* Machines */
.atn-devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
/* R9: the machines grouped by branch, the ones waiting for approval first */
.atn-devg { display: grid; gap: 10px; margin: 0 0 20px; min-width: 0; }
.atn-devg-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.atn-ds .atn-off-h { display: block; font-size: 12px; color: var(--ink-3); }
.atn-dev { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.atn-dev.pending { border-style: dashed; border-color: var(--warn); }
.atn-dev.off { opacity: .8; }
.atn-dev-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.atn-dev-h h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.atn-ds { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.atn-dev-h .atn-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.atn-dev-h .atn-dot.on { background: var(--pos); }
.atn-dev-h .atn-dot.silent { background: var(--warn); }
.atn-dev-h .atn-dot.off { background: var(--neg); }
.atn-dev-h .atn-dot.file { background: var(--accent); }
.atn-dev-h .atn-dot.never { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); }
.atn-kv { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 14px; }
.atn-kv .full { grid-column: 1 / -1; }
.atn-kv dd { font-weight: 500; }
.atn-kv dd small { display: block; }
.atn-lines summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; border-radius: 6px; }
.atn-lines ul { list-style: none; display: grid; gap: 8px; margin: 8px 0 0; padding: 0; }
.atn-lines li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.atn-lines small { color: var(--ink-3); font-size: 12.5px; }
.atn-conn p { margin: 0 0 8px; }
.atn-conn .dlg-sec { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Setup */
.atn-sec + .atn-sec { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.atn-sec .card-h h3 { margin: 0; font-size: 17px; font-weight: 600; }
.atn-sec .card-h .btn { margin-inline-start: 0; }
.atn-sec .card-h > .btn, .atn-sec .card-h > .btns { margin-inline-start: auto; }
.atn-yearnav { display: inline-flex; align-items: center; gap: 8px; }
.atn-wds { display: inline-flex; gap: 3px; }
.atn-wds i { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font-style: normal; font-size: 11px; line-height: 1.6; text-decoration: line-through; opacity: .7; }
.atn-wds i.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; text-decoration: none; opacity: 1; }
.atn-pick { display: grid; gap: 2px; max-height: 38vh; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.atn-pick[hidden] { display: none; }
.atn-pick .chk { min-height: 36px; }
.atn-pairs { list-style: none; display: grid; gap: 6px; max-height: 40vh; overflow: auto; margin: 0; padding: 0; }
.atn-pairs li { display: flex; align-items: center; gap: 10px; }
html[dir='rtl'] .atn-pairs li > span { display: inline-block; transform: scaleX(-1); }

/* the Employee window and the self view */
.atn-win .dlg-b { gap: 14px; }
.atn-win .dlg-f { align-items: center; }
.atn-ew-h { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.atn-ew-h h3 { margin: 0; font-size: 19px; font-weight: 600; }
.atn-ew-h p { margin: 0; font-size: 13.5px; }
.atn-ew-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 10px; }
html[dir='rtl'] [data-atn='smonth'][data-v='1'] .ic, html[dir='rtl'] [data-atn='pmonth'][data-v='1'] .ic, html[dir='rtl'] [data-atn='hyear'][data-v='1'] .ic { transform: scaleX(-1); }
.atn-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.atn-cal-w { padding-block: 2px; text-align: center; font-size: 12px; color: var(--ink-3); }
.atn-cd { position: relative; display: grid; place-items: center; min-height: 46px; padding: 0; border: 2px solid transparent; border-radius: 10px; font: inherit; cursor: pointer; }
.atn-cd small { position: absolute; top: 3px; inset-inline-start: 5px; font-size: 10.5px; font-weight: 500; opacity: .85; }
.atn-cd b { font-size: 15px; font-weight: 700; }
.atn-cd.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.atn-day { display: grid; gap: 10px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.atn-day-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.atn-day-h h4, .atn-tot h4 { margin: 0; font-size: 16px; font-weight: 600; }
.atn-hol { margin: 0; color: var(--ink-2); }
.atn-corr { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.atn-corr p { margin: 0; overflow-wrap: anywhere; }
.atn-tot { margin-top: 16px; }
.atn-tot h4 { margin-bottom: 8px; }

/* the file import */
.atn-imp { display: grid; gap: 14px; min-width: 0; }
.atn-imp input[type='file'] { width: 100%; padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.atn-imp-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.atn-warns { display: grid; gap: 4px; margin: 0; padding-inline-start: 20px; color: var(--warn); }
.atn-done .dlg-sec { color: var(--pos); }

@media (max-width: 1100px) { .atn-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .atn-row { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 10px 12px; }
  .atn-times, .atn-st { grid-column: 1 / -1; justify-content: flex-start; }
  .atn-bar .field, .atn-bar .field.wide { flex: 1 1 100%; max-width: none; }
  .atn-bar .atn-btns, .atn-bar2 .atn-btns { margin-inline-start: 0; }
  .atn-banner .btn { margin-inline-start: 0; }
  .atn-dev { padding: 14px; }
}
@media (max-width: 600px) {
  .atn-gridwrap { display: none; }
  .atn-cards { display: grid; }
  .atn-cd { min-height: 42px; }
  .atn-cd b { font-size: 14px; }
  .atn-ew-h { gap: 10px; }
}
@media (max-width: 520px) { .atn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .atn-tile b { font-size: 22px; } }
@media print {
  .atn-bar, .atn-bar2, .atn-banner, .atn-btns, .atn-legend { display: none !important; }
  .atn-gridwrap { overflow: visible; border: 0; }
  .atn-cards { display: none; }
}
/* ===== end attendance ===== */

/* the page of one property (property-page.js): its cards stand apart, and a wide table scrolls in its own box instead of widening the page */
.pp-page, .pp-page > #ppPanel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.pp-page > .tabs-bar { margin: 0; }
.pp-page > .card > .btns { margin-top: 12px; }
/* ===== Property units (units.js) ===== */
.pr-units > td { padding: 0; background: var(--surface-2); border-top: 0; }
.un-panel { display: grid; gap: 12px; padding: 14px 16px; }
.un-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.un-roll { color: var(--ink-2); font-size: 13px; }
.un-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.un-floors { display: flex; flex-wrap: wrap; gap: 8px; }
.un-floor { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; }
.un-floor small { color: var(--ink-3); }
.un-x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.un-x:hover, .un-x:focus-visible { color: var(--accent); }
.un-link { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.un-note { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.un-tbl td small { display: block; color: var(--ink-3); }
.un-tag { color: var(--ink-3); }
.un-page { display: grid; gap: 16px; }
.un-page .card-h { gap: 8px; flex-wrap: wrap; }
.un-h3 { margin: 12px 0 6px; font-size: 14px; }
.un-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
@media (max-width: 720px) { .un-panel { padding: 10px; } }
/* ===== end Property units ===== */
/* ===== UX round 2: the Help page (UX-07), the note of a form whose text was put back (UX-13) ===== */
.help-p { margin: 0; line-height: 1.65; color: var(--ink-2); font-size: 14.5px; }
.draft-note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px; }
.toast.err { border-inline-start: 4px solid var(--neg); } /* UX-09: a refusal stays longer and is marked */
/* ===== end UX round 2: the Help page (UX-07), the note of a form whose text was put back (UX-13) ===== */
/* ===== UX round 2: cards for the money tables on a phone (UX-10) ===== */
@media (max-width: 700px) {
  .tbl.cards { min-width: 0; }
  .tbl.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* still read by a screen reader */
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; box-sizing: border-box; }
  .tbl.cards tr { margin: 0 0 10px; padding: 6px 4px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
  .tbl.cards td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 12px; border: 0; text-align: end; overflow-wrap: anywhere; }
  .tbl.cards td[data-th]::before { content: attr(data-th); flex: none; max-width: 45%; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: start; }
  .tbl.cards td:not([data-th]) { justify-content: flex-start; flex-wrap: wrap; gap: 6px; text-align: start; }
  .tbl.cards td:empty { display: none; }
  .tbl.cards .acts, .tbl.cards .cl-act { flex-wrap: wrap; justify-content: flex-start; }
  /* phone check R1 (docs/phone-check.md): the s8 tables (Salary, Expenses) keep their 560 px only as tables; a value of several parts wraps under its first part
     at the end of the card instead of being squeezed into a narrow column; the totals under a list are a card too */
  .tbl.cards.s8:not(.slim) { min-width: 0; }
  .tbl.cards tfoot { display: block; }
  .tbl.cards td[data-th] { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
  .tbl.cards td[data-th]::before { margin-inline-end: auto; }
  .tbl.cards td:first-child:has(> .who) { justify-content: flex-start; text-align: start; padding-block: 8px; } /* the person heads the card: the face and the name need no column word */
  .tbl.cards td:first-child:has(> .who)::before { content: none; }
}
@media (pointer: coarse) {
  .tbl .btn, .tbl .icon-btn, .tbl .lk { min-height: 40px; min-width: 40px; }
}
/* ===== end UX round 2: cards for the money tables on a phone (UX-10) ===== */
/* ===== phone check R1: touch size on a phone (docs/phone-check.md) ===== */
/* a phone upright (700 px), or a phone held sideways: a touch screen up to the 920 px drawer width and at most 500 px tall (phones on their side are 320-430 px
   tall; a tablet is taller, a desktop has a mouse, so neither changes) */
@media (max-width: 700px), (max-width: 920px) and (pointer: coarse) and (max-height: 500px) {
  /* a finger needs 44 px: Save, Cancel, Approve, Refuse, the row actions and the menu button. !important: many page rules make a button smaller for a wide table */
  .btn { min-height: 44px !important; }
  .btn.icon, .icon-btn { min-width: 44px !important; min-height: 44px !important; }
  .agy-print select { min-height: 44px; } /* the print-language list next to Print on a Contract list card */
  /* 16 px text in a box: an iPhone zooms in on every tapped field with smaller text */
  input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea { font-size: 16px !important; }
}
/* ===== end phone check R1: touch size on a phone ===== */
/* ===== UI simplification: sections of the menu, the account menu of the top bar ===== */
.nav-g.sub { margin-top: 10px; font-size: 11.5px; opacity: .8; }
.nav-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 8px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: start; }
.nav-more:hover, .nav-more:focus-visible { background: rgba(255, 255, 255, .08); }
.nav-more-body[hidden] { display: none; }
button.profile { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: start; border-radius: 12px; padding-block: 2px; }
button.profile:hover, button.profile:focus-visible { background: var(--surface-2); }
.acct-wrap { position: relative; flex: none; }
.acct-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30; width: min(300px, 86vw); display: grid; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md, 0 12px 32px -14px rgba(15, 23, 34, .35)); }
.acct-panel[hidden] { display: none; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-panel .ctl-l { display: block; font-size: 13.5px; color: var(--ink-2); }
.scope-wrap[hidden], .ctl[hidden] { display: none; }
/* the logins that show only a page (the showroom, the complaints): the language switch (and, for complaints, the theme) stays in the bar, as before */
html.showroom-only #acctPanel, html.complain-only #acctPanel { display: flex; position: static; width: auto; padding: 0; border: 0; box-shadow: none; background: transparent; gap: 10px; }
html.showroom-only #userChip, html.showroom-only .acct-theme { display: none; }
html.showroom-only .acct-lang .ctl-l, html.complain-only .acct-lang .ctl-l { display: none; }
@media (max-width: 700px) {
  .profile .meta { display: none; }
  .acct-panel { inset-inline-end: -6px; }
}
/* ===== end UI simplification: sections of the menu, the account menu of the top bar ===== */
/* ===== roadmap leftovers R3: chasing late money ===== */
.fu-box .fu-who { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.fu-lang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.fu-lang .chip[aria-pressed="true"] { background: var(--accent, #1d6f5f); color: #fff; }
.fu-btns { margin: 6px 0; }
.fu-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fu-hist small { display: block; }
.fu-open { margin-inline-end: 4px; }
.fu-tabs { margin-bottom: 12px; }
.fu-tbl td small { display: block; }
/* ===== end roadmap leftovers R3 ===== */
/* ===== roadmap leftovers HR-02: the receipt code ===== */
.cmp-code { border: 2px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); padding: 12px 14px; margin: 12px 0; }
.cmp-code-v { font-size: 1.6rem; letter-spacing: .12em; font-weight: 700; margin: 6px 0; }
.cmp-follow { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line, #d8dee4); }
/* ===== end HR-02 ===== */
/* ===== roadmap leftovers R1: agency money ===== */
.agm .agm-btns { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.agm .tbl.slim td small { display: block; }
.agm .is-reversed td { color: var(--muted); text-decoration: line-through; }
.ten-bal b { display: block; }
/* ===== end roadmap leftovers R1 ===== */

/* ===== round 2 polish: Start here (REP-14) ===== */
.start-here { margin-bottom: 16px; }
.start-steps { margin: 10px 0 0; padding-inline-start: 22px; line-height: 1.9; }
.start-steps a { color: var(--accent); }
/* ===== end round 2 polish: Start here ===== */
/* ===== R2 vault: the Vault page (investors, packages, investments, distributions, documents; docs/vault-and-investors.md). It reuses the Lending page's totals, bars and cards (lend-*); only what the tables and the printed statement need is here ===== */
.vt-body:focus, #vtBody:focus { outline: none; }
.vt-tbl { min-width: 720px; }
.vt-tbl td { vertical-align: top; }
.vt-tbl small.vt-m { display: none; }
.vt-tbl td.acts .btns { justify-content: flex-end; }
.vt-body tr.sec td { padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-bottom: 0; }
.vt-stm-h { margin: 18px 0 8px; font-size: 14.5px; font-weight: 600; }
.vt-body .stm-bar { margin-bottom: 4px; }
@media (max-width: 700px) {
  /* the phone layout of the tables (as the Lending page): the secondary columns go, their words move under the first one */
  .vt-tbl { min-width: 0; }
  .vt-tbl .vt-d { display: none; }
  .vt-tbl small.vt-m { display: block; }
  .vt-tbl td, .vt-tbl th { padding-inline: 8px; }
  .vt-tbl td.wrap { min-width: 0; }
  .vt-tbl td small { white-space: normal; }
  .vt-tbl td.acts { min-width: 0; }
  #vtPanel .stm-bar .field, #vtPanel .stm-bar .field.wide { flex: 1 1 100%; max-width: none; }
}
/* the printed statement of an investor: alone on the paper (html.printing-vt, set by the Print button while it prints) */
#vtSheet { display: none; }
@media print {
  html.printing-vt body > :not(#vtSheet) { display: none !important; }
  html.printing-vt #vtSheet { display: block; color: #000; background: #fff; font-size: 11px; }
  #vtSheet h1 { font-size: 18px; margin: 0 0 2px; }
  #vtSheet h2 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
  #vtSheet p { margin: 0 0 6px; }
  #vtSheet .vt-stm-h { margin: 14px 0 4px; }
  #vtSheet .table-wrap { overflow: visible; margin: 0; padding: 0; }
  #vtSheet .tbl { min-width: 0; width: 100%; font-size: 10.5px; }
  #vtSheet .tbl thead { display: table-header-group; }
  #vtSheet .tbl tr { break-inside: avoid; page-break-inside: avoid; }
  #vtSheet .tbl th, #vtSheet .tbl td { padding: 4px 6px; border-bottom: 1px solid #999; background: none; color: #000; }
  #vtSheet .tbl tr.sec td { font-weight: 600; background: none; }
  #vtSheet .chip { border: 1px solid #666; background: none; color: #000; padding-inline: 6px; }
  #vtSheet .vt-foot { margin-top: 10px; font-size: 10px; }
}
/* ===== end R2 vault ===== */
/* ===== roadmap leftovers R12: the diary, new matches, send a listing ===== */
.r12-bar { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.dry-list, .mat-list, .mat-with { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dry-row { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line, #ddd); }
.dry-row.late .dry-t { color: var(--bad, #9b1c1c); }
.dry-row small, .mat-list small { display: block; }
.mat-with { margin: 4px 0 8px; padding-inline-start: 14px; }
.shr-text { width: 100%; box-sizing: border-box; font: inherit; }
.ph-cam { display: none; }
@media (pointer: coarse) { .ph-cam { display: inline-flex; } }   /* R13: the camera button shows on a phone or a tablet only */
/* ===== end roadmap leftovers R12 ===== */
/* ===== roadmap leftovers R8: contract safeguards ===== */
.agy-cr small { display: block; }
.cad .tbl.slim td small { display: block; }
.cad .is-reversed td { color: var(--muted); text-decoration: line-through; }
/* ===== end roadmap leftovers R8 ===== */
/* ===== UI simplification, release B: the Payments page ===== */
.ps-filters[hidden], .calc-more-body[hidden] { display: none; }
.calc-more { justify-self: start; }
.calc-more-body { display: grid; gap: 12px; padding-top: 4px; }
/* ===== + Money (simple money release, money.js, docs/simple-money.md): the top bar button, the three choices, the types, the short form's read-out ===== */
.money-btn { white-space: nowrap; flex: none; }
.money-btn[hidden] { display: none; }
@media (max-width: 600px) { .money-btn .money-l { display: none; } .money-btn { padding-inline: 10px; } }
.mny-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.mny-big-b { display: grid; justify-items: start; align-content: start; gap: 4px; min-width: 0; padding: 14px 16px; text-align: start; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.mny-big-b b { font-size: 16px; font-weight: 600; white-space: nowrap; }
/* a phone fits two of the three: the third takes the whole line, not half of it with a hole beside */
@media (max-width: 440px) { .mny-big-b:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.mny-big-b small { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.mny-big-b.in .ic { color: var(--pos); }
.mny-big-b.out .ic { color: var(--neg); }
.mny-big-b[aria-pressed='true'] { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.mny-big-b:focus-visible, .mny-way:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }
.mny-types, .mny-qs { display: flex; flex-wrap: wrap; gap: 8px; }
.mny-types .btn, .mny-qs .btn { white-space: nowrap; }
.mny-types .btn.is-last { border-color: var(--btn); }
.mny-types .btn[aria-pressed='true'] { background: var(--btn); border-color: var(--btn); color: #fff; }
html[data-theme='dark'] .mny-types .btn[aria-pressed='true'] { color: #0A1420; }
.mny-ways { display: grid; gap: 8px; }
.mny-way { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; text-align: start; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.mny-way .ic { flex: none; }
.mny-no { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; }
.mny-no .ic { flex: none; margin-top: 2px; }
.mny-sum { display: grid; gap: 4px; margin: 0; padding: 10px 14px; list-style: none; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); }
.mny-sum li:empty { display: none; }
.mny-sum .bad { color: var(--neg); }
.mny-sum .warn { color: var(--ink); font-weight: 600; }
.mny-ok { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.mny-ok .ic { flex: none; color: var(--pos); }
/* ===== end + Money ===== */
.ps-filter-btn { margin-inline-start: auto; }
.ps-n { margin-inline-start: 4px; }
/* ===== end UI simplification, release B: the Payments page ===== */
/* ===== UI simplification, release B: the Listings page ===== */
.lst-filters[hidden] { display: none; }
.lst-filter-btn { margin-inline-start: auto; }
/* ===== end UI simplification, release B: the Listings page ===== */
/* ===== UI simplification, release B: the long forms (More details) ===== */
.dlg-form.fold:not(.show-more) .more-f, .dlg-form.fold:not(.show-more) .more-x { display: none; }
.dlg-more-row { justify-self: start; }
/* ===== end UI simplification, release B: the long forms (More details) ===== */
/* ===== UI simplification, release B: the "..." menu of a card ===== */
.more-act { position: relative; display: inline-flex; align-self: start; }
.more-btn { font-size: 20px; line-height: 1; }
.more-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 25; display: grid; gap: 4px; min-width: 180px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 32px -14px rgba(15, 23, 34, .35); }
.more-menu[hidden] { display: none; }
.more-menu .btn { width: 100%; justify-content: flex-start; text-align: start; white-space: normal; }
/* ===== end UI simplification, release B: the "..." menu of a card ===== */
/* ===== UI simplification, release B: first steps and the "?" of a page ===== */
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-help-btn { font-weight: 700; }
.page-help-box { margin-top: 10px; padding: 12px 16px; max-width: 70ch; background: var(--accent-soft); border-radius: var(--radius-md); font-size: 14.5px; line-height: 1.6; }
.page-help-box[hidden] { display: none; }
.page-help-box p { margin: 0 0 6px; }
.page-help-box p:last-child { margin: 0; }
.first-steps { margin-bottom: 14px; }
.fs-list { margin: 8px 0 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.fs-list a { font-weight: 600; }
/* ===== end UI simplification, release B: first steps and the "?" of a page ===== */
/* ===== UI simplification, release C: the tab strip of a hub ===== */
.hub-tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 14px 0 16px; border-bottom: 1px solid var(--line); }
.hub-tabs[hidden] { display: none; }
.hub-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; margin-bottom: -1px; border: 1px solid transparent; border-radius: var(--radius-md) var(--radius-md) 0 0; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.hub-tab:hover { color: var(--ink); background: var(--accent-soft); }
.hub-tab[aria-current="page"] { color: var(--ink); background: var(--surface); border-color: var(--line); border-bottom-color: var(--surface); box-shadow: inset 0 2px 0 var(--accent); }
.page-h:has(.hub-tabs:not([hidden])) { align-items: flex-start; margin-bottom: 14px; }
.hub-tab .badge { margin: 0; }
@media print { .hub-tabs { display: none; } }
@media (min-width: 701px) { .page-h:has(.hub-tabs:not([hidden])) > .page-actions { margin-inline-start: auto; } }
/* ===== end UI simplification, release C: the tab strip of a hub ===== */
/* ===== UI simplification, release C: the Today box of the overview ===== */
.today { margin-bottom: 14px; }
.today .rem-list { margin-top: 0; }
.today .muted { margin: 0; }
/* ===== end UI simplification, release C: the Today box of the overview ===== */
/* ===== roadmap leftovers R9: the clauses of the printed contracts ===== */
.ccl-problems { margin: 6px 0; padding-inline-start: 18px; color: var(--bad, #9b1c1c); }
.ccl-status { margin: 4px 0 8px; }
.ccl-btns { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
/* ===== end roadmap leftovers R9 ===== */
/* ===== table sorting (tablesort.js, docs/ui-tables.md) ===== */
.tbl th[data-ts] { cursor: pointer; }
.tbl th[data-ts]::after { content: "\2195"; content: "\2195" / ""; margin-inline-start: .4em; font-weight: 400; color: var(--ink-2); opacity: .8; } /* the second content is the text for a screen reader: none, aria-sort says it */
.tbl th[data-ts]:hover { color: var(--ink); }
.tbl th[data-ts]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tbl th[data-ts][aria-sort] { color: var(--ink); }
.tbl th[data-ts][aria-sort="ascending"]::after { content: "\2191"; content: "\2191" / ""; color: currentColor; opacity: 1; }
.tbl th[data-ts][aria-sort="descending"]::after { content: "\2193"; content: "\2193" / ""; color: currentColor; opacity: 1; }
.ts-bar, .ts-note { display: none; }
.ts-note[data-on] { display: block; margin: 0 0 8px; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 700px) {
  .ts-bar:has(+ table.cards), .ts-bar:has(+ table.sec), .ts-bar:has(+ table.ten), .ts-bar:has(+ table.lst), .ts-bar:has(+ table.mk-rep-t) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
}
@media (max-width: 767px) {
  .ts-bar:has(+ table.r6-tbl) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
}
.ts-bar label { display: flex; flex: 1 1 160px; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.ts-bar label select { flex: 1 1 60px; }
.ts-bar select { max-width: 100%; }
.ts-bar > select { flex: 1 1 140px; }
div.ts-bar > label, div.ts-bar > select { max-width: min(360px, 100%); } /* not stretched across a wide card */
.ts-bar > select:disabled { display: none; }
@media print { .ts-bar, .ts-note { display: none !important; } .tbl th[data-ts]::after, .tbl th[data-ts][aria-sort]::after { content: none !important; } }
/* ===== end table sorting (tablesort.js, docs/ui-tables.md) ===== */
/* ===== the free note of a payment (payments list, the money of an agency contract) ===== */
.pay-note { display: block; max-width: 34ch; white-space: normal; overflow-wrap: anywhere; color: var(--ink-3); }
/* ===== end the free note of a payment ===== */
/* ===== How to: the guides of the Help page (guides.js, docs/help-guides.md) ===== */
.hg-howto { margin-bottom: 16px; }
.hg-howto .hg-lead { margin: 0 0 12px; }
.hg-search { max-width: 420px; margin-bottom: 12px; }
.hg-sec { margin-top: 14px; }
.hg-sec h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.hg-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.hg-list a { font-weight: 600; }
.hg-list a, .hg-back a, .hg-here a, .fs-how { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.hg-list a:hover, .hg-back a:hover, .hg-here a:hover, .fs-how:hover { text-decoration-color: currentColor; }
.hg-basics { margin: 8px 0 12px; font-size: 17px; }
.hg-back { margin: 0 0 10px; }
.hg-guide { max-width: 760px; }
.hg-guide .hg-who { margin: 0 0 10px; }
.hg-steps { margin: 12px 0 0; padding-inline-start: 24px; display: grid; gap: 10px; line-height: 1.65; font-size: 15px; }
.hg-steps b, .hg-list b { font-weight: 700; }
.hg-here { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.hg-here h3 { margin: 0 0 4px; font-size: 14px; }
.hg-here ul { margin: 0; padding-inline-start: 20px; }
.fs-how { margin-inline-start: 6px; font-size: 13px; font-weight: 400; }
.fs-list a.fs-how { font-weight: 400; }
/* Help for every account (attendance release, item 10): the pages the search finds, and the Help row of the account menu */
.hg-pages { margin: 0 0 6px; }
.hg-pages h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.hg-pages ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.hg-pages a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding-block: 6px; padding-inline: 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.hg-pages a:hover, .hg-pages a:focus-visible { background: var(--surface-2); }
.hg-pages small { color: var(--ink-3); font-weight: 400; }
.acct-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding-inline: 4px; border-radius: 10px; color: inherit; font-weight: 600; text-decoration: none; }
.acct-link:hover, .acct-link:focus-visible { background: var(--surface-2); }
.acct-help[hidden] { display: none; }
html.complain-only .acct-help { display: none; }
@media (max-width: 700px) { .hg-search { max-width: none; } .hg-steps { font-size: 14.5px; } .hg-pages a { min-height: 44px; } }
@media print { .hg-search, .hg-back, .hg-guide .btn { display: none !important; } }
/* ===== end How to: the guides of the Help page (guides.js, docs/help-guides.md) ===== */
/* ===== supplier bill: "Post now" next to Save (payables.js postNowBySave, docs/accounts-payable.md) ===== */
.dlg-f .ap-postnow { margin: 0; align-self: center; }
.dlg-f .ap-postnow .chk { min-height: 40px; }
@media (max-width: 640px) { .dlg-f .ap-postnow { flex: 1 1 100%; } }
/* ===== end supplier bill: "Post now" next to Save ===== */
/* ===== explained permissions (st-roles): the "What it allows" button of a role and its window (app.js showRoleWhy) ===== */
.tbl.roles .role-why-btn { display: flex; width: fit-content; margin-top: 6px; white-space: nowrap; }
.role-why .why-list { list-style: none; margin: 0 0 12px; padding: 0; }
.role-why .why-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.role-why .why-list li:last-child { border-bottom: 0; }
.role-why .why-list b { display: block; font-weight: 600; }
.role-why .why-list span { display: block; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; }
.role-why .why-list li.is-none b { color: var(--ink-3); font-weight: 500; }
/* ===== end explained permissions ===== */
/* ===== leave and permission (leave-permission.js, docs/leave.md): the page, the allowances section, the permission card of My pay ===== */
.lp-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 12px; }
.lp-bar .field { margin: 0; min-width: 150px; }
.lp-bar .grow { flex: 1 1 auto; }
.lp-ro { display: flex; align-items: center; gap: 6px; margin: 4px 2px 12px; font-size: 13px; }
.lp-tbl td small { display: block; margin-top: 2px; }
.lp-warn { color: var(--warn, #9a6700); }
.lp-sub { margin: 16px 0 8px; font-size: 14px; }
.lp-pager { justify-content: center; align-items: center; gap: 10px; margin-top: 12px; }
.lp-al { gap: 12px; margin: 10px 0; }
@media (max-width: 700px) { .lp-bar .field { min-width: 0; flex: 1 1 45%; } .lp-bar .btns { flex: 1 1 100%; } }
/* ===== end leave and permission ===== */
/* ===== employee performance (performance.js, docs/employee-performance.md): the page, one person, My pay's card ===== */
.perf-bar { margin-top: 12px; align-items: flex-end; }
.perf-bar .seg { align-self: flex-end; }
.perf-tbl td small, .perf-months td small { display: block; margin-top: 2px; color: var(--ink-3); }
.perf-tbl .chip, .perf-months .chip, .perf-cmp .chip { white-space: nowrap; }
.perf-nc { margin-inline-start: 6px; }
.perf-open { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0; font-size: 13.5px; }
.perf-open .ic { flex: none; margin-top: 2px; }
.perf-pay, .perf-team, .perf-score { margin: 10px 0 0; font-size: 13px; }
.perf-cmp { max-width: 640px; }
.perf-cmp th[scope='row'] { font-weight: 500; text-align: start; }
.perf-cmp .perf-sec th { padding-top: 14px; font-weight: 600; text-align: start; color: var(--ink-2); }
.perf-sub { margin: 18px 0 8px; font-size: 14px; }
.perf-note { padding: 10px 0; border-bottom: 1px solid var(--line); }
.perf-note:last-of-type { border-bottom: 0; }
.perf-note-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.perf-note-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) { .perf-bar .field { flex: 1 1 100%; max-width: none; } .perf-cmp { max-width: none; } }
/* ===== end employee performance ===== */
/* ===== the HR overview (hr-dash.js, docs/hr-overview.md): the cards of an HR person's Overview; 3 columns, 2 on a tablet, 1 on a phone; no sideways scroll ===== */
.hrd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.hrd-card { display: flex; flex-direction: column; min-width: 0; }
.hrd-card .card-h { margin-bottom: 10px; }
.hrd-wide { grid-column: 1 / -1; }
.hrd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.hrd-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hrd-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); color: inherit; text-decoration: none; }
a.hrd-tile:hover { background: var(--line); }
.hrd-tile b { font-size: 24px; font-weight: 600; line-height: 1.15; }
.hrd-tile b.warn { color: var(--warn); }
.hrd-tile span { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.hrd-line { margin: 10px 2px 0; font-size: 13.5px; }
.hrd-card .card-h + .hrd-line { margin-top: 0; margin-bottom: 10px; }
.hrd-rows { display: flex; flex-direction: column; }
.hrd-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.hrd-row:last-child { border-bottom: 0; }
a.hrd-row:hover { background: var(--surface-2); }
.hrd-who { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.hrd-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrd-who small { color: var(--ink-3); font-size: 12.5px; }
.hrd-row .chip, .hrd-when { flex: none; white-space: nowrap; }
.hrd-when { font-size: 12.5px; color: var(--ink-3); }
.hrd-empty { padding: 14px 4px; text-align: start; }
.hrd-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
@media (max-width: 1100px) { .hrd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hrd-grid { grid-template-columns: minmax(0, 1fr); } .hrd-foot .btn { flex: 1 1 auto; min-height: 44px; } }
/* ===== end the HR overview ===== */

/* ===== update 4 (hr-attpage): the HR attendance page, its alerts, the report, the alert limits (docs/hr-attendance.md 23). Plain: the chips, cards and fields of the app ===== */
@media (min-width: 1101px) { .atn-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.atn-grps { list-style: none; display: grid; gap: 18px; margin: 0; padding: 0; }
.atn-grp { display: grid; gap: 8px; min-width: 0; }
.atn-grp-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 15px; font-weight: 600; }
.atn-grp-c { display: flex; flex-wrap: wrap; gap: 4px 6px; font-weight: 400; }
.atn-al-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.atn-al-head p { margin: 0; flex: 1 1 280px; }
.atn-al-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.atn-al-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.atn-al-main { display: grid; gap: 4px; flex: 1 1 260px; min-width: 0; }
.atn-al-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.atn-al-v { margin: 0; font-weight: 500; }
.atn-al-done p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.atn-al-acts { flex: 0 0 auto; }
.atn-al-n { margin-inline-start: 4px; padding-inline: 7px; }
.atn-ew-al { margin: 12px 0; }
.atn-ew-al h4 { margin: 0 0 8px; font-size: 14px; }
.atn-counts { display: grid; gap: 2px; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.atn-counts p { margin: 0; }
.atn-rp-tbl th, .atn-rp-tbl td { font-size: 13px; }
.atn-rp-tbl tfoot th, .atn-rp-tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.atn-rp-cards { display: none; list-style: none; gap: 12px; margin: 12px 0 0; padding: 0; }
.atn-rp-kv { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 12px; }
.atn-lim { gap: 12px; margin: 10px 0; }
.atn-lim .field { min-width: 0; }
.atn-lim-br { margin: 4px 0 10px; }
.atn-lim-people { list-style: none; display: grid; gap: 8px; margin: 0 0 10px; padding: 0; }
.atn-lim-people li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.atn-lim-people .atn-main small { white-space: normal; }
@media (max-width: 1100px) {
  .atn-rp-wide { display: none; }
  .atn-rp-cards { display: grid; }
}
@media (max-width: 700px) {
  .atn-al-row { padding: 10px 12px; }
  .atn-al-acts { flex: 1 1 100%; }
  .atn-bar .field.atn-now { flex: 1 1 100%; }
}
@media print {
  .atn-al-acts, .atn-rp-cards { display: none !important; }
  .atn-rp-wide { display: block !important; }
}
/* ===== end update 4 (hr-attpage) ===== */
/* ===== labels on one line (pu-labels) ===== */
/* Owner item 5 (28/11/2026, "this yellow thing"): a label (status, days left, due, paid, approved ...) stays on ONE line and is never broken inside a word,
   whatever its cell says (a td.wrap may break a long word anywhere: a label does not take that). A name in a label (a zone, a placeholder, a contact, a sign-in)
   ends in "…" inside its <bdi> or <span>; a text too long for a label is plain text (.lbl-t) that wraps between words only. docs/ui-labels.md;
   tests/Feature/Http/LabelsOneLineNodeTest.php fails on any rule that lets a label wrap or break; scripts/label-fit.js measures the pages. */
.chip, .asof, .badge, .cnt, .bell .dot { white-space: nowrap; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.chip { max-width: 100%; }
.chip > bdi:not(.num), .chip.r6-chip > span, .chip.login > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lbl-t { font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--ink-2); overflow-wrap: normal; word-break: normal; }
.lbl-t.warn { color: var(--warn); }
.lbl-t.bad { color: var(--neg); }
.lbl-t.ok { color: var(--pos); }
.lbl-t.brass { color: var(--accent-ink); }
.lbl-t > svg { vertical-align: -2px; margin-inline-end: 4px; }
.lbl-lines { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
/* ===== end labels on one line ===== */
/* ===== client menu (client-menu.js, docs/client-menu.md) ===== */
.clm-head p { margin: 0 0 12px; max-width: 80ch; }
.clm-top { gap: 10px; }
.clm-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.clm-count { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.clm-count b { font-size: 24px; line-height: 1.2; }
.clm-count span { color: var(--ink-3); font-size: 13.5px; }
.clm-count.ok b { color: var(--pos); }
.clm-count.warn b { color: var(--warn); }
.clm-bar { margin-bottom: 14px; }
.clm-bar .field { min-width: 150px; }
.clm-chk { align-self: end; padding-bottom: 8px; }
.clm-chip, .clm-chip.warn { white-space: nowrap; }
.clm-tbl td { vertical-align: middle; }
.tbl.clm-tbl, .tbl.clm-own, .tbl.clm-gone { min-width: 0; } /* the three tables fit their box: no sideways scroll at 1024 px (owner item 2) */
.clm-pm { display: flex; gap: 10px; align-items: flex-start; }
.clm-pt { min-width: 0; }
.clm-acts { margin-top: 8px; }
.clm-sws { white-space: nowrap; }
.clm-sws .clm-sw { display: flex; gap: 8px; margin: 4px 0; }
.clm-swl { font-size: 13.5px; color: var(--ink-2); }
.clm-tbl .clm-price .num { white-space: nowrap; }
.clm-state { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; }
.clm-tbl td small, .clm-own td small { display: block; color: var(--ink-3); }
.clm-pic { display: block; width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.clm-nopic { display: grid; place-items: center; color: var(--ink-3); }
.clm-sw { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.clm-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.clm-track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.clm-track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .15s; }
.clm-sw input:checked + .clm-track { background: var(--pos); }
.clm-sw input:checked + .clm-track::after { inset-inline-start: 21px; }
.clm-sw input:focus-visible + .clm-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.clm-sw input:disabled + .clm-track { opacity: .5; }
.clm-sec { margin-top: 16px; }
.clm-sec > p { max-width: 80ch; }
.clm-pub { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.clm-pub-h { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.clm-copyrow { display: flex; gap: 8px; align-items: start; }
.clm-copyrow input, .clm-copyrow textarea { flex: 1 1 auto; min-width: 0; font-family: var(--f-num); font-size: 13px; }
.clm-copyrow textarea { resize: vertical; }
.clm-steps { margin: 0 0 14px; padding-inline-start: 22px; display: grid; gap: 8px; }
.clm-pvnote { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius-sm); }
.clm-pvnote.ok { background: var(--pos-bg); color: var(--pos); }
.clm-pvnote.warn { background: var(--warn-bg); color: var(--warn); }
.clm-card .card-h h2 { display: flex; align-items: center; gap: 8px; }
.clm-card p { margin: 0 0 10px; }
.clm-card { margin-bottom: 14px; }
.shr-tools { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 700px) {
  .clm-bar .field { min-width: 0; flex: 1 1 45%; }
  .clm-copyrow { flex-wrap: wrap; }
}
/* ===== end client menu ===== */
/* ===== every page fits the screen (fit.js, docs/ui-fit.md) ===== */
/* fit.js marks the tables it looks after with data-fit. They have no fixed smallest width any more (they were 560 to 1080 px at least and scrolled sideways in
   a narrower box): a table is as wide as its columns need, and when that is wider than its box fit.js folds its less important columns into the main cell
   (fit-hid, fit-more) or shows its rows as cards (fit-cards). Screen only: a printed table shows every column, as before. */
@media screen {
  .tbl[data-fit] { min-width: 0; }
  .tbl[data-fit] th { white-space: normal; }
  .tbl[data-fit] td.wrap { overflow-wrap: break-word; }
  .tbl th.fit-hid, .tbl td.fit-hid { display: none; }
  .tbl small.fit-more { display: block; margin-top: 4px; white-space: normal; text-align: start; font-weight: 400; }
  .fit-kv { display: block; }
  .fit-k { color: var(--ink-3); }
  .fit-k::after { content: ':'; }
  .fit-v { color: var(--ink-2); }
  .fit-v small { display: inline; margin: 0; font-size: inherit; }
  .fit-v small::before { content: ' '; }
  /* a table that does not fit even with its columns folded: its rows are cards, as on a phone (cards.js gives every cell the title of its column) */
  table.tbl.fit-cards.fit-cards { min-width: 0; width: 100%; }
  table.tbl.fit-cards.fit-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.tbl.fit-cards.fit-cards, table.tbl.fit-cards.fit-cards tbody, table.tbl.fit-cards.fit-cards tfoot, table.tbl.fit-cards.fit-cards tr { display: block; width: 100%; box-sizing: border-box; }
  table.tbl.fit-cards.fit-cards tr { margin: 0 0 10px; padding: 6px 4px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
  table.tbl.fit-cards.fit-cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; margin-bottom: 10px; } /* two or three cards side by side where there is room */
  table.tbl.fit-cards.fit-cards tbody tr { margin: 0; }
  table.tbl.fit-cards.fit-cards tbody tr:has(> td[colspan]), table.tbl.fit-cards.fit-cards tbody tr[hidden] { grid-column: 1 / -1; } /* a detail or message row takes the whole width */
  table.tbl.fit-cards.fit-cards tbody tr[hidden] { display: none; }
  table.tbl.fit-cards.fit-cards td { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 2px 12px; width: auto; min-width: 0; max-width: none; padding: 5px 12px; border: 0; text-align: end; white-space: normal; overflow-wrap: break-word; }
  table.tbl.fit-cards.fit-cards td[data-th]::before { content: attr(data-th); flex: none; max-width: 45%; margin-inline-end: auto; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: start; }
  table.tbl.fit-cards.fit-cards td:first-child:has(> .who) { justify-content: flex-start; text-align: start; } /* the person heads the card, without the column word */
  table.tbl.fit-cards.fit-cards td:first-child:has(> .who)::before { content: none; }
  table.tbl.fit-cards.fit-cards td:not([data-th]) { justify-content: flex-start; gap: 6px; text-align: start; }
  table.tbl.fit-cards.fit-cards td:empty { display: none; }
  table.tbl.fit-cards.fit-cards td .btns { flex-wrap: wrap; justify-content: flex-start; margin-inline-start: 0; }
  /* a table whose headers hold controls (it sorts by itself: the agency Performance; "select all" of Ending soon) keeps them, as a row above its cards */
  table.tbl.fit-cards.fit-cards thead:has(button, input, select) { position: static; display: block; width: auto; height: auto; overflow: visible; clip-path: none; margin-bottom: 10px; }
  table.tbl.fit-cards.fit-cards thead:has(button, input, select) tr { display: flex; flex-wrap: wrap; gap: 6px 14px; }
  table.tbl.fit-cards.fit-cards thead:has(button, input, select) th { display: block; padding: 0; background: none; border-radius: 0; }
  table.tbl.fit-cards.fit-cards thead:has(button, input, select) th:not(:has(button, input, select)) { display: none; }
  .ts-bar:has(+ table.fit-cards) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; } /* the sort choice of tablesort.js, as on a phone */
  .ts-bar label { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .ts-bar select { min-width: 0; } /* a long column title ("Monthly rent as written on the contracts") no longer makes the choice wider than a phone */
  /* tab strips and boards wrap instead of sliding sideways */
  .seg.tabs { flex-wrap: wrap; border-radius: 20px; }
  .kanban, .kanban.rcr-board { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); overflow-x: visible; }
}
/* a financial statement keeps its columns (fit.js leaves it alone): on a phone its cells are closer and its figures smaller, so the three columns of the
   trial balance fit 289 px; the buttons of a cell wrap in a phone card */
@media screen and (max-width: 700px) {
  .tbl.stm th, .tbl.stm td { padding-inline: 6px; font-size: 13px; }
  table.tbl[data-fit] td.fit-acts { white-space: normal; } /* a cell of buttons in a phone card wraps them (the counts of a zone were two buttons on one line, wider than the card) */
  .tbl.lst td.nw, .tbl.sec td.nw, .tbl.ten td.nw { white-space: normal; } /* in the phone cards of these pages a "no wrap" cell may wrap between its parts (a hidden phone number and Show number); the number itself does not break */
}
/* the buttons of a row: two keep one line; more are in the "⋯" menu (a popover, drawn above the page so a scrolling box does not cut it off) */
@media screen and (min-width: 701px) {
  .tbl[data-fit]:not(.fit-cards) td.fit-acts { min-width: 0; width: 1%; }
  .tbl[data-fit]:not(.fit-cards) td.fit-acts .btns { display: flex; flex-wrap: nowrap; flex-direction: row; align-items: center; max-width: none; }
}
.fit-mbtn { font-size: 20px; line-height: 1; font-weight: 700; color: var(--ink-2); }
.fit-mbtn[aria-expanded='true'] { background: var(--accent-soft); color: var(--ink); }
.fit-menu { position: fixed; inset: auto; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); min-width: 190px; max-width: min(340px, calc(100vw - 16px)); overflow: auto; text-align: start; }
.fit-menu:popover-open { display: grid; gap: 2px; }
.fit-menu > * { justify-self: stretch; min-width: 0; }
#view .fit-menu .btn { width: 100%; min-width: 0; min-height: 38px; justify-content: flex-start; gap: 8px; padding: 6px 12px; border-color: transparent; border-radius: 10px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.3; text-align: start; white-space: normal; }
#view .fit-menu .btn:hover, #view .fit-menu .btn:focus-visible { background: var(--surface-2); }
#view .fit-menu .btn.bad { color: var(--neg); }
#view .fit-menu .btn .ic { display: inline-block; flex: none; }
.fit-lbl { display: none; }
#view .fit-menu .fit-lbl { display: inline; }
#view .fit-menu .agy-print { display: flex; align-items: center; gap: 6px; }
#view .fit-menu .agy-print > a { flex: 1; }
@media print { .fit-mbtn, .fit-menu, .tbl small.fit-more { display: none !important; } } /* the copies of folded values: on paper their columns are back (fit.js also unfolds before printing) */
/* ===== end every page fits the screen (fit.js, docs/ui-fit.md) ===== */

/* ===== search in every drop-down (select-search.js): the list opens over the page, the select itself never moves ===== */
.ss-pop { position: fixed; inset: auto; margin: 0; z-index: 1000; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); overflow: hidden; }
.ss-q { width: 100%; box-sizing: border-box; min-height: 44px; font-size: 16px; }
.ss-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.ss-list li { display: flex; align-items: center; min-height: 44px; padding: 4px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.ss-list li.on { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--accent); }
.ss-list li[aria-selected="true"] { font-weight: 600; }
.ss-list li.ss-none { cursor: default; opacity: .75; }
/* ===== end search in every drop-down (select-search.js) ===== */

/* Receipts (owner item 21, receipts.js): the + Money form drawn into the page. Header: company, centred title, date (mirrored by the reading direction) */
.rc-go { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.rc-go .btn { flex: 1 1 150px; max-width: 280px; }
.rc-tabs { flex-wrap: wrap; border-radius: var(--radius); }
.rc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rc-sheet { max-width: 880px; }
.rc-sheet .dlg-h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.rc-sheet .dlg-h h2 { text-align: center; }
.rc-sheet .dlg-h .field { justify-self: end; max-width: 190px; }
.rc-co { overflow-wrap: anywhere; }
.rc-sheet .dlg-b { overflow: visible; padding: 14px 0; }
.rc-sheet .dlg-f { justify-content: flex-start; padding: 14px 0 0; }
.rc-sheet input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.rc-done { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.rc-done[hidden] { display: none; }
.rc-notes { display: grid; gap: 10px; justify-items: start; margin-top: 14px; }
#rclPanel > p[role='status'], #cbPanel p[role='status'] { margin: 14px 0 8px; font-size: 13.5px; }
.cb-band { margin-bottom: 14px; }
/* phone: the start buttons and the filters of the two lists take the whole width */
@media (max-width: 600px) { .rc-go .btn { max-width: none; } #rcList .stm-bar .field, #rcList .stm-bar .field.wide, #cbPanel .stm-bar .field { flex: 1 1 100%; max-width: none; } }
@media (max-width: 640px) {
  .rc-sheet .dlg-h { grid-template-columns: minmax(0, 1fr) auto; }
  .rc-sheet .dlg-h h2 { grid-column: 1 / -1; order: -1; }
  .rc-sheet .dlg-f .btn { flex: 1 1 auto; }
}
/* a small phone: the date takes a row of its own, or the company name is broken in the middle of a word */
@media (max-width: 379px) { .rc-sheet .dlg-h .field { grid-column: 1 / -1; justify-self: stretch; max-width: none; } }

/* ===== the home page (home.js, owner item 22): large cards, then the counts; two a row on a narrow screen ===== */
.home-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.home-row + .home-row { margin-top: 24px; }
.home-big, .home-count { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; padding: 16px 10px; text-align: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.home-big { min-height: 128px; font-size: 17px; font-weight: 600; cursor: pointer; border-color: var(--line-strong); }
.home-big .ic { color: var(--accent); }
.home-count { min-height: 96px; align-self: stretch; justify-content: space-between; box-shadow: none; font-size: 14px; color: var(--ink-2); }
.home-count b { font-size: clamp(24px, 2.3vw, 34px); font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
a.home-big:hover, summary.home-big:hover, a.home-count:hover { background: var(--accent-soft); border-color: var(--accent); }
summary.home-big { list-style: none; }
summary.home-big::-webkit-details-marker { display: none; }
.home-forms { min-width: 0; }
.home-forms a { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; padding: 6px 10px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.home-forms a.btn:not(.ghost) { background: var(--btn); color: #fff; border-color: var(--btn); font-weight: 600; }
@media (max-width: 920px) { .home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ===== end the home page ===== */
/* ===== Limits, "Read each week": a heading of its own size, with room around it ===== */
.lw h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.lw .lw-gap { margin-top: 10px; font-size: 13px; }
/* ===== end Limits, "Read each week" ===== */

/* ===== the contract forms of the old system: two tabs, two columns, the main form with a box in each sentence ===== */
.dlg-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dlg-cols > div { display: grid; gap: 14px; align-content: start; min-width: 0; }
.dlg-b > .agy-tabs { justify-self: start; overflow: visible; }   /* as an auto-overflow grid row the strip was squeezed to nothing */
.agy-main:empty { display: none; }
.dlg-form:not(.agy-on-main) .agy-main, .dlg-form.agy-on-main .dlg-cols, .dlg-form.agy-on-main .dlg-grid { display: none; }
.agy-sheet h2 { margin: 12px 0; }
.agy-sheet li { margin-bottom: 4px; }
.agy-sheet input, .agy-sheet select, .agy-sheet textarea { display: inline-block; width: auto; max-width: 100%; min-height: 36px; margin: 2px 0; padding: 2px 8px; font: inherit; font-size: 16px; line-height: 1.4;
  background-color: #F2F5F9; color: #15181E; border: 1px solid #B9C2CF; border-radius: 6px; vertical-align: middle; }
.agy-sheet [hidden] { display: none; }
.agy-sheet li input[type='number'], .agy-sheet li input[data-money] { width: 8em; }
.agy-sheet .dt { display: inline-flex; vertical-align: middle; }
.agy-sheet li .dt input { width: 9.5em; }
.agy-pp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 8px; }
.agy-c { display: flex; flex-direction: column; min-width: 0; }
.agy-c > span:first-child { font-weight: 700; font-size: .85em; }
.agy-c input, .agy-c select, .agy-c textarea { width: 100%; }
.agy-bar { margin: 14px 0; padding: 4px 10px; text-align: center; font-weight: 700; background: #15181E; color: #FFFFFF; border-radius: 6px; }
@media (max-width: 700px) { .dlg-cols { grid-template-columns: 1fr; } .agy-pp { grid-template-columns: 1fr; } }
/* ===== end the contract forms of the old system ===== */

/* ===== the How-to helper (help-ask.js, docs/help-ai.md) ===== */
.ha-card { margin-bottom: 16px; max-width: 760px; }
.ha-form { display: flex; flex-wrap: wrap; gap: 8px; }
.ha-form input { flex: 1 1 240px; min-width: 0; min-height: 40px; padding: 8px 10px; font: inherit; font-size: 16px; background: var(--surface); color: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ha-privacy { margin: 8px 0 0; font-size: 13px; }
.ha-hit, .ha-note { margin-top: 12px; }
.ha-hit h3 { margin: 0 0 6px; font-size: 16px; }
.ha-held { margin-top: 12px; }
.ha-held h3 { margin: 0 0 6px; font-size: 14px; }
.ha-held ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
/* ===== end the How-to helper ===== */
