/* Doxymed — экраны приложения. Токены те же, что у сайта: больничная бумага и зелень формы. */
@font-face { font-family: "Onest"; font-weight: 400 700; font-display: swap; src: url("/fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 700; font-display: swap; src: url("/fonts/onest-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #fff; --surface: #f4f8f6; --surface-2: #d7e3de; --line: #c3d3cd; --field: #fff;
  --ink: #0d3a33; --muted: #4a6660; --accent: #0d3a33; --accent-ink: #e6eeeb; --accent-hover: #164f46;
  --bar: #0d3a33; --bar-ink: #e6eeeb; --bar-muted: #a9c4bc;
  --ok: #1f6f4a; --warn: #8a5a00; --bad: #a32020;
  --notice: #fff4d6; --notice-ink: #4d3500; --chip-ready: #fff0c2; --chip-ok: #cfe8da; --chip-bad: #f6d6d6; --chip-run: #d6e6f6;
  --now: #d7ebe3;
  --margin: clamp(1rem, 2.2vw, 2rem);
  --small: 0.875rem; --body: 1rem; --lead: 1.125rem; --h2: 1.25rem; --h1: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
}
/* тёмная тема: по настройке системы («Авто») или выбранная вручную */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1715; --surface: #15211e; --surface-2: #1e2e2a; --line: #2e423d; --field: #101a18;
    --ink: #dbe8e3; --muted: #93aaa3; --accent: #9fd6c4; --accent-ink: #0b2621; --accent-hover: #b8e2d4;
    --bar: #0a2a25; --bar-ink: #dbe8e3; --bar-muted: #93b3aa;
    --ok: #7fd1a6; --warn: #f0c46a; --bad: #f19a9a;
    --notice: #3a2f12; --notice-ink: #f3e2b8; --chip-ready: #4a3d12; --chip-ok: #173b2a; --chip-bad: #4a1d1d; --chip-run: #17324a;
    --now: #23403a;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1715; --surface: #15211e; --surface-2: #1e2e2a; --line: #2e423d; --field: #101a18;
    --ink: #dbe8e3; --muted: #93aaa3; --accent: #9fd6c4; --accent-ink: #0b2621; --accent-hover: #b8e2d4;
    --bar: #0a2a25; --bar-ink: #dbe8e3; --bar-muted: #93b3aa;
    --ok: #7fd1a6; --warn: #f0c46a; --bad: #f19a9a;
    --notice: #3a2f12; --notice-ink: #f3e2b8; --chip-ready: #4a3d12; --chip-ok: #173b2a; --chip-bad: #4a1d1d; --chip-run: #17324a;
    --now: #23403a;
}
/* палитры: у каждой светлая и тёмная тема; «Хвоя» — значения выше, у неё своих правил нет */
:root[data-palette="ocean"] { --surface: #f3f6fb; --surface-2: #d8e2f0; --line: #c2d0e3; --ink: #0e2a4a; --muted: #47607d; --accent: #0f3d73; --accent-ink: #e8f0fa; --accent-hover: #16508f; --bar: #0f3d73; --bar-ink: #e8f0fa; --bar-muted: #b4cae4; --now: #d6e5f5; }
@media (prefers-color-scheme: dark) { :root[data-palette="ocean"]:not([data-theme="light"]) { --bg: #0c131d; --surface: #131d2b; --surface-2: #1c2a3d; --line: #2d3f57; --field: #0e1622; --ink: #dbe6f2; --muted: #95a9c0; --accent: #9cc6f0; --accent-ink: #0a2340; --accent-hover: #b9d8f6; --bar: #0b2542; --bar-ink: #dbe6f2; --bar-muted: #93afcc; --now: #233b57; } }
:root[data-palette="ocean"][data-theme="dark"] { --bg: #0c131d; --surface: #131d2b; --surface-2: #1c2a3d; --line: #2d3f57; --field: #0e1622; --ink: #dbe6f2; --muted: #95a9c0; --accent: #9cc6f0; --accent-ink: #0a2340; --accent-hover: #b9d8f6; --bar: #0b2542; --bar-ink: #dbe6f2; --bar-muted: #93afcc; --now: #233b57; }
:root[data-palette="plum"] { --surface: #f8f4f9; --surface-2: #e6dbe9; --line: #d6c6da; --ink: #3a1640; --muted: #68506e; --accent: #4f1f5c; --accent-ink: #f4ebf6; --accent-hover: #662b76; --bar: #4f1f5c; --bar-ink: #f4ebf6; --bar-muted: #cdb3d4; --now: #eadcef; }
@media (prefers-color-scheme: dark) { :root[data-palette="plum"]:not([data-theme="light"]) { --bg: #150f17; --surface: #1f1723; --surface-2: #2c2131; --line: #423349; --field: #181119; --ink: #eadfee; --muted: #b19fb7; --accent: #d7b3e3; --accent-ink: #2e1136; --accent-hover: #e5cbee; --bar: #2f1538; --bar-ink: #eadfee; --bar-muted: #b89fc1; --now: #3d2a45; } }
:root[data-palette="plum"][data-theme="dark"] { --bg: #150f17; --surface: #1f1723; --surface-2: #2c2131; --line: #423349; --field: #181119; --ink: #eadfee; --muted: #b19fb7; --accent: #d7b3e3; --accent-ink: #2e1136; --accent-hover: #e5cbee; --bar: #2f1538; --bar-ink: #eadfee; --bar-muted: #b89fc1; --now: #3d2a45; }
:root[data-palette="graphite"] { --surface: #f5f6f7; --surface-2: #dfe2e5; --line: #cbd0d5; --ink: #1f2428; --muted: #565e66; --accent: #2b3138; --accent-ink: #eef0f2; --accent-hover: #3d454e; --bar: #2b3138; --bar-ink: #eef0f2; --bar-muted: #b4bbc2; --now: #e2e5e8; }
@media (prefers-color-scheme: dark) { :root[data-palette="graphite"]:not([data-theme="light"]) { --bg: #101214; --surface: #181b1e; --surface-2: #23272b; --line: #363c42; --field: #121417; --ink: #e4e7ea; --muted: #a0a8b0; --accent: #c4cbd2; --accent-ink: #1b1f23; --accent-hover: #d8dde2; --bar: #1c2024; --bar-ink: #e4e7ea; --bar-muted: #a3abb3; --now: #2e3439; } }
:root[data-palette="graphite"][data-theme="dark"] { --bg: #101214; --surface: #181b1e; --surface-2: #23272b; --line: #363c42; --field: #121417; --ink: #e4e7ea; --muted: #a0a8b0; --accent: #c4cbd2; --accent-ink: #1b1f23; --accent-hover: #d8dde2; --bar: #1c2024; --bar-ink: #e4e7ea; --bar-muted: #a3abb3; --now: #2e3439; }
:root[data-palette="terracotta"] { --surface: #fbf5f2; --surface-2: #efdfd7; --line: #e0cbc0; --ink: #4a1f10; --muted: #6f4c3a; --accent: #7a2e16; --accent-ink: #fbeee8; --accent-hover: #933a1d; --bar: #7a2e16; --bar-ink: #fbeee8; --bar-muted: #ecd0c2; --now: #f2e0d6; }
@media (prefers-color-scheme: dark) { :root[data-palette="terracotta"]:not([data-theme="light"]) { --bg: #18100c; --surface: #231813; --surface-2: #32231c; --line: #4a362c; --field: #1a120e; --ink: #f0e2da; --muted: #bba598; --accent: #eeb79e; --accent-ink: #3a1508; --accent-hover: #f4cdb9; --bar: #3f1a0c; --bar-ink: #f0e2da; --bar-muted: #c5a594; --now: #43302a; } }
:root[data-palette="terracotta"][data-theme="dark"] { --bg: #18100c; --surface: #231813; --surface-2: #32231c; --line: #4a362c; --field: #1a120e; --ink: #f0e2da; --muted: #bba598; --accent: #eeb79e; --accent-ink: #3a1508; --accent-hover: #f4cdb9; --bar: #3f1a0c; --bar-ink: #f0e2da; --bar-muted: #c5a594; --now: #43302a; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--body)/1.5 "Onest", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
h1 { font-size: var(--h1); line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: var(--h2); line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: var(--body); font-weight: 600; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; text-decoration: none; }

.bar { display: flex; align-items: center; gap: 2rem; padding: 0.9rem var(--margin); background: var(--bar); color: var(--bar-ink); }
.bar .wordmark { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.bar .wordmark span { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .wordmark img { display: block; height: 2.25rem; max-width: 9rem; object-fit: contain; flex: none; }
.bar-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: var(--small); font-weight: 500; }
.bar-nav a { text-decoration: none; opacity: 0.8; }
.bar-nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 0.3em; }
.bar-user { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: var(--small); }
.theme { display: inline-flex; gap: 1px; font-size: var(--small); font-weight: 500; }
.theme a { padding: 0.2rem 0.55rem; text-decoration: none; opacity: 0.75; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.theme a[aria-current] { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }
.bar-user a { opacity: 0.8; }
.bar-user .me { display: inline-flex; align-items: center; gap: 0.4rem; }
.bar-user .me svg { flex: none; }

.page { padding: 2rem var(--margin) 4rem; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.meta, .lead { color: var(--muted); font-size: var(--lead); margin-top: 0.35rem; }
.hint { color: var(--muted); font-size: var(--small); }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.empty { color: var(--muted); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.2rem; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 0; font: 500 var(--body)/1 "Onest", sans-serif; text-decoration: none; cursor: pointer; transition: transform 140ms ease, background-color 160ms ease; }
.button:hover { background: var(--accent-hover); }
.button:active { transform: scale(0.97); }
.button.ghost { background: var(--surface-2); color: var(--ink); }
.button.ghost:hover { background: var(--line); }
.button.small { min-height: 2.25rem; padding: 0 0.9rem; font-size: var(--small); }

.panel { background: var(--surface); padding: 1.25rem; display: grid; gap: 0.9rem; align-content: start; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.5rem; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 2.2fr) minmax(16rem, 1fr); }
.side { display: grid; gap: 1.5rem; }
.split > * { min-width: 0; }
.notice { background: var(--notice); color: var(--notice-ink); padding: 0.9rem 1rem; }
.error { color: var(--bad); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }

label { display: grid; gap: 0.35rem; font-weight: 500; font-size: var(--small); }
input, select, textarea { font: 400 var(--body)/1.4 "Onest", sans-serif; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 0; padding: 0.6rem 0.75rem; width: 100%; }
textarea { resize: vertical; }
textarea[data-autosize] { field-sizing: content; min-height: 2.75rem; resize: none; overflow: hidden; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
label.check { display: flex; align-items: center; gap: 0.6rem; font-weight: 400; font-size: var(--body); }
label.check input { width: 1.2rem; height: 1.2rem; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
fieldset.choice legend { font-weight: 500; font-size: var(--small); padding: 0; margin-bottom: 0.35rem; width: 100%; }
fieldset.choice label { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; font-size: var(--body); }
fieldset.choice input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 24rem)); gap: 1.1rem 1.5rem; background: var(--surface); padding: 1.5rem; }
.form-grid .wide { grid-column: 1 / -1; }
.block-rule { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.palettes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.palettes legend { padding: 0; margin-bottom: 0.35rem; font-weight: 500; font-size: var(--small); }
.palette { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); background: var(--field); font-weight: 500; cursor: pointer; }
.palette:has(input:checked) { border-color: var(--ink); outline: 1px solid var(--ink); }
.palette input { width: auto; margin: 0; }
.swatch { display: inline-flex; width: 2.25rem; height: 1.25rem; border: 1px solid var(--line); flex: none; }
.swatch i { flex: 1; }
.brand { margin-top: 1.5rem; max-width: 50rem; }
.logo-now { display: flex; align-items: center; gap: 0.5rem; }
.button.logo-x { width: 2.25rem; padding: 0; font-size: 1.5rem; line-height: 1; }
.brand-now { height: 3rem; max-width: 12rem; object-fit: contain; border: 1px solid var(--line); padding: 0.25rem; }
.stack { display: grid; gap: 1rem; }
.narrow { max-width: 24rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* таблицы — фрагменты интерфейса */
.table-wrap { overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--small); }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); }
td a { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
details summary { cursor: pointer; }
table.stages { margin-top: 0.4rem; min-width: 26rem; background: var(--surface-2); }
table.stages td { padding: 0.35rem 0.6rem; text-align: left; }
table.stages td.num { text-align: right; white-space: nowrap; }
.status { display: inline-block; padding: 0.15rem 0.5rem; background: var(--surface-2); font-size: var(--small); font-weight: 500; }
.s-ready, .s-transcribed { background: var(--chip-ready); }
.s-confirmed { background: var(--chip-ok); color: var(--ok); }
.s-error { background: var(--chip-bad); color: var(--bad); }
.s-processing, .s-queued, .s-queued_llm { background: var(--chip-run); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.stats div { background: var(--surface); padding: 1rem 1.25rem; }
.stats dt { color: var(--muted); font-size: var(--small); }
.stats dd { margin: 0.2rem 0 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.checks { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.checks li::before { content: "●"; margin-right: 0.5rem; }
.checks .ok::before { color: var(--ok); }
.checks .off::before { color: var(--line); }
.checks .bad::before { color: var(--bad); }

/* приём */
.recorder { display: grid; gap: 0.9rem; }
.timer { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.level { height: 8px; background: var(--surface-2); }
.level span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 80ms linear; }
.recording .timer { color: var(--bad); }
.file-up label { font-weight: 400; }
.qr img { width: 180px; height: 180px; background: #fff; padding: 6px; }  /* QR-код всегда на белом: так его читают камеры */
.files, .refs { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.files span, .refs span { display: block; color: var(--muted); font-size: var(--small); }
.extras { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; background: var(--chip-run); font-size: var(--small); font-weight: 500; }
.extras.done { background: var(--chip-ok); color: var(--ok); }
.spin { width: 0.9rem; height: 0.9rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.9s linear infinite; }
.extras.done .spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hints { padding-left: 1.1rem; display: grid; gap: 0.4rem; font-size: var(--small); }
.pbar { height: 14px; background: var(--surface-2); overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--accent); transition: width 1.4s linear; }
.processing .lead b { font-size: 1.75rem; font-variant-numeric: tabular-nums; margin-right: 0.5rem; }
.steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: var(--small); }
.steps li { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.steps li::before { content: ""; width: 0.6rem; height: 0.6rem; border: 2px solid currentColor; border-radius: 50%; }
.steps .step-done { color: var(--ok); }
.steps .step-done::before { background: currentColor; }
.steps .step-now { color: var(--ink); font-weight: 600; }
.steps .step-now::before { border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { background: var(--accent); } }
.processing .lead { color: var(--ink); font-weight: 500; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tabs a { padding: 0.55rem 0.9rem; background: var(--surface-2); text-decoration: none; font-size: var(--small); font-weight: 500; }
.tabs a[aria-current] { background: var(--ink); color: var(--accent-ink); }
.tabs .edited { font-weight: 400; opacity: 0.8; }
.record-form { display: grid; gap: 1.25rem; background: var(--surface); padding: 1.25rem; }
.record-form .field > label, .record-form .field > .label { font-size: var(--body); font-weight: 600; }
.doc-on > label, .doc-on > textarea { display: none; }
.doc-text { display: grid; gap: 0.3rem; line-height: 1.6; cursor: text; background: var(--field); border: 1px solid var(--line); padding: 1rem 1.1rem; }
.doc-text:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.doc-text h3 { margin-top: 1.1rem; cursor: default; user-select: text; }
.doc-text h3:first-child { margin-top: 0; }
.doc-body { position: relative; min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-body.blank::before { content: attr(data-hint); position: absolute; inset: 0 0 auto; color: var(--muted); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-form label > .hint { font-weight: 400; }
.record { background: var(--surface); padding: 1.25rem; display: grid; gap: 0.4rem; }
.record h3 { margin-top: 0.6rem; }
.code { display: inline-block; padding: 0.05rem 0.4rem; background: var(--accent); color: var(--accent-ink); font-size: var(--small); font-weight: 500;
  font-variant-numeric: tabular-nums; text-decoration: none; }
a.code:hover { background: var(--accent-hover); }
.code-lg { font-size: 0.8em; padding: 0.1rem 0.5rem; vertical-align: 0.15em; }
.pre { white-space: pre-line; }
.variant-title { font-size: var(--h2); }
.mkb-list { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.25rem 0; font-size: var(--small); color: var(--muted); }
.crumbs a { margin-right: 1rem; text-decoration: none; }
.crumbs a + a::before { content: "›"; margin-right: 1rem; color: var(--muted); }
.crumbs a:hover { text-decoration: underline; }

/* метки: коды МКБ-10 и коды страховой */
.field { display: grid; gap: 0.35rem; }
.field > label, .field > .label, .field .head-row > label { font-weight: 500; font-size: var(--small); }
.field .head-row { align-items: center; }
.tags { position: relative; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.4rem; background: var(--field);
  border: 1px solid var(--line); min-height: 2.75rem; cursor: text; }
.tags:focus-within { outline: 2px solid var(--ink); border-color: var(--ink); }
.tags input { flex: 1 1 12rem; min-width: 8rem; border: 0; padding: 0.3rem 0.35rem; background: transparent; }
.tags input:focus { outline: 0; }
.tag-list { display: contents; list-style: none; }
.tag { display: inline-flex; align-items: center; gap: 0.45rem; max-width: 100%; padding: 0.2rem 0.2rem 0.2rem 0.5rem; background: var(--surface-2);
  font-size: var(--small); line-height: 1.3; }
.tag a { font-weight: 600; font-variant-numeric: tabular-nums; text-underline-offset: 0.2em; }
.tag span { min-width: 0; }
.tags-mkb .tag span { color: var(--muted); }
.tag button { flex: none; width: 1.6rem; height: 1.6rem; border: 0; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.tag button:hover { background: var(--line); }
.tag-warn { box-shadow: inset 3px 0 0 var(--warn); }
.tags-approval .tag { background: var(--chip-ready); box-shadow: inset 3px 0 0 var(--warn); }
.suggest { position: absolute; z-index: 5; left: -1px; right: -1px; top: 100%; margin: 0; padding: 0; list-style: none; max-height: 20rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--ink); box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); }
.suggest li { padding: 0.5rem 0.75rem; font-size: var(--small); cursor: pointer; }
.suggest li b { font-variant-numeric: tabular-nums; margin-right: 0.35rem; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--surface-2); }
.mic.on { background: var(--bad); color: var(--bg); }
.mic { gap: 0.45rem; }
.mic-icon { flex: none; }
.dictate { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1.25rem; }
.appt-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem; align-items: start; }
.appt-meta input, .appt-meta select { height: 2.9rem; }
.fold { margin: 0.75rem 0; }
.fold > summary { display: flex; width: 100%; text-align: center; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold[open] > summary { margin-bottom: 0.75rem; }
.agree { width: min(36rem, calc(100vw - 2rem)); margin: auto; padding: 1.5rem; color: var(--ink); background: var(--surface); border: 1px solid var(--ink); }
.agree::backdrop { background: rgb(0 0 0 / 0.55); }
.agree > * + * { margin-top: 1rem; }
.agree label.check { align-items: flex-start; }
.agree label.check input { flex: none; margin-top: 0.15rem; }
.agree .button:disabled { opacity: 0.45; cursor: not-allowed; }

/* расшифровка и аудиозапись */
.player { display: grid; gap: 0.35rem; }
.player audio { width: 100%; max-width: 40rem; }
.turns { position: relative; list-style: none; padding: 0; display: grid; gap: 0.75rem; max-height: 32rem; overflow-y: auto; }
.turn { display: grid; grid-template-columns: 9rem 3rem 1fr; gap: 0.75rem; padding: 0.15rem 0; }
.turn.now { background: var(--now); box-shadow: -0.5rem 0 0 var(--now); }
.turn p { max-width: 75ch; }
.turn .time { justify-self: start; align-self: start; color: var(--muted); font-size: var(--small); font-variant-numeric: tabular-nums; }
button.time { padding: 0; border: 0; background: none; font: inherit; font-size: var(--small); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
button.time:hover { color: var(--ink); }
.r-doctor b { color: var(--ink); }
.r-patient b, .r-companion b, .r-unknown b { color: var(--muted); }
.pw { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.05em; }

/* вход */
.login { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; margin: -2rem calc(var(--margin) * -1) -4rem; padding: 0 var(--margin); }
.login-top { display: flex; justify-content: space-between; align-items: baseline; padding: 1.5rem 0; font-size: var(--small); font-weight: 500; }
.login-top a:not(.wordmark) { text-decoration: none; }
.login-body { align-self: center; display: grid; gap: 1rem; max-width: 30rem; padding: 2rem 0; }
.login-body h1 { font-size: clamp(2.5rem, 1.5rem + 3vw, 4rem); line-height: 0.95; letter-spacing: -0.04em; }
.login-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; padding: 1.25rem var(--margin); margin: 0 calc(var(--margin) * -1);
  background: var(--bar); color: var(--bar-muted); font-size: var(--small); }
.login-foot b, .login-foot a { color: var(--bar-ink); }

/* пациент: крупно и просто */
.patient { max-width: 34rem; margin: 0 auto; display: grid; gap: 1.25rem; padding-top: 1rem; }
.patient h1 { font-size: 2.25rem; }
.big, .big-hint { font-size: 1.25rem; line-height: 1.45; }
.big-file { font-size: 1.25rem; padding: 1.25rem; background: var(--surface); border: 2px dashed var(--line); }
.big-file input { font-size: 1.125rem; border: 0; background: transparent; padding: 0.5rem 0 0; }
.big-button { min-height: 4rem; font-size: 1.375rem; width: 100%; }

@media (max-width: 60em) {
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .bar { flex-wrap: wrap; gap: 0.75rem 1.5rem; }
  .bar-user { margin-left: 0; }
  .turn { grid-template-columns: 1fr; gap: 0.15rem; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 40em) { .theme a { padding: 0.2rem 0.4rem; } }
@media (prefers-reduced-motion: reduce) { .button, .level span, .pbar span { transition: none; } .steps .step-now::before, .spin { animation: none; } }
