/*
 * AI-приёмная Smiledent — консоль сотрудника.
 *
 * One stylesheet, no build step, nothing loaded from outside. Every tunable value
 * is a custom property on :root. The look: a warm paper desk, white «slips», ink text,
 * one teal accent for the automation and for the primary action. Serif for names and
 * titles (the slip reads like a document), the system sans for everything else.
 * Colour never carries meaning alone — every state also has a word or an icon.
 */

:root {
  /* surface */
  --paper: #f3f1ec;
  --paper-2: #ebe8e1;
  --card: #ffffff;
  --card-2: #faf9f6;

  /* ink */
  --ink: #17252b;
  --ink-2: #3a4a52;
  --muted: #5b686f;

  /* lines */
  --line: #ddd8cd;
  --line-soft: #eae6dd;

  /* the automation and the primary action */
  --accent: #0f6b74;
  --accent-ink: #0a4f56;
  --accent-soft: #dceeee;
  --accent-tint: #eef6f6;
  --brand: var(--accent);

  /* meaning */
  --danger: #b3261e;
  --danger-ink: #8f1d17;
  --danger-tint: #fbe9e7;
  --warn: #8a5300;
  --warn-tint: #fcf0d4;
  --ok: #1e6b3a;
  --ok-tint: #e3f2e7;

  /* marks that are neither state nor action: separators, the rank and kind tints */
  --sep: #a9a398;
  --rank-high: #c98a1b;
  --rail-normal: #c2cbcd;
  --draft-tint: #f1e9d3;
  --draft-ink: #6b4f10;
  --failure-tint: #f6e0dd;

  /* type: a stack the device already has, chosen for Cyrillic UI text and a
     document serif for names and titles */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --font-doc: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --type-scale: 1;
  /* 13 — captions, mono and column heads; 14 — secondary running text (design audit
     2026-11-27: 13px running text and 12px identifiers read too small) */
  --fs-1: calc(13px * var(--type-scale));
  --fs-2: calc(14px * var(--type-scale));
  --fs-3: calc(15px * var(--type-scale));
  --fs-4: calc(18px * var(--type-scale));
  --fs-5: calc(24px * var(--type-scale));
  --fs-6: calc(32px * var(--type-scale));
  --lh: 1.5;
  --lh-tight: 1.2;

  /* space: the dense dashboard scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* shape */
  --radius: 10px;
  --radius-s: 6px;
  --radius-l: 14px;
  --shadow-1: 0 1px 2px rgba(23, 37, 43, 0.06), 0 0 0 1px rgba(23, 37, 43, 0.02);
  --shadow-2: 0 12px 28px -14px rgba(23, 37, 43, 0.28), 0 2px 6px rgba(23, 37, 43, 0.06);
  --shadow-3: 0 24px 56px -20px rgba(23, 37, 43, 0.35);

  /* motion: subtle — state changes, nothing decorative */
  --t-1: 120ms;
  --t-2: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);

  /* layout */
  --topbar-h: 56px;
  --list-w: 420px;
  --reader-max: 880px;
  /* the page and the bars keep this much from the window edge: 24 on a desk, 16 on a phone */
  --gutter: 24px;
  --theme: light;
}

/* ----------------------------------------------------------------- foundation */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--fs-3) / var(--lh) var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, blockquote, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-s); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
}

/* The first tab stop: straight to the content, shown only when it has the focus. */
.skip {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 30;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: var(--sp-2); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--font-mono); font-size: max(13px, 0.92em); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: var(--fs-2); }
.is-overdue { color: var(--danger); font-weight: 600; }

.page { flex: 1; min-height: 0; padding: var(--sp-5) var(--gutter) var(--sp-8); }
/* The queue is a work surface, not a document: it is pinned to the window and the two
   columns scroll on their own (on a phone it is a document again, see below). */
body.body--fixed { height: 100dvh; overflow: hidden; }
/* Document pages never scroll sideways: a wide table scrolls inside its own wrap.
   `clip`, not `hidden` — a hidden overflow still lets the page be dragged sideways. */
.page--wide, .page--narrow { overflow-x: clip; }
.page--narrow { display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; }

.demo-banner {
  padding: var(--sp-1) var(--sp-4);
  background: repeating-linear-gradient(135deg, #fff6d6 0 14px, #fff1c4 14px 28px);
  color: #5d4300;
  font-size: var(--fs-2);
  text-align: center;
}

/* --------------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--topbar-h);
  padding: var(--sp-2) var(--gutter);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--accent); text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-doc); font-size: var(--fs-4); font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.brand__sub { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease);
}
.nav__link:hover { background: var(--paper-2); color: var(--ink); }
.nav__link.is-active { background: var(--ink); color: #fff; }
.nav__count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav__link.is-active .nav__count { background: #fff; color: var(--ink); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2); color: var(--muted); white-space: nowrap; }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: breathe 2.8s ease-in-out infinite; }
.live.is-stale { color: var(--danger); }
.live.is-stale .live__dot { background: var(--danger); animation: none; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.who { display: inline-flex; align-items: center; gap: var(--sp-2); color: inherit; text-decoration: none; }
.who__avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-doc);
  font-weight: 700;
}
.who__text { display: flex; flex-direction: column; line-height: 1.2; }
.who__name { font-weight: 600; font-size: var(--fs-2); }
.who__role { font-size: var(--fs-1); color: var(--muted); }

/* The two switches of the top bar: system notifications and the chime. On = the
   accent; «denied» = the browser refused and only its own settings can change that. */
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease);
}
.iconbtn:hover { background: var(--paper-2); color: var(--ink); }
.iconbtn.is-on { background: var(--accent-soft); color: var(--accent-ink); }
.iconbtn.is-denied { color: var(--muted); opacity: 0.6; }
.iconbtn[hidden] { display: none; }

.logout { display: contents; }

/* -------------------------------------------------------------------- controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-1) var(--ease), border-color var(--t-1) var(--ease), color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.btn:hover { background: var(--card-2); border-color: #c8c1b2; color: var(--ink); }
.btn:active { transform: translateY(1px); }
/* Everything else a finger or a mouse presses answers the same instant: the fill darkens
   a step. Nothing moves, so no layout shifts. */
.row:active { background: var(--accent-tint); }
.tab:active, .chip:active, .nav__link:active, .jump a:active, .who:active { background: var(--paper-2); color: var(--ink); }
.tab.is-active:active, .nav__link.is-active:active { background: var(--ink); color: #fff; }
.linkbtn:active { color: var(--accent); }
/* A form that has been sent shows it while the page is on its way. */
.is-busy { opacity: 0.72; }
.is-busy .btn { cursor: progress; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn--danger { color: var(--danger); border-color: #e2b6b2; }
.btn--danger:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger-ink); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--paper-2); border-color: transparent; }
.btn--s { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-2); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--fs-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.field__label { font-size: var(--fs-2); font-weight: 600; color: var(--ink-2); }
.field__input, .draft__text, .menu__note, .notebox__text {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  line-height: var(--lh);
}
.field__input { min-height: 42px; }
textarea.field__input, .draft__text, .menu__note, .notebox__text { resize: vertical; min-height: 64px; }
.field__input::placeholder, .menu__note::placeholder, .notebox__text::placeholder { color: #647077; opacity: 1; } /* 4.9:1 on white */
.field__input:focus-visible, .draft__text:focus-visible, .menu__note:focus-visible, .notebox__text:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

.stack > * + * { margin-top: 0; }

.radio { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; cursor: pointer; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: var(--fs-1);
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}
.tag--urgent { background: var(--danger-tint); color: var(--danger-ink); }
.tag--high { background: var(--warn-tint); color: var(--warn); }
.tag--risk { background: var(--danger); color: #fff; }
.tag--state { background: var(--paper-2); color: var(--ink-2); }
.tag--ok { background: var(--ok-tint); color: var(--ok); }

.notice { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); margin-bottom: var(--sp-4); font-weight: 500; }
.notice--error { background: var(--danger-tint); color: var(--danger-ink); }
.notice--warn { background: var(--warn-tint); color: var(--warn); }

/* ------------------------------------------------------------------------ login */
.body--login .login { flex: 1; display: grid; place-items: center; padding: var(--sp-6); }
.login__card {
  width: min(440px, 100%);
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-3);
}
.login__mark { width: 44px; height: 44px; color: var(--accent); margin-bottom: var(--sp-4); }
.login__brand { font-size: var(--fs-2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.login__title { font-family: var(--font-doc); font-size: var(--fs-6); line-height: var(--lh-tight); font-weight: 600; margin-top: var(--sp-2); }
.login__lead { color: var(--ink-2); margin-top: var(--sp-3); margin-bottom: var(--sp-6); }
.login__form { margin-top: var(--sp-2); }
.login__help { margin-top: var(--sp-5); font-size: var(--fs-2); color: var(--muted); }

/* ----------------------------------------------------------------------- queue */
.page--queue { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

.queuebar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--gutter) var(--sp-3);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.queuebar__title { font-family: var(--font-doc); font-size: var(--fs-5); font-weight: 600; line-height: 1.1; white-space: nowrap; }
.tabs { display: flex; align-items: center; gap: var(--sp-1); overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease);
}
.tab:hover { background: var(--paper-2); color: var(--ink); }
.tab.is-active { background: var(--ink); color: #fff; }
.tab__n { font-variant-numeric: tabular-nums; font-weight: 700; opacity: 0.85; }
.tab--alert:not(.is-active) { color: var(--danger); }
.tab--alert:not(.is-active) .tab__n { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; opacity: 1; }

.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--list-w) minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-4);
}

.queue {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.kinds { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-soft); }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--fs-2);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-1) var(--ease), border-color var(--t-1) var(--ease);
}
.chip:hover { background: var(--card-2); color: var(--ink); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.rows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.rows__item { margin: 0; }

.row {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rail); }
.row--urgent { --rail: var(--danger); }
.row--high { --rail: var(--rank-high); }
.row--normal { --rail: var(--rail-normal); }
.row:hover { background: var(--card-2); color: inherit; }
.row.is-selected { background: var(--accent-tint); box-shadow: inset 0 0 0 1px rgba(15, 107, 116, 0.28); }
.row.is-overdue { background: linear-gradient(90deg, rgba(179, 38, 30, 0.07), rgba(179, 38, 30, 0) 55%); }
.row.is-overdue.is-selected { box-shadow: inset 0 0 0 1px rgba(179, 38, 30, 0.35); }
.row:focus-visible { outline-offset: -2px; z-index: 1; }

.row__body { flex: 1; min-width: 0; }
.row__top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px var(--sp-2); }
.row__name { font-weight: 600; }
.row__phone { color: var(--muted); font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.row__title { display: block; margin-top: 1px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 2px; font-size: var(--fs-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.row__dot { color: var(--sep); }
.row__overdue { color: var(--danger); font-weight: 600; }
.row__due.is-soon { color: var(--warn); font-weight: 600; }
.row__owner { background: var(--paper-2); border-radius: 999px; padding: 0 8px; color: var(--ink-2); font-weight: 500; }
.row__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-2);
  overflow-wrap: anywhere;
}

.row__kind {
  flex: none;
  width: 28px; height: 28px;
  margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 8px;
}
.kind-question, .kind-task { background: var(--accent-soft); color: var(--accent-ink); }
.kind-draft { background: var(--draft-tint); color: var(--draft-ink); }
.kind-failure { background: var(--failure-tint); color: var(--danger-ink); }

.empty { padding: var(--sp-10) var(--sp-6); text-align: center; color: var(--muted); }
.empty__icon { color: var(--ok); margin-bottom: var(--sp-3); }
.empty__title { font-family: var(--font-doc); font-size: var(--fs-4); color: var(--ink); }
.empty__text { margin-top: var(--sp-1); font-size: var(--fs-2); }

/* ---------------------------------------------------------------------- reader */
.reader { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.reader__empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-family: var(--font-doc);
  font-size: var(--fs-4);
}

/* ------------------------------------------------------------------------ slip */
.handoffbar { padding-bottom: var(--sp-3); }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.crumb:hover { color: var(--accent); }
.handoffstage { display: flex; flex-direction: column; width: min(100%, var(--reader-max)); margin: 0 auto; }

.slip {
  position: relative;
  width: min(100%, var(--reader-max));
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.slip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); background: var(--rail, transparent); }
.slip.is-overdue { --rail: var(--danger); }

.slip__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6) var(--sp-4); }
.slip__kicker { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.slip__kind { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-1); font-weight: 700; line-height: 22px; }
.slip__name { font-family: var(--font-doc); font-size: var(--fs-5); line-height: var(--lh-tight); font-weight: 600; overflow-wrap: anywhere; }
.slip__contact { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-2); }
.slip__phone { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.slip__sep { color: var(--sep); }
.slip__amo { display: inline-flex; align-items: center; gap: 3px; }
.owner {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: var(--fs-2);
  font-weight: 500;
  white-space: nowrap;
}
.owner--mine { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.owner--none { background: var(--warn-tint); color: var(--warn); }

.slip__ask { padding: var(--sp-4) var(--sp-6) var(--sp-5); background: var(--card-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.slip__title { font-family: var(--font-doc); font-size: var(--fs-5); line-height: var(--lh-tight); font-weight: 600; }
.slip__instruction { margin-top: var(--sp-2); color: var(--ink-2); }
.slip__clock { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--sp-2); margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-2); font-variant-numeric: tabular-nums; }

.patient-state {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  margin: var(--sp-4) var(--sp-6) 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-weight: 500;
}
.patient-state .icon { margin-top: 3px; }
.patient-state--warn { background: var(--warn-tint); color: var(--warn); }
.patient-state--ok { background: var(--ok-tint); color: var(--ok); }
.patient-state--neutral { background: var(--paper-2); color: var(--ink-2); }

.slip__sec { padding: var(--sp-5) var(--sp-6); }
.slip__sec + .slip__sec { border-top: 1px solid var(--line-soft); }
.slip__h { display: flex; align-items: baseline; gap: var(--sp-2); margin-bottom: var(--sp-3); font-size: var(--fs-1); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.slip__hnote { font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.slip__note { margin-top: var(--sp-3); font-size: var(--fs-2); color: var(--ink-2); }
.slip__tech { margin-top: var(--sp-3); padding: var(--sp-3); background: var(--card-2); border-radius: var(--radius-s); font-size: var(--fs-2); color: var(--ink-2); overflow-wrap: anywhere; }
.slip__tech code { font-family: var(--font-mono); font-size: max(13px, 0.92em); }
.slip__quote { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius-s) var(--radius-s) 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-4); line-height: 1.45; }
.slip__quote.is-muted { border-left-color: var(--line); background: var(--card-2); color: var(--ink-2); }

/* chat */
.chat { display: flex; flex-direction: column; gap: var(--sp-2); }
.chat__earlier summary { cursor: pointer; color: var(--accent-ink); font-size: var(--fs-2); font-weight: 500; padding: var(--sp-1) 0; }
.chat__earlier[open] summary { margin-bottom: var(--sp-2); }
.chat__earlier .bubble { opacity: 0.92; }
.chat__gap { height: var(--sp-1); }
.bubble { max-width: 82%; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); background: var(--paper-2); }
.bubble--in { align-self: flex-start; border-bottom-left-radius: var(--radius-s); }
.bubble--out { align-self: flex-end; border-bottom-right-radius: var(--radius-s); }
.bubble--staff { background: var(--accent-soft); }
.bubble--bot { background: #e6e8ea; }
.bubble--ai { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.bubble__who { display: block; font-size: var(--fs-1); font-weight: 700; color: var(--muted); }
.bubble__text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble__time { display: block; margin-top: 2px; font-size: var(--fs-1); color: var(--muted); font-variant-numeric: tabular-nums; }
.bubble--trigger { max-width: 92%; background: var(--ink); color: #fff; border-bottom-left-radius: var(--radius-s); }
.bubble--trigger .bubble__who, .bubble--trigger .bubble__time { color: rgba(255, 255, 255, 0.72); }
.bubble--trigger .bubble__text { font-size: var(--fs-4); line-height: 1.45; }

/* draft */
.slip__sec--draft { background: var(--card-2); }
.draft { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
.draft__text { font-size: var(--fs-4); line-height: 1.45; background: var(--card); min-height: 96px; overflow: hidden; }
.draft__hint { font-size: var(--fs-2); color: var(--muted); }
.draft__reject { margin-top: var(--sp-3); }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: var(--sp-2); }
.timeline__step { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; }
.timeline__dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--rail-normal); }
.timeline__step--ok .timeline__dot { background: var(--ok); }
.timeline__step--warn .timeline__dot { background: var(--warn); }
.timeline__text { overflow-wrap: anywhere; }
.timeline__step--warn .timeline__text { color: var(--warn); font-weight: 500; }
.timeline__time { color: var(--muted); font-size: var(--fs-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* facts + history */
.facts { display: grid; gap: var(--sp-1); }
.facts__row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-1) 0; }
.facts dt { color: var(--muted); }
.facts dd { overflow-wrap: anywhere; }

.history { display: flex; flex-direction: column; }
.history__item { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr) auto; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line-soft); align-items: baseline; }
.history__item:first-child { border-top: 0; }
.history__who { font-weight: 600; }
.history__who--auto { color: var(--accent-ink); }
.history__what { overflow-wrap: anywhere; }
.history__time { color: var(--muted); font-size: var(--fs-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.notebox { margin-top: var(--sp-4); }
.notebox__row { display: flex; gap: var(--sp-2); align-items: flex-start; margin-top: var(--sp-1); }
.notebox__row .btn { flex: none; margin-top: 4px; }

/* actions */
.slip__actions {
  position: static;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -6px 16px -12px rgba(23, 37, 43, 0.28);
}
.act { display: contents; }
/* The one decisive action keeps its full size; the rest are compact, so a coordinator's
   five controls stay on one line of the 880 px slip. */
.slip__actions .btn:not(.btn--primary) { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-2); }
.slip__actions .btn--danger { padding-inline: var(--sp-3); }
.slip__actions-sep { width: 1px; height: 22px; background: var(--line); margin: 0 var(--sp-1); }
.slip__elsewhere, .slip__closed { color: var(--ink-2); }

.act--menu { position: relative; display: inline-block; }
.menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + var(--sp-2));
  z-index: 40;
  width: 300px;
  max-width: calc(100vw - var(--sp-6));
  padding: var(--sp-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.menu legend { padding: 0; margin-bottom: var(--sp-1); }
.menu__group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.menu__note { min-height: 56px; font-size: var(--fs-2); }
.act--menu:last-child .menu, .act--menu:nth-last-child(2) .menu { left: auto; right: 0; }

/* ---------------------------------------------------------------------- panels */
.pagehead { width: min(100%, var(--reader-max)); margin: 0 auto var(--sp-5); }
.pagehead__title { font-family: var(--font-doc); font-size: var(--fs-6); line-height: var(--lh-tight); font-weight: 600; }
.pagehead__lead { margin-top: var(--sp-2); color: var(--muted); }
/* The sections of a long page as one line of links under its heading (the page is
   three screens tall; the audit asked for a way to jump). */
.jump { width: min(100%, var(--reader-max)); margin: calc(-1 * var(--sp-2)) auto var(--sp-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-2); }
.jump__title { color: var(--muted); margin-right: var(--sp-1); }
.jump a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.jump a:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.panel__h { scroll-margin-top: calc(var(--topbar-h) + var(--sp-3)); }

.cols { width: min(100%, var(--reader-max)); margin: 0 auto var(--sp-5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-5); width: min(100%, var(--reader-max)); margin-left: auto; margin-right: auto; }
.cols .panel { width: auto; margin: 0; }
.panel__h { font-family: var(--font-doc); font-size: var(--fs-4); font-weight: 600; margin-bottom: var(--sp-4); }
.panel__hnote { font-family: var(--font-ui); font-size: var(--fs-2); font-weight: 500; color: var(--muted); margin-left: var(--sp-2); }
.panel__empty { color: var(--muted); }

.flags { display: flex; flex-direction: column; }
.flag { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); }
.flag:first-child { border-top: 0; }
.flag__dot { width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--rail-normal); }
.flag.is-on .flag__dot { background: var(--ok); }
.flag.is-off .flag__dot { background: var(--danger); }
.flag__body { display: flex; flex-direction: column; }
.flag__name { font-weight: 600; }
.flag__hint { color: var(--muted); font-size: var(--fs-2); }
.flag__state { color: var(--muted); font-size: var(--fs-2); white-space: nowrap; font-weight: 500; }
.flag.is-on .flag__state { color: var(--ok); }
.flag.is-off .flag__state { color: var(--danger); }
.flag.is-static .flag__dot { background: var(--accent); }
.flag.is-static .flag__state { color: var(--accent-ink); }
.feed__link { align-self: flex-start; font-weight: 600; }

.beats { display: flex; flex-direction: column; gap: var(--sp-2); }
.beat { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: var(--sp-3); align-items: baseline; }
.beat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.beat.is-silent .beat__dot { background: var(--danger); }
.beat__name { font-weight: 600; }
.beat__name .mono { font-weight: 500; color: var(--muted); margin-left: var(--sp-2); }
.beat__age { grid-column: 2; color: var(--muted); font-size: var(--fs-2); }

.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); }
.feed__item:first-child { border-top: 0; }
.feed__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed__title { font-weight: 600; }
.feed__item--critical .feed__title { color: var(--danger-ink); }
.feed__item--critical .feed__title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--danger); vertical-align: 1px; }
.feed__item--warning .feed__title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #c98a1b; vertical-align: 1px; }
.feed__detail { color: var(--muted); font-size: var(--fs-2); font-family: var(--font-mono); overflow-wrap: anywhere; }
.feed__time { color: var(--muted); font-size: var(--fs-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.table th, .table td { padding: var(--sp-2) var(--sp-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
.table thead th { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table tbody th { font-weight: 500; }
.table--counts td, .table--counts th { font-variant-numeric: tabular-nums; text-align: right; }
.table--counts tbody th, .table--counts thead th:first-child { text-align: left; }
.table__name { font-weight: 600; font-size: var(--fs-3); white-space: nowrap; }
.table__actions { white-space: nowrap; }
.table__actions form { display: inline-flex; margin-right: var(--sp-1); }
.table tr.is-off td { color: var(--muted); }
.tablewrap { max-width: 100%; overflow-x: auto; }

.authlog__item { padding: var(--sp-2) 0; }

.sessions { display: flex; flex-direction: column; margin-bottom: var(--sp-4); }
.session { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line-soft); }
.session:first-child { border-top: 0; }
.session__main { display: flex; flex-direction: column; min-width: 0; }
.session__addr { font-weight: 600; }
.session__ua { color: var(--muted); font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session__meta { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: var(--fs-2); white-space: nowrap; }

.authlog { display: flex; flex-direction: column; }
.authlog__item { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-1) 0; font-size: var(--fs-2); border-top: 1px solid var(--line-soft); }
.authlog__item:first-child { border-top: 0; }
.authlog__time { color: var(--muted); font-variant-numeric: tabular-nums; }
.authlog__who { font-weight: 600; }
.authlog__what { color: var(--ink-2); }

/* ------------------------------------------------------------------------ error */
.errorbox { text-align: center; padding: var(--sp-10) var(--sp-8); }
.errorbox__code { font-family: var(--font-mono); color: var(--accent); font-weight: 700; letter-spacing: 0.1em; }
.errorbox__title { font-family: var(--font-doc); font-size: var(--fs-5); margin-top: var(--sp-2); }
.errorbox__text { color: var(--ink-2); margin: var(--sp-3) auto var(--sp-6); max-width: 44ch; }

/* ------------------------------------------------------------------------ toast */
/* Top right, under the bar: the tabs are at the top centre and the actions at the
   bottom; a phone gets the full width (below). */
.toast {
  position: fixed;
  right: var(--sp-5);
  top: calc(var(--topbar-h) + var(--sp-3));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: min(460px, calc(100vw - var(--sp-10)));
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-3);
  font-weight: 500;
  animation: rise var(--t-2) var(--ease);
}
.toast--error { background: var(--danger-ink); }
.toast--password { background: var(--ink); }
.toast__text { overflow-wrap: anywhere; }
.toast__copy { background: rgba(255, 255, 255, 0.12); border-color: transparent; color: #fff; }
.toast__copy:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.toast__close { border: 0; background: none; color: rgba(255, 255, 255, 0.7); font-size: var(--fs-4); line-height: 1; cursor: pointer; padding: 4px; }
.toast__close:hover { color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------------- responsive */
@media (min-width: 1280px) {
  :root { --list-w: 464px; }
}

/* The slip is a column on every screen: its body scrolls on its own and the action bar
   stands under it, so nothing is ever covered. (The bar used to stick over the body
   and hide the bottom of the draft form until the reader scrolled — design audit
   2026-11-27.) In the queue this holds on a desk; on a phone the queue is a list and
   the slip opens on its own page, which is pinned to the window for the same reason. */
.handoffstage > .slip { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* Only the body gives way when the slip is taller than its pane; the bar keeps its height. */
.slip__body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.slip__actions { flex: none; }
.page--handoff { display: flex; flex-direction: column; overflow: hidden; }
.page--handoff .handoffstage { flex: 1; min-height: 0; }

@media (min-width: 760px) {
  .page--queue .reader { display: flex; flex-direction: column; overflow: hidden; }
  .reader > .slip { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  /* The profile: the password form is the tall one; sessions and access stack beside
     it and stretch to its height, so no void is left under the shorter card. */
  .cols--profile { grid-template-rows: auto auto; align-items: stretch; }
  .cols--profile > .panel:first-child { grid-row: 1 / span 2; }
  .cols--profile > .panel:nth-child(2) { grid-column: 2; grid-row: 1; }
  .cols--profile > .panel--access { grid-column: 2; grid-row: 2; }
}

@media (max-width: 1180px) {
  :root { --list-w: 360px; }
  .live { display: none !important; }
}

@media (max-width: 759px) {
  :root { --fs-3: calc(16px * var(--type-scale)); }

  body { font-size: var(--fs-3); }
  :root { --gutter: 16px; }

  .topbar { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--gutter); }
  .brand__sub { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; gap: 2px; }
  .nav__link { min-height: 40px; }
  .topbar__right { gap: var(--sp-2); }
  .who__text { display: none; }

  .page { padding: var(--sp-4) var(--gutter) var(--sp-8); }
  body.body--fixed:not(.body--handoff) { height: auto; min-height: 100dvh; overflow: visible; }
  .page--handoff { padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); }
  .page--queue { padding: 0; overflow: visible; }
  .queuebar { flex-direction: column; align-items: stretch; gap: var(--sp-2); padding: var(--sp-3) var(--gutter) var(--sp-2); }
  .queuebar__title { font-size: var(--fs-4); }
  .board { display: block; padding: var(--sp-3) var(--gutter); }
  .page--queue .reader { display: none; }
  .queue { min-height: 60vh; }

  .row { padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); }
  .row__title { white-space: normal; }

  .slip::before { width: 3px; }
  .slip__head { flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-3); }
  .slip__name { font-size: var(--fs-4); }
  .slip__ask, .slip__sec { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .patient-state { margin-left: var(--sp-4); margin-right: var(--sp-4); }
  .bubble { max-width: 94%; }

  .toast { left: var(--gutter); right: var(--gutter); max-width: none; }

  /* A thumb needs more than a line of text to hit: the text links of the slip get a
     target of their own on a narrow screen. */
  .linkbtn, .slip__amo { min-height: 32px; }
  /* The section links flow as pills; their heading stays for screen readers only. */
  .jump__title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* The five short columns of the day's counts fit a phone without scrolling sideways. */
  .table--counts th, .table--counts td { padding: var(--sp-2) 2px; }
  .table--counts thead th { white-space: normal; letter-spacing: 0; }
  /* The staff list is a stack of cards on a phone: six columns with buttons do not
     fit, and a table scrolling sideways dragged the whole page after it. */
  .table--staff thead { display: none; }
  .table--staff, .table--staff tbody, .table--staff tr, .table--staff th, .table--staff td { display: block; }
  .table--staff tr { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-soft); }
  .table--staff tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .table--staff td { padding: 2px 0; border: 0; }
  .table--staff .table__name { font-size: var(--fs-4); }
  .table--staff td[data-label]::before { content: attr(data-label); color: var(--muted); margin-right: var(--sp-2); }
  .table--staff td.mono { font-size: var(--fs-2); font-family: var(--font-ui); }
  .table--staff td.mono .mono { font-family: var(--font-mono); font-size: max(13px, 0.92em); }
  .table--staff td.table__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-3); }
  .table--staff td.table__actions form { margin-right: 0; }
  .table--staff .btn--s { min-height: 44px; }

  /* One row the thumb can swipe: a column of five buttons took half of a phone screen. */
  .slip__actions {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
  }
  .act { display: contents; }
  .act--menu { display: inline-block; flex: none; }
  /* As specific as the 36px rule of the bar above, and later: on a phone the bar's buttons are 44px. */
  .slip__actions .act .btn, .slip__actions .act--menu > summary.btn { width: auto; min-height: 44px; font-size: var(--fs-3); flex: none; }
  .slip__actions-sep { display: none; }
  .slip__elsewhere, .slip__closed { flex: 1 1 100%; }
  .menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + var(--sp-2));
    width: min(320px, calc(100vw - var(--sp-6)));
    margin: 0;
    padding: var(--sp-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
  }
  .act--menu:last-child .menu, .act--menu:nth-last-child(2) .menu { left: auto; right: 0; }
  /* A scrolling row clips its popovers: while a menu is open the bar wraps instead and
     the open menu becomes a full-width block above the buttons. */
  .slip__actions:has(details[open]) { overflow: visible; flex-wrap: wrap; }
  .slip__actions:has(details[open]) .act--menu[open] { flex: 1 0 100%; order: -1; }
  .slip__actions:has(details[open]) .act--menu[open] > summary { width: 100%; }
  .slip__actions:has(details[open]) .menu {
    position: static;
    width: auto;
    margin: var(--sp-2) 0 0;
    padding: var(--sp-3) 0 0;
    border: 0;
    box-shadow: none;
  }

  .history__item { grid-template-columns: minmax(0, 1fr) auto; }
  .history__who { grid-column: 1; }
  .history__what { grid-column: 1 / -1; }
  .history__time { grid-column: 2; grid-row: 1; }
  .facts__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .timeline__step { grid-template-columns: 12px minmax(0, 1fr); }
  .timeline__time { grid-column: 2; }

  .cols { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: var(--sp-4); }
  .login__card { padding: var(--sp-6) var(--sp-5); }
}

/* A phone on its side is wide but short: the bar becomes the one swipeable row of an
   upright phone, or it would take a third of the window. */
@media (max-height: 500px) and (min-width: 760px) {
  .slip__actions { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: var(--sp-2) var(--sp-3); gap: var(--sp-2); }
  .act { display: contents; }
  .act--menu { display: inline-block; flex: none; }
  .slip__actions .act .btn, .slip__actions .act--menu > summary.btn { width: auto; min-height: 44px; flex: none; }
  .slip__actions-sep { display: none; }
  .slip__elsewhere, .slip__closed { flex: 1 1 100%; }
  .slip__actions:has(details[open]) { overflow: visible; flex-wrap: wrap; }
  .slip__actions:has(details[open]) .act--menu[open] { flex: 1 0 100%; order: -1; }
  .slip__actions:has(details[open]) .act--menu[open] > summary { width: 100%; }
  .slip__actions:has(details[open]) .menu {
    position: static;
    width: auto;
    margin: var(--sp-2) 0 0;
    padding: var(--sp-3) 0 0;
    border: 0;
    box-shadow: none;
  }
}

/* A thumb needs 44px: every control of a touch screen gets them, the two icon
   switches of the top bar and the text links included. */
@media (pointer: coarse) {
  .btn, .btn--s, .tab, .chip, .nav__link, .slip__actions .btn:not(.btn--primary), .jump a { min-height: 44px; }
  .iconbtn { width: 44px; height: 44px; }
  .linkbtn { min-height: 44px; padding: var(--sp-2); margin: calc(-1 * var(--sp-2)); }
  .who { min-height: 44px; }
}

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

/* A field the form refused is named as such — by the outline too, not by colour alone. */
.field__input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 1px; }
