/* ЛекБаланс — пакет Б «Структура экранов» (подготовлен 28.10.2026, база v37.30).
   Подключается после mobile-layout.css (и после polish-a.css, если пакет А внесён).
   Работает в паре с правками app.js и mobile-layout.js из папки «Патчи».
   Не меняет палитру, пять статусов, тексты предупреждений и медицинские данные. */

/* Б1. «Добавить средство».
   Телефон: у нижней панели сплошной фон и линия сверху — содержимое больше не просвечивает сквозь градиент.
   Компьютер (от 821 px): кнопка в шапке «Аптеки», нижняя полоса на всю ширину скрыта;
   «Изменить / Заменить упаковку» в карточке — по ширине содержимого, а не на 970 px. */
html:root body .x-dock{background:var(--bg);box-shadow:0 -1px 0 var(--border)}
html:root body .x-head-act{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
html:root body .x-add-top{display:none}
@media (min-width:821px){
  html:root body .x-add-top{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 18px;white-space:nowrap}
  html:root body .x-add-top svg{width:20px;height:20px}
  html:root body .x-dock:has(> [data-act=addSheet]){display:none}
  html:root body .x-dock.two{display:flex;justify-content:flex-start;gap:8px;background:transparent;box-shadow:none}
  html:root body .x-dock.two .btn{width:auto;min-width:200px}
}

/* Б2. Карточка: «Для чего применяют» стоит сразу после описания (порядок задан в mobile-layout.js). */
html:root body .x-det.x-ind{margin-top:12px}
html:root body .x-det>summary{min-height:48px;display:flex;align-items:center;padding:0;box-sizing:border-box}

/* Б3. Кнопка удаления в карточке: корзина и подпись «Удалить» вместо «×», который читается как «закрыть». */
html:root body .x-ib.x-rmk{width:auto;min-width:48px;padding:0 14px;grid-auto-flow:column;gap:8px;font-weight:600;white-space:nowrap;color:var(--danger)}
html:root body .x-ib.x-rmk svg{flex:none}
@media (max-width:380px){html:root body .x-ib.x-rmk{padding:0 10px;gap:6px;min-width:44px}}
html:root[data-large=true] body .x-ib.x-rmk{padding:0 10px;gap:6px}

/* Б4. Обрезанная цитата из инструкции подписана как фрагмент с названием раздела. */
html:root body .x-frag{margin:6px 0 0;padding-left:10px;border-left:2px solid var(--border);color:var(--muted);font-size:1rem}

/* Б5. «Ещё»: тот же список с иконками, что и на других экранах; шапка не растягивается на коротких страницах. */
@media (max-width:820px){html:root body #app{align-content:start}}
html:root body .x-row .pill{margin-left:auto;flex:none}
html:root body .x-row .pill+.x-chev{margin-left:0}
html:root body .x-about{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-card);box-shadow:var(--shadow);padding:4px 16px}
html:root body .x-about p{margin:12px 0}

/* Б7. Схема сочетаний: подписи крупнее и дальше от кружка, связи толще,
   «учитывать при приёме» — пунктир, чтобы уровни различались без цвета. */
html:root body .map .lbl{font-size:15px}
html:root body .map.many .pl.high .vis{stroke-width:4.5}
html:root body .map.many .pl.moderate .vis{stroke-width:4}
html:root body .map.many .pl.low .vis{stroke-width:3;stroke-dasharray:6 5}
html:root body .map .pl.low .vis{stroke-dasharray:6 5}

/* v37.32. «Требует внимания» — общий заголовок над вкладками «Лекарства и БАДы» и «Еда и напитки». */
html:root body .x-att-h{border-bottom:0;padding:14px 16px 6px;gap:12px}
html:root body .x-att-h h2{margin:0;font-size:1.0625rem;font-weight:700;color:var(--text);line-height:1.3}
html:root body .x-att-h .num{min-width:24px;height:24px;padding:0 7px;border-radius:12px;display:inline-grid;place-items:center;background:var(--x-line);color:var(--text);font-size:.875rem;font-weight:700;font-variant-numeric:tabular-nums}
html:root body .x-att-h:has(+ .x-pane){border-bottom:1px dashed var(--x-line);padding-bottom:12px}
html:root body .x-tabs-w .x-tabs{padding-top:2px}
html:root body .x-pane > .x-fd-none{margin:0;padding:16px}

/* v37.36: блок «Из официальной инструкции» (по образцу .fd-more) */
.instr{margin:14px 0 0}
.instr>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--primary)}
.instr>summary .muted{margin-left:auto}
.instr>summary::-webkit-details-marker,.instr-s>summary::-webkit-details-marker{display:none}
.instr>summary::after,.instr-s>summary::after{content:"";width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-4px;flex:none;transition:transform .15s}
.instr[open]>summary::after,.instr-s[open]>summary::after{transform:rotate(-135deg);margin-top:4px}
.instr>summary:focus-visible,.instr-s>summary:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
.instr-doc{margin:10px 2px 6px;line-height:1.45}
.instr-other{margin:10px 2px 4px;padding:10px 12px;border-radius:10px;background:var(--warn-soft);color:var(--text);line-height:1.45}
.instr-s{border-top:1px solid var(--border);margin:0 2px}
.instr-s>summary{cursor:pointer;list-style:none;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:600;color:var(--text)}
.instr-t{line-height:1.55;padding:0 0 12px;max-height:360px;overflow:auto;overscroll-behavior:contain;color:var(--text)}
@media (prefers-reduced-motion:reduce){.instr>summary::after,.instr-s>summary::after{transition:none}}

/* v37.39: на телефоне нижние кнопки больше не закрывают список на первом экране (аудит D-14, D-16).
   «Аптека»: «Добавить» в шапке рядом с заголовком (как на компьютере); «Напоминания»: «Пропустить / Принял» — внутри карточки текущего приёма. */
@media (max-width:820px){
  html:root body .x-head-act{flex-wrap:wrap;align-items:center;row-gap:10px}
  html:root body .x-add-top{display:inline-flex;align-items:center;gap:6px;min-height:48px;padding:0 16px;white-space:nowrap;flex:none}
  html:root body .x-add-top svg{width:20px;height:20px}
  html:root body .x-add-w{display:none}
}
html:root body .x-dock.x-dock-in{position:static;margin:16px 0 0;padding:0;background:none;box-shadow:none}
html:root body .x-dock.x-dock-in .btn{min-height:52px}
@media (max-width:820px){
  html:root body .x-dock.x-dock-in{grid-template-columns:1fr;gap:8px}
  html:root body .x-dock.x-dock-in .btn:not(.quiet){order:-1}
}
