/* ==========================================================================
   NKB · ВЪТРЕШНИ СТРАНИЦИ - композиционни модели върху nkb.css
   ========================================================================== */

/* Demo / за потвърждение */
.todo { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); background: #FBF1E2; border: 1px dashed #E7C48E; padding: 2px 7px; border-radius: 4px; vertical-align: middle; white-space: nowrap; }
.ph--night .todo, .section--night .todo { background: rgba(231, 196, 142, .12); color: #E7C48E; border-color: rgba(231, 196, 142, .35); }

/* ---------- PageHero варианти ---------- */
.ph { position: relative; padding-block: clamp(32px, 4vw, 64px) clamp(48px, 5vw, 88px); }
.ph .crumbs { margin-bottom: clamp(28px, 4vw, 56px); }
.ph__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.ph__title { grid-column: 1 / span 8; }
.ph__title .label { margin-bottom: 22px; }
.ph__aside { grid-column: 9 / -1; color: var(--ink-2); }
.ph__search { grid-column: 1 / span 9; margin-top: clamp(28px, 3vw, 44px); }
.ph__filters { grid-column: 1 / -1; margin-top: 18px; }
@container (max-width: 860px) { .ph__title, .ph__aside, .ph__search { grid-column: 1 / -1; } }

.ph--night { background: var(--night); color: var(--night-ink); margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + clamp(32px, 4vw, 64px)); overflow: hidden; }
.ph--night::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 45% 60% at 80% 40%, rgba(47, 107, 219, .14), transparent 70%), radial-gradient(ellipse 25% 30% at 82% 60%, rgba(227, 6, 19, .06), transparent 70%); }
.ph--night > .wrap { position: relative; }
.ph--night .crumbs, .ph--night .label, .ph--night .ph__aside, .ph--night .t-muted { color: var(--night-muted); }
.ph--night .crumbs [aria-current] { color: var(--night-ink); }
.ph--night .crumbs li + li::before { color: var(--night-line); }
.ph--night .search__box { background: rgba(255, 255, 255, .04); border-color: var(--night-line); }
.ph--night .search__input { color: #fff; }
.ph--night .search__box .i { color: var(--night-muted); }
.ph--night .search__box:focus-within { border-color: var(--night-ink); box-shadow: 0 0 0 6px rgba(255, 255, 255, .06); }
.ph--night .kbd { background: transparent; border-color: var(--night-line); color: var(--night-muted); }
.ph--night .chip { color: var(--night-ink); border-color: var(--night-line); }
.ph--night .chip:hover { border-color: var(--night-ink); }
.ph--night .chip[aria-pressed='true'] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.ph--night .search__results { color: var(--ink); }
.ph--night .heart { --hs: rgba(207, 216, 230, .62); --heart-fill-hi: #172338; --heart-fill-lo: #0A1220; }

/* ---------- Secondary sticky nav ---------- */
.subnav { position: sticky; top: var(--header-h); z-index: 30; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line-2); }
.subnav__in { display: flex; align-items: center; gap: 24px; height: 60px; }
.subnav__title { font-weight: 500; font-size: var(--t-sm); white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity var(--d), transform var(--d); }
.subnav.is-stuck .subnav__title { opacity: 1; transform: none; }
.subnav nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.subnav nav::-webkit-scrollbar { display: none; }
.subnav nav a { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-pill); font-size: var(--t-sm); color: var(--muted); white-space: nowrap; transition: background var(--d-fast), color var(--d-fast); }
.subnav nav a:hover { color: var(--ink); background: rgba(11, 22, 38, .05); }
.subnav nav a.is-on { color: var(--paper); background: var(--ink); }
.subnav__cta { margin-left: auto; }
@media (max-width: 760px) { .subnav__title, .subnav__cta { display: none; } }

/* ---------- Generic blocks ---------- */
.blk { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.blk__side { grid-column: 1 / span 3; }
.blk__side .label { position: sticky; top: calc(var(--header-h) + 84px); }
.blk__main { grid-column: 4 / -1; }
.blk__main--narrow { grid-column: 4 / span 7; }
@container (max-width: 860px) { .blk__side, .blk__main, .blk__main--narrow { grid-column: 1 / -1; } .blk__side .label { position: static; } }
.lead-statement { font-size: clamp(1.5rem, 2.4vw, 2.3rem); font-weight: 450; letter-spacing: -.03em; line-height: 1.22; text-wrap: balance; }
.cols-2 { columns: 2; column-gap: var(--gap); }
.cols-2 p { break-inside: avoid; margin-bottom: 1em; color: var(--ink-2); }
@container (max-width: 760px) { .cols-2 { columns: 1; } }
.sec-gap { height: clamp(48px, 6vw, 96px); }

/* Факти - dl в редове */
.kv { display: grid; grid-template-columns: repeat(var(--kv, 4), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.kv > div { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.kv dd { margin-top: 6px; font-size: 1.0625rem; font-weight: 500; letter-spacing: -.01em; }
.kv dd a:hover { color: var(--red-ink); }
@container (max-width: 760px) { .kv { grid-template-columns: 1fr 1fr; } }
.ph--night .kv { border-color: var(--night-line); } .ph--night .kv > div { border-color: var(--night-line); } .ph--night .kv dt { color: var(--night-muted); }

/* Статистики на ред */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stats-row .stat { padding: 28px 24px 0 0; }
.stats-row .stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
@container (max-width: 860px) { .stats-row { grid-template-columns: 1fr 1fr; } .stats-row .stat:nth-child(3) { border-left: 0; padding-left: 0; } }

/* Чеклист / bullet list */
.list-check { display: grid; gap: 12px; }
.list-check li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.list-check li::before { content: ''; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 1px solid var(--line); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' fill='none' stroke='%23E30613' stroke-width='1.6'%3E%3Cpath d='M1 4l2.8 2.6L9 1.2'/%3E%3C/svg%3E") center no-repeat; }
.list-dash li { padding: 12px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 14px; }
.list-dash li::before { content: '-'; color: var(--red); }

/* Портретни карти - Ръководство / началник */
.portrait-xl { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.portrait-xl__img { grid-column: 1 / span 5; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(160deg, #E9ECEF, #D3D9E0); position: relative; }
.portrait-xl__img img { width: 100%; height: 100%; object-fit: cover; }
.portrait-xl__body { grid-column: 7 / -1; padding-bottom: 8px; }
.portrait-xl__body .t-d2 { margin: 14px 0 6px; }
.portrait-xl__body .prose { margin-top: 28px; color: var(--ink-2); }
@container (max-width: 860px) { .portrait-xl__img, .portrait-xl__body { grid-column: 1 / -1; } }
.mono-face { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(3rem, 8cqi, 7rem); font-weight: 500; letter-spacing: -.05em; color: rgba(11, 22, 38, .16); }

.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px) var(--gap); }
.pgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 1080px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 760px) { .pgrid, .pgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 420px) { .pgrid, .pgrid--3 { grid-template-columns: 1fr; } }

/* ---------- Directory (Клиники) ---------- */
.dir { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.dir__list { grid-column: 1 / span 8; }
.dir__aside { grid-column: 9 / -1; position: sticky; top: calc(var(--header-h) + 24px); }
.dir__group { margin-bottom: 40px; }
.dir__group > .label { display: flex; justify-content: space-between; width: 100%; padding-bottom: 12px; border-bottom: 1px solid var(--ink); color: var(--ink); }
.dir .dept { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 20px 0; }
.dir .dept__name { font-size: clamp(1.15rem, 1.5vw, 1.45rem); }
.dir .dept__text { grid-column: 2; grid-row: 2; }
.dir .dept__go { grid-row: 1; grid-column: 3; }
.dir .dept.is-hl { background: linear-gradient(90deg, transparent, rgba(11,22,38,.03), transparent); }
.preview { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); }
.preview__media { aspect-ratio: 16 / 10; background: var(--paper-2); }
.preview__media img { width: 100%; height: 100%; object-fit: cover; }
.preview__body { padding: 24px; display: grid; gap: 14px; }
.preview__body .t-h4 { margin-top: 4px; }
.preview .kv { --kv: 2; }
.preview .kv dd { font-size: var(--t-sm); }
.empty { padding: 56px 0; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .i { width: 40px; height: 40px; color: var(--faint); }
@container (max-width: 980px) { .dir__list, .dir__aside { grid-column: 1 / -1; } .dir__aside { display: none; } }
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; font-size: var(--t-sm); color: var(--muted); }
.results-meta b { color: var(--ink); font-weight: 500; }

/* ---------- Split hero (клиника, лекар) ---------- */
.sh { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.sh__copy { grid-column: 1 / span 6; display: flex; flex-direction: column; }
.sh__copy .t-d1 { margin-top: 20px; }
.sh__copy .t-lead { margin-top: 24px; max-width: 46ch; }
.sh__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.sh__copy .kv { margin-top: auto; padding-top: 40px; border-top: 0; }
.sh__media { grid-column: 8 / -1; position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 460px; }
.sh__media img { width: 100%; height: 100%; object-fit: cover; }
.sh__media .caption { position: absolute; left: 16px; bottom: 16px; margin: 0; color: #fff; background: rgba(5, 10, 19, .5); backdrop-filter: blur(8px); padding: 6px 10px; border-radius: 6px; }
@container (max-width: 980px) { .sh__copy, .sh__media { grid-column: 1 / -1; } .sh__media { min-height: 320px; aspect-ratio: 4 / 3; } }

/* Профил на лекар */
.dp { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.dp__img { grid-column: 1 / span 5; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; position: relative; }
.dp__img img { width: 100%; height: 100%; object-fit: cover; }
.dp__img .doc__ecg { opacity: 1; bottom: 18%; }
.dp__img .doc__ecg path { animation: draw 2.4s var(--ease) .4s forwards; }
.dp__body { grid-column: 7 / -1; }
.dp__title { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--night-muted); }
.dp__body .t-d1 { margin: 14px 0 20px; }
.dp__meta { display: grid; gap: 4px; font-size: 1.125rem; }
.dp__meta span { color: var(--night-muted); font-size: var(--t-sm); }
@container (max-width: 860px) { .dp__img, .dp__body { grid-column: 1 / -1; } .dp__img { max-width: 420px; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line-2); font-size: var(--t-sm); }
.tl-mini { border-left: 1px solid var(--line); padding-left: 24px; display: grid; gap: 22px; }
.tl-mini li { position: relative; }
.tl-mini li::before { content: ''; position: absolute; left: -29px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--red); }
.tl-mini b { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--red-ink); display: block; }
.tl-mini span { display: block; margin-top: 2px; }
.pub { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.pub b { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--faint); }
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.related a { display: grid; gap: 10px; padding: 24px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); transition: border-color var(--d-fast), transform var(--d) var(--ease); }
.related a:hover { border-color: var(--ink); transform: translateY(-2px); }
.related .i { width: 28px; height: 28px; stroke-width: 1.3; }
@container (max-width: 860px) { .related { grid-template-columns: 1fr; } }

/* ---------- Timeline (История) ---------- */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: calc(25% - var(--gap) / 2); top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl { display: grid; grid-template-columns: 1fr 3fr; gap: var(--gap); padding-bottom: clamp(28px, 3vw, 44px); position: relative; }
.tl__y { font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 500; letter-spacing: -.05em; line-height: 1; text-align: right; padding-right: 32px; }
.tl__y .todo { margin-top: 10px; }
.tl::after { content: ''; position: absolute; left: calc(25% - var(--gap) / 2 - 6px); top: 10px; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 2px solid var(--red); }
.tl__body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); padding-left: 24px; align-items: start; }
.tl__body h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.tl__body p { margin-top: 12px; color: var(--ink-2); }
.tl__body .media { aspect-ratio: 16 / 10; }
@container (max-width: 760px) {
  .timeline::before { left: 6px; } .tl::after { left: 0; }
  .tl { grid-template-columns: 1fr; padding-left: 32px; gap: 12px; }
  .tl__y { text-align: left; padding: 0; } .tl__body { grid-template-columns: 1fr; padding: 0; }
}

/* Quote band */
.quote { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 3.4rem); line-height: 1.12; letter-spacing: -.025em; max-width: 26ch; text-wrap: balance; }
.quote-by { margin-top: 32px; }

/* 4 колони „роля“ */
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.roles > div { border-top: 1px solid var(--ink); padding-top: 20px; }
.roles .i { width: 30px; height: 30px; stroke-width: 1.3; margin-bottom: 28px; }
.roles h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.roles p { font-size: var(--t-sm); color: var(--muted); margin-top: 10px; }
@container (max-width: 980px) { .roles { grid-template-columns: 1fr 1fr; } }
@container (max-width: 520px) { .roles { grid-template-columns: 1fr; } }
.section--night .roles > div { border-color: var(--night-line); } .section--night .roles p { color: var(--night-muted); }

/* Org chart */
.org { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.org__col { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 28px; }
.org__col h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.org__col a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: var(--t-sm); }
.org__col a:hover { color: var(--red-ink); }
.org__top { grid-column: 1 / -1; justify-self: center; text-align: center; background: var(--ink); color: var(--paper); border-radius: var(--r-pill); padding: 14px 28px; font-weight: 500; position: relative; }
@container (max-width: 760px) { .org { grid-template-columns: 1fr; } }

/* ---------- Категории (За пациенти) ---------- */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cat { position: relative; display: grid; gap: 16px; align-content: start; min-height: 220px; padding: 28px; background: var(--white); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--d) var(--ease); }
.cat .i { width: 36px; height: 36px; stroke-width: 1.2; }
.cat__t { font-size: 1.3rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.15; margin-top: 12px; }
.cat__d { font-size: var(--t-sm); color: var(--muted); line-height: 1.5; }
.cat .qa__go { position: absolute; right: 24px; top: 28px; }
.cat:hover { background: var(--paper); }
.cat:hover .qa__go { background: var(--ink); border-color: var(--ink); color: #fff; transform: rotate(-45deg); }
@container (max-width: 980px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@container (max-width: 520px) { .cats { grid-template-columns: 1fr; } .cat { min-height: 0; grid-template-columns: 36px 1fr; padding: 20px 16px; } .cat__t { margin: 0; font-size: 1.125rem; } .cat__d { grid-column: 2; } .cat .qa__go { top: 20px; right: 16px; } }

/* Канали за записване */
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.channel { display: grid; gap: 14px; align-content: start; padding: 28px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); }
.channel--main { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.channel--main .t-muted, .channel--main .label { color: rgba(246, 245, 241, .6); }
.channel__v { font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.1; word-break: break-word; }
@container (max-width: 860px) { .channels { grid-template-columns: 1fr; } }

/* ---------- Прием - голям journey ---------- */
.big-journey { counter-reset: s; display: grid; gap: 0; }
.bj { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); padding: clamp(32px, 4vw, 56px) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 80px); }
.bj__n { font-size: clamp(2.6rem, 4vw, 4rem); font-weight: 500; letter-spacing: -.06em; line-height: .9; color: var(--line); transition: color var(--d-slow); font-feature-settings: 'tnum'; }
.bj.is-on .bj__n { color: var(--red); }
.bj__t { font-size: clamp(1.5rem, 2.2vw, 2.1rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
.bj__t + p { margin-top: 14px; color: var(--ink-2); font-size: 1.125rem; line-height: 1.6; }
.bj__box { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 24px; align-self: start; }
.bj__box .label { margin-bottom: 14px; }
.bj__box li { font-size: 1.0625rem; }
@container (max-width: 860px) { .bj { grid-template-columns: 1fr; gap: 14px; } }
.prog { position: sticky; top: calc(var(--header-h) + 60px); z-index: 20; height: 3px; background: var(--line-2); }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--red); transition: width var(--d-fast) linear; }
body.a-large { font-size: 1.1875rem; }
body.a-large .bj__t + p, body.a-large .bj__box li, body.a-large .prose { font-size: 1.25rem; }
.a-switch { display: inline-flex; gap: 4px; align-items: center; }
.a-switch button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); font-weight: 500; }
.a-switch button[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Master-detail (Изследвания) ---------- */
.md { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.md__list { grid-column: 1 / span 5; display: grid; gap: 10px; }
.md__detail { grid-column: 6 / -1; position: sticky; top: calc(var(--header-h) + 24px); }
.md .proc { cursor: pointer; padding: 20px 22px; gap: 10px; }
.md .proc.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.md .proc__title { font-size: 1.0625rem; }
.detail { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.detail__head { padding: clamp(24px, 3vw, 40px); background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; }
.detail__head .t-d2 { margin-top: 16px; }
.detail__head .kv { margin-top: 28px; border-color: var(--night-line); }
.detail__head .kv > div { border-color: var(--night-line); }
.detail__head .kv dt { color: var(--night-muted); }
.detail__ecg { position: absolute; right: -10px; top: 24px; width: 260px; opacity: .5; }
.detail__ecg path { stroke: var(--red); stroke-width: 1.5; fill: none; }
.detail__body { padding: clamp(24px, 3vw, 40px); display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.detail__body h4 { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.detail__body h4 .i { width: 16px; height: 16px; }
.detail__body p { margin-top: 8px; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.6; }
.detail__body .full { grid-column: 1 / -1; }
@container (max-width: 980px) { .md__list, .md__detail { grid-column: 1 / -1; } .md__detail { position: static; order: -1; } .detail__body { grid-template-columns: 1fr; } }

/* ---------- Педиатрична тема ---------- */
body.peds-theme { background: var(--peds-bg); --paper: #F7F0E7; --paper-2: #EFE5D8; --line: #E2D6C6; --line-2: #EBE1D3; }
body.peds-theme .i { --icon-accent: var(--peds-warm); }
body.peds-theme .label--tick::before { background: var(--peds-warm); }
body.peds-theme .section--white { background: #FBF8F3; }
.peds-hero { position: relative; overflow: hidden; }
.peds-hero__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.peds-hero__copy { grid-column: 1 / span 6; }
.peds-hero__copy .t-mega { margin-top: 24px; font-size: clamp(2.6rem, 5.4vw, 5.6rem); }
.peds-hero__copy .t-lead { margin-top: 28px; max-width: 44ch; color: var(--peds-ink); }
.peds-hero__media { grid-column: 8 / -1; aspect-ratio: 4 / 4.6; border-radius: 320px 320px var(--r-lg) var(--r-lg); overflow: hidden; position: relative; }
.peds-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.peds-hero__blob { position: absolute; right: -6%; top: 8%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--peds-blue); z-index: -1; }
@container (max-width: 860px) { .peds-hero__copy, .peds-hero__media { grid-column: 1 / -1; } }
.soft-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.soft { display: grid; gap: 14px; align-content: start; padding: 28px; border-radius: var(--r-lg); background: #FBF8F3; border: 1px solid var(--line-2); transition: transform var(--d) var(--ease), box-shadow var(--d); }
.soft:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.soft .i { width: 34px; height: 34px; stroke-width: 1.25; color: var(--peds-ink); }
.soft__ico { width: 64px; height: 64px; border-radius: 50%; background: var(--peds-blue); display: grid; place-items: center; }
.soft h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: -.025em; margin-top: 8px; }
.soft p { color: var(--peds-ink); font-size: var(--t-sm); opacity: .85; }
@container (max-width: 980px) { .soft-cards { grid-template-columns: 1fr 1fr; } }
@container (max-width: 560px) { .soft-cards { grid-template-columns: 1fr; } }

/* ---------- Спешна помощ - функционално ---------- */
.sos-hero { padding-block: clamp(24px, 3vw, 48px) clamp(40px, 4vw, 64px); }
.sos-hero h1 { font-size: clamp(2.6rem, 7vw, 6.4rem); font-weight: 650; letter-spacing: -.045em; line-height: .95; }
.sos-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(28px, 3vw, 48px); }
.sos-call { grid-column: 1 / span 6; background: var(--red); color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); display: grid; gap: 18px; }
.sos-call__n { font-size: clamp(4rem, 10vw, 8rem); font-weight: 650; letter-spacing: -.06em; line-height: .85; }
.sos-call .btn { --bg: #fff; --fg: var(--red-ink); --bd: #fff; justify-self: start; height: 64px; font-size: 1.125rem; padding: 0 32px; }
.sos-nkb { grid-column: 7 / -1; border: 2px solid var(--ink); border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); display: grid; gap: 14px; align-content: start; }
.sos-nkb__v { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.sos-nkb .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sos-nkb .btn { height: 56px; font-size: 1rem; }
@container (max-width: 860px) { .sos-call, .sos-nkb { grid-column: 1 / -1; } }
.symptoms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.symptoms li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 18px; background: var(--white); border-radius: var(--r-sm); border-left: 3px solid var(--red); font-size: 1.0625rem; font-weight: 500; line-height: 1.35; }
.symptoms li span { color: var(--red-ink); font-family: var(--f-mono); font-size: 12px; padding-top: 3px; }
@container (max-width: 860px) { .symptoms { grid-template-columns: 1fr; } }
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.howto > div { border-top: 2px solid var(--ink); padding-top: 18px; }
.howto h3 { display: flex; gap: 10px; align-items: center; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.howto p, .howto li { margin-top: 10px; font-size: 1.0625rem; color: var(--ink-2); }
@container (max-width: 860px) { .howto { grid-template-columns: 1fr; } }

/* ---------- Trials ---------- */
.trial { border-top: 1px solid var(--line); }
.trial:last-child { border-bottom: 1px solid var(--line); }
.trial__head { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 180px 150px 36px; gap: var(--gap); align-items: center; padding: 24px 0; text-align: left; }
.trial__t { font-size: 1.1875rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.3; }
.trial__area { font-size: var(--t-sm); color: var(--muted); }
.trial__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d) var(--ease); }
.trial.is-open .trial__panel { grid-template-rows: 1fr; }
.trial__panel > div { overflow: hidden; }
.trial__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--gap); padding: 0 0 32px; }
.trial__inner h4 { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 10px; }
.trial.is-open .acc__icon { background: var(--ink); color: #fff; border-color: var(--ink); }
.trial.is-open .acc__icon::after { transform: translate(-50%, -50%) rotate(0); }
@container (max-width: 860px) { .trial__head { grid-template-columns: 1fr 36px; } .trial__head > :nth-child(2), .trial__head > :nth-child(3) { grid-column: 1; } .trial__head .acc__icon { grid-row: 1; grid-column: 2; } .trial__inner { grid-template-columns: 1fr; } }

/* ---------- Newsroom / статия ---------- */
.feat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.feat__media { grid-column: 1 / span 8; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; }
.feat__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--d-slow) var(--ease); }
.feat:hover .feat__media img { transform: scale(1.03); }
.feat__body { grid-column: 9 / -1; display: grid; gap: 18px; padding-bottom: 8px; }
.feat__body h2 { font-size: clamp(1.6rem, 2.4vw, 2.4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.08; }
@container (max-width: 860px) { .feat__media, .feat__body { grid-column: 1 / -1; } }
.ngrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 3vw, 48px) var(--gap); }
@container (max-width: 980px) { .ngrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 560px) { .ngrid { grid-template-columns: 1fr; } }
.article { max-width: 760px; margin-inline: auto; }
.article__meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.article h1 { margin-top: 24px; font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.04; text-wrap: balance; }
.article__lead { margin-top: 28px; font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.5; color: var(--ink-2); }
.article__media { max-width: 1120px; margin: clamp(40px, 5vw, 72px) auto; }
.article__media .media { aspect-ratio: 16 / 9; border-radius: var(--r-lg); }
.article__media--top { margin: clamp(28px, 3.5vw, 48px) auto clamp(28px, 3.5vw, 48px); } /* новина: снимката е веднага под заглавието */
.article__body { font-size: 1.1875rem; line-height: 1.72; color: var(--ink-2); }
.article__body p + p { margin-top: 1.1em; }
.article__body h2 { font-size: 1.6rem; font-weight: 500; letter-spacing: -.03em; color: var(--ink); margin: 1.8em 0 .6em; }
.article__body blockquote { margin: 1.6em 0; padding-left: 24px; border-left: 2px solid var(--red); font-family: var(--f-serif); font-style: italic; font-size: 1.6rem; line-height: 1.3; color: var(--ink); }
.article__body ul { margin: 1em 0; display: grid; gap: 8px; }
.article__body ul li { padding-left: 22px; position: relative; }
.article__body ul li::before { content: ''; position: absolute; left: 0; top: .7em; width: 10px; height: 1px; background: var(--red); }
.article__body a:not(.btn) { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color var(--d), text-decoration-color var(--d); }
.article__body a:not(.btn):hover { color: var(--red); text-decoration-color: currentColor; }
.article__body h3 { font-size: 1.2rem; font-weight: 500; line-height: 1.35; letter-spacing: -.02em; color: var(--ink); margin: 1.8em 0 .3em; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.share > .t-xs { margin-right: 6px; }
.share .icon-btn:hover { color: var(--red); border-color: var(--red); }
.share__copy .share__ok { display: none; } .share__copy.is-done { color: #1A7F4B; border-color: #1A7F4B; } .share__copy.is-done .share__ok { display: block; } .share__copy.is-done .i:not(.share__ok) { display: none; }
@media (max-width: 560px) { .share .link-arrow { margin-left: 0 !important; flex-basis: 100%; margin-top: 8px; } }

/* ---------- Powered by medboard ---------- */
.mb-aside { justify-self: end; }
@container (max-width: 860px) { .mb-aside { justify-self: start; } }
.mb-pill { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line-2); box-shadow: var(--sh-1); white-space: nowrap; transition: border-color var(--d-fast), box-shadow var(--d); }
.mb-pill:hover { border-color: #0090B9; box-shadow: var(--sh-2); }
.mb-pill__by, .mb-pill__cp { font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.mb-pill__logo { height: 19px; width: auto; display: block; }
.mb-pill--sm { height: 34px; padding: 0 12px; gap: 7px; box-shadow: none; }
.mb-pill--sm .mb-pill__by, .mb-pill--sm .mb-pill__cp { font-size: 11px; }
.mb-pill--sm .mb-pill__logo { height: 14px; }
@media (max-width: 520px) { .mb-pill__cp { display: none; } }
@container (max-width: 860px) { .sec-head .mb-pill { justify-self: start; } }

/* ---------- Jobs ---------- */
.job { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 120px 160px 44px; gap: var(--gap); align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); transition: padding var(--d) var(--ease); }
.job:first-child { border-top: 1px solid var(--line); }
.job__t { font-size: 1.25rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; }
.job__c { font-size: var(--t-sm); color: var(--muted); }
.job:hover { padding-left: 12px; }
.job:hover .icon-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
@container (max-width: 860px) { .job { grid-template-columns: 1fr 44px; gap: 6px 16px; } .job > :not(.job__t):not(.icon-btn) { grid-column: 1; } .job .icon-btn { grid-row: 1; grid-column: 2; } }
.perks { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.perks > div { padding-top: 18px; border-top: 1px solid var(--night-line); }
.perks b { display: block; font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; margin-top: 18px; }
.perks p { color: var(--night-muted); font-size: var(--t-sm); margin-top: 8px; }
.perks .i { width: 28px; height: 28px; stroke-width: 1.3; }
@container (max-width: 980px) { .perks { grid-template-columns: 1fr 1fr; } }
.apply { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); display: grid; gap: 18px; }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 28px; text-align: center; color: var(--muted); font-size: var(--t-sm); transition: border-color var(--d-fast), background var(--d-fast); cursor: pointer; }
.drop:hover { border-color: var(--ink); background: var(--paper); }

/* ---------- Контакти ---------- */
.picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pick { display: grid; gap: 14px; justify-items: start; padding: 22px 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); text-align: left; transition: border-color var(--d-fast), background var(--d-fast), color var(--d-fast); }
.pick .i { width: 28px; height: 28px; stroke-width: 1.3; }
.pick span { font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
.pick:hover { border-color: var(--ink); }
.pick[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); --icon-accent: #FF5A62; }
.pick--sos .i { color: var(--red); }
@container (max-width: 980px) { .picker { grid-template-columns: repeat(3, 1fr); } }
@container (max-width: 520px) { .picker { grid-template-columns: 1fr 1fr; } }
.answer { margin-top: 16px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); animation: pop var(--d) var(--ease); }
.answer__main { grid-column: 1 / span 5; }
.answer__main .contact__value { font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -.045em; }
.answer__list { grid-column: 7 / -1; }
@container (max-width: 860px) { .answer__main, .answer__list { grid-column: 1 / -1; } }
.getting { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.getting > div { padding: 24px; background: var(--white); border-radius: var(--r-md); border: 1px solid var(--line-2); }
.getting h3 { display: flex; gap: 10px; align-items: center; font-size: 1.125rem; font-weight: 500; }
.getting p { margin-top: 10px; font-size: var(--t-sm); color: var(--ink-2); }
@container (max-width: 860px) { .getting { grid-template-columns: 1fr; } }

/* ---------- Search results ---------- */
.sr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.sr__main { grid-column: 1 / span 8; }
.sr__aside { grid-column: 10 / -1; position: sticky; top: calc(var(--header-h) + 24px); }
.srow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.srow__ico { width: 56px; height: 56px; border-radius: 14px; background: var(--white); border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--f-mono); font-size: 14px; overflow: hidden; }
.srow__ico img { width: 100%; height: 100%; object-fit: cover; }
.srow__type { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.srow__t { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; margin-top: 4px; }
.srow__t mark { background: none; box-shadow: inset 0 -.35em 0 var(--red-tint); color: inherit; }
.srow__ctx { color: var(--muted); font-size: var(--t-sm); margin-top: 6px; }
.srow__crumb { font-size: var(--t-xs); color: var(--faint); margin-top: 8px; }
.srow:hover .srow__t { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@container (max-width: 980px) { .sr__main, .sr__aside { grid-column: 1 / -1; } .sr__aside { position: static; } }

/* ---------- 404 ---------- */
.nf { min-height: calc(100vh - var(--header-h)); display: grid; align-content: center; padding-block: 64px; }
.nf__code { font-family: var(--f-mono); font-size: 13px; letter-spacing: .1em; color: var(--red-ink); display: flex; gap: 14px; align-items: center; }
.nf__flat { width: min(560px, 100%); height: 80px; margin: 40px 0; }
.nf__flat path { stroke: var(--red); stroke-width: 1.5; fill: none; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.6s var(--ease-io) .2s forwards; }

/* ---------- Специализации ---------- */
.spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.spec-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); min-width: 0; }
.spec-card .num { font-family: var(--f-mono); font-size: 11px; color: var(--red-ink); }
.spec-card b { font-weight: 500; letter-spacing: -.015em; line-height: 1.25; }
@container (max-width: 980px) { .spec-grid { grid-template-columns: repeat(2, 1fr); } }
@container (max-width: 520px) { .spec-grid { grid-template-columns: 1fr; } }

/* ---------- Ценоразпис ---------- */
.pr { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: start; }
.pr__toc { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 2px; max-height: calc(100vh - 120px); overflow: auto; font-size: var(--t-sm); }
.pr__toc .label { margin-bottom: 10px; }
.pr__toc a { padding: 6px 0 6px 12px; border-left: 1px solid var(--line); color: var(--muted); line-height: 1.3; }
.pr__toc a.sub { padding-left: 24px; font-size: var(--t-xs); }
.pr__toc a:hover, .pr__toc a.is-on { color: var(--ink); border-color: var(--ink); }
.pr__sec { margin-bottom: 48px; scroll-margin-top: calc(var(--header-h) + 24px); }
.pr__sec > h2 { font-size: clamp(1.4rem, 2vw, 1.9rem); font-weight: 500; letter-spacing: -.03em; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.pr__sub { scroll-margin-top: calc(var(--header-h) + 24px); }
.pr__sub h3 { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 22px 0 8px; }
.pr__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.pr__row:hover { background: linear-gradient(90deg, transparent, rgba(11,22,38,.03), transparent); }
.pr__code { font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.pr__name { line-height: 1.4; }
.pr__name em { display: block; font-style: normal; font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.pr__price { font-weight: 500; white-space: nowrap; }
.pr__price small { font-weight: 400; color: var(--muted); }
.is-hl > h2, .pr__sub.is-hl h3 { color: var(--red-ink); }
@container (max-width: 860px) { .pr { grid-template-columns: 1fr; } .pr__toc { display: none; } .pr__row { grid-template-columns: 1fr auto; } .pr__code { grid-column: 1 / -1; } }

/* ---------- ПВУ ---------- */
.eu { display: grid; gap: 14px; justify-items: start; }
.eu__logo { width: min(100%, 380px); height: auto; padding: 14px 18px; background: #fff; border-radius: var(--r-sm); border: 1px solid var(--line-2); }
.eu__flag { width: 66px; height: 44px; border-radius: 3px; background: url(eu-flag.svg) center/cover no-repeat; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.pvu { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.pvu__main { grid-column: 1 / span 8; }
.pvu__side { grid-column: 10 / -1; position: sticky; top: calc(var(--header-h) + 24px); }
@container (max-width: 860px) { .pvu__main, .pvu__side { grid-column: 1 / -1; position: static; } }

/* ---------- Клиника: отделения (подменю) ---------- */
.dsub { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; position: sticky; top: calc(var(--header-h) + 64px); z-index: 5; padding: 8px 0; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); }
.dsub::-webkit-scrollbar { display: none; }
.dsub a { height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--t-sm); white-space: nowrap; background: var(--white); transition: border-color var(--d-fast), background var(--d-fast), color var(--d-fast); }
.dsub a:hover, .dsub a.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.dcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.dcard { display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); scroll-margin-top: calc(var(--header-h) + 140px); transition: border-color var(--d), box-shadow var(--d); }
.dcard:target, .dcard.is-hl { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.dcard__n { font-family: var(--f-mono); font-size: 12px; color: var(--red-ink); }
.dcard h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.dcard dl { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; border-block: 1px solid var(--line-2); }
.dcard dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.dcard dd { font-size: var(--t-sm); font-weight: 500; margin-top: 2px; }
.dcard__d { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
@container (max-width: 1080px) { .dcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 640px) { .dcards { grid-template-columns: 1fr; } }
.price-band { display: grid; gap: 14px; padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); transition: border-color var(--d); }
.price-band:hover { border-color: var(--ink); }
.hist-teaser { display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; align-items: center; padding: clamp(28px, 4vw, 56px); border-radius: var(--r-lg); background: var(--night); color: var(--night-ink); }
.hist-teaser .label { grid-column: 1 / -1; color: var(--night-muted); }
.hist-teaser__y { grid-row: span 3; font-size: clamp(3.5rem, 8vw, 7rem); font-weight: 500; letter-spacing: -.06em; line-height: .9; color: #fff; }
.hist-teaser__t { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
.hist-teaser__d { color: var(--night-muted); max-width: 62ch; }
.hist-teaser .btn { --bg: #fff; --fg: var(--ink); --bd: #fff; }
@container (max-width: 760px) { .hist-teaser { grid-template-columns: 1fr; } .hist-teaser__y { grid-row: auto; } }

/* ---------- По-малки портрети в страница на клиника ---------- */
body[data-page='clinic'] .portrait-xl__img { grid-column: 1 / span 3; aspect-ratio: 4 / 5; }
body[data-page='clinic'] .portrait-xl__body { grid-column: 5 / -1; align-self: center; }
body[data-page='clinic'] .pgrid:has(> .doc) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
body[data-page='clinic'] .pgrid .doc__name { font-size: 1.05rem; }
body[data-page='clinic'] .pgrid .doc__meta { font-size: 12px; }
@container (max-width: 1080px) { body[data-page='clinic'] .pgrid:has(> .doc) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 640px) { body[data-page='clinic'] .pgrid:has(> .doc) { grid-template-columns: repeat(2, minmax(0, 1fr)); } body[data-page='clinic'] .portrait-xl__img { grid-column: 1 / -1; max-width: 280px; } body[data-page='clinic'] .portrait-xl__body { grid-column: 1 / -1; } }
.ph__aside .todo { white-space: normal; line-height: 1.5; display: inline; }
.pr__grp { font-size: var(--t-sm); font-weight: 500; color: var(--ink); padding: 18px 0 6px; border-bottom: 1px solid var(--line); }
.pr__notes { margin-top: 24px; padding: 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); font-size: var(--t-xs); color: var(--muted); line-height: 1.6; }

/* ---------- Наука: развитие на академичния състав ---------- */
.acad { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.acad__col { display: flex; flex-direction: column; gap: 12px; }
.docs { display: grid; border-top: 1px solid var(--line); }
.docs--grid { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
.doc-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--line-2); transition: background var(--d-fast); }
.doc-row:hover { background: var(--white); }
.doc-row .i { width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }
.doc-row b { font-weight: 500; letter-spacing: -.01em; line-height: 1.35; display: block; }
.doc-row em { font-style: normal; display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 3px; line-height: 1.45; }
.doc-row__t { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--red-ink); white-space: nowrap; padding-top: 3px; }
.doc-row:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.acad__pos { margin-top: 48px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(20px, 2.4vw, 32px); }
.acad__ph { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.acad__pane { display: none; } .acad__pane.is-on { display: block; animation: fade var(--d) var(--ease); }
@container (max-width: 860px) { .acad, .docs--grid { grid-template-columns: 1fr; } }

.spec-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 32px; }
.spec-more__card { display: grid; gap: 14px; align-content: start; padding: clamp(22px, 2.4vw, 32px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.spec-more__card h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.spec-more__card p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.spec-more__card .list-check { gap: 10px; font-size: var(--t-sm); }
@container (max-width: 980px) { .spec-more { grid-template-columns: 1fr; } }

/* диапазон в голямо число - тирето с въздух от двете страни */
.stat__n--range .dash { display: inline-block; margin: 0 .14em; letter-spacing: 0; color: var(--muted); font-weight: 400; }

/* ---------- Образна диагностика ---------- */
.tgroup { display: grid; gap: 16px; margin-bottom: 40px; }
.tgroup .chips span { height: auto; padding: 8px 14px; }
.stars5 { display: flex; gap: 20px; align-items: center; padding: 20px 24px; border-radius: var(--r-lg); background: #003399; color: #fff; }
.stars5 > span { color: #FFCC00; font-size: 1.6rem; letter-spacing: 4px; white-space: nowrap; }
.stars5 b { font-weight: 500; font-size: 1.125rem; }
.stars5 .t-muted { color: rgba(255,255,255,.7) !important; }
.gal { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 220px; gap: 12px; }
.gal .media:first-child { grid-row: span 2; }
.gal .media img { width: 100%; height: 100%; object-fit: cover; }
@container (max-width: 760px) { .gal { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; } .gal .media:first-child { grid-column: 1 / -1; grid-row: auto; } }
body[data-page='clinic-imaging'] .portrait-xl__img { grid-column: 1 / span 3; }
body[data-page='clinic-imaging'] .portrait-xl__body { grid-column: 5 / -1; align-self: center; }
body[data-page='clinic-imaging'] .pgrid:has(> .doc) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
body[data-page='clinic-imaging'] .pgrid .doc__name { font-size: 1.05rem; }
@container (max-width: 1080px) { body[data-page='clinic-imaging'] .pgrid:has(> .doc) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 640px) { body[data-page='clinic-imaging'] .pgrid:has(> .doc) { grid-template-columns: repeat(2, minmax(0, 1fr)); } body[data-page='clinic-imaging'] .portrait-xl__img, body[data-page='clinic-imaging'] .portrait-xl__body { grid-column: 1 / -1; } }

/* Биография (от стария сайт) */
#dpBio .bio__h { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--red-ink); font-weight: 500; margin-top: 28px; }
#dpBio .bio__h:first-child { margin-top: 0; }
#dpBio .bio__ul { margin-top: 6px; font-size: 1.0625rem; }
#dpBio .bio__ul li { padding: 9px 0; }
#dpBio .bio__src { margin-top: 28px; font-size: var(--t-xs); color: var(--muted); }
#dpBio .bio__src a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Маршрут до болницата ---------- */
.route { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: stretch; padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.route__form { display: flex; flex-direction: column; }
.route__seg { align-self: flex-start; }
.route__in { position: relative; display: block; }
.route__in .input { width: 100%; padding-right: 56px; }
.route__loc { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background var(--d-fast), color var(--d-fast); }
.route__loc:hover { background: var(--paper-2); color: var(--red); }
.field__hint .i { width: 14px; height: 14px; vertical-align: -2px; }
.route__modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.route__mode { display: grid; justify-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--paper); font-size: var(--t-xs); color: var(--ink-2); text-align: center; transition: border-color var(--d-fast), background var(--d-fast), box-shadow var(--d-fast); }
.route__mode .i { width: 24px; height: 24px; }
.route__mode:hover { border-color: var(--ink-2); }
.route__mode[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 500; }
.route__mode[aria-pressed='true'] .i { --icon-accent: #FF5A62; }
.route__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 28px; }
.route__map { min-height: 520px; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); }
.route__leaf { width: 100%; height: 100%; min-height: 520px; }
@container (max-width: 900px) { .route { grid-template-columns: 1fr; } .route__map, .route__leaf { min-height: 420px; } }
@media (max-width: 900px) { .route { grid-template-columns: 1fr; } .route__map, .route__leaf { min-height: 420px; } .route__btns .btn { flex: 1 1 100%; justify-content: center; } }
body.wf .route__leaf { visibility: hidden; }

/* Линии на градския транспорт около НКБ */
.lines { margin-top: var(--gap); padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.lines__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: baseline; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.lines__row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.lines__row:last-child { border-bottom: 0; padding-bottom: 0; }
.lines__stop { font-weight: 500; display: grid; gap: 4px; }
.lines__stop .num { font-weight: 400; font-size: var(--t-xs); color: var(--muted); }
.lines__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { --c: var(--ink); display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--paper); font-size: var(--t-xs); }
.lchip small { font-size: 11px; color: var(--muted); order: 2; }
.lchip b { order: 1; min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 600; font-size: 13px; }
.lchip em { order: 3; font-style: normal; font-size: 11px; color: var(--muted); }
.lchip--tram { --c: #E58A00; }
.lchip--trolley { --c: #2F6BDB; }
.lchip--bus { --c: #B5121B; }
.lchip--metro { --c: #0B1626; }
.lchip--M1 { --c: #E30613; } .lchip--M2 { --c: #2F6BDB; } .lchip--M3 { --c: #1A9A5C; } .lchip--M4 { --c: #F2B705; }
@media (max-width: 900px) { .lines__head, .lines__row { grid-template-columns: 1fr; gap: 10px; } }

/* Маршрут - карта (Leaflet), предложения, резултат */
.route__map { position: relative; z-index: 0; }
.route__leaf .leaflet-tile-pane { filter: grayscale(.9) brightness(1.04) contrast(.92); }
.route__leaf { background: #F2F1EC; }
.route__leaf .leaflet-control-attribution { font-size: 10px; }
.route__sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-2, 0 18px 40px -18px rgba(11,22,38,.35)); }
.route__sugg button { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: var(--t-sm); }
.route__sugg button:hover, .route__sugg button:focus-visible { background: var(--paper); }
.route__sugg small { color: var(--muted); font-size: var(--t-xs); }
.rpin { width: 44px; height: 44px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--red); display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(227,6,19,.6); border: 3px solid #fff; }
.rpin svg { width: 22px; height: 22px; transform: rotate(45deg); }
.rtip { font: 500 12px/1.2 var(--f-sans, inherit); color: var(--ink); border-radius: 999px !important; padding: 6px 10px !important; border: 0 !important; box-shadow: 0 6px 16px -8px rgba(11,22,38,.4) !important; }
.rme { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 4px solid #fff; box-shadow: 0 0 0 6px rgba(11,22,38,.15); }
.rbadge { display: inline-block; white-space: nowrap; padding: 4px 9px; border-radius: 999px; background: var(--c); color: #fff; font: 600 12px/1 var(--f-sans, inherit); border: 2px solid #fff; box-shadow: 0 4px 10px -4px rgba(0,0,0,.4); }
.rres { margin-top: var(--gap); padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.rres__load, .rres__tip, .rres__err { color: var(--ink-2); }
.rres__load::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--red); animation: rpulse 1s ease-in-out infinite; }
@keyframes rpulse { 50% { transform: scale(.5); opacity: .4; } }
.rres__err { color: var(--red-ink, #B5121B); }
.rres__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: start; }
.rres__big { font-size: clamp(2.6rem, 4.4vw, 4rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; margin: 14px 0 6px; }
.rres__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rres__note { margin-top: 16px; font-size: var(--t-xs); color: var(--muted); }
.rres__note a { text-decoration: underline; }
.rres__head { margin-bottom: 18px; }
.rsteps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rsteps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.rsteps__n { font-size: 11px; color: var(--red); }
.rsteps small { color: var(--muted); font-size: var(--t-xs); }
.rsteps.is-long li:nth-child(n+9) { display: none; }
.rsteps__more { margin-top: 14px; grid-column: 2; justify-self: start; }
.ropts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.ropt { display: grid; gap: 12px; text-align: left; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--paper); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.ropt:hover { border-color: var(--ink-2); }
.ropt[aria-pressed='true'] { background: var(--white); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ropt__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ropt__top b { font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; }
.ropt__top small, .ropt__tr { color: var(--muted); font-size: var(--t-xs); }
.ropt__bar { display: flex; gap: 3px; height: 8px; }
.ropt__bar i { background: var(--c); border-radius: 999px; min-width: 6px; }
.ropt__bar i.is-walk { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 6px); opacity: .6; }
.ropt__lines { display: flex; flex-wrap: wrap; gap: 6px; }
.ropt .lchip { height: 30px; padding: 0 10px 0 4px; gap: 6px; }
.ropt .lchip b { min-width: 22px; height: 22px; font-size: 12px; padding: 0 6px; }
.rlegs { list-style: none; margin: 0; padding: 0; }
.rleg { position: relative; padding: 0 0 22px 30px; font-size: var(--t-sm); }
.rleg::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: -6px; width: 3px; background: var(--c); border-radius: 3px; }
.rleg--walk::before { background: repeating-linear-gradient(180deg, var(--c) 0 3px, transparent 3px 7px); opacity: .7; }
.rleg::after { content: ''; position: absolute; left: 1px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--c); box-sizing: border-box; }
.rleg--end::before { display: none; }
.rleg--end::after { background: var(--c); }
.rleg p { margin-top: 8px; line-height: 1.6; }
.rleg small { color: var(--muted); font-size: var(--t-xs); }
.rleg .lchip { vertical-align: middle; }
@media (max-width: 900px) { .rres__grid { grid-template-columns: 1fr; } .ropts { grid-template-columns: 1fr; } }
.route__note { margin-top: 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--red-tint, #FDECEC); color: var(--ink); font-size: var(--t-sm); }
.route__note a { color: var(--red); font-weight: 600; }

/* ---------- QA: мобилни поправки ----------
   Компонентите, сложени директно на .wrap (wrap pr / md / getting), не виждат собствения си @container - дублираме с @media. */
@media (max-width: 900px) {
  .wrap.pr { grid-template-columns: minmax(0, 1fr); }
  .wrap.pr .pr__toc { display: none; }
  .wrap.md { grid-template-columns: minmax(0, 1fr); }
  .wrap.getting { grid-template-columns: minmax(0, 1fr); }
  /* вградени grid-column / колони в съдържанието → цяла ширина */
  main .wrap [style*="grid-column"]:not(.field):not(label) { grid-column: 1 / -1 !important; }
  .sos-card[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .stats-row[style*="grid-template-columns"]:not([style*="repeat(4"]) { grid-template-columns: minmax(0, 1fr) !important; }
  .stats-row[style*="repeat(4"] { grid-template-columns: 1fr 1fr !important; }
  .stats-row[style*="repeat(4"] .stat:nth-child(3) { border-left: 0; padding-left: 0; }
}
/* дълги цени („… + … за всяка следваща“) се пренасят, вместо да избутват реда */
.pr__price { white-space: normal; text-align: right; max-width: 22ch; overflow-wrap: anywhere; }
.pr__price.num { font-variant-numeric: tabular-nums; }
/* имейли и дълги думи в kv / таблици */
.kv dd, .kv dd a, .contact__note, .contact__value { overflow-wrap: anywhere; }
@media (max-width: 980px) { .sh__media[style*="min-height"], .sh__media { min-height: 0 !important; } }
@media (max-width: 760px) {
  .news-row, .news-row[style] { grid-template-columns: minmax(0, 1fr) auto !important; row-gap: 8px; }
  .news-row > .news-item__meta { grid-column: 1 / -1; }
  .news-row > .badge { display: none; }
}
.dept__name, .dept__text { overflow-wrap: break-word; hyphens: auto; }
@container (max-width: 520px) { .dept__name { font-size: 1.2rem; } }
/* картите с изследвания - по 2 на ред на таблет */
@container (max-width: 900px) { .pgrid--3:has(> .proc) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .pgrid--3:has(> .proc) { grid-template-columns: minmax(0, 1fr); } }

/* ---------- QA 2: визуални поправки на мобилни ---------- */
/* Научен съвет - редовете без линк изглеждат като останалите */
.org__col .org__row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: var(--t-sm); }
/* портретите на лекари - по 2 на ред на телефон, вместо една огромна карта */
@container (max-width: 520px) {
  .pgrid:has(> .doc) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 22px 14px; }
  .pgrid:has(> .doc) .doc__name { font-size: 1rem; }
  .pgrid:has(> .doc) .doc__meta, .pgrid:has(> .doc) .doc__role { font-size: 12px; }
}
@media (max-width: 760px) {
  /* отделенията с вградени 3 колони → номер + текст */
  .dept[style*="grid-template-columns"] { grid-template-columns: 32px minmax(0, 1fr) !important; row-gap: 8px; }
  .dept[style*="grid-template-columns"] .dept__text { grid-column: 2; }
  /* табовете за академичните длъжности се скролват, вместо да излизат от картата */
  .acad__ph .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .acad__ph .segmented button { white-space: nowrap; flex: none; }
  /* бланките - по-дребен шрифт, за да не се цепят думите */
  .kv[style*="--kv:4"] dd { font-size: 1rem; overflow-wrap: normal; hyphens: auto; }
  /* формата за заявка за час - една колона */
  form.answer__list[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  form.answer__list [style*="grid-column"] { grid-column: 1 / -1 !important; }
}
.job .badge { justify-self: start; }
/* обява: на телефон първо описанието, после формата за кандидатстване */
@media (max-width: 900px) { .wrap.md #apply.md__detail { order: 2; } }
.md .proc .badge, .proc__top .badge { white-space: nowrap; }
@container (max-width: 560px) { .detail__ecg { top: auto; bottom: 18px; width: 180px; opacity: .35; } }
.price-band .btn { justify-self: start; }

/* ---------- Звена (pages_units.py) ---------- */
.unit-notice { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 22px 26px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); border-left: 4px solid var(--red); }
.unit-notice .i { width: 28px; height: 28px; color: var(--red); }
.unit-notice b { font-size: 1.125rem; font-weight: 600; }
.unit-notice p { margin-top: 6px; color: var(--ink-2); font-size: var(--t-sm); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 var(--gap); margin-top: 12px; border-top: 1px solid var(--line); }
.person { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.person b { font-weight: 500; }
.person span { font-size: var(--t-xs); color: var(--muted); }
a.person[href] b { transition: color var(--d-fast); }
a.person[href]:hover b { color: var(--red-ink); }
a.person[href] b::after { content: '\00a0→'; color: var(--faint); font-weight: 400; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.room { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; padding: 18px 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); }
.room__n { font-size: 1.25rem; font-weight: 500; color: var(--red); }
.room p { margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.related-links { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .rooms { grid-template-columns: minmax(0, 1fr); } .people { grid-template-columns: minmax(0, 1fr); } }
.stat__n--word { font-size: clamp(1.6rem, 2.6vw, 2.4rem) !important; overflow-wrap: anywhere; }

/* ---------- Материали за сайта ---------- */
.m-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.mblocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mblock { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 22px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); align-content: start; }
.mblock__n { color: var(--red); font-size: 13px; padding-top: 3px; }
.mblock h3 { font-size: 1.125rem; font-weight: 500; letter-spacing: -.02em; }
.mblock p { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); }
.mblock .link-arrow { margin-top: 12px; font-size: var(--t-xs); }
.m-sample { margin-top: 28px; padding: 24px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.mstatus { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--white); }
.mtable { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 860px; }
.mtable th, .mtable td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-align: center; vertical-align: middle; }
.mtable thead th { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--paper); position: sticky; top: 0; }
.mtable th[scope=row], .mtable thead th:first-child { text-align: left; }
.mtable th[scope=row] a { font-weight: 500; }
.mtable th[scope=row] a:hover { color: var(--red-ink); }
.mtable small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.mtable tbody tr:last-child > * { border-bottom: 0; }
.mst { font-size: 1rem; font-weight: 600; }
.mst--y { color: #1A9A5C; } .mst--p { color: #E58A00; } .mst--n { color: var(--faint); }
@container (max-width: 980px) { .mblocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 600px) { .mblocks { grid-template-columns: minmax(0, 1fr); } }
.mdl { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.mdl:hover { border-color: var(--ink); }
.mdl .i { width: 14px; height: 14px; }

.mcontact { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); border-left: 4px solid var(--red); }
.mcontact__img { width: 148px; height: 185px; object-fit: cover; border-radius: var(--r-md); }
.mcontact__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 600px) { .mcontact { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; } .mcontact__img { width: 96px; height: 120px; } .mcontact__btns .btn { flex: 1 1 100%; justify-content: center; } }

/* ---------- Онлайн форма (forms.js) ---------- */
.fpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fpick__i { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-2); transition: border-color var(--d-fast); }
.fpick__i:hover { border-color: var(--ink); }
.fpick__i span { font-size: var(--t-xs); color: var(--muted); }
.fform { display: grid; gap: 18px; max-width: 980px; }
.fsec { padding: clamp(20px, 2.6vw, 32px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); display: grid; gap: 14px; }
.fsec.is-ok { border-color: #1A9A5C; box-shadow: inset 4px 0 0 #1A9A5C; }
.fsec.is-ok .ftext { opacity: .55; }
.fsec__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.fgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ftext { width: 100%; min-height: 72px; resize: vertical; font: inherit; font-size: var(--t-sm); line-height: 1.55; }
.fhp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fperson { border-top: 1px solid var(--line-2); padding: 14px 0; display: grid; gap: 10px; }
.fperson__head { display: grid; grid-template-columns: minmax(0, 1fr) auto 200px; gap: 12px; align-items: center; }
.fperson[data-new="1"] .fperson__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 200px; }
.fperson__head b { display: block; font-weight: 500; }
.fperson__head span { font-size: var(--t-xs); color: var(--muted); }
.fbio { justify-self: start; font-size: 11px !important; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); white-space: nowrap; }
.fbio.is-y { background: rgba(26, 154, 92, .12); color: #137A48 !important; }
.fperson details summary { cursor: pointer; font-size: var(--t-sm); color: var(--red-ink, #B5121B); font-weight: 500; list-style: none; }
.fperson details summary::-webkit-details-marker { display: none; }
.fperson details[open] summary { margin-bottom: 8px; }
.fperson details .input { margin-top: 8px; width: 100%; }
.ftest { border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 16px 18px 18px; display: grid; gap: 10px; margin: 0; }
.ftest legend { padding: 0 8px; font-weight: 500; }
.fsubmit { display: grid; gap: 12px; justify-items: start; padding-top: 8px; }
.fmsg--err { color: var(--red-ink, #B5121B); }
.fdone { max-width: 760px; padding: clamp(28px, 4vw, 48px); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); display: grid; gap: 14px; }
.fdone > .i { width: 40px; height: 40px; color: var(--red); }
.mfill small { display: block; }
.mdl--word { margin-left: 6px; height: 28px; padding: 0 10px; color: var(--muted); }
.mtable td .btn--sm { white-space: nowrap; }
@media (max-width: 760px) { .fgrid2, .fperson__head, .fperson[data-new="1"] .fperson__head { grid-template-columns: minmax(0, 1fr); } }
/* Отговори */
.ans__tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ans__tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); font-size: var(--t-xs); color: var(--muted); }
.ans__tab.is-done { color: var(--ink); border-color: #1A9A5C; }
.ans__unit { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.ans { border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); overflow: hidden; }
.ans__head { display: flex; justify-content: space-between; gap: 16px; padding: 16px 22px; background: var(--paper); border-bottom: 1px solid var(--line-2); }
.ans__head span { display: block; font-size: var(--t-xs); color: var(--muted); }
.ans__head time { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.ans__s { padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.ans__s:last-child { border-bottom: 0; }
.ans__s h4 { font-size: var(--t-sm); font-weight: 600; margin-bottom: 8px; }
.ans__s h4 em, .ans__p em { font-style: normal; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: rgba(229, 138, 0, .14); color: #9A5B00; margin-left: 6px; }
.ans__s.is-ok p { color: #137A48; font-size: var(--t-sm); }
.ans__cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans__cmp small { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ans pre { white-space: pre-wrap; font: inherit; font-size: var(--t-sm); line-height: 1.55; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--paper); }
.ans__cmp > div:last-child pre { background: rgba(26, 154, 92, .08); }
.ans__p { padding: 10px 0; border-top: 1px dashed var(--line-2); }
.ans__p span { font-size: var(--t-xs); color: var(--muted); }
.ans__p pre { margin-top: 6px; }
.ans__dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; font-size: var(--t-sm); }
.ans__dl dt { color: var(--muted); }
.ans__files { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .ans__cmp, .ans__dl { grid-template-columns: minmax(0, 1fr); } }

/* лентата „Изпрати“ - винаги видима долу */
.fsubmit { position: sticky; bottom: 12px; z-index: 5; padding: 14px 18px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -20px rgba(11, 22, 38, .45); }
.fsubmit__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.fmsg--err { font-weight: 500; }

/* последна актуализация */
.fupd { padding: 16px 20px; border-radius: var(--r-lg); background: rgba(26, 154, 92, .08); border: 1px solid rgba(26, 154, 92, .35); font-size: var(--t-sm); }
.fupd span { display: block; margin-top: 4px; color: var(--ink-2); }
.fsec.is-upd, .fperson.is-upd, .ftest.is-upd { position: relative; }
.fsec.is-upd { border-color: rgba(26, 154, 92, .55); }
.fperson.is-upd { background: rgba(26, 154, 92, .05); border-radius: 10px; padding-left: 12px; padding-right: 12px; }
.ftest.is-upd { border-color: rgba(26, 154, 92, .55); }
.fsec.is-upd::before, .fperson.is-upd::before, .ftest.is-upd::before { content: 'Актуализирано'; position: absolute; top: 10px; right: 12px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: #1A9A5C; color: #fff; }
.fsec.is-upd .fsec__head { padding-right: 110px; }
.fperson.is-upd { margin-top: 14px; }
.fperson.is-upd::before { top: -10px; right: 12px; }
.fsubmit { padding: 10px 14px; }
.fsubmit__row { flex-direction: row-reverse; justify-content: flex-start; } .fsubmit__row #fMsg { flex: 1 1 200px; text-align: right; }
.fsubmit__row { justify-self: stretch; width: 100%; }
.mcontact { grid-template-columns: minmax(0, 1fr) !important; }

/* ---------- Медицински център ---------- */
.mcf { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.mcf__search { position: relative; display: block; }
.mcf__search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.mcf__search .input { width: 100%; padding-left: 42px; }
.mcf__toggles { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mcf__toggles .is-off { opacity: .45; }
.mcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.mcd { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); align-items: start; }
.mcd__img { width: 96px; height: 120px; border-radius: 12px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; font-size: 1.6rem; color: var(--faint); }
.mcd__img img { width: 100%; height: 100%; object-fit: cover; }
.mcd__body { display: grid; gap: 6px; min-width: 0; }
.mcd__spec { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.mcd__name { font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
.mcd__name a:hover { color: var(--red-ink); }
.mcd__place { display: flex; gap: 6px; align-items: center; font-size: var(--t-xs); color: var(--muted); }
.mcd__place .i { width: 14px; height: 14px; flex: none; }
.mcd__st { font-size: var(--t-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px; justify-self: start; background: var(--paper-2); color: var(--ink-2); }
.mcd--now .mcd__st { background: rgba(26, 154, 92, .14); color: #137A48; }
.mcd--now .mcd__st::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1A9A5C; margin-right: 6px; vertical-align: 1px; animation: rpulse 1.4s ease-in-out infinite; }
.mcd--today .mcd__st { background: rgba(26, 154, 92, .08); color: #137A48; }
.mcd--off .mcd__st { background: rgba(229, 138, 0, .14); color: #9A5B00; }
.mcd--off, .mcd--no { opacity: .78; }
.mcd__note { font-size: var(--t-xs); color: var(--ink-2); }
.mcd__week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; margin-top: 2px; }
.mcd__week span { display: grid; gap: 1px; padding: 4px 3px; border-radius: 6px; background: var(--paper); font-size: 9.5px; line-height: 1.2; text-align: center; color: var(--faint); overflow-wrap: anywhere; }
.mcd__week span.has { color: var(--ink-2); }
.mcd__week span b { font-size: 10px; font-weight: 600; }
.mcd__week span.is-today { outline: 1.5px solid var(--ink); background: var(--white); color: var(--ink); }
.mcd__pay { display: flex; flex-wrap: wrap; gap: 6px; }
.mcpay { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); }
.mcpay.is-y { color: #137A48; border-color: rgba(26, 154, 92, .35); }
.mcpay.is-n { color: var(--faint); text-decoration: line-through; }
.mcd__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mc-cols { columns: 2; column-gap: var(--gap); }
.mc-cols li { break-inside: avoid; }
@media (max-width: 900px) { .mcf { grid-template-columns: minmax(0, 1fr); } .mc-cols { columns: 1; } }
@media (max-width: 420px) { .mcgrid { grid-template-columns: minmax(0, 1fr); } .mcd { grid-template-columns: 76px minmax(0, 1fr); } .mcd__img { width: 76px; height: 96px; } }
/* редактор на графика */
.me__bar { position: sticky; top: calc(var(--header-h) + 8px); z-index: 4; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px; margin-bottom: 14px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); box-shadow: 0 12px 30px -18px rgba(11,22,38,.4); }
.me__bar #meQ { margin-left: auto; max-width: 260px; }
.me__ok { color: #137A48; font-weight: 500; }
.me__wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--white); }
.me { border-collapse: collapse; min-width: 1280px; width: 100%; font-size: var(--t-xs); }
.me th, .me td { padding: 6px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.me thead th { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--paper); }
.me th[scope=row] { min-width: 190px; }
.me th[scope=row] b { display: block; font-weight: 500; font-size: var(--t-sm); }
.me th[scope=row] small { color: var(--muted); }
.me .input { height: 34px; padding: 0 8px; font-size: 12.5px; width: 100%; min-width: 96px; }
.me__off { display: grid; gap: 4px; min-width: 170px; }
.me__grp th { background: var(--paper-2); font-weight: 600; font-size: var(--t-sm); }

/* ---------- МЦ - таблица (като Лозенец) ---------- */
.mctable { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--white); }
.mcr { display: grid; grid-template-columns: 15% minmax(0, 1fr) 13% 19% 13% 13%; align-items: center; border-bottom: 1px solid var(--line-2); }
.mcr:nth-child(odd):not(.mcr--head) { background: #FBFAF7; }
.mcr > div { padding: 12px 14px; font-size: var(--t-sm); }
.mcr > div + div { border-left: 1px solid var(--line-2); align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.mcr--head { background: var(--ink) !important; color: #fff; }
.mcr--head > div { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 18px 14px; border-color: rgba(255,255,255,.12) !important; }
.mcr__lbl { display: none; }
.mcr__spec { color: var(--red); font-weight: 500; }
.mcr__doc { flex-direction: row !important; justify-content: flex-start !important; align-items: center; gap: 12px; }
.mcr__img { flex: none; width: 58px; height: 58px; border-radius: 50%; padding: 2px; border: 2px solid var(--red); overflow: hidden; display: grid; place-items: center; background: var(--paper-2); }
.mcr__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 50%; }
.mcr__img b { color: var(--faint); font-weight: 500; }
.mcr__name { display: block; font-size: 1.02rem; font-weight: 500; line-height: 1.25; }
.mcr__name a:hover { color: var(--red-ink); }
.mcr__st { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.mcr--now .mcr__st { color: #137A48; } .mcr--now .mcr__st::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1A9A5C; margin-right: 6px; vertical-align: 1px; animation: rpulse 1.4s ease-in-out infinite; }
.mcr--today .mcr__st { color: #137A48; } .mcr--off .mcr__st { color: #9A5B00; }
.mcr--off, .mcr--no { opacity: .72; }
.mcr__note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mcr__loc, .mcr__sch { text-align: center; font-size: 12.5px !important; color: var(--ink-2); }
.mcr__g { line-height: 1.45; } .mcr__g span { color: var(--muted); }
.mcr__g.is-today { font-weight: 600; color: var(--ink); } .mcr__g.is-today span { color: var(--ink); }
.mcr__muted { color: var(--faint); }
.mcr__pay ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.mcr__pay li { display: flex; align-items: center; gap: 8px; }
.mcr__pay li i { width: 13px; height: 13px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; }
.mcr__pay li.is-y i::after { content: ''; width: 7px; height: 7px; background: var(--red); }
.mcr__pay li.is-n { color: var(--faint); }
.mcr__pay li.is-n i::after { content: ''; width: 7px; height: 7px; background: var(--line); }
.mcr__cta { align-items: center; }
.mcr__cta .btn { white-space: normal; text-align: center; line-height: 1.15; height: auto; min-height: 38px; padding: 8px 14px; }
@media (max-width: 980px) {
  .mcr--head { display: none; }
  .mcr { grid-template-columns: 1fr; padding: 16px; gap: 10px; }
  .mcr > div { padding: 0; border: 0 !important; }
  .mcr > div + div { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; text-align: left; }
  .mcr__doc { display: flex !important; }
  .mcr__lbl { display: block; color: var(--red); font-weight: 600; font-size: var(--t-sm); }
  .mcr__spec { order: -1; display: block; }
  .mcr__spec .mcr__lbl { display: none; }
  .mcr__loc, .mcr__sch { text-align: left; }
  .mcr__cta { justify-self: start; }
  .mcr__cta .btn { white-space: nowrap; }
}
@media (max-width: 980px) { .mcr__cta { display: block !important; } .mcr__cta .btn { width: auto; padding: 10px 18px; } .mcr__img { width: 72px; height: 72px; } }

/* МЦ - услуги: еднаква височина, отваряне надолу; свободен прием на цялата ширина */
.mcsvcs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.mcsvc { border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); transition: border-color var(--d-fast); }
.mcsvc[open] { border-color: var(--ink); }
.mcsvc summary { list-style: none; cursor: pointer; display: grid; gap: 10px; padding: clamp(20px, 2.4vw, 28px); min-height: 200px; align-content: start; }
.mcsvc summary::-webkit-details-marker { display: none; }
.mcsvc h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.mcsvc__hint { font-size: var(--t-sm); color: var(--ink-2); }
.mcsvc__btn { margin-top: auto; align-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 500; color: var(--red-ink, #B5121B); }
.mcsvc__btn .i { width: 14px; height: 14px; transition: transform var(--d-fast); }
.mcsvc[open] .mcsvc__btn .i { transform: rotate(180deg); }
.mcsvc ul { margin: 0; padding: 0 clamp(20px, 2.4vw, 28px) clamp(20px, 2.4vw, 28px); font-size: var(--t-sm); }
.mcfree { margin-top: 40px; }
.mcfree h3 span { font-weight: 400; }
.mcfree__list { margin-top: 16px; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px var(--gap); }
@media (max-width: 1100px) { .mcfree__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .mcsvcs { grid-template-columns: minmax(0, 1fr); } .mcsvc summary { min-height: 0; } .mcfree__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mcfree__list { grid-template-columns: minmax(0, 1fr); } }

/* МЦ - компактен списък на телефон */
@media (max-width: 980px) {
  .mctable { border-radius: var(--r-md); }
  .mcr { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 14px 14px; align-items: center; }
  .mcr > div + div { display: block; }
  .mcr__lbl { display: none !important; }
  .mcr__spec { grid-column: 2 / -1; grid-row: 1; font-size: 11px; font-family: var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
  .mcr__doc { display: contents !important; }
  .mcr__img { grid-column: 1; grid-row: 1 / span 3; width: 56px !important; height: 56px !important; align-self: start; }
  .mcr__doc > span:last-child { grid-column: 2 / -1; grid-row: 2; }
  .mcr__name { font-size: .98rem; }
  .mcr__loc, .mcr__sch { grid-column: 2 / -1; font-size: 12px !important; text-align: left !important; color: var(--muted); }
  .mcr__loc.is-empty, .mcr__sch.is-empty { display: none !important; }
  .mcr__pay { grid-column: 2; margin-top: 6px; }
  .mcr__pay ul { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; }
  .mcr__pay li i { width: 11px; height: 11px; }
  .mcr__cta { grid-column: 3; grid-row: auto; align-self: end; margin-top: 6px; display: block !important; }
  .mcr__cta .btn { min-height: 34px; padding: 6px 12px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 380px) { .mcr__pay { grid-column: 2 / -1; } .mcr__cta { grid-column: 2 / -1; justify-self: start; } }
@media (max-width: 980px) {
  .mcr { grid-template-columns: 56px minmax(0, 1fr); }
  .mcr__pay { grid-column: 2; }
  .mcr__pay ul { flex-wrap: nowrap; gap: 10px; white-space: nowrap; }
  .mcr__cta { grid-column: 2; justify-self: start; }
}

/* ---------- МЦ - специалисти (записване в MyHealth) ---------- */
.mcmon { display: grid; gap: 28px; }
.mcg { border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); overflow: hidden; }
.mcg__head, .mcw { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(0, 1fr) 150px; gap: 18px; align-items: center; padding: 12px 18px; }
.mcg__head { grid-template-columns: 1fr; background: var(--ink); color: #fff; padding-top: 14px; padding-bottom: 14px; }
.mcg__head h3 { font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; }
.mcg__head h3 small { font-family: var(--f-mono); font-size: 11px; color: rgba(255,255,255,.55); margin-left: 6px; }
.mcw { border-top: 1px solid var(--line-2); transition: background var(--d-fast); }
.mcw:hover { background: #FBFAF7; }
.mcw__who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mcw__img { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; }
.mcw__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mcw__img b { font-weight: 500; color: var(--faint); font-size: 14px; }
.mcw__txt { display: grid; gap: 2px; min-width: 0; }
.mcw__name { font-weight: 500; line-height: 1.25; }
.mcw__name a:hover { color: var(--red-ink); }
.mcw__meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.mcw__how { font-size: 12.5px; color: var(--muted); }
.mcw__how a { color: var(--ink); font-weight: 500; white-space: nowrap; }
.mcw__go { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; transition: background var(--d-fast); }
.mcw__go:hover { background: var(--red); }
.mcw__go .i { width: 15px; height: 15px; }
.mcw__go--tel { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.mcw__go--tel:hover { background: var(--paper-2); }
@media (max-width: 980px) {
  .mcw { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px; }
  .mcw__who { grid-column: 1 / -1; }
  .mcw__how { grid-column: 1; font-size: 12px; }
  .mcw__cta { grid-column: 2; align-self: center; }
  .mcw__go { width: auto; height: 36px; padding: 0 12px; }
  .mcw__go span { display: none; }
}

/* акредитации, проекти и награди на звеното (pages_units.py) */
.accr { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.accr li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.accr__y { font-weight: 600; color: var(--red); padding-top: 2px; }
.accr b { display: block; font-size: 17px; line-height: 1.35; color: var(--ink); margin-bottom: 6px; }
.accr p { margin: 0; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 700px) { .accr li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* Звената от общия шаблон (pages_units.py) - същите размери на портрета и картите като в страниците на клиниките */
body[data-page^='unit-'] .portrait-xl__img { grid-column: 1 / span 3; aspect-ratio: 4 / 5; }
body[data-page^='unit-'] .portrait-xl__body { grid-column: 5 / -1; align-self: center; }
body[data-page^='unit-'] .pgrid:has(> .doc) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
body[data-page^='unit-'] .pgrid .doc__name { font-size: 1.05rem; }
body[data-page^='unit-'] .pgrid .doc__meta { font-size: 12px; }
@container (max-width: 1080px) { body[data-page^='unit-'] .pgrid:has(> .doc) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 640px) { body[data-page^='unit-'] .pgrid:has(> .doc) { grid-template-columns: repeat(2, minmax(0, 1fr)); } body[data-page^='unit-'] .portrait-xl__img { grid-column: 1 / -1; max-width: 280px; } body[data-page^='unit-'] .portrait-xl__body { grid-column: 1 / -1; } }

/* Биография - по-събрана: въведение отгоре, разделите в две колони на широк екран */
#dpBio .bio__intro { display: grid; gap: .5em; font-size: 1.125rem; margin-bottom: 32px; max-width: 760px; }
#dpBio .bio__intro p:nth-child(-n+2) { color: var(--ink); }
#dpBio .bio__cols { columns: 2 340px; column-gap: 56px; font-size: 1rem; line-height: 1.6; }
#dpBio .bio__sec { break-inside: auto; margin-bottom: 30px; }
#dpBio .bio__sec > p { margin: 0 0 .7em; }
#dpBio .bio__cols .bio__h { margin-top: 0; break-after: avoid; }
#dpBio .bio__cols .bio__h + p, #dpBio .bio__cols .bio__h + ul { break-before: avoid; }
#dpBio .bio__cols .bio__ul { margin: 4px 0 14px; font-size: 1rem; }
#dpBio .bio__cols .bio__ul li { padding: 6px 0; break-inside: avoid; }
#dpBio.prose { max-width: none; }

/* Галерии - отваряне на цял екран (pages.js) */
.gal__open { cursor: zoom-in; }
.gal__open:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.lbox { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 10, 19, .94); display: grid; place-items: center; }
.lbox[hidden] { display: none; }
.lbox__fig { margin: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 72px; box-sizing: border-box; }
.lbox__fig img { max-width: 100%; max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .6); }
.lbox__n { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: var(--night-muted); font: 500 .8125rem/1 var(--f-mono); letter-spacing: .06em; }
.lbox__btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--night-line); background: rgba(255, 255, 255, .08); color: var(--night-ink); font: 400 1.75rem/1 var(--f-sans); cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.lbox__btn:hover { background: rgba(255, 255, 255, .18); }
.lbox__btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.lbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lbox__close { top: 12px; right: 16px; font-size: 1.125rem; }
@media (max-width: 640px) {
  .lbox__fig { padding: 56px 8px 84px; }
  .lbox__fig img { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
  .lbox__prev, .lbox__next { top: auto; bottom: 18px; transform: none; }
  .lbox__prev { left: calc(50% - 60px); } .lbox__next { right: calc(50% - 60px); }
}

/* Заболявания в звената - карта с резюме, въпросите в прозорец (pages_units.py → conds) */
.cond__more { margin-top: 6px; justify-self: start; text-align: left; }
.dcard--min { padding-block: 18px; }
.dcard--min h3 { font-size: 1.125rem; }
.cdlg { width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(5, 10, 19, .5); }
.cdlg::backdrop { background: rgba(5, 10, 19, .6); }
html:has(dialog.cdlg[open]) { overflow: hidden; }
.cdlg__in { position: relative; padding: 40px 44px 44px; display: grid; gap: 16px; }
.cdlg__in h2 { padding-right: 48px; }
.cdlg__lead { font-size: 1.0625rem; color: var(--ink-2); margin-bottom: 12px; }
.cdlg__x { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; cursor: pointer; }
.cdlg__x:hover { border-color: var(--ink); }
.cdlg__x:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cdlg__note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md, 12px); background: var(--red-tint); color: var(--red-ink); font-weight: 500; }
.cdlg__note svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
@media (max-width: 640px) { .cdlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; } .cdlg__in { padding: 28px 18px 40px; } }

/* Заболявания по групи (pages_units.py → conds с група) */
.dcards > .dgroup { grid-column: 1 / -1; margin: 24px 0 -4px; font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dcards > .dgroup:first-child { margin-top: 0; }

/* Старши сестри с биография (pages_units.py → nurse_bios) */
.nbios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.nbio { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); }
.nbio__img { aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.nbio__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.nbio__n { font-size: 1.2rem; font-weight: 500; letter-spacing: -.02em; }
.nbio__r { margin: 4px 0 12px; font-size: var(--t-sm); color: var(--muted); }
.nbio .prose p { font-size: .9375rem; }
@container (max-width: 980px) { .nbios { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .nbio { grid-template-columns: 1fr; } .nbio__img { max-width: 180px; } }

/* число-интервал („1 200-1 300“) - на един ред */
.stat__n--range { white-space: nowrap; font-size: clamp(1.9rem, 3.2vw, 3rem) !important; }

/* Шаблон на звената като Образна диагностика: списъци като карти, „Прочетете още“, биография на сестрите */
.dcard--li { padding-block: 20px; }
.dcard--li p { font-size: 1.0625rem; line-height: 1.45; color: var(--ink); }
details.more { margin-top: 4px; }
details.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--ink); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '+'; font-size: 1.1em; line-height: 1; }
details.more[open] > summary { margin-bottom: 18px; }
details.more[open] > summary::after { content: '−'; }
details.more > summary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.nbio__more { margin-top: 10px; }
/* Галерия с портрети - лицата не се режат (gallery_cls='gal--people') */
.gal.gal--people { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; }
.gal.gal--people .media, .gal.gal--people .media:first-child { grid-row: auto; grid-column: auto; aspect-ratio: 4 / 5; }
.gal--people .media img { object-position: 50% 15%; }
@container (max-width: 980px) { .gal.gal--people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 560px) { .gal.gal--people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.lbox__n { white-space: nowrap; max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis; }
/* галерия с точно 4 снимки - последната запълва реда */
.gal:not(.gal--people) > .media:nth-child(4):last-child { grid-column: span 2; }
.gal:not(.gal--people) > .media:nth-child(4):last-child img { object-position: 50% 22%; }

/* Спешно отделение - благодарствени писма */
.thanks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.thanks__i { margin: 0; padding: 28px 30px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-2); display: grid; gap: 18px; align-content: space-between; }
.thanks__i blockquote { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.4; color: var(--ink); }
.thanks__i figcaption { font-size: var(--t-sm); color: var(--muted); }
.thanks__i figcaption b { color: var(--ink); font-weight: 500; }
@media (max-width: 760px) { .thanks { grid-template-columns: minmax(0, 1fr); } .thanks__i { padding: 22px; } }

/* Новина: колона с текст ~820px; на широк екран вдясно „Последни новини“ (5), които остават видими при скролиране.
   Под 1200px дясната колона се скрива - остават „Свързани статии“ под новината. */
.art-layout { display: grid; grid-template-columns: minmax(0, 820px); justify-content: center; column-gap: clamp(48px, 4vw, 80px); }
.art-layout > .article { max-width: none; margin-inline: 0; }
.art-fig { grid-column: 1; max-width: none; width: 100%; } /* снимката е в колоната на текста; „Последни новини“ започват до нея */
.art-layout .article h1 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); line-height: 1.1; } /* новина: по-малко заглавие от общото .article h1 */
.art-side { display: none; }
@container (min-width: 1200px) {
  .art-layout { grid-template-columns: minmax(0, 820px) 300px; }
  .art-side { display: grid; gap: 20px; align-content: start; align-self: start; position: sticky; top: calc(var(--header-h) + 32px); grid-column: 2; grid-row: 1 / span 2; margin-top: clamp(28px, 3.5vw, 48px); }
}
.art-latest { display: grid; }
.art-latest li + li { border-top: 1px solid var(--line); }
.art-latest a { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 0; }
.art-latest a:not(:has(.art-latest__img)) { grid-template-columns: minmax(0, 1fr); }
.art-latest__img { width: 72px; height: 72px; border-radius: var(--r-sm, 10px); overflow: hidden; background: var(--line); }
.art-latest__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--d-slow) var(--ease); }
.art-latest a:hover .art-latest__img img { transform: scale(1.05); }
.art-latest__date { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.art-latest__t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .95rem; font-weight: 500; line-height: 1.35; color: var(--ink); transition: color var(--d); }
.art-latest a:hover .art-latest__t { color: var(--red); }

/* Профил на лекар: „Запази час“ скролва до блока за записване; името на лекаря е над заглавието */
#dpContacts { scroll-margin-top: calc(var(--header-h) + 72px); }
.cta__who { color: rgba(246, 245, 241, .62); margin-bottom: 14px; }
#dpContacts:target .cta { animation: cta-hl 1.6s var(--ease) 1; }
@keyframes cta-hl { 0%, 30% { box-shadow: 0 0 0 3px var(--red); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Профил на сестра / специалист (lib/person-profile): цитат в раздел */
.pf-quote { margin: 32px 0 0; padding-left: 24px; border-left: 2px solid var(--red); font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; line-height: 1.45; color: var(--ink); }
.pf-quote footer { font-family: var(--f-sans); font-style: normal; font-size: var(--t-xs); color: var(--muted); margin-top: 10px; }

/* Галерия с равни плочки 3:2 (страница „Галерия“, „Екип“) - без рязане на общите снимки */
.gal.gal--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
.gal.gal--grid > .media, .gal.gal--grid > .media:first-child { grid-row: auto; grid-column: auto; aspect-ratio: 3 / 2; }
.gal.gal--grid > .media:nth-child(4):last-child { grid-column: auto; }
@container (max-width: 760px) { .gal.gal--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 460px) { .gal.gal--grid { grid-template-columns: 1fr; } }

/* „Екип“ - хедър с мозайка от портрети: квадратни плочки зад тъмносиния фон, текстът остава четим */
.ph--team { position: relative; overflow: hidden; isolation: isolate; }
.ph--team > .wrap { position: relative; z-index: 2; }
.ph--team .ph__title, .ph--team .ph__aside, .ph--team .ph__search { grid-column: 1 / span 6; }
.ph--team .ph__aside { max-width: 46ch; }
@container (max-width: 860px) { .ph--team .ph__title, .ph--team .ph__aside, .ph--team .ph__search { grid-column: 1 / -1; } }
.tmos { position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: min(64%, 980px); display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 8px; padding: 8px; align-content: start; overflow: hidden; }
.tmos img[hidden] { display: none; }
.tmos img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 16%; border-radius: 10px; filter: saturate(.8) brightness(.9); }
.ph--team::after { content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, #050A13 0%, #050A13 34%, rgba(5, 10, 19, .9) 48%, rgba(8, 18, 38, .5) 66%, rgba(8, 18, 38, .4) 100%), linear-gradient(180deg, rgba(5, 10, 19, .55) 0%, rgba(5, 10, 19, 0) 26%, rgba(5, 10, 19, 0) 70%, rgba(5, 10, 19, .7) 100%); }
@media (max-width: 980px) {
  .tmos { width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  .ph--team::after { background: linear-gradient(180deg, rgba(5, 10, 19, .86) 0%, rgba(8, 18, 38, .74) 55%, rgba(5, 10, 19, .9) 100%); }
}
@media (max-width: 560px) { .tmos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Тесни телефони (≤ 380 px): плочките „Какво търсите?“ и числата не разширяват страницата */
@media (max-width: 380px) {
  .picker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .pick { padding: 18px 14px; min-width: 0; }
  .pick span { overflow-wrap: anywhere; }
  .stats-row, .stats-row[style*="repeat(4"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .stats-row .stat { min-width: 0; padding-right: 12px; }
  .stats-row .stat + .stat { padding-left: 12px; }
  .stats-row .stat__n { font-size: clamp(1.9rem, 10vw, 2.6rem); }
}
@media (max-width: 900px) { .route { grid-template-columns: minmax(0, 1fr) !important; } .route__form { min-width: 0; } }
@media (max-width: 380px) { .route { padding: 20px 16px; } }
@media (max-width: 380px) {
  .kv { grid-template-columns: minmax(0, 1fr) !important; }
  .kv dd { overflow-wrap: anywhere; }
  .md__list, .md__list > * { min-width: 0; }
  .md .proc { padding: 18px 16px; }
  .md .proc .badge, .proc__top .badge { white-space: normal; }
  .stat__n--range { font-size: 1.5rem !important; }
}
@media (max-width: 380px) { .room > div { min-width: 0; } .room b, .room p { overflow-wrap: anywhere; } }
/* Статии и текстови страници на телефон: дълги думи, адреси и имена на файлове се пренасят, вместо да разширяват страницата */
.article__body { overflow-wrap: break-word; }
.article__body ul { grid-template-columns: minmax(0, 1fr); }
.article__body li, .article__body a { overflow-wrap: anywhere; }
