/* ============================================================
   Розділ «Рентген та ДІВ»
   Свідомо БЕЗ шеренги фільтрів: замість шести селектів — постійне
   дерево зліва (те, що працює в НК 025/026) і суцільна читалка справа.
   Кольори — лише через токени порталу, щоб темна тема працювала сама.
   ============================================================ */

.rt-hero h1 { margin-bottom: 6px; }

/* Позначки нечинності — на наявній ролі --warning-*, а не на власних
   кольорах: у порталу вже є значення цієї ролі для обох тем. Свій
   «червоний» тут дав би світлу пляму в темній темі. */
.rt-stat-warn strong { color: var(--warning-text); }

.rt-layout {
  /* Портальний .layout — це двоколонковий grid (minmax(470px,.9fr) +
     minmax(450px,1.1fr)). Без цього скидання вкладки лягають у ліву
     колонку, вміст — у праву, і півекрана лишається порожнім.
     Свою сітку розділ будує нижче, у .rt-body. */
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

/* ---------- перемикач режимів ---------- */
.rt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.rt-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rt-tab:hover { color: var(--accent-dark); background: var(--accent-soft); }
.rt-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 -2px 0 var(--accent) inset;
}

.rt-view { display: none; }
.rt-view.is-visible { display: block; }

.rt-lead {
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}
.rt-lead strong { color: var(--ink); }

/* ---------- пошук і чипси ---------- */
.rt-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rt-search { position: relative; flex: 1 1 420px; }
.rt-search input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  font: inherit;
  font-size: 15px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.rt-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.rt-search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .55; pointer-events: none;
}
.rt-search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--soft); color: var(--muted);
  width: 27px; height: 27px; border-radius: 50%; cursor: pointer; font-size: 13px;
}
.rt-search-clear:hover { background: var(--accent-soft); color: var(--accent-dark); }

.rt-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.rt-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.rt-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.rt-chip.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- каркас: дерево + читалка ---------- */
.rt-body {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
.rt-body-pkg { grid-template-columns: minmax(260px, 330px) 1fr; }

.rt-tree, .rt-pkglist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  position: sticky;
  top: 12px;
}
.rt-reader, .rt-pkgdetail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 30px 40px;
  min-height: 340px;
  scroll-margin-top: 12px;
}

/* ---------- дерево ---------- */
.rt-contour {
  font-size: 11px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 6px;
}
.rt-doc { margin-bottom: 2px; }
/* Вузли дерева й картки — посилання, а не кнопки: у кожного екрана є адреса,
   тож їх можна відкрити в новій вкладці й кинути в лист. */
.rt-doc-btn {
  width: 100%; text-align: left; text-decoration: none;
  border: none; background: transparent; color: var(--ink);
  font: inherit; font-size: 13.5px; line-height: 1.35;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  display: flex; gap: 8px; align-items: baseline;
}
.rt-doc-btn:hover { background: var(--soft); }
.rt-doc.is-open > .rt-doc-btn { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.rt-doc-num { font-weight: 700; white-space: nowrap; font-size: 12.5px; opacity: .8; }
.rt-doc-name { flex: 1; }
.rt-dead {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  color: var(--warning-text); white-space: nowrap;
}

.rt-nodes { display: none; padding: 2px 0 8px 6px; border-left: 2px solid var(--line); margin-left: 12px; }
.rt-doc.is-open .rt-nodes { display: block; }
.rt-node {
  width: 100%; text-align: left; text-decoration: none;
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; line-height: 1.4;
  padding: 5px 8px; border-radius: 7px; cursor: pointer;
  display: block;
}
.rt-node:hover { background: var(--soft); color: var(--ink); }
.rt-node.is-current { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.rt-node b { font-weight: 700; color: var(--ink); }
.rt-node.lvl-5 { padding-left: 20px; }
.rt-node.lvl-6 { padding-left: 32px; font-size: 12px; }
.rt-node-more {
  font-size: 12px; color: var(--accent-dark); background: none; border: none;
  cursor: pointer; padding: 6px 8px; font: inherit; font-weight: 600;
}

/* ---------- читалка ---------- */
.rt-doc-head { border-bottom: 2px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.rt-doc-kind {
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-dark);
}
.rt-doc-title { font-size: 22px; line-height: 1.3; margin: 8px 0 12px; color: var(--ink); }
.rt-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.rt-meta b { color: var(--ink); font-weight: 700; }
.rt-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.rt-badge.ok { background: var(--accent-soft); color: var(--accent-dark); }
.rt-badge.no { background: var(--warning-bg); color: var(--warning-text); }

.rt-alert {
  border-left: 4px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 12px 16px; border-radius: 8px; margin: 16px 0;
  font-size: 13.5px; line-height: 1.5;
}
.rt-alert b { color: var(--warning-text); }
.rt-amend {
  background: var(--soft); border-radius: 8px; padding: 12px 16px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 20px;
}
/* Пояснення походження тексту: акт не з rada або зі свідомо проставленим
   статусом. Не тривога — довідка, тому тон спокійніший за .rt-alert. */
.rt-source {
  border-left: 3px solid var(--border);
  background: var(--soft); border-radius: 8px; padding: 11px 15px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 14px 0 20px;
}

.rt-preamble { font-size: 14px; line-height: 1.65; color: var(--muted); margin-bottom: 24px; }

.rt-sec { scroll-margin-top: 16px; padding: 2px 0; }
.rt-sec-head {
  display: flex; gap: 10px; align-items: baseline;
  margin: 22px 0 6px;
}
.rt-sec.lvl-5 .rt-sec-head { margin: 16px 0 4px; }
.rt-sec.lvl-6 .rt-sec-head { margin: 12px 0 4px; }
.rt-sec-num {
  font-weight: 800; font-size: 13px; color: var(--accent-dark);
  white-space: nowrap; min-width: 62px;
}
.rt-sec-title { font-weight: 700; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.rt-sec.lvl-5 .rt-sec-title { font-size: 14px; }
.rt-sec.lvl-6 .rt-sec-title { font-size: 13.5px; font-weight: 600; }
.rt-sec-body {
  font-size: 14.5px; line-height: 1.72; color: var(--ink);
  padding-left: 72px; white-space: pre-wrap;
}
.rt-sec.lvl-5 .rt-sec-body, .rt-sec.lvl-6 .rt-sec-body { font-size: 14px; }
.rt-sec.is-hit { background: var(--accent-soft); border-radius: 8px; }
mark { background: #ffe58a; color: #4a3200; border-radius: 3px; padding: 0 2px; }

/* ---------- пакети ---------- */
.rt-pkg-btn {
  width: 100%; text-align: left; text-decoration: none;
  border: none; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1.35;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  display: flex; gap: 9px; align-items: baseline;
}
.rt-pkg-btn:hover { background: var(--soft); }
.rt-pkg-btn.is-current { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.rt-pkg-n {
  font-weight: 800; font-size: 12.5px; min-width: 24px;
  color: var(--accent-dark);
}
.rt-cls {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; margin-right: 4px;
  background: var(--soft); color: var(--muted); white-space: nowrap;
}
.rt-cls.therapy { background: #fde9d7; color: #9a4b06; }
.rt-cls.nuclear { background: #e7e0fb; color: #5b3fa8; }
.rt-cls.diagnostic { background: var(--accent-soft); color: var(--accent-dark); }
/* Плашки класів ДІВ — єдине місце з власними кольорами (три класи треба
   розрізняти на око). Тому для темної теми потрібні явні пари, інакше
   світлий фон лишається плямою. */
:root.dark-theme .rt-cls.therapy { background: #45280a; color: #fbbf78; }
:root.dark-theme .rt-cls.nuclear { background: #2e2551; color: #c4b5fd; }

.rt-h3 { font-size: 15px; margin: 22px 0 10px; color: var(--ink); }
.rt-h3:first-of-type { margin-top: 0; }

.rt-eq { margin: 0 0 26px; padding: 0; list-style: none; }
.rt-eq li {
  padding: 12px 15px; margin-bottom: 9px;
  background: var(--soft); border-radius: 9px;
  font-size: 13.5px; line-height: 1.5; color: var(--ink);
}
.rt-eq-name { font-weight: 600; }
.rt-eq-esoz { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.rt-eq-esoz-cap {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.rt-esoz { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.rt-esoz code {
  background: var(--accent-soft); color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  white-space: nowrap;
}
.rt-esoz span { font-size: 13px; color: var(--ink); }
.rt-eq-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* блок «дотичне до ПМГ» у читалці */
.rt-pmg-box {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px; padding: 14px 18px; margin: 16px 0 22px;
}
.rt-pmg-cap {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--accent-dark); margin-bottom: 6px;
}
.rt-pmg-note { font-size: 13.5px; line-height: 1.6; color: var(--ink); margin-bottom: 10px; }
.rt-pmg-toggle { background: var(--surface); }
.rt-sec.is-pmg .rt-sec-num::after {
  content: "🩻"; margin-left: 6px; font-size: 11px;
}
/* Дозвільні блоки згорнуті: сім розгорнутих простирадл — саме те, за що
   розділ і лаяли. Видно назву і скільки актів; пояснення — під підписом. */
.rt-permit {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 9px;
}
.rt-permit[open] { background: var(--soft); }
.rt-permit > summary {
  cursor: pointer; list-style: none;
  display: flex; gap: 10px; align-items: baseline; justify-content: space-between;
}
.rt-permit > summary::-webkit-details-marker { display: none; }
.rt-permit > summary::after {
  content: "▾"; color: var(--muted); font-size: 12px; transition: transform .15s;
}
.rt-permit[open] > summary::after { transform: rotate(180deg); }
.rt-permit-title {
  font-weight: 800; font-size: 14.5px; color: var(--ink);
}
.rt-permit-count { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.rt-permit-note {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  margin: 10px 0; padding-top: 10px; border-top: 1px dashed var(--line);
}
.rt-permit-docs { display: flex; flex-direction: column; gap: 5px; }
.rt-permit-doc {
  border: none; background: var(--surface); color: var(--ink); text-decoration: none;
  font: inherit; font-size: 12.5px; text-align: left;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  display: flex; gap: 9px; align-items: baseline;
}
.rt-permit-doc:hover { background: var(--accent-soft); color: var(--accent-dark); }
.rt-permit-doc.dead { opacity: .72; }

/* ---------- порожньо / службове ---------- */
.rt-empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.rt-empty-ico { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.rt-empty h2 { font-size: 18px; color: var(--ink); margin: 0 0 8px; }
.rt-empty p { font-size: 14px; line-height: 1.6; max-width: 460px; margin: 0 auto; }
.rt-loading { padding: 24px 12px; color: var(--muted); font-size: 13.5px; }
.rt-count { font-size: 12.5px; color: var(--muted); padding: 6px 10px; }

/* ---------- мобільна ---------- */
@media (max-width: 900px) {
  .rt-layout { padding: 12px 12px 40px; }
  .rt-body, .rt-body-pkg { grid-template-columns: 1fr; }
  .rt-tree, .rt-pkglist { position: static; max-height: 46vh; }
  .rt-reader, .rt-pkgdetail { padding: 18px 16px 28px; }
  .rt-sec-body { padding-left: 0; }
  .rt-sec-head { flex-direction: column; gap: 2px; }
  .rt-doc-title { font-size: 18px; }
}

/* ── Майбутні зміни: акт опубліковано, але ще не діє ────────────
   Текст акта лишається чинною редакцією. Накладка не підмінює його, а
   стоїть поруч: інакше портал показував би норму, якої ще немає.
   Тон теплий, не тривожний — це не помилка, а календар. */
.rt-pending {
  border: 1px solid var(--warning-border); border-left: 4px solid var(--warning-border);
  background: var(--warning-bg); color: var(--warning-text);
  border-radius: 10px; margin: 16px 0 22px; overflow: hidden;
}
.rt-pending-cap {
  font-weight: 800; font-size: 13px; letter-spacing: .01em;
  padding: 10px 16px 0;
}
.rt-pending-body { padding: 6px 16px 13px; font-size: 13.5px; line-height: 1.55; }
.rt-pending-body p { margin: 6px 0; }
.rt-pending-body a { color: inherit; font-weight: 700; }
.rt-pending-orphan { opacity: .85; font-size: 12.5px; }

/* Позначка на самому пункті */
.rt-pend-tag {
  margin-left: auto; white-space: nowrap; align-self: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  border-radius: 20px; padding: 2px 9px;
  background: var(--warning-bg); color: var(--warning-text);
}
.rt-sec.is-pending .rt-sec-num { color: var(--warning-text); }
.rt-sec.pend-delete .rt-sec-body { opacity: .6; text-decoration: line-through solid rgba(0,0,0,.18); }

/* Картка самої зміни під текстом пункту */
.rt-change {
  margin: 8px 0 4px 72px; padding: 11px 14px;
  background: var(--soft); border: 1px dashed var(--warning-border);
  border-radius: 9px; font-size: 13px; line-height: 1.55;
}
.rt-ch-head {
  font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--warning-text); margin-bottom: 5px;
}
.rt-ch-scope { font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .8; }
.rt-ch-scope::before { content: " · "; }
.rt-ch-sum { color: var(--ink); }
.rt-ch-now {
  margin-top: 9px; padding: 9px 12px; border-radius: 7px;
  background: var(--surface); border-left: 3px solid var(--accent);
  color: var(--ink); white-space: normal;
}
.rt-ch-now-cap {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 4px;
}
.rt-ch-link { display: inline-block; margin-top: 9px; font-weight: 700; font-size: 12.5px; }

@media (max-width: 720px) {
  .rt-change { margin-left: 0; }
  .rt-pend-tag { margin-left: 0; }
}

/* ============================================================
   Аналітичний шар: розбори рішень
   Світлофор має три тони, і жоден із них не «червоний просто так»:
   ok — шлях є, warn — є, але з умовою, risk — тут норми немає або вона
   проти вас. Портальних ролей для «ok» і «risk» немає, тому пари
   оголошені локально — обидві теми явно, як у плашок класів ДІВ.
   ============================================================ */
.tone-ok   { --tone-fg: #2c6b52; --tone-bg: #eaf6f0; --tone-bd: #a9d8c2; }
.tone-warn { --tone-fg: #7a5000; --tone-bg: #fff3cd; --tone-bd: #ffc107; }
.tone-risk { --tone-fg: #9b2c2c; --tone-bg: #fdecec; --tone-bd: #e8a6a6; }
:root.dark-theme .tone-ok   { --tone-fg: #86e0b8; --tone-bg: #123227; --tone-bd: #2f6b52; }
:root.dark-theme .tone-warn { --tone-fg: #fbbf78; --tone-bg: #3a2a0a; --tone-bd: #7c5310; }
:root.dark-theme .tone-risk { --tone-fg: #f8b4b4; --tone-bg: #3a1a1b; --tone-bd: #7c2d2d; }

/* ---------- смуга навігації: назад + де я ---------- */
.rt-navbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.rt-back {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.rt-back:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.rt-crumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.rt-crumbs a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.rt-crumbs a:hover { text-decoration: underline; }
.rt-crumbs span { color: var(--muted); }
.rt-crumbs i { color: var(--faint); font-style: normal; }

/* ---------- перелік розборів ---------- */
.rt-cases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
/* Власний display перебиває атрибут hidden (у нього лише стиль браузера),
   тому ховати доводиться явно — інакше перелік лишався б висіти над розбором. */
.rt-cases[hidden], .rt-casedetail[hidden], .rt-lead[hidden] { display: none; }
.rt-case {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rt-case:hover {
  border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px);
}
.rt-case-ico { font-size: 26px; line-height: 1.2; }
.rt-case-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rt-case-q { font-size: 15.5px; font-weight: 800; line-height: 1.35; }
.rt-case-verdict {
  font-size: 13px; line-height: 1.45; color: var(--tone-fg);
  background: var(--tone-bg); border-radius: 8px; padding: 7px 11px;
}
.rt-case-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rt-case-meta b { color: var(--accent-dark); }
.rt-case-go { color: var(--faint); font-size: 18px; align-self: center; }

/* ---------- сам розбір ---------- */
.rt-casedetail {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 30px 40px;
}
.rt-case-head { border-bottom: 2px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.rt-case-lead { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 10px 0 12px; }
.rt-case-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rt-normlink {
  color: var(--accent-dark); text-decoration: none; font-weight: 700; font-size: 12.5px;
  background: var(--accent-soft); border-radius: 999px; padding: 5px 12px;
}
.rt-normlink:hover { background: var(--soft-hover); }
.rt-tag {
  font-size: 12px; color: var(--muted); background: var(--soft);
  border-radius: 999px; padding: 5px 12px;
}

/* вердикт і три замки */
.rt-verdict {
  border: 1px solid var(--tone-bd); border-left-width: 5px;
  background: var(--tone-bg); border-radius: 12px; padding: 16px 20px; margin-bottom: 26px;
}
.rt-verdict-head { font-size: 16px; font-weight: 800; color: var(--tone-fg); line-height: 1.4; }
.rt-locks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 14px; }
.rt-lock {
  background: var(--surface); border-radius: 10px; padding: 12px 14px;
  border-top: 3px solid var(--tone-bd);
}
.rt-lock-t { font-weight: 800; font-size: 13px; color: var(--tone-fg); margin-bottom: 5px; }
.rt-lock-x { font-size: 13px; line-height: 1.55; color: var(--ink); }

/* кроки */
.rt-steps { list-style: none; margin: 0 0 26px; padding: 0; }
.rt-step { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.rt-step::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 2px; background: var(--line);
}
.rt-step:last-child::before { display: none; }
.rt-step-n {
  flex: 0 0 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.rt-step.is-opt .rt-step-n { background: var(--soft); color: var(--muted); }
.rt-step-main { flex: 1; padding-top: 4px; }
.rt-step-t { font-size: 15px; font-weight: 800; color: var(--ink); }
.rt-step-opt {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--soft); border-radius: 999px; padding: 2px 9px; margin-left: 8px;
}
.rt-step-facts {
  display: flex; gap: 8px 18px; flex-wrap: wrap; margin: 7px 0;
  font-size: 12.5px; color: var(--muted);
}
.rt-step-facts b { color: var(--ink); font-weight: 700; }
.rt-step-x { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.rt-step-docs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }

/* гроші */
.rt-moneybox {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--soft); border-radius: 12px; padding: 18px 20px; margin-bottom: 26px;
}
.rt-money-rate { display: flex; flex-direction: column; gap: 2px; }
.rt-money-rate b { font-size: 30px; color: var(--accent-dark); line-height: 1.1; }
.rt-money-rate span { font-size: 13px; color: var(--ink); }
.rt-money-rate i { font-size: 11.5px; color: var(--muted); font-style: normal; }
.rt-money-rules p { margin: 0 0 7px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.rt-money-flag { color: var(--warning-text) !important; font-weight: 600; }
.rt-calc { background: var(--surface); border-radius: 10px; padding: 14px 16px; }
.rt-calc-cap {
  font-size: 11px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 9px;
}
.rt-calc label {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink); margin-bottom: 7px;
}
.rt-calc input {
  width: 82px; padding: 6px 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.rt-calc input:focus { outline: none; border-color: var(--accent); }
.rt-calc-out {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13.5px; color: var(--ink);
}
.rt-calc-out b { color: var(--accent-dark); font-size: 16px; }
.rt-calc-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 7px; }

/* що це змінює для пакета */
.rt-impact { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 26px; }
.rt-imp { background: var(--soft); border-radius: 10px; padding: 13px 16px; }
.rt-imp-t { font-weight: 800; font-size: 13.5px; color: var(--ink); margin-bottom: 4px; }
.rt-imp-x { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ризики */
.rt-risks { display: flex; flex-direction: column; gap: 9px; margin-bottom: 26px; }
.rt-risk { border-left: 4px solid var(--line); padding: 11px 15px; background: var(--soft); border-radius: 0 9px 9px 0; }
.rt-risk.lvl-high { border-left-color: #d76a6a; }
.rt-risk.lvl-mid { border-left-color: var(--warning-border); }
.rt-risk.lvl-low { border-left-color: var(--accent); }
.rt-risk-t { font-weight: 800; font-size: 13.5px; color: var(--ink); display: flex; gap: 9px; align-items: baseline; }
.rt-risk-t span {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--surface); border-radius: 999px; padding: 2px 8px;
}
.rt-risk-x { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: 4px; }

/* перелік звільнених типів */
.rt-exempt { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 26px; }
.rt-exempt-head { font-size: 13.5px; color: var(--ink); line-height: 1.5; margin-bottom: 10px; }
.rt-exempt-list { margin: 0 0 12px; padding-left: 22px; columns: 2; column-gap: 26px; }
.rt-exempt-list li { font-size: 13px; line-height: 1.5; margin-bottom: 6px; break-inside: avoid; }
.rt-exempt-foot { font-size: 12.5px; line-height: 1.6; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.rt-exempt-foot b { color: var(--ink); }
.rt-warnline { margin-top: 8px; color: var(--warning-text); }

/* підстави */
.rt-srcs { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-src {
  font-size: 12.5px; text-decoration: none; color: var(--ink);
  background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.rt-src:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

/* ---------- плитки в паспорті пакета ---------- */
.rt-tiles { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.rt-tile {
  background: var(--soft); border-radius: 12px; padding: 12px 16px;
  /* Підпис під числом — 12px, а на такому кеглі --muted на --soft дає 4,37.
     Тому підпис іде на --ink: у плитці він і так короткий. */
  font-size: 12px; color: var(--ink); font-weight: 600; line-height: 1.4; min-width: 130px;
}
.rt-tile span { display: block; font-size: 22px; font-weight: 800; color: var(--accent-dark); }
.rt-tile-wide span { font-size: 15px; }
.rt-caselinks { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 20px; }
.rt-caselink {
  display: block; text-decoration: none; padding: 12px 15px;
  border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 11px;
}
.rt-caselink b { display: block; font-size: 13.5px; color: var(--accent-dark); margin-bottom: 3px; }
.rt-caselink span { font-size: 12.5px; color: var(--ink); line-height: 1.45; }

/* ---------- згортання довгих службових блоків ---------- */
.rt-fold { margin: 14px 0 20px; }
.rt-fold > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--accent-dark);
  list-style: none;
}
.rt-fold > summary::-webkit-details-marker { display: none; }
.rt-fold > summary::before { content: "▸ "; }
.rt-fold[open] > summary::before { content: "▾ "; }
.rt-fold .rt-amend { margin-top: 9px; }

@media (max-width: 900px) {
  .rt-casedetail { padding: 18px 16px 28px; }
  .rt-exempt-list { columns: 1; }
  .rt-cases { grid-template-columns: 1fr; }
  .rt-money-rate b { font-size: 26px; }
}
