/* Colours come from the NKAY Aesthetics logo: chocolate, gold and cream.
   Typography and spacing follow the GaliSuite (Galiway) shell: 13px base, 12.5px controls
   and tables, 11.5px field labels, 10.5px chips, DM Sans, compact 8-14px spacing.
   Flat edges and no shadows throughout. */
:root {
  --bg: #f6f3ef; --surface: #ffffff; --ink: #2a1b12; --muted: #6a5a4e; --line: #d9cbbb; --line-soft: #ebe2d7;
  --cream: #fffaf1; --tint: #fbf8f4; --tint-2: #f4ede4;
  --primary: #8a5a33; --primary-dark: #5c3a1f; --primary-soft: #f5eadc; --accent: #e4ae6c;
  --rail: #3a1c0e; --rail-light: #4d2713; --rail-active: rgba(228, 174, 108, .2); --rail-ink: #fbf3e8;
  /* Inks for a state: brick, ochre, forest and slate. They sit with the brown; none of them shouts. */
  --danger: #a5352c; --danger-soft: #f6e6e2; --warn: #96600f; --warn-soft: #f6ecd9;
  --ok: #2f6b45; --ok-soft: #e6efe6; --info: #3d5578; --info-soft: #e8ecf2; --grey-soft: #f0ebe4;
  --fs: 13px; --fs-sm: 12.5px; --fs-xs: 11.5px; --fs-xxs: 10.5px; --fs-lg: 14px; --fs-xl: 21px;
  --scrim: rgba(40, 24, 14, .5);
  --font: 'DM Sans', 'Segoe UI', Tahoma, sans-serif; --mono: 'DM Sans', 'Segoe UI', Tahoma, sans-serif; --display: 'Bricolage Grotesque', 'DM Sans', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; border-radius: 2px; box-shadow: none; }
html, body { height: 100%; margin: 0; }
body { font: var(--fs)/1.4 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-size: var(--fs); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--tint-2); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--tint-2); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* Iconly icons (inline SVG, drawn in the current text colour) */
svg.icon { width: 18px; height: 18px; flex: none; display: block; }
.btn svg.icon, .x svg.icon { width: 15px; height: 15px; }

/* Sign-in: the clinic on a framed panel, the form on a card beside it */
.login { height: 100%; display: flex; background: var(--bg); }
.login-side { position: relative; width: 44%; max-width: 640px; min-width: 320px; padding: 48px; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
/* A fine gold line set in from the edge. */
.login-side::before { content: ''; position: absolute; inset: 18px; border: 1px solid var(--accent); opacity: .34; pointer-events: none; }
/* The NKAY wordmark (img/login-logo.png, wide); a logo of the clinic's own from Company details takes its place. */
.login-logo { width: 300px; max-width: 84%; height: auto; display: block; margin: 0 auto 26px; }
.login-name { font-family: var(--display); font-size: calc(var(--fs-xl) * 1.3); font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.login-tag { margin-top: 14px; color: var(--accent); font-size: var(--fs-xs); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; }
.login-tag:empty { display: none; }
.login-tag::before { content: ''; display: block; width: 36px; height: 1px; margin: 0 auto 14px; background: var(--accent); opacity: .75; }
.login-foot { position: absolute; left: 0; right: 0; bottom: 40px; display: flex; justify-content: center; gap: 10px; font-size: var(--fs-xs); opacity: .6; }
.login-foot span + span:not(:empty)::before { content: '\00b7'; margin-right: 10px; }
/* The form sits in the middle of its side; the maker's credit is pinned underneath. */
.login-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 24px 24px 26px; overflow: auto; }
.login-made { flex: none; margin-top: 18px; text-align: center; color: var(--muted); font-size: var(--fs-xxs); line-height: 1.7; }
.login-made b { color: var(--ink); font-weight: 600; }
/* The makers write their name in lowercase Comfortaa. */
.sofdas { font-family: 'Comfortaa', var(--font); font-weight: 700; text-transform: lowercase; letter-spacing: 0; }
.login-card { margin: auto 0; width: 376px; max-width: 100%; display: grid; gap: 14px; padding: 34px 34px 28px; background: var(--surface); border: 1px solid var(--line-soft); }
.login-card h1 { font-family: var(--display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.login-card p { margin: 0; }
.login-card .login-lead { margin: -8px 0 6px; }
.login-field { position: relative; display: block; }
.login-field > svg.icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.login-field input, .login-field select { height: 38px; padding-left: 36px; }
.login-field input[type=password], .login-field input#login-pass { padding-right: 38px; }
.login-eye { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.login-eye:hover, .login-eye.on { color: var(--primary-dark); }
.login-eye svg.icon { width: 16px; height: 16px; }
/* After signing in, someone with several branches picks one from this list. */
.login-pick-list { display: grid; gap: 6px; }
.login-pick-list button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.login-pick-list button:hover, .login-pick-list button:focus-visible { background: var(--primary-soft); border-color: var(--primary); outline: none; }
.login-pick-list button svg.icon { width: 16px; height: 16px; color: var(--muted); }
.login-pick-list button small { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.login-caps { margin-top: -8px; color: var(--warn); font-size: var(--fs-xs); }
.login-card .btn-block { height: 40px; margin-top: 4px; font-size: var(--fs); font-weight: 600; }
/* A computer without access: why, which computer, and an administrator signing in to give it access */
#login-access { width: 420px; }
.access-pc { display: grid; gap: 2px; padding: 10px 14px; background: var(--primary-soft); border: 1px solid var(--line-soft); }
.access-pc span { font-size: var(--fs-xxs); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; color: var(--muted); }
.access-pc b { font-family: var(--display); font-size: calc(var(--fs-xl) * .85); font-weight: 600; letter-spacing: .06em; color: var(--ink); white-space: nowrap; }
.access-pc small { color: var(--muted); font-size: var(--fs-xs); }
.access-or { margin-top: 4px; font-size: var(--fs-xxs); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; color: var(--muted); }
/* My profile: the staff app's code for a phone's camera */
.phone-app { display: flex; gap: 16px; align-items: flex-start; }
.phone-qr { flex: none; width: 136px; height: 136px; border: 1px solid var(--line-soft); }
/* A switch in a list's row (access to N-Clinic, for example), and the note above a list */
td.switch-cell { width: 1%; white-space: nowrap; }
.page-note { margin: -2px 0 10px; font-size: var(--fs-sm); max-width: 900px; }

/* Layout: icon rail on the left, top bar with module tabs, then the content */
.app { height: 100%; display: flex; }
.rail { width: 104px; flex: none; background: var(--rail); color: #fff; display: flex; flex-direction: column; }
.rail-brand { height: 64px; flex: none; display: grid; place-items: center; border: 0; background: var(--rail-light); color: #fff; cursor: pointer; }
.rail-brand .logo { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
/* The modules breathe: a little space between them (less in a short window, below). */
.rail-nav { flex: 1; overflow-y: auto; scrollbar-width: none; display: grid; align-content: start; gap: 8px; padding: 8px 0; }
.rail-foot { gap: 2px; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; min-height: 50px; padding: 4px; border: 0; background: none; color: #fff; font: inherit; font-size: 8px; font-weight: 400; letter-spacing: .2px; line-height: 1.2; cursor: pointer; text-align: center; transition: background .12s; }
.rail-badge { position: absolute; top: 4px; right: 16px; background: #ff4d4f; color: #fff; font-size: var(--fs-xxs); font-weight: 600; line-height: 1; padding: 2px 4px; min-width: 16px; text-align: center; }
.rail-item svg.icon { width: 22px; height: 22px; }
.rail-item:hover { background: rgba(255, 255, 255, .12); }
.rail-item.active { background: var(--rail-active); }
.rail-scroll { flex: none; height: 16px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.rail-scroll:hover { background: rgba(255, 255, 255, .22); }
.rail-scroll svg.icon { width: 14px; height: 14px; }
.rail-scroll.up svg.icon { transform: rotate(90deg); } .rail-scroll.down svg.icon { transform: rotate(-90deg); }
.rail-foot { flex: none; display: grid; padding: 4px 0 6px; border-top: 1px solid rgba(255, 255, 255, .18); }
.rail-foot .rail-item { min-height: 38px; padding: 4px; }
.alert-dot { position: absolute; top: 5px; left: calc(50% + 4px); width: 9px; height: 9px; background: #ff4d4f; border: 2px solid var(--rail); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 44px; flex: none; display: flex; align-items: stretch; justify-content: space-between; gap: 14px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: stretch; gap: 14px; min-width: 0; }
.topbar-left h1 { align-self: center; white-space: nowrap; }
.subnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { padding: 0 10px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; white-space: nowrap; }
.subnav button:hover { color: var(--ink); }
.subnav button.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; font-size: var(--fs-sm); }
.user-chip { display: flex; align-items: center; gap: 8px; margin: 0 4px 0 6px; line-height: 1.2; }
.user-chip small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.avatar { width: 26px; height: 26px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); }
.sync-pill { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line-soft); background: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.sync-pill:hover { background: var(--grey-soft); color: var(--ink); }
.sync-pill .dot { width: 8px; height: 8px; background: #9aa4b2; flex: none; }
.sync-pill.online .dot { background: #46d17f; } .sync-pill.error .dot { background: #ff6b6b; } .sync-pill.busy .dot { background: #ffd24a; }
.content { flex: 1; overflow: auto; padding: 10px 10px 30px; }

/* Split screens: cards on the left, the selected record on the right */
.content.split-mode { padding: 0; overflow: hidden; display: flex; }
.split-list { width: clamp(320px, 29.4vw, 460px); flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.split-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px 6px; }
.split-head h2 { flex: 1; }
.split-search { padding: 0 12px 8px; }
.cards { flex: 1; overflow-y: auto; padding: 2px 12px 10px; display: grid; gap: 6px; align-content: start; }
.pcard { display: flex; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid var(--line-soft); background: var(--tint); color: inherit; font: inherit; cursor: pointer; text-align: left; }
.pcard:hover { border-color: var(--line); }
.pcard.active { background: var(--primary-soft); border-color: var(--primary); }
.avatar-lg { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-weight: 600; color: #fff; }
.pcard .lines { min-width: 0; display: grid; gap: 1px; align-content: start; font-size: var(--fs-sm); }
.pcard .lines strong { font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .lines span { color: var(--muted); }
.pcard .lines .ph { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.pcard .lines .ph svg.icon { width: 14px; height: 14px; }
.load-more { flex: none; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--primary-dark); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; padding: 9px; }
.load-more:hover { background: var(--grey-soft); }
.split-detail { flex: 1; min-width: 0; overflow: auto; padding: 10px 12px 30px; background: var(--bg); }
.split-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }
.split-empty .pic { width: 150px; height: 150px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--tint-2); border: 1px solid var(--line-soft); }
.split-empty .pic svg.icon { width: 60px; height: 60px; color: var(--muted); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.detail-head .toolbar { margin: 0; }

/* Visit (EMR) screen */
.emr-section { margin-top: 10px; }
.vitals { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip { padding: 3px 8px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.fav { border-color: var(--accent); background: var(--primary-soft); }
.chip.add { border-style: dashed; color: var(--primary-dark); }

/* Week calendar */
.cal { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); }
.cal-corner { border-bottom: 1px solid var(--line); }
.cal-head { padding: 6px 4px; text-align: center; font-weight: 600; font-size: var(--fs-sm); border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
.cal-head small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.cal-head.today { background: var(--primary-soft); color: var(--primary-dark); }
.cal-body { grid-column: 1 / -1; display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); grid-auto-rows: 26px; }
.cal-time { grid-column: 1; color: var(--muted); text-align: right; padding: 2px 6px 0 0; line-height: 1; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: var(--fs-xs); }
.cal-slot { border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); cursor: pointer; }
.cal-slot.hour { border-top-color: var(--line-soft); }
.cal-slot.today { background: var(--tint); }
.cal-slot:hover { background: var(--primary-soft); }
.cal-ev { z-index: 1; margin: 1px 2px 1px 0; padding: 2px 5px; background: var(--primary); color: #fff; border-left: 3px solid var(--primary-dark); line-height: 1.25; overflow: hidden; cursor: pointer; font-size: var(--fs-xs); }
.cal-ev.done { background: #8c7b6c; border-left-color: #6a5a4e; }
.cal-ev.cancel { background: var(--danger); border-left-color: #9e1f24; text-decoration: line-through; }
.cal-ev strong, .cal-ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.s1 span { display: none; }

/* Staff chat */
.chat-rooms { flex: 1; overflow-y: auto; padding: 2px 12px 10px; display: grid; gap: 4px; align-content: start; }
.chat-room { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 9px; border: 1px solid transparent; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.chat-room:hover { background: var(--tint); }
.chat-room.active { background: var(--primary-soft); border-color: var(--primary); }
.chat-room .avatar-lg { width: 32px; height: 32px; }
.chat-room .lines { min-width: 0; flex: 1; display: grid; }
.chat-room .lines strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room .lines span { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-head { padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-thread { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-day { text-align: center; color: var(--muted); font-size: var(--fs-xs); margin: 6px 0; }
.msg { max-width: 70%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line-soft); padding: 6px 10px; }
.msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: var(--line); }
.msg .who { font-size: var(--fs-xxs); color: var(--muted); margin-bottom: 2px; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-compose textarea { flex: 1; min-height: 44px; }

/* "Needs attention" list behind the bell, also used for small clickable rows */
.alert-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; text-align: left; }
.alert-row:hover { background: var(--tint); }
.alert-row.zero { color: var(--muted); }

/* Building blocks */
.card { background: var(--surface); border: 1px solid var(--line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; min-height: 32px; border-bottom: 1px solid var(--line-soft); background: var(--tint); }
.card-head h2 { font-size: var(--fs-sm); }
.card-body { padding: 12px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .grow { flex: 1; }
.grid { display: grid; gap: 8px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 10px 12px; }
.stat .label { color: var(--muted); font-size: var(--fs-xs); }
.stat .value { font-family: var(--mono); font-size: var(--fs-xl); font-weight: 600; line-height: 1.1; margin-top: 3px; }
.stat .hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 3px; }
.stat.clickable { cursor: pointer; } .stat.clickable:hover { border-color: var(--primary); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary-dark); color: #fff; } .btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); } .btn-danger:hover { background: var(--danger-soft); border-color: #f0c4c6; }
.btn-ghost { border-color: transparent; background: none; color: var(--muted); } .btn-ghost:hover { color: var(--ink); background: var(--grey-soft); border-color: transparent; }
.btn-sm { padding: 3px 9px; font-size: var(--fs-xs); }
.btn-block { width: 100%; padding: 7px; }

label { display: grid; gap: 3px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
label .req { color: var(--danger); }
input, select, textarea { width: 100%; padding: 5px 8px; border: 1px solid var(--line); background: var(--cream); color: var(--ink); font: inherit; font-size: var(--fs); font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); border-style: dashed; color: var(--muted); }
textarea { min-height: 62px; resize: vertical; }
input[type=checkbox] { width: 15px; height: 15px; padding: 0; accent-color: var(--primary); }
label.check { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: var(--fs); color: var(--ink); padding-top: 18px; }
.search { max-width: 260px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-group-title { grid-column: 1 / -1; font-size: var(--fs-xxs); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding-bottom: 3px; margin-top: 4px; }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f0c4c6; padding: 6px 9px; font-size: var(--fs-sm); }
.req { color: var(--danger); }

table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 6px 9px; border-bottom: 1px solid var(--line); background: var(--tint-2); white-space: nowrap; }
table.data td { padding: 5px 9px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: var(--tint); }
table.data tbody tr.rowlink { cursor: pointer; } table.data tbody tr.rowlink:hover td { background: var(--primary-soft); }
table.data td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.data .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
table.items td { padding: 2px 3px; } table.items input, table.items select { padding: 4px 7px; font-size: var(--fs-sm); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-xs); }
.pager div { display: flex; gap: 4px; }

/* A state is written, not boxed: small capitals, coloured only by how things stand. */
.badge { display: inline-block; font-size: var(--fs-xxs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.danger { color: var(--danger); } .badge.info { color: var(--info); }
/* A figure is a figure. It is coloured only when it calls for attention: running low, or run out. */
.fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig.low { color: var(--warn); font-weight: 600; } .fig.out { color: var(--danger); font-weight: 600; }

/* Typeahead for linked records */
.picker { position: relative; }
/* The list is placed on the page itself, over popups, at the box it belongs to (crud.js sets where). */
.picker-list { position: fixed; z-index: 1250; left: 0; top: 0; max-height: 220px; overflow: auto; background: var(--surface); border: 1px solid var(--primary); }
.picker-list div { padding: 5px 9px; cursor: pointer; font-weight: 400; font-size: var(--fs-sm); color: var(--ink); }
.picker-list div:hover, .picker-list div.hl { background: var(--primary-soft); }
.picker-list .none { color: var(--muted); cursor: default; }
.picker-list .none:hover { background: none; }
.picker-list .more { width: 0; min-width: 100%; box-sizing: border-box; white-space: normal; overflow: visible; text-overflow: clip; position: sticky; bottom: 0; border-top: 1px solid var(--line-soft); background: var(--surface); font-size: var(--fs-xs); line-height: 1.35; }

/* Popup, as in GaliSuite: coloured title bar, 14px body, light footer with the buttons on the right */
.modal-back { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(clamp(620px, 46vw, 760px), 94vw); max-height: 90vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--primary-dark); }
.modal.lg { width: min(clamp(900px, 66vw, 1120px), 94vw); } .modal.sm { width: min(clamp(420px, 31vw, 500px), 94vw); }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; background: var(--primary); color: #fff; }
.modal-head h2 { color: #fff; }
.modal-body { padding: 14px; overflow: auto; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line-soft); background: var(--tint); }
.modal-foot .spacer { flex: 1; }
.x { border: 0; background: none; line-height: 1; color: inherit; cursor: pointer; padding: 0 2px; opacity: .85; } .x:hover { opacity: 1; }
table.data .x { color: var(--danger); }

.toasts { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 90; display: grid; gap: 6px; justify-items: center; }
.toast { background: var(--rail); color: #fff; border: 1px solid var(--rail-light); padding: 7px 14px; font-size: var(--fs-sm); max-width: 70vw; }
.toast.error { background: var(--danger); border-color: #9e1f24; } .toast.ok { background: var(--ok); border-color: #095e2e; }

/* Simple bar charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 16px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars .fill { width: 100%; max-width: 44px; background: var(--primary); min-height: 2px; }
.bars .cap { color: var(--muted); font-size: var(--fs-xs); } .bars .val { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; }
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 8px; padding: 4px 0; font-size: var(--fs-sm); }
.hbar .track { height: 8px; background: var(--grey-soft); overflow: hidden; } .hbar .track i { display: block; height: 100%; background: var(--primary); }
.hbar strong { font-family: var(--mono); }

.kv { display: grid; grid-template-columns: clamp(130px, 10.3vw, 170px) 1fr; gap: 4px 10px; font-size: var(--fs-sm); } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs button { padding: 6px 14px; border: 1px solid var(--line); border-bottom: 0; background: var(--tint-2); font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--primary-dark); font-weight: 600; margin-bottom: -1px; padding-bottom: 7px; }
.totals { margin-left: auto; width: 280px; display: grid; gap: 4px; padding-top: 8px; font-size: var(--fs-sm); }
.totals div { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .totals strong, .totals span:last-child { font-family: var(--mono); }
.totals .grand { font-size: var(--fs-lg); font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.totals input { width: 110px; text-align: right; font-family: var(--mono); }
.alert { padding: 6px 10px; background: var(--tint-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--accent); color: var(--ink); font-size: var(--fs-sm); margin-bottom: 10px; }

/* flatpickr, dressed the same way */
.flatpickr-calendar { border-radius: 2px !important; border: 1px solid var(--primary-dark); box-shadow: none !important; font-family: var(--font); font-size: var(--fs-sm); }
.flatpickr-calendar:before, .flatpickr-calendar:after { display: none; }
.flatpickr-months { background: var(--primary); padding: 3px 0; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month input.cur-year, .flatpickr-current-month .flatpickr-monthDropdown-months { color: #fff; fill: #fff; background: var(--primary); }
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--primary); color: #fff; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: #fff; fill: #fff; padding: 6px 9px; }
.flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg { fill: #fff; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--accent); }
.numInputWrapper span.arrowUp:after { border-bottom-color: #fff; } .numInputWrapper span.arrowDown:after { border-top-color: #fff; }
.flatpickr-weekdays { background: var(--primary); }
span.flatpickr-weekday { background: var(--primary); color: #fbf3e8; font-size: var(--fs-xxs); font-weight: 600; }
.flatpickr-day { border-radius: 2px !important; font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink); border-color: transparent; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--primary-soft); border-color: var(--line-soft); }
.flatpickr-day.today { border-color: var(--warn); font-weight: 600; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--line); }

/* Printing: only the print area is shown */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  body { background: #fff; }
  #print-area { display: block; }
}

/* ---- Themes: only the colour variables change ---- */
/* The earlier themes keep their cool greys. */
html[data-theme="sky"], html[data-theme="navy"], html[data-theme="teal"], html[data-theme="green"], html[data-theme="purple"], html[data-theme="slate"] {
  --bg: #f3f5f8; --ink: #10203f; --muted: #4a5a76; --line: #c3d0e3; --line-soft: #e3e9f2; --cream: #fffbef; --tint: #f7fafe; --tint-2: #edf2fa;
  --grey-soft: #edf0f5; --accent: var(--primary); --rail-ink: #fff; --rail-active: rgba(255, 255, 255, .22); --scrim: rgba(16, 32, 63, .5);
}
html[data-theme="sky"] { --primary: #2f8ff2; --primary-dark: #1f74d0; --primary-soft: #e6f1fd; --rail: #2f8ff2; --rail-light: #4ea2f8; }
html[data-theme="navy"] { --primary: #2d5ba8; --primary-dark: #1c3f94; --primary-soft: #e7effb; --rail: #1c3f94; --rail-light: #2d5ba8; }
html[data-theme="teal"] { --primary: #0f8f83; --primary-dark: #0b6f66; --primary-soft: #e0f4f1; --rail: #0f766e; --rail-light: #14968b; }
html[data-theme="purple"] { --primary: #7c3aed; --primary-dark: #5b21b6; --primary-soft: #efe7fd; --rail: #5b21b6; --rail-light: #7c3aed; }
html[data-theme="green"] { --primary: #2e9e5b; --primary-dark: #1f7a45; --primary-soft: #e3f5ea; --rail: #1f7a45; --rail-light: #2e9e5b; }
html[data-theme="slate"] { --primary: #475569; --primary-dark: #334155; --primary-soft: #e8edf3; --rail: #1e293b; --rail-light: #334155; }
html[data-theme="dark"] {
  --accent: var(--primary); --rail-ink: #fff; --rail-active: rgba(255, 255, 255, .14); --scrim: rgba(0, 0, 0, .62);
  --bg: #0f1722; --surface: #18222f; --ink: #e4ebf5; --muted: #9aa9bd; --line: #33445a; --line-soft: #263447;
  --cream: #121b27; --tint: #1d2938; --tint-2: #223043; --grey-soft: #223043;
  --primary: #4ea2f8; --primary-dark: #2f8ff2; --primary-soft: #1c3350; --rail: #0b1220; --rail-light: #16233a;
  --ok-soft: #12352a; --warn-soft: #3b2e12; --danger-soft: #3d1a1d; --info-soft: #1b2c4d; --ok: #86c59a; --warn: #dcae62; --danger: #e59488; --info: #a3b8d8;
}
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #121b27; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #33445a; border-color: #121b27; }
html[data-theme="dark"] table.data tbody tr.rowlink:hover td, html[data-theme="dark"] .cal-slot:hover { background: #223043; }
html[data-theme="dark"] .tabs button { background: #1d2938; }
/* Text size */
html[data-scale="small"] { --fs: 12px; --fs-sm: 11.5px; --fs-xs: 10.5px; --fs-xxs: 10px; --fs-lg: 13px; --fs-xl: 19px; }
html[data-scale="large"] { --fs: 14.5px; --fs-sm: 14px; --fs-xs: 12.5px; --fs-xxs: 11.5px; --fs-lg: 16px; --fs-xl: 24px; }

/* ---- Feel: short transitions and a soft entrance for screens and popups ---- */
.btn, .pcard, .chip, .subnav button, .tabs button, .alert-row, .stat, input, select, textarea { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
@keyframes nk-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes nk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nk-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
/* A screen eases in when it is opened (the router marks that moment); a record eases in when it is chosen. */
.content.nav-in > * { animation: nk-in .18s ease-out; }
.split-detail > * { animation: nk-fade .14s ease-out; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, .rail-item:focus-visible, .pcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Tabs take the width of the bar; those that do not fit wait behind More, so the row never runs off the edge. */
.topbar-left { flex: 1 1 auto; }
.subnav { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.subnav button { flex: none; }
.subnav .subnav-more { display: inline-flex; align-items: center; gap: 7px; }
.subnav-more::after { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.topbar-left { gap: 8px; }
.rail-brand, .rail-scroll { font: inherit; }
.card-head h2 { white-space: nowrap; }
.toolbar > input, .toolbar > select { width: auto; }
.branch-pick { width: auto; max-width: 190px; padding: 4px 8px; font-size: var(--fs-xs); background: var(--surface); }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-swatch { display: grid; gap: 4px; justify-items: center; padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-xs); cursor: pointer; min-width: 84px; }
.theme-swatch i { display: block; width: 54px; height: 26px; border: 1px solid rgba(0, 0, 0, .15); }
.theme-swatch.active { border-color: var(--primary); background: var(--primary-soft); }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 6px 8px; border: 1px solid var(--line); background: var(--cream); }
.check-list label { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: var(--fs); color: var(--ink); }
.chart { width: 100%; height: 260px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.board .card-body { padding: 0; }
.tick-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); cursor: pointer; }
.tick-row.done { color: var(--muted); text-decoration: line-through; }
.stmt { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.stmt td { padding: 4px 12px; border-bottom: 1px solid var(--line-soft); }
.stmt td.num { text-align: right; font-family: var(--mono); white-space: nowrap; width: 160px; }
.stmt tr.hd td { background: var(--tint-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--primary-dark); }
.stmt tr.tot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--tint); }

/* ---- DataTables, dressed like the rest ---- */
div.dt-container { font-size: var(--fs-sm); color: var(--ink); }
div.dt-container .dt-layout-row { padding: 6px 9px; margin: 0 !important; }
div.dt-container .dt-layout-row.dt-layout-table { padding: 0; }
div.dt-container .dt-search input, div.dt-container .dt-length select { width: auto; background: var(--cream); border: 1px solid var(--line); padding: 3px 7px; font-family: var(--font); font-size: var(--fs-sm); color: var(--ink); border-radius: 2px; }
div.dt-container .dt-search input:focus { border-color: var(--primary); background: var(--surface); outline: none; }
div.dt-container .dt-info { color: var(--muted); font-size: var(--fs-xs); }
div.dt-container .dt-paging .dt-paging-button { border-radius: 2px !important; border: 1px solid var(--line) !important; background: var(--surface) !important; color: var(--ink) !important; padding: 2px 9px !important; margin: 0 2px !important; font-size: var(--fs-sm) !important; }
div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) { background: var(--primary-soft) !important; border-color: var(--primary) !important; }
div.dt-container .dt-paging .dt-paging-button.current { background: var(--primary) !important; border-color: var(--primary-dark) !important; color: #fff !important; }
div.dt-container .dt-paging .dt-paging-button.disabled { opacity: .4; }
table.dataTable { border-collapse: collapse !important; width: 100% !important; margin: 0 !important; }
table.dataTable thead th { text-align: left !important; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 6px 9px !important; border-bottom: 1px solid var(--line) !important; background: var(--tint-2); white-space: nowrap; }
table.dataTable tbody td { padding: 5px 9px !important; border-top: 0 !important; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.dataTable tbody tr:nth-child(even) > * { background: var(--tint); box-shadow: none !important; }
table.dataTable tbody tr:nth-child(odd) > * { box-shadow: none !important; }
table.dataTable tbody tr.rowlink { cursor: pointer; }
table.dataTable tbody tr.rowlink:hover > * { background: var(--primary-soft) !important; }
table.dataTable td.num, table.dataTable th.num { text-align: right !important; font-family: var(--mono); }

/* ---- Row context menu ---- */
.ctx { position: fixed; z-index: 1300; min-width: 196px; max-width: 320px; background: var(--surface); border: 1px solid var(--primary-dark); padding: 3px; animation: nk-in .1s ease-out; }
.ctx button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; padding: 5px 9px; cursor: pointer; font: inherit; font-size: var(--fs-sm); color: var(--ink); }
.ctx button:hover:not(:disabled) { background: var(--primary-soft); }
.ctx button:disabled { opacity: .4; cursor: not-allowed; }
.ctx button.danger { color: var(--danger); }
.ctx button svg.icon { width: 15px; height: 15px; color: var(--primary-dark); }
.ctx button.danger svg.icon { color: var(--danger); }
.ctx button em { margin-left: auto; font-style: normal; font-size: var(--fs-xxs); color: var(--muted); }
.ctx .sep { height: 1px; background: var(--line-soft); margin: 3px 0; }
.ctx .hd { font-size: var(--fs-xxs); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; color: var(--muted); padding: 5px 9px 3px; }
.rail-item { min-height: 44px; }

/* ---- Finish: figures that line up, underline tabs, headline strips ---- */
strong, b { font-weight: 600; }
::selection { background: var(--primary-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
table, .stat .value, .kpi .value, .totals, .cal-time, .flatpickr-day, .donut-list, .alert-row strong, input[type=number] { font-variant-numeric: tabular-nums; }
.topbar-left h1 { font-family: var(--display); font-size: var(--fs-lg); letter-spacing: -.01em; }
.subnav button { border-bottom-width: 2px; }
.stat .value { font-family: var(--display); letter-spacing: -.01em; }
.tabs { gap: 0; border-bottom-color: var(--line-soft); }
.tabs button, html[data-theme="dark"] .tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 6px 12px; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: none; border-bottom-color: var(--primary); margin-bottom: -1px; padding-bottom: 6px; }
.tick-row.rowlink::after { content: '\22EF'; color: var(--muted); margin-left: 2px; }
.split-empty .pic { background: none; border: 0; width: auto; height: auto; margin-bottom: 12px; }
.split-empty .pic svg.icon { color: var(--line); }

/* Switches: every checkbox in the system is a round on/off switch */
input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 30px; height: 17px; padding: 0 !important; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--grey-soft); cursor: pointer; vertical-align: middle; transition: background-color .15s ease, border-color .15s ease; }
input[type=checkbox]::before { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-sizing: border-box; transition: transform .15s ease; }
input[type=checkbox]:focus { background: var(--grey-soft); border-color: var(--line); }
input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary-dark); }
input[type=checkbox]:checked::before { transform: translateX(13px); border-color: transparent; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; border-style: solid; }
input[type=checkbox]:disabled:not(:checked) { background: var(--grey-soft); }
/* A choice of one (radio): a small round dot, never the full width the other boxes take */
input[type=radio] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 16px; height: 16px; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; vertical-align: middle; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
input[type=radio]:hover { border-color: var(--primary); }
input[type=radio]:checked { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }
input[type=radio]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Headline figures: one card, one cell per figure */
.kpis { display: grid; }
.kpi { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-left: 1px solid var(--line-soft); min-width: 0; transition: background-color .12s ease; }
.kpi:first-child { border-left: 0; }
.kpi-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); }
.kpi-icon svg.icon { width: 16px; height: 16px; }
.kpi-text { min-width: 0; }
.kpi .label, .kpi .hint { color: var(--muted); font-size: var(--fs-xs); }
.kpi .value { font-family: var(--display); font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value.bad { color: var(--danger); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { background: var(--tint); }

/* Dashboard */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 10px; }
.page-head h2 { font-family: var(--display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.page-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; align-items: start; }
.dash-col { display: grid; gap: 8px; min-width: 0; }
.dash .chart { height: 200px; }
.glance .alert-row:last-child { border-bottom: 0; }
.donut { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; }
.donut-chart { height: 132px; }
.donut-list { display: grid; gap: 6px; font-size: var(--fs-sm); }
.donut-list div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 34px; gap: 8px; align-items: center; }
.donut-list i { width: 9px; height: 9px; }
.donut-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-list em { font-style: normal; color: var(--muted); font-size: var(--fs-xs); text-align: right; }

/* Staff chat, in the manner of a phone messenger: round pictures, rounded bubbles, a pill to type in.
   This is the one screen where corners are deliberately round. */
.chat-list { width: clamp(260px, 22.8vw, 350px); }
.chat-list .split-search input { border-radius: 16px; padding: 6px 14px; background: var(--tint-2); border-color: transparent; }
.chat-list .split-search input:focus { background: var(--surface); border-color: var(--primary); }
.chat-rooms { padding: 2px 6px 10px; gap: 1px; }
.chat-room { gap: 11px; padding: 8px 9px; border: 0; border-radius: 10px; }
.chat-room:hover { background: var(--tint-2); }
.chat-room.active { background: var(--primary-soft); border: 0; }
.chat-room .avatar-lg, .chat-head .avatar-lg { width: 40px; height: 40px; border-radius: 50%; font-size: var(--fs-lg); }
.chat-room .lines { gap: 2px; }
.chat-room .top, .chat-room .bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-room .top strong { flex: 1; min-width: 0; font-weight: 600; }
.chat-room .top time { flex: none; color: var(--muted); font-size: var(--fs-xxs); }
.chat-room .bottom span { flex: 1; min-width: 0; }
.chat-count { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-style: normal; font-size: var(--fs-xxs); font-weight: 600; line-height: 18px; text-align: center; }
.chat-main { background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 8px 16px; min-height: 57px; }
.chat-head .lines { display: grid; min-width: 0; }
.chat-head .lines strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .lines span { color: var(--muted); font-size: var(--fs-xs); }
.chat-thread { padding: 14px 18px; gap: 8px; }
.chat-day { align-self: center; margin: 8px 0 4px; padding: 3px 12px; border-radius: 12px; background: var(--tint-2); color: var(--muted); font-size: var(--fs-xxs); }
.msg { max-width: min(68%, 560px); padding: 7px 12px 6px; border: 1px solid var(--line-soft); border-radius: 16px 16px 16px 5px; background: var(--surface); line-height: 1.45; }
.msg.mine { border-color: transparent; border-radius: 16px 16px 5px 16px; background: var(--primary-soft); }
.msg.follows { margin-top: -4px; }
.msg .who { margin-bottom: 1px; font-size: var(--fs-xs); font-weight: 600; }
.msg .body time { float: right; margin: 7px 0 0 14px; color: var(--muted); font-size: var(--fs-xxs); line-height: 1; }
.chat-compose { align-items: flex-end; gap: 9px; padding: 9px 16px 11px; border-top: 1px solid var(--line-soft); }
.chat-compose textarea { min-height: 36px; max-height: 120px; padding: 8px 15px; border-radius: 18px; background: var(--tint-2); border-color: transparent; resize: none; line-height: 1.4; overflow-y: hidden; }
/* The box grows with its words (fit() in the chat pages); only at its full height does it scroll. */
.chat-compose textarea.tall { overflow-y: auto; }
.chat-compose textarea:focus { background: var(--surface); border-color: var(--primary); }
.chat-send { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .12s ease; }
.chat-send:hover { background: var(--primary-dark); }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-send svg.icon { width: 17px; height: 17px; }
html[data-theme="dark"] .msg.mine { background: var(--primary-soft); }
/* Files in the staff chat: the picture itself, or a card that opens the file. */
.chat-main .chat-compose { position: relative; }
.chat-main .chat-compose .wa-tool { margin-bottom: 0; }
.wa-attach.chat-attach { grid-template-columns: repeat(4, 92px); }
.msg.has-file { padding-top: 5px; }
.chat-photo { display: block; width: auto; max-width: 300px; max-height: 300px; min-width: 140px; min-height: 100px; margin: 0 -7px 5px; border-radius: 12px; background: var(--tint-2); object-fit: cover; cursor: zoom-in; opacity: 0; transition: opacity .2s ease; }
.chat-photo.ready { min-width: 0; min-height: 0; opacity: 1; }
.chat-file { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 220px; margin: 0 -5px 5px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--tint-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.chat-file:hover { background: var(--tint); }
.msg.mine .chat-file { background: rgba(255, 255, 255, .5); }
.chat-file-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; }
.chat-file-ico svg.icon { width: 18px; height: 18px; }
.chat-file .lines { min-width: 0; display: grid; }
.chat-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-file .lines span { color: var(--muted); font-size: var(--fs-xxs); }
.chat-main.dropping .chat-thread { outline: 2px dashed var(--primary); outline-offset: -8px; }
/* Phone numbers, email addresses, links and places found in messages (App.richText), and contact cards. */
.rich { white-space: pre-wrap; overflow-wrap: anywhere; }
.spot { color: var(--primary-dark); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; overflow-wrap: anywhere; }
/* A menu heading never widens the menu: a long one is clipped. */
.ctx .hd { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx { max-width: min(360px, calc(100vw - 24px)); }
.spot:hover { text-decoration-style: solid; }
.wa-cards { display: grid; gap: 6px; margin: 2px 0 4px; }
.wa-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; min-width: 230px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.wa-card .lines { display: grid; gap: 2px; min-width: 0; }
.wa-card .lines strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-card-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
/* The map for sharing a location (Leaflet, OpenStreetMap). */
.wa-geo { display: grid; gap: 10px; }
.wa-geo-search { display: flex; gap: 8px; }
.wa-geo-search input { flex: 1; }
.wa-geo-hits { display: grid; gap: 4px; max-height: 160px; overflow: auto; }
.wa-geo-hits button { display: grid; gap: 1px; padding: 8px 12px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.wa-geo-hits button:hover { background: var(--tint); }
.wa-geo-hits strong { font-weight: 600; }
.wa-geo-hits span { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-map { height: 340px; overflow: hidden; background: var(--tint-2); cursor: crosshair; }
.wa-map .leaflet-control-attribution { font-size: 10px; }
.leaflet-container { font: inherit; }
/* What OneBot did lately (WhatsApp > Set up > Assistant). */
.ob-log { margin: 4px 0 0; padding: 8px 10px; max-height: 140px; overflow: auto; border: 1px solid var(--line-soft); background: var(--tint-2); color: var(--muted); font: inherit; font-size: var(--fs-xs); white-space: pre-wrap; }
html[data-theme="dark"] .msg.mine .chat-file { background: rgba(0, 0, 0, .18); }

/* Forms: boxes are low, so they are never drawn long. A form takes as many columns as fit
   instead of stretching two across, and a single-line box stops at a comfortable width. */
.form-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, calc(50% - 5px)), 1fr)); }
/* A field is its caption over its box. In each row the captions share one line and the boxes the next,
   so a caption that runs to two lines never pushes its box out of step with its neighbours. */
.form-grid > label:not(.check) { grid-row: span 2; grid-template-rows: subgrid; row-gap: 3px; align-items: end; }
.form-grid > label:not(.check) > input, .form-grid > label:not(.check) > select, .form-grid > label:not(.check) > textarea,
.form-grid > label:not(.check) > .picker, .form-grid > label:not(.check) > .check-list { align-self: start; }
.form-grid > label.check { grid-row: span 2; align-self: end; padding: 0 0 5px; }
/* Notes and lists are two fields wide, not the whole width of the form. */
.form-grid .wide, .form-grid > label:has(> textarea) { grid-column: span 2; }
.form-grid .form-error, .form-grid > .form-grid { grid-column: 1 / -1; }
label > input:not([type=checkbox]), label > select, label > .picker { max-width: 420px; }

/* Signing on screen: a white sheet with a line to sign on */
.sig-pad-wrap { position: relative; width: 562px; max-width: 100%; margin: 0 auto; }
.sig-pad { display: block; max-width: 100%; background: #fff; border: 1px solid var(--line); cursor: crosshair; touch-action: none; }
.sig-pad-line { position: absolute; left: 30px; right: 30px; top: 160px; border-top: 1px dashed var(--line); pointer-events: none; }
.sig-mine { display: grid; place-items: center; min-height: 86px; padding: 8px; background: #fff; border: 1px solid var(--line-soft); }
.sig-mine img { max-height: 70px; max-width: 260px; }

/* Logos on the Company details page, and signature pictures in HR */
.logo-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.logo-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-row .logo-preview { width: 96px; height: 70px; background: #fff; border: 1px solid var(--line-soft); }
.sig-thumb { display: block; max-height: 34px; max-width: 150px; background: #fff; }

/* A document as it will look on paper, shown before it is printed or saved as a PDF */
.doc-preview { min-height: 360px; padding: 26px 30px; background: #fff; border: 1px solid var(--line-soft); overflow: auto; }
.company-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }

/* Help: the user guide, contents on the left and the text on the right */
.guide-toc { width: clamp(210px, 18.4vw, 290px); }
.guide-toc-list { gap: 1px; padding: 0 8px 10px; }
.guide-link { display: block; width: 100%; padding: 5px 10px; border: 0; border-left: 3px solid transparent; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; transition: background-color .12s ease; }
.guide-link:hover { background: var(--tint); }
.guide-link.active { border-left-color: var(--accent); background: var(--primary-soft); font-weight: 600; }
.guide-body { max-width: 860px; }
.guide-sec { background: var(--surface); border: 1px solid var(--line); padding: 14px 18px 12px; margin-bottom: 8px; }
.guide-sec h2 { font-family: var(--display); font-size: var(--fs-lg); letter-spacing: -.01em; margin-bottom: 6px; }
.guide-sec h3 { margin: 14px 0 4px; color: var(--primary-dark); }
.guide-sec p { margin: 6px 0; line-height: 1.55; }
.guide-sec ol, .guide-sec ul { margin: 6px 0; padding-left: 20px; line-height: 1.6; }
.guide-sec .g-note { padding: 6px 10px; background: var(--tint-2); border-left: 3px solid var(--accent); font-size: var(--fs-sm); }
.guide-sec table.data { margin: 8px 0; border: 1px solid var(--line-soft); }
.guide-sec table.data td { vertical-align: top; }
.guide-sec table.data td:first-child { width: 1%; white-space: nowrap; font-weight: 600; }

/* Time picker: opens under the field when it is clicked; hour first, then minute */
.time-input { font-variant-numeric: tabular-nums; }
.timepop { position: fixed; z-index: 1200; width: 236px; background: var(--surface); border: 1px solid var(--primary-dark); font-size: var(--fs-sm); animation: nk-in .1s ease-out; }
.timepop-head { padding: 6px 10px; background: var(--primary); color: #fff; font-family: var(--display); font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.timepop-body { padding: 8px 10px 2px; }
.timepop-label { margin-bottom: 4px; font-size: var(--fs-xxs); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.timepop-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin-bottom: 8px; }
.timepop-grid button { height: 26px; padding: 0; border: 1px solid transparent; background: none; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .1s ease; }
.timepop-grid button:hover { background: var(--primary-soft); border-color: var(--line-soft); }
.timepop-grid button.on, .timepop-grid button.on:hover { background: var(--primary); border-color: var(--primary-dark); color: #fff; font-weight: 600; }
.timepop-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line-soft); background: var(--tint); }
.timepop-foot .grow { flex: 1; }

/* ---- Brand: the clinic's logo in the menu and on the sign-in screen, gold for what is selected ---- */
.rail, .rail-item, .rail-brand, .rail-scroll { color: var(--rail-ink); }
.rail-brand { height: 54px; padding: 0; background: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.rail-brand img { width: 38px; height: 38px; display: block; }
/* The menu is only as wide as its longest label; icons and row heights stay as they were. */
.rail { width: max-content; }
.rail-item { padding: 4px 9px; white-space: nowrap; }
.rail-badge { right: 6px; }
.rail-item.active::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; background: var(--accent); }
.subnav button.active, .tabs button.active { border-bottom-color: var(--accent); }
.logo-preview { width: 92px; height: 92px; flex: none; object-fit: contain; }

/* ---- Smooth: how things arrive, leave and settle ---- */
/* Popups: the page dims and the popup rises into place; both fade when it is closed. */
.modal-back { animation: nk-fade .16s ease-out; transition: opacity .12s ease-in; }
.modal { animation: nk-pop .2s cubic-bezier(.2, .75, .25, 1); transition: transform .12s ease-in; }
.modal-back.closing { opacity: 0; pointer-events: none; }
.modal-back.closing .modal { transform: translateY(6px); }
.picker-list { animation: nk-in .1s ease-out; }
/* Signing in and out. */
.app, .login { animation: nk-fade .22s ease-out; }
.login-card { animation: nk-in .28s ease-out; }
/* Notices: an icon, a slide up, a slide away. */
.toasts { pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; pointer-events: auto; cursor: default; animation: nk-toast .22s cubic-bezier(.2, .75, .25, 1); transition: opacity .18s ease, transform .18s ease; }
.toast svg.icon { width: 16px; height: 16px; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@keyframes nk-toast { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Tabs of a module: one marker that slides to the open tab. */
.subnav button.active { border-bottom-color: transparent; }
.subnav-ink { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); pointer-events: none; }
.subnav-ink.moving { transition: transform .22s cubic-bezier(.3, .7, .3, 1), width .22s cubic-bezier(.3, .7, .3, 1); }
/* The menu: resting entries sit back a little, the open one is marked with a bar that grows in. */
.rail-item { color: color-mix(in srgb, var(--rail-ink) 76%, transparent); transition: background-color .14s ease, color .14s ease; }
.rail-item:hover, .rail-item.active, .rail-foot .rail-item:hover { color: var(--rail-ink); }
.rail-item.active::before { animation: nk-mark .2s ease-out; transform-origin: center; }
@keyframes nk-mark { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Rows and cards answer the pointer without a jump. */
table.data td, table.dataTable tbody td, .cal-slot, .ctx button, .picker-list div, .chat-room, .tick-row, .theme-swatch, .load-more { transition: background-color .1s ease, border-color .1s ease; }
.pcard:hover { background: var(--surface); }
.pcard.active:hover { background: var(--primary-soft); }
.btn { transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .06s ease; }
input:not([type=checkbox]):hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--line) 68%, var(--muted)); }
/* Keyboard focus is shown the same way everywhere. */
.subnav button:focus-visible, .tabs button:focus-visible, .ctx button:focus-visible, .alert-row:focus-visible, .chip:focus-visible, .guide-link:focus-visible,
.chat-room:focus-visible, .theme-swatch:focus-visible, .login-eye:focus-visible, .load-more:focus-visible, .x:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rail-item:focus-visible { outline-color: var(--accent); outline-offset: -2px; }
/* The frame of the app is not text: it is not selected by a stray drag, and pictures are not dragged about. */
.rail, .topbar, .btn, .tabs, .ctx, .modal-head, .toast, .split-head h2, .flatpickr-calendar, .timepop, .badge { user-select: none; }
img { -webkit-user-drag: none; }
/* Room for the scrollbar is always kept, so a screen does not shift sideways when one appears. */
.content { scrollbar-gutter: stable; padding-right: 0; overscroll-behavior: contain; }
.content.split-mode { scrollbar-gutter: auto; }
.split-detail { scrollbar-gutter: stable; padding-right: 2px; overscroll-behavior: contain; }
.cards { scrollbar-gutter: stable; padding-right: 2px; overscroll-behavior: contain; }
.modal-body { scrollbar-gutter: stable; padding-right: 4px; overscroll-behavior: contain; }
.picker-list, .chat-thread, .chat-rooms { overscroll-behavior: contain; }
/* The heading of a record: its name on the left, its buttons kept together on the right. */
/* When the buttons do not fit beside the name they move below it together, still on the right. */
.detail-head { align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; }
.detail-head h2 { flex: 0 1 auto; max-width: 100%; min-height: 30px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.detail-head .toolbar { flex: 0 1 auto; min-width: 0; margin-left: auto; justify-content: flex-end; gap: 6px; }
/* Grids: the sort mark sits beside the heading and shows only on the sorted column or under the pointer. */
table.dataTable thead > tr > th div.dt-column-header { flex-direction: row; justify-content: flex-start; gap: 5px; }
/* A figure column's heading ends where its figures end; its sort mark stands before the heading. */
table.dataTable thead > tr > th.num div.dt-column-header, table.dataTable thead > tr > th.dt-type-numeric div.dt-column-header { flex-direction: row-reverse; justify-content: flex-start; }
table.dataTable thead > tr > th div.dt-column-header .dt-column-title { flex-grow: 0; }
table.dataTable thead > tr > th .dt-column-order { opacity: 0; transition: opacity .12s ease; }
table.dataTable thead > tr > th:hover .dt-column-order, table.dataTable thead > tr > th.dt-ordering-asc .dt-column-order, table.dataTable thead > tr > th.dt-ordering-desc .dt-column-order { opacity: 1; }
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc { cursor: pointer; transition: color .12s ease; }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc { color: var(--ink); }
div.dt-container .dt-length, div.dt-container .dt-search { display: flex; align-items: center; gap: 7px; }
div.dt-container .dt-length label, div.dt-container .dt-search label { display: inline; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
div.dt-container .dt-paging .dt-paging-button { transition: background-color .12s ease, border-color .12s ease; }
/* The calendar's month heading is the size of a popup title, not larger. */
.flatpickr-current-month { font-size: var(--fs-lg); font-weight: 600; padding-top: 10px; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 3px; height: 34px; padding: 0 10px; display: flex; align-items: center; }
.flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year { font-weight: 600; }
/* A chart with nothing to draw says so. */
.chart-empty { display: grid; place-items: center; color: var(--muted); font-size: var(--fs-sm); }
/* ---- Fit: the whole interface is scaled to the window by the app (main/fit.js); these rules settle the rest ---- */
/* In a short window the menu closes up a little, so every module is still in view without scrolling.
   (The foot of the menu holds five buttons: WhatsApp, the bell, help, settings, sign out.) */
@media (max-height: 800px) {
  .rail-nav { gap: 6px; padding: 6px 0; }
  .rail-brand { height: 48px; }
  .rail-item { min-height: 40px; padding-top: 2px; padding-bottom: 2px; }
  .rail-foot .rail-item { min-height: 33px; }
}
/* In a very short one it closes up further. The icons keep their size. */
@media (max-height: 720px) {
  .rail-nav { gap: 2px; padding: 4px 0; }
  .rail-foot { gap: 0; }
  .rail-brand { height: 44px; }
  .rail-brand img { width: 34px; height: 34px; }
  .rail-item { min-height: 36px; padding-top: 1px; padding-bottom: 1px; gap: 1px; }
  .rail-foot .rail-item { min-height: 30px; }
}
/* People who ask their computer for less movement get none. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- Precision: the details a careful look at every screen turned up ---- */
/* Headline figures stay on one line; the app sets a long one smaller until it fits (fitFigures). */
.stat .value { white-space: nowrap; overflow: hidden; }
/* A list of facts keeps its rows together at the top, however tall the card beside it. */
.kv { align-content: start; }
/* Switches form their own row in a form, and the field after them starts a new one. */
.form-grid > label:not(.check) + label.check, .form-grid > label.check + label:not(.check) { grid-column-start: 1; }
/* A typeahead's list is as wide as its longest entry, each on one line. */
.picker-list { width: max-content; max-width: min(440px, 80vw); }
.picker-list div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* In a table of lines to fill in, a cell of plain text lines up with its heading. */
table.items td:not(:has(input)):not(:has(select)):not(.actions) { padding: 5px 9px; }
/* The search box of a grid shows its whole prompt. */
div.dt-container .dt-search input { width: 250px; max-width: 42vw; }
/* A cell that gives way: it takes the room that is left and is shortened when there is little. */
table.data .clip { max-width: 0; width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1250px) { .dash .col-type { display: none; } }
/* Board rows: a name on one line with a quieter line beneath it; what stands at the right never wraps. */
.tick-row { min-width: 0; }
.tick-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tick-title, .tick-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick-main small { color: var(--muted); font-size: var(--fs-xs); }
.tick-token { flex: none; min-width: 20px; }
.tick-row > .badge, .tick-row > strong, .tick-row > .muted { flex: none; white-space: nowrap; }
/* The roster gives every day the same width. */
table.roster { table-layout: fixed; }
table.roster th:first-child { width: 22%; }
table.roster td { overflow: hidden; }
table.roster .chip, table.roster .badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The title of a list stays on one line beside its buttons. */
.split-head h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Calendar entries keep to their lane. */
.cal-ev { justify-self: start; box-sizing: border-box; min-width: 0; }

/* Money: the line that says what a payment in another currency comes to, and the dollar figure under a bill. */
.fx-note { grid-column: 1 / -1; padding: 6px 9px; background: var(--tint-2); color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.fx-note strong { font-weight: 600; }
.totals .fx-line { color: var(--muted); font-size: var(--fs-xs); }
.totals .fx-line span:last-child { font-family: var(--font); }

/* ---- Hand: nothing here is a pastel pill ---- */
/* One quiet tile behind every initial. */
.avatar-lg { background: var(--primary-soft); color: var(--primary-dark); }
/* The marks on the menu that say something is waiting are in the brand's gold. */
.alert-dot { background: var(--accent); }
.rail-badge { background: var(--accent); color: var(--rail); }
/* Words that explain rather than inform (an empty screen, a line of description) are set small. */
.empty, .split-empty, .chart-empty, .page-head .sub, p.muted { font-size: var(--fs-xs); line-height: 1.5; }
.split-empty .pic svg.icon { width: 44px; height: 44px; }
.split-empty .pic { margin-bottom: 8px; }

/* The three ways a computer can work with the server: a switch, its name, and a line that says what it means. */
.ways { display: grid; gap: 2px; max-width: 760px; }
.way { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid transparent; font-weight: 400; color: var(--ink); cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.way:hover { background: var(--tint); }
.way:has(input:checked) { background: var(--tint); border-color: var(--line-soft); }
.way input { margin-top: 2px; }
.way span { display: grid; gap: 2px; }
.way strong { font-size: var(--fs); font-weight: 600; }
.way small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }

/* A number is typed, not nudged: number boxes have no arrows. A text area has no corner to drag. */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
textarea { resize: none; }
/* The buttons of a page heading stay together on one line; the words beside them give way. */
.page-head > div:first-child { min-width: 0; }
.page-head > .toolbar { flex: none; flex-wrap: nowrap; }
/* The organisation: one table per branch; a department stands beside its roles. */
table.org th:first-child, table.org td.org-dept { width: 190px; }
table.org th:nth-child(2) { width: 220px; }
table.org td { vertical-align: top; }
table.org td.org-dept { font-weight: 600; background: var(--surface) !important; border-right: 1px solid var(--line-soft); }
table.org td.org-dept.muted { font-weight: 400; }
table.org tbody tr:nth-child(even) td { background: none; }

/* Counting a store: the sheet scrolls inside its popup, under headings that stay in view. */
.modal-body .card > table.data thead th { position: sticky; top: 0; z-index: 1; }

/* The locked screen covers everything, in the colour of the menu. */
.lock { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: var(--rail); animation: nk-fade .2s ease-out; }
.lock .login-card { animation: none; }

/* ---- Packages, consent forms, photographs ---- */
.tabs { flex-wrap: wrap; }
.meter { display: inline-block; width: 64px; height: 5px; margin-right: 8px; background: var(--line-soft); vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--primary); }
.meter-text { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.consent-text { margin-top: 12px; padding: 12px 14px; max-height: 34vh; overflow: auto; border: 1px solid var(--line); background: var(--surface); white-space: pre-wrap; font-size: var(--fs-sm); line-height: 1.6; }
.consent-sig { display: block; max-width: 260px; max-height: 110px; padding: 6px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line-soft); }
.photo-wrap { padding: 4px 14px 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.photo { position: relative; display: block; padding: 0; border: 1px solid var(--line); background: var(--tint); color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo-none { display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 8px; text-align: center; color: var(--muted); font-size: var(--fs-xs); }
.photo-cap { display: flex; justify-content: space-between; gap: 6px; padding: 4px 7px; border-top: 1px solid var(--line-soft); background: var(--surface); font-size: var(--fs-xs); }
.photo-cap strong { font-weight: 600; }
.photo-cap span { color: var(--muted); white-space: nowrap; }
.photo.sel { outline: 2px solid var(--primary); outline-offset: -2px; }
.photo-n { position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; background: var(--primary); color: #fff; font-size: var(--fs-xs); font-weight: 600; }
.photo-n:empty { display: none; }
.photo-large img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; }
.cmp-stage { position: relative; height: min(62vh, 620px); background: #1c1410; overflow: hidden; cursor: ew-resize; user-select: none; touch-action: none; }
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.cmp-line i { position: absolute; top: 50%; left: 50%; width: 12px; height: 44px; margin: -22px 0 0 -6px; background: #fff; border: 1px solid var(--primary-dark); border-radius: 2px; }
.cmp-tag { position: absolute; bottom: 8px; padding: 2px 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: var(--fs-xs); pointer-events: none; }
.cmp-tag.left { left: 8px; }
.cmp-tag.right { right: 8px; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-side[hidden], .cmp-stage[hidden] { display: none; }
.cmp-side figure { margin: 0; background: #1c1410; }
.cmp-side img { display: block; width: 100%; height: min(58vh, 580px); object-fit: contain; }
.cmp-side figcaption { padding: 4px 8px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-xs); }

/* ---- Till receipts and medicine labels: narrow paper, black on white ---- */
.slip, .lab { box-sizing: border-box; background: #fff; color: #000; font-family: "DM Sans", "Segoe UI", system-ui, sans-serif; text-align: left; }
.slip { width: 72mm; padding: 3mm 0 4mm; font-size: 11px; line-height: 1.4; }
.slip .s-logo { display: block; max-width: 44mm; max-height: 20mm; margin: 0 auto 2mm; filter: grayscale(1) contrast(1.2); }
.slip .s-c { text-align: center; }
.slip .s-name { font-size: 14px; font-weight: 700; }
.slip .s-title { margin-bottom: 1mm; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.slip .s-rule { margin: 1.6mm 0; border-top: 1px dashed #000; }
.slip .s-row { display: flex; justify-content: space-between; gap: 3mm; font-variant-numeric: tabular-nums; }
.slip .s-row span:last-child { text-align: right; }
.slip .s-item { margin-top: .6mm; font-weight: 600; }
.slip .s-big { margin: .8mm 0; font-size: 14px; font-weight: 700; }
.lab { position: relative; padding: 2mm 2.5mm; overflow: hidden; font-size: 9.5px; line-height: 1.25; break-after: page; }
.lab:last-child { break-after: auto; }
.lab .l-top { display: flex; justify-content: space-between; gap: 2mm; padding-bottom: .7mm; margin-bottom: .9mm; border-bottom: .3mm solid #000; font-size: 8px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.lab .l-top span:first-child { overflow: hidden; text-overflow: ellipsis; }
.lab .l-pat { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab .l-med { display: flex; justify-content: space-between; gap: 2mm; font-weight: 600; }
.lab .l-med span { font-weight: 400; white-space: nowrap; }
.lab .l-how { margin-top: .6mm; font-size: 10.5px; font-weight: 700; }
.lab .l-ins { font-size: 9px; }
.lab .l-foot { position: absolute; left: 2.5mm; right: 2.5mm; bottom: 1.4mm; display: flex; justify-content: space-between; gap: 2mm; font-size: 7.5px; white-space: nowrap; }
.lab.tiny { padding: 1.4mm 2mm; font-size: 8px; }
.lab.tiny .l-pat { font-size: 9px; }
.lab.tiny .l-how { font-size: 8.5px; }
.lab.tiny .l-ins { display: none; }
.slip-preview { display: grid; justify-items: center; gap: 10px; padding: 16px; max-height: 62vh; overflow: auto; background: var(--tint-2); }
.slip-preview .slip { width: 80mm; padding-left: 4mm; padding-right: 4mm; border: 1px solid var(--line); }
.slip-preview .lab { border: 1px solid var(--line); }
@media print { #print-area.narrow .slip { margin: 0 4mm; } }

/* ---- WhatsApp chats: the look of the staff chat, with what a chat with a patient needs ---- */
#btn-whatsapp[hidden] { display: none; }
.rail-foot .rail-badge { top: 2px; right: calc(50% - 21px); min-width: 15px; padding: 2px 3px; border-radius: 8px; }
.chat-main [hidden] { display: none !important; }
.wa-filters { display: flex; gap: 6px; padding: 0 12px 8px; }
.wa-filters button { padding: 3px 11px; border: 1px solid var(--line-soft); border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.wa-filters button.active { border-color: transparent; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.wa-list-tools { display: flex; align-items: center; gap: 6px; }
.wa-head-tools { display: flex; flex: none; gap: 6px; margin-left: auto; }
.wa-dots { padding-left: 7px; padding-right: 7px; }
.wa-none { flex: 1; align-content: center; }
.wa-none svg.icon { width: 56px; height: 56px; margin: 0 auto 10px; color: var(--line); }
.wa-none p { max-width: 420px; margin: 4px auto; font-size: var(--fs-xs); line-height: 1.5; }
.msg.wa { position: relative; padding: 6px 9px 5px; }
.msg.wa .body .wa-meta time { float: none; margin: 0; }
.wa-text a { color: var(--info); text-decoration: underline; }
.wa-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 0 12px; color: var(--muted); font-size: var(--fs-xxs); line-height: 1; }
.wa-meta svg.icon { width: 14px; height: 14px; }
.wa-meta svg.icon.read { color: var(--info); }
.wa-bang { color: var(--danger); font-weight: 700; }
.wa-quote { display: grid; width: 100%; margin: 0 0 5px; padding: 4px 8px; border: 0; border-left: 3px solid var(--primary); border-radius: 6px; background: rgba(0, 0, 0, .05); color: inherit; font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.wa-quote strong { color: var(--primary-dark); font-weight: 600; }
.wa-quote span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="dark"] .wa-quote, html[data-theme="dark"] .wa-doc { background: rgba(255, 255, 255, .07); }
.msg.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-img { display: block; max-width: 260px; max-height: 300px; margin-bottom: 4px; border-radius: 10px; background: var(--tint-2); cursor: pointer; }
.wa-img:not([src]) { display: none; }
.wa-fetch { display: block; width: 220px; margin-bottom: 4px; padding: 26px 10px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.msg.wa.sticker { padding: 0; border-color: transparent; background: none; }
.msg.wa.sticker .wa-img { max-width: 130px; cursor: default; }
.wa-video { display: grid; place-content: center; justify-items: center; gap: 6px; width: 240px; height: 150px; margin-bottom: 4px; border: 0; border-radius: 10px; background: #1c1410; color: #fff; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.wa-video svg.icon { width: 30px; height: 30px; }
.wa-vid { display: block; max-width: 300px; max-height: 320px; margin-bottom: 4px; border-radius: 10px; background: #000; }
.wa-audio { display: flex; align-items: center; gap: 9px; min-width: 230px; }
.wa-play { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; }
.wa-play:disabled { opacity: .5; }
.wa-play svg.icon { width: 16px; height: 16px; }
.wa-wave { flex: 1; min-width: 0; display: grid; gap: 4px; }
.wa-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; cursor: pointer; }
.wa-bar i { display: block; width: 0; height: 100%; background: var(--primary); }
.wa-len { color: var(--muted); font-size: var(--fs-xxs); font-variant-numeric: tabular-nums; }
.wa-doc { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 220px; margin-bottom: 4px; padding: 8px 10px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .05); color: inherit; font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.wa-doc svg.icon { flex: none; width: 20px; height: 20px; color: var(--primary-dark); }
.wa-doc span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wa-doc em { flex: none; color: var(--muted); font-style: normal; font-size: var(--fs-xxs); }
.wa-kind { display: block; margin-bottom: 1px; color: var(--muted); font-size: var(--fs-xxs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.wa-react { position: absolute; bottom: -11px; left: 10px; padding: 1px 6px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); font-size: 12px; line-height: 1.3; }
.msg.wa.mine .wa-react { left: auto; right: 10px; }
.msg.wa:has(.wa-react) { margin-bottom: 9px; }
.msg.wa.failed { border-color: var(--danger); }
.wa-error { clear: both; padding-top: 3px; color: var(--danger); font-size: var(--fs-xxs); }
.wa-more { position: absolute; top: 3px; right: 3px; display: none; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; }
.msg.wa:hover .wa-more { display: grid; }
.wa-more svg.icon { width: 12px; height: 12px; transform: rotate(-90deg); }
.wa-reacts { display: flex; gap: 2px; margin-bottom: 3px; padding: 3px 3px 5px; border-bottom: 1px solid var(--line-soft); }
.ctx .wa-reacts button, .ctx .wa-emoji button { justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; }
.ctx .wa-reacts button.on { background: var(--primary-soft); }
.wa-emoji { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 3px; }
.wa-foot { border-top: 1px solid var(--line-soft); background: var(--surface); }
.wa-foot .chat-compose { border-top: 0; }
.wa-compose { gap: 4px; }
.wa-compose textarea { margin: 0 5px; }
.wa-tool { flex: none; display: grid; place-items: center; width: 34px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.wa-tool:hover { background: var(--tint-2); color: var(--primary-dark); }
.wa-tool svg.icon { width: 20px; height: 20px; }
.wa-replying { display: flex; align-items: center; gap: 10px; margin: 8px 16px 0; padding: 5px 10px; border-left: 3px solid var(--primary); border-radius: 6px; background: var(--tint-2); font-size: var(--fs-xs); }
.wa-replying div { flex: 1; min-width: 0; display: grid; }
.wa-replying strong { color: var(--primary-dark); font-weight: 600; }
.wa-replying span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-replying .x { display: grid; padding: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.wa-closed { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.wa-closed span { flex: 1; }
.wa-closed .btn { flex: none; }
.wa-rec { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: var(--fs-sm); }
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: wa-blink 1s steps(2, start) infinite; }
@keyframes wa-blink { to { visibility: hidden; } }
.wa-rec-time { min-width: 38px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wa-files { display: grid; gap: 8px; max-height: 44vh; overflow: auto; }
.wa-file { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line-soft); }
.wa-file img, .wa-file-ico { flex: none; display: grid; place-items: center; width: 54px; height: 54px; object-fit: cover; background: var(--tint-2); color: var(--primary-dark); }
.wa-file div { min-width: 0; display: grid; }
.wa-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wa-file span { color: var(--muted); font-size: var(--fs-xs); }
.wa-file .x { flex: none; display: grid; margin-left: auto; padding: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.wa-file .x:hover { color: var(--danger); }
/* A chat whose 24 hours have passed: the message box stays, with a word on how what is sent will go. */
.wa-closed.wa-lapsed { gap: 8px; margin: 8px 16px 0; padding: 7px 10px; border-left: 3px solid var(--accent); border-radius: 2px; background: var(--cream); color: var(--ink); }
.wa-closed.wa-lapsed svg.icon { flex: none; width: 16px; height: 16px; color: var(--primary); }
/* Broadcast: the form on the left, a phone showing what one person receives on the right. */
.wa-cast { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.wa-cast-form { display: grid; gap: 12px; min-width: 0; }
.wa-cast-form .form-grid { margin: 0; }
.wa-cast-count { display: flex; align-items: baseline; gap: 4px; padding: 8px 10px; border-radius: 2px; background: var(--tint-2); color: var(--muted); font-size: var(--fs-xs); }
.wa-cast-count strong { color: var(--primary-dark); font-family: var(--display); font-size: 18px; font-weight: 600; }
.wa-cast-tools { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.wa-cast-left { margin-left: auto; color: var(--muted); font-size: var(--fs-xxs); }
.wa-cast-file:empty { display: none; }
.wa-cast-look { position: sticky; top: 0; display: grid; gap: 10px; }
.wa-phone { overflow: hidden; min-height: 360px; border: 7px solid var(--rail); border-radius: 26px; background: #efe7dc; box-shadow: 0 10px 30px rgba(58, 28, 14, .16); }
.wa-phone-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--rail); color: var(--rail-ink); font-size: var(--fs-sm); }
.wa-phone-head .avatar { width: 28px; height: 28px; font-size: 11px; }
.wa-phone-chat { display: grid; gap: 3px; padding: 14px 12px 18px; }
.wa-preview-msg { justify-self: start; max-width: 94%; padding: 4px 4px 6px; border-radius: 2px 12px 12px 12px; background: #fff; color: #2a1b12; font-size: 12.5px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); animation: wa-pop .18s ease-out; }
.wa-preview-msg > div { padding: 2px 6px 0; white-space: pre-wrap; word-break: break-word; }
.wa-preview-msg img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 9px; }
.wa-preview-msg time { display: block; padding: 0 6px; color: #8c7d70; font-size: 10px; text-align: right; }
.wa-preview-media { display: flex; align-items: center; gap: 8px; padding: 18px 12px; border-radius: 9px; background: #f4ede4; color: var(--primary-dark); font-weight: 600; }
.wa-preview-media span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-preview-buttons { display: grid; gap: 3px; max-width: 94%; }
.wa-preview-buttons span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 10px; background: #fff; color: #1a7fbd; font-size: 12.5px; font-weight: 600; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-preview-buttons svg.icon { width: 14px; height: 14px; }
.wa-preview { padding: 14px 12px; border-radius: 2px; background: #efe7dc; }
.wa-cast-state { display: flex; gap: 8px; padding: 8px 10px; border-radius: 2px; background: var(--ok-soft); color: var(--ok); font-size: var(--fs-xs); line-height: 1.45; }
.wa-cast-state.warn { background: var(--warn-soft); color: var(--warn); }
.wa-cast-state svg.icon { flex: none; width: 16px; height: 16px; }
.wa-new { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@keyframes wa-pop { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 900px) { .wa-cast, .wa-new { grid-template-columns: minmax(0, 1fr); } .wa-cast-look { position: static; } }
.wa-copy { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px; }
.wa-copy label { flex: 0 1 440px; display: grid; gap: 3px; }
.wa-copy input { width: 100%; max-width: none; font-size: var(--fs-xs); }

/* A long unbroken value (a token, an address) wraps inside its column instead of pushing past it. */
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* Five headline figures in a narrow window: the icon tiles step aside so that the figures have their room. */
@media (max-width: 1240px) {
  .kpis:has(.kpi:nth-child(5)) .kpi-icon { display: none; }
  .kpis:has(.kpi:nth-child(5)) .kpi { padding-left: 11px; padding-right: 11px; }
}

/* ---- The desk around a WhatsApp chat: the client beside it, notes, quick replies, the pickers ---- */
.wa-side { flex: none; width: clamp(250px, 21vw, 320px); border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; overscroll-behavior: contain; }
.wa-side[hidden] { display: none; }
.wa-side-body { padding: 14px 14px 18px; }
.wa-who { display: grid; justify-items: center; gap: 2px; padding-bottom: 12px; text-align: center; }
.wa-who .avatar-lg { width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; font-size: var(--fs-xl); }
.wa-who strong { font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.wa-who span { color: var(--muted); font-size: var(--fs-xs); }
.wa-tags { margin-top: 5px; color: var(--primary-dark); font-size: var(--fs-xxs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.wa-sec { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.wa-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.wa-sec-head h3 { margin: 0; color: var(--muted); font-size: var(--fs-xxs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.wa-mini { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-soft); border-radius: 2px; background: none; color: var(--primary-dark); cursor: pointer; }
.wa-mini:hover { background: var(--primary-soft); }
.wa-mini svg.icon { width: 13px; height: 13px; }
.wa-kv { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 3px 8px; font-size: var(--fs-xs); }
.wa-kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.wa-nil { color: var(--muted); font-size: var(--fs-xs); }
.wa-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 4px 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.wa-line:hover:not(:disabled) { background: var(--tint-2); }
.wa-line:disabled { cursor: default; }
.wa-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-line em { flex: none; font-style: normal; font-variant-numeric: tabular-nums; }
.wa-visit { display: grid; gap: 1px; width: 100%; margin: 0; padding: 5px 0; border: 0; background: none; color: inherit; font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.wa-visit:hover { background: var(--tint-2); }
.wa-visit span, .wa-visit small { color: var(--muted); }
.wa-visit strong { font-weight: 600; }
.wa-visit small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-head-tools .btn.on { background: var(--primary-soft); border-color: var(--primary); }
.wa-pin { flex: none; display: grid; color: var(--muted); }
.wa-pin svg.icon { width: 12px; height: 12px; }
.chat-room.settled .lines strong { font-weight: 400; color: var(--muted); }
.wa-note { align-self: center; display: flex; gap: 8px; max-width: 80%; padding: 3px 12px; border-radius: 12px; background: var(--tint-2); color: var(--muted); font-size: var(--fs-xxs); line-height: 1.5; text-align: center; }
.wa-note time { flex: none; opacity: .8; }
.wa-ai { margin-right: 3px; font-weight: 600; }
.wa-text strong { font-weight: 600; }
.wa-tool.busy { animation: wa-blink 1s steps(2, start) infinite; }
.wa-quick { margin: 8px 16px 0; border: 1px solid var(--line); background: var(--surface); max-height: 220px; overflow: auto; }
.wa-quick[hidden] { display: none; }
.wa-quick button { display: grid; grid-template-columns: 120px 1fr; gap: 10px; width: 100%; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: inherit; font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.wa-quick button:hover { background: var(--primary-soft); }
.wa-quick button strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-quick button span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-quick .wa-nil { padding: 8px 10px; }
.wa-quick > button.active { background: var(--primary-soft); }
.wa-quick.docs button { grid-template-columns: 230px 1fr; }
/* The list as a work queue: who is on a chat, how long the client has waited, and the "Needs reply" count. */
.wa-filters button { position: relative; }
.wa-filters button em.chat-count { margin-left: 5px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.wa-filters button em[hidden] { display: none; }
.wa-onit { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tint-2); color: var(--muted); font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.wa-filters { flex-wrap: wrap; }
.wa-filters button { white-space: nowrap; }
.wa-wait { flex: none; color: var(--muted); font-style: normal; font-size: var(--fs-xxs); white-space: nowrap; }
.wa-wait.late { color: var(--danger); font-weight: 600; }
/* The conversation sits at the bottom, by the box, as in a phone; a short one leaves its room above. */
.chat-thread > :first-child { margin-top: auto; }
.chat-day.chat-new { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.wa-foot { position: relative; }
.wa-jump { position: absolute; right: 18px; top: -42px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--primary-dark); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.wa-jump[hidden] { display: none; }
.wa-jump svg.icon { width: 14px; height: 14px; }
.turn-down { display: inline-grid; } .turn-down svg.icon { transform: rotate(90deg); } .turn-up svg.icon { transform: rotate(-90deg); }
.wa-jump b:empty { display: none; }
/* On a bubble: reply, react, more, on hover. */
.wa-acts { position: absolute; top: -13px; right: 8px; display: none; gap: 1px; padding: 2px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface); }
.msg.wa:hover .wa-acts { display: flex; }
.wa-acts button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.wa-acts button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.wa-acts svg.icon { width: 13px; height: 13px; }
.msg.wa.mine .wa-acts { right: auto; left: 8px; }
/* OneBot's replies in their own tint; a colleague's sticky note, never sent. */
.msg.wa.mine.ai { background: var(--tint-2); }
.wa-note.mention { align-self: stretch; max-width: none; margin: 2px 24px; padding: 6px 12px; border: 1px dashed var(--primary); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: var(--fs-xs); text-align: left; }
.wa-note.mention svg.icon { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--primary); }
.wa-note.mention span { flex: 1; }
.wa-note.mention b { color: var(--primary-dark); font-weight: 600; }
.msg.hit, .wa-note.hit { outline: 2px solid var(--primary-soft); outline-offset: 1px; }
/* The four signs, pointed out under the box. */
.wa-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 16px 8px; color: var(--muted); font-size: var(--fs-xxs); }
.wa-hint[hidden] { display: none; }
.wa-hint b { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-weight: 600; }
.wa-hint button { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.wa-hint button svg.icon { width: 14px; height: 14px; }
/* Finding words in the chat and jumping to a day. */
.wa-find { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.wa-find[hidden] { display: none; }
.wa-find > svg.icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.wa-find .wa-find-q { flex: 1; min-width: 120px; }
.wa-find .wa-find-day { flex: none; width: 140px; }
.wa-find-n { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.wa-find-nav { display: inline-flex; gap: 2px; }
.wa-find-nav button, .wa-find-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: inherit; cursor: pointer; }
.wa-find-nav button:disabled { opacity: .4; cursor: default; }
.wa-find-nav button svg.icon, .wa-find-x svg.icon { width: 13px; height: 13px; }
.chat-head .btn.on { background: var(--primary-soft); border-color: var(--primary); }
/* The panel's sections fold; a paper's number sits over its date. */
.wa-sec-head h3 { cursor: pointer; }
.wa-sec.folded > :not(.wa-sec-head) { display: none; }
.wa-sec.folded .wa-sec-head h3 { opacity: .7; }
.wa-line > span b { display: block; font-weight: 600; }
.wa-line > span small { display: block; color: var(--muted); font-size: var(--fs-xxs); }
.wa-quick button span b { color: var(--ink); font-weight: 600; }
.wa-quick button span .badge { margin-left: 4px; }
.wa-quick-head { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-xs); }
.wa-quick-head b { font-weight: 600; }
.wa-quick-head i { color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-quick-more { display: flex; gap: 6px; padding: 6px 10px; }
.wa-quick-more button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: inherit; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.wa-quick-more button:hover { border-color: var(--primary); }
.wa-quick-more button svg { width: 14px; height: 14px; }
.wa-internal { display: flex; align-items: center; gap: 8px; margin: 6px 16px 0; padding: 6px 10px; border: 1px solid var(--line); border-left: 3px solid var(--primary); background: var(--surface); color: var(--muted); font-size: var(--fs-xs); }
.ob-learned .ob-log { max-height: 180px; overflow: auto; white-space: pre-wrap; }
/* A video post: a play button over its thumbnail in the post card, a play mark on the list's thumbnail. */
/* Pictures and videos never widen their boxes: the thumbnail's picture is laid over its box, the card's media is a block of the card's width. */
.fbc-thumb { overflow: hidden; }
.fbc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.fbc-thumb .fbc-pf, .fbc-thumb .fbc-play { z-index: 1; }
.fb-media { position: relative; display: block; overflow: hidden; }
.fb-media img, .fb-media video { display: block; width: 100%; max-width: 100%; min-width: 0; }
.fb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; border: 0; border-radius: 22px; background: rgba(0, 0, 0, .62); color: #fff; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.fb-play svg.icon { width: 18px; height: 18px; }
.fb-play:hover { background: rgba(0, 0, 0, .78); }
.fb-play:disabled { opacity: .8; cursor: default; }
.fb-media:has(.fb-play):not(:has(img)) { min-height: 180px; background: var(--tint-2); }
.fb-video { display: block; width: 100%; max-height: 480px; background: #000; }
.fbc-thumb { position: relative; }
.fbc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; }
.fbc-play svg.icon { width: 11px; height: 11px; }
/* Staff chat (pages/chat.js): tabs, and bubbles that can be answered, reacted to, passed on, changed and deleted. */
.chat-tabs { padding: 0 12px 8px; }
.chat-tabs button em.chat-count { margin-left: 5px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.chat-thread .msg { position: relative; }
.chat-thread .msg:hover .wa-acts { display: flex; }
.chat-thread .msg.mine .wa-acts { right: auto; left: 8px; }
.chat-thread .msg.has-react { margin-bottom: 12px; }
.chat-thread .msg.mine .wa-react { left: auto; right: 10px; }
.chat-thread .msg.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-thread .msg.removed .body { color: var(--muted); font-style: italic; }
.chat-removed { display: inline-flex; align-items: center; gap: 6px; }
.chat-removed svg.icon { width: 14px; height: 14px; }
.chat-fwd { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; color: var(--muted); font-size: var(--fs-xxs); font-style: italic; }
.chat-fwd svg.icon { width: 12px; height: 12px; }
.chat-replying { margin: 0 16px 6px; }
.chat-replying > svg.icon { width: 16px; height: 16px; flex: none; color: var(--primary); }
.chat-audio { margin: 0 0 4px; }
.chat-compose .wa-rec { display: flex; }
.chat-compose .wa-rec[hidden] { display: none; }
.chat-level { width: 60px; height: 4px; border-radius: 2px; background: var(--tint-2); overflow: hidden; }
.chat-level i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }
.chat-place { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 2px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-place:hover { background: var(--primary-soft); }
.chat-place .avatar-lg { width: 30px; height: 30px; }
.chat-place span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-place em { color: var(--muted); font-style: normal; font-size: var(--fs-xxs); }
.fwd-tabs { padding: 0; }
.fwd-list { display: grid; max-height: 46vh; overflow: auto; }
.chat-fwd-what { padding: 6px 10px; border-left: 3px solid var(--primary); background: var(--tint-2); color: var(--muted); font-size: var(--fs-sm); white-space: pre-wrap; }
/* The app's own tooltips (core.js): a small label below the element it explains, above when there is no room. */
.tip { position: fixed; z-index: 3000; max-width: 280px; padding: 5px 9px; border-radius: 2px; background: var(--ink); color: var(--surface); font-size: var(--fs-xs); line-height: 1.4; white-space: pre-line; pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity .12s ease-out, transform .12s ease-out; }
.tip.above { transform: translateY(3px); }
.tip.in { opacity: 1; transform: none; }
.tip[hidden] { display: none; }
/* What OneBot knows of a client, beside the chat. */
.wa-memory { white-space: pre-wrap; font-size: var(--fs-sm); line-height: 1.45; }
.bb-reasons { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
/* CRM > Bring back. */
.bb-head h2 { margin: 0 0 4px; }
.bb-head .toolbar { margin: 8px 0 0; }
.bb-figures { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.bb-figure { min-width: 130px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); }
.bb-figure b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bb-figure span { color: var(--muted); font-size: var(--fs-xs); }
.bb-part { margin-top: 10px; }
.bb-part-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
.bb-part-head h3 { margin: 0; font-size: var(--fs-md); }
.bb-row { display: grid; grid-template-columns: 240px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface); }
.bb-row:last-child { border-bottom: 1px solid var(--line); }
.bb-row.done { cursor: pointer; }
.bb-row.done:hover { background: var(--primary-soft); }
.bb-who { display: flex; gap: 8px; min-width: 0; }
.bb-who svg { width: 18px; height: 18px; flex: none; color: var(--primary); margin-top: 2px; }
.bb-who strong { display: block; font-weight: 600; }
.bb-who span { display: block; font-size: var(--fs-xs); }
.bb-who em { display: block; color: var(--muted); font-style: normal; font-size: var(--fs-xs); }
.bb-text textarea { width: 100%; min-height: 60px; resize: vertical; }
.bb-text.muted { font-size: var(--fs-sm); white-space: pre-wrap; }
.bb-acts { display: flex; gap: 6px; }
.bb-came { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 900px) { .bb-row { grid-template-columns: 1fr; } .bb-came { justify-content: flex-start; } }
.wa-internal[hidden] { display: none; }
.wa-internal svg { width: 14px; height: 14px; flex: none; color: var(--primary); }
.wa-times { display: flex; flex-wrap: wrap; gap: 5px; min-height: 30px; }
.wa-times button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: inherit; font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; cursor: pointer; }
.wa-times button:hover { border-color: var(--primary); }
.wa-times button.active { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.wa-pick { max-height: 34vh; overflow: auto; border: 1px solid var(--line-soft); }
.wa-pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); cursor: pointer; }
.wa-pick-row span { flex: 1; min-width: 0; display: grid; }
.wa-pick-row strong { font-weight: 600; }
.wa-pick-row small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-pick-row em { flex: none; font-style: normal; font-variant-numeric: tabular-nums; }
/* A report from the assistant in the staff chat. */
.msg.system { max-width: min(82%, 640px); background: var(--tint); }
.msg.system .who { color: var(--primary-dark) !important; }

/* ---- Settings > AI models ---- */
.ai-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-role { min-width: 0; padding: 12px 14px; border-left: 1px solid var(--line-soft); }
.ai-role:first-child { border-left: 0; }
.ai-role .label, .ai-role .hint { color: var(--muted); font-size: var(--fs-xs); }
.ai-role .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-role strong { display: block; font-family: var(--display); font-size: var(--fs-lg); font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-role strong.off { color: var(--muted); font-weight: 400; }
.ai-provs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ai-prov { display: grid; gap: 9px; align-content: start; min-width: 0; padding: 12px 14px; border: 1px solid var(--line-soft); background: var(--tint); }
.ai-prov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ai-prov-head strong { font-weight: 600; }
.ai-prov label:not(.check) { display: grid; gap: 3px; }
.ai-prov label[hidden] { display: none; }
.ai-prov input[type=password], .ai-prov input[type=text] { width: 100%; max-width: none; }
.ai-prov .toolbar { margin: 0; flex-wrap: wrap; gap: 6px; }
.ai-note { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; overflow-wrap: anywhere; }
.ai-note.bad, .ai-answer.bad { color: var(--danger); }
.ai-route { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(150px, 1fr) minmax(200px, 1.3fr); gap: 10px 12px; align-items: center; max-width: 940px; }
.ai-route .what strong { font-weight: 600; }
.ai-route .what div { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.ai-route select { width: 100%; max-width: none; }
.ai-tasks select { width: 190px; }
.ai-answer { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); background: var(--surface); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; }
.ai-answer[hidden] { display: none; }
.ai-answer .by { display: block; margin-top: 6px; color: var(--muted); font-size: var(--fs-xs); }
/* What a membership or promotion takes off, in a document's totals. */
.totals div > :last-child { flex: none; white-space: nowrap; }
.totals div > span:first-child { min-width: 0; }
/* The import window: each field of the list, the column of the file that fills it, and what it expects */
.import-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 10px 12px; }
.import-map > label { grid-template-rows: auto auto 1fr; align-content: start; min-width: 0; }
.import-map > label > select { max-width: none; }
.import-map small { color: var(--muted); font-size: var(--fs-xxs); font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.import-foot { margin-top: 8px; font-size: var(--fs-xs); }
.import-choices { display: grid; gap: 4px; margin-top: 12px; max-width: 560px; }
.import-choices p { margin: 0; font-size: var(--fs-xs); line-height: 1.45; }
.import-sample { overflow: auto; }
.import-sample td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.import-reasons { max-height: 220px; overflow: auto; padding: 8px 10px; background: var(--tint); border: 1px solid var(--line-soft); font-size: var(--fs-xs); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
/* Allergy warnings: above the lines of a document, and on each line concerned */
.doc-warn { margin: 0 0 8px; padding: 8px 11px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); font-size: var(--fs-sm); line-height: 1.45; }
.doc-warn[hidden] { display: none; }
.doc-warn > div + div { margin-top: 3px; }
table.items tr.allergy td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.items tr.allergy td:first-child input { color: var(--danger); }
.allergy-list { display: grid; gap: 6px; }
/* The payment plan's instalments: their dates and amounts, and what they come to */
.plan-rows td input { width: 150px; }
.plan-rows td.num input { text-align: right; }
.plan-sum { font-size: var(--fs-sm); color: var(--ok); }
.plan-sum.bad { color: var(--danger); }
/* Buttons joined in a row, one of them chosen (the calendar's Day / Week / Month) */
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { padding: 4px 12px; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.active { background: var(--primary); color: #fff; }
.seg button:not(.active):hover { background: var(--primary-soft); }
/* The calendar: shaded where the person does not work, a column per person on a day, the month */
.cal { overflow-x: auto; }
.cal-bar .cal-range { white-space: nowrap; }
.cal-slot.off { background: repeating-linear-gradient(135deg, var(--tint) 0 6px, color-mix(in srgb, var(--line) 45%, var(--tint)) 6px 7px); cursor: default; }
.cal-slot.off:hover { background: repeating-linear-gradient(135deg, var(--tint) 0 6px, color-mix(in srgb, var(--line) 45%, var(--tint)) 6px 7px); }
.cal-head span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head.away small { color: var(--danger); }
.cal-month { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mhead { padding: 6px 8px; font-weight: 600; font-size: var(--fs-sm); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-soft); }
.cal-day { min-height: 92px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 5px 7px; text-align: left; background: var(--surface); border: 0; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.cal-day:hover { background: var(--primary-soft); }
.cal-day.other { color: var(--muted); background: var(--tint); }
.cal-day.today .n { background: var(--primary); color: #fff; }
.cal-day .n { align-self: flex-start; min-width: 22px; padding: 1px 5px; font-weight: 600; text-align: center; }
.cal-day .count { position: absolute; }
.cal-day { position: relative; }
.cal-day .count { top: 5px; right: 7px; color: var(--primary-dark); font-size: var(--fs-xs); font-weight: 600; }
.cal-day .line { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .more { font-size: var(--fs-xxs); color: var(--muted); }
/* The appointment form's "Next free time" sits under the time box */
.form-grid > .next-free { grid-row: span 2; display: flex; align-items: flex-end; }
/* A counter sale: who buys, the scan box, the products, the payment beside the totals */
.sale { display: grid; gap: 10px; }
.sale-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.7fr); gap: 10px; align-items: end; }
.sale-head > label, .sale-pay > label:not(.check) { display: grid; gap: 3px; min-width: 0; }
.sale-head select, .sale-pay input, .sale-pay select { max-width: none; }
.sale-buyer > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sale-buyer > .sale-patient { grid-template-columns: minmax(0, 1fr); }
.sale-buyer > div[hidden] { display: none; }
.sale-scan .picker input { padding: 8px 11px; font-size: var(--fs); border-color: var(--primary); background: var(--surface); }
.sale-scan label, .sale-scan .picker { max-width: none; }
table.sale-lines td input { width: 92px; text-align: right; }
table.sale-lines tr.short td:nth-child(2) { color: var(--danger); font-weight: 600; }
.sale-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 18px; align-items: start; }
.sale-pay { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px 10px; }
.sale-pay label.check { padding-top: 18px; }
.sale-pay label[hidden] { display: none; }
.totals.sale-totals { width: auto; margin: 0; }
.sale-totals .change { color: var(--ok); }
.sale-totals .t-auto span { color: var(--muted); font-size: var(--fs-xs); }
/* A patient's photograph, in place of the initial */
.avatar-lg.photo { padding: 0; overflow: hidden; background: var(--tint); }
.avatar-lg.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
h2.with-photo { display: flex; align-items: center; gap: 10px; }
h2 .head-photo { width: 40px; height: 40px; flex: none; }
.cam-view { width: 100%; aspect-ratio: 1; object-fit: cover; background: #1c1410; }
.allergy-list .alert { margin: 0; }
.totals .t-auto[hidden] { display: none; }
.totals .t-auto span { color: var(--muted); font-size: var(--fs-xs); }
.totals .t-auto.bad span { color: var(--danger); }

/* Reports: tabs for each report, its filters, and wide tables that scroll inside their card */
.report-tabs { flex-wrap: wrap; }
.report-range { display: inline-flex; align-items: center; gap: 8px; }
.report-about { margin: 8px 0; font-size: var(--fs-sm); }
.report-table { margin-top: 8px; }
.report-table .card-body.flush { padding: 0; }
.report-scroll { overflow-x: auto; }
.report-empty { padding: 12px; }
table.data tfoot tr.tot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; background: var(--tint-2); }

/* Dictation: the microphone beside a box, and the "Dictate notes" window */
label.has-mic { position: relative; }
.mic-btn { position: absolute; top: -3px; right: 0; display: inline-flex; align-items: center; gap: 4px; height: 22px; min-width: 24px; padding: 0 5px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.mic-btn svg.icon { width: 14px; height: 14px; }
.mic-btn:hover { color: var(--primary-dark); border-color: var(--line); background: var(--surface); }
.mic-btn.rec { color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 0 0 calc(var(--level, 0) * 5px) rgba(192, 57, 43, .25); }
.mic-btn.busy { color: var(--primary-dark); background: var(--primary-soft); cursor: progress; }
.mic-time:empty { display: none; }
.dict { display: grid; gap: 14px; }
.dict-head { display: flex; align-items: center; gap: 18px; }
.dict-rec { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.dict-rec svg.icon { width: 26px; height: 26px; }
.dict-rec:hover { background: var(--primary); color: #fff; }
.dict-rec.rec { background: var(--danger); border-color: var(--danger); color: #fff; animation: dict-pulse 1.4s ease-in-out infinite; }
.dict-rec:disabled { opacity: .55; cursor: progress; }
@keyframes dict-pulse { 50% { opacity: .78; } }
.dict-side { flex: 1; min-width: 0; display: grid; gap: 4px; }
.dict-state { font-size: var(--fs-sm); }
.dict-time { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); }
.dict-level { height: 4px; background: var(--tint-2); overflow: hidden; }
.dict-level span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }
.dict-parts { display: grid; gap: 8px; }
.dict-part { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--tint); font-weight: 400; }
.dict-part strong { display: block; font-size: var(--fs-sm); margin-bottom: 4px; }
.dict-part input { margin-top: 3px; }
/* The visit: its kind beside the title, and the parts it leaves out */
select.visit-type { width: auto; height: 26px; padding: 0 26px 0 8px; font-size: var(--fs-sm); font-weight: 400; vertical-align: middle; margin-left: 6px; }
.visit-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px; border: 1px dashed var(--line); font-size: var(--fs-sm); }
/* Settings > Visit screen */
.layout-list { display: grid; gap: 0; border: 1px solid var(--line-soft); max-width: clamp(320px, 60%, 560px); }
.layout-row { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-top: 1px solid var(--line-soft); }
.layout-row:first-child { border-top: 0; }
.layout-row label.check { flex: 1; padding: 0; }
.layout-row.fixed { justify-content: space-between; background: var(--tint); font-size: var(--fs-sm); }
.layout-row.off label.check span { color: var(--muted); }
.layout-row .icon-btn { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-soft); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.layout-row .icon-btn svg.icon { width: 12px; height: 12px; }
.layout-row .icon-btn.up svg { transform: rotate(90deg); } .layout-row .icon-btn.down svg { transform: rotate(-90deg); }
.layout-row .icon-btn:hover:not(:disabled) { color: var(--primary-dark); border-color: var(--primary); }
.layout-row .icon-btn:disabled { opacity: .3; cursor: default; }
/* Papers and messages in the patient's language */
.doc-lang { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-preview.waiting { opacity: .45; transition: opacity .15s ease; }
.doc-preview .p-break { height: 0; margin: 28px 0; border-top: 1px dashed var(--line); }
.msg-lang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-lang[hidden] { display: none; }

/* Registration forms: choosing the file a form goes into, and the signature it carries */
.intake-match { display: grid; gap: 6px; }
.radio-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--surface); font-weight: 400; cursor: pointer; }
.radio-row:hover { border-color: var(--primary); }
.radio-row input { margin-top: 2px; flex: none; }
.radio-row strong { display: block; font-size: var(--fs-sm); }
.radio-row .muted { font-size: var(--fs-xs); }
.radio-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.intake-sign { margin-top: 10px; padding: 6px; border: 1px solid var(--line-soft); background: #fff; display: inline-block; }
.intake-sign img { display: block; max-height: 80px; max-width: 260px; }

/* Backups: what the disk check found */
.kv dd.disk-off, .kv dd.disk-paused { color: var(--danger); }
.kv dd.disk-on { color: var(--ok); }

/* Help > About: the maker's website, in the app's colours */
a.about-site { color: var(--primary); text-decoration: none; }
a.about-site:hover { color: var(--primary-dark); text-decoration: underline; }

/* The update card (renderer/js/update.js): bottom right, out of the way of the work, sliding in as news
   arriving rather than as a popup. */
.nk-update { position: fixed; right: 14px; bottom: 14px; width: clamp(280px, 26vw, 360px); max-width: calc(100vw - 28px); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--primary); z-index: 900; font-size: var(--fs-sm); opacity: 0; transform: translateY(14px); transition: opacity .18s ease, transform .18s ease; }
.nk-update.in { opacity: 1; transform: none; }
.nk-update.bad { border-top-color: var(--danger); }
.nk-update .h { display: flex; align-items: center; gap: 7px; padding: 8px 10px 6px; font-weight: 600; color: var(--primary-dark); }
.nk-update.bad .h { color: var(--danger); }
.nk-update .h .ic svg.icon { width: 15px; height: 15px; }
.nk-update .h .t { flex: 1; min-width: 0; }
.nk-update .h .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; display: grid; place-items: center; }
.nk-update .h .x:hover { color: var(--ink); }
.nk-update .h .x svg.icon { width: 15px; height: 15px; }
.nk-update .b { padding: 0 10px 8px; }
.nk-update .v { color: var(--ink); }
.nk-update .v b { font-family: var(--mono); }
.nk-update .dim { color: var(--muted); font-weight: 400; }
.nk-update .n { margin-top: 4px; font-size: var(--fs-xs); line-height: 1.5; color: var(--muted); white-space: pre-line; }
.nk-update .n:empty { display: none; }
.nk-update .bar, .upd-bar { margin-top: 9px; height: 6px; background: var(--tint-2); overflow: hidden; }
.nk-update .bar span, .upd-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.nk-update .bar span.idle { background: linear-gradient(90deg, var(--primary) 25%, var(--accent) 50%, var(--primary) 75%); background-size: 200% 100%; animation: nk-upd 1.1s linear infinite; }
@keyframes nk-upd { from { background-position: 200% 0; } to { background-position: 0 0; } }
.nk-update .f { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-soft); background: var(--tint); }
@media (prefers-reduced-motion: reduce) { .nk-update { transition: none; } .nk-update .bar span.idle { animation: none; } }
/* Settings > This installation > Updates */
.upd-title { margin: 14px 0 4px; font-size: var(--fs-sm); }
.upd-block { margin-top: 10px; }
.upd-state { padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--tint); font-size: var(--fs-sm); }
.upd-state.ok { border-color: var(--ok); background: var(--ok-soft); }
.upd-state.new { border-color: var(--primary); background: var(--primary-soft); }
.upd-state.warn { border-color: var(--danger); background: var(--danger-soft); }
.upd-state b { font-family: var(--mono); }

/* The client beside a WhatsApp chat: folded away to a thin strip at the edge, and back */
.wa-side-fold { flex: none; width: 22px; border: 0; border-left: 1px solid var(--line); background: var(--tint); color: var(--muted); cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 14px; }
.wa-side-fold[hidden] { display: none; }
.wa-side-fold:hover { background: var(--primary-soft); color: var(--primary-dark); }
.wa-side-fold svg.icon { width: 14px; height: 14px; }
.wa-side-body { position: relative; }
.wa-side-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-soft); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.wa-side-close:hover { color: var(--primary-dark); border-color: var(--primary); }
.wa-side-close svg.icon { width: 13px; height: 13px; }

/* Calendar: days before today take no bookings */
.cal-slot.past { background: repeating-linear-gradient(135deg, var(--grey-soft) 0 6px, transparent 6px 12px); cursor: not-allowed; }
.cal-slot.past:hover { background: repeating-linear-gradient(135deg, var(--grey-soft) 0 6px, transparent 6px 12px); }

/* Popups: new notifications, and tickets handed to the person, each one card with its number (app.js popup()). */
.notices { position: fixed; right: 18px; bottom: 18px; z-index: 95; display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: calc(100vw - 36px); pointer-events: none; }
/* On a chat screen the message box lives along the bottom: a notice sits above it, never over the Send button. */
body:has(.split-mode) .notices { bottom: 92px; }
/* With the client panel open, a notice sits to its left, clear of the panel and of the jump-down button. */
body:has(.wa-side:not([hidden])) .notices { right: calc(clamp(250px, 21vw, 320px) + 18px); }
.notice { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 2px;
  animation: nk-rise .34s cubic-bezier(.2, .8, .2, 1); transition: opacity .2s ease, transform .22s ease; }
.notice.leaving { opacity: 0; transform: translateY(18px); }
.notice.bump { animation: nk-bump .42s cubic-bezier(.2, .8, .2, 1); }
@keyframes nk-rise { from { opacity: 0; transform: translateY(36px); } }
@keyframes nk-bump { 35% { transform: translateY(-5px); } }
.notice-ico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; background: var(--primary-soft); color: var(--primary-dark); }
.notice-ico svg.icon { width: 18px; height: 18px; }
.notice-text { flex: 1; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.notice .x { display: grid; padding: 3px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.notice .x:hover { color: var(--ink); }
.notice .x svg.icon { width: 16px; height: 16px; }
/* The Notifications page. */
.notes { max-width: 760px; }
.notes > p { margin: 0; padding: 14px 16px 12px; }
.note-line { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--ink); font: inherit; font-size: var(--fs); text-align: left; cursor: pointer; transition: background-color .15s ease; }
.note-line:hover { background: var(--tint-2); }
.note-line.is-new { font-weight: 600; }
.note-label { flex: 1; }
.note-line strong { color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.note-line svg.icon { width: 16px; height: 16px; color: var(--muted); }
.note-new { padding: 1px 7px; background: var(--accent); color: #2a1b12; font-size: var(--fs-xxs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* With no logo above it, the menu starts a little below the top edge. */
.rail-nav { padding-top: 10px; }
@media (prefers-reduced-motion: reduce) { .notice, .notice.bump { animation: none; } }

/* ---- Client inbox: WhatsApp, Messenger and Instagram chats, and Facebook and Instagram comments ---- */
:root { --ch-whatsapp: #25a35a; --ch-messenger: #0a7cff; --ch-instagram: #d62976; --ch-facebook: #1877f2; }
.inbox-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 12px 8px; padding: 3px; background: var(--tint-2); border-radius: 999px; }
.inbox-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.inbox-tabs button svg.icon { width: 16px; height: 16px; }
.inbox-tabs button.on { background: var(--surface); color: var(--primary-dark); }
.inbox-tabs button:not(.on):hover { color: var(--ink); }
.inbox-tabs .chat-count { margin-left: 2px; }
.wa-meta .wa-by { margin-right: 2px; font-weight: 600; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.fb-compose.with-bot { display: block; padding: 0; background: none; border: 0; }
.fb-compose .fb-bot { margin: 0; }
.fbs-elsewhere { color: var(--warn, #b45309); }
.fb-by { color: var(--fb-muted); font-size: var(--fs-xs); font-style: italic; }
/* OneBot (shared/onebot.js): the bar that stands for the message box, the note beside Take over, the tag in the list. */
.wa-bot { display: flex; align-items: center; gap: 12px; margin: 8px 14px 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); animation: nk-in .2s ease-out; }
.wa-bot-av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; }
.wa-bot-av svg.icon { width: 19px; height: 19px; }
.wa-bot-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.wa-bot-txt b { font-weight: 600; }
.wa-bot-txt span { color: var(--muted); font-size: var(--fs-xs); }
.wa-bot-go { position: relative; flex: none; display: flex; align-items: center; }
.wa-takeover { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wa-bot-go { gap: 6px; }
.wa-bot-tip { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: max-content; max-width: min(180px, 45vw); display: grid; gap: 1px; padding: 4px 7px; border-radius: 7px 7px 2px 7px; background: var(--ink); color: var(--surface); font-size: 10px; line-height: 1.3; animation: wa-tip-in .25s ease-out; }
.wa-bot-tip .wa-bot-clock { justify-self: end; font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .8; }
.wa-bot-tip.done { background: var(--ok, #1f7a45); color: #fff; }
@keyframes wa-tip-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-room .wa-tag-bot { flex: none; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--tint-2); color: var(--primary-dark); font-style: normal; font-size: 10px; font-weight: 700; line-height: 16px; }
.chat-room .wa-tag-bot.taking { background: var(--primary); color: #fff; }
.ob-knows { display: grid; gap: 10px; }
.ob-site { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ob-read { display: flex; align-items: center; gap: 10px; min-height: 34px; flex-wrap: wrap; }
.ob-reach-title { margin-bottom: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.ob-reach { white-space: pre-line; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 2px; background: var(--tint); font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.ob-tag { display: inline-flex; align-items: center; gap: 4px; width: max-content; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; }
.ob-tag svg.icon { width: 12px; height: 12px; }
.detail-head .ob-tag { margin-right: auto; }
.wa-error { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.wa-resend { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.wa-resend svg.icon { width: 13px; height: 13px; }
.wa-resend:disabled { opacity: .6; cursor: default; }
.chat-room .wa-draft { color: var(--danger, #b42318); }
.chat-room .wa-draft b { font-weight: 600; }
/* The paperclip's panel, as WhatsApp's: round coloured choices above the box. */
.wa-compose { position: relative; }
.wa-attach { position: absolute; left: 12px; bottom: calc(100% + 6px); z-index: 20; display: grid; grid-template-columns: repeat(3, 92px); gap: 6px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); animation: wa-tip-in .18s ease-out; }
.wa-attach button { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-xs); cursor: pointer; transition: background-color .15s ease; }
.wa-attach button:hover, .wa-attach button:focus-visible { background: var(--tint); outline: none; }
.wa-attach-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; }
.wa-attach-ico svg.icon { width: 22px; height: 22px; }
.wa-cam-box { display: grid; gap: 8px; }
.wa-cam { width: 100%; max-height: 52vh; border-radius: 10px; background: #000; object-fit: contain; }
.wa-channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 12px 8px; }
.wa-channels .ch-n { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.wa-channels button.active .ch-n { background: #fff; color: var(--ink); }
.wa-channels button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-channels button { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.wa-channels button svg.icon { width: 16px; height: 16px; flex: none; }
.wa-channels button.active { color: #fff; border-color: transparent; background: var(--primary); }
.wa-channels button.ch-whatsapp.active { background: var(--ch-whatsapp); }
.wa-channels button.ch-messenger.active { background: var(--ch-messenger); }
.wa-channels button.ch-instagram.active { background: var(--ch-instagram); }
.av-wrap { position: relative; flex: none; display: inline-grid; padding: 0 3px 3px 0; }
.ch-badge { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 17px; height: 17px; border: 2px solid var(--surface); border-radius: 50%; color: #fff; background: var(--ch-whatsapp); }
.ch-badge svg.icon { width: 10px; height: 10px; stroke-width: 2.2; }
.ch-badge.ch-messenger { background: var(--ch-messenger); }
.ch-badge.ch-instagram { background: var(--ch-instagram); }

/* Comments, as Facebook shows them (rounded, like the chats: the exception to the 2px corners). */
.fbc { --fb-bubble: #f0f2f5; --fb-ink: #050505; --fb-muted: #65676b; --fb-blue: #1877f2; --fb-line: #dfe1e5; --fb-card: #fff; }
html[data-theme="dark"] .fbc { --fb-bubble: #2a3442; --fb-ink: var(--ink); --fb-muted: var(--muted); --fb-blue: #5aa2f7; --fb-line: var(--line); --fb-card: var(--surface); }
.fbc-filters { padding-bottom: 6px; }
.fbc-posts { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 12px; display: grid; align-content: start; gap: 2px; }
.fbc-post { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .12s ease; }
.fbc-post:hover { background: var(--tint); }
.fbc-post.on { background: var(--primary-soft); }
.fbc-thumb { position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 8px; background: var(--tint-2); color: var(--muted); }
.fbc-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.fbc-pf { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; background: var(--ch-facebook); vertical-align: -3px; }
.fbc-pf svg.icon { width: 11px; height: 11px; stroke-width: 2; }
.fbc-pf.pf-instagram { background: var(--ch-instagram); }
.fbc-thumb .fbc-pf { position: absolute; right: 2px; bottom: 2px; width: 19px; height: 19px; border: 2px solid var(--surface); }
.fbc-txt { min-width: 0; flex: 1; display: grid; gap: 2px; }
.fbc-txt b { font-weight: 600; font-size: var(--fs-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fbc-txt small { color: var(--muted); font-size: var(--fs-xxs); }
.fbc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.fbc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 24px; }
.fbc-none { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; max-width: 420px; margin: 0 auto; }
.fbc-none > svg.icon { width: 40px; height: 40px; color: var(--ch-facebook); }

.fb-post { max-width: 680px; margin: 0 auto; background: var(--fb-card); border: 1px solid var(--fb-line); border-radius: 10px 10px 0 0; overflow: hidden; color: var(--fb-ink); }
.fb-post.fresh { animation: nk-in .22s ease-out; }
.fb-post header { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.fb-who { flex: 1; min-width: 0; display: grid; }
.fb-who b { font-weight: 600; font-size: var(--fs); }
.fb-who small { color: var(--fb-muted); font-size: var(--fs-xxs); }
.fb-open { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border: 0; border-radius: 6px; background: var(--fb-bubble); color: var(--fb-ink); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.fb-open svg.icon { width: 14px; height: 14px; }
.fb-open:hover { filter: brightness(.96); }
.fb-caption { padding: 0 14px 10px; font-size: var(--fs); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.fb-more { border: 0; background: none; padding: 0; color: var(--fb-muted); font: inherit; font-weight: 600; cursor: pointer; }
.fb-media { background: var(--tint-2); display: grid; place-items: center; }
.fb-media img { display: block; width: 100%; max-height: min(340px, 42vh); object-fit: contain; }
.fb-stats { display: flex; justify-content: space-between; gap: 10px; margin: 0 14px; padding: 9px 0; border-bottom: 1px solid var(--fb-line); color: var(--fb-muted); font-size: var(--fs-xs); }
.fb-waiting { color: var(--fb-blue); font-weight: 600; }
.fb-done { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); }
.fb-done svg.icon { width: 14px; height: 14px; }
.fb-thread { max-width: 680px; margin: 0 auto; padding: 12px 14px 14px; background: var(--fb-card); border: 1px solid var(--fb-line); border-top: 0; border-radius: 0 0 10px 10px; display: grid; gap: 10px; color: var(--fb-ink); }
.fb-none { color: var(--fb-muted); font-size: var(--fs-sm); margin: 4px 0 8px; }

.fb-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.fb-av img { width: 100%; height: 100%; object-fit: cover; }
.fb-av.page { width: 40px; height: 40px; font-size: 14px; background: var(--rail) !important; color: var(--accent); }
.fb-av.page.small, .fb-c .fb-av.page { width: 32px; height: 32px; font-size: 12px; }
.fb-c { display: flex; gap: 7px; align-items: flex-start; }
.fb-c-body { min-width: 0; flex: 1; }
.fb-bubble { display: inline-block; max-width: 100%; padding: 7px 12px 8px; border-radius: 18px; background: var(--fb-bubble); line-height: 1.38; word-break: break-word; }
.fb-bubble b { display: inline-block; margin-right: 6px; font-size: var(--fs-sm); font-weight: 600; }
.fb-author { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--fb-blue); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 1px; }
.fb-bubble .fb-words { display: block; font-size: var(--fs); white-space: pre-wrap; }
.fb-words a { color: var(--fb-blue); }
.fb-c-media { display: block; max-width: 240px; max-height: 240px; margin-top: 4px; border-radius: 14px; }
.fb-c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 3px 12px 0; color: var(--fb-muted); font-size: var(--fs-xxs); font-weight: 600; }
.fb-c-actions time { font-weight: 400; }
.fb-act { border: 0; background: none; padding: 0; color: var(--fb-muted); font: inherit; font-weight: 700; cursor: pointer; }
.fb-act:hover { text-decoration: underline; }
.fb-act.on { color: var(--fb-blue); }
.fb-dots { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; opacity: 0; transition: opacity .15s ease, background-color .15s ease; }
.fb-dots:hover { background: var(--fb-bubble); text-decoration: none; }
.fb-dots svg.icon { width: 13px; height: 13px; }
.fb-c:hover > .fb-c-body > .fb-c-actions .fb-dots, .fb-dots:focus-visible { opacity: 1; }
.fb-tag { padding: 0 7px; border-radius: 999px; background: var(--fb-bubble); color: var(--fb-muted); font-weight: 600; line-height: 17px; }
.fb-tag.new { background: rgba(24, 119, 242, .12); color: var(--fb-blue); }
.fb-tag.done { display: inline-flex; align-items: center; gap: 3px; background: none; color: var(--ok); padding: 0; }
.fb-tag.done svg.icon { width: 12px; height: 12px; }
.fb-c.is-new > .fb-c-body > .fb-bubble > b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--fb-blue); vertical-align: 1px; }
.fb-c.hidden-c > .fb-c-body > .fb-bubble, .fb-c.hidden-c > .fb-av { opacity: .5; }
/* Replies hang on a thread line from the first comment, as on Facebook. */
.fb-replies { position: relative; display: grid; gap: 8px; margin-top: 8px; }
.fb-replies::before { content: ""; position: absolute; left: -23px; top: -6px; bottom: 16px; border-left: 2px solid var(--fb-line); }
.fb-replies > .fb-c, .fb-replies > .fb-reply-box { position: relative; }
.fb-replies > .fb-c::before, .fb-replies > .fb-reply-box::before { content: ""; position: absolute; left: -23px; top: -6px; width: 18px; height: 21px; border-left: 2px solid var(--fb-line); border-bottom: 2px solid var(--fb-line); border-bottom-left-radius: 12px; }
.fb-replies .fb-av { width: 26px; height: 26px; font-size: 10px; }
.fb-reply-box, .fb-compose { display: flex; gap: 7px; align-items: flex-end; }
.fb-pill { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 4px; padding: 3px 4px 3px 12px; border-radius: 20px; background: var(--fb-bubble); }
.fb-pill textarea { flex: 1; min-height: 30px; max-height: 140px; padding: 6px 0; border: 0; background: none; color: var(--fb-ink); font: inherit; font-size: var(--fs); resize: none; line-height: 1.4; box-shadow: none; }
.fb-pill textarea:focus { outline: none; border: 0; background: none; }
.fb-send { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--fb-blue); cursor: pointer; transition: background-color .15s ease, opacity .15s ease; }
.fb-send:hover:not(:disabled) { background: rgba(24, 119, 242, .1); }
.fb-send:disabled { opacity: .35; cursor: default; }
.fb-send svg.icon { width: 18px; height: 18px; }
.fb-compose { max-width: 680px; width: calc(100% - 40px); margin: 0 auto 14px; padding: 10px 14px; background: var(--fb-card); border: 1px solid var(--fb-line); border-radius: 10px; }
.fb-quote { padding: 8px 12px; border-radius: 14px; background: var(--fb-bubble); }
.fb-quote b { display: block; font-size: var(--fs-sm); }

/* Facebook and Instagram set-up */
.fbs-pages { display: grid; gap: 6px; }
.fbs-page { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; }
.fbs-page:hover { background: var(--tint); }
/* What the clinic's server sees of Facebook and Instagram (App.socialServer). */
.fbs-server { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--tint-2); text-align: left; color: var(--ink); }
.fbs-server-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fbs-server-body { display: grid; gap: 6px; font-size: var(--fs-sm); }
.fbs-server-body p { margin: 0; }
.fbs-error { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); }
.fbs-error svg.icon { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.fbs-error > span { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.fbs-error b { font-weight: 600; color: var(--danger); }
.fbs-error small { color: var(--muted); font-size: var(--fs-xxs); }
.fbs-fine { display: flex; gap: 6px; align-items: center; color: var(--ok); }
.fbs-fine svg.icon { width: 16px; height: 16px; }
.fbs-news { font-weight: 600; }
.fbc-none .fbs-server { width: min(440px, 100%); margin-top: 6px; }
.fbs-txt { flex: 1; min-width: 0; display: grid; }
.fbs-txt b { font-weight: 600; }
.fbs-txt small { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: var(--fs-xs); }
.fbs-txt small svg.icon { width: 13px; height: 13px; }
.fbs-page { font-size: var(--fs-sm); font-weight: 400; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .fb-post { animation: none; } }

/* The queue: where the patient is now, under the appointment's status */
.q-stage { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.q-stage.left { color: var(--warn); font-weight: 600; }
.q-stage.gone { color: var(--ok); }

/* Check out: one line for each part of the visit, how it stands and what can be done */
.checkout .co-lines, .checkout .co-next { display: grid; gap: 6px; }
.checkout .co-next { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.co-line { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 2px; background: var(--surface); }
.co-line .co-mark { flex: none; display: flex; color: var(--muted); }
.co-line .co-mark svg.icon { width: 18px; height: 18px; }
.co-line.ok .co-mark { color: var(--ok); }
.co-line.wait { border-color: var(--warn); background: var(--warn-soft); }
.co-line.wait .co-mark { color: var(--warn); }
.co-line .co-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.co-line .co-text span { color: var(--muted); font-size: var(--fs-sm); }
.co-line.next { flex-wrap: wrap; }
.co-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-foot { margin: 6px 0 0; font-size: var(--fs-sm); }

/* Approving a request: what was asked for, what the store holds, what is given */
.give-table input { width: 96px; }
.give-table .short { color: var(--warn); font-weight: 600; }
.give-note { margin: 10px 0 0; }
/* A choice under a list's head (which pharmacy, for example) */
.split-filter { padding: 0 12px 8px; }
.split-filter select { width: 100%; }

/* Ask OneBot: a pane on the right, over the screen, that slides in */
.helpbot { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(410px, 92vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .2s ease; }
.helpbot.on { transform: none; }
body.hb-open .notices { right: calc(min(410px, 92vw) + 18px); }
.hb-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--primary); color: #fff; }
.hb-face { display: flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; }
.hb-face svg.icon { width: 22px; height: 22px; }
.hb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hb-who small { opacity: .85; font-size: var(--fs-xs); }
.hb-tool { border: 0; background: none; color: #fff; cursor: pointer; padding: 4px; opacity: .85; display: flex; } .hb-tool:hover { opacity: 1; }
.hb-tool svg.icon { width: 18px; height: 18px; }
.hb-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.hb-msg { max-width: 92%; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 2px; background: var(--surface); line-height: 1.5; overflow-wrap: anywhere; }
.hb-msg.me { align-self: flex-end; background: var(--tint); border-color: var(--line); white-space: pre-wrap; }
.hb-msg.bot { align-self: flex-start; }
.hb-msg p { margin: 0 0 6px; } .hb-msg p:last-child { margin-bottom: 0; }
.hb-msg ol, .hb-msg ul { margin: 2px 0 6px; padding-left: 20px; } .hb-msg li { margin: 2px 0; }
.hb-msg .hb-shut { color: var(--muted); font-size: var(--fs-sm); }
.hb-go { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 2px 0; padding: 3px 9px; border: 1px solid var(--primary); border-radius: 2px; background: none; color: var(--primary-dark); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.hb-go::after { content: '\2192'; }
.hb-go:hover { background: var(--primary); color: #fff; }
.hb-go.guide::after { content: ''; }
.hb-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hb-idea { padding: 5px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.hb-idea:hover { border-color: var(--primary); color: var(--primary-dark); }
.hb-typing { display: flex; gap: 4px; padding: 12px; }
.hb-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: hb-dot 1s infinite ease-in-out; }
.hb-typing span:nth-child(2) { animation-delay: .15s; } .hb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hb-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.hb-box { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.hb-box textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; overflow-y: auto; }
.hb-send { flex: none; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 2px; background: var(--primary); color: #fff; cursor: pointer; }
.hb-send svg.icon { width: 18px; height: 18px; }
.hb-foot { flex: none; padding: 6px 12px 9px; font-size: var(--fs-xs); color: var(--muted); background: var(--surface); }
.hb-link { border: 0; background: none; padding: 0; color: var(--primary-dark); font: inherit; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .helpbot { transition: none; } .hb-typing span { animation: none; opacity: .6; } }

/* The CEO dashboard: figures with a small trend, then charts in cards that ease in */
.ceo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ceo-head h2 { font-family: var(--display); font-size: var(--fs-xl); margin: 0; }
.ceo-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.ceo-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ceo-range { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); }
.ceo-range input { width: 136px; }
.ceo-body { transition: opacity .25s ease; }
.ceo-body.loading { opacity: .55; }
.ceo-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ceo-kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 2px; overflow: hidden; animation: ceo-in .45s ease both; }
.ceo-kpi.clickable { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.ceo-kpi.clickable:hover { border-color: var(--primary); transform: translateY(-1px); }
.ceo-kpi-label { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
.ceo-kpi-value { font-family: var(--display); font-size: 1.45rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ceo-kpi-value.bad { color: var(--danger); }
.ceo-kpi-change, .ceo-kpi-hint { font-size: var(--fs-xs); color: var(--muted); min-height: 1.3em; }
.ceo-kpi-change.up, .ceo-fact em.up { color: var(--ok); } .ceo-kpi-change.down, .ceo-fact em.down { color: var(--danger); }
.ceo-spark { height: 44px; margin: 6px -14px 0; } .ceo-spark.flat { border-top: 1px dashed var(--line-soft); height: 22px; margin-top: 28px; }
.ceo-facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 8px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 2px; animation: ceo-in .45s .25s ease both; }
.ceo-fact { display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; border-left: 1px solid var(--line-soft); min-width: 0; }
.ceo-fact:first-child { border-left: 0; }
.ceo-fact span { color: var(--muted); font-size: var(--fs-xs); }
.ceo-fact strong { font-size: var(--fs-md, 1rem); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ceo-fact strong.bad { color: var(--danger); }
.ceo-fact em { font-style: normal; font-size: var(--fs-xs); color: var(--muted); }
.ceo-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ceo-card { grid-column: span 6; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 2px; animation: ceo-in .5s ease both; }
.ceo-card.w3 { grid-column: span 3; } .ceo-card.w4 { grid-column: span 4; } .ceo-card.w5 { grid-column: span 5; } .ceo-card.w8 { grid-column: span 8; }
.ceo-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px 0; }
.ceo-card-head h3 { margin: 0; font-size: var(--fs-md, 1rem); font-weight: 600; }
.ceo-card-head span { color: var(--muted); font-size: var(--fs-xs); text-align: right; }
.ceo-chart { height: 270px; padding: 4px 8px 8px; min-width: 0; }
.ceo-chart.none { display: grid; place-items: center; }
.ceo-empty { color: var(--muted); font-size: var(--fs-sm); padding: 20px; text-align: center; }
.ceo-ring-total { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--ink); }
.ceo-ring-name { font-size: 11px; color: var(--muted); }
.ceo-leg { color: var(--muted); }
@keyframes ceo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1250px) { .ceo-kpis, .ceo-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ceo-card, .ceo-card.w3, .ceo-card.w4, .ceo-card.w5, .ceo-card.w8 { grid-column: span 6; } .ceo-card.w8 { grid-column: span 12; } }
@media (prefers-reduced-motion: reduce) { .ceo-kpi, .ceo-facts, .ceo-card { animation: none; } .ceo-kpi.clickable:hover { transform: none; } }
.ceo-chart.ring .highcharts-container { position: relative; }
.ceo-ring-mid { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; line-height: 1.15; }
.ceo-ring-mid .ceo-ring-total { white-space: nowrap; }
.ceo-chart.bars { height: auto; min-height: 270px; }

/* The dashboards of each role: lists in cards, the queue in a card, the choice of dashboard */
.dash-switch { width: auto; min-width: 170px; }
.ceo-kpi-value.warn { color: var(--warn); }
.ceo-kpi-act { margin-top: 6px; }
.ceo-spark.none { display: none; }
.ceo-kpi:has(.ceo-spark.none) { padding-bottom: 12px; }
.dash-list .dl-rows { display: flex; flex-direction: column; padding: 6px 8px 10px; max-height: 330px; overflow: auto; }
.dl-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: 2px; transition: background-color .12s ease; }
.dl-row:last-child { border-bottom: 0; }
.dl-row:hover:not(:disabled) { background: var(--tint); }
.dl-row:disabled { cursor: default; opacity: 1; }
.dl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dl-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-main span { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-right { flex: none; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-right.bad { color: var(--danger); font-weight: 600; } .dl-right.warn { color: var(--warn); font-weight: 600; } .dl-right.ok { color: var(--ok); }
.dash-list .ceo-empty { padding: 26px 10px; }
.dl-table { padding: 4px 8px 8px; overflow: auto; max-height: 420px; }
.dl-table table.data { margin: 0; }
.ceo-card.w12 { grid-column: span 12; }
