/* Themes: five palettes, each with a dark and a light mode, selected with
   data-theme / data-mode on <html> (see src/theme.ts). Midnight dark is the
   default. "Film" tokens colour the always-dark lightbox-style panels. */
:root {
  --radius-s: 4px;
  --radius-m: 8px;
  --font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root, :root[data-theme="midnight"][data-mode="dark"] {
  --bg: #0d1726;
  --panel: #13213a;
  --panel-2: #1a2b48;
  --rule: #253a5c;
  --text: #dbe5f3;
  --muted: #8ea2c0;
  --accent: #5aa2ff;
  --accent-ink: #05111f;
  --accent-soft: rgba(90, 162, 255, 0.16);
  --ok: #4fbf8f;
  --bad: #ef6b5e;
  --film: #08101c;
  --film-panel: #14223a;
  --film-rule: #22344f;
  --film-text: #d6e1f0;
  --film-muted: #8496b3;
  --focus: #9cc8ff;
  color-scheme: dark;
}
:root[data-theme="midnight"][data-mode="light"] {
  --bg: #edf2f9;
  --panel: #ffffff;
  --panel-2: #f4f7fc;
  --rule: #d3dceb;
  --text: #15233a;
  --muted: #566a88;
  --accent: #1d64c9;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 100, 201, 0.12);
  --ok: #237a52;
  --bad: #c0392f;
  --film: #0f1a2b;
  --film-panel: #182640;
  --film-rule: #2a3c5a;
  --film-text: #dbe5f3;
  --film-muted: #8ea2c0;
  --focus: #1d64c9;
  color-scheme: light;
}
:root[data-theme="slate"][data-mode="dark"] {
  --bg: #18212b;
  --panel: #212d3a;
  --panel-2: #283646;
  --rule: #2f3e4f;
  --text: #dce4ec;
  --muted: #8b9bae;
  --accent: #e9b44c;
  --accent-ink: #1d1606;
  --accent-soft: rgba(233, 180, 76, 0.14);
  --ok: #5db88c;
  --bad: #e0675a;
  --film: #0f161e;
  --film-panel: #283646;
  --film-rule: #2f3e4f;
  --film-text: #dce4ec;
  --film-muted: #8b9bae;
  --focus: #7cc4ff;
  color-scheme: dark;
}
:root[data-theme="slate"][data-mode="light"] {
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f5f7f9;
  --rule: #d5dce3;
  --text: #1c2733;
  --muted: #5b6b7d;
  --accent: #b97a0c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(185, 122, 12, 0.12);
  --ok: #2d8a5e;
  --bad: #c2463a;
  --film: #1a232d;
  --film-panel: #283646;
  --film-rule: #33445a;
  --film-text: #dce4ec;
  --film-muted: #8b9bae;
  --focus: #1f6fb5;
  color-scheme: light;
}
:root[data-theme="graphite"][data-mode="dark"] {
  --bg: #161718;
  --panel: #1f2022;
  --panel-2: #27292c;
  --rule: #34373b;
  --text: #e3e4e6;
  --muted: #979ba1;
  --accent: #3cc4d6;
  --accent-ink: #04191c;
  --accent-soft: rgba(60, 196, 214, 0.15);
  --ok: #5dbb84;
  --bad: #e8695d;
  --film: #0c0d0e;
  --film-panel: #222326;
  --film-rule: #323438;
  --film-text: #dedfe1;
  --film-muted: #8d9196;
  --focus: #7fe3f0;
  color-scheme: dark;
}
:root[data-theme="graphite"][data-mode="light"] {
  --bg: #f2f2f3;
  --panel: #ffffff;
  --panel-2: #f7f7f8;
  --rule: #dadbdd;
  --text: #1c1d1f;
  --muted: #62666b;
  --accent: #0e8797;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 135, 151, 0.12);
  --ok: #2b7d51;
  --bad: #c2412f;
  --film: #18191b;
  --film-panel: #26282b;
  --film-rule: #36393d;
  --film-text: #e3e4e6;
  --film-muted: #979ba1;
  --focus: #0e8797;
  color-scheme: light;
}
:root[data-theme="evergreen"][data-mode="dark"] {
  --bg: #0f1a17;
  --panel: #152420;
  --panel-2: #1c2f29;
  --rule: #284239;
  --text: #dbe9e3;
  --muted: #8eab9f;
  --accent: #4fd1a1;
  --accent-ink: #04170f;
  --accent-soft: rgba(79, 209, 161, 0.15);
  --ok: #7ccf72;
  --bad: #ef6f60;
  --film: #08110e;
  --film-panel: #152621;
  --film-rule: #243a33;
  --film-text: #d6e6df;
  --film-muted: #87a397;
  --focus: #93ead0;
  color-scheme: dark;
}
:root[data-theme="evergreen"][data-mode="light"] {
  --bg: #eef5f2;
  --panel: #ffffff;
  --panel-2: #f5faf8;
  --rule: #d0e1d9;
  --text: #13261f;
  --muted: #557063;
  --accent: #137a56;
  --accent-ink: #ffffff;
  --accent-soft: rgba(19, 122, 86, 0.12);
  --ok: #2f7d3c;
  --bad: #c03a2f;
  --film: #10201b;
  --film-panel: #1a2e28;
  --film-rule: #2a453c;
  --film-text: #dbe9e3;
  --film-muted: #8eab9f;
  --focus: #137a56;
  color-scheme: light;
}
:root[data-theme="plum"][data-mode="dark"] {
  --bg: #1a1424;
  --panel: #231b31;
  --panel-2: #2c223d;
  --rule: #3b2e52;
  --text: #e8e0f2;
  --muted: #a596ba;
  --accent: #c08cff;
  --accent-ink: #1a0d2b;
  --accent-soft: rgba(192, 140, 255, 0.16);
  --ok: #5fc49a;
  --bad: #f0707a;
  --film: #0f0b16;
  --film-panel: #241c33;
  --film-rule: #382c4e;
  --film-text: #e3dbee;
  --film-muted: #9c8eb2;
  --focus: #d9b8ff;
  color-scheme: dark;
}
:root[data-theme="plum"][data-mode="light"] {
  --bg: #f5f1fa;
  --panel: #ffffff;
  --panel-2: #faf7fd;
  --rule: #e0d6ec;
  --text: #24183a;
  --muted: #6c5d84;
  --accent: #7b3fc4;
  --accent-ink: #ffffff;
  --accent-soft: rgba(123, 63, 196, 0.12);
  --ok: #2a7d57;
  --bad: #c13b4a;
  --film: #1a1326;
  --film-panel: #2a2140;
  --film-rule: #3d3058;
  --film-text: #e8e0f2;
  --film-muted: #a596ba;
  --focus: #7b3fc4;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 700; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent); }
.tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  padding: 0.45rem 0.6rem;
  min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type='checkbox'] { accent-color: var(--accent); width: 1rem; height: 1rem; padding: 0; }

button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: 0.55; }
.btn, .btn-primary, .btn-ghost, .btn-link {
  border-radius: var(--radius-s);
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  background: none;
  white-space: nowrap;
}
.btn { border-color: var(--rule); background: var(--panel-2); }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
.btn-ghost.danger:hover:not(:disabled) { color: var(--bad); }
.btn-link { padding: 0.1rem 0.3rem; color: var(--accent); }
.btn-link:hover { text-decoration: underline; }
.block { width: 100%; }

/* ------------------------------------------------------------------ shell */
.boot { min-height: calc(100vh - var(--top-inset, 0px)); }
.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: calc(100vh - var(--top-inset, 0px)); }
.rail {
  background: var(--panel);
  border-right: 1px solid var(--rule);
  padding: 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: var(--top-inset, 0px);
  height: calc(100vh - var(--top-inset, 0px));
}
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-s);
  color: var(--text);
  text-decoration: none;
}
.rail a:hover { background: var(--panel-2); }
.rail a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.rail-group { color: var(--muted); font-size: 0.82rem; margin: 1.1rem 0.65rem 0.25rem; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.15rem; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.rail-foot .btn-ghost { text-align: left; padding-left: 0.65rem; }
.rail-viewer { border: 1px solid var(--rule); text-align: center; margin-bottom: 0.4rem; }

.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; padding: 0 0.65rem 1rem; }
.brand-lg { font-size: 1.35rem; padding: 0 0 1rem; }
/* RadiX Nexus Cloud (1.9.0): the orbit mark (src/brand.tsx) and wordmark. */
.brand-mark { flex: none; display: block; overflow: visible; }
.brand-word { font-family: 'Space Grotesk', var(--font); font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.brand-cloud { font-weight: 400; color: var(--accent); }
.login:not(:has(.login-globe)) { justify-content: center; }
html:has(.login), body:has(.login) { overscroll-behavior: none; }

.main { padding: 1.75rem 2rem 4rem; min-width: 0; }
/* 1.13.0: pages use the width of wide screens (the worklist was capped at 82rem). */
.page { max-width: 150rem; }
.page-narrow { max-width: 34rem; }
.page-head { display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: 0.5rem; }
.page-head h1 { margin: 0; }
.lede { color: var(--muted); max-width: 70ch; }
.notice { color: var(--muted); }
.count { color: var(--muted); margin: 1.25rem 0 0.5rem; }

/* ------------------------------------------------------------------ login */
/* 1.9.0: the form over a turning globe (src/loginGlobe.ts); the padlock opens on sign-in.
   1.33.0 (Hourbook look): the card sits at the bottom centre with the globe rising behind its
   top edge (loginGlobe.ts reads the card's position); passkey first; phones fold the password. */
.login {
  position: relative; min-height: calc(100vh - var(--top-inset, 0px)); min-height: calc(100dvh - var(--top-inset, 0px)); overflow: hidden; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6rem clamp(1rem, 6vw, 6rem) max(6vh, 2.5rem);
}
.login-globe { position: absolute; inset: 0; }
.login-globe-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.login-globe-canvas:active { cursor: grabbing; }
.login-top { position: absolute; top: 1.6rem; left: 2rem; z-index: 1; pointer-events: none; }
.login-top .brand-lg { padding: 0; }
.login-card {
  position: relative; z-index: 1; width: min(24rem, 100%); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 0.95rem; padding: 3.1rem 1.75rem 1.5rem; border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--rule);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
.login-brand { display: flex; align-items: center; gap: 0.75rem; }
.login-mark { width: 48px; height: 48px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--bg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 13%, transparent); }
.login-brand-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.login-brand-txt .brand-word { font-size: 1.35rem; line-height: 1.2; white-space: normal; }
.login-brand-txt small { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.login-pk { display: grid; gap: 0.65rem; }
.login-btn { min-height: 46px; border-radius: 23px; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; font-size: 1rem; }
.login-hint.pw-part-hint { margin: -0.1rem 0 0; text-align: center; font-size: 0.82rem; }
.login-pw-show { display: none; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.login-error { margin: 0; }
.login-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.login-head h1 { margin: 0; font-size: 1.6rem; }
.login-status { font-size: 0.82rem; color: var(--muted); }
.login-status.ok { color: var(--ok); }
.login-lede { color: var(--muted); margin: 0; }
.login-secure { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.82rem; }
.login-legend {
  position: absolute; right: 1.75rem; bottom: 1.5rem; z-index: 1; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.1rem; color: var(--muted); font-size: 0.82rem;
}
.login-legend > span { display: flex; align-items: center; gap: 0.5rem; }
.login-lock {
  position: absolute; top: -34px; left: calc(50% - 34px); width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel); border: 2px solid var(--accent); color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); transition: color 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.login-lock.open { color: var(--ok); border-color: var(--ok); transform: scale(1.08); }
.login-lock-hole { fill: var(--panel); }
.login-lock-shackle { transition: transform 0.5s cubic-bezier(0.3, 1.7, 0.5, 1); transform-box: fill-box; transform-origin: 100% 100%; }
.login-lock.open .login-lock-shackle { transform: translateY(-6px) rotate(32deg); }
.login-lock-ring {
  position: absolute; inset: -7px; border-radius: 50%; border: 3px solid transparent;
  border-top-color: var(--accent); border-right-color: var(--accent-soft); opacity: 0; transition: opacity 0.2s;
}
.login-lock.verify .login-lock-ring { opacity: 1; animation: login-spin 0.9s linear infinite; }
.login-lock-pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; }
.login-lock.open .login-lock-pulse { animation: login-pulse 0.9s ease-out 1; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@keyframes login-pulse { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
.login-outro { position: fixed; inset: 0; z-index: 1000; padding: 0; background: var(--bg); pointer-events: none; }
.login-outro .login-globe-canvas { cursor: default; }
.login-outro-card { position: fixed; }
.login-outro-card > .login-card { width: 100%; height: 100%; margin: 0; }
@media (max-width: 700px) {
  .login { padding: 1rem 1rem max(28px, env(safe-area-inset-bottom)); align-items: stretch; }
  .login-top { display: none; }
  .login-legend { display: none; }
  /* 1.33.1: the page never moves; a touch anywhere but a button or field spins the globe
     (the card lets touches through to the globe's canvas underneath). */
  .login:not(.login-outro) { height: 100dvh; min-height: 0; overscroll-behavior: none; touch-action: none; }
  .login-card { pointer-events: none; }
  .login-card button, .login-card input, .login-card a, .login-card label, .login-card .note, .login-card .form-error { pointer-events: auto; }
  .login-card {
    width: auto; border-radius: 28px; padding: 3.1rem 1.15rem 1.15rem; gap: 0.875rem;
    background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  }
  .login-btn { min-height: 52px; border-radius: 26px; }
  .login-card .field input { height: 50px; border-radius: 14px; font-size: 16px; }
  .pw-folded .pw-part, .pw-folded .pw-part-hint, .pw-folded .login-secure { display: none; }
  .pw-folded .login-pw-show { display: block; min-height: 44px; width: 100%; text-align: center; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .login-lock, .login-lock-shackle { transition: none; }
  .login-lock.verify .login-lock-ring { animation: none; }
  .login-lock.open .login-lock-pulse { animation: none; }
}

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 0.9rem; }
.form h2 { margin-top: 0.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem 1rem; align-items: start; }
.form-grid .field-wide, .form-grid > .field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.spacer { flex: 1; }
.form-error { color: var(--bad); margin: 0.5rem 0; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.checks { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-grid > .check { align-self: end; padding-bottom: 0.5rem; }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; flex-wrap: wrap; }
.seg button { background: var(--panel-2); border: 0; border-right: 1px solid var(--rule); padding: 0.42rem 0.75rem; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ------------------------------------------------------------------ search */
.node-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0 1rem; }
.node-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m);
  padding: 0.5rem 0.8rem;
}
.node-chip:hover { border-color: var(--muted); }
.node-chip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.node-chip-name { font-weight: 700; }
.node-chip-kind { color: var(--muted); font-size: 0.82rem; }

.query {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(9rem, max-content);
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: 0.9rem;
}
.query-row { grid-column: 1 / -1; border: 0; padding: 0; margin: 0.25rem 0 0; min-width: 0; }
.query-row > legend { padding: 0; margin-bottom: 0.35rem; }
.query .dates { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; color: var(--muted); }
.date-range { display: inline-flex; align-items: center; gap: 0.5rem; }
.date-summary { font-size: 0.9rem; }
.mod-checks { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mod-check {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; user-select: none;
  border: 1px solid var(--rule); background: var(--panel-2); border-radius: var(--radius-s);
  padding: 0.3rem 0.6rem; font-weight: 700; font-size: 0.88rem;
}
.mod-check:hover { border-color: var(--muted); }
.mod-check.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.mod-check input { width: 0.9rem; height: 0.9rem; }
.query > .btn-primary { grid-column: 5; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; }
.query-compact { grid-template-columns: 1fr auto; max-width: 40rem; margin: 1rem 0; }
/* 1.10.2: the search panel follows the width it has (window size, rail, split monitors). */
.search-page { container: worklist / inline-size; }
@container worklist (max-width: 760px) {
  .query { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query > .btn-primary { grid-column: 1 / -1; max-width: none; }
}
@container worklist (max-width: 420px) {
  .query { grid-template-columns: minmax(0, 1fr); }
}

.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; opacity: 0.6; }
.dot-ok { background: var(--ok); opacity: 1; }
.dot-bad { background: var(--bad); opacity: 1; }

.mods { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.mod {
  display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.05rem 0.4rem;
  border-radius: 3px; background: var(--panel-2); border: 1px solid var(--rule); color: var(--text);
}
.badge { font-size: 0.75rem; padding: 0.05rem 0.4rem; border-radius: 3px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--rule); }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.grid th { text-align: left; font-weight: 500; font-size: 0.85rem; color: var(--muted); padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); background: var(--panel-2); }
.grid td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; }
.grid .actions { text-align: right; white-space: nowrap; }
/* 1.13.0: dates, IDs and accession numbers never break across lines; headers stay on one line. */
.grid td.tab, .grid td.nowrap, .grid th { white-space: nowrap; }
/* 1.13.1: how a retrieval travelled (Retrievals & sends). */
.route, .grid td .mod { white-space: nowrap; }
.route-lan { color: var(--ok); font-weight: 600; }
.route-lan .muted, .route-cloud .muted { font-weight: 400; }
.grid .actions > * + * { margin-left: 0.25rem; }
.grid .sub { display: block; color: var(--muted); font-size: 0.85rem; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { cursor: pointer; }
.row:hover td { background: var(--panel-2); }
.row-open td { background: var(--accent-soft); }
.row-open td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.detail > td { background: var(--film); padding: 0; }

.study-detail { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1.25rem; padding: 1rem 1.25rem 1.25rem; color: var(--film-text); }
.series-list { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.series { display: grid; grid-template-columns: auto 2.5rem auto 1fr auto; align-items: center; gap: 0.65rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-s); cursor: pointer; }
.series:hover { background: rgba(255, 255, 255, 0.06); }
.series .mod { background: transparent; border-color: var(--film-rule); color: var(--film-text); }
.series-no { color: var(--film-muted); text-align: right; }
.series-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-count { color: var(--film-muted); font-size: 0.85rem; }
.series-panel { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
/* 1.15.0: thumbnails from the cloud copy, Series / Images (src/cloudImages.tsx) */
.series-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.series-bar .seg button { background: var(--film-panel); color: var(--film-text); border-color: var(--film-rule); padding: 0.28rem 0.7rem; }
.series-bar .seg button.on { background: var(--accent); color: var(--accent-ink); }
.series-bar .seg button:disabled { opacity: 0.45; cursor: not-allowed; }
.series-edited { font-size: 0.82rem; color: var(--warn, #e0a33a); }
.series.series-thumb { grid-template-columns: auto 4rem 2.5rem auto 1fr auto; padding: 0.25rem 0.5rem; }
.thumb { width: 4rem; height: 4rem; background: #000; border: 1px solid var(--film-rule); border-radius: var(--radius-s); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-none { color: var(--film-muted); font-size: 0.62rem; text-align: center; line-height: 1.15; padding: 0.2rem; }
.img-series { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.3rem 0.25rem 0.6rem; }
.img-series + .img-series { border-top: 1px solid var(--film-rule); padding-top: 0.6rem; }
.img-series-head { display: grid; grid-template-columns: 2.5rem auto 1fr auto auto; align-items: center; gap: 0.65rem; }
.img-series-head .mod { background: transparent; border-color: var(--film-rule); color: var(--film-text); }
.img-series-head .btn-link { color: var(--accent); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.35rem; }
.img-cell { position: relative; aspect-ratio: 1; background: #000; border: 1px solid var(--film-rule); border-radius: var(--radius-s); padding: 0; overflow: hidden; display: grid; place-items: center; cursor: pointer; color: var(--film-text); }
.img-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; display: grid; place-items: center; cursor: zoom-in; color: inherit; }
.img-cell:hover { outline: 2px solid var(--film-muted); outline-offset: -2px; }
.img-cell.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.img-no { position: absolute; left: 0.25rem; bottom: 0.15rem; font-size: 0.66rem; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.img-check { position: absolute; top: 0.2rem; right: 0.2rem; width: 1.3rem; height: 1.3rem; padding: 0; cursor: pointer; z-index: 1; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.45); font-size: 0.75rem; line-height: 1; display: grid; place-items: center; color: var(--accent-ink); }
.img-cell.on .img-check { background: var(--accent); border-color: var(--accent); }
.study-actions { display: flex; flex-direction: column; gap: 0.6rem; align-items: stretch; }
.study-actions .field-label { color: var(--film-muted); display: block; margin-bottom: 0.3rem; }
.study-actions .seg button { background: var(--film-panel); color: var(--film-text); border-color: var(--film-rule); }
.study-actions .seg button.on { background: var(--accent); color: var(--accent-ink); }
.study-actions .btn { background: var(--film-panel); color: var(--film-text); border-color: var(--film-rule); }
.study-detail .muted { color: var(--film-muted); }

.progress { display: flex; flex-direction: column; gap: 0.3rem; min-width: 11rem; }
.progress-bar { height: 0.4rem; background: var(--rule); border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.4s ease; }
.progress-completed .progress-bar span { background: var(--ok); }
.progress-failed .progress-bar span, .progress-partial .progress-bar span { background: var(--bad); }
.progress-cancelled .progress-bar span { background: var(--muted); }
.progress-label { font-size: 0.85rem; }
.progress-msg { font-size: 0.8rem; color: var(--bad); max-width: 46ch; overflow-wrap: anywhere; }
.progress-cell { min-width: 11rem; } /* 1.13.1: was width: 30% (pushed the table past the page) */

.empty { border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 2rem; margin-top: 1.25rem; max-width: 46rem; }
.empty-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.35rem; }
.empty-body { color: var(--muted); }
.empty-body p { margin: 0; }

/* ------------------------------------------------------------------ nodes */
.node-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.node-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.node-card.disabled { opacity: 0.65; }
.node-card header { display: flex; align-items: center; gap: 0.55rem; }
.node-kind { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.node-addr { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.node-meta { margin: 0; color: var(--muted); font-size: 0.88rem; }
.node-card footer { display: flex; gap: 0.35rem; margin-top: auto; padding-top: 0.5rem; }
.check > input[type='radio'], .check > input[type='checkbox'] { flex: none; }
.setup-steps { margin: 0.25rem 0 0.75rem 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.steps { list-style: none; margin: 0.25rem 0; padding: 0.55rem 0.7rem; background: var(--panel-2); border-radius: var(--radius-s); display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.88rem; }
.steps li { display: grid; grid-template-columns: 1rem 9.5rem 1fr; gap: 0.4rem; }
.steps .ok .step-mark { color: var(--ok); }
.steps .bad .step-mark, .steps .bad .step-detail { color: var(--bad); }
.step-detail { color: var(--muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ modal / toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 17, 0.6); display: grid; place-items: start center; padding: 6vh 1rem; overflow-y: auto; z-index: 26; }
.modal { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); width: min(32rem, 100%); padding: 1.25rem 1.4rem 1.4rem; }
.modal-wide { width: min(58rem, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 30; }
.toast { background: var(--panel); border: 1px solid var(--rule); border-left: 3px solid var(--ok); padding: 0.65rem 0.9rem; border-radius: var(--radius-s); max-width: 26rem; }
.toast-error { border-left-color: var(--bad); }
.code { background: var(--film); color: var(--film-text); padding: 1rem; border-radius: var(--radius-s); overflow: auto; max-height: 65vh; font-size: 0.8rem; }

/* ------------------------------------------------------------------ hanging protocols */
.page-split { display: grid; grid-template-columns: 18rem minmax(0, 1fr); gap: 2rem; max-width: 96rem; }
.hp-list .lede { font-size: 0.92rem; }
.hp-group { margin-top: 1.25rem; }
.hp-group-mod { font-weight: 700; color: var(--accent); margin: 0 0 0.35rem; }
.hp-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.hp-item { width: 100%; display: flex; align-items: center; gap: 0.6rem; text-align: left; background: none; border: 1px solid transparent; border-radius: var(--radius-s); padding: 0.4rem 0.5rem; }
.hp-item:hover { background: var(--panel); }
.hp-item.on { background: var(--panel); border-color: var(--accent); }
.hp-item.off .hp-item-name { color: var(--muted); }
.hp-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-prio { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.mini { display: inline-grid; gap: 2px; width: 1.6rem; height: 1.2rem; flex: none; }
.mini span { background: var(--muted); opacity: 0.55; border-radius: 1px; }
.mini-big { width: 4.5rem; height: 3.3rem; gap: 3px; }
.mini-big span { background: var(--film); opacity: 1; box-shadow: inset 0 0 0 1px var(--rule); }

.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.75rem; }
.template { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.9rem; text-align: left; }
.template:hover { border-color: var(--accent); }
.template-name { font-weight: 700; }
.template-mod { color: var(--muted); font-size: 0.85rem; }

.hp-editor { display: flex; flex-direction: column; gap: 1.25rem; }
.hp-meta { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 1rem; align-items: start; }
.hp-meta > .check { padding-top: 1.7rem; }

/* The lightbox: the protocol as it will hang, panes lit like a film viewer. */
.hp-stage { background: var(--film); border-radius: var(--radius-m); padding: 0.9rem; }
.hp-stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; color: var(--film-text); }
.hp-stage .field-label { color: var(--film-muted); }
.sync { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.layout-picker { display: flex; align-items: center; gap: 0.75rem; }
.layout-cells { display: grid; grid-template-columns: repeat(4, 0.95rem); gap: 3px; }
.layout-cells button { width: 0.95rem; height: 0.95rem; padding: 0; border: 1px solid var(--film-rule); background: var(--film-panel); border-radius: 2px; }
.layout-cells button.in { background: var(--accent); border-color: var(--accent); }
.layout-label { color: var(--film-text); font-weight: 700; min-width: 3rem; }
.lightbox { display: grid; gap: 6px; min-height: 19rem; }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 0.1rem;
  text-align: left;
  border: 1px solid var(--film-rule);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  color: var(--film-text);
  background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--film-panel) 70%, #ffffff 12%) 0%, var(--film-panel) 70%);
  overflow: hidden;
  min-height: 7.5rem;
}
.tile:hover { border-color: var(--film-muted); }
.tile.on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  /* A lit lightbox pane, tinted with the theme accent. */
  background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--accent) 35%, #ffffff) 0%, color-mix(in srgb, var(--accent) 80%, #ffffff) 55%, color-mix(in srgb, var(--accent) 75%, #000000) 100%);
  color: #10141a;
}
.tile.inverted:not(.on) { background: radial-gradient(120% 90% at 50% 40%, #cfd6dd 0%, #8d99a5 70%); color: #10171e; }
.tile-title { font-weight: 700; font-size: 1rem; }
.tile-line { font-size: 0.82rem; opacity: 0.85; }
.tile-plane { position: absolute; top: 0.7rem; right: 0.8rem; width: 2rem; height: 2rem; border: 1.5px solid currentColor; border-radius: 50%; opacity: 0.55; }
.plane-axial { border-radius: 50%; transform: scaleY(0.35); }
.plane-sagittal { transform: scaleX(0.35); }
.plane-coronal { border-radius: 4px; transform: scaleY(0.8); }

.hp-inspector { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.1rem 1.2rem; }
.hp-inspector h2 { margin-bottom: 0.9rem; }
.hp-advanced { margin-top: 1.2rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.hp-advanced summary { cursor: pointer; color: var(--muted); margin-bottom: 0.75rem; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.6rem; }
  .rail ul { display: flex; flex-wrap: wrap; }
  .rail-group { display: none; }
  .rail-foot { margin: 0; border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; }
  .brand { padding: 0 0.5rem; }
  .main { padding: 1.25rem 1rem 3rem; }
  .study-detail { grid-template-columns: 1fr; }
  .page-split { grid-template-columns: 1fr; }
  .hp-meta { grid-template-columns: 1fr 1fr; }
  table.grid { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* layout fixes */
.field > .seg { align-self: flex-start; }
.seg-grid { display: grid; grid-template-columns: repeat(2, 1fr); align-self: stretch !important; }
.seg-grid button { border-bottom: 1px solid var(--rule); }
.seg-grid button:nth-child(2n) { border-right: 0; }
.seg-grid button:nth-last-child(-n + 2) { border-bottom: 0; }
.hp-list .btn-primary.block { margin: 0.25rem 0 1rem; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .page-split > *, .main { min-width: 0; }
  .rail { width: 100%; }
}

/* ------------------------------------------------------------------ 1.1 additions */
.small { font-size: 0.85rem; }
.small-print { font-size: 0.88rem; margin-top: 1rem; }
.warn-text { color: var(--bad); font-size: 0.9rem; }
code { font-size: 0.9em; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 3px; padding: 0.05rem 0.3rem; }

.chips, .found { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; font-size: 0.78rem; padding: 0.08rem 0.45rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--rule); color: var(--text); white-space: nowrap; }
.chip-local { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* Multi-select node chips get a checkbox mark. */
.node-check { box-sizing: border-box; width: 1rem; height: 1rem; border: 1.5px solid var(--muted); border-radius: 3px; flex: none; position: relative; }
.node-check.on { background: var(--accent); border-color: var(--accent); }
/* 1.30.2: the tick centred in the box (it sat high and left). */
.node-check.on::after { content: ''; position: absolute; left: 50%; top: 45%; box-sizing: border-box; width: 0.3rem; height: 0.56rem; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg); }
.node-company { margin: 0; font-weight: 700; font-size: 0.9rem; }

.detail-nodes { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.6rem; }
.detail-nodes .field-label { color: var(--film-muted); }
.detail-nodes .seg button { background: var(--film-panel); color: var(--film-text); border-color: var(--film-rule); }
.detail-nodes .seg button.on { background: var(--accent); color: var(--accent-ink); }
.row td.actions .btn { padding: 0.25rem 0.75rem; }

/* Rail: badge, mode toggle */
.rail a { display: flex; align-items: center; gap: 0.5rem; }
.nav-badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: 0.75rem; font-weight: 700; min-width: 1.3rem; text-align: center; padding: 0 0.35rem; line-height: 1.3rem; }
.rail-user { display: flex; align-items: center; gap: 0.25rem; }
.rail-user > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-toggle { padding: 0.35rem 0.5rem; }
.mode-icon { display: block; width: 1rem; height: 1rem; border-radius: 50%; }
/* moon: a crescent; sun: a filled disc with a ring */
.mode-icon-dark { box-shadow: inset -0.3rem -0.15rem 0 0 currentColor; transform: rotate(-20deg); }
.mode-icon-light { background: currentColor; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px currentColor; transform: scale(0.65); }

/* Update notification */
.update-banner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-m); padding: 0.6rem 0.9rem; margin: -0.5rem 0 1.25rem; max-width: 150rem; }
.update-banner > span:nth-child(2) { flex: 1; min-width: 12rem; }
.update-banner .btn-primary, .update-banner .btn { text-decoration: none; }
.update-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }
.update-dot-busy { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
a.btn-primary, a.btn, a.btn-ghost { display: inline-block; text-decoration: none; }
a.btn-primary { color: var(--accent-ink); }
a.btn { color: var(--text); }

.notice-box { border: 1px solid var(--rule); background: var(--panel); border-radius: var(--radius-m); padding: 0.8rem 1rem; margin: 1rem 0; max-width: 60rem; }
.notice-box.warn { border-color: var(--bad); }
.update-status { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.9rem 1.1rem; margin: 1rem 0; max-width: 60rem; }
.update-status.update-failed, .update-status.update-rolled_back { border-color: var(--bad); }
.update-status.update-succeeded { border-color: var(--ok); }
.update-status-head { display: flex; align-items: center; gap: 0.55rem; }
.update-step { margin: 0.4rem 0; }
.update-log { margin-top: 0.5rem; max-height: 22rem; white-space: pre-wrap; }
.update-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; max-width: 60rem; }
.update-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.update-card header { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.update-notes { white-space: pre-wrap; line-height: 1.5; }
.update-card footer { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* Account: appearance */
.account-block { margin-top: 1.75rem; }
.account-block h2 { margin-bottom: 0.35rem; }
.mode-seg { margin: 0.5rem 0 1rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.75rem; max-width: 64rem; }
.theme-card { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.7rem; }
.theme-card:hover { border-color: var(--muted); }
.theme-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-swatch { display: grid; grid-template-columns: 1fr 3fr; gap: 4px; height: 4.2rem; border-radius: var(--radius-s); padding: 5px; border: 1px solid rgba(127, 127, 127, 0.25); }
.theme-swatch-rail { border-radius: 2px; }
.theme-swatch-panel { border-radius: 2px; display: flex; align-items: flex-end; padding: 6px; }
.theme-swatch-panel > span { width: 45%; height: 0.55rem; border-radius: 2px; }
.theme-name { font-weight: 700; }
.theme-blurb { color: var(--muted); font-size: 0.85rem; }

/* Opening a study (its own tab) */
.opening { min-height: calc(100vh - var(--top-inset, 0px)); display: grid; place-items: center; padding: 1rem; }
.opening-card { width: min(30rem, 100%); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.opening-card .brand { padding: 0; }
.opening-study { margin: 0; }
.opening-step { margin: 0; }

/* ------------------------------------------------------------------ 1.2.0: monitors */
.monitor-map { position: relative; width: 100%; max-width: 46rem; max-height: 22rem; min-height: 9rem; margin: 0.9rem 0; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-m); box-sizing: border-box; }
.monitor { position: absolute; box-sizing: border-box; border: 3px solid var(--panel); background: var(--film-panel); color: var(--film-text); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; padding: 0.2rem; overflow: hidden; }
.monitor:hover { background: var(--film-rule); }
.monitor.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.monitor-num { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.monitor-role { font-size: 0.78rem; color: var(--film-muted); text-align: center; }
.monitor-worklist .monitor-role, .monitor-viewer .monitor-role { color: var(--film-text); font-weight: 700; }
.monitor-viewer { background: #05080d; }
.monitor-none { opacity: 0.55; }
.monitor-split { padding: 0; background: var(--panel); }
.monitor-zone { position: absolute; top: 0; bottom: 0; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; background: var(--film-panel); }
.monitor-zone + .monitor-zone { border-left: 2px dashed var(--film-muted); }
.monitor-zone.monitor-viewer { background: #05080d; }
.monitor-zone.monitor-none { opacity: 0.55; }
.monitor-split.monitor-none, .monitor-split { opacity: 1; }
.role-chooser { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; flex-basis: 100%; }
.role-chooser > .field-label { min-width: 6rem; }
.monitor-inspector { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin-bottom: 0.6rem; }
.monitor-inspector h3 { margin: 0; font-size: 1rem; }
.monitor-inspector p { margin: 0.15rem 0 0; }
.monitor-inspector .field { min-width: 14rem; }
.monitor-blank { min-height: calc(100vh - var(--top-inset, 0px)); background: #000; color: #7d838c; display: grid; place-items: center; text-align: center; font-size: 0.95rem; }
.monitor-blank .strong { color: #b9bec6; }
.opening-card .brand .badge { margin-left: auto; }

.hp-monitors { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; }
.hp-mon { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel-2); text-align: left; }
.hp-mon.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hp-mon > span { display: flex; flex-direction: column; font-weight: 700; }
.hp-mon-study { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.hp-mon-add { align-self: center; }
.hp-mon-field { min-width: 15rem; }
.hp-mon-field select { background: var(--film-panel); color: var(--film-text); border-color: var(--film-rule); }
.hp-mon-note { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--film-muted); }
.hp-mon-actions { margin: 0 0 0.6rem; }
.lightbox[style*="aspect-ratio"] { min-height: 0; }
.lightbox-empty { display: grid; place-items: center; border: 1px dashed var(--film-rule); border-radius: 3px; min-height: 12rem; }
.template-mons { display: flex; gap: 0.35rem; }
.check-list { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; }
.hp-mon .mini span { background: var(--accent); opacity: 0.6; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { color: var(--text); }
.th-sort.on { color: var(--accent); }
.th-arrow { font-size: 0.7em; opacity: 0.45; }
.th-sort.on .th-arrow { opacity: 1; }
th.num .th-sort { flex-direction: row-reverse; }

/* 1.3.0: passkeys and HTTPS */
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 0.55rem 0.8rem; border-radius: 3px; max-width: 70ch; }
.note.bad { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.note.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.inline-form input { flex: 1 1 14rem; max-width: 22rem; }
.login-or { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.85rem; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.login-hint { color: var(--muted); font-size: 0.85rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0.75rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tls-log { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 4px; padding: 0.6rem 0.8rem; max-height: 16rem; overflow: auto; font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.host-list { display: flex; flex-direction: column; gap: 0.4rem; max-width: 26rem; }
.host-list .host-row { display: flex; gap: 0.4rem; }
.host-list .host-row input { flex: 1; min-width: 0; }

/* 1.4.0: security, audit, idle sign-out */
.nav-badge-alert { background: var(--bad); color: #fff; }
.inline-badge { display: inline-block; margin-left: 0.6rem; vertical-align: middle; font-size: 0.75rem; }
.rail-note { font-size: 0.78rem; line-height: 1.35; }
.idle-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; z-index: 1000; padding: 1rem; }
.idle-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 1.25rem 1.5rem; max-width: 26rem; display: flex; flex-direction: column; gap: 0.8rem; }
.idle-card h2 { margin: 0; }
.enroll-card { width: min(34rem, 100%); }
.enroll-title { font-size: 1.3rem; margin: 0; }
.plain-list { list-style: none; padding: 0; margin: 0.25rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.audit-filters { margin: 1rem 0; align-items: end; }
.audit-table td { vertical-align: top; }
.audit-table .uid { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 0.8rem; }
.nowrap { white-space: nowrap; }
.bad-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.outcome-badge { margin-left: 0.4rem; font-size: 0.72rem; padding: 0 0.35rem; border-radius: 3px; background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.muted-row td { color: var(--muted); }
.strong-row td { font-weight: 600; }
textarea { font: inherit; }
.users-table .actions { white-space: normal; width: 1%; min-width: 16rem; }
.users-table .actions > * { margin: 0.1rem 0 0.1rem 0.25rem; }

/* ------------------------------------------------------------------ reporting (1.5.0) */
.btn-small { padding: 0.2rem 0.55rem; font-size: 0.85rem; }
.ok-text { color: var(--ok); font-size: 0.9rem; }
.sub-h { font-size: 0.95rem; margin: 1.1rem 0 0.2rem; }
.spacer { flex: 1; }
.tabs { margin: 0.4rem 0 1rem; }

/* Report status chips: worklists, report lists, report screen. */
.report-chip { font-weight: 700; }
.report-draft { border-color: var(--muted); color: var(--muted); }
.report-transcription { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.report-transcribed { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.report-signed { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

/* The report screen fills the window: header, editor + side panels, action bar. */
.report-screen { min-height: calc(100vh - var(--top-inset, 0px)); display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); }
.report-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.6rem; padding: 0.7rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.report-patient h1 { font-size: 1.3rem; margin: 0; line-height: 1.2; }
.report-exam { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.report-facts { display: inline-flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--muted); font-size: 0.9rem; align-items: center; }
.report-state { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.report-error { margin: 2rem 1.25rem; }
.report-body { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; padding: 1rem 1.25rem; align-items: start; }
.report-main { min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.report-main .notice { margin: 0; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--panel); }
.editor-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.editor-tools { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.editor-tools .field-label { margin-right: 0.4rem; }
.save-state { font-size: 0.85rem; }
.report-editor { width: 100%; box-sizing: border-box; min-height: calc(calc(100vh - var(--top-inset, 0px)) - 15rem); resize: vertical; font: 400 1.05rem/1.6 var(--font); padding: 0.9rem 1rem; background: var(--panel); color: var(--text); border: 1px solid var(--rule); border-radius: var(--radius-m); tab-size: 4; }
.report-editor:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.report-editor[readonly] { background: var(--panel-2); }
.report-editor-small { min-height: 9rem; font-size: 0.98rem; }
/* 1.9.3: the text follows dictation playback (a highlight drawn behind the text box) */
.report-editor-wrap { position: relative; }
.report-editor-wrap.following > textarea { position: relative; z-index: 1; background: transparent; scrollbar-gutter: stable; }
.report-backdrop { position: absolute; inset: 0; min-height: 0; overflow: hidden; scrollbar-gutter: stable; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; color: transparent; pointer-events: none; resize: none; }
.report-backdrop.ro { background: var(--panel-2); }
.report-backdrop mark { color: transparent; background: color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 3px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 32%, transparent); }
.dict-follow { font-size: 0.85rem; margin: 0.3rem 0 0; }
.editor-help { font-size: 0.82rem; margin: 0; }
.report-final { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.1rem 1.3rem; }
.report-text { white-space: pre-wrap; word-wrap: break-word; font: 400 1.03rem/1.6 var(--font); margin: 0; color: var(--text); }
.report-sig { color: var(--muted); margin: 1rem 0 0; font-size: 0.92rem; }
.report-addendum { border-top: 1px solid var(--rule); margin-top: 1.1rem; padding-top: 0.9rem; }
.report-addendum h3 { font-size: 0.95rem; margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.03em; }
.addendum-editor { border-top: 1px solid var(--rule); margin-top: 1.1rem; padding-top: 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; }
.report-side { display: flex; flex-direction: column; gap: 0.9rem; position: sticky; top: 4.6rem; max-height: calc(calc(100vh - var(--top-inset, 0px)) - 9.5rem); overflow: auto; }
.side-block { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.75rem 0.9rem; }
.side-block h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.side-block p { margin: 0.2rem 0; font-size: 0.9rem; }
.report-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.7rem 1.25rem; background: var(--panel); border-top: 1px solid var(--rule); position: sticky; bottom: 0; z-index: 5; }
.report-actions .btn-primary { min-width: 7rem; }

/* Dictation */
.recorder { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.rec-btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.rec-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--bad); display: inline-block; }
.rec-live { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }
.rec-live .rec-dot { animation: rec-pulse 1.2s ease-in-out infinite; }
.rec-live.paused { color: var(--muted); }
.rec-live.paused .rec-dot { animation: none; background: var(--muted); }
@keyframes rec-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .rec-live .rec-dot { animation: none; } }
.dict-player { width: 100%; margin: 0.2rem 0; }
.dict-rate { display: flex; align-items: center; gap: 0.4rem; }
.dict-rate select { width: auto; }
.dict-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.dict-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.dict-list li.on .btn-link { font-weight: 700; }
.dict-list .tab { margin-left: auto; }

/* Documents */
.docs { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.doc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; width: 100%; }
.doc { display: flex; align-items: center; gap: 0.5rem; }
.doc-link { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; min-width: 0; flex: 1; }
.doc-link:hover .doc-meta span:first-child { text-decoration: underline; }
.doc-thumb { width: 2.6rem; height: 3.3rem; object-fit: cover; border: 1px solid var(--rule); border-radius: 3px; background: #fff; }
.doc-pdf { width: 2.6rem; height: 3.3rem; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 3px; font-size: 0.75rem; font-weight: 700; color: var(--bad); background: var(--panel-2); }
.doc-meta { display: flex; flex-direction: column; font-size: 0.88rem; min-width: 0; }
.add-docs { display: flex; flex-direction: column; gap: 0.9rem; }
.drop { border: 2px dashed var(--rule); border-radius: var(--radius-m); padding: 1.4rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.drop p { margin: 0; color: var(--muted); }
.camera { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.camera-view { width: 100%; max-height: 22rem; background: #000; border-radius: var(--radius-m); transition: opacity 0.15s; }
.camera-view.flash { opacity: 0.35; }
.scanner { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: flex-end; }
.scanner .field { min-width: 11rem; }
.pages { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.page-thumb { margin: 0; width: 7rem; display: flex; flex-direction: column; gap: 0.2rem; }
.page-thumb img, .page-thumb .doc-pdf { width: 7rem; height: 9rem; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 3px; }
.page-thumb figcaption { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }

/* Prior reports and activity */
.prior-reports { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.prior-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; width: 100%; text-align: left; background: none; border: 0; padding: 0.3rem 0; color: var(--text); cursor: pointer; }
.prior-head:hover .strong { text-decoration: underline; }
.prior-text { padding: 0.3rem 0 0.6rem; border-bottom: 1px solid var(--rule); }
.prior-text .report-text { font-size: 0.9rem; }
.deliveries { list-style: none; padding: 0; margin: 0 0 0.6rem; display: flex; flex-direction: column; gap: 0.45rem; }
.delivery { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; align-items: center; font-size: 0.88rem; }
.delivery-msg { flex-basis: 100%; font-size: 0.82rem; }
.delivery-chip-sent { border-color: var(--ok); color: var(--ok); }
.delivery-chip-failed { border-color: var(--bad); color: var(--bad); }
.delivery-chip-pending, .delivery-chip-sending { border-color: var(--accent); color: var(--accent); }
.history { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.2rem; }

/* Node editor: report routing; admin reporting page; account templates */
.routing { display: flex; flex-direction: column; gap: 0.45rem; border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.75rem 0.9rem; }
.routing .field { max-width: 30rem; }
.routing-note { margin: 0; font-size: 0.88rem; }
.routing-sub { margin-top: 0.4rem; }
.routing-hl7 { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem 0.9rem; padding: 0.4rem 0 0.4rem 1.6rem; }
.scanner-row { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(14rem, 1fr) auto; gap: 0.5rem 1rem; align-items: start; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.scanner-row .form-actions { grid-column: 1 / -1; margin: 0; }
.template-editor { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.9rem; margin-top: 0.6rem; max-width: 60rem; }
.template-list { display: flex; flex-direction: column; gap: 0.2rem; }
.template-key { text-align: left; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.35rem 0.6rem; }
.template-key.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.template-add { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.template-add input { min-width: 0; }
.study-actions-sep { border-top: 1px solid var(--film-rule); margin: 0.2rem 0; }

@media (max-width: 960px) {
  .report-body { grid-template-columns: 1fr; }
  .report-side { position: static; max-height: none; }
  .report-editor { min-height: 50vh; }
  .template-editor { grid-template-columns: 1fr; }
  .scanner-row { grid-template-columns: 1fr; }
}

/* Toasts stay clear of the report screen's action bar. */
.report-screen ~ .toasts { bottom: 4.6rem; }

/* Long dialogs (adding several document pages) scroll inside the window. */
.modal { max-height: calc(calc(100vh - var(--top-inset, 0px)) - 2.5rem); overflow-y: auto; box-sizing: border-box; }
.template-key.on .muted { color: inherit; opacity: 0.8; }
.scanner-row > .check { padding-top: 1.9rem; }

.btn-primary.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ------------------------------------------------------------------ devices (1.5.1) */
.devices .dev-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.2rem; margin: 0 0 1rem; max-width: 70rem; }
.devices .dev-card h2 { font-size: 1.02rem; margin: 0 0 0.6rem; }
.devices .dev-card p { margin: 0.35rem 0; }
.dev-dot { display: inline-block; width: 0.62rem; height: 0.62rem; border-radius: 50%; margin-right: 0.55rem; vertical-align: 0.05rem; background: var(--muted); }
.dev-ok { background: var(--ok); }
.dev-bad { background: var(--bad); }
.dev-wait { background: var(--muted); opacity: 0.6; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem 1rem; margin: 0.6rem 0; }
.dev-install { margin: 0.6rem 0; }
.dev-install summary { cursor: pointer; font-weight: 600; }
.dev-install ol { padding-left: 1.3rem; }
.dev-install li { margin: 0.35rem 0; }
.dev-cmd { background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.55rem 0.7rem; overflow-x: auto; margin: 0.4rem 0; font-size: 0.85rem; }
.dev-upload { margin-left: 0.8rem; cursor: pointer; }
.dev-label { width: 3.5in; max-width: 100%; height: 1.125in; box-sizing: border-box; background: #fff; color: #000; border-radius: 6px; padding: 0.4rem 0.8rem; display: flex; flex-direction: column; justify-content: center; font: 12px Arial, sans-serif; margin: 0.6rem 0 0.2rem; }
.dev-label strong { font-size: 14px; }
.sig-canvas { width: 100%; max-width: 500px; aspect-ratio: 5 / 1; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-s); display: block; }

/* ------------------------------------------------------------------ 1.6.0 */
.btn.danger, .btn-primary.danger { border-color: var(--bad); }
.btn.danger { color: var(--bad); }
.btn-primary.danger { background: var(--bad); color: #fff; }
.page-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.section-title { margin: 2rem 0 0.6rem; font-size: 1.1rem; }
.grid th.pick, .grid td.pick { width: 2.2rem; padding-right: 0; }
.chip-bad { border-color: var(--bad); color: var(--bad); font-weight: 700; }
.chip-warn { border-color: var(--warn, #d99a1e); color: var(--warn, #d99a1e); font-weight: 700; }
.badge-bad { border-color: var(--bad); color: var(--bad); }
.badge-warn { border-color: var(--warn, #d99a1e); color: var(--warn, #d99a1e); }
.update-banner.banner-alert { background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: var(--bad); }
.update-dot-alert { background: var(--bad); animation: pulse 1.2s ease-in-out infinite; }
.node-chip-backup { color: var(--warn, #d99a1e); font-weight: 700; }
.node-roles { margin: 0; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.node-backup { color: var(--muted); }
.backup-box { border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 0.75rem; gap: 0.6rem; }
.backup-box .form-grid { margin-top: 0.25rem; }
.endpoint { display: inline-flex; align-items: center; gap: 0.4rem; }
.monitor-grid td { vertical-align: top; }
.monitor-grid tr.disabled td { opacity: 0.55; }
.admin-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; margin: 1.5rem 0; align-items: start; }
.card-form { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.1rem; }
.card-form h2 { margin: 0; font-size: 1.05rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.test-to { max-width: 14rem; }
.alert-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; max-width: 82rem; }
.alert-item { display: grid; grid-template-columns: 11rem 1fr; gap: 0.2rem 1rem; padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-left: 4px solid var(--muted); border-radius: var(--radius-s); background: var(--panel); }
.alert-item .sub { grid-column: 2; color: var(--muted); font-size: 0.85rem; }
.alert-item.alert-error { border-left-color: var(--bad); }
.alert-item.alert-warning { border-left-color: var(--warn, #d99a1e); }
.alert-item.alert-info { border-left-color: var(--ok); }
.alert-item.unread { box-shadow: inset 0 0 0 1px var(--accent); }

/* DICOM Send */
.send-dialog { min-width: min(30rem, 90vw); }
.send-dests { display: flex; flex-direction: column; gap: 0.4rem; }
.send-dest { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.3rem 0.6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel-2); cursor: pointer; }
.send-dest.on { border-color: var(--accent); background: var(--accent-soft); }
.send-dest .sub { grid-column: 3 / -1; color: var(--muted); font-size: 0.85rem; }
.send-jobs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.send-jobs li { display: flex; flex-direction: column; gap: 0.25rem; }

/* Print window */
.print-screen { min-height: calc(100vh - var(--top-inset, 0px)); display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.print-top { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.print-top h1 { margin: 0; font-size: 1.15rem; }
.print-patient { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1rem; }
.print-msg { padding: 2rem 1.25rem; }
.print-body { display: grid; grid-template-columns: minmax(18rem, 22rem) 1fr; min-height: 0; }
.print-options { display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--panel); border-right: 1px solid var(--rule); overflow-y: auto; max-height: calc(calc(100vh - var(--top-inset, 0px)) - 3.5rem); position: sticky; top: 3.5rem; }
.print-options .field select, .print-film input { width: 100%; }
.seg-wrap { flex-wrap: wrap; }
.print-series { display: flex; flex-direction: column; gap: 0.35rem; max-height: 12rem; overflow-y: auto; }
.print-series .check { align-items: baseline; }
.print-window { display: flex; gap: 0.75rem; margin-top: 0.3rem; }
.print-window input { width: 6rem; }
.print-film { display: grid; grid-template-columns: 1fr 6rem; gap: 0.75rem; }
.toggle-row { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.print-summary { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-m); padding: 0.7rem 0.9rem; }
.print-summary p { margin: 0; }
.print-pages { font-size: 1.25rem; }
.print-pages strong { font-size: 1.9rem; }
.print-go { padding: 0.7rem 1rem; font-size: 1.05rem; }
.print-preview { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.25rem; align-content: flex-start; min-width: 0; }
.print-preview-hint { margin: 0; font-size: 0.85rem; }
.print-preview-pages { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.preview-page { margin: 0; display: flex; flex-direction: column; gap: 0.35rem; align-items: center; }
/* 1.12.3: the preview page is drawn to scale (Letter with its margins, or the film), so each box has the printed shape. */
.preview-sheet { box-sizing: border-box; display: flex; flex-direction: column; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.preview-sheet.film { background: #000; outline: 1px solid var(--rule); }
.preview-head { flex: none; display: flex; align-items: flex-start; }
.preview-head span { display: block; width: 100%; height: 45%; border-bottom: 1px solid #000; background: linear-gradient(90deg, #c9ced6 0 35%, transparent 35% 45%, #dde1e7 45% 70%, transparent 70%); background-size: 100% 40%; background-repeat: no-repeat; }
.preview-grid { display: grid; }
.preview-sheet.film .preview-grid > .pv-cell { box-shadow: inset 0 0 0 0.5px #333; }
.pv-cell { position: relative; background: #000; overflow: hidden; touch-action: none; user-select: none; }
.pv-cell.movable { cursor: grab; }
.pv-cell.movable.live { cursor: grabbing; }
.pv-cell img { display: block; pointer-events: none; -webkit-user-drag: none; }
.pv-cell .pv-raw { position: absolute; max-width: none; max-height: none; }
.pv-cell .pv-exact { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pv-cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.pv-fit { position: absolute; top: 3px; right: 3px; padding: 0.05rem 0.4rem; font-size: 0.7rem; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; opacity: 0.9; }
.pv-label { position: absolute; left: 3px; bottom: 2px; color: #fff; font-size: 0.6rem; }
.print-sheets { display: none; }

@media print {
  html, body { background: #fff !important; }
  .print-screen.printing > :not(.print-sheets):not(style) { display: none !important; }
  .print-screen.printing { display: block; min-height: 0; background: #fff; }
  .print-sheets { display: block; color: #000; font-family: var(--font); }
  .toasts, .idle-overlay { display: none !important; }
  /* 1.13.4: the installed app's title-bar strip (wco) repeated on every page and its 32 px top padding pushed
     the last sheet onto an extra, blank page; a dark theme's colour scheme framed the pages in black. */
  :root { color-scheme: light !important; }
  html.wco body, body { padding: 0 !important; margin: 0 !important; }
  .wco-bar { display: none !important; }
  html.wco .print-screen.printing { min-height: 0 !important; }
  .sheet { height: calc(100vh - 1mm); display: flex; flex-direction: column; break-after: page; page-break-after: always; overflow: hidden; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sheet-head { flex: none; box-sizing: border-box; height: 7mm; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; font-size: 9pt; line-height: 1.2; padding-bottom: 1mm; border-bottom: 0.3mm solid #000; margin-bottom: 2mm; }
  .sheet-grid { flex: 1; display: grid; gap: 1mm; min-height: 0; }
  .sheet-cell { position: relative; background: #000; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
  .sheet-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
  .sheet-label { position: absolute; left: 1mm; bottom: 0.5mm; color: #fff; font-size: 7pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 760px) {
  .print-body { grid-template-columns: 1fr; }
  .print-options { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--rule); }
}
.monitor-grid code { white-space: normal; word-break: break-all; }

/* ------------------------------------------------------------------ phones (1.7.0) */
.m-shell { height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: var(--bg); overflow: hidden; }
.m-shell, .mv, .m-sheet { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.m-shell ::-webkit-scrollbar, .mv ::-webkit-scrollbar { width: 4px; height: 4px; }
.m-shell ::-webkit-scrollbar-track, .mv ::-webkit-scrollbar-track { background: transparent; }
.m-shell ::-webkit-scrollbar-thumb, .mv ::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }
.m-shell ::-webkit-scrollbar-thumb:hover, .mv ::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.m-body { overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.m-page-desktop { padding: 12px; overflow-x: auto; }
.m-page-desktop .page { padding: 0; }
.m-page { display: flex; flex-direction: column; min-height: 100%; }
.m-head { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 3; }
.m-head h1 { margin: 0; font-size: 22px; flex: 1; }
.m-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--panel-2); color: var(--text); flex: none; }
.m-searchbar { padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.m-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--rule); color: var(--muted); }
.m-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; outline: none; padding: 0; }
.m-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.m-chip { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.m-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.m-count { margin: 0; padding: 10px 16px 6px; font-size: 13px; color: var(--muted); }
.m-pad { padding: 0 16px; }
.m-list { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.m-empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.m-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--rule); color: var(--text); text-align: left; font: inherit; width: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.m-card:active { background: var(--panel-2); }
.m-card-top { display: flex; align-items: baseline; gap: 8px; }
.m-card-name { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card-time { font-size: 13px; color: var(--muted); }
.m-card-desc { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.m-card-id { font-size: 12px; color: var(--muted); }
.m-tabs { display: grid; background: var(--panel); border-top: 1px solid var(--rule); padding: 6px 4px max(10px, env(safe-area-inset-bottom)); }
.m-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; color: var(--muted); text-decoration: none; font-size: 12px; }
.m-tabs a.on { color: var(--accent); font-weight: 700; }
.m-sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 20, 0.55); display: flex; align-items: flex-end; }
.m-sheet { width: 100%; max-height: 88dvh; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0; border-top: 1px solid var(--rule); padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: m-up 0.18s ease-out; }
@keyframes m-up { from { transform: translateY(40px); opacity: 0.4; } }
.m-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--rule); margin: 10px auto 4px; }
.m-sheet-head { padding: 4px 18px 12px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.m-sheet-head p { margin: 0; font-size: 15px; }
.m-sheet-title { display: flex; align-items: center; gap: 8px; }
.m-sheet-title h2 { margin: 0; font-size: 20px; flex: 1; }
.m-sheet-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.m-actions { padding: 14px 18px 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-actions button { min-height: 50px; border-radius: 12px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--text); font: inherit; font-size: 15px; }
.m-actions .m-open { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 17px; }
.m-sheet-sub { margin: 12px 18px 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.m-series { list-style: none; margin: 0; padding: 0 18px; }
.m-series label { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--rule); }
.m-series input { width: 20px; height: 20px; }
.m-series-desc { flex: 1; min-width: 0; font-size: 15px; }
.m-note { margin: 0; padding: 10px 18px; font-size: 13px; color: var(--muted); }
.m-form { padding: 16px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.m-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.m-field input { height: 46px; font-size: 16px; }
.m-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-group legend { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.m-grid3, .m-grid4 { display: grid; gap: 8px; }
.m-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.m-tile { min-height: 44px; border-radius: 10px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.m-tile.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.m-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--panel); }
.m-row > span:nth-of-type(1) { flex: 1; font-size: 16px; }
.m-row.on { border-color: var(--accent); }
.m-footer { position: sticky; bottom: 0; padding: 12px 0 4px; background: var(--bg); margin-top: auto; }
.m-big { width: 100%; height: 52px; font-size: 17px; border-radius: 12px; }
.m-menu { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.m-who { margin: 0 0 8px; color: var(--muted); }
.m-menu-item { display: flex; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; font-size: 16px; text-decoration: none; text-align: left; }
.m-menu-item.danger { color: var(--bad); }

/* Quick viewer: always on black (the film tokens), whatever the theme. */
.mv { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr); user-select: none; -webkit-user-select: none; background: #000; color: var(--film-text); overflow: hidden; }
.mv-top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 10px 8px; background: var(--film); }
.mv-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 0; background: none; color: var(--film-text); }
.mv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv-title span { font-size: 13px; color: var(--film-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-stage { position: relative; min-height: 0; overflow: hidden; }
.mv-canvas { position: absolute; inset: 0; touch-action: none; }
.mv-corner { position: absolute; top: 8px; font-size: 12px; line-height: 1.5; color: #e6e6e6; pointer-events: none; text-shadow: 0 0 3px #000; }
.mv-tl { left: 10px; }
.mv-tr { right: 14px; text-align: right; }
.mv-scroll { position: absolute; right: 4px; top: 56px; bottom: 56px; width: 4px; border-radius: 2px; background: var(--film-rule); pointer-events: none; }
.mv-scroll span { position: absolute; left: 0; right: 0; height: 22px; margin-top: -11px; border-radius: 2px; background: var(--accent); }
.mv-hint { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; font-size: 12px; color: var(--film-muted); pointer-events: none; }
.mv-msg { padding: 24px 16px; margin: 0; }
.mv-over { position: absolute; left: 0; right: 0; top: 40%; text-align: center; }
.mv-tray { background: var(--film); padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 6px; }
.mv-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mv-chip { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--film-rule); background: var(--film-panel); color: var(--film-text); font: inherit; font-size: 14px; }
.mv-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.mv-series { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; }
.mv-thumb { flex: none; width: 74px; height: 74px; border-radius: 10px; border: 1px solid var(--film-rule); background: var(--film-panel); color: var(--film-text); font: inherit; font-size: 11px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; }
.mv-thumb.on { border: 2px solid var(--accent); }
.mv-thumb img { width: 100%; height: 48px; object-fit: contain; background: #000; border-radius: 6px; }
.mv-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--film); border-top: 1px solid var(--film-rule); padding: 4px 4px max(10px, env(safe-area-inset-bottom)); }
.mv-bar button { min-height: 52px; border: 0; background: none; color: var(--film-text); font: inherit; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.mv-bar button.on { color: var(--accent); font-weight: 700; }
/* Series loading in the background (1.9.3) */
.mv-load { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: color-mix(in srgb, var(--film-rule) 60%, transparent); z-index: 3; pointer-events: none; }
.mv-load span { display: block; height: 100%; background: var(--accent); transition: width .2s linear; }
/* Dictation in the quick viewer (1.9.2) */
.mv-bar button.mv-rec { color: #ff5a52; font-weight: 700; font-variant-numeric: tabular-nums; }
.mv-bar button:disabled { opacity: .5; }
.mv-lang { margin-left: auto; white-space: nowrap; border: 1px solid var(--film-rule); background: none; color: var(--film-text); font: inherit; font-size: 12px; border-radius: 999px; padding: 4px 10px; min-height: 30px; }
.mv-dict { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5; background: color-mix(in srgb, var(--film-panel) 92%, transparent); color: var(--film-text); border: 1px solid var(--film-rule); border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 1.35; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mv-dict.on { border-color: color-mix(in srgb, #ff5a52 55%, var(--film-rule)); }
.mv-dict-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--film-muted); }
.mv-dict-head strong { color: var(--film-text); font-size: 13px; }
.mv-dict-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5a52; animation: mv-pulse 1.2s ease-in-out infinite; }
@keyframes mv-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mv-dict-dot { animation: none; } }
.mv-dict-text { margin: 4px 0 0; max-height: 4.1em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.mv-dict-text em { font-style: normal; opacity: .75; }
.mv-dict-note { margin: 4px 0 0; font-size: 12px; color: var(--film-muted); }

/* Thin scrollbars in the theme's colours, everywhere (1.7.0). */
html, body, * { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-corner { background: transparent; }

/* Company profile (1.9.0) */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.company-cell { display: flex; align-items: center; gap: 10px; }
.company-logo-sm { height: 28px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.company-logo-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.company-logo-box { width: 180px; height: 64px; border: 1px dashed var(--rule); border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.company-logo-box img { max-width: 168px; max-height: 54px; object-fit: contain; }
.company-logo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; flex: 1; min-width: 180px; }

/* Unsent report text and dictation kept on the device (1.9.1) */
.draft-restore > span { flex: 1 1 320px; }
.draft-restore button { white-space: nowrap; }
.draft-restore { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius-s); border: 1px solid var(--accent); background: var(--accent-soft); font-size: 0.9rem; }
.device-pending { border-left: 3px solid var(--accent); }
.device-pending-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.device-pending-head { display: flex; gap: 8px; align-items: baseline; }
.device-pending-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.device-pending-audio { width: 100%; margin-top: 6px; }

/* AI transcriptionist (1.10.0) */
.ai-line { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0.15rem 0 0.35rem; font-size: 0.85rem; }
.ai-spin { display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.35em; vertical-align: -0.1em; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: ai-spin 0.9s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation: none; } }
.ai-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.55rem 0.8rem; margin-bottom: 0.6rem; border-radius: var(--radius-m); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.ai-corrections { padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; border-radius: var(--radius-m); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); background: var(--panel); }
.ai-corrections-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; }
.ai-diff { margin: 0.5rem 0; line-height: 1.6; white-space: pre-wrap; }
.ai-diff del { color: var(--danger, #d9534f); background: color-mix(in srgb, var(--danger, #d9534f) 14%, transparent); text-decoration: line-through; border-radius: 3px; }
.ai-diff ins { color: var(--ok, #2e9e5b); background: color-mix(in srgb, var(--ok, #2e9e5b) 16%, transparent); text-decoration: none; border-radius: 3px; }
.ai-corrections-actions { display: flex; gap: 0.5rem; }
.ai-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; margin: 0.4rem 0 0.8rem; }
.ai-engine { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.4rem 0.9rem 0.8rem; margin: 0; }
.ai-engine legend { padding: 0 0.3rem; font-weight: 600; }

/* Installed app drawing into the title bar (1.10.1, src/wco.ts) */
.wco-bar { display: none; }
html.wco { --top-inset: env(titlebar-area-height, 32px); }
html.wco body { padding-top: var(--top-inset); }
html.wco .wco-bar {
  display: flex; align-items: center; position: fixed; z-index: 1000; top: 0;
  left: env(titlebar-area-x, 0); width: env(titlebar-area-width, 100%); height: var(--top-inset);
  padding: 0 0.8rem; box-sizing: border-box; background: var(--panel); border-bottom: 1px solid var(--rule);
  color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  -webkit-app-region: drag; app-region: drag; user-select: none;
}
html.wco .shell, html.wco .report-screen, html.wco .print-screen { min-height: calc(100vh - var(--top-inset)); }
html.wco .report-top, html.wco .print-top { top: var(--top-inset); }
html.wco .report-side { top: calc(4.6rem + var(--top-inset)); }
html.wco .print-options { top: calc(3.5rem + var(--top-inset)); }
html.wco .modal-backdrop { padding-top: calc(6vh + var(--top-inset)); }

/* Live dictation and uploads (1.11.0) */
.live-switch { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; margin-left: 0.4rem; }
.live-state { font-size: 0.85rem; }
.upload-rec { margin-left: auto; }

/* 1.12.1: text replacements table */
.ai-repl { width: 100%; }
.ai-repl input { width: 100%; }
.ai-repl td:last-child { width: 1%; white-space: nowrap; }

/* 1.12.2: print options: summary + Print button always visible; hints under switches */
.print-footer { position: sticky; bottom: -1.1rem; margin: auto -1.25rem -1.1rem; padding: 0.8rem 1.25rem 1.1rem; background: var(--panel); border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.7rem; z-index: 2; }
/* 1.15.0: option rows with a hint under the label (Send dialog too). */
.send-dialog .toggle-row, .export-dialog .toggle-row { align-items: flex-start; }
.send-dialog .toggle-row > span, .export-dialog .toggle-row > span { display: flex; flex-direction: column; gap: 0.15rem; }
.send-dialog .toggle-row > input, .export-dialog .toggle-row > input { flex: none; margin-top: 0.2rem; width: 1rem; height: 1rem; accent-color: var(--accent); }
.print-options .toggle-row { align-items: flex-start; }
.print-options .toggle-row > span { display: flex; flex-direction: column; gap: 0.1rem; }
.print-options .toggle-row .field-hint { font-size: 0.8rem; }
.print-options { gap: 0.85rem; }
@media (max-width: 760px) { .print-footer { position: static; margin: 0; padding: 0; border: 0; } }
.print-options .toggle-row > input { flex: none; margin-top: 0.2rem; }

/* 1.13.1: print preview boxes waiting for / failing to get their image. */
.pv-wait { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: rgba(255, 255, 255, 0.8); animation: pv-spin 0.9s linear infinite; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pv-wait { animation: none; } }
.pv-failed { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; padding: 0.2rem 0.5rem; font-size: 0.7rem; border: 1px solid var(--bad); border-radius: var(--radius-s); background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer; }
.print-failed { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.print-failed .form-actions { margin: 0; }

/* 1.13.3: where the print window takes the images from. */
.print-source { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; }
.print-source .field-label { margin: 0; }
.print-source .muted { font-size: 0.8rem; }
.print-source-local { border-left-color: var(--ok); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 1.16.0: larger preview of cloud images (imagePreview.tsx) */
.thumb-open { padding: 0; cursor: zoom-in; }
.thumb-open:hover, .thumb-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ipv-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 9, 0.78); display: grid; place-items: center; padding: max(1rem, var(--top-inset, 0px)) 1rem 1rem; z-index: 30; overscroll-behavior: contain; }
.ipv { width: min(72rem, 100%); height: min(56rem, calc(100vh - 2rem - var(--top-inset, 0px))); display: grid; grid-template-rows: auto 1fr auto; background: var(--film); color: var(--film-text); border: 1px solid var(--film-rule); border-radius: var(--radius-m); overflow: hidden; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5); }
.ipv-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.6rem 0.5rem 0.9rem; border-bottom: 1px solid var(--film-rule); background: var(--film-panel); }
.ipv-head .btn-ghost { color: var(--film-text); }
.ipv-title { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1; }
.ipv-title .mod { background: transparent; border-color: var(--film-rule); color: var(--film-text); }
.ipv-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipv-pos { color: var(--film-muted); font-size: 0.85rem; white-space: nowrap; }
.ipv-stage { position: relative; background: #000; min-height: 0; display: grid; place-items: center; overflow: hidden; user-select: none; }
.ipv-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.ipv-msg { color: var(--film-muted); }
.ipv-spin { position: absolute; top: 0.75rem; right: 0.75rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--accent); animation: ai-spin 0.8s linear infinite; }
.ipv-flag { position: absolute; top: 0.6rem; left: 0.6rem; background: var(--bad); color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: var(--radius-s); }
.ipv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.5rem; height: 4rem; border: 0; border-radius: var(--radius-s); background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.ipv-stage:hover .ipv-nav:not(:disabled), .ipv-nav:focus-visible { opacity: 1; }
.ipv-nav.prev { left: 0.5rem; }
.ipv-nav.next { right: 0.5rem; }
.ipv-foot { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.5rem 0.9rem 0.6rem; border-top: 1px solid var(--film-rule); background: var(--film-panel); }
.ipv-slider { width: 100%; accent-color: var(--accent); }
.ipv-strip { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.15rem; }
.ipv-chip { position: relative; flex: 0 0 auto; width: 3.4rem; height: 3.4rem; padding: 0; background: #000; border: 1px solid var(--film-rule); border-radius: var(--radius-s); overflow: hidden; cursor: pointer; color: #fff; }
.ipv-chip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ipv-chip span { position: absolute; left: 0.2rem; bottom: 0.1rem; font-size: 0.62rem; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ipv-chip.on { outline: 2px solid var(--accent); outline-offset: -2px; }
.ipv-hint { margin: 0; font-size: 0.75rem; color: var(--film-muted); }
@media (max-width: 700px) {
  .ipv-backdrop { padding: 0; }
  .ipv { height: 100vh; border-radius: 0; border: 0; }
  .ipv-hint, .ipv-pos { display: none; }
  .ipv-nav { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .ipv-spin { animation: none; } }

/* 1.16.0: Download / disc dialog (exportMedia.tsx) */
.export-dialog .field { display: flex; flex-direction: column; gap: 0.35rem; }
.export-studies { display: flex; flex-direction: column; gap: 0.3rem; max-height: 14rem; overflow-y: auto; }
.export-study { display: grid; grid-template-columns: auto 6.5rem 1fr auto; gap: 0.6rem; align-items: center; padding: 0.45rem 0.6rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel-2); cursor: pointer; }
.export-study.on { border-color: var(--accent); }
.export-size { margin: 0; }
.export-progress { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.export-progress .progress { width: 100%; }
.export-ready { display: flex; flex-direction: column; gap: 0.6rem; }
.export-ready p { margin: 0; }
.export-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.export-buttons a { text-decoration: none; display: inline-flex; align-items: center; }
.burn { display: flex; flex-direction: column; gap: 0.4rem; border-top: 1px solid var(--rule); padding-top: 0.7rem; }
.burn p { margin: 0; }
.burn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.burn-row select { flex: 1; min-width: 12rem; }
.progress-cell .export-ready { gap: 0.3rem; }
.progress-cell .burn { display: none; }
@media (max-width: 560px) { .export-study { grid-template-columns: auto 1fr; } .export-study .tab { grid-column: 2; } }

/* 1.17.0: RIS foundation (ris.tsx, pages/Orders, Patients, ProceduresAdmin) */
.table-wrap { overflow-x: auto; }
.ris-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0.6rem; }
.ris-subbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.ris-search { flex: 1 1 18rem; max-width: 32rem; }
.ris-daynav { display: inline-flex; align-items: center; gap: 0.3rem; }
.ris-daynav .btn-ghost { font-size: 1.2rem; padding: 0.1rem 0.5rem; }
.ris-row { cursor: pointer; }
.ris-row:hover td, .ris-row:focus-visible td { background: var(--accent-soft); }
.ris-row-cancelled td { color: var(--muted); }
.ris-row-cancelled td .strong { text-decoration: line-through; }
.ris-status { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.06rem 0.45rem; border-radius: 99px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.ris-scheduled { color: var(--text); }
.ris-arrived { border-color: var(--accent); color: var(--accent); }
.ris-in_progress { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ris-completed { border-color: var(--ok); color: var(--ok); }
.ris-reported { background: color-mix(in srgb, var(--ok) 18%, transparent); border-color: var(--ok); color: var(--ok); }
.ris-cancelled { text-decoration: line-through; }
.ris-form .form-row { align-items: start; }
.ris-form fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.ris-ins { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.ris-dups { margin: 0; }
.ris-dups .btn-link { margin-left: 0.5rem; }
.ris-picker { display: flex; flex-direction: column; gap: 0.5rem; }
.ris-picker-bar { display: flex; gap: 0.5rem; }
.ris-picker-bar input { flex: 1; }
.ris-picker-list { list-style: none; margin: 0.4rem 0 0; padding: 0; max-height: 16rem; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-m); }
.ris-picker-list:empty { display: none; }
.ris-picker-list li + li { border-top: 1px solid var(--rule); }
.ris-picker-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; text-align: left; background: none; border: 0; padding: 0.5rem 0.7rem; color: inherit; cursor: pointer; font: inherit; }
.ris-picker-list button:hover, .ris-picker-list button:focus-visible { background: var(--accent-soft); }
.ris-patient-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.ris-proc-search input { width: 100%; }
.ris-proc-list { list-style: none; margin: 0.4rem 0 0; padding: 0; max-height: 14rem; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-m); }
.ris-proc-list li + li { border-top: 1px solid var(--rule); }
.ris-proc-list li.muted { padding: 0.45rem 0.7rem; }
.ris-proc-list button, .ris-picked li { display: grid; grid-template-columns: 3.2rem 3.6rem 1fr auto auto; align-items: center; gap: 0.5rem; width: 100%; text-align: left; background: none; border: 0; padding: 0.4rem 0.7rem; color: inherit; font: inherit; }
.ris-proc-list button { cursor: pointer; grid-template-columns: 3.2rem 3.6rem 1fr; }
.ris-proc-list button:hover, .ris-proc-list button:focus-visible { background: var(--accent-soft); }
.ris-picked { list-style: none; margin: 0 0 0.5rem; padding: 0; border: 1px solid var(--accent); border-radius: var(--radius-m); background: var(--accent-soft); }
.ris-picked li + li { border-top: 1px solid var(--rule); }
.ris-prep { margin: 0.5rem 0 0; font-size: 0.9rem; }
.ris-order { display: flex; flex-direction: column; gap: 0.75rem; }
.ris-order-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ris-order-title { font-size: 1.05rem; font-weight: 700; }
.ris-order-state { display: flex; gap: 0.4rem; align-items: flex-start; }
.ris-name { color: var(--text); }
.ris-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ris-cancel { margin-top: 0; }
.ris-history summary { cursor: pointer; color: var(--muted); }
.ris-history .history { margin-top: 0.4rem; }
.ris-kv { max-width: 48rem; }
.ris-back { margin: 0 0 0.25rem; }
.ris-box { border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius-m); background: var(--panel); padding: 0.5rem 0.7rem; font-size: 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; }
.ris-box-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.ris-box-head .field-label { margin: 0; }
.side-block .ris-box { border: 0; border-left: 0; background: none; padding: 0; }
.study-actions .ris-box-compact { flex: 1 1 100%; }
.code-input { text-transform: uppercase; font-variant-numeric: tabular-nums; max-width: 8rem; }
.code-badge { margin-left: 0.45rem; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .ris-proc-list button, .ris-picked li { grid-template-columns: 2.8rem 3.4rem 1fr auto; }
  .ris-picked li .muted { display: none; }
}
.user-ris-role { display: block; margin-top: 0.3rem; }

/* 1.18.0: DICOM nodes › Modalities, monitoring tabs */
.page-head.sub-head { align-items: flex-start; flex-wrap: nowrap; }
.page-head.sub-head .lede { margin: 0; flex: 1; }
@media (max-width: 700px) { .page-head.sub-head { flex-wrap: wrap; } }
.mod-group .section-title { margin-top: 1.25rem; }
.mod-unknown code { font-weight: 700; }
.ris-machine { display: flex; gap: 0.5rem; align-items: center; }

/* ------------------------------------------------------------------ reading worklist (1.19.0) */
.worklist-page .page-head-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.worklist-grid .wl-check { width: 2rem; text-align: center; }
.worklist-grid .wl-check input { margin: 0; }
.worklist-grid tr.wl-stat td { background: color-mix(in srgb, var(--bad, #d64545) 9%, transparent); }
.worklist-grid tr.wl-stat td:first-child { box-shadow: inset 3px 0 0 var(--bad, #d64545); }
.worklist-grid tr.wl-urgent td:first-child { box-shadow: inset 3px 0 0 var(--warn, #d99a1e); }
.worklist-grid tr.wl-stat.row-open td, .worklist-grid tr.row-open td { background: var(--accent-soft); }
.wl-agesex { font-weight: 400; white-space: nowrap; }
.wl-reason { font-size: 0.8rem; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-cloud { margin-left: 0.35rem; font-size: 0.7rem; }
.wl-change { margin-left: 0.4rem; font-size: 0.82rem; }
.wl-sub { font-size: 0.8rem; display: flex; gap: 0.1rem; align-items: baseline; }
.wl-sub .wl-change:first-child { margin-left: 0; }
.wl-scroll { overflow-x: auto; }
.wl-author { font-size: 0.8rem; }
.wl-stat-count { color: var(--bad, #d64545); }
.wl-foot { font-size: 0.8rem; margin-top: 0.75rem; }
.wl-selbar { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem; margin: 0.4rem 0; border: 1px solid var(--accent); border-radius: var(--radius-s); background: var(--accent-soft); position: sticky; top: 0; z-index: 2; }
.wl-order-search { width: 100%; margin: 0.25rem 0 0.75rem; }
.wl-match { margin-left: 0.4rem; font-size: 0.7rem; }
.wl-likely td { background: var(--accent-soft); }
@media (max-width: 1440px) {
  .worklist-grid .wl-c-mod { display: none; }
  .worklist-grid td, .worklist-grid th { padding-left: 0.5rem; padding-right: 0.5rem; }
}
@media (max-width: 1100px) {
  .wl-reason { display: none; }
}
@media (max-width: 700px) {
  .worklist-grid .wl-c-reader, .worklist-grid .wl-c-id, .worklist-grid .wl-c-fac, .worklist-grid .wl-c-mod, .worklist-grid .wl-c-img, .worklist-grid .wl-c-order, .worklist-grid .wl-c-rep, .worklist-grid .wl-check,
  .worklist-grid .wl-c-act, .worklist-grid th:last-child { display: none; }
  .worklist-grid td, .worklist-grid th { padding-left: 0.45rem; padding-right: 0.45rem; }
}
.wl-polling { margin-top: 1.5rem; max-width: 52rem; }
/* 1.28.0: DICOM Institution Name column (Worklist, Q/R, Cloud studies) */
.worklist-grid .wl-c-inst, .col-inst { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .worklist-grid .wl-c-inst { display: none; } }
.inst-rules { display: grid; gap: 0.4rem; margin: 0.3rem 0 0.5rem; }
.inst-rule { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 0.4rem; align-items: center; }
.inst-find { display: flex; gap: 0.5rem; align-items: center; margin: 0.4rem 0; flex-wrap: wrap; }
.inst-find input { flex: 1 1 14rem; min-width: 0; }
.inst-count { opacity: 0.8; margin-left: 0.2rem; font-variant-numeric: tabular-nums; }
.inst-seen { max-height: 12rem; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.35rem 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
@media (max-width: 520px) { .inst-rule { grid-template-columns: 1fr auto; } .inst-rule select { grid-column: 1 / -1; } }
.num-input { width: 4.2rem; padding: 0.2rem 0.35rem; }

/* ------------------------------------------------------------------ scheduling (1.20.0) */
.when-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.slot-picker { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.6rem 0.75rem; margin: 0.25rem 0 0.75rem; background: var(--panel-2); }
.slot-day { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.slot-row { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.6rem; align-items: start; padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.slot-machine { font-weight: 700; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; max-height: 11rem; overflow-y: auto; }
.slot-chip { font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 99px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font-variant-numeric: tabular-nums; }
.slot-chip:hover, .slot-chip:focus-visible { border-color: var(--accent); color: var(--accent); }

.sched-dayname { margin-left: auto; }
.sched-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; align-items: start; }
.sched-grid { display: grid; grid-template-columns: 4.2rem repeat(var(--lanes), minmax(10rem, 1fr)); overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel); max-height: calc(100vh - 13rem); overflow-y: auto; user-select: none; }
.sched-head { position: sticky; top: 0; z-index: 3; background: var(--panel-2); border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); padding: 0.4rem 0.5rem; min-height: 3.2rem; }
.sched-head .small { font-size: 0.72rem; line-height: 1.25; }
.sched-gutter-head { border-left: 0; }
.sched-gutter { position: relative; }
.sched-hour { position: absolute; right: 0.4rem; transform: translateY(-50%); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched-hour:first-child { transform: none; }
/* Closed time: faint stripes; open hours are plain panels drawn on top (.sched-open). */
.sched-lane { position: relative; border-left: 1px solid var(--rule); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 9%, transparent) 0 2px, transparent 2px 9px); }
.sched-lane-any { background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.sched-lane-edit { cursor: copy; }
.sched-open { position: absolute; left: 0; right: 0; background: var(--panel); background-image: linear-gradient(to bottom, color-mix(in srgb, var(--rule) 60%, transparent) 1px, transparent 1px); background-size: 100% 24px; }
.sched-block { position: absolute; left: 0; right: 0; z-index: 1; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 22%, transparent) 0 6px, transparent 6px 12px); border-top: 1px solid var(--muted); border-bottom: 1px solid var(--muted); font-size: 0.72rem; color: var(--muted); padding: 0.1rem 0.35rem; overflow: hidden; cursor: pointer; }
.sched-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.sched-order { position: absolute; z-index: 2; border-radius: 4px; padding: 0.15rem 0.35rem; font-size: 0.75rem; line-height: 1.25; overflow: hidden; background: var(--accent-soft); border: 1px solid var(--accent); border-left-width: 4px; color: var(--text); cursor: pointer; }
.sched-order .badge { font-size: 0.65rem; padding: 0 0.25rem; }
.sched-movable { cursor: grab; touch-action: none; }
.sched-arrived, .sched-in_progress { background: color-mix(in srgb, var(--warn, #d99a1e) 18%, var(--panel)); border-color: var(--warn, #d99a1e); }
.sched-completed, .sched-reported { background: var(--panel-2); border-color: var(--rule); color: var(--muted); }
.sched-requested { border-style: dashed; }
.sched-clash { box-shadow: 0 0 0 2px var(--bad); }
.sched-p-stat { border-left-color: var(--bad); }
.sched-dragging { opacity: 0.35; }
.sched-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.sched-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-status { color: var(--muted); }
.sched-ghost { position: absolute; left: 2px; right: 2px; z-index: 4; border: 2px dashed var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 20%, transparent); font-size: 0.75rem; padding: 0.15rem 0.35rem; pointer-events: none; overflow: hidden; }
.sched-drag-hint { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 0.35rem 0.8rem; border-radius: 99px; font-weight: 700; z-index: 50; pointer-events: none; }
.sched-side { border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel); padding: 0.6rem 0.7rem; max-height: calc(100vh - 13rem); overflow-y: auto; }
.sched-side h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.sched-waiting { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.sched-wait-item { border: 1px dashed var(--rule); border-radius: 4px; padding: 0.35rem 0.45rem; background: var(--panel-2); cursor: pointer; user-select: none; }
.sched-wait-item.sched-movable { cursor: grab; }
.sched-week { display: grid; grid-template-columns: repeat(7, minmax(9rem, 1fr)); gap: 0.5rem; overflow-x: auto; }
.sched-week-day { border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--panel); min-height: 12rem; }
.sched-week-day.sched-today { border-color: var(--accent); }
.sched-week-head { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: var(--panel-2); border: 0; border-bottom: 1px solid var(--rule); padding: 0.4rem 0.5rem; text-align: left; }
.sched-week-day ul { list-style: none; margin: 0; padding: 0.35rem; display: grid; gap: 0.3rem; }
.sched-week-item { position: static; border: 1px solid var(--accent); border-left-width: 4px; border-radius: 4px; padding: 0.2rem 0.35rem; font-size: 0.75rem; background: var(--accent-soft); cursor: pointer; }
@media (max-width: 1100px) { .sched-wrap { grid-template-columns: 1fr; } .sched-side { max-height: none; } }

/* ------------------------------------------------------------------ worklist extras, critical results (1.21.0) */
.wl-who { margin: 0 0 0.5rem; }
.wl-reading { font-size: 0.78rem; color: var(--warn, #d99a1e); white-space: nowrap; }
.crit-open { font-weight: 700; white-space: nowrap; }
.crit-done { white-space: nowrap; }
.crit-overdue { animation: crit-pulse 1.6s ease-in-out infinite; }
@keyframes crit-pulse { 50% { background: color-mix(in srgb, var(--bad) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .crit-overdue { animation: none; background: color-mix(in srgb, var(--bad) 25%, transparent); } }
.crit-done { border-color: var(--ok, #3fb37f); color: var(--ok, #3fb37f); }
.crit-box { display: grid; gap: 0.4rem; margin-bottom: 0.75rem; }
.crit-row { border: 1px solid var(--bad); border-radius: var(--radius-s); padding: 0.4rem 0.55rem; font-size: 0.85rem; background: color-mix(in srgb, var(--bad) 8%, transparent); }
.crit-row.crit-communicated { border-color: var(--rule); background: var(--panel-2); }
.crit-row .btn-link { margin-left: 0.4rem; font-size: 0.82rem; }
.crit-flag { justify-self: start; border-color: var(--bad); color: var(--bad); }
.crit-also { margin: 0 0 0.75rem; }
.crit-page .crit-finding { font-weight: 600; }
.crit-page tr.crit-overdue-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.nav-badge-stat { background: var(--bad); color: #fff; }

/* ------------------------------------------------------------------ appointment papers (1.23.0) */
/* Paper is always white with black text, on screen too (a preview of what prints). */
.pp-wrap { background: #e9ecef; min-height: 100vh; color: #111; padding: 0 0 2rem; font-family: var(--font); }
.pp-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: var(--panel); color: var(--text); border-bottom: 1px solid var(--rule); }
.pp-error { margin: 2rem; }
.pp-sheet { background: #fff; color: #111; width: 8.5in; max-width: calc(100vw - 2rem); min-height: 10in; margin: 1rem auto; padding: 0.6in; box-sizing: border-box; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); font-size: 11pt; line-height: 1.35; }
.pp-day .pp-sheet, .pp-sheet.pp-day { width: 11in; min-height: 8in; padding: 0.45in; font-size: 9.5pt; }
.pp-head { display: flex; align-items: flex-start; gap: 14px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 14px; }
.pp-logo { max-height: 56px; max-width: 180px; object-fit: contain; }
.pp-fac { flex: 1; }
.pp-fac-name { font-weight: 700; font-size: 1.15em; }
.pp-fac-line { font-size: 0.85em; color: #333; }
.pp-title { font-weight: 700; font-size: 1.3em; text-transform: uppercase; letter-spacing: 0.04em; text-align: right; }
.pp-slip-when { border: 2px solid #111; border-radius: 6px; padding: 10px 14px; margin: 6px 0 14px; }
.pp-big { font-size: 1.6em; font-weight: 700; }
.pp-big::first-letter, .pp-day-date::first-letter { text-transform: uppercase; }
.pp-big2 { font-size: 1.2em; margin-top: 2px; }
.pp-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 10px; }
.pp-kv dt { color: #444; }
.pp-kv dd { margin: 0; }
.pp-sheet h3 { font-size: 1em; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #999; margin: 14px 0 6px; padding-bottom: 2px; }
.pp-table { width: 100%; border-collapse: collapse; }
.pp-table td, .pp-table th { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; vertical-align: top; }
.pp-table th { font-size: 0.85em; text-transform: uppercase; color: #333; border-bottom: 1.5px solid #111; }
.pp-small { font-size: 0.82em; color: #444; }
.pp-list { margin: 4px 0; padding-left: 1.2em; }
.pp-call { margin-top: 18px; font-size: 1.05em; }
.pp-req-codes { display: flex; gap: 40px; margin: 4px 0 12px; }
.pp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pp-box { border: 1px solid #999; border-radius: 4px; padding: 6px 8px; margin: 8px 0; }
.pp-sign { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; }
.pp-foot { margin-top: 18px; font-size: 0.75em; color: #555; }
.pp-day-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 8px; }
.pp-day-date { font-weight: 700; font-size: 1.15em; }
.pp-day-table tr.pp-prio td:first-child { border-left: 4px solid #111; }
.pp-check { font-size: 1.3em; text-align: center; }
.barcode { display: inline-flex; flex-direction: column; align-items: center; }
.barcode svg { display: block; }
.barcode-text { font-family: ui-monospace, monospace; font-size: 0.8em; letter-spacing: 0.08em; }
.pp-labels { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 1rem; }
.pp-label { width: var(--lw); height: var(--lh); box-sizing: border-box; padding: 0.06in 0.08in; background: #fff; color: #000; overflow: hidden; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; justify-content: space-between; font-size: 7.5pt; line-height: 1.15; }
.pp-label-name { font-weight: 700; font-size: 9.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-label-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-label .barcode { align-self: center; }
.pp-label-small { font-size: 6.5pt; }
.pp-label-small .pp-label-name { font-size: 8pt; }
@media print {
  .pp-wrap { background: #fff !important; padding: 0; min-height: 0; }
  .no-print { display: none !important; }
  .pp-sheet { box-shadow: none; margin: 0; padding: 0; width: auto; max-width: none; min-height: 0; }
  .pp-break { break-before: page; page-break-before: always; }
  .pp-labels { display: block; padding: 0; }
  .pp-label { box-shadow: none; width: var(--lw); height: var(--lh); break-after: page; page-break-after: always; }
  .pp-label:last-child { break-after: auto; page-break-after: auto; }
}
.prep-missing { margin-left: 0.35rem; font-size: 0.68rem; }
.reminder-sample { white-space: pre-wrap; font-family: var(--font); font-size: 0.85rem; max-height: 18rem; overflow-y: auto; }

/* ------------------------------------------------------------------ tabbed pages, templates (1.25.0) */
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0.25rem 0 1rem; flex-wrap: wrap; }
.tabbar-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.55rem 0.95rem; color: var(--muted); font: inherit; display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: -1px; }
.tabbar-tab:hover { color: var(--text); }
.tabbar-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.tab-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--bad); display: inline-block; }
.tab-badge { margin-left: 0; }
.tabbed-page > .page-head { margin-bottom: 0; }
.tabbed-page .tab-body > section.page, .tabbed-page .tab-body > .page { padding: 0; max-width: none; }
.tabbed-page .tab-body > section.page > h1:first-child, .tabbed-page .tab-body > .page > h1:first-child,
.tabbed-page .tab-body > section.page > .page-head:first-child > h1 { display: none; }
.tpl-panel .tpl-head { display: flex; justify-content: space-between; align-items: baseline; }
.tpl-search { width: 100%; margin: 0.35rem 0; }
.tpl-group { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0.6rem 0 0.3rem; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.tpl-row { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.45rem 0.55rem; border: 1px solid var(--rule); border-radius: var(--radius-s); }
.tpl-row.tpl-current { border-color: var(--accent); background: var(--accent-soft); }
.tpl-row-main { flex: 1; min-width: 0; }
.tpl-name { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.tpl-name:hover { color: var(--accent); }
.tpl-meta { font-size: 0.78rem; color: var(--muted); }
.tpl-preview { white-space: pre-wrap; font-family: var(--font); font-size: 0.8rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.45rem 0.55rem; margin: 0.35rem 0 0; max-height: 14rem; overflow-y: auto; }
.tpl-preview-dialog { max-height: 12rem; }
.tpl-textarea { font-family: var(--font); min-height: 16rem; }
.tpl-first { max-width: 36rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-fold { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.75rem; letter-spacing: 0.04em; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 1rem 0.65rem 0.25rem; cursor: pointer; }
.rail-fold:hover { color: var(--text); }
.rail-fold .chev { transition: transform 0.15s; }
.rail-fold[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.rail-heading { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; padding: 1rem 0.65rem 0.25rem; margin: 0; }
/* Worklist cards (1.25.0): narrow windows and phones */
.wl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.wl-card { position: relative; display: flex; align-items: stretch; border-radius: 12px; background: var(--panel); border: 1px solid var(--rule); }
.wl-card-stat { border-left: 4px solid var(--bad); }
.wl-card-urgent { border-left: 4px solid var(--warn, #d99a1e); }
.wl-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: none; border: 0; color: var(--text); text-align: left; font: inherit; cursor: pointer; border-radius: 12px; touch-action: manipulation; }
.wl-card-main:hover { background: var(--panel-2); }
.wl-card-top { display: flex; align-items: baseline; gap: 8px; }
.wl-card-name { font-weight: 700; font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-card-time { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.wl-card-desc { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; }
.wl-chip-reading { border-color: var(--warn, #d99a1e); color: var(--warn, #d99a1e); }
.wl-card-more { position: relative; }
.wl-card-dots { height: 100%; padding: 0 12px; font-size: 1.3rem; border-radius: 0 12px 12px 0; }
.wl-card-menu { position: absolute; right: 6px; top: 40px; z-index: 6; min-width: 13rem; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; padding: 4px; }
.wl-card-menu button { background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 8px 10px; border-radius: var(--radius-s); }
.wl-card-menu button:hover { background: var(--accent-soft); }
.wl-card-menu button.danger { color: var(--bad); }
.wl-cards-mode .page-head-actions .muted { display: none; }

/* 1.26.0: click and drag on the schedule to select a time and length. */
.sched-sel { position: absolute; left: 2px; right: 2px; z-index: 5; border: 2px solid var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.35rem; pointer-events: none; }
.sched-sel > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-sel-done { pointer-events: auto; cursor: default; }
.sched-sel-menu { position: absolute; top: 100%; left: -2px; margin: 4px 0; z-index: 6; display: flex; gap: 0.35rem; align-items: center; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.35rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.sched-lane-edit { user-select: none; -webkit-user-select: none; }

/* 1.26.0: report screen › Templates › Manage opens as a pop-up. */
.modal-tpl { width: min(64rem, 100%); }
.tpl-inline-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.tpl-inline-head h3 { margin: 0; font-size: 1.05rem; }
.modal-tpl .tpl-manager .grid { width: 100%; }
@media (max-width: 760px) {
  .modal-backdrop:has(.modal-tpl) { padding: 0; }
  .modal-tpl { width: 100%; max-width: none; height: 100%; max-height: none !important; border-radius: 0; }
  .modal-tpl .grid th:nth-child(3), .modal-tpl .grid td:nth-child(3) { display: none; }
  .modal-tpl .tpl-manager { overflow-x: auto; }
}

/* 1.26.2: a server certificate's fingerprint to compare. */
.pin-card { background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; display: grid; gap: 0.3rem; margin: 0.5rem 0; }
.pin-fp { font-size: 0.85rem; word-break: break-all; line-height: 1.5; }

/* 1.26.3: Connect dcm4chee lists the archive's AE titles. */
.aet-list { display: grid; gap: 0.4rem; margin: 0.5rem 0; }
.aet-item { display: flex; align-items: baseline; gap: 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.5rem 0.7rem; cursor: pointer; }
.aet-item.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.aet-list + .btn-link { align-self: flex-start; justify-self: start; text-align: left; }

/* 1.27.0: Worklist search, date range, multi-select chips, study panel; outside CD/DVD import. */
.wl-search { min-width: 18rem; flex: 1 1 18rem; font-size: 1rem; padding-left: 0.75rem; }
.wl-dates { display: inline-flex; align-items: center; gap: 0.4rem; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0.25rem 0 0.75rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-btn { border: 1px solid var(--rule); background: var(--panel-2); color: inherit; border-radius: 999px; padding: 0.25rem 0.75rem; font: inherit; font-size: 0.9rem; cursor: pointer; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.wl-row { cursor: default; }
.wl-row.wl-row-shown td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wl-panel { position: fixed; top: var(--top-inset, 0px); right: 0; bottom: 0; width: min(25rem, 100vw); z-index: 25; background: var(--panel); border-left: 1px solid var(--rule); box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35); padding: 1rem 1.2rem; overflow-y: auto; box-sizing: border-box; }
.wl-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.wl-panel-head h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.wl-panel-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 1rem 0 0.5rem; }
.wl-panel-actions .btn-primary { grid-column: 1 / -1; }
.import-patient { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; }
.import-studies { display: grid; gap: 0.35rem; margin: 0.25rem 0 0; }

/* 1.29.0: patient portal on the Worklist panel */
.pp-staff { border-top: 1px solid var(--rule); margin-top: 0.8rem; padding-top: 0.6rem; }
.pp-staff-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.pp-staff-head h3 { margin: 0; font-size: 1rem; }
.pp-timeline { margin: 0.5rem 0; padding-left: 1.1rem; font-size: 0.9rem; display: grid; gap: 0.25rem; }
.pp-hold { margin-top: 0.5rem; }

/* 1.30.0: Transfer logs */
.tl-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0 0.5rem; }
.tl-filters input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.tl-status { margin-bottom: 0.75rem; }
.tl-grid .sub { display: block; font-size: 0.8rem; color: var(--muted); }
.tl-msg { max-width: 22rem; white-space: normal; }
.tl-inst { font-size: 0.8rem; color: var(--text); opacity: 0.85; }
.chip.tl-active { background: var(--accent-soft); }
.chip.tl-failed { border-color: var(--danger, #e5484d); color: var(--danger, #e5484d); }
.tl-row-failed td { background: color-mix(in srgb, var(--danger, #e5484d) 7%, transparent); }

/* 1.30.1: compact list filters (src/filterMenu.tsx) */
.fm { position: relative; }
.fm-btn { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.2rem; padding: 0 0.8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; max-width: 22rem; }
.fm-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.fm-label { color: var(--muted); }
.fm-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fm-panel { position: absolute; z-index: 30; top: calc(100% + 0.35rem); left: 0; width: min(26rem, 90vw); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-s); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); padding: 0.6rem; display: grid; gap: 0.4rem; }
.fm-panel input[type="search"] { width: 100%; }
.fm-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fm-list { max-height: 20rem; overflow-y: auto; display: grid; gap: 0.1rem; }
.fm-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; padding: 0.35rem 0.4rem; border-radius: 6px; cursor: pointer; }
.fm-item:hover { background: var(--accent-soft); }
.fm-name { min-width: 0; overflow-wrap: anywhere; }
.fm-hint { display: block; font-size: 0.78rem; color: var(--muted); }
.fm-count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 0.2rem; }
.chip-btn.on .fm-count { color: inherit; opacity: 0.8; }
.wl-active { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.2rem 0 0.6rem; }
.fm-tag { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 0.15rem 0.6rem; font: inherit; font-size: 0.85rem; cursor: pointer; }

/* 1.31.0: Facilities › Institutions (aliases). */
.ia-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ia-chip { display: inline-block; padding: 0.1rem 0.45rem; border: 1px solid var(--rule); border-radius: 999px; font-size: 0.82rem; }
.ia-h2 { margin-top: 1.75rem; font-size: 1.05rem; }
.ia-find { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.ia-find input { flex: 1 1 auto; min-width: 0; }
.ia-loose { max-height: 18rem; }
.ia-pick { max-height: 16rem; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-s); margin-top: 0.4rem; padding: 0.25rem; }
.inst-alias { opacity: 0.7; font-size: 0.85em; }

/* 1.32.0: Edit DICOM details (metadataEdit.tsx) */
.meta-edit .tabbar { margin: 0.4rem 0 0.8rem; }
.meta-edit .form-grid { margin: 0.6rem 0; }
.meta-done { margin: 0; padding-left: 1.1rem; }
.meta-find { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }
.meta-find input { flex: 1 1 14rem; min-width: 0; }
.meta-picks { list-style: none; margin: 0.4rem 0; padding: 0; display: grid; gap: 0.35rem; max-height: 16rem; overflow: auto; }
.meta-picks button { width: 100%; text-align: left; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; padding: 0.5rem 0.7rem;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-s); color: var(--text); }
.meta-picks button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.meta-picks button:disabled { opacity: 0.6; cursor: default; }
.meta-picks .chip { margin-left: auto; }

/* ------------------------------------------------------------------ phone shell, 1.34.0 (Hourbook look)
   Step 2 of the iPhone redesign: large titles, round header buttons, floating glass bottom bar,
   chips, grouped two-line rows, sheets with 28px corners. Colours come from the theme (all five
   themes, light and dark); amber = still to do, red = STAT / critical, blue = in the cloud / sent. */
.m-shell, .mv2, .m-vars {
  --m-amber: #F2B45A; --m-amber-soft: color-mix(in srgb, #F2B45A 16%, var(--panel));
  --m-red-soft: color-mix(in srgb, var(--bad) 18%, var(--panel)); --m-ok-soft: color-mix(in srgb, var(--ok) 16%, var(--panel));
  --m-info: color-mix(in srgb, var(--accent) 55%, var(--text)); --m-info-soft: color-mix(in srgb, var(--accent) 18%, var(--panel));
  --m-line-soft: color-mix(in srgb, var(--rule) 70%, var(--panel));
}
.m-shell { display: block; position: relative; }
:root[data-mode="light"] .m-shell { --m-amber: #A9690D; --m-amber-soft: #FCF1DA; --m-info: color-mix(in srgb, var(--accent) 80%, #000); }
.m-shell .m-body { height: 100dvh; padding-bottom: calc(112px + env(safe-area-inset-bottom)); box-sizing: border-box; overscroll-behavior-y: contain; }
.m-glass {
  background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
}
:root[data-mode="light"] .m-glass { box-shadow: 0 12px 30px -10px rgba(19, 32, 54, 0.25); }
.m-fade { position: fixed; left: 0; right: 0; bottom: 0; height: calc(110px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 35%, color-mix(in srgb, var(--bg) 0%, transparent)); pointer-events: none; z-index: 20; }
.m-bar { position: fixed; left: 16px; right: 16px; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; z-index: 21; }
.m-bar-pill { flex: 1; height: 64px; border-radius: 32px; display: flex; align-items: center; padding: 0 4px; box-sizing: border-box; min-width: 0; }
.m-tab { flex: 1; min-width: 0; height: 56px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; -webkit-tap-highlight-color: transparent; }
.m-tab.on { background: color-mix(in srgb, var(--accent) 17%, transparent); color: var(--accent); }
.m-tab-badge { position: absolute; top: 3px; left: calc(50% + 3px); background: var(--m-amber); color: #08101F; font-size: 9.5px; font-weight: 700; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.m-tab-badge.stat { background: var(--bad); color: #fff; }
.m-bar-search { width: 64px; height: 64px; border-radius: 32px; flex: none; display: grid; place-items: center; color: var(--text); padding: 0; }

.m-page2 { min-height: auto; }
.m-top { display: flex; align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 16px 4px; }
.m-top h1 { flex: 1; margin: 0; font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; min-width: 0; }
.m-round { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--text); padding: 0; flex: none; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); background: var(--panel-2); }
.m-avatar { width: 40px; height: 40px; border-radius: 20px; border: 0; background: #7B5CF0; color: #fff; font: inherit; font-weight: 700; font-size: 14px; flex: none; display: grid; place-items: center; padding: 0; }
.m-avatar.big { width: 56px; height: 56px; border-radius: 28px; font-size: 20px; }
.m-spin { animation: login-spin 0.9s linear infinite; }
.m-tools { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.m-search2 { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 24px; background: var(--panel); border: 1px solid var(--rule); padding: 0 16px; color: var(--muted); }
.m-search2 input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 500; outline: none; padding: 0; }
.m-chips2 { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.m-chips2::-webkit-scrollbar { display: none; }
.m-chip2 { height: 34px; padding: 0 13px; border-radius: 17px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; position: relative; }
.m-chip2 .n { color: var(--muted); font-weight: 600; }
.m-chip2.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.m-chip2.on .n { color: color-mix(in srgb, var(--bg) 70%, var(--text)); }
.m-chip-sel select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; padding: 0; margin: 0; outline: none; max-width: 14rem; }
.m-chip-sel select option { color: initial; }
.m-seg2 { display: flex; background: var(--panel); border: 1px solid var(--rule); border-radius: 19px; padding: 3px; height: 38px; box-sizing: border-box; }
.m-seg2 button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; border-radius: 16px; padding: 0 6px; white-space: nowrap; }
.m-seg2 button.on { background: var(--panel-2); color: var(--text); }
.m-count2 { margin: 0; padding: 10px 20px 0; font-size: 12.5px; color: var(--muted); }
.m-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 16px 0; }
.m-tile2 { background: var(--panel); border: 1px solid var(--m-line-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-tile2 strong { font-size: 24px; line-height: 30px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tile2 strong.amber { color: var(--m-amber); }
.m-sub { font-size: 12.5px; line-height: 17px; color: var(--muted); }
.m-list2 { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.m-cap { margin: 0 4px 8px; font-size: 12px; line-height: 16px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.m-group2 { background: var(--panel); border: 1px solid var(--m-line-soft); border-radius: 16px; overflow: hidden; }
.m-row2-wrap { position: relative; overflow: hidden; border-top: 1px solid var(--m-line-soft); }
.m-group2 > .m-row2-wrap:first-child { border-top: 0; }
.m-row2 {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 9px 14px; box-sizing: border-box;
  background: var(--panel); border: 0; color: var(--text); font: inherit; text-align: left; touch-action: pan-y; transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.m-row2:active { background: color-mix(in srgb, var(--panel-2) 70%, var(--panel)); }
.m-swipe-acts { position: absolute; right: 0; top: 0; bottom: 0; display: flex; }
.m-swipe-act { flex: 1; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: inherit; font-size: 12.5px; font-weight: 700; }
.m-swipe-act.tone-accent { background: var(--accent); color: var(--accent-ink); }
.m-swipe-act.tone-amber { background: var(--m-amber); color: #08101F; }
.m-swipe-act.tone-danger { background: var(--bad); color: #fff; }
.m-swipe-act.tone-neutral { background: var(--panel-2); color: var(--text); }
.m-mod { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--m-info-soft); color: var(--m-info); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.m-mod.stat { background: var(--m-red-soft); color: var(--bad); }
.m-r-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-r-t { font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-r-s { font-size: 12.5px; line-height: 17px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-r-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 40%; }
.m-r-time { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.m-pill { display: inline-block; font-size: 11px; line-height: 15px; font-weight: 700; border-radius: 8px; padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.m-pill-amber { background: var(--m-amber-soft); color: var(--m-amber); }
.m-pill-red { background: var(--m-red-soft); color: var(--bad); }
.m-pill-info { background: var(--m-info-soft); color: var(--m-info); }
.m-pill-ok { background: var(--m-ok-soft); color: var(--ok); }
.m-pill-neutral { background: var(--panel-2); color: var(--muted); }
.m-page2 .m-empty { padding: 32px 8px; }
.m-page2 .m-note { padding: 0 4px; }

/* sheets (1.34.0 look; the study and filter sheets follow in step 3) */
.m-sheet2 { border-radius: 28px 28px 0 0; border-top: 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6); }
.m-sheet2 .m-grip { width: 38px; height: 5px; margin: 8px auto 0; }
.m-sheet2-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 4px; }
.m-sheet2-head h2 { flex: 1; margin: 0; text-align: center; font-size: 17px; line-height: 22px; font-weight: 700; min-width: 0; }
.m-sheet2-head h2 small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sheet2-body { padding: 10px 16px 12px; display: flex; flex-direction: column; }
.m-sheet2-body .m-group2, .m-page2 .m-group2 { background: var(--panel-2); }
.m-page2 .m-list2 > div > .m-group2 { background: var(--panel); }
.m-set { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; box-sizing: border-box; border: 0; border-top: 1px solid var(--rule); background: transparent; color: var(--text); font: inherit; font-size: 15px; text-align: left; }
.m-group2 > .m-set:first-child { border-top: 0; }
.m-set.danger { color: var(--bad); }
.m-set:disabled { opacity: 0.55; }
.m-set-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.m-set-name { flex: 1; min-width: 0; font-weight: 500; }
.m-set-val { color: var(--muted); font-size: 14px; }
.m-chev { color: var(--muted); font-size: 20px; line-height: 1; }
.m-acct-who { display: flex; align-items: center; gap: 14px; padding: 4px 4px 16px; }
.m-acct-name { font-size: 20px; line-height: 26px; font-weight: 700; }
.m-sheet2-body .m-cap, .m-page2 .m-list2 > .m-cap { margin-top: 2px; }
.m-sheet2-body .m-group2 + .m-cap, .m-list2 .m-group2 + .m-cap { margin-top: 16px; }
.m-sheet2-body .m-note, .m-list2 > .m-note { margin: 8px 0 0; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.m-signout { margin-top: 18px; height: 52px; border-radius: 26px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--bad); font: inherit; font-size: 16px; font-weight: 700; }
/* desktop pages shown inside the phone shell (Reports, My transfers, Account) */
.m-shell .m-page-desktop { padding: max(14px, env(safe-area-inset-top)) 12px 12px; }
@media (max-width: 700px) {
  .wl-panel { padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); border-left: 0; z-index: 30; }
  .wl-panel-actions button, .wl-panel-actions a { white-space: normal; min-height: 46px; border-radius: 23px; }
}

/* ------------------------------------------------------------------ phone sheets, 1.35.0 (iPhone redesign step 3) */
.m-sheet2 { max-height: calc(100dvh - max(44px, env(safe-area-inset-top))); }
.m-study-body { gap: 14px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.m-study-sum { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-study-desc { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.m-study-pills { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.m-study-pills:empty { display: none; }
.m-btn-row { display: flex; gap: 8px; }
.m-btn { flex: 1; height: 52px; border-radius: 26px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.m-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.m-btn:disabled { opacity: 0.55; }
.m-qtiles { display: flex; gap: 8px; }
.m-qt { flex: 1; min-width: 0; height: 68px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--rule); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.m-qt svg { color: var(--accent); }
.m-qt:disabled { opacity: 0.6; }
.m-check { width: 22px; height: 22px; border-radius: 11px; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); box-sizing: border-box; flex: none; }
.m-check.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--panel-2); }
.m-ser-mod { height: 22px; padding: 0 6px; border-radius: 6px; background: var(--m-info-soft); color: var(--m-info); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.m-ser .m-set-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-prior { min-height: 62px; }
.m-details { margin: 0; }
.m-details > div { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.m-details > div:first-child { border-top: 0; }
.m-details dt { width: 7.5rem; flex: none; color: var(--muted); font-size: 14px; }
.m-details dd { margin: 0; flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.m-group2 > .m-empty { padding: 18px 14px; margin: 0; }
.m-textbtn { height: 40px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; padding: 0 4px; flex: none; }
.m-filters2-body { gap: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.m-filters2-body .m-cap { margin-top: 18px; }
.m-filters2-body .m-cap:first-child { margin-top: 4px; }
.m-field2 { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-top: 1px solid var(--rule); }
.m-group2 > .m-field2:first-child { border-top: 0; }
.m-field2 > span { width: 6.5rem; flex: none; font-size: 15px; font-weight: 500; color: var(--text); }
.m-field2 input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 500; text-align: right; outline: none; padding: 0; }
.m-field2 input::placeholder { color: var(--muted); }
.m-chipwrap { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip3 { height: 34px; padding: 0 13px; border-radius: 17px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; }
.m-chip3.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.m-node .m-set-name { display: flex; flex-direction: column; padding: 8px 0; }
input.m-switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; min-height: 0; border-radius: 16px; border: 0; padding: 0; background: var(--rule); position: relative; flex: none; margin: 0; cursor: pointer; transition: background 0.2s; box-shadow: none; }
input.m-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: left 0.2s; }
input.m-switch:checked { background: var(--ok); }
input.m-switch:checked::after { left: 22px; }
input.m-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.m-filters2-go { width: 100%; margin-top: 22px; flex: none; }

/* ------------------------------------------------------------------ phone viewer, 1.36.0 (iPhone redesign step 4)
   The image fills the screen; glass bars float over it. Reading mode (dictating): tools hidden,
   thin red line at the top, live caption, one big stop button; tap the image for the tools. */
.mv.mv2 { display: block; position: relative; }
.mv2 .mv-stage { position: absolute; inset: 0; top: var(--mv2-edge); }
/* 1.37.3: a solid, full-width bar fixed to the top edge, under the round back button and the title.
   Safari on iOS 26+ blurs page content at the top of the screen when nothing there is fixed and
   full width (its "scroll edge" effect): that blurred the top bar and the status bar. With this
   bar it takes the bar's colour instead. The image starts below it. */
.mv2 { --mv2-edge: calc(max(10px, env(safe-area-inset-top)) + 54px); }
.mv2-edge { position: fixed; left: 0; right: 0; top: 0; height: var(--mv2-edge); background: #000; z-index: 5; pointer-events: none; }
.mv-glass { background: rgba(20, 31, 51, 0.72); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); border: 1px solid rgba(230, 237, 248, 0.1); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7); color: #E6EDF8; }
.mv2 .mv-corner { top: 4px; }
.mv2 .mv-scroll { top: 56px; bottom: 210px; }
.mv2 .mv-hint { bottom: 200px; }
.mv2.reading .mv-scroll { bottom: 230px; }
.mv2-top { position: absolute; left: 12px; right: 12px; top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; z-index: 6; }
.mv2-round { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; flex: none; padding: 0; }
.mv2-title { flex: 1; min-width: 0; height: 44px; border-radius: 22px; padding: 0 16px; display: flex; flex-direction: column; justify-content: center; }
.mv2-title strong { font-size: 14px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv2-title > span { font-size: 11.5px; line-height: 15px; color: #94A5BF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv2-rec { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.mv2-rec b { color: #FF7B7B; font-variant-numeric: tabular-nums; flex: none; }
.mv2-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv2-dot { width: 8px; height: 8px; border-radius: 50%; background: #FF7B7B; flex: none; animation: mv-pulse 1.2s ease-in-out infinite; }
.mv2-done { height: 44px; border-radius: 22px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 700; color: #4D8DFF; flex: none; }
.mv2-recline { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #FF7B7B; z-index: 7; animation: mv-pulse 1.6s ease-in-out infinite; pointer-events: none; }
.mv2-tray { position: absolute; left: 12px; right: 12px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.mv2.reading .mv2-tray { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 196px); }
.mv2-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mv2-chips::-webkit-scrollbar { display: none; }
.mv2-chip { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid rgba(230, 237, 248, 0.14); background: rgba(20, 31, 51, 0.72); color: #E6EDF8; font: inherit; font-size: 13px; font-weight: 600; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.mv2-chip.on { background: #E6EDF8; border-color: #E6EDF8; color: #0D1626; }
.mv2-series { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mv2-series::-webkit-scrollbar { display: none; }
.mv2-thumb { flex: none; width: 58px; height: 58px; border-radius: 12px; overflow: hidden; position: relative; border: 2px solid transparent; background: #000; padding: 0; box-sizing: border-box; }
.mv2-thumb.on { border-color: #4D8DFF; }
.mv2-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv2-thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; font-weight: 700; text-align: center; background: rgba(0, 0, 0, 0.6); color: #E6EDF8; line-height: 14px; }
.mv2-bar { position: absolute; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); height: 64px; border-radius: 32px; display: flex; align-items: center; padding: 0 4px; box-sizing: border-box; z-index: 6; }
.mv2-bar button { flex: 1; min-width: 0; height: 56px; border-radius: 28px; border: 0; background: transparent; color: #94A5BF; font: inherit; font-size: 10.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.mv2-bar button.on { background: rgba(77, 141, 255, 0.17); color: #4D8DFF; }
.mv2-read { position: absolute; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; z-index: 6; }
.mv2-caption { display: flex; flex-direction: column; gap: 2px; border-radius: 18px; padding: 8px 14px 12px; text-align: left; font: inherit; width: 100%; box-sizing: border-box; }
.mv2-grip { width: 36px; height: 4px; border-radius: 2px; background: rgba(230, 237, 248, 0.25); margin: 0 auto 6px; }
.mv2-last { font-size: 13px; line-height: 18px; color: #94A5BF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv2-now { font-size: 16px; line-height: 22px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mv2-now i { font-style: normal; color: #FF7B7B; animation: mv-pulse 1s steps(2) infinite; }
.mv2-readbar { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.mv2-pill { height: 44px; min-width: 88px; border-radius: 22px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600; box-sizing: border-box; }
.mv2-dim { color: #94A5BF; }
.mv2-mic { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #FF7B7B; color: #08101F; display: grid; place-items: center; position: relative; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8); padding: 0; }
.mv2-mic::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 123, 123, 0.55); animation: mv2-ring 1.6s ease-out infinite; }
.mv2-mic:disabled { opacity: 0.6; }
@keyframes mv2-ring { 0% { transform: scale(0.92); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }
.mv2-notice { position: absolute; left: 16px; right: 16px; top: calc(max(10px, env(safe-area-inset-top)) + 56px); margin: 0; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; z-index: 8; }
.mv2-notice.bad { border-color: rgba(255, 123, 123, 0.55); }
.mv2-wrap { z-index: 50; }
.mv2 .m-sheet2 { background: #141F33; color: #E6EDF8; }
.mv2 .m-group2 { background: #1A2740; border-color: #263652; }
.mv2 .m-set { border-top-color: #263652; color: #E6EDF8; }
.mv2-drawer { max-height: 62dvh; }
.mv2-body { white-space: pre-wrap; background: #1A2740; border: 1px solid #263652; border-radius: 16px; padding: 12px 14px; font-size: 15px; line-height: 22px; max-height: 34dvh; overflow-y: auto; user-select: text; -webkit-user-select: text; }
@media (prefers-reduced-motion: reduce) { .mv2-recline, .mv2-mic::before, .mv2-dot, .mv2-now i { animation: none; } }

/* ------------------------------------------------------------------ phone round 2, 1.37.0
   Board 8: a Worklist tap opens the study actions sheet. Board 9: the report screen on a phone
   (glass top bar, image card, chips, the text, More / mic / Sign). Board 10: Print on a phone
   (printer row, one-page preview with ‹ ›, chips, switches, one Print button). */
:root[data-mode="light"] .m-vars { --m-amber: #A9690D; --m-amber-soft: #FCF1DA; --m-info: color-mix(in srgb, var(--accent) 80%, #000); }
.m-amber-t { color: var(--m-amber); }
.wl-study .m-sheet2-body > .m-cap.wl-study-cap { margin-top: 4px; margin-bottom: -6px; }
.wl-study .m-note { margin: -6px 0 0; }
.wl-study-portal:empty { display: none; }
.wl-study-portal { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 16px; padding: 4px 14px; font-size: 14px; }
.m-set small, .m-set-name small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
a.m-set { text-decoration: none; }

/* report */
.rp-phone { position: fixed; inset: 0; background: var(--bg); color: var(--text); display: flex; flex-direction: column; overflow: hidden; }
.rp-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; }
.rp-rb { width: 44px; height: 44px; border-radius: 22px; }
.rp-title { flex: 1; min-width: 0; height: 44px; border-radius: 22px; padding: 0 16px; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; }
.rp-title strong { font-size: 14px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-title small { font-size: 11.5px; line-height: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 4px 16px calc(112px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.rp-img { position: relative; flex: none; height: 168px; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--rule); padding: 0; color: #fff; display: block; width: 100%; }
.rp-img img { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; object-fit: contain; }
.rp-img-mod { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #4a5a76; letter-spacing: 0.04em; }
.rp-img-cap { position: absolute; left: 12px; top: 10px; font-size: 11.5px; color: #C9D4E5; }
.rp-img-go { position: absolute; right: 10px; bottom: 10px; height: 34px; border-radius: 17px; padding: 0 14px; display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--text); }
.rp-phone:has(textarea:focus) .rp-img { display: none; }
.rp-chips { display: flex; gap: 8px; overflow-x: auto; flex: none; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.rp-chips::-webkit-scrollbar { display: none; }
.rp-chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; }
.rp-chip.rp-amber { border-color: color-mix(in srgb, var(--m-amber) 45%, transparent); color: var(--m-amber); }
.rp-chip.rp-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.rp-chip.rp-info { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--m-info); }
.rp-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--rule); font-size: 13.5px; line-height: 19px; flex: none; }
.rp-restore { display: flex; flex-direction: column; gap: 4px; border-color: color-mix(in srgb, var(--m-amber) 45%, transparent); }
.rp-pending:empty { display: none; }
.rp-pending .side-block, .rp-pending > * { margin: 0; }
.rp-main > .rp-card { flex: 1 0 auto; }
.rp-card { background: var(--panel); border: 1px solid var(--m-line-soft); border-radius: 16px; min-height: 260px; display: flex; flex-direction: column; }
.rp-card.report-editor-wrap > .report-editor, .rp-card .report-backdrop { flex: 1; min-height: 260px; border: 0; background: transparent; border-radius: 16px; padding: 14px; font-size: 16px; line-height: 24px; resize: none; }
.rp-card.report-editor-wrap > .report-editor { height: 100%; }
.rp-card .report-editor:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.rp-signed { padding: 14px; gap: 10px; }
.rp-signed .report-text { white-space: pre-wrap; font: inherit; font-size: 15.5px; line-height: 23px; margin: 0; }
.rp-signed .report-sig { font-size: 13px; color: var(--muted); margin: 0; }
.rp-signed .report-addendum h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 8px 0 4px; }
.rp-signed .addendum-editor { display: flex; flex-direction: column; gap: 10px; }
.rp-signed .addendum-editor textarea { min-height: 8rem; font-size: 16px; }
.rp-fade { position: fixed; left: 0; right: 0; bottom: 0; height: calc(150px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 40%, color-mix(in srgb, var(--bg) 0%, transparent)); pointer-events: none; z-index: 2; }
.rp-bar { position: fixed; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; z-index: 3; }
.rp-pill { height: 48px; min-width: 96px; border-radius: 24px; padding: 0 16px; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); text-decoration: none; }
.rp-pill-space { width: 96px; }
.rp-primary { background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 700; font-size: 15px; }
.rp-sign { background: var(--ok); color: #08101F; border: 0; font-weight: 700; font-size: 15px; }
.rp-pill:disabled { opacity: 0.55; }
.rp-mic { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8); padding: 0; }
.rp-mic.on { background: var(--bad); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent), 0 12px 30px -10px rgba(0, 0, 0, 0.8); }
.rp-stop { width: 24px; height: 24px; border-radius: 6px; background: #fff; }
.rp-live { position: fixed; left: 16px; right: 16px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 92px); z-index: 3; min-height: 44px; border-radius: 22px; padding: 6px 6px 6px 14px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rp-live-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rp-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--bad); flex: none; animation: rp-blink 1.2s ease-in-out infinite; }
@keyframes rp-blink { 50% { opacity: 0.3; } }
.rp-lang { height: 32px; min-width: 44px; border-radius: 16px; border: 1px solid var(--rule); background: var(--panel-2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; }
.rp-listening .rp-card { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.rp-more-sub { margin: -6px 0 12px; text-align: center; font-size: 12.5px; color: var(--muted); }
.rp-bang { font-weight: 800; font-size: 17px; }
.rp-sign-big { margin-top: 14px; flex: none; background: var(--ok); border-color: var(--ok); color: #08101F; }
.rp-panel .m-sheet2-body .side-block, .rp-panel .m-sheet2-body section { margin: 0; }
.rp-panel .m-sheet2-body h2 { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .rp-dot { animation: none; } }

/* print */
.print-screen.print-phone { display: block; min-height: 0; position: fixed; inset: 0; overflow: hidden; }
.pp-head { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 6px; }
.pp-head h1 { flex: 1; margin: 0; text-align: center; font-size: 17px; line-height: 22px; font-weight: 700; min-width: 0; }
.pp-head h1 small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-body { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 54px); left: 0; right: 0; bottom: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(120px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; }
.pp-body > *, .rp-main > * { flex-shrink: 0; }
.pp-body .m-group2 { background: var(--panel); }
.print-phone .pp-head { border: 0; }
.pp-printer { position: relative; min-height: 60px; }
.pp-printer select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; }
.pp-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pp-preview .preview-sheet { border-radius: 4px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8); overflow: hidden; }
.pp-pager { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.pp-pager button { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); font-size: 20px; line-height: 1; padding: 0; }
.pp-pager button:disabled { opacity: 0.35; }
.pp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.m-chip2.pp-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pp-wl { display: flex; gap: 10px; margin-top: 10px; }
.pp-wl label { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.pp-wl input, .pp-field input, .pp-field select { flex: 1; min-width: 0; height: 40px; font-size: 16px; border-radius: 10px; }
.pp-field input { max-width: 6rem; flex: none; }
.pp-field select { max-width: 11rem; flex: none; }
.pp-fade { position: fixed; left: 0; right: 0; bottom: 0; height: calc(130px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 45%, color-mix(in srgb, var(--bg) 0%, transparent)); pointer-events: none; }
.pp-go { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8); }
@media print { .print-screen.print-phone.printing { position: static; overflow: visible; } }

/* ------------------------------------------------------------------ 1.38.2: row menu ("⋯") */
.row-menu-btn { font-size: 1.15rem; line-height: 1; padding: 0.3rem 0.6rem; }
.row-menu {
  position: fixed; z-index: 40; min-width: 12rem; display: flex; flex-direction: column; padding: 0.35rem;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.row-menu button { all: unset; box-sizing: border-box; padding: 0.5rem 0.7rem; border-radius: 7px; cursor: pointer; color: var(--text); font: inherit; }
.row-menu button:hover, .row-menu button:focus-visible { background: var(--accent-soft); }
.row-menu button.danger { color: var(--bad); }
/* Users (1.38.2): roles shown as text, changed only in the editor. */
.role-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.role-tag { font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.role-tag.admin { background: rgba(169, 139, 255, 0.16); color: #a98bff; }
.role-tag.rad { background: var(--accent-soft); color: var(--accent); }
:root[data-mode="light"] .role-tag.admin { color: #6a45d6; }
.users-table td .sub { display: block; color: var(--muted); font-size: 0.85em; }

/* ================================================================== 1.39.0 desktop redesign: shared layout
   Desktop only (min-width 901px): the phone shell (≤700px) and narrow windows keep their own rules. */
@media (min-width: 901px) {
  .rail { padding: 1rem 0.7rem; gap: 0.15rem; }
  .rail a { padding: 0.48rem 0.7rem; border-radius: 8px; }
  .rail-heading, .rail-fold { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; padding: 1.1rem 0.7rem 0.3rem; }
  .rail-search {
    display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 2.3rem; margin: 0 0 0.7rem; padding: 0 0.7rem;
    border: 1px solid var(--rule); border-radius: 9px; background: var(--bg); color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
  }
  .rail-search:hover { color: var(--text); border-color: var(--accent); }
  .rail-search span { flex: 1; }
  .rail-search kbd, .gs kbd { font: inherit; font-size: 0.7rem; border: 1px solid var(--rule); border-radius: 5px; padding: 0.05rem 0.35rem; color: var(--muted); }
  .rail-user > a { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; white-space: normal; }
  .rail-avatar { width: 2rem; height: 2rem; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.75rem; }
  .rail-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .rail-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-who small { color: var(--muted); font-size: 0.74rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail a.active .rail-who small { color: var(--accent); opacity: 0.8; }

  .main { padding: 1.4rem 1.75rem 3rem; }
  .page-head { margin-bottom: 0.35rem; }
  .page-head h1, .page > h1 { font-size: 1.5rem; }
  .lede { font-size: 0.9rem; margin: 0.15rem 0 0.9rem; }
  .page-sub { color: var(--muted); font-size: 0.88rem; margin: 0.1rem 0 0; }

  .btn, .btn-primary, .btn-ghost { border-radius: 9px; }
  .seg { border-radius: 9px; }
  .seg button.on { background: var(--accent-soft); color: var(--accent); }
  :root[data-mode="light"] .seg button.on { background: var(--accent); color: var(--accent-ink); }

  table.grid { border-radius: 12px; }
  .grid th { font-size: 0.8rem; font-weight: 600; }
  .grid td { padding: 0.6rem 0.75rem; }
  .grid tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
  .grid td .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
  .grid td .two > small, .grid td .two > .sub2 { color: var(--muted); font-size: 0.82rem; }

  /* Toolbars: one row that wraps, active filters as chips under it. */
  .toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.6rem; }
  .toolbar .grow { flex: 1 1 16rem; min-width: 12rem; }
  .filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: -0.15rem 0 0.6rem; }
  .fchip { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.75rem; padding: 0 0.6rem; border-radius: 99px; font-size: 0.82rem; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); cursor: pointer; font-family: inherit; }
  .fchip .x { opacity: 0.7; }

  /* Details panel at the right that pushes the list instead of covering it. */
  .with-side { display: flex; gap: 1rem; align-items: flex-start; }
  .with-side > .side-main { flex: 1; min-width: 0; }
}

/* ------------------------------------------------------------------ 1.39.0: Search everything (Ctrl K) */
.gs-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4, 9, 18, 0.55); display: grid; place-items: start center; padding: 11vh 1rem 1rem; }
.gs { width: min(42rem, 100%); background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.gs-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--rule); color: var(--muted); }
.gs-head input { all: unset; flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--text); }
.gs-head input::placeholder { color: var(--muted); }
.gs-busy { width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--accent); animation: gs-spin 0.8s linear infinite; }
@keyframes gs-spin { to { transform: rotate(360deg); } }
.gs-list { list-style: none; margin: 0; padding: 0.4rem; overflow-y: auto; }
.gs-group { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.7rem 0.25rem; }
.gs-list li[role="option"] { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; padding: 0.5rem 0.7rem; border-radius: 9px; cursor: pointer; }
.gs-list li[role="option"].on { background: var(--accent-soft); }
.gs-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-sub { grid-column: 1; color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 99px; background: color-mix(in srgb, #f2b45a 18%, transparent); color: #d9952f; }
.gs-empty { padding: 1rem 0.7rem; color: var(--muted); }
.gs-foot { display: flex; gap: 1.2rem; padding: 0.6rem 1.1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.8rem; }
@media (max-width: 900px) { .rail-search { display: none; } }

/* ------------------------------------------------------------------ 1.39.0: Worklist (desktop table) */
/* On wide screens (reading workstations) the details panel takes its width from the page instead of
   covering the last columns; on smaller ones it lies over the list as before. */
@media (min-width: 1800px) {
  .worklist-page.wl-panel-open:not(.wl-cards-mode) { padding-right: 25.5rem; }
}
@media (min-width: 901px) {
  .worklist-page .ris-toolbar .wl-search { flex: 1 1 16rem; min-width: 12rem; }
  .worklist-page .ris-toolbar .wl-who { margin: 0; }
  .worklist-page .ris-toolbar .fm-btn { height: 2.25rem; }
  .worklist-grid td.wl-c-patient, .worklist-grid td.wl-c-proc { white-space: normal; }
  .worklist-grid td.wl-c-proc .two > span:first-child { display: inline; }
  .worklist-grid td .two small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 19rem; display: block; }
  .worklist-grid td.wl-c-proc { max-width: 22rem; }
  .worklist-grid td.wl-c-patient { max-width: 13rem; }
  .worklist-grid td.wl-c-patient .strong { overflow: hidden; text-overflow: ellipsis; }
  .worklist-grid th, .worklist-grid td { padding-left: 0.6rem; padding-right: 0.6rem; }
  .worklist-grid .wl-noorder { color: #d9952f; font-weight: 700; }
  :root[data-mode="light"] .worklist-grid .wl-noorder { color: #9a5d07; }
  .worklist-grid .wl-change { margin-left: 0.4rem; font-size: inherit; }
  .worklist-grid .modalities, .worklist-grid .mods { display: inline-flex; vertical-align: 1px; }
}

/* ------------------------------------------------------------------ 1.39.0: Q/R */
.query-row-inline { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.query-row-inline > .query-row { margin: 0; }
@media (min-width: 901px) {
  .search-page .node-picker { margin: 0.3rem 0 0.6rem; }
  .search-page .grid td.qr-c-patient, .search-page .grid td.qr-c-study { white-space: normal; }
  .search-page .grid td.qr-c-study { max-width: 26rem; }
  .search-page .grid td .two small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24rem; }
  .search-page .grid tr.detail > td { padding: 0; }
  .search-page .study-detail { max-width: 100%; overflow-x: auto; }
}
@media (min-width: 901px) {
  /* 1.39.0: inside a tab the page title is hidden, so the head's actions sit at the right. */
  .tab-body .page-head { justify-content: flex-end; margin: -0.4rem 0 0; }
}

/* ------------------------------------------------------------------ 1.39.0: Reports (desktop) */
@media (min-width: 901px) {
  .reports-page .side-main { overflow-x: auto; }
  .reports-grid td.nowrap { white-space: nowrap; }
  .reports-grid tr.row-open td { background: var(--accent-soft); }
  .reports-page .with-side .rp-preview { margin-top: 2.2rem; }
  .reports-grid td .two small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24rem; }
  .reports-grid td .two > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26rem; }
  .rp-preview { flex: 0 0 26rem; width: 26rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 0.9rem 1rem; }
  .rp-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
  .rp-head > div { display: flex; flex-direction: column; min-width: 0; }
  .rp-head small { color: var(--muted); font-size: 0.82rem; }
  .rp-x { padding: 0 0.5rem; font-size: 1.2rem; line-height: 1.6rem; }
  .rp-meta { margin: 0.5rem 0; font-size: 0.85rem; color: var(--muted); }
  .rp-body { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.45; overflow-y: auto; flex: 1 1 auto; min-height: 4rem; }
  .rp-addendum { border-top: 1px solid var(--rule); margin-top: 0.6rem; padding-top: 0.5rem; }
  .rp-addendum small { color: var(--muted); }
  .rp-foot { display: flex; justify-content: flex-end; padding-top: 0.7rem; }
}
@media (min-width: 901px) and (max-width: 1599px) {
  .rp-preview { flex-basis: 21rem; width: 21rem; }
  .reports-grid td .two > span:first-child, .reports-grid td .two small { max-width: 16rem; }
}
@media (min-width: 901px) and (max-width: 1439px) {
  .worklist-grid th, .worklist-grid td { padding-left: 0.5rem; padding-right: 0.5rem; }
  .worklist-grid td.wl-c-proc { max-width: 18rem; }
  .worklist-grid td.wl-c-proc .two small { max-width: 17rem; white-space: normal; }
}
@media (min-width: 901px) {
  .worklist-grid .wl-author { display: block; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9rem; margin-top: 0.15rem; }
}
/* 1.39.0: phones keep the 1.38 user line in the top bar (name only). */
@media (max-width: 900px) {
  .rail-avatar, .rail-who small { display: none; }
}

/* ------------------------------------------------------------------ 1.40.0: Front desk (desktop) */
@media (min-width: 901px) {
  .seg button .seg-n { display: inline-block; margin-left: 0.4rem; font-size: 0.78rem; opacity: 0.75; font-variant-numeric: tabular-nums; }
  .seg button.seg-warn .seg-n { color: var(--warn, #d99a1e); opacity: 1; font-weight: 700; }
  .ris-subbar { margin-bottom: 0.6rem; }
  .orders-grid td .two small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }
  .orders-grid tr.row-open td { background: var(--accent-soft); }
  .orders-grid tr.ris-row-late td:first-child { box-shadow: inset 3px 0 0 var(--warn, #d99a1e); }
  .orders-page .with-side > .side-main { overflow-x: auto; }
  .ris-side { flex: 0 0 27rem; width: 27rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 0.8rem 1rem 1rem; }
  .ris-side-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
  .ris-side-head h2 { font-size: 1rem; margin: 0; font-variant-numeric: tabular-nums; }
  .ris-side .ris-order-head { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .ris-side .ris-actions { flex-wrap: wrap; gap: 0.4rem; }
  .ris-side .ris-actions .btn, .ris-side .ris-actions .btn-primary, .ris-side .ris-actions .btn-ghost { padding: 0.3rem 0.7rem; font-size: 0.88rem; }
  .ris-side .form-row { flex-direction: column; }
  .ris-side .kv { grid-template-columns: 6.5rem 1fr; }
}
@media (min-width: 901px) and (max-width: 1439px) {
  .ris-side { flex-basis: 22rem; width: 22rem; }
  .orders-grid td .two small { max-width: 14rem; }
}
@media (min-width: 901px) {
  .sched-page .ris-toolbar .grow { flex: 1; }
  /* blue = coming / here, green = done, amber = late (same colours as Orders and the Worklist) */
  .sched-page .sched-arrived, .sched-page .sched-in_progress { background: color-mix(in srgb, var(--accent) 26%, var(--panel)); border-color: var(--accent); }
  .sched-page .sched-completed, .sched-page .sched-reported { background: color-mix(in srgb, var(--ok, #4fbf8f) 14%, var(--panel)); border-color: var(--ok, #4fbf8f); color: var(--text); }
  .sched-page .sched-late { background: color-mix(in srgb, var(--warn, #d99a1e) 16%, var(--panel)); border-color: var(--warn, #d99a1e); }
  .sched-page .sched-p-stat { border-left-color: var(--bad); }
  .sched-page .sched-outside { border-style: dashed; }
  /* 15–20 minute appointments: one line with the procedure instead of hiding it */
  .sched-page .sched-short { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
  .sched-page .sched-short > .muted, .sched-page .sched-short > .badge { flex: none; }
  .sched-page .sched-short .sched-desc { flex: 1; min-width: 0; color: var(--muted); }
  .sched-page .sched-short .sched-desc::before { content: '· '; }
}
@media (min-width: 901px) {
  .sched-page .sched-short > .muted { display: none; }
  .sched-page .sched-short > strong { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .sched-page .sched-short > .sched-time { flex: none; }
  .sched-page .sched-short .sched-desc { flex: 1 1 45%; }
  .sched-page .sched-short .sched-status { display: none; }
}
@media (min-width: 901px) {
  .sched-page .sched-compact { padding-top: 1px; padding-bottom: 1px; line-height: 1.15; }
  .sched-page .sched-compact .sched-desc { color: var(--muted); }
}
@media (min-width: 901px) {
  .sched-page .sched-short > strong { flex: 0 0 auto; max-width: 58%; }
  .sched-page .sched-short .sched-desc { flex: 1 1 0; }
}
/* 1.40.0: Patients list and the patient record (desktop) */
@media (min-width: 901px) {
  .patients-grid td .two small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18rem; }
  .patient-layout { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .patient-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 0.4rem 1rem 0.8rem; }
  .patient-card .section-title { font-size: 0.95rem; margin: 0.7rem 0 0.4rem; }
  .patient-card .kv.ris-kv { grid-template-columns: 5.6rem minmax(0, 1fr); margin: 0; }
  .patient-card .kv.ris-kv dd { overflow-wrap: anywhere; }
  .patient-layout { margin-top: 0.6rem; }
  .patient-history .seg.tabs { margin-bottom: 0.6rem; }
  .pt-timeline { list-style: none; margin: 0 0 0.6rem; padding: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
  .pt-ev { display: grid; grid-template-columns: 8.5rem 5.2rem minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding: 0.55rem 0.9rem; border-top: 1px solid var(--rule); }
  .pt-ev:first-child { border-top: 0; }
  .pt-when { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pt-kind { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
  .pt-critical .pt-kind { color: var(--bad); }
  .pt-report .pt-kind { color: var(--accent); }
  .pt-main { display: flex; flex-direction: column; min-width: 0; }
  .pt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pt-main small { color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pt-badge { white-space: nowrap; }
  .pt-act .btn { padding: 0.25rem 0.7rem; }
}
@media (min-width: 901px) and (max-width: 1439px) {
  .patient-layout { grid-template-columns: 19rem minmax(0, 1fr); }
  .pt-ev { grid-template-columns: 7.6rem 4.6rem minmax(0, 1fr) auto auto; gap: 0.5rem; }
}
/* 1.40.0: Front desk pages have no phone layout; keep their two-line cells and counts readable there. */
@media (max-width: 900px) {
  .ris-page .grid td .two { display: flex; flex-direction: column; line-height: 1.3; }
  .ris-page .grid td .two > small { color: var(--muted); font-size: 0.8rem; }
  .seg button .seg-n { margin-left: 0.3rem; opacity: 0.75; font-variant-numeric: tabular-nums; }
  .pt-ev { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.6rem; padding: 0.55rem 0.7rem; border-top: 1px solid var(--rule); }
  .pt-timeline { list-style: none; padding: 0; margin: 0 0 0.6rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
  .pt-when, .pt-kind { font-size: 0.78rem; color: var(--muted); }
  .pt-main { grid-column: 1 / -1; display: flex; flex-direction: column; }
  .pt-main small { color: var(--muted); font-size: 0.8rem; }
  .patient-card { margin-bottom: 0.8rem; }
}
/* ------------------------------------------------------------------ 1.40.1: referring physicians */
.ref-picker { position: relative; }
.ref-picker > input { width: 100%; }
.ref-drop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 22rem; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 10px; padding: 0.3rem; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.ref-drop > button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; text-align: left; padding: 0.45rem 0.6rem;
  border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.ref-drop > button:hover, .ref-drop > button:focus-visible { background: var(--accent-soft); outline: none; }
.ref-drop > button small { color: var(--muted); font-size: 0.82rem; }
.ref-drop > button .chip { margin-left: 0.4rem; font-size: 0.72rem; }
.ref-drop > button.ref-more { color: var(--accent); flex-direction: row; border-top: 1px solid var(--rule); border-radius: 0 0 7px 7px; margin-top: 0.2rem; }
.ref-cap { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.4rem 0.6rem 0.2rem; margin: 0; }
.ref-note { margin: 0; padding: 0.35rem 0.6rem; font-size: 0.85rem; color: var(--muted); }
.ref-form { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.3rem 0 0.6rem; }
.ref-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.ref-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ref-form .btn { align-self: flex-start; }
.ref-hits { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.ref-hit { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel-2); }
.ref-hit small { color: var(--muted); font-size: 0.82rem; }
.ref-hit-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.ref-add { padding: 0.2rem 0.8rem; font-size: 0.85rem; }
.ris-side-head small { display: block; font-size: 0.78rem; }
@media (min-width: 901px) {
  .referrers-grid td .two small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 20rem; }
  .referrers-page .with-side > .side-main { overflow-x: auto; }
}
.ref-form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ref-form input, .ref-form select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (min-width: 901px) and (max-width: 1439px) {
  .referrers-page .with-side .referrers-grid td .two small { white-space: normal; max-width: 11rem; }
  .referrers-page .with-side .referrers-grid td .two > span:first-child { white-space: normal; }
}

/* ------------------------------------------------------------------ 1.41.0 Administration kit (adminKit.tsx) */
/* Works at every width (admin pages have no phone layout of their own); desktop refinements below. */
.ak-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ak-head-text { min-width: 0; }
.ak-back { display: inline-block; font-size: 0.85rem; color: var(--accent); text-decoration: none; margin-bottom: 0.15rem; }
.ak-back:hover { text-decoration: underline; }
.ak-head-acts { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.ak-layout { display: flex; gap: 1.5rem; align-items: flex-start; margin-top: 0.9rem; }
.ak-layout > .ak-cards { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.ak-vnav { display: flex; flex-direction: column; gap: 0.15rem; width: 12.5rem; flex: none; position: sticky; top: 1rem; }
.ak-vnav button { text-align: left; font: inherit; font-size: 0.92rem; color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 0.5rem 0.7rem; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; }
.ak-vnav button:hover { color: var(--text); background: var(--panel); }
.ak-vnav button.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.ak-vnav button.danger { color: var(--bad); }
.ak-dirty-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--warn, #d99a1e); }
.ak-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.8rem; scroll-margin-top: 1rem; min-width: 0; }
.ak-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.ak-card-head h2 { margin: 0; font-size: 1rem; }
.ak-card-acts { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ak-card.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--rule)); }
.ak-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1rem; }
.ak-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem 1rem; }
.ak-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin: 0.6rem 0 0.9rem; }
.ak-stat { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ak-stat b { font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ak-stat small { color: var(--muted); font-size: 0.82rem; }
.t-ok { color: var(--ok); } .t-bad { color: var(--bad); } .t-warn { color: var(--warn, #d99a1e); } .t-accent { color: var(--accent); } .t-mute { color: var(--muted); }
.ak-badge { display: inline-flex; align-items: center; height: 1.4rem; padding: 0 0.5rem; border-radius: 99px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.ak-badge.t-mute { color: var(--muted); border-color: var(--rule); background: var(--panel-2); }
.ak-badge + .ak-badge { margin-left: 0.3rem; }
.ak-status { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.ak-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); flex: none; }
.ak-dot.t-ok { background: var(--ok); } .ak-dot.t-bad { background: var(--bad); } .ak-dot.t-warn { background: var(--warn, #d99a1e); } .ak-dot.t-mute { background: var(--rule); }
.ak-note { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.65rem 0.9rem; border-radius: 10px; border: 1px solid var(--rule); background: var(--panel); font-size: 0.9rem; margin: 0 0 0.75rem; }
.ak-note-text { flex: 1 1 18rem; min-width: 0; }
.ak-note-acts { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ak-note.t-warn { color: inherit; border-color: color-mix(in srgb, var(--warn, #d99a1e) 50%, var(--rule)); background: color-mix(in srgb, var(--warn, #d99a1e) 8%, var(--panel)); }
.ak-note.t-ok { color: inherit; border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.ak-note.t-bad { color: inherit; border-color: color-mix(in srgb, var(--bad) 50%, var(--rule)); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.ak-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; padding: 0.7rem 1rem; border: 1px solid var(--rule); border-radius: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ak-savebar.dirty { border-color: color-mix(in srgb, var(--warn, #d99a1e) 55%, var(--rule)); }
.ak-save-msg { font-size: 0.88rem; color: var(--muted); }
.ak-save-msg.t-warn { color: var(--warn, #d99a1e); } .ak-save-msg.t-bad { color: var(--bad); }
.ak-grow { flex: 1; }
.ak-row-link { cursor: pointer; }
.ak-row-link .ak-open { color: var(--accent); white-space: nowrap; text-align: right; }
@media (max-width: 900px) {
  .ak-layout { flex-direction: column; gap: 0.75rem; }
  .ak-vnav { flex-direction: row; flex-wrap: wrap; width: auto; position: static; gap: 0.35rem; }
  .ak-vnav button { border: 1px solid var(--rule); padding: 0.35rem 0.65rem; font-size: 0.85rem; }
  .ak-grid2, .ak-grid3 { grid-template-columns: minmax(0, 1fr); }
  .ak-savebar { bottom: calc(env(safe-area-inset-bottom, 0px) + 0.25rem); }
}

/* ------------------------------------------------------------------ 1.41.0 nodes pages */
/* ------------------------------------------------------------------ 1.41.0 DICOM nodes (PACS, node settings, Modalities, Printers, Monitoring) */
/* Classes nd-*. Works at every width; desktop refinements in the media query below. */
.nd-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.75rem; }
.nd-toolbar .grow { flex: 1 1 14rem; min-width: 0; }
.nd-toolbar select { width: auto; max-width: 100%; }
.nd-spacer { flex: 1 1 0; }
.nd-table { min-width: 100%; }
.nd-table td { vertical-align: middle; }
.nd-table td .two .strong .mod { margin-right: 0.25rem; }
.nd-table .nd-menu-col { width: 2.75rem; text-align: right; padding-left: 0.25rem; padding-right: 0.4rem; }
.nd-table code, .nd-foot code, .ak-note code { font-size: 0.86em; }
.nd-addr { word-break: break-all; }
.nd-badges { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.nd-badges .ak-badge + .ak-badge { margin-left: 0; }
.nd-detail { display: block; margin-top: 0.2rem; font-size: 0.8rem; max-width: 22rem; overflow-wrap: anywhere; }
.nd-foot { color: var(--muted); font-size: 0.85rem; margin: 0.7rem 0 0; }
.nd-hint { font-size: 0.86rem; margin: 0; line-height: 1.45; }
.nd-link { color: var(--accent); font-size: 0.88rem; text-decoration: none; white-space: nowrap; }
.nd-link:hover { text-decoration: underline; }
.nd-sec { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.nd-sec-row { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }
.nd-sec-row .nd-sec { margin-bottom: 0.5rem; }

/* Node settings page */
.nd-page .ak-card .field { margin: 0; min-width: 0; }
.nd-page .ak-card .field input:not([type="checkbox"]):not([type="radio"]), .nd-page .ak-card .field select { width: 100%; max-width: 100%; box-sizing: border-box; }
.nd-page .ak-card .seg { align-self: flex-start; }
.nd-page .ak-card .check { margin: 0; }
.nd-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.8rem 1rem; align-items: start; }
.nd-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; align-items: center; }
.nd-stack { display: flex; flex-direction: column; gap: 0.4rem; }
.nd-sub { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem 0.9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel-2); min-width: 0; }
.nd-subhead { margin-top: 0.3rem; }
.nd-narrow { width: auto !important; max-width: 16rem; margin-top: 0.4rem; }
.nd-err { display: block; margin: 0.25rem 0 0; font-size: 0.82rem; }
.nd-danger { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
.nd-danger .nd-hint { flex: 1 1 18rem; }
.nd-dotsep { color: var(--muted); margin: 0 0.45rem; }
.nd-page .page-sub { display: flex; flex-wrap: wrap; align-items: center; row-gap: 0.2rem; }
.nd-page .ak-head .ak-head-text { min-width: 0; }
.nd-page .ak-card .pin-card { max-width: 100%; overflow-wrap: anywhere; }

/* Printers: activity cards */
.nd-cards { margin-top: 1rem; }
.nd-figures { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.nd-figures .two b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.nd-figures .two small { color: var(--muted); font-size: 0.82rem; }
.nd-cards .two { display: flex; flex-direction: column; line-height: 1.3; }

/* Monitoring */
.nd-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 1.3rem; vertical-align: middle; }
.nd-bars i { display: block; width: 5px; height: 100%; border-radius: 2px; background: var(--rule); }
.nd-bars i.b-ok { background: var(--ok); }
.nd-bars i.b-backup { background: var(--warn, #d99a1e); }
.nd-bars i.b-fail, .nd-bars i.b-down { background: var(--bad); }
.nd-rules { margin-top: 1rem; }
.nd-rules-row { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; }
.nd-rules-text { flex: 1 1 18rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.nd-alerts tr.nd-read td { color: var(--muted); }
.nd-alerts tr.nd-unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

@media (max-width: 900px) {
  .nd-row { grid-template-columns: minmax(0, 1fr); }
  .nd-toolbar .grow { flex-basis: 100%; }
  .nd-table { white-space: nowrap; }
  .nd-detail { white-space: normal; min-width: 12rem; }
}

@media (min-width: 901px) {
  .nd-table th, .nd-table td { padding-left: 0.65rem; padding-right: 0.65rem; }
  .nd-table td.small { max-width: 16rem; }
}
.nd-plain small { display: block; color: var(--muted); font-size: 0.82rem; }
.nd-table td .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.nd-table td .two > small { color: var(--muted); font-size: 0.82rem; }

/* ------------------------------------------------------------------ 1.41.0 facilities pages */
/* ------------------------------------------------------------------ 1.41.0 Facilities (CompaniesAdmin, ProceduresAdmin, InstitutionAliases, patientPortal) */
/* Works at every width (admin pages have no phone layout); desktop refinements at the end. */

/* Action row at the top of a tab (the wrapper shows the title). */
.fc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.6rem; }
.fc-actions .grow { flex: 1 1 18rem; min-width: 0; }

/* Two-line cells and rows (first line strong, second muted), at every width. */
.fc-page .two, .fc-procs .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.fc-page .two > small, .fc-procs .two > small { color: var(--muted); font-size: 0.82rem; }

/* Facilities list (board 19) */
.fc-table td { vertical-align: middle; }
.fc-name-cell { display: flex; align-items: center; gap: 0.7rem; min-width: 14rem; }
.fc-name-cell .two { min-width: 0; }
.fc-tile { width: 2.25rem; height: 2.25rem; border-radius: 9px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 0.74rem; letter-spacing: 0.02em; background: var(--accent-soft); color: var(--accent); }
.fc-logo { width: 2.25rem; height: 2.25rem; border-radius: 9px; flex: none; object-fit: contain; background: var(--panel-2); border: 1px solid var(--rule); padding: 2px; }
.fc-finder { margin-top: 0.9rem; }
.fc-finder-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.fc-finder-row > .two { flex: 1 1 16rem; min-width: 0; }
/* A read-only switch (the setting is changed in its dialog). */
.fc-sw { width: 2.25rem; height: 1.3rem; border-radius: 99px; background: var(--rule); position: relative; flex: none; }
.fc-sw::after { content: ''; position: absolute; top: 0.15rem; left: 0.15rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--panel); transition: left 0.15s; }
.fc-sw.on { background: var(--ok); }
.fc-sw.on::after { left: 1.1rem; }

/* One facility (board 20) */
.fc-code { font-size: 0.8rem; vertical-align: middle; margin-left: 0.5rem; }
.fc-tab { margin-top: 0.9rem; }
.fc-cards { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.fc-cards .field, .fc-profile .field { margin: 0; }
.fc-profile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.fc-profile-main { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.fc-profile-side { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.fc-side-title { margin: 0; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fc-logo-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.fc-logo-box { width: 150px; height: 44px; border-radius: 8px; border: 1px dashed var(--rule); background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.fc-logo-box img { max-width: 146px; max-height: 40px; object-fit: contain; }
.fc-list { margin: 0; padding-left: 1.2rem; }

/* Report header preview: the real profile fields on a page-like card. */
.fc-paper { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; font-size: 0.74rem; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.fc-paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.fc-paper-name { font-size: 0.85rem; }
.fc-paper-logo { max-width: 150px; max-height: 44px; object-fit: contain; border-radius: 3px; }
.fc-paper-addr { text-align: right; color: var(--muted); }
.fc-paper-addr b { color: var(--text); }
.fc-paper-contact { display: block; }
.fc-paper-rule { border-top: 1.5px solid var(--text); margin: 0.6rem 0 0.5rem; opacity: 0.8; }
.fc-paper-line { margin-top: 0.4rem; height: 6px; border-radius: 3px; background: var(--rule); }

/* Procedures (board 21) */
.fc-fac-select { max-width: 100%; }
.fc-missing { display: inline-flex; align-items: center; gap: 0.4rem; }
.fc-missing.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.fc-proc-table td { vertical-align: middle; }
.fc-proc-table .two { min-width: 14rem; }
.fc-copy-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.fc-copy-head .grow { flex: 1; }
.fc-copy-list .fm-item { grid-template-columns: auto 3.5rem minmax(0, 1fr) auto; }
.fc-copy-list .fm-item.muted { cursor: default; }
.fc-copy-cpt { color: var(--muted); }

/* Institutions (board 22) */
.fc-inst { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.fc-inst-main, .fc-inst-side { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.fc-inst-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.fc-group .ak-card-head h2 { font-size: 0.98rem; }
.fc-suggest { border-color: color-mix(in srgb, var(--warn, var(--accent)) 45%, var(--rule)); }
.fc-suggest .ak-card-head h2 { font-size: 0.95rem; }
.fc-suggest-acts { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.fc-inst .ia-find { margin: 0; }
.fc-inst .inst-seen { display: flex; flex-wrap: wrap; gap: 0.35rem; }

@media (min-width: 901px) {
  .fc-profile { grid-template-columns: minmax(0, 1fr) 330px; }
  .fc-inst { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); }
}
.fc-suggest-acts button { padding: 0.35rem 0.7rem; font-size: 0.88rem; }

/* ------------------------------------------------------------------ 1.41.0 admin pages */
/* ------------------------------------------------------------------ 1.41.0 Administration (admin part): Users, Reporting, Security, Logs, System */
/* Classes ad-*. Works at every width (phones get the same layout, tables scroll inside their box);
   desktop refinements in the media query at the end. Tokens only. */
.ad-cards { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.ad-mt { margin-top: 0.9rem; }
.ad-grow { flex: 1 1 0; min-width: 0; }
.ad-block { display: block; }
.ad-left { justify-content: flex-start; }
.ad-wide { width: 100%; justify-content: center; }
.ad-wrap { overflow-wrap: anywhere; white-space: pre-wrap; }
.ad-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.ad-scroll > table.grid { display: table; }
.ad-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ad-foot { margin: 0.7rem 0 0; }
.ad-h3 { font-size: 0.95rem; margin: 0.4rem 0 0; }
.ad-sub, .ad-side-sec { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0.4rem 0 -0.2rem; }
.ad-seg-start { align-self: flex-start; }
.ad-span2 { grid-column: span 2; min-width: 0; }
.ad-side .field, :is(.ad-reporting, .ad-security, .ad-https, .ad-email, .ad-updates) .ak-card .field { margin: 0; min-width: 0; }
:is(.ad-reporting, .ad-security, .ad-https, .ad-email, .ad-updates) .ak-card .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea), .ad-side .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { width: 100%; max-width: 100%; box-sizing: border-box; }
:is(.ad-reporting, .ad-security, .ad-https, .ad-email, .ad-updates) .ak-card .check { margin: 0; }
:is(.ad-reporting, .ad-security, .ad-https, .ad-email, .ad-updates) .ak-card-head h2 .ak-badge { margin-left: 0.5rem; vertical-align: 1px; }
.ad-tab-body { margin-top: 0.9rem; }
.ad-changed td { background: color-mix(in srgb, var(--warn, #d99a1e) 7%, transparent); }

/* On/off switch (a styled checkbox; it only changes the draft, Save writes it). */
.ad-switch { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; font-size: 0.85rem; color: var(--muted); user-select: none; }
.ad-switch input { appearance: none; -webkit-appearance: none; width: 2.3rem; height: 1.3rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--rule); position: relative; margin: 0; cursor: pointer; transition: background 0.15s; flex: none; }
.ad-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.3rem - 6px); height: calc(1.3rem - 6px); border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.ad-switch input:checked { background: var(--accent); border-color: var(--accent); }
.ad-switch input:checked::after { transform: translateX(1rem); background: var(--accent-ink); }
.ad-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Side panel (Users editor, Problem report details). Below the list on narrow screens. */
.ad-side { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; margin-top: 1rem; }
.ad-side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.ad-side-head h2 { margin: 0; font-size: 1.05rem; }
.ad-side .form { gap: 0.75rem; }
.ad-side .seg { max-width: 100%; }
.ad-side .seg button:disabled { opacity: 0.55; cursor: not-allowed; }
.ad-side .form-actions { flex-wrap: wrap; }
.ad-side .inst-rule { flex-wrap: wrap; }
.ad-details > summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; margin-bottom: 0.4rem; }
.ad-kv { margin: 0; grid-template-columns: max-content minmax(0, 1fr); font-size: 0.9rem; }
.ad-pre { max-height: 14rem; overflow: auto; font-size: 0.78rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-uid { font-size: 0.82rem; overflow-wrap: anywhere; }
.ad-row { cursor: pointer; }
table.grid tr.ad-row.sel > td { background: var(--accent-soft); }
.ad-off td { opacity: 0.6; }
.ad-facs { max-width: 18rem; }

/* Security */
.ad-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem 1rem; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ad-chip { display: inline-flex; align-items: center; gap: 0.3rem; height: 1.9rem; padding: 0 0.3rem 0 0.65rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--rule); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ad-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0.1rem 0.35rem; border-radius: 99px; }
.ad-chip button:hover { color: var(--bad); background: var(--panel); }
.ad-chip-add { display: inline-flex; gap: 0.4rem; align-items: center; flex: 1 1 16rem; min-width: 0; }
.ad-chip-add input { flex: 1 1 10rem; min-width: 0; }
.ad-alerts { max-height: 18rem; overflow-y: auto; }

/* Reporting › Dictation and AI: engines list */
.ad-engines { display: flex; flex-direction: column; }
.ad-engine { border-top: 1px solid var(--rule); }
.ad-engine:first-child { border-top: 0; }
.ad-engine-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.6rem 0; }
.ad-engine-row .ak-status { min-width: 13rem; }
.ad-engine-body { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.2rem 0 0.9rem; }
.ai-repl input { width: 100%; box-sizing: border-box; }

/* Logs */
.ad-audit-head { align-items: center; }
.ad-filters select { width: auto; max-width: 100%; }
.ad-filters input[type="date"] { width: auto; }
.ad-detail-cell { max-width: 26rem; min-width: 14rem; overflow-wrap: anywhere; }
tr.ad-expand > td { background: var(--panel-2); white-space: normal; }
.ad-fchip.bad:not(.on) { border-color: color-mix(in srgb, var(--bad) 55%, var(--rule)); color: var(--bad); }
.ad-fchip .seg-n { margin-left: 0.25rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.ad-result { min-width: 8rem; }
.ad-prog { display: inline-flex; flex-direction: column; gap: 0.2rem; width: 9rem; }
.ad-bar { display: block; height: 0.4rem; border-radius: 99px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--rule); }
.ad-bar i { display: block; height: 100%; background: var(--accent); }
.ad-transfers .toolbar select { width: auto; max-width: 100%; }

/* System › Updates */
.ad-ready { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.ad-notes { margin: 0; padding-left: 1.2rem; line-height: 1.65; }
.ad-updates .section-title { margin: 0.6rem 0 0; font-size: 1rem; }

/* System › HTTPS */
.ad-status { flex-direction: row; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.ad-status.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.ad-status.warn { border-color: color-mix(in srgb, var(--warn, #d99a1e) 50%, var(--rule)); }
.ad-status-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 0.15rem; }
.ad-lock { flex: none; }
.ad-host-input { width: 100%; min-width: 12rem; box-sizing: border-box; }
.ad-hosts td { vertical-align: middle; }

/* System › Email */
.ad-email-grid { display: flex; flex-direction: column; gap: 1rem; }
.ad-email-side { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.ad-email-side .ak-note { margin: 0; }
.ad-senders { list-style: none; margin: 0; padding: 0; }
.ad-senders li { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.ad-senders li:first-child { border-top: 0; padding-top: 0.1rem; }
.ad-senders small { display: block; margin-top: 0.15rem; line-height: 1.45; }
.ad-count { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.95rem; }

/* Two-line cells also on phones (the shared rule is desktop-only); admin tables keep a usable
   width and scroll sideways inside their box. */
:is(.ad-users-page, .ad-reporting, .ad-security, .ad-audit, .ad-transfers, .ad-problems, .ad-updates, .ad-https, .ad-email, .ad-side) .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
:is(.ad-users-page, .ad-reporting, .ad-security, .ad-audit, .ad-transfers, .ad-problems, .ad-updates, .ad-https, .ad-email) .two > small { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 900px) {
  :is(.ad-users-page, .ad-audit, .ad-transfers, .ad-problems, .ad-updates) .toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.6rem; }
  :is(.ad-users-page, .ad-audit, .ad-transfers, .ad-problems) .toolbar input.grow { flex: 1 1 100%; }
  .ad-scroll > table.grid, .ad-scroll > table.table { min-width: 40rem; }
  .ad-scroll > table.ai-repl { min-width: 24rem; }
  .ad-scroll > table.ad-audit-grid, .ad-scroll > table.ad-tl-grid { min-width: 56rem; }
  .ad-scroll > .ad-hosts { min-width: 28rem; }
  .ad-grid3 { grid-template-columns: minmax(0, 1fr); }
  .ad-span2 { grid-column: auto; }
  .ad-engine-row .ak-status { min-width: 0; flex: 1 1 auto; }
  .ad-engine-row .ad-grow { flex-basis: 100%; order: 3; }
  .ad-chip-add { flex-basis: 100%; }
  .ad-filters > *, .ad-transfers .toolbar > select { flex: 1 1 9rem; }
  .ad-transfers .toolbar .seg, .ad-problems .toolbar .seg, .ad-users-page .toolbar .seg { max-width: 100%; }
}

@media (min-width: 901px) {
  .ad-side { flex: 0 0 25rem; width: 25rem; margin-top: 0; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; box-sizing: border-box; }
  .with-side > .side-main { min-width: 0; }
  .ad-users-grid td, .ad-problems-grid td { vertical-align: middle; }
  .ad-email-grid { flex-direction: row; align-items: flex-start; }
  .ad-email-main { flex: 1 1 0; }
  .ad-email-side { flex: 0 0 26rem; width: 26rem; }
  .ad-audit-head p { margin: 0; }
  .ad-filters > select, .ad-transfers .toolbar > select { flex: 0 0 auto; width: auto; max-width: 13rem; }
  .ad-filters > input.grow, .ad-transfers .toolbar > input.grow { flex: 1 1 14rem; min-width: 12rem; }
}
@media (min-width: 901px) and (max-width: 1350px) {
  .ad-side { flex-basis: 21rem; width: 21rem; }
  .ad-email-side { flex-basis: 21rem; width: 21rem; }
}
/* The report header preview shows the printed page: white paper in every theme (logos are made for it). */
.fc-paper { background: #fff; color: #1d2b44; border-color: #d5dbe5; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.fc-paper .fc-paper-addr { color: #4a5872; }
.fc-paper .fc-paper-addr b { color: #1d2b44; }
.fc-paper .fc-paper-rule { border-top-color: #1d2b44; }
.fc-paper .fc-paper-line { background: #e3e8ef; }

/* ------------------------------------------------------------------ 1.42.0 workstations */
/* 1.42.0 Administration › Workstations (board 25) and My settings › This computer status.
   Reuses .ad-side / .ad-switch / .ad-row / .ad-scroll (1.41.0) and the admin kit. */

.ws-page .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ws-page .two > small { color: var(--muted); font-size: 0.82rem; }
.ws-grow { flex: 1 1 auto; }
.ws-line { margin: 0; line-height: 1.45; }
.ws-small { font-size: 0.84rem; }
.ws-h3 { font-size: 0.95rem; margin: 0.5rem 0 0; }
.ws-h3:first-child { margin-top: 0; }

/* Summary card (agent release, update rules) */
.ws-summary { padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.ws-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.ws-summary-row .two small { white-space: normal; }

/* List */
.ws-grid td { vertical-align: middle; }
.ws-grid td .two .strong .ak-badge { margin-left: 0.35rem; vertical-align: 1px; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ws-chip { display: inline-flex; align-items: center; height: 1.4rem; padding: 0 0.5rem; border-radius: 99px; font-size: 0.78rem; background: var(--panel-2); border: 1px solid var(--rule); color: var(--text); white-space: nowrap; }
.ws-foot { font-size: 0.82rem; margin: 0.7rem 0 0; max-width: 60rem; }
.ws-page > .ak-note { margin-bottom: 0.75rem; }

/* Side panel */
.ws-side h2 .ak-badge { margin-left: 0.4rem; vertical-align: 2px; }
.ws-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.8rem; }
.ws-grid2 .field, .ws-dev-fields .field, .ws-dev-row .field, .ws-browser .field { margin: 0; min-width: 0; }
.ws-grid2 .field :is(input, select), .ws-dev-fields .field select, .ws-dev-row .field select { width: 100%; max-width: 100%; box-sizing: border-box; }
.ws-dev-fields { display: flex; flex-direction: column; gap: 0.5rem; }
.ws-dev-row { display: flex; align-items: flex-end; gap: 0.5rem; min-width: 0; }
.ws-dev-row > .field { flex: 1 1 auto; }
.ws-dev-row > .btn { flex: none; margin-bottom: 0; }
.ws-dev-row:has(.field-hint) > .btn { margin-bottom: 1.35rem; }
.ws-dev-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.ws-dev-grid3 .field-label { font-size: 0.8rem; }
.ws-hint { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 8px; padding: 0.45rem 0.6rem; font-size: 0.84rem; }
.ws-films { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ws-films .check { font-size: 0.9rem; }
.ws-test:disabled { opacity: 0.55; cursor: not-allowed; }
.ws-side .form-actions { gap: 0.5rem; align-items: center; margin: 0; }
.ws-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; border-top: 1px solid var(--rule); padding-top: 0.75rem; margin-top: 0.25rem; }
.btn.ws-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--rule)); }
.btn.ws-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* Cards under the list: this PC in this browser only, the app, for all PCs */
.ws-more { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.25rem; }
.ws-more .ak-card-head h2 .ak-badge { margin-left: 0.5rem; vertical-align: 1px; }
.ws-browser .dev-label { margin: 0.2rem 0; }
.ws-browser .ws-dev-fields { max-width: 40rem; }
.ws-browser .form-actions { margin: 0; }
.ws-browser-save { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; border-top: 1px solid var(--rule); padding-top: 0.75rem; font-size: 0.88rem; }
.ws-shared { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem 1.4rem; }
.ws-shared > div { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ws-shared a { overflow-wrap: anywhere; }

/* Install dialog */
.ws-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; }
.ws-steps li { line-height: 1.45; }
.ws-cmd { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; max-height: 12rem; overflow-y: auto; user-select: all; }
.ws-install .form-actions { flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* My settings › This computer */
.ws-this-status { font-size: 0.92rem; line-height: 1.45; }

@media (max-width: 900px) {
  .ws-page .toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.6rem; }
  .ws-page .toolbar input.grow { flex: 1 1 100%; }
  .ws-page .toolbar select { flex: 1 1 auto; width: auto; max-width: 100%; }
  .ws-page .ad-scroll > table.ws-grid { min-width: 40rem; }
  .ws-shared { grid-template-columns: minmax(0, 1fr); }
  .ws-dev-grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .ws-page .toolbar select { flex: 0 0 auto; width: auto; max-width: 15rem; }
  .ws-side { flex-basis: 27rem; width: 27rem; }
  .ws-page .with-side > .side-main { overflow-x: auto; }
  .ws-page .with-side .ws-grid td .two small { white-space: normal; }
}
@media (min-width: 901px) and (max-width: 1350px) {
  .ws-side { flex-basis: 23rem; width: 23rem; }
  .ws-page .with-side .ws-shared { grid-template-columns: minmax(0, 1fr); }
}
.ws-side .ws-dev-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-side .ws-dev-grid3 > :first-child { grid-column: span 2; }
.ws-films > legend { padding: 0; margin-bottom: 0.2rem; }
.ws-browser .ws-dev-row { max-width: 40rem; }

/* ------------------------------------------------------------------ 1.42.0 mysettings */
/* ------------------------------------------------------------------ 1.42.0 My settings (Account.tsx desktop, Protocols, Templates, Passkeys) */
/* Classes ms-*. Only the desktop My settings uses them (phones keep the 1.41 tabbed page). Works at
   every width; desktop refinements and the text size / density preferences at the end. Tokens only. */
.ms-page .ak-layout { margin-top: 0.6rem; }
.ms-view { gap: 0.9rem; }
.ms-view > .account-block:first-child { margin-top: 0; }
.ms-hint { font-size: 0.85rem; line-height: 1.45; }
.ms-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ms-grow { flex: 1 1 12rem; min-width: 0; }
.ms-block { width: 100%; justify-content: center; }
.ms-table-wrap { overflow-x: auto; max-width: 100%; }
.ms-table-wrap > table.grid { display: table; }
.ms-seg-fit { align-self: flex-start; }
.ms-fields .field { margin: 0; min-width: 0; }
.ms-fields select, .ms-form input { width: 100%; max-width: 100%; box-sizing: border-box; }
.ms-form { display: flex; flex-direction: column; gap: 0.7rem; }
.ms-form .field { margin: 0; min-width: 0; }
.ms-danger-btn { color: var(--bad); }

/* Appearance: theme tiles with a preview drawn from each theme's own tokens */
.ms-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.ms-theme { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.6rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.ms-theme:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.ms-theme.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ms-theme-pv { display: flex; gap: 5px; height: 3.6rem; padding: 6px; border-radius: 7px; border: 1px solid; box-sizing: border-box; }
.ms-theme-pv i { display: block; border-radius: 4px; }
.ms-theme-rail { width: 22%; }
.ms-theme-main { flex: 1; border-bottom: 4px solid; display: flex; flex-direction: column; gap: 4px; padding: 6px; box-sizing: border-box; }
.ms-theme-main b { display: block; height: 4px; border-radius: 2px; width: 70%; opacity: 0.85; }
.ms-theme-main b + b { width: 45%; opacity: 0.6; }
.ms-theme-name { font-weight: 600; font-size: 0.9rem; }

/* List + editor side by side (Hanging protocols, Templates) */
.ms-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.25rem; align-items: start; }
.ms-list { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ms-list input[type="search"] { width: 100%; box-sizing: border-box; }
.ms-list-top { display: flex; gap: 0.5rem; align-items: stretch; }
.ms-seg { flex: 1; display: flex; }
.ms-seg button { flex: 1; }
.ms-plus { min-width: 2.4rem; padding: 0 0.6rem; font-size: 1.15rem; line-height: 1; }
.ms-ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); overflow: hidden; }
.ms-ul li + li { border-top: 1px solid var(--rule); }
.ms-li { display: flex; flex-direction: column; gap: 0.15rem; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; padding: 0.6rem 0.75rem; color: var(--text); font: inherit; cursor: pointer; line-height: 1.3; }
.ms-li:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ms-li.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ms-li.off .strong { color: var(--muted); }
.ms-li .strong { overflow-wrap: anywhere; }
.ms-li .mod { margin-right: 0.2rem; }
.ms-li small { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.ms-li .ak-badge { height: 1.2rem; font-size: 0.7rem; }
.ms-detail { min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.ms-detail > .empty { margin-top: 0; }

/* Hanging protocols: every monitor as a preview card */
.ms-hp-mons { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.ms-hp-mon { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); color: var(--text); text-align: left; font: inherit; min-width: 0; }
button.ms-hp-mon { cursor: pointer; }
button.ms-hp-mon:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.ms-hp-mon.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ms-hp-mon-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.88rem; }
.ms-hp-mon-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-hp-grid { display: grid; gap: 5px; height: 8.5rem; }
.ms-hp-vp { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 0; overflow: hidden; padding: 0.35rem 0.45rem; border-radius: 6px; border: 1px solid var(--film-rule); background: var(--film); color: var(--film-text); font-size: 0.74rem; line-height: 1.25; }
.ms-hp-vp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-hp-vp small { color: var(--film-muted); font-size: 0.68rem; }
.ms-hp-dark { display: grid; place-items: center; border: 1px dashed var(--rule); border-radius: 6px; font-size: 0.8rem; }
.ms-hp-add { justify-content: center; align-items: center; border-style: dashed; min-height: 6rem; color: var(--accent); font-weight: 600; }
.ms-hp-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0; }
.ms-hp-shared-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.ms-hp-shared-head .two { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ms-hp-shared-head .two small { color: var(--muted); font-size: 0.85rem; }
.ms-hp-shared p { margin: 0; }
.ms-detail .hp-editor { gap: 1rem; }

/* Templates editor */
.ms-tpl-editor { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.ms-tpl-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem 1rem; }
.ms-tpl-fields .field { margin: 0; min-width: 0; }
.ms-tpl-fields input { width: 100%; box-sizing: border-box; }
.ms-tpl-opts { display: flex; align-items: center; gap: 0.6rem 1.25rem; flex-wrap: wrap; }
.ms-inline-field { display: inline-flex; align-items: center; gap: 0.5rem; }
.ms-inline-field select { width: auto; max-width: 16rem; }
.ms-tpl-body textarea { width: 100%; box-sizing: border-box; min-height: 20rem; resize: vertical; font: inherit; font-size: 0.95rem; line-height: 1.7; background: var(--bg); color: var(--text); border: 1px solid var(--rule); border-radius: 8px; padding: 0.7rem 0.85rem; }
.ms-tpl-body textarea[readonly] { background: var(--panel-2); }

/* Sign-in and devices */
.ms-sessions td .two, .ms-keys td .two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ms-sessions td .two small { color: var(--muted); font-size: 0.82rem; }
.ms-sessions td.actions { width: 1%; }
.ms-signin-grid { align-items: start; }

@media (min-width: 901px) {
  .ms-split { grid-template-columns: 16.5rem minmax(0, 1fr); }
  .ms-list { position: sticky; top: 1rem; }
  .ms-tpl-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .ms-detail .hp-meta { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
}
@media (min-width: 901px) and (max-width: 1350px) {
  /* Laptop widths: the protocol editor's own fields stack two by two. */
  .ms-detail .hp-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ms-detail .hp-meta > .check { padding-top: 0; }
}

/* Text size and density (My settings › Appearance): computers only, the portal only. Phones,
   the viewer and the images never change. */
@media (min-width: 901px) {
  html[data-text="smaller"] { font-size: 93.75%; }
  html[data-text="smaller"] body { font-size: 14px; }
  html[data-text="larger"] { font-size: 112.5%; }
  html[data-text="larger"] body { font-size: 16.5px; }
  html[data-density="compact"] .main { padding-top: 1rem; padding-bottom: 2.5rem; }
  html[data-density="compact"] .grid th { padding-top: 0.38rem; padding-bottom: 0.38rem; }
  html[data-density="compact"] .grid td { padding-top: 0.32rem; padding-bottom: 0.32rem; }
  html[data-density="compact"] .ak-card { padding: 0.7rem 0.9rem; gap: 0.6rem; }
  html[data-density="compact"] .ak-layout > .ak-cards { gap: 0.6rem; }
  html[data-density="compact"] .ms-li { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  html[data-density="compact"] .page-head { margin-bottom: 0.2rem; }
}

/* This computer: the status line wraps inside the card (long agent messages). */
.ms-view .ws-this-status .ak-status { white-space: normal; align-items: flex-start; }
.ms-view .ws-this-status .ak-dot { margin-top: 0.45em; }

/* ------------------------------------------------------------------ 1.43.0 hid */
/* 1.43.0 dictation mic (hid part): My settings › Dictation › "Dictation mic" and "Buttons"
   (frontend/src/micSettings.tsx). Tokens only. */
.ms-mics, .ms-mic-buttons { width: 100%; }
.ms-mics td { vertical-align: middle; }
.ms-mics td.actions, .ms-mic-buttons td.actions { width: 1%; white-space: nowrap; text-align: right; }
.ms-mic-acts { display: inline-flex; align-items: center; gap: 0.4rem; }
.ms-mic-err { display: block; margin-top: 0.3rem; color: var(--warn); font-size: 0.82rem; line-height: 1.4; max-width: 34rem; white-space: normal; }
.ms-mic-empty { margin: 0.25rem 0 0; }
.ms-mic-dev + .ms-mic-dev { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.ms-mic-dev-head { margin-bottom: 0.4rem; }
.ms-mic-dev-head h3 { margin: 0; font-size: 0.92rem; }
.ms-mic-id { font-weight: 400; font-size: 0.8rem; margin-left: 0.35rem; font-variant-numeric: tabular-nums; }
.ms-mic-pick { width: 16rem; }
.ms-mic-select { width: 100%; min-width: 12rem; }
.ms-mic-buttons .two small { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.76rem; word-break: break-all; }

/* Learn / Test dialogs */
.ms-mic-modal { width: min(36rem, calc(100vw - 2rem)); }
.ms-mic-prompt { margin: 0 0 0.35rem; font-weight: 600; }
.ms-mic-wait { display: flex; align-items: center; gap: 0.6rem; padding: 1.2rem 1rem; border: 1px dashed var(--rule); border-radius: 10px; color: var(--muted); justify-content: center; }
.ms-mic-pulse { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--accent); animation: ms-mic-pulse 1.4s ease-in-out infinite; }
@keyframes ms-mic-pulse { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .ms-mic-pulse { animation: none; } }
.ms-mic-new td { animation: ms-mic-in 0.6s ease-out; }
@keyframes ms-mic-in { from { background: var(--accent-soft); } to { background: transparent; } }
.ms-mic-pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.ms-mic-key { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel-2); transition: background 0.08s, border-color 0.08s; min-width: 0; }
.ms-mic-key b { font-size: 0.88rem; }
.ms-mic-key small { color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.ms-mic-key.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ms-mic-key.on small { color: var(--accent-ink); }
.ms-mic-log { list-style: none; margin: 0.25rem 0 0; padding: 0; font-size: 0.86rem; min-height: 1.4rem; }
.ms-mic-log li { padding: 0.2rem 0; border-bottom: 1px solid var(--rule); }
.ms-mic-log li:first-child { font-weight: 600; }
.ms-mic-modal .ak-note { margin: 0; }
@media (max-width: 900px) {
  .ms-mic-pick { width: auto; }
  .ms-mic-select { min-width: 9rem; }
}

/* ------------------------------------------------------------------ 1.43.0 remote */
/* ------------------------------------------------------------------ 1.43.0 iPhone microphone (remote part)
   Desktop: the "Use my iPhone" control in the report screen's Dictation panel (rm-*), its QR
   dialog. iPhone: the /m/mic screen (rmp-*), Hourbook look (.m-vars tokens), safe areas. */

/* desktop: the control next to Record / Live text */
.rm-use { display: inline-flex; align-items: center; gap: 0.35rem; }
.rm-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 1.9rem; padding: 0.15rem 0.3rem 0.15rem 0.6rem; box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--rule)); border-radius: 999px; background: color-mix(in srgb, var(--ok) 10%, var(--panel));
  color: var(--text); font-size: 0.85rem; max-width: 100%; min-width: 0;
}
.rm-pill > svg { color: var(--ok); flex: none; }
.rm-pill.warn { border-color: color-mix(in srgb, var(--warn, #d99a1e) 55%, var(--rule)); background: color-mix(in srgb, var(--warn, #d99a1e) 10%, var(--panel)); }
.rm-pill.warn > svg { color: var(--warn, #d99a1e); }
.rm-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rm-off { font-size: 0.85rem; flex: none; }
.rm-level { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.rm-level i { width: 4px; border-radius: 1px; background: var(--rule); transition: background 0.08s linear; }
.rm-level i:nth-child(1) { height: 5px; } .rm-level i:nth-child(2) { height: 7px; } .rm-level i:nth-child(3) { height: 9px; }
.rm-level i:nth-child(4) { height: 11px; } .rm-level i:nth-child(5) { height: 14px; }
.rm-level i.on { background: var(--ok); }

/* desktop: the QR dialog */
.rm-pair { display: flex; gap: 1.25rem; align-items: center; }
.rm-qr { flex: none; width: 208px; height: 208px; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--rule); background: var(--panel-2); }
.rm-qr svg { display: block; width: 100%; height: 100%; }
.rm-qr.expired { opacity: 0.25; filter: grayscale(1); }
.rm-steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.95rem; line-height: 1.4; }
.rm-foot { margin: 1rem 0 0; font-size: 0.9rem; }
.rm-warn { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--warn, #d99a1e); }
.rm-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.1rem; }
@media (max-width: 560px) {
  .rm-pair { flex-direction: column; align-items: stretch; }
  .rm-qr { align-self: center; }
}

/* ------------------------------------------------------------------ iPhone: /m/mic */
.rmp {
  min-height: 100dvh; box-sizing: border-box; background: var(--bg); color: var(--text); display: flex; flex-direction: column; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
}
.rmp-top { display: flex; align-items: center; gap: 10px; }
.rmp-title { flex: 1; min-width: 0; }
.rmp-title h1 { margin: 0; font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; }
.rmp-title small { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmp-end {
  height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); background: var(--panel-2);
  color: var(--bad); font: inherit; font-size: 15px; font-weight: 650; flex: none;
}

.rmp-status { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--m-line-soft); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.rmp-dot { width: 14px; height: 14px; border-radius: 7px; flex: none; background: var(--muted); }
.rmp-status.rec .rmp-dot { background: var(--bad); box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 60%, transparent); animation: rmp-pulse 1.4s ease-out infinite; }
.rmp-status.wait .rmp-dot { background: var(--m-amber); }
.rmp-st { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rmp-st strong { font-size: 19px; line-height: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmp-st small { font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmp-init { flex: none; min-width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; background: var(--m-info-soft); color: var(--m-info); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; padding: 0 6px; box-sizing: border-box; }
@keyframes rmp-pulse { 70% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--bad) 0%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

.rmp-meter { height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--m-line-soft); }
.rmp-meter i { display: block; height: 100%; width: 100%; transform-origin: left center; background: var(--ok); transition: transform 0.1s linear; }

.rmp-resume {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; box-sizing: border-box; padding: 14px 16px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--m-amber) 55%, var(--rule)); background: var(--m-amber-soft); color: var(--text); font: inherit;
}
.rmp-resume > svg { color: var(--m-amber); flex: none; }
.rmp-resume.first { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); background: var(--accent-soft); }
.rmp-resume.first > svg { color: var(--accent); }
.rmp-resume strong { display: block; font-size: 16px; line-height: 21px; }
.rmp-resume small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); margin-top: 2px; }

.rmp-buttons { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(92px, 1fr); gap: 10px; }
.rmp-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 22px; min-width: 0;
  border: 1px solid var(--m-line-soft); background: var(--panel); color: var(--text); font: inherit; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.rmp-btn.wide { grid-column: 1 / -1; }
.rmp-btn:active, .rmp-btn.held { background: var(--panel-2); transform: scale(0.98); }
.rmp-btn:disabled { opacity: 0.45; }
.rmp-lbl { font-size: 18px; line-height: 22px; font-weight: 700; text-align: center; }
.rmp-btn small { font-size: 12.5px; color: var(--muted); text-align: center; }
.rmp-rec { width: 26px; height: 26px; border-radius: 13px; background: var(--bad); }
.rmp-toggle_dictation.on .rmp-rec { border-radius: 6px; width: 22px; height: 22px; }
.rmp-toggle_dictation.on { border-color: color-mix(in srgb, var(--bad) 55%, var(--rule)); background: var(--m-red-soft); }
.rmp-push_to_talk.held { border-color: var(--bad); background: var(--m-red-soft); }
.rmp-sign .rmp-lbl { color: var(--accent); }
.rmp-foot { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--muted); text-align: center; }

.rmp-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 0 12px 15vh; }
.rmp-empty-ic { width: 64px; height: 64px; border-radius: 32px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.rmp-empty h2 { margin: 0; font-size: 22px; line-height: 28px; }
.rmp-empty p { margin: 0; color: var(--muted); font-size: 15px; line-height: 21px; max-width: 22rem; }
@media (prefers-reduced-motion: reduce) { .rmp-status.rec .rmp-dot { animation: none; } .rmp-btn:active { transform: none; } }
.rmp-signout { margin-top: 8px; color: var(--text); }

/* My settings › Dictation: "iPhone as microphone" */
.rm-btn-list { list-style: none; margin: 0.75rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius-m); max-width: 34rem; }
.rm-btn-list li { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.5rem 0.35rem 0.75rem; border-top: 1px solid var(--rule); min-width: 0; }
.rm-btn-list li:first-child { border-top: 0; }
.rm-btn-n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font-size: 0.8rem; font-weight: 700; flex: none; }
.rm-btn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-btn-add { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.85rem; max-width: 22rem; }

/* ================================================================== 1.44.0 desktop fixes (design review 2026-11-05)
   Sidebar: the links scroll, the account block stays pinned; quieter counts; one red (Critical results). */
.rail-scroll { display: flex; flex-direction: column; gap: inherit; }
.rail-me { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; padding: 0.4rem 0.5rem; }
.rail-acts { display: flex; gap: 0.4rem; }
.rail-act {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 2.25rem; padding: 0 0.5rem !important;
  border: 1px solid var(--rule); border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 0.88rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.rail-act:hover { background: var(--panel-2); border-color: var(--accent); }
.rail a.rail-act.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 700; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 400; white-space: nowrap; }
.rail a.active .nav-count { color: var(--accent); opacity: 0.85; }
.nav-count-stat { color: var(--warn, #d99a1e); font-weight: 700; }
.nav-badge-warn { background: color-mix(in srgb, var(--warn, #d99a1e) 22%, var(--panel)); color: var(--warn, #d99a1e); }
:root[data-mode="light"] .nav-badge-warn { color: #8a5a00; background: color-mix(in srgb, #d99a1e 22%, var(--panel)); }
@media (min-width: 901px) {
  .rail { overflow: hidden; padding-bottom: 0.75rem; }
  .rail > .brand, .rail > .rail-search { flex: none; }
  .rail-scroll {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -0.7rem; padding: 0 0.7rem 1.2rem;
    scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 1.2rem), transparent); mask-image: linear-gradient(#000 calc(100% - 1.2rem), transparent);
  }
  .rail-foot { flex: none; margin-top: 0; gap: 0.4rem; padding-top: 0.6rem; }
}
@media (max-width: 900px) {
  .rail-scroll { display: contents; }
  .rail-me { padding: 0 0.4rem; }
}
/* 1.44.0 picker chip (single choice) */
.fm-panel-choice { width: min(20rem, 90vw); }
.fm-choice { display: grid; grid-template-columns: 1rem 1fr auto; gap: 0.5rem; align-items: center; width: 100%; padding: 0.4rem 0.45rem; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fm-choice:hover, .fm-choice:focus-visible { background: var(--accent-soft); }
.fm-choice.on { color: var(--accent); font-weight: 700; }
.fm-tick { color: var(--accent); font-weight: 700; }
.fm-dates { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; border-top: 1px solid var(--rule); padding-top: 0.5rem; }
.fm-dates input { flex: 1 1 8rem; }
/* 1.44.0: the whole header cell sorts, not just the label. */
th[aria-sort] { position: relative; }
th[aria-sort] .th-sort::after { content: ''; position: absolute; inset: 0; }
th[aria-sort]:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* 1.44.0 Worklist (desktop): one-line 42 px rows in a fixed grid, pages of 100, filters in one row. */
.wl-help { position: relative; }
.btn-icon { min-width: 2.25rem; height: 2.25rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.wl-help-pop { position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30; width: 19rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-s); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); padding: 0.8rem 0.9rem; display: grid; gap: 0.4rem; }
.wl-help-pop ul { margin: 0; padding-left: 1rem; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.wl-help-pop kbd { font: inherit; font-size: 0.8rem; border: 1px solid var(--rule); border-radius: 5px; padding: 0 0.3rem; }
.wl-help-pop .btn-ghost { justify-self: end; }
.wl-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; padding: 0.55rem 0.2rem 0; }
.wl-pager-nav { display: inline-flex; align-items: center; gap: 0.5rem; }
.wl-pri { display: inline-flex; align-items: center; gap: 0.35rem; }
@media (min-width: 901px) {
  .worklist-page .ris-toolbar { flex-wrap: wrap; row-gap: 0.5rem; margin-bottom: 0.5rem; }
  .worklist-page .ris-toolbar .wl-search { flex: 1 1 12rem; min-width: 10rem; height: 2.25rem; }
  .worklist-grid { table-layout: fixed; }
  .worklist-grid th, .worklist-grid td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .worklist-grid td { height: 2.65rem; padding-top: 0; padding-bottom: 0; }
  .worklist-grid td.wl-c-patient, .worklist-grid td.wl-c-proc { white-space: nowrap; max-width: none; }
  .worklist-grid th.wl-check { width: 2.2rem; }
  .worklist-grid th:nth-child(1):not(.wl-check), .worklist-grid .wl-check + th { width: 5.4rem; }
  .worklist-grid th.num:not(.wl-c-img) { width: 5.2rem; }
  .worklist-grid th.wl-c-mod1 { width: 3.8rem; }
  .worklist-grid th.wl-c-fac1 { width: 9.5rem; }
  .worklist-grid th.wl-c-img { width: 4.8rem; }
  .worklist-grid th.wl-c-reader { width: 7.5rem; }
  .worklist-grid th.wl-c-rep { width: 7.5rem; }
  .worklist-grid th:last-child { width: 4.9rem; }
  .worklist-grid .wl-line { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; overflow: hidden; }
  .worklist-grid .wl-line > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
  .worklist-grid .wl-line > .wl-sub { display: block; flex: 0 3 auto; color: var(--muted); font-size: 0.82rem; }
  .worklist-grid .wl-line > .wl-sub .wl-change { margin-left: 0.3rem; }
  .worklist-grid td.wl-c-reader .wl-reading { margin-left: 0.3rem; }
  .worklist-grid .wl-author { display: inline; margin: 0 0 0 0.3rem; max-width: none; }
  .worklist-grid td.wl-c-act .btn { padding: 0.25rem 0.7rem; }
}
@media (min-width: 901px) and (max-width: 1599px) {
  .worklist-grid .wl-c-img { display: none; }
  .worklist-grid th.wl-c-fac1 { width: 9.5rem; }
  .worklist-grid th.wl-c-reader { width: 6.5rem; }
  .worklist-grid th.wl-c-rep { width: 7rem; }
  .worklist-grid th:nth-child(1):not(.wl-check), .worklist-grid .wl-check + th { width: 5.6rem; }
  .worklist-grid th.num:not(.wl-c-img) { width: 5.6rem; }
}
@media (max-width: 900px) {
  .worklist-grid .wl-c-mod1 { display: none; }
}
.wl-rep-reader { display: none; }
@media (min-width: 901px) {
  .worklist-page .ris-toolbar { gap: 0.5rem; }
  .worklist-page .ris-toolbar .wl-search { flex: 1 1 9rem; min-width: 7rem; }
  .worklist-grid .wl-line > :first-child { flex: 0 0 auto; max-width: 72%; }
  .worklist-grid .wl-check, .worklist-grid .wl-c-act, .worklist-grid .wl-c-mod1, .worklist-grid th:last-child { text-overflow: clip; }
  .worklist-grid .wl-line > .wl-sub { flex: 0 4 auto; }
}
@media (min-width: 901px) and (max-width: 1599px) {
  .worklist-grid .wl-c-reader { display: none; }
  .worklist-grid .wl-rep-reader { display: inline; margin-right: 0.4rem; font-size: 0.85rem; }
  .worklist-grid .wl-rep-reader + span .chip { margin-left: 0; }
  .worklist-grid th:nth-child(1):not(.wl-check), .worklist-grid .wl-check + th { width: 5.2rem; }
  .worklist-grid th.wl-c-rep { width: 6.8rem; }
}

/* 1.44.0 Reports: search + filters under the tabs */
.tab-n { color: var(--muted); font-weight: 400; font-size: 0.85em; }
.tabbar-tab.on .tab-n { color: inherit; opacity: 0.8; }
.rp-toolbar { margin-top: -0.4rem; }
.rp-search { flex: 0 1 22rem; min-width: 12rem; }
.rp-clear { margin-left: auto; }
.reports-grid td .two small.rp-snippet { color: var(--text); opacity: 0.75; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32rem; }
@media (max-width: 700px) { .rp-toolbar { display: none; } }

/* 1.44.0 Q/R: node picker chip */
.node-pick .fm-btn.fm-need { border-color: var(--warn, #d99a1e); }
.node-pick-warn { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--warn, #d99a1e); color: #1a1205; font-size: 0.75rem; font-weight: 700; margin-left: 0.2rem; }
.node-pick-panel { width: min(24rem, 92vw); }
.node-pick-panel .fm-list { max-height: 24rem; }
.node-pick-group + .node-pick-group { margin-top: 0.4rem; }
.node-pick-head { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.4rem 0.15rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.node-pick-head .btn-link { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
.node-pick-item .fm-name { display: inline-flex; align-items: center; gap: 0.4rem; }
.node-pick-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; border-top: 1px solid var(--rule); padding-top: 0.5rem; font-size: 0.85rem; }
/* 1.44.0: day stepper arrows are real 36 × 36 targets */
.ris-daynav .day-step { width: 2.25rem; height: 2.25rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: 8px; font-size: 1.15rem; color: var(--text); }
.ris-daynav .day-step:hover:not(:disabled) { border-color: var(--accent); }
@media (min-width: 901px) { .rail-heading, .rail-fold { font-size: 0.75rem; } }
/* 1.44.0: one line of help + Learn more */
.more > p { margin: 0; }
.more-link { font-size: inherit; padding: 0; }
.more-body { margin-top: 0.35rem; }
.more-body p { margin: 0 0 0.35rem; }
.cloud-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.cloud-bar .query-compact { flex: 1 1 28rem; margin: 0.6rem 0; }
.cloud-bar .page-head-actions { margin-left: auto; }
/* 1.44.0: empty states fill the list's width (they looked like a stray narrow card) */
@media (min-width: 901px) { .page > .empty, .side-main > .empty, .tab-body .empty { max-width: none; text-align: center; padding: 2.5rem 2rem; } }
@media (min-width: 901px) {
  .worklist-page .ris-toolbar { gap: 0.4rem; }
  .worklist-page .ris-toolbar .seg button { padding-left: 0.7rem; padding-right: 0.7rem; }
  .worklist-page .ris-toolbar .fm-btn { padding: 0 0.7rem; }
}

/* ================================================================== 1.44.1 iPhone: the page itself scrolls
   (it used to scroll inside .m-body), so iOS's tap on the status bar scrolls back to the top. */
.m-shell { height: auto; min-height: 100dvh; overflow: visible; }
.m-shell .m-body { height: auto; min-height: 100dvh; overflow: visible; }
/* Full-screen phone screens and open sheets: the page behind stays still. */
html:has(.m-sheet-wrap), html:has(.rp-phone), html:has(.print-phone), html:has(.ipv-backdrop) { overflow: hidden; }
.m-sheet { overscroll-behavior: contain; }

/* 1.44.2: narrow desktop windows list the Worklist with the iPhone row instead of large cards. */
.wl-list2 { margin-top: 0.4rem; overflow: visible; }
.wl-row2 { position: relative; display: flex; align-items: center; border-top: 1px solid var(--m-line-soft); }
.wl-list2 > .wl-row2:first-child { border-top: 0; }
.wl-list2 > .wl-row2:first-child .wl-row2-main { border-radius: 16px 16px 0 0; }
.wl-row2-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 4px 9px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wl-row2-main:hover { background: color-mix(in srgb, var(--panel-2) 60%, var(--panel)); }
.wl-row2-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wl-row2 .m-r-t { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.wl-row2-id { font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row2 .wl-card-more { position: relative; flex: none; padding-right: 6px; }
.wl-row2.wl-card-stat { box-shadow: inset 3px 0 0 var(--bad); }
.wl-row2.wl-card-urgent { box-shadow: inset 3px 0 0 var(--m-amber); }
.wl-mod-more { font-size: 0.78rem; margin-left: 0.2rem; }
.wl-cloud-dot { color: var(--accent); font-size: 0.8rem; }
@media (min-width: 1600px) {
  .worklist-grid th.wl-c-fac1 { width: 12rem; }
  .worklist-grid th.wl-c-reader { width: 6.5rem; }
  .worklist-grid th.wl-c-rep { width: 6.5rem; }
}
/* 1.45.0: dcm4chee editing state on a node */
.d4c-state { color: var(--warn, #d99a1e); }
.d4c-state.ok { color: var(--ok); }
/* 1.45.0: Outside access (DICOMweb for other PACS) */
.gw-sub { display: block; font-size: 0.8rem; }
.gw-nodes { display: grid; gap: 0.35rem; max-height: 14rem; overflow: auto; padding: 0.2rem 0; }
.gw-copy { display: flex; align-items: center; gap: 0.5rem; }
.gw-copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 6px; padding: 0.4rem 0.55rem; font-size: 0.85rem; }
.gw-auth p { margin: 0 0 0.35rem; }
.gw-actions { justify-content: flex-end; margin-top: 1rem; }

/* 1.46.0: "Use previous report" bar above the report text */
.prev-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.5rem; padding: 0.45rem 0.6rem 0.45rem 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); background: var(--accent-soft); border-radius: var(--radius-s, 8px); font-size: 0.9rem; }
.prev-bar-text { flex: 1 1 16rem; min-width: 0; }
.prev-bar-used { border-color: color-mix(in srgb, var(--warn, #d99a1e) 55%, var(--rule)); background: color-mix(in srgb, var(--warn, #d99a1e) 12%, var(--panel)); }
.prev-bar-used > span { flex: 1 1 16rem; }
.prev-bar-x { font-size: 1.1rem; line-height: 1; padding: 0 0.4rem; }
.prev-preview { max-height: 60vh; overflow: auto; white-space: pre-wrap; }
@media (max-width: 700px) { .prev-bar-text, .prev-bar-used > span { flex-basis: 100%; } .prev-bar-x { margin-left: auto; } }

/* ------------------------------------------------------------------ 1.47.0 forms */
.note-warn { border-left-color: var(--warn, #d99a1e); background: color-mix(in srgb, var(--warn, #d99a1e) 12%, transparent); }
.ff-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0; }
.forms-admin > p { max-width: 80ch; }
.forms-grid { width: 100%; max-width: 60rem; }
.forms-grid th { text-align: left; }
.fe-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0.2rem 1rem; max-width: 70rem; }
.fe-head .field-wide, .fe-head > :nth-child(n + 3) { grid-column: 1 / -1; }
.fe-section { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.8rem 1rem 1rem; margin: 1rem 0; max-width: 70rem; }
.fe-sec-head { display: flex; align-items: center; gap: 0.4rem; }
.fe-sec-title { font-weight: 700; font-size: 1.02rem; flex: 0 1 24rem; }
.fe-note { width: 100%; max-width: 48rem; margin: 0.4rem 0 0.6rem; font-size: 0.9rem; }
.fe-fields { width: 100%; margin-bottom: 0.6rem; }
.fe-fields th { text-align: left; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.fe-fields td { padding: 0.2rem 0.3rem; vertical-align: middle; }
.fe-fields td:first-child input { width: 100%; min-width: 12rem; }
.fe-fields select, .fe-fields td:nth-child(3) input { width: 100%; }
.fe-fields td:nth-child(5) { text-align: center; }
.fe-unit { max-width: 7rem; }
.fe-preview { max-width: 58rem; border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 1rem 1.2rem; }
.ff-modal { width: min(64rem, 100%); }
.ff-who { display: flex; align-items: baseline; gap: 0.3rem; flex-wrap: wrap; margin: -0.4rem 0 0.6rem; }
.ff-state { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.ff-state.ok { color: var(--ok); }
.ff-scroll { max-height: calc(100vh - 16rem); overflow-y: auto; padding-right: 0.3rem; }
.ff-body fieldset.ff-section { border: 0; border-top: 1px solid var(--rule); padding: 0.6rem 0 0.8rem; margin: 0; }
.ff-section legend { font-weight: 700; padding-right: 0.5rem; }
.ff-note { margin: 0 0 0.5rem; font-size: 0.88rem; }
.ff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem 1rem; }
.ff-grid .ff-wide { grid-column: 1 / -1; }
.ff-field { display: flex; flex-direction: column; gap: 0.25rem; }
.ff-label { font-size: 0.86rem; color: var(--muted); }
.ff-field input, .ff-field textarea { width: 100%; box-sizing: border-box; }
.ff-hint { font-size: 0.8rem; }
.ff-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.15rem 1rem; margin-top: 0.6rem; }
.ff-multi { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.ff-check { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; padding: 0.2rem 0; }
.ff-check input { width: 1.05rem; height: 1.05rem; margin: 0; }
.ff-seg { align-self: flex-start; }
.ff-seg button { padding: 0.35rem 0.8rem; }
.ff-footer { font-size: 0.75rem; margin-top: 0.8rem; }
.ff-foot { margin-top: 0.9rem; border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.doc-pdf.draft { color: var(--muted); font-size: 0.66rem; }
.doc-link.btn-reset { background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.forms-pick { display: flex; flex-direction: column; align-items: stretch; gap: 0.2rem; border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 0.4rem; max-width: 26rem; }
.forms-pick-item { text-align: left; background: none; border: 0; padding: 0.45rem 0.6rem; border-radius: var(--radius-s); cursor: pointer; color: inherit; font: inherit; }
.forms-pick-item:hover, .forms-pick-item:focus-visible { background: var(--panel-2); }
.forms-pick-item.sep { border-top: 1px solid var(--rule); border-radius: 0; margin-top: 0.2rem; padding-top: 0.6rem; }
.forms-pick .btn-ghost { align-self: flex-start; }
.ris-forms h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
@media (max-width: 720px) {
  .fe-head { grid-template-columns: 1fr; }
  .ff-grid { grid-template-columns: 1fr; }
  .ff-scroll { max-height: none; }
}

/* 1.48.0 Radiology presets: "Try it" result */
.ad-try { white-space: pre-wrap; font: inherit; font-size: 0.9rem; background: var(--bg-soft, rgba(127,127,127,0.08)); border: 1px solid var(--border, rgba(127,127,127,0.25)); border-radius: 8px; padding: 0.6rem 0.75rem; margin: 0.4rem 0 0; }

/* 1.51.0: Copy studies from another PACS (pages/PacsCopy.tsx) */
.pc-h { margin: 1.3rem 0 0.5rem; font-size: 1rem; }
.pc-row { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; margin: 0.4rem 0; }
.pc-row > .spacer { flex: 1; }
.pc-row > .muted.small { flex: 1 1 22rem; align-self: center; }
.pc-row .field { margin: 0; }
.pc-job { margin: 0.5rem 0; }
.pc-months { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; padding: 0; }
.pc-m { display: flex; gap: 0.5rem; align-items: baseline; border: 1px solid var(--rule); border-radius: 8px; padding: 0.2rem 0.55rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pc-m.pc-waiting, .pc-m.pc-skipped { color: var(--muted); }
.pc-m.pc-asking { border-color: var(--accent); }
.pc-m.pc-error { border-color: var(--bad, #d9534f); }
.pc-m.pc-error b { color: var(--bad, #d9534f); }
.pc-table td.num, .pc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pc-table tfoot th { border-top: 1px solid var(--rule); }
.pc-modal .ak-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
