/* «Данные рейтинга» (src/ratingdata.js) — окно поверх «Эффективности»:
   таблицы задач, месяцы цикла, смены ведущих.

   30.09.2026 переделано: прежнее окно было широкой плоской плашкой в
   1040 пикселей, высотой «по содержимому» — от вкладки к вкладке оно
   прыгало, а половину его занимали абзацы пояснений. Теперь размер
   постоянный, пояснения — в значках ⓘ, края у заголовка, вкладок и
   содержимого — по одной линии. */
.rt-modal { animation: rt-fade .16s var(--ease); }
.rt-card {
  position: relative;
  width: min(760px, 100%); height: min(640px, 100%);
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-float);
  overflow: hidden; outline: none;
  animation: rt-in .2s var(--ease);
}
@keyframes rt-fade { from { background: rgba(0, 0, 0, 0); } }
@keyframes rt-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  .rt-modal, .rt-card, .rt-tip { animation: none; }
}

/* ── шапка ── */
.rt-head {
  flex: none; display: flex; align-items: center; gap: 2px;
  padding: 16px 14px 0 22px;
}
.rt-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rt-head .grow { flex: 1; }
.rt-x {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 9px; background: none; color: var(--ink3); cursor: pointer;
}
.rt-x:hover { background: var(--box-bg-h); color: var(--ink); }
.rt-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Вкладки — тем же переключателем, что «Сотрудники | Отделы» на
   странице: окно продолжает страницу, а не приходит из другого набора. */
.rt-nav { flex: none; padding: 12px 22px 14px; border-bottom: 1px solid var(--line2); }
.rt-tabs {
  display: inline-flex; gap: 2px; max-width: 100%; padding: 3px;
  background: var(--raise); border: 1px solid var(--line2); border-radius: 10px;
  overflow-x: auto; scrollbar-width: none;
}
.rt-tabs::-webkit-scrollbar { display: none; }
.rt-tabs button {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border: 0; border-radius: 7.5px; background: none; cursor: pointer; white-space: nowrap;
  color: var(--ink2); font: 500 11.5px var(--sans);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.rt-tabs button:hover { color: var(--ink); }
.rt-tabs button[aria-selected="true"] {
  background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 28, 25, .08);
}
.rt-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rt-tabs i {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--box-bg);
  font: 600 9.5px var(--sans); font-style: normal; color: var(--ink3);
}
.rt-tabs button[aria-selected="true"] i { background: var(--brand-tint); color: var(--brand-deep); }
.rt-tabs .rt-ts { display: none; }

/* Вложенный вид: «←» и что открыто — на месте вкладок. */
.rt-crumb { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.rt-back {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line2); border-radius: 9px; background: var(--card);
  color: var(--ink2); cursor: pointer;
}
.rt-back:hover { background: var(--raise); border-color: var(--line); color: var(--ink); }
.rt-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round; }
.rt-crumb-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rt-crumb-t b, .rt-crumb-t span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rt-crumb-t b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.rt-crumb-t span { font-size: 10.5px; color: var(--ink3); }

/* ── содержимое ── */
.rt-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 22px 22px;
}
.rt-body > * { flex: none; }
.rt-foot {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-top: 1px solid var(--line2); background: var(--card);
}
.rt-foot[hidden] { display: none; }
.rt-foot .grow { flex: 1; }
.rt-foot-note { font-size: 10.5px; color: var(--ink3); }

.rt-state, .rt-empty {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 28px 12px; text-align: center; color: var(--ink3); font-size: 11px; line-height: 1.5;
}
.rt-state b, .rt-empty b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.rt-state.bad > svg { width: 30px; height: 30px; margin-bottom: 4px; fill: none; stroke: var(--bad);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rt-state.bad span { max-width: 460px; }
.rt-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line2); border-top-color: var(--brand);
  animation: rt-spin .75s linear infinite;
}
@keyframes rt-spin { to { transform: rotate(360deg); } }
.rt-sub { display: block; margin-top: 1px; font-size: 10px; color: var(--ink3); line-height: 1.35; }

/* ── значок ⓘ и его подсказка ── */
.rt-i {
  flex: none; display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin: -3px 0 -3px 2px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ink4, var(--ink3));
  vertical-align: middle; cursor: help;
}
.rt-i svg { width: 14.5px; height: 14.5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rt-i:hover, .rt-i[aria-describedby] { background: var(--brand-tint); color: var(--brand-deep); }
.rt-i:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rt-tip {
  position: fixed; z-index: 95;
  width: max-content; max-width: min(300px, calc(100vw - 16px));
  padding: 9px 12px; border-radius: 10px;
  background: var(--ink); color: var(--card);
  font: 400 11px/1.5 var(--sans); white-space: pre-line;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  pointer-events: none;
  animation: rt-tip .12s var(--ease);
}
.rt-tip::before {
  content: ""; position: absolute; top: -4px; left: var(--ax, 50%);
  width: 9px; height: 9px; margin-left: -4.5px;
  background: inherit; border-radius: 2px; transform: rotate(45deg);
}
.rt-tip.up::before { top: auto; bottom: -4px; }
@keyframes rt-tip { from { opacity: 0; transform: translateY(3px); } }

/* ── загрузка файла ── */
.rt-drop {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 16px; border: 1.5px dashed var(--line); border-radius: 12px;
  background: var(--raise); color: var(--ink2); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.rt-drop:hover, .rt-drop:focus-visible { border-color: var(--brand); background: var(--brand-tint); outline: none; }
.rt-drop-ic {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; background: var(--card); color: var(--brand-deep);
  box-shadow: 0 1px 2px rgba(29, 28, 25, .08);
}
.rt-drop-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.rt-drop-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-drop-t b { font-size: 12px; font-weight: 600; color: var(--ink); }
.rt-drop-t span { font-size: 10.5px; color: var(--ink3); }
.rt-drop .rt-tap { display: none; }
.rt-drop.big {
  flex: 1 0 auto; flex-direction: column; justify-content: center; gap: 14px;
  min-height: 300px; padding: 32px 24px; text-align: center;
}
.rt-drop.big .rt-drop-ic { width: 54px; height: 54px; border-radius: 16px; }
.rt-drop.big .rt-drop-ic svg { width: 25px; height: 25px; }
.rt-drop.big .rt-drop-t { align-items: center; gap: 4px; }
.rt-drop.big .rt-drop-t b { font-size: 14.5px; letter-spacing: -.01em; }
.rt-drop.big .rt-drop-t span:not(.rt-dnd):not(.rt-tap) { font-size: 11.5px; color: var(--ink2); }
.rt-drop-btn {
  display: inline-flex; align-items: center; height: 30.5px; padding: 0 14px;
  border-radius: 9px; background: var(--brand); color: var(--on-brand); font: 600 11px var(--sans);
}
.rt-drop.big:hover .rt-drop-btn { background: var(--brand-deep); }
@media (hover: none) and (pointer: coarse) {
  .rt-drop .rt-dnd { display: none; }
  .rt-drop .rt-tap { display: inline; }
}
/* Файл тащат над окном — показываем, куда бросить. */
.rt-card.rt-dragging::after {
  content: "Отпустите файл — загрузим"; position: absolute; inset: 10px; z-index: 5;
  display: grid; place-items: center; border: 2px dashed var(--brand); border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--brand));
  color: var(--brand-deep); font: 600 13px var(--sans);
  pointer-events: none;
}

/* ── список таблиц ── */
.rt-list { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.rt-item {
  display: flex; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line2); background: var(--card);
  transition: background .12s var(--ease);
}
.rt-item:first-child { border-top: 0; }
.rt-item:hover { background: var(--raise); }
.rt-item.asking { background: var(--bad-soft); }
.rt-row {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 11px 8px 11px 14px; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.rt-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 10px; }
.rt-ico {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; background: var(--box-bg); color: var(--ink2);
}
.rt-ico.sum { background: var(--brand-tint); color: var(--brand-deep); }
.rt-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.rt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rt-txt b, .rt-txt span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rt-txt b { font-size: 12px; font-weight: 600; color: var(--ink); }
.rt-txt span { font-size: 10.5px; color: var(--ink3); }
.rt-val {
  flex: none; padding: 2px 8px; border-radius: 999px;
  background: var(--box-bg); color: var(--ink2); font: 600 11px var(--mono);
}
.rt-val i { font-style: normal; font-weight: 400; color: var(--ink3); }
.rt-val.ok { background: var(--ok-soft); color: var(--ok); }
.rt-val.late { background: var(--warn-soft); color: var(--warn); }
.rt-val.over { background: var(--bad-soft); color: var(--bad); }
.rt-acts { flex: none; display: flex; align-items: center; gap: 2px; padding-right: 10px; }
.rt-ib {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--ink3); cursor: pointer;
  transition: opacity .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
}
.rt-ib svg { width: 15.5px; height: 15.5px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.rt-ib:hover { background: var(--brand-tint); color: var(--brand-deep); }
.rt-ib.warn:hover { background: var(--bad-soft); color: var(--bad); }
.rt-ib:focus-visible { outline: 2px solid var(--brand); outline-offset: -1px; }
/* Значки действий — по наведению на строку: в покое список читается
   без них. С клавиатуры и на телефоне — видны всегда. */
@media (hover: hover) {
  .rt-item:not(:hover):not(:focus-within) .rt-ib { opacity: 0; }
}
.rt-ask { margin-right: 4px; font-size: 11px; font-weight: 500; color: var(--bad); white-space: nowrap; }
.rt-acts .btn.sm { height: 27px; }
.rt-item-warn {
  flex: 1 1 100%; display: flex; align-items: center; gap: 6px;
  margin-top: -5px; padding: 0 14px 10px 58px;
  font-size: 10.5px; color: var(--warn);
}
.rt-item-warn > svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rt-item-warn .rt-i { color: var(--warn); }

/* ── разметка столбцов ── */
.rt-form {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px 14px; align-items: center;
}
.rt-fl { display: flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--ink2); }
.rt-form .fld { max-width: 380px; }
.rt-form .rt-fw { max-width: 220px; }
.rt-seg {
  justify-self: start; display: inline-flex; gap: 2px; padding: 3px;
  background: var(--raise); border: 1px solid var(--line2); border-radius: 10px;
}
.rt-seg label {
  position: relative; display: inline-flex; align-items: center; height: 27px; padding: 0 12px;
  border-radius: 7.5px; color: var(--ink2); font: 500 11.5px var(--sans); cursor: pointer; white-space: nowrap;
}
.rt-seg label:hover { color: var(--ink); }
.rt-seg label.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 28, 25, .08); }
.rt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rt-seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.rt-repl { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: var(--ink); cursor: pointer; }
.rt-repl input { flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.rt-repl i { display: block; font-style: normal; font-size: 10.5px; color: var(--ink3); }

.rt-sec-h { display: flex; align-items: center; margin-bottom: 8px; font-size: 11px; font-weight: 600; color: var(--ink2); }
.rt-map { border: 1px solid var(--line2); border-radius: 12px; }
.rt-mrow {
  display: grid; grid-template-columns: 20px 118px minmax(0, 210px) minmax(0, 1fr);
  align-items: center; gap: 10px; padding: 7px 12px;
  border-top: 1px solid var(--line2);
}
.rt-mrow:first-child { border-top: 0; }
.rt-mst {
  width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
  background: var(--box-bg); color: var(--ink3); font: 700 10px var(--sans);
}
.rt-mst svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rt-mrow.on .rt-mst { background: var(--ok-soft); color: var(--ok); }
.rt-mrow.miss .rt-mst { background: var(--bad-soft); color: var(--bad); }
.rt-ml { font-size: 11.5px; color: var(--ink); }
.rt-ml i { margin-left: 2px; font-style: normal; color: var(--bad); }
.rt-mrow:not(.on) .rt-ml { color: var(--ink2); }
.rt-mv { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10.5px; color: var(--ink3); }
.rt-warn-line {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-size: 11px; line-height: 1.45;
}
.rt-warn-line > svg { flex: none; width: 14px; height: 14px; margin-top: 1px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Как платформа видит файл — свёрнуто: нужно, только если узнала неверно. */
.rt-peek { border: 1px solid var(--line2); border-radius: 12px; }
.rt-peek > summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  list-style: none; cursor: pointer; border-radius: 12px;
  font-size: 11px; color: var(--ink3);
}
.rt-peek > summary::-webkit-details-marker { display: none; }
.rt-peek > summary:hover { background: var(--raise); }
.rt-peek > summary b { font-weight: 600; color: var(--ink2); }
.rt-peek > summary svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .15s var(--ease); }
.rt-peek[open] > summary svg { transform: rotate(90deg); }
.rt-peek-b { display: flex; flex-direction: column; gap: 10px; padding: 2px 12px 12px; }
.rt-hrow { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink2); }
.rt-hrow .fld { width: 76px; }
.rt-scroll { overflow-x: auto; }
.rt-sample { border: 1px solid var(--line2); border-radius: 10px; }
.rt-sample .rt-tbl { font-size: 10.5px; }
.rt-sample .rt-tbl th { position: static; }
.rt-sample .rt-tbl td, .rt-sample .rt-tbl th {
  max-width: 220px; padding: 6px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rt-sample .rt-tbl td.on { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.rt-sample .rt-tbl th.on { background: var(--brand-tint); color: var(--ink); }
.rt-chip {
  display: block; width: max-content; margin-bottom: 3px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand);
  font-size: 9px; font-weight: 600; line-height: 15px;
}

/* ── загружено ── */
.rt-done {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 20px 8px; text-align: center;
}
.rt-done-ic {
  width: 54px; height: 54px; margin-bottom: 8px; display: grid; place-items: center;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok);
}
.rt-done-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; }
.rt-done > b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rt-done-sub { font-size: 11.5px; color: var(--ink2); }
.rt-notes {
  display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 520px;
  margin: 12px 0 0; padding: 0; list-style: none; text-align: left;
}
.rt-notes li { padding: 8px 12px; border-radius: 10px; background: var(--raise); font-size: 11px; line-height: 1.45; color: var(--ink2); }
.rt-notes li.warn { background: var(--warn-soft); color: var(--warn); }
.rt-done-n { margin-top: 12px; font-size: 10.5px; color: var(--ink3); }

/* ── таблицы: строки, месяцы, смены ── */
.rt-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.rt-tbl th {
  position: sticky; top: -18px; z-index: 1;
  padding: 7px 10px; background: var(--card); border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap; font-size: 10px; font-weight: 500; color: var(--ink3);
}
.rt-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.rt-tbl tbody tr:last-child td { border-bottom: 0; }
/* Крайние колонки — без внутренних полей: текст таблицы стоит по той же
   линии, что заголовок окна и вкладки. */
.rt-tbl:not(.rt-sample *) th:first-child, .rt-tbl:not(.rt-sample *) td:first-child { padding-left: 0; }
.rt-tbl:not(.rt-sample *) th:last-child, .rt-tbl:not(.rt-sample *) td:last-child { padding-right: 0; }
.rt-tbl .r { text-align: right; }
.rt-tbl .num { font-family: var(--mono); font-size: 11px; }
.rt-tbl td b { font-weight: 600; }
.rt-tbl th .rt-i { width: 20px; height: 20px; }

.rt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-fchip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--card);
  color: var(--ink2); font: 500 11px var(--sans); cursor: pointer;
}
.rt-fchip i { font-style: normal; font-size: 10px; color: var(--ink3); }
.rt-fchip:hover { border-color: var(--line); color: var(--ink); }
.rt-fchip.on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-deep); }
.rt-fchip.on i { color: var(--brand-deep); }

/* Оценка строки — тем же языком, что клетки матрицы. */
.rt-v {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; white-space: nowrap;
  background: var(--box-bg); color: var(--ink2);
}
.rt-v.ok { background: var(--ok-soft); color: var(--ok); }
.rt-v.late, .rt-v.wait { background: var(--warn-soft); color: var(--warn); }
.rt-v.over { background: var(--bad-soft); color: var(--bad); }

.rt-from { color: var(--ink3); }
.rt-arr { margin: 0 6px; color: var(--ink3); }
.rt-who { font-size: 10.5px; color: var(--ink2); white-space: nowrap; }
.rt-who span { display: block; font-size: 10px; color: var(--ink3); }
.rt-date {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: 400 11px var(--mono);
}
.rt-date:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rt-date.bad { border-color: var(--bad); }
.rt-date.saved { border-color: var(--ok); }

/* Кнопка «Данные» в шапке «Эффективности» — рядом с фильтрами. */
.rt-open {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 31px; padding: 0 10px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--raise);
  color: var(--ink2); font: 500 11px var(--sans); cursor: pointer;
}
.rt-open[hidden] { display: none; }
.rt-open:hover { color: var(--ink); background: var(--card); }
.rt-open svg {
  width: 14.5px; height: 14.5px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* Ноутбук: «Данные» — одним значком (подпись — во всплывающей
   подсказке), иначе фильтрам не хватало ширины и последний уезжал
   на вторую строку один. */
@media (min-width: 685px) and (max-width: 1100px) {
  .rt-open span { display: none; }
  .rt-open { width: 31px; padding: 0; justify-content: center; }
}

/* ── телефон: окно во весь экран ── */
@media (max-width: 684px) {
  .rt-modal { padding: 0; }
  .rt-card { width: 100%; height: 100%; border-radius: 0; }
  .rt-head { padding: 12px 8px 0 16px; }
  .rt-nav { padding: 10px 16px 12px; }
  .rt-tabs { display: flex; }
  .rt-tabs button { flex: 1 0 auto; padding: 0 10px; }
  .rt-tabs .rt-tl { display: none; }
  .rt-tabs .rt-ts { display: inline; }
  .rt-body { padding: 14px 16px 18px; gap: 12px; }
  .rt-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .rt-foot .btn { height: 40px; padding: 0 16px; }
  .rt-open span { display: none; }
  .rt-open { width: 31px; padding: 0; justify-content: center; }

  .rt-drop.big { min-height: 0; }
  .rt-row { gap: 10px; padding: 11px 6px 11px 12px; }
  .rt-txt span { white-space: normal; }
  .rt-item-warn { padding-left: 54px; }
  .rt-acts { padding-right: 8px; }
  .rt-item.asking .rt-acts { flex: 1 1 100%; justify-content: flex-end; padding: 0 12px 10px; }

  .rt-form { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .rt-form > .rt-fl:not(:first-child) { margin-top: 8px; }
  .rt-form > span:empty { display: none; }
  .rt-form .fld, .rt-form .rt-fw { max-width: none; }
  .rt-seg { display: flex; }
  .rt-seg label { flex: 1; justify-content: center; }
  .rt-mrow { grid-template-columns: 20px minmax(0, 1fr); gap: 5px 10px; padding: 9px 12px; }
  .rt-mrow .fld, .rt-mrow .rt-mv { grid-column: 2; }

  .rt-tbl .hs { display: none; }
  .rt-tbl th { top: -14px; }
  /* Смены ведущих — карточками: четыре колонки в 340 пикселей давали
     столбик по слову. */
  .rt-leads thead { display: none; }
  .rt-leads, .rt-leads tbody { display: block; }
  .rt-leads tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
    padding: 11px 0; border-bottom: 1px solid var(--line2);
  }
  .rt-leads tr:last-child { border-bottom: 0; }
  .rt-leads td { display: block; padding: 0 !important; border: 0; }
  .rt-leads .rt-obj { grid-column: 1 / -1; }
  .rt-leads .rt-who { grid-column: 1 / -1; text-align: left; }
  .rt-leads .rt-who span { display: inline; margin-left: 5px; }
}
