/* orders.css — область «Наряды»: список нарядов (openOrders) и доска производства (openProductionBoard); токены — в theme.css. */

/* Правила перекрывают общий слой app.css. Панель производства имеет собственную
   раскладку; подписи и элементы карточек сохраняются. Границы браузерной приёмки:
   - список при 1440: первая строка не ниже 380 px, строки 36–72 px, в первых
     900 px не меньше 7 полных строк; controls в .orders-primary не ниже 31,5 px;
   - details.orders-filters и details.orders-qr остаются раскрываемыми областями;
   - у колонки производства заголовок «Ожидают · N» и непрозрачная точка
     ::before своего цвета; --stage-* — только маркер, текст пишется --info/--warn/--ok;
   - таблица списка помещается в ширину без внутренней прокрутки: ≤75rem прячется
     «Сумма», ≤42rem строки становятся карточками.
   .orders-table есть и у зарплаты, отчётов и ресурсов, поэтому таблица списка
   адресуется только своим классом .orders-list. */

/* ================================================================ список === */

/* Заголовок: «Наряды», круглая «?» 32 px и (для роли без правки) «только
   просмотр»; справка раскрывается заметкой над фильтрами. */
.orders-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.orders-title-row > h1 { margin: 0; }
.orders-help-toggle {
  width: 32px; height: 32px; min-height: 0; padding: 0; border: 1px solid var(--button-border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-2); font-weight: var(--fw-600);
}
.orders-help-toggle[aria-expanded="true"] { border-color: var(--ink); }
.orders-readonly { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--chip-bg); color: var(--ink-2); font-size: var(--fs-12); font-weight: var(--fw-500); }
.orders-help {
  display: flex; flex-direction: column; gap: 6px; max-width: 760px; margin: 0 0 var(--sp-4); padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--fill-soft); line-height: 1.5;
}
.orders-help[hidden] { display: none; }
.orders-help > strong { font-weight: var(--fw-600); }
.orders-help > span { color: var(--ink-2); }

/* Управление — строка поиска, QR, статуса и «Показывать закрытые», под ней
   переключатели «Дополнительные фильтры» и «Открыть наряд по QR». */
.orders-controls { display: flex; flex-direction: column; gap: 10px; margin: 0 0 var(--sp-4); background: none; border: 0; border-radius: 0; padding: 0; }
.orders-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
/* Подпись поля в макете не видна; первый текстовый узел остаётся для чтения. */
label.bare-field, .orders-controls .filter-strip > label.field.bare-field, .orders-controls .order-scanner-row > label.field.bare-field {
  display: block; margin: 0; padding: 0; border: 0; background: none; font-size: 0; line-height: 0; gap: 0;
}
label.bare-field > input, label.bare-field > select { font-size: var(--fs-13); line-height: normal; }
.orders-primary > label.bare-field > select { height: 36px; min-width: 160px; }
.orders-primary > label:not(.field) {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px; white-space: nowrap; color: var(--ink); font-size: var(--fs-13);
}
.orders-primary > label:not(.field) > input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.orders-primary > button { height: 36px; }
.orders-search { flex: 1 1 340px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.orders-search > .search-field { flex: 1 1 auto; min-width: 0; }
.orders-search > .search-field > input { width: 100%; height: 36px; }
.orders-qr-toggle { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; }
.orders-qr-toggle .ui-icon { width: 18px; height: 18px; }
.orders-qr-toggle[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }

/* Переключатели — кнопки 32 px со стрелкой «›», которая поворачивается при
   раскрытии; раскрытая область — панель на всю ширину под строкой. */
.orders-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.orders-tools > details, .orders-tools > details[open]::details-content { display: contents; }
.orders-tools > details:not([open]) > :not(summary) { display: none; }
.orders-tools > details > summary {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; min-height: 0; padding: 0 12px;
  border: 1px solid var(--button-border); border-radius: var(--radius); background: var(--surface);
  list-style: none; white-space: nowrap; font-weight: var(--fw-500); color: var(--ink); cursor: pointer;
}
.orders-tools > details > summary::-webkit-details-marker { display: none; }
.orders-toggle-mark { display: inline-block; transition: transform .15s; }
.orders-tools > details[open] > summary .orders-toggle-mark { transform: rotate(90deg); }
.orders-tools > .orders-qr[open] > summary { background: var(--fill-soft); }
.orders-tools > .orders-filters.has-active > summary { background: var(--brand-soft); }
.orders-tools > details > :not(summary) { order: 10; flex: 1 0 100%; }
.orders-tools > .orders-active-filters { order: 5; }
.orders-filter-fields {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px;
  border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--gray-25);
}
.orders-filter-fields > .field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--muted); }
.orders-controls .orders-filter-fields input[type="date"] { height: 32px; min-height: 0; padding-block: 0; }
.orders-filter-fields select, .orders-filter-fields input { width: 100%; max-width: none; min-width: 0; height: 32px; font-size: var(--fs-13); font-weight: var(--fw-400); color: var(--ink); }
.orders-period-basis { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--chip-bg); }
.orders-period-basis > button {
  flex: 1; height: 28px; min-height: 0; padding: 0 6px; border: 0; border-radius: 6px; background: transparent;
  box-shadow: none; font-size: var(--fs-12-5); font-weight: var(--fw-400); color: var(--ink); white-space: nowrap;
}
.orders-period-basis > button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: var(--fw-600); }
.orders-tools > details > .error { margin: 0; }
.orders-qr-panel {
  display: flex; flex-direction: column; gap: 8px; max-width: 640px; padding: 14px;
  border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--gray-25);
}
.orders-qr-panel > .scanner-hint { color: var(--ink-2); }
.order-scanner { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.order-scanner-row { display: flex; flex-wrap: wrap; gap: 8px; }
.order-scanner-row > .bare-field { flex: 1 1 220px; min-width: 0; }
.order-scanner-row > .bare-field > input { width: 100%; height: 36px; font-family: var(--mono); font-size: var(--fs-12-5); }
.order-scanner-row > button { height: 36px; padding: 0 14px; }
.orders-qr-error { color: var(--danger); font-size: var(--fs-12-5); }
.orders-qr-error:empty { display: none; }

.orders-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.orders-filter-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; min-width: 0;
  height: 32px; padding: 0 4px 0 10px;
  border-radius: var(--radius-pill); background: var(--chip-bg); color: var(--ink); font-size: var(--fs-12-5);
}
.orders-filter-name { color: var(--muted); }
.orders-filter-chip > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-600); }
.orders-filter-remove {
  flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-14); line-height: 1; cursor: pointer;
}
.orders-filter-remove:hover { background: var(--surface); color: var(--ink); }
.orders-filter-remove:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }

/* Плитки: четыре всегда, тон по смыслу, число 22 моно; выбранная — кольцо своего
   тона, остальные приглушены. «Ничего не горит» — зелёная пилюля рядом. */
.orders-overview {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: stretch; gap: 8px; margin: 0 0 var(--sp-4);
}
.orders-tile {
  --tile-ink: var(--ink); --tile-bg: var(--surface); --tile-line: var(--rule);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 6px;
  min-width: 0; min-height: 72px; padding: 10px 12px;
  border: 1px solid var(--tile-line); border-radius: var(--radius-card);
  background: var(--tile-bg); color: var(--tile-ink); text-align: left; cursor: pointer; font: inherit;
}
.orders-tile.tone-danger { --tile-ink: var(--danger); --tile-bg: var(--danger-soft); --tile-line: var(--danger-line); }
.orders-tile.tone-held { --tile-ink: var(--held); --tile-bg: var(--held-soft); --tile-line: var(--held-line); }
.orders-tile.tone-info { --tile-ink: var(--info); --tile-bg: var(--info-soft); --tile-line: var(--info-line); }
.orders-tile-label { font-size: var(--fs-12-5); font-weight: var(--fw-600); line-height: 1.3; }
.orders-tile > b { font: var(--fw-600) 22px/1 var(--mono); font-variant-numeric: tabular-nums; }
.orders-tile.on { border-color: var(--tile-ink); box-shadow: 0 0 0 1px var(--tile-ink); }
.orders-tile.is-dim { opacity: .55; }
.orders-tile:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.orders-overview > .chip-link {
  align-self: center; justify-self: start; height: 32px; padding: 0 8px; border: 0; background: none;
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.orders-calm {
  align-self: center; justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok); font-weight: var(--fw-500); white-space: nowrap;
}
.orders-calm > .dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: currentColor; }

.orders-list-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 var(--sp-4); font-size: var(--fs-12-5); }
.orders-found { margin: 0; color: var(--ink-2); font-size: var(--fs-12-5); }
.orders-found > b { font-family: var(--mono); color: var(--ink); }
.orders-deadline-hint { margin-left: auto; color: var(--muted); font-size: var(--fs-12-5); }

/* ---------------------------------------------------------- таблица списка --- */

/* Фиксированная раскладка: колонки не растягиваются содержимым, длинное
   обрезается многоточием (полный текст — в title и у экранного диктора), строка
   держится в 48–72 px и таблица помещается в ширину без прокрутки. */
.orders-list { table-layout: fixed; width: 100%; }
.orders-list th { height: 34px; padding: 0 var(--sp-3); overflow: hidden; white-space: normal; line-height: 1.2; }
.orders-list td {
  height: 48px; padding: var(--sp-1-5) var(--sp-3); vertical-align: middle;
  font-size: var(--fs-12-5); line-height: 1.3; overflow: hidden;
}
.orders-list th.col-number { width: 124px; }
.orders-list th.col-due { width: 124px; }
.orders-list th.col-status { width: 136px; }
.orders-list th.col-approval { width: 144px; }
.orders-list th.col-sum { width: 116px; text-align: right; }
.orders-list tbody tr.is-overdue { background: var(--overdue-row); }
.orders-compact-only, .orders-list td > .orders-compact-only { display: none; }
.orders-list .order-sent-text { display: none; }

/* Заголовок-сортировка — кнопка во всю высоту ячейки; стрелка — только знак. */
.orders-list th[aria-sort] { padding: 0 var(--sp-2); }
.orders-list .sort-button {
  display: inline-flex; align-items: center; gap: var(--sp-1); height: 32px; padding: 0 var(--sp-1);
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: var(--fs-12); font-weight: var(--fw-500);
}
.orders-list .sort-button.on { color: var(--ink); }
.orders-list .sort-button:hover { background: var(--surface); color: var(--ink); }
.orders-list .sort-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.orders-list .sort-mark { font-family: var(--mono); font-size: var(--fs-11); }

.orders-list td > .subline, .orders-list td > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-list .subline { margin-top: 1px; font-size: var(--fs-11); }
.orders-list .order-number { display: block; font: var(--fw-600) var(--fs-12-5)/1.3 var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-list .order-lab-number { font-family: var(--mono); }
.orders-list td.order-patient-cell { overflow: hidden; font-size: var(--fs-13); font-weight: var(--fw-400); color: var(--ink); }
.orders-list .order-patient-name { font-weight: var(--fw-500); line-height: 1.3; }
.orders-list td > .order-patient-clinic { font-size: var(--fs-12); font-weight: var(--fw-400); color: var(--muted); }
.orders-list .order-paused { margin-top: 2px; font-size: var(--fs-11); font-weight: var(--fw-500); color: var(--held); }
.orders-list td.order-approval-cell .approval-pill {
  display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; padding: 2px 8px; border-radius: var(--radius-card);
  font-size: var(--fs-12); font-weight: var(--fw-500); line-height: 1.35; white-space: normal;
}
.orders-list td.order-approval-cell .approval-dot { margin-top: 5px; }
.orders-list .order-clinic { color: var(--ink-2); }
.orders-list td.num { font: var(--fw-500) var(--fs-12-5)/1.3 var(--mono); color: var(--ink); }

/* Срок: дата моно, под ней мелко — что с ней: просрочено, сдвинута, скоро,
   пожелание заказчика. Пожелание серое: обещать по нему нечего. */
.orders-list .order-due-main { font: var(--fw-600) var(--fs-12-5)/1.3 var(--mono); color: var(--ink); }
.orders-list td > .order-due-sub {
  display: -webkit-box; margin-top: 1px; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  white-space: normal; font-size: var(--fs-11); line-height: 1.25; color: var(--muted);
}
.orders-list td[data-due="overdue"] > span { color: var(--danger); }
.orders-list td[data-due="held"] > .order-due-sub { color: var(--held); }
.orders-list td[data-due="soon"] > .order-due-sub { color: var(--info); }
.orders-list td[data-due="wish"] > .order-due-main,
.orders-list td[data-due="none"] > .order-due-main { color: var(--muted); }
.orders-list td[data-due="none"] > .order-due-main { font: var(--fw-400) var(--fs-12-5)/1.3 var(--font); }

/* Статус — прежняя пилюля; значок отправки рядом, со своей подписью для диктора. */
.orders-list .order-state-line { display: flex; align-items: center; gap: var(--sp-1); overflow: visible; }
.orders-list .order-sent {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok);
}
.orders-list .order-sent .ui-icon { width: 12px; height: 12px; stroke-width: 2.2; }

/* Этапы — первый текущий этап: операция и «ещё N», под ней состояние и
   исполнитель. «Не назначен» — тон warn, подрядчик — violet. Полный список —
   .order-stages-all для диктора и title ячейки для мыши. */
.orders-list .order-stages-line { display: grid; min-width: 0; overflow: hidden; white-space: normal; }
.orders-list .order-stage-head { display: flex; align-items: center; gap: var(--sp-1-5); min-width: 0; }
.orders-list .order-stage-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-500); color: var(--ink); }
.orders-list .order-stage-state { min-width: 0; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-11); color: var(--muted); }
.orders-list .order-stage-state.tone-work { color: var(--warn); }
.orders-list .order-stage-state.tone-wait { color: var(--info); }
.orders-list .order-stage-state.tone-unassigned { color: var(--warn); font-weight: var(--fw-600); }
.orders-list .order-stage-state.tone-external { color: var(--violet); }
.orders-list .order-stages-more {
  flex: none; padding: 0 var(--sp-1-5); border-radius: var(--radius-sm);
  background: var(--chip-bg); color: var(--ink-2); font-size: var(--fs-11); line-height: 18px; white-space: nowrap;
}
.orders-list .order-stages-none { color: var(--muted); }

/* ---------------------------------------------------- состояния списка --- */

/* Загрузка — скелет строк и подпись; пустой список и «ничего не найдено» — блок по
   центру с пояснением и действиями; отказ — красная панель с «Повторить». */
.orders-controls ~ .table-wrap > .empty {
  display: grid; justify-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-6); color: var(--muted); font-size: var(--fs-12-5); font-weight: var(--fw-500);
}
.orders-skeleton { display: grid; }
.orders-skeleton-row {
  display: grid; grid-template-columns: 4rem minmax(0, 2fr) minmax(0, 1fr) 4.5rem minmax(0, 1fr); align-items: center; gap: var(--sp-4);
  height: 48px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--row-rule);
}
.orders-skeleton-row:first-child { height: 36px; background: var(--table-head-bg); }
.orders-skeleton-row > span { height: 10px; border-radius: var(--radius-sm); background: var(--chip-bg); }
.orders-skeleton-row:first-child > span { background: var(--rule); }
.orders-skeleton-row > span:nth-child(4) { height: 20px; border-radius: var(--radius-pill); }
.orders-loading { overflow: hidden; }
.orders-loading-text { display: block; padding: 8px 14px; color: var(--muted); font-size: var(--fs-12-5); }
.orders-controls ~ .table-wrap:has(> .orders-error), .orders-controls ~ .table-wrap:has(> .orders-noresults) { border: 0; background: none; }
.orders-controls ~ .table-wrap > .orders-error {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px; text-align: center;
  border: 1px solid var(--danger-line); border-radius: var(--radius-panel); background: var(--danger-soft);
}
.orders-controls ~ .table-wrap > .orders-error > strong { color: var(--danger); font-size: 15px; font-weight: var(--fw-600); }
.orders-controls ~ .table-wrap > .orders-error > span { max-width: 460px; color: var(--ink-2); }
.orders-noresults { border: 1px dashed var(--file-drop-line); border-radius: var(--radius-panel); background: none; padding: 40px 20px; }
.orders-empty { padding: 56px 20px; background: var(--gray-25); }
.orders-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--indigo-50); color: var(--indigo-700); }
.orders-empty-icon .ui-icon { width: 22px; height: 22px; }
.orders-state {
  display: grid; justify-items: center; gap: var(--sp-2-5);
  padding: 2.5rem var(--sp-5); text-align: center; background: var(--fill-soft);
}
.orders-controls ~ .table-wrap .orders-state > .empty {
  padding: 0; background: none; color: var(--ink); font-size: 15px; font-weight: var(--fw-600); line-height: 1.4;
}
.orders-controls ~ .table-wrap .orders-empty > .empty { font-size: var(--fs-17); }
.orders-state > .hint { max-width: 28rem; margin: 0; color: var(--muted); font-size: var(--fs-12-5); line-height: 1.5; }
.orders-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.orders-more { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding-top: var(--sp-3); }
.orders-more:empty { display: none; }
.orders-more > .error { margin: 0; }

/* До 1180 px: заказчик под пациентом, суммы нет (макет «Наряды»). */
@media (max-width: 73.75rem) {
  .orders-list th.num, .orders-list td.num, .orders-list th.col-customer, .orders-list td.order-customer { display: none; }
  .orders-list .orders-compact-only { display: inline; }
  .orders-list td > .order-patient-clinic.orders-compact-only { display: block; }
  .orders-list th.col-number { width: 104px; }
  .orders-list th.col-due { width: 112px; }
  .orders-list th.col-status { width: 124px; }
  .orders-list th.col-approval { width: 132px; }
}

@media (max-width: 64rem) {
  .orders-list th, .orders-list td { padding-inline: var(--sp-2-5); }
  .orders-list th.col-number { width: 8rem; }
  .orders-list th.col-due { width: 8.5rem; }
  .orders-list th.col-status { width: 7.75rem; }
}

/* ≤42rem: плитки 2×2, строки — карточки: номер и статус сверху, пациент крупно,
   клиника · врач, срок на подложке своего тона, текущий этап. Шапка остаётся для
   диктора, но не видна. */
@media (max-width: 42rem) {
  .orders-primary > .orders-search { flex-basis: 100%; }
  .orders-deadline-hint { margin-left: 0; }
  .orders-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-overview > .chip-link { grid-column: 1 / -1; }
  .orders-skeleton-row { grid-template-columns: 3rem minmax(0, 1fr) 4.5rem; gap: var(--sp-3); }
  .orders-skeleton-row > span:nth-child(n+4) { display: none; }
  .orders-controls ~ .table-wrap:has(> .orders-list) { border: 0; border-radius: 0; background: none; }
  .orders-controls ~ .table-wrap > table.orders-list { min-width: 0; }
  .orders-list, .orders-list tbody { display: block; }
  .orders-list thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  /* Шапка карточек видна только чтению с экрана: «Сумма» снова в ней (≤1180 её прятали). */
  .orders-list th.num { display: table-cell; }
  .orders-list tbody { display: grid; gap: var(--sp-2); }
  .orders-list tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    grid-template-areas: "no state" "patient patient" "customer customer" "due due" "stages stages" "ap sum";
    gap: var(--sp-1-5) var(--sp-2); padding: var(--sp-3);
    border: 1px solid var(--card-border); border-radius: var(--radius-card); background: var(--surface);
  }
  .orders-list tbody tr:last-child td { border-bottom: 0; }
  .orders-list td { display: block; height: auto; padding: 0; border: 0; }
  .orders-list td.order-no { grid-area: no; display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
  .orders-list td.order-no > .subline { margin: 0; }
  .orders-list td.order-patient-cell { grid-area: patient; white-space: normal; font-size: var(--fs-17); line-height: 1.3; }
  .orders-list td.order-customer { grid-area: customer; display: flex; min-width: 0; color: var(--muted); }
  .orders-list td.order-customer > span { display: inline; flex: 0 1 auto; margin: 0; font-size: var(--fs-12-5); color: var(--muted); }
  .orders-list td.order-customer > .order-doctor::before { content: " · "; white-space: pre; }
  .orders-list td.order-due {
    grid-area: due; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2);
    padding: var(--sp-2) var(--sp-2-5); border-radius: var(--radius); background: var(--fill-soft);
  }
  .orders-list td.order-due::before { content: "Срок"; font-size: var(--fs-12); color: var(--ink-2); }
  .orders-list td.order-due > span { display: inline; white-space: normal; overflow: visible; }
  .orders-list td.order-due > .order-due-sub { flex-basis: 100%; font-size: var(--fs-12); }
  .orders-list td[data-due="overdue"] { background: var(--danger-soft); }
  .orders-list td[data-due="held"] { background: var(--held-soft); }
  .orders-list td[data-due="soon"] { background: var(--info-soft); }
  .orders-list td.order-state { grid-area: state; justify-self: end; }
  .orders-list td.order-stages { grid-area: stages; }
  .orders-list tbody tr.is-overdue { background: var(--surface); border-color: var(--danger-line); }
  .orders-list td.order-patient-cell .order-patient-name { font-weight: var(--fw-600); }
  .orders-list td > .order-patient-clinic.orders-compact-only, .orders-list td > .orders-compact-only { display: none; }
  .orders-list th.col-customer, .orders-list td.order-customer { display: flex; }
  .orders-list td.order-approval-cell {
    grid-area: ap; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--row-rule);
  }
  .orders-list td.order-approval-cell .approval-pill { border-radius: var(--radius-pill); }
  .orders-list .order-sent-text { display: inline; font-size: var(--fs-12); color: var(--ok); }
  .orders-list .order-sent { display: none; }
  .orders-list td.num {
    grid-area: sum; display: block; align-self: stretch; padding-top: 8px; border-top: 1px solid var(--row-rule);
    text-align: right; font-size: var(--fs-13);
  }
  .orders-list td.order-state .order-paused { display: none; }
  .orders-overview > .orders-calm { grid-column: 1 / -1; }
}

/* ---------------------------------------------- 30 «Возвраты» (R1, returns.js) ---
   Макет «Возвраты.dc.html» этапа 3: список по вкладкам, таймер ожидания, панель
   разбора 580 px справа (тот же компонент открывает «Карточка наряда»), окна
   «Передать», «Попросить фото / уточнение», «Предложить врачу другую дату». */
.rt-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; max-width: 1040px; }
.rt-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.rt-head-text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rt-head-text h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.rt-head-text p { margin: 0; color: var(--muted); line-height: 1.45; }
.rt-rule { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--gray-250); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer; color: var(--ink); }
.rt-tabs { display: flex; gap: 2px; padding: 2px; background: var(--gray-100); border-radius: 8px; align-self: flex-start; flex-wrap: wrap; max-width: 100%; }
.rt-tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; font-weight: 400; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.rt-tabs button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: 600; }
.rt-tab-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--gray-250); color: var(--ink); font: 600 11px/18px var(--mono); }
.rt-tab-n.rt-n-new { background: var(--red-700); color: var(--surface); }
.rt-tab-n.rt-n-ask { background: var(--held-soft); color: var(--held); }
.rt-list { border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
.rt-row { display: flex; gap: 12px 16px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--gray-150); background: var(--surface); }
.rt-row:first-child { border-top: 0; }
.rt-timer-col { width: 100px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.rt-timer { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px; font: 600 13px var(--mono); background: var(--gray-100); color: var(--ink-2); }
.rt-timer.rt-tone-warn { background: var(--warn-soft); color: var(--warn); }
.rt-timer.rt-tone-red { background: var(--danger); color: var(--surface); }
.rt-timer.rt-tone-held { background: var(--held-soft); color: var(--held); }
.rt-timer.rt-tone-ok { background: var(--ok-soft); color: var(--ok); }
.rt-timer-sub { font-size: 11px; color: var(--muted); text-align: center; font-weight: 500; }
.rt-timer-sub.is-red { color: var(--danger); }
.rt-row-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rt-row-title { font-size: 13.5px; line-height: 1.4; }
.rt-row-title b { font-weight: 600; }
.rt-mono, .rt-row-title b.rt-mono { font-family: var(--mono); }
.rt-row-title b.rt-mono { font-size: 13px; }
.rt-quote { font-size: 14px; }
.rt-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--gray-100); color: var(--ink-2); }
.rt-chip-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.rt-chip-info { background: var(--info-soft); color: var(--info); }
.rt-chip-ok { background: var(--ok-soft); color: var(--ok); }
.rt-chip-warn { background: var(--warn-soft); color: var(--warn); }
.rt-chip-danger { background: var(--danger-soft); color: var(--danger); }
.rt-chip-held { background: var(--held-soft); color: var(--held); }
.rt-row-btns { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.rt-btn { height: 32px; padding: 0 12px; border: 1px solid var(--gray-250); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; }
.rt-btn-dark { border: 0; background: var(--brand-ink); color: var(--surface); }
.rt-btn-sm { height: 30px; padding: 0 10px; font-weight: 400; }
.rt-btn-dark.rt-btn-sm { font-weight: 500; padding: 0 12px; }
.rt-btn:disabled { opacity: .6; cursor: default; }
.rt-lime { color: var(--brand-lime); }
.rt-empty { padding: 40px 24px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--gray-25); display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.rt-empty strong { font-size: 17px; font-weight: 600; }
.rt-empty span { color: var(--ink-2); max-width: 480px; line-height: 1.5; }
.rt-note { font-size: 12.5px; color: var(--muted); }
.rt-note a { color: var(--ink); }
.rt-loading { color: var(--muted); margin: 0; padding: 16px 20px; }
.rt-error { color: var(--danger); margin: 0; padding: 16px 20px; }

/* Панель разбора: поверх экрана, 580 px справа; в узком окне — во всю ширину. */
body.rt-panel-open { overflow: hidden; }
.rt-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(23, 24, 26, .32); }
.rt-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 56; width: 580px; max-width: 100%; background: var(--surface); box-shadow: -12px 0 40px rgba(16, 24, 40, .18); display: flex; flex-direction: column; font-size: 13px; color: var(--ink); }
.rt-p-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 4px; }
.rt-p-title { display: flex; align-items: center; gap: 10px; }
.rt-p-title h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
.rt-timer.rt-timer-sm { height: 26px; font-size: 12.5px; }
.rt-x { width: 32px; height: 32px; border: 1px solid var(--gray-250); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--ink); }
.rt-p-sub { color: var(--muted); }
.rt-p-sub a { color: var(--ink); }
.rt-p-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.rt-p-foot { padding: 12px 20px; background: var(--gray-25); border-top: 1px solid var(--gray-200); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.rt-p-foot .rt-btn { font-weight: 400; }
.rt-p-foot .rt-btn-dark { font-weight: 500; padding: 0 16px; }
.rt-p-foot .rt-push { margin-right: auto; }
.rt-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.rt-ink2 { color: var(--ink-2); }
.rt-muted { color: var(--muted); }
.rt-grow { flex: 1; }
.rt-hint { font-size: 12px; color: var(--muted); }
.rt-hint-ink { font-size: 12.5px; color: var(--ink-2); }
.rt-prev { padding: 10px 12px; border-radius: 10px; background: var(--gray-50); line-height: 1.45; }
.rt-prev b { font-weight: 600; }
.rt-banner { padding: 10px 12px; border-radius: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; line-height: 1.45; }
.rt-banner > span { flex: 1 1 260px; }
.rt-banner b { font-weight: 600; }
.rt-banner-info { background: var(--info-soft); }
.rt-banner-info b { color: var(--info); }
.rt-banner-gray { background: var(--gray-100); }
.rt-doc { padding: 12px 14px; border-radius: 10px; background: var(--danger-soft); display: flex; flex-direction: column; gap: 8px; }
.rt-doc-who { font-size: 12px; color: var(--ink-2); }
.rt-doc-who b { font-weight: 600; color: var(--ink); }
.rt-doc-quote { font-size: 14px; line-height: 1.4; }
.rt-doc textarea { padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: 8px; resize: vertical; background: var(--surface); }
.rt-doc-visit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.rt-doc-visit input { height: 30px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface); }
.rt-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-photo { width: 120px; height: 80px; border-radius: 8px; background: repeating-linear-gradient(135deg, var(--gray-100) 0 6px, var(--surface) 6px 12px); border: 1px solid var(--danger-line); display: flex; align-items: flex-end; padding: 5px; }
.rt-photo span { font: 10.5px var(--mono); background: var(--surface); padding: 1px 4px; border-radius: 4px; }
.rt-form { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: center; }
.rt-flabel { font-weight: 500; color: var(--ink-2); }
.rt-w110 { width: 110px; flex: none; }
.rt-fcol { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rt-seg { display: flex; gap: 2px; padding: 2px; background: var(--gray-100); border-radius: 8px; align-self: flex-start; flex-wrap: wrap; justify-self: start; }
.rt-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; font-weight: 400; color: var(--ink); cursor: pointer; }
.rt-seg button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: 600; }
.rt-seg button:disabled { color: var(--gray-500); cursor: default; }
.rt-teeth { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rt-tooth { --tooth: var(--indigo-700); width: 52px; height: 40px; border: 2px solid var(--tooth); border-radius: 8px; background: var(--surface); color: var(--tooth); font: 600 14px var(--mono); cursor: pointer; }
.rt-tooth-abutment { --tooth: var(--violet-700); }
.rt-tooth-pontic { --tooth: var(--amber-700); }
.rt-tooth[aria-pressed="true"] { background: var(--tooth); color: var(--surface); }
.rt-guilts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rt-guilts button { height: 30px; padding: 0 10px; border: 1px solid var(--gray-250); border-radius: 8px; background: var(--surface); font-weight: 400; cursor: pointer; color: var(--ink); }
.rt-guilts button[aria-checked="true"] { border-color: var(--brand-ink); background: var(--brand-soft); font-weight: 600; }
.rt-pct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-pct { display: flex; align-items: center; height: 32px; border: 1px solid var(--gray-300); border-radius: 8px; padding: 0 8px; gap: 4px; }
.rt-pct input { width: 48px; border: 0; outline: 0; font: 500 13px var(--mono); text-align: right; }
.rt-form select { height: 32px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface); max-width: 100%; }
.rt-block { display: flex; flex-direction: column; gap: 8px; }
.rt-blabel { font-weight: 500; color: var(--ink-2); }
.rt-stages { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.rt-stages label, .rt-remake label { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
.rt-stages input, .rt-remake input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-ink); }
.rt-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-who-name { flex: 1; }
.rt-who-name b { font-weight: 600; }
.rt-who-list { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-who-list button { height: 30px; padding: 0 10px; border: 1px solid var(--gray-250); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--ink); }
.rt-who-list button[aria-pressed="true"] { border-color: var(--brand-ink); background: var(--brand-soft); }
.rt-due { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--surface); }
.rt-due.is-late { border-color: var(--danger-line); background: var(--danger-soft); }
.rt-due-line { font-size: 13.5px; }
.rt-due-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12.5px; font-weight: 600; }
.rt-due.is-late .rt-due-chip { background: var(--danger); color: var(--surface); }
.rt-due-chip.is-unknown { background: var(--surface-2); color: var(--muted); }
.rt-late { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.rt-late b { font-weight: 600; }
.rt-remake { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid var(--gray-200); }
.rt-remake-title { font-weight: 600; }
.rt-remake .rt-ink2 { line-height: 1.45; }
.rt-clinic { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rt-clinic-col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rt-clinic-line { font-weight: 500; }
.rt-warn-text { font-size: 12.5px; color: var(--warn); }
.rt-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rt-radio input[type=radio] { margin: 0; accent-color: var(--brand-ink); }
.rt-sum { display: flex; align-items: center; height: 30px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; gap: 4px; }
.rt-sum input { width: 80px; border: 0; outline: 0; font: 500 13px var(--mono); text-align: right; }
.rt-answer { display: flex; flex-direction: column; gap: 6px; }
.rt-answer textarea, .rt-dlg textarea { padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: 8px; resize: vertical; }
.rt-answer textarea.is-bad, .rt-dlg textarea.is-bad { border-color: var(--danger); }
.rt-field-err { font-size: 12px; color: var(--danger); }
.rt-feed { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-top: 1px solid var(--gray-150); }
.rt-feed-row { display: flex; gap: 10px; font-size: 12.5px; }
.rt-feed-at { font-family: var(--mono); color: var(--muted); width: 40px; flex: none; }
.rt-decision { padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.rt-decision b { font-size: 14px; font-weight: 600; }
.rt-decided { color: var(--ink-2); }
.rt-decided-note { font-size: 12.5px; color: var(--muted); }
.rt-vfeed { display: flex; flex-direction: column; }
.rt-vfeed .rt-label { margin-bottom: 6px; }
.rt-vfeed-row { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--gray-75); }
.rt-vfeed-i { width: 14px; font-weight: 700; flex: none; }
.rt-fg-ok { color: var(--ok); }
.rt-fg-muted { color: var(--muted); }
/* R2 · «Оплата доработки технику»: источник суммы, «изменено вручную», правка
   суммы, строки согласия, плашки «Не договорились» и «Ждёт директора». */
.rt-sum-src { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12.5px; }
.rt-sum-val { font: 500 12.5px var(--mono); }
.rt-manual { padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.rt-sum-btn { height: 26px; padding: 0 8px; border: 0; background: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 12.5px; }
.rt-sum-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-sum-in { display: flex; align-items: center; height: 32px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; gap: 4px; }
.rt-sum-in input { width: 90px; border: 0; outline: 0; font: 500 13px var(--mono); text-align: right; }
.rt-agree { border-radius: 8px; background: var(--gray-50); overflow: hidden; }
.rt-agree-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--gray-150); font-size: 12.5px; }
.rt-agree-who { flex: 1 1 200px; }
.rt-agree-state { font-weight: 500; }
.rt-fg-ink2 { color: var(--ink-2); }
.rt-fg-warn { color: var(--warn); }
.rt-fg-danger { color: var(--danger); }
.rt-fg-info { color: var(--info); }
.rt-lh { line-height: 1.45; }
.rt-banner-held { background: var(--held-soft); }
.rt-banner-held b { color: var(--held); }
.rt-banner .rt-btn-sm { font-weight: 500; padding: 0 12px; }
.rt-corr-link { font-size: 12.5px; color: var(--ink); }
.rt-vfeed-at { font-family: var(--mono); color: var(--muted); width: 86px; flex: none; }
.rt-vfeed-row.is-old .rt-vfeed-text { color: var(--muted); text-decoration: line-through; }

/* Окна разбора: 460 px по центру. */
.rt-dlg-layer { position: fixed; inset: 0; z-index: 70; background: rgba(23, 24, 26, .45); display: grid; place-items: center; padding: 16px; }
.rt-dlg { width: min(460px, 100%); background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(16, 24, 40, .28); overflow: hidden; font-size: 13px; color: var(--ink); }
.rt-dlg-body { padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 12px; }
.rt-dlg-body h2 { margin: 0; font-size: 17px; font-weight: 600; }
.rt-tr-list { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
.rt-tr-list label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-top: 1px solid var(--gray-150); background: var(--surface); cursor: pointer; }
.rt-tr-list label:first-child { border-top: 0; }
.rt-tr-list label.is-on { background: var(--gray-50); }
.rt-tr-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-ink); }
.rt-tr-who { flex: 1; display: flex; flex-direction: column; }
.rt-tr-who b { font-weight: 500; }
.rt-tr-who span { font-size: 12px; color: var(--muted); }
.rt-tr-none { margin: 0; padding: 12px; color: var(--muted); }
.rt-date-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-date-field, .rt-time-field, .rt-dlg-note { display: flex; flex-direction: column; gap: 4px; }
.rt-date-field { flex: 1 1 160px; }
.rt-time-field { flex: 0 1 120px; }
.rt-date-field span, .rt-time-field span, .rt-dlg-note > span:first-child { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.rt-date-row input { height: 32px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; }
.rt-dlg-hint { font-size: 12.5px; color: var(--muted); }
.rt-dlg-hint b { color: var(--ink); }
.rt-dlg-text { color: var(--ink-2); line-height: 1.45; }
.rt-dlg-foot { padding: 12px 20px; background: var(--gray-25); border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }
.rt-dlg-foot .rt-btn { font-weight: 400; padding: 0 14px; }
.rt-dlg-foot .rt-btn-dark { font-weight: 500; padding: 0 16px; }

@media (max-width: 700px) {
  .rt-panel { width: 100%; }
  .rt-form { grid-template-columns: 1fr; }
}
.rt-panel[data-mode="view"] .rt-doc { gap: 4px; }

/* Плашка возврата над карточкой наряда (06, R1). */
.order-return-slot:empty { display: none; }
.rt-plate { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); border: 1px solid var(--danger-line); }
.rt-plate-mark { color: var(--danger); font-size: 16px; font-weight: 700; }
.rt-plate-text { flex: 1 1 300px; line-height: 1.45; }
.rt-plate-text b { font-weight: 600; }
.rt-plate-text > b:first-child { color: var(--danger); }
.rt-plate-meta { font: 500 12px var(--mono); color: var(--ink-2); white-space: nowrap; }
.rt-plate-btn { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--danger); color: var(--surface); font-weight: 500; cursor: pointer; }
/* Поля разбора поверх общих правил полей (ширина 100 %, высота, рамка). */
.rt-panel input[type="radio"], .rt-dlg input[type="radio"] { width: 16px; height: 16px; margin: 0; flex: none; padding: 0; }
.rt-pct input, .rt-sum input { height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; appearance: textfield; -moz-appearance: textfield; }
.rt-pct input::-webkit-inner-spin-button, .rt-pct input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rt-doc-visit input { width: auto; }
.rt-clinic-col .rt-radio { align-self: flex-start; }

/* R3 · шапка экрана 30: «Как это видит врач»; плашка «Предложение техника». */
.rt-doctor-link { display: inline-flex; align-items: center; height: 32px; padding: 0 4px; font-weight: 500; color: var(--ink); text-underline-offset: 2px; }
.rt-doctor-link:hover { color: var(--ink-2); }
.rt-banner-warn { background: var(--warn-soft); }
.rt-banner-warn b { color: var(--warn); }

/* R3 · «Как это видит врач» — экран 31 в статусе возврата (телефон 390 × 844 в рамке). */
.rt-phone-layer { position: fixed; inset: 0; z-index: 72; background: rgba(23, 24, 26, .45); display: grid; place-items: center; padding: 16px; overflow: auto; }
.rt-phone-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 100%; }
.rt-phone-bar { display: flex; align-items: center; gap: 8px; width: 410px; max-width: 100%; }
.rt-phone-bar select { flex: 1; height: 32px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface); }
.rt-phone-holder { display: flex; justify-content: center; max-width: 100%; }
.rt-phone-holder > .rt-loading, .rt-phone-holder > .rt-error, .rt-phone-none { background: var(--surface); border-radius: 12px; }
.rt-phone-none { margin: 0; padding: 16px 20px; color: var(--ink-2); }
.rt-phone { width: 410px; height: 864px; max-width: 100%; max-height: calc(100vh - 90px); flex: none; border: 10px solid var(--gray-900); border-radius: 52px; background: var(--gray-75); overflow: hidden; position: relative; display: flex; flex-direction: column; font-size: 15px; line-height: normal; color: var(--ink); }
.rt-phone button { font-family: inherit; }
.rt-ph-status { height: 47px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; font: 600 15px var(--mono); }
.rt-ph-notch { width: 110px; height: 30px; border-radius: 999px; background: var(--gray-900); margin-top: -6px; }
.rt-ph-sig { font-size: 12px; }
.rt-ph-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 6px; height: 56px; font-size: 15.5px; }
.rt-ph-head b { font: 600 15px var(--mono); }
.rt-ph-back { width: 56px; height: 56px; border: 0; background: transparent; font-size: 24px; color: var(--ink); }
.rt-ph-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.rt-ph-foot { flex: none; padding: 10px 18px 30px; background: var(--gray-75); display: flex; flex-direction: column; gap: 8px; }
.rt-phone button:disabled { cursor: default; opacity: 1; }
.rt-ph-main { height: 56px; border: 0; border-radius: 12px; background: var(--gray-900); color: var(--surface); font-size: 16px; font-weight: 600; flex: 1; }
.rt-ph-sec { height: 56px; border: 1px solid var(--gray-300); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 500; flex: 1; }
.rt-ph-cancel { height: 56px; border: 1px solid var(--red-200); border-radius: 12px; background: var(--surface); color: var(--danger); font-size: 15px; font-weight: 500; }
.rt-ph-note { font-size: 13px; color: var(--muted); text-align: center; }
.rt-ph-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-ph-ask { padding: 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--approval-warn-line); display: flex; flex-direction: column; gap: 10px; }
.rt-ph-ask > span, .rt-ph-late > span { font-size: 15px; line-height: 1.45; }
.rt-ph-ask b { font-weight: 600; color: var(--warn); }
.rt-ph-late { padding: 14px; border-radius: 12px; background: var(--surface); border: 2px solid var(--danger); display: flex; flex-direction: column; gap: 10px; }
.rt-ph-late b { font-weight: 600; }
.rt-ph-late .rt-ph-two { display: flex; gap: 8px; }
.rt-ph-card { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--gray-300); display: flex; flex-direction: column; gap: 6px; }
.rt-ph-card b { font-weight: 600; }
.rt-ph-quote { font-size: 15px; line-height: 1.45; }
.rt-ph-who { font-size: 13px; color: var(--muted); }
.rt-ph-title { font-size: 24px; font-weight: 600; }
.rt-ph-tl { list-style: none; margin: 0; padding: 16px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; }
.rt-tl { display: flex; gap: 14px; }
.rt-tl-mark { display: flex; flex-direction: column; align-items: center; width: 28px; flex: none; }
.rt-tl-dot { width: 28px; height: 28px; border-radius: 999px; background: var(--surface); color: var(--gray-500); border: 2px solid var(--gray-300); display: grid; place-items: center; font-size: 13px; font-weight: 700; box-sizing: border-box; }
.rt-tl.is-cur .rt-tl-dot { border-color: var(--gray-900); }
.rt-tl.is-done .rt-tl-dot { background: var(--gray-900); color: var(--brand-lime); border-color: var(--gray-900); }
.rt-tl-line { flex: 1; width: 2px; min-height: 22px; background: var(--gray-300); }
.rt-tl.is-done .rt-tl-line { background: var(--gray-900); }
.rt-tl-text { flex: 1; padding: 3px 0 16px; display: flex; flex-direction: column; gap: 2px; }
.rt-tl-label { font-size: 15.5px; font-weight: 400; color: var(--muted); }
.rt-tl.is-done .rt-tl-label { font-weight: 500; color: var(--ink); }
.rt-tl.is-cur .rt-tl-label { font-weight: 700; color: var(--ink); }
.rt-tl-at { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.rt-ph-summary { padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.rt-ph-closed { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.rt-ph-bang { width: 56px; height: 56px; border-radius: 16px; background: var(--gray-100); color: var(--ink-2); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.rt-ph-closed strong { font-size: 24px; font-weight: 600; line-height: 1.25; }
.rt-ph-closed > span:not(.rt-ph-bang) { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.rt-ph-closed .rt-ph-main { flex: none; border-radius: 14px; font-size: 17px; }
