/* Раздел 07 «Рядом с пациентом» — стили страницы.
   Визуальный язык общий с разделом 06 (life.css): оглавление, главы-аккордеоны, инструменты, выноски. */

/* ---------- герой ---------- */
.near-tagline { margin: 14px 0 0; font-family: var(--ff-display); font-weight: 700; font-size: clamp(18px, 2.2vw, 23px); line-height: 1.3; color: var(--accent-600); }
.page-hero .near-tagline + .lead { margin-top: 12px; }
.near-sos { margin-top: 22px; display: flex; gap: 14px; align-items: flex-start; max-width: 780px; padding: 14px 18px; border-radius: var(--r-md); background: var(--danger-bg); border: 1px solid #f6c4ce; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); transition: border-color .2s; }
.near-sos:hover { border-color: var(--danger); }
.near-sos b { color: var(--danger); font-family: var(--ff-display); font-size: 16px; }
.near-sos u { color: var(--danger); font-weight: 600; text-underline-offset: 3px; }
.near-sos__ico { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: #fff; color: var(--danger); }
.near-sos__ico svg { width: 19px; height: 19px; }

/* раскрытие глав над точкой прокрутки не должно «уводить» страницу */
body[data-page="near"] main { overflow-anchor: none; }
body[data-page="near"] .section--tight { padding-block: 28px; }
@media (min-width: 720px) { body[data-page="near"] .section--tight { padding-block: 40px; } }
.page-end { margin-top: 20px; }

/* ---------- карточки инструментов ---------- */
.near-tools .section-head { margin-bottom: 20px; }
.near-tools__lead { margin-top: 10px; color: var(--ink-2); }
.tool-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-cards li { display: grid; }
.tool-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent-300); box-shadow: var(--shadow-md); }
.tool-card .icon-tile { width: 40px; height: 40px; border-radius: 12px; }
.tool-card .icon-tile svg { width: 20px; height: 20px; }
.tool-card__t { font-family: var(--ff-display); font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--ink); overflow-wrap: break-word; hyphens: auto; }
.tool-card__d { display: none; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tool-card__go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.tool-card__go svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.tool-card:hover .tool-card__go svg { transform: translateX(3px); }
@media (min-width: 620px) { .tool-card__d { display: block; } .tool-card { padding: 18px 18px 16px; } .tool-card__t { font-size: 16.5px; } }
@media (min-width: 720px) { .tool-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1100px) { .tool-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- раскладка: оглавление + главы ---------- */
.near-main { padding-top: 8px !important; }
.near-layout { display: grid; gap: 20px; align-items: start; }
.near-aside { display: none; }
.near-acc { min-width: 0; container-type: inline-size; }
.near-acc > * + * { margin-top: 14px; }

.near-jump { position: sticky; top: calc(var(--header-h) + 8px); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.near-jump svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.near-jump select { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-overflow: ellipsis; }
.near-jump select:focus-visible { outline: 3px solid var(--accent-300); outline-offset: 2px; border-radius: 10px; }

.near-ch, .near-block, .near-group, .near-acc > .tool { scroll-margin-top: 62px; }
.near-acc .acc .tool { scroll-margin-top: 70px; }

@media (min-width: 1000px) {
  .near-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; }
  .near-aside { display: block; position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: var(--r-lg); }
  .near-jump { display: none; }
  .near-acc > .near-jump + * { margin-top: 0; }
  .near-ch, .near-block, .near-group, .near-acc > .tool, .near-acc .acc .tool { scroll-margin-top: 8px; }
}

/* оглавление */
.near-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 16px 12px; box-shadow: var(--shadow-sm); }
.near-toc__head { display: block; font-family: var(--ff-display); font-weight: 600; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--kicker); margin: 0 6px 6px; }
.near-toc__group + .near-toc__group { margin-top: 6px; }
.near-toc__g { display: block; padding: 10px 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.near-toc ol { list-style: none; margin: 0; padding: 0; }
.near-toc a { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 6px 8px 6px 6px; border-radius: 10px; font-size: 14px; line-height: 1.35; color: var(--ink-2); transition: background .2s, color .2s; }
.near-toc a:hover { color: var(--accent); background: var(--bg-soft); }
.near-toc a.is-current { color: var(--accent-600); background: var(--accent-100); font-weight: 600; }
.near-toc__n { flex: none; width: 20px; font-family: var(--ff-display); font-weight: 700; font-size: 11.5px; color: var(--accent); }

/* группы */
.near-acc > .near-group { margin-top: 44px; }
.near-acc > .near-group:first-child { margin-top: 0; }
@media (max-width: 999px) { .near-acc > .near-jump + .near-group { margin-top: 22px; } }
.near-group { padding: 0 2px; }
.near-group__k { display: block; font-family: var(--ff-display); font-weight: 600; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--kicker); margin-bottom: 4px; }
.near-group__t { font-weight: 800; font-size: clamp(24px, 3vw, 30px); line-height: 1.15; }

/* ---------- глава-аккордеон ---------- */
.near-acc .acc { overflow: clip; }
.near-acc .acc__inner { overflow: clip; min-height: 0; }
.near-acc h5, .near-acc h6 { margin: 0; font-family: var(--ff-display); line-height: 1.3; }
.near-ch__h { margin: 0; font: inherit; letter-spacing: 0; }
.near-ch__text { min-width: 0; }
.near-ch__n { display: block; font-family: var(--ff-text); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.near-ch .acc__title { display: block; }
.near-ch.is-open .near-ch__sub { display: block; color: var(--muted); }
.near-ch__sub { font-weight: 500 !important; }
@media (max-width: 420px) { .near-ch .acc__head { gap: 12px; padding: 16px 14px; } .near-ch .acc__title { font-size: 16.5px; } .near-ch .acc__content { padding: 0 14px 20px; } }
@media (min-width: 720px) { .near-ch > .near-ch__h .acc__head { padding: 22px 26px; } .near-ch .acc__content { padding: 0 26px 28px; } }

.near-acc .acc__content { font-size: 16px; line-height: 1.65; }
.near-acc :where(.acc__content p, .near-block p, .tool p) { margin: 0; }
.near-ch .acc__content > * + *, .ch-sec > * + *, .near-block > * + * { margin-top: 14px; }
.ch-sec { margin-top: 24px !important; }
.ch-h { font-size: 18px; line-height: 1.3; color: var(--ink); }
.near-acc .acc__content strong { color: var(--ink); }
.near-acc .dots li { color: var(--ink-2); }

/* реплика в кавычках */
.say { padding: 12px 16px; border-left: 3px solid var(--accent-300); background: var(--bg-soft); border-radius: 0 12px 12px 0; font-style: italic; color: var(--ink); }
.say + .say { margin-top: 8px !important; }
.say--sm { padding: 8px 12px; font-size: 14.5px; }

/* выноски */
.callout { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-pink); }
.callout__ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #fff; color: var(--accent); }
.callout__ico svg { width: 19px; height: 19px; }
.callout__label { display: block; font-family: var(--ff-display); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-600); margin-bottom: 4px; }
.callout p { color: var(--ink); font-size: 15.5px; line-height: 1.6; }
.callout--tip { background: var(--beta-bg); }
.callout--tip .callout__ico, .callout--tip .callout__label { color: var(--beta-ink); }
.callout--warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.callout--warn .callout__ico, .callout--warn .callout__label { color: var(--soon-ink); }
.callout--main { background: var(--ok-bg); }
.callout--main .callout__ico, .callout--main .callout__label { color: var(--ok-ink); }

/* «вместо / можно спросить» */
.kn-grid { display: grid; gap: 10px; margin: 12px 0; }
.kn { padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 15px; }
.kn b { display: block; margin-bottom: 6px; }
.kn--yes b { color: var(--ok-ink); }
.kn--no b { color: var(--beta-ink); }
.kn .say { margin: 0; }
@container (min-width: 560px) { .kn-grid { grid-template-columns: 1fr 1fr; } }

/* карточки внутри глав */
.near-cards { gap: 12px; }
.near-cards .info-card { padding: 16px 18px; }
.near-cards .info-card h5 { margin: 0 0 6px; font-family: var(--ff-display); font-size: 16px; line-height: 1.3; }
.near-cards .info-card p { font-size: 15px; margin: 0; }
.near-cards .info-card p + p { margin-top: 6px; }
@container (max-width: 560px) { .near-cards { grid-template-columns: 1fr !important; } }

/* ---------- общий вид инструмента ---------- */
.tool { container-type: inline-size; position: relative; padding: 18px; border-radius: var(--r-lg); background: var(--bg-soft); border: 1.5px solid var(--accent-100); }
.near-acc > .tool { border-color: var(--accent-300); background: #fff; box-shadow: var(--shadow-sm); }
.tool > * + * { margin-top: 14px; }
.tool__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tool__badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tool__badge svg { width: 15px; height: 15px; }
.tool__title { flex: 1 1 220px; font-size: 20px; line-height: 1.25; }
.tool__note { font-size: 14px; line-height: 1.5; color: var(--muted); }
.tool__disc { display: flex; gap: 8px; align-items: flex-start; }
.tool__disc svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.tool__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tool__actions svg, .tool__btn svg, .tool .btn svg { width: 17px; height: 17px; }
.tool__status { display: block; font-size: 14px; font-weight: 600; color: var(--ok-ink); }
.tool__status:empty { display: none; }
.tool .btn.is-armed { border-color: var(--danger); color: var(--danger); }
.tool .check { background: #fff; border: 1px solid var(--line); }
.tool .check:hover { background: #fff; border-color: var(--accent-300); }
.tool .checklist { gap: 8px; }
.kit-count { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent-600); white-space: nowrap; }
.kit-count b { font-family: var(--ff-display); font-size: 17px; }
.sit-fb__src { font-size: 14px; color: var(--muted); }
.sit-fb__src .link { font-weight: 600; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent-600); }
.phone-link { color: var(--ink); white-space: nowrap; }
.phone-link:hover { color: var(--accent); }
@media (min-width: 720px) { .tool { padding: 22px 24px; } }
@media (max-width: 519px) { .tool { padding: 16px 14px; } }

/* общие вкладки внутри инструментов */
.tool .pills { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; padding-block: 0; scroll-snap-type: none; }
.tool .pill { min-height: 42px; padding: 0 16px; font-size: 14.5px; }
.tool .pill .pill__ico { width: 30px; height: 30px; margin-left: -8px; }
.tp-seg { gap: 8px; }
.tp-seg button { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
.tab-panel.tp, .tool .tab-panel { padding-top: 0; }
.tp { padding: 16px 18px !important; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.tp > * + * { margin-top: 12px; }
.tp-t { font-size: 16.5px; color: var(--ink); }
.tp > .tp-t:not(:first-child) { margin-top: 20px; }
@media (max-width: 519px) { .tool .pill, .tp-seg button { min-height: 40px; padding: 0 12px; font-size: 14px; } .tool .pills, .tp-seg { gap: 6px; } .tool .pill .pill__ico { display: none; } .tp { padding: 14px !important; } }

/* ---------- 1. ситуации ---------- */
.sit > * + * { margin-top: 12px; }
.sit__prompt { padding: 16px 18px; border-radius: var(--r-md); background: var(--plum-grad); color: #fff; font-family: var(--ff-display); font-weight: 700; font-size: 18px; line-height: 1.35; }
.sit__k { display: block; margin-bottom: 4px; font-family: var(--ff-text); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.sit__q { font-weight: 600; color: var(--ink); }
.sit-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sit-opt { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r-sm); background: #fff; border: 1.5px solid var(--line); text-align: left; font-size: 15.5px; line-height: 1.5; color: var(--ink); transition: border-color .2s, background .2s; }
.sit-opt:hover { border-color: var(--accent-300); }
.sit-opt__l { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-100); color: var(--accent-600); font-family: var(--ff-display); font-weight: 700; font-size: 13px; }
.sit-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--bg-soft); }
.sit-opt[aria-pressed="true"] .sit-opt__l { background: var(--accent); color: #fff; }
.sit-opt.is-seen:not([aria-pressed="true"]) .sit-opt__l { background: var(--line-strong); color: var(--ink-2); }
@container (min-width: 640px) { .sit-opts { grid-template-columns: 1fr 1fr; } }
.sit-fbs { min-height: 60px; }
.sit-fbs__empty { padding: 14px 16px; border-radius: var(--r-md); border: 1.5px dashed var(--line-strong); color: var(--muted); font-size: 14.5px; }
.sit-fb { padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); font-size: 15.5px; line-height: 1.6; }
.sit-fb > * + *, .sit-fb__t > * + * { margin-top: 8px; }
.sit-fb__v { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
.sit-fb__v svg { width: 16px; height: 16px; }
.sit-fb--ok { border-left-color: #4f9a66; }
.sit-fb--ok .sit-fb__v { background: var(--ok-bg); color: var(--ok-ink); }
.sit-fb--no { border-left-color: var(--accent); }
.sit-fb--no .sit-fb__v { background: var(--accent-100); color: var(--accent-600); }
.sit-fb--dep { border-left-color: var(--beta-ink); }
.sit-fb--dep .sit-fb__v { background: var(--beta-bg); color: var(--beta-ink); }
.sit__more { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.sit__more svg { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--accent); }

/* ---------- 2. фразы ---------- */
.ph-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ph-mode .seg { flex-wrap: nowrap; gap: 8px; }
.ph-mode .seg button { min-height: 44px; padding: 0 18px; font-size: 15px; white-space: nowrap; }
@media (max-width: 400px) { .ph-mode .seg button { padding: 0 12px; font-size: 14.5px; } }
.ph-hint { flex: 1 1 220px; transition: opacity .25s; }
.ph-hint.is-off { opacity: 0; }
@media (max-width: 519px) { .ph-hint.is-off { display: none; } }
.phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px 16px; }
.phrase { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 8px; }
@container (min-width: 620px) { .phrases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 900px) { .phrases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.phrase__old { position: relative; padding: 14px 16px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 15.5px; line-height: 1.45; color: #6b4a5c; }
.phrase__old s { text-decoration-thickness: 1.5px; text-decoration-color: rgba(107, 74, 92, .75); }
.phrase__src { float: right; margin: -2px -4px 4px 8px; padding: 2px 9px; border-radius: 999px; background: var(--bg-soft); font-size: 11.5px; font-weight: 700; color: var(--accent); }
a.phrase__src:hover { background: var(--accent-100); }
.phrase__lab { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.phrase__why { padding: 0 4px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.phrase__why p + p { margin-top: 4px; }
.phrase__arrow { display: grid; place-items: center; color: var(--accent); }
.phrase__arrow svg { width: 20px; height: 20px; }
.phrase__new { position: relative; display: block; width: 100%; text-align: left; padding: 16px 18px 18px; border: 0; border-radius: var(--r-md); background: var(--plum); color: #fff; box-shadow: 0 10px 24px rgba(52, 30, 43, .18); cursor: default; overflow: hidden; }
.phrase__new:disabled { opacity: 1; }
.phrase__new .phrase__lab { color: rgba(255, 255, 255, .62); }
.phrase__text { display: block; transition: filter .35s var(--ease), opacity .35s var(--ease); }
.phrase__text b { display: block; font-weight: 600; font-size: 16px; line-height: 1.45; }
.phrase__cover { position: absolute; inset: 8px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; border: 1.5px dashed rgba(255, 255, 255, .3); font-weight: 600; font-size: 15px; color: rgba(255, 255, 255, .9); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s; }
.phrase__cover svg { width: 18px; height: 18px; }
.phrases.is-quiz .phrase__new { cursor: pointer; background: var(--plum-grad); }
.phrases.is-quiz .phrase__new:hover .phrase__cover { border-color: rgba(255, 255, 255, .6); }
.phrases.is-quiz .phrase__new:not(.is-open) .phrase__cover { opacity: 1; visibility: visible; }
.phrases.is-quiz .phrase__new:not(.is-open) .phrase__text { filter: blur(7px); opacity: .25; }
.phrases.is-quiz .phrase__new.is-open { background: var(--plum); animation: phrase-in .45s var(--ease); }
@keyframes phrase-in { from { transform: rotateX(70deg); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .phrases.is-quiz .phrase__new.is-open { animation: none; } }

/* ---------- 3. план помощи ---------- */
.hp-agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); font-size: 14.5px; color: var(--ink-2); }
.hp-agree svg { width: 19px; height: 19px; flex: none; margin-top: 2px; color: var(--ok-ink); }
.hp-agree b { color: var(--ok-ink); }
.hp-grid { display: grid; gap: 16px; align-items: start; }
@container (min-width: 700px) { .hp-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .hp-out { position: sticky; top: calc(var(--header-h) + 20px); } }
.hp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hp-task { border-radius: var(--r-sm); }
.hp-check b { display: block; color: var(--ink); font-weight: 700; }
.hp-check small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.tool .hp-check input:checked + span { color: inherit; text-decoration: none; }
.hp-task.is-on .hp-check { border-color: var(--accent-300); background: var(--bg-soft); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hp-fields { display: grid; gap: 8px; padding: 10px 14px 12px; border: 1px solid var(--accent-300); border-top: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); background: #fff; }
.hp-fields[hidden] { display: none; }
@container (min-width: 420px) { .hp-fields { grid-template-columns: 1fr 1fr; } }
.hp-f { display: block; min-width: 0; }
.hp-f__l { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.field__input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; font: inherit; font-size: 16px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field__input:focus { outline: 0; border-color: var(--accent-300); box-shadow: 0 0 0 3px var(--accent-100); }
.hp-custom .hp-check { padding-right: 60px; }
.hp-del { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 12px; }
.hp-del svg { width: 17px; height: 17px; }
.hp-del:hover { border-color: var(--danger); color: var(--danger); }
.hp-custom { position: relative; }
.hp-add { display: flex; gap: 8px; margin-top: 10px; }
.hp-add .field__input { flex: 1; min-width: 0; }
.hp-add .btn { flex: none; min-height: 44px; }
.hp-out { padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.hp-out > * + * { margin-top: 12px; }
.hp-out__t { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }
.hp-out__t svg { width: 20px; height: 20px; color: var(--accent); }
.hp-out__empty { font-size: 14.5px; color: var(--muted); }
.hp-plan { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }
.hp-plan li::marker { color: var(--accent); font-weight: 700; }
.hp-plan b { color: var(--ink); }
.hp-plan small { display: block; color: var(--muted); font-size: 13.5px; }
.hp-out .tool__actions { gap: 8px; }

/* ---------- 4. личные границы ---------- */
.bqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: bq; }
.bq { counter-increment: bq; padding: 14px 16px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.bq > * + * { margin-top: 10px; }
.bq__q { font-weight: 700; color: var(--ink); font-size: 16px; line-height: 1.45; }
.bq__q::before { content: counter(bq) '. '; color: var(--accent); font-family: var(--ff-display); }
.bq__ans { display: flex; flex-wrap: wrap; gap: 8px; }
.bq__ans button { min-height: 42px; min-width: 84px; padding: 0 16px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line-strong); font-weight: 600; font-size: 15px; transition: background .2s, border-color .2s, color .2s; }
.bq__ans button:hover { border-color: var(--accent-300); }
.bq__ans button[aria-pressed="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }
.bq__fb:empty { display: none; }
.bq__fbin { padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); font-size: 15px; line-height: 1.6; }
.bq__fbin > * + * { margin-top: 8px; }
.bq__fbin[hidden] { display: none; }
.bq__lead { font-weight: 700; color: var(--ink); }
.bq__guide b { color: var(--accent-600); }
.bq.is-match .bq__lead { color: var(--ok-ink); }

/* ---------- 5. забота о себе ---------- */
.self-lead { font-weight: 600; color: var(--ink); }
.self-lead .muted { font-weight: 500; }
@container (min-width: 600px) { .self-signs { grid-template-columns: 1fr 1fr; } }
.tool .self-signs input:checked + span { color: var(--ink); text-decoration: none; }
.self-signs .check:has(input:checked) { border-color: var(--accent-300); background: var(--bg-soft); }
.self-note { padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); font-size: 14.5px; }
.self-next { padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); font-size: 15px; }
.self-next b { color: var(--ok-ink); }
.self-crisis, .self-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.self-crisis { background: var(--danger-bg); color: var(--ink); }
.self-crisis svg { color: var(--danger); }
.self-crisis a { color: var(--danger); font-weight: 800; font-family: var(--ff-display); }
.self-line { background: var(--surface-pink); color: var(--ink-2); }
.self-line svg { color: var(--accent); }
.self-crisis svg, .self-line svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }

/* ---------- 6. этапы ---------- */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: none; }
.stages li { display: grid; }
.stage { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); text-align: left; font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--ink); transition: background .2s, border-color .2s, color .2s; }
.stage:hover { border-color: var(--accent-300); }
.stage__n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-100); color: var(--accent-600); font-family: var(--ff-display); font-weight: 700; font-size: 13px; }
.stage[aria-selected="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }
.stage[aria-selected="true"] .stage__n { background: rgba(255, 255, 255, .16); color: #fff; }
@container (min-width: 720px) {
  .stages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .stage { flex-direction: column; justify-content: flex-start; text-align: center; gap: 8px; min-height: 100%; padding: 12px 6px; border: 0; background: none; border-radius: 14px; font-size: 14px; }
  .stage::after { content: ''; position: absolute; top: 27px; left: calc(50% + 22px); right: calc(-50% + 22px); height: 2px; background: var(--line-strong); }
  .stages li:last-child .stage::after { display: none; }
  .stage__n { width: 32px; height: 32px; box-shadow: 0 0 0 4px var(--bg-soft); }
  .near-acc > .tool .stage__n { box-shadow: 0 0 0 4px #fff; }
  .stage[aria-selected="true"] { background: var(--bg-soft); color: var(--accent-600); }
  .stage[aria-selected="true"] .stage__n { background: var(--accent); color: #fff; }
}
.sg { padding: 16px 18px !important; border-radius: var(--r-md); background: var(--bg-soft); }
.sg > * + * { margin-top: 12px; }
.sg__head { display: flex; align-items: center; gap: 12px; }
.sg__t { font-size: 19px; }
.sg__k { display: block; font-family: var(--ff-text); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sg-cols { display: grid; gap: 10px; align-items: start; }
@container (min-width: 760px) { .sg-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sg-col { padding: 14px 16px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); font-size: 15px; line-height: 1.55; }
.sg-col > * + * { margin-top: 8px; }
.sg-col .dots { gap: 4px; }
.sg-col .dots li { font-size: 14.5px; }
.sg-col__t { display: flex; align-items: center; gap: 8px; font-family: var(--ff-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.sg-col__t svg { width: 18px; height: 18px; flex: none; }
.sg-col--need .sg-col__t svg { color: var(--accent); }
.sg-col--help { border-top: 3px solid #4f9a66; }
.sg-col--help .sg-col__t svg { color: var(--ok-ink); }
.sg-col--care .sg-col__t svg { color: var(--soon-ink); }
.sg-col--need { border-top: 3px solid var(--accent); }
.sg-col--care { border-top: 3px solid var(--soon-dot); }
.sg-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sg-nav .btn { white-space: normal; text-align: left; line-height: 1.2; }

/* ---------- 7. семья ---------- */
.fam-k { font-weight: 700; color: var(--ink); }
.fam .btn { white-space: normal; }

/* ---------- 8. каталог ---------- */
.org-grid { display: grid; gap: 10px; }
.org { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.org[hidden] { display: none; }
.org__tag { align-self: flex-start; }
.org[data-type="psy"] .org__tag { background: var(--beta-bg); color: var(--beta-ink); }
.org[data-type="soc"] .org__tag { background: var(--soon-bg); color: var(--soon-ink); }
.org[data-type="pat"] .org__tag { background: var(--ok-bg); color: var(--ok-ink); }
.org__name { font-size: 16.5px; line-height: 1.3; }
.org__meta { margin: 0; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.5; }
.org__meta dt { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.org__meta dd { margin: 0; color: var(--ink-2); }
.org__url { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; word-break: break-all; }
.org__url svg { width: 14px; height: 14px; flex: none; }
.org__url:hover { text-decoration: underline; text-underline-offset: 3px; }
.org__phone { font-family: var(--ff-display); font-weight: 700; font-size: 18px; color: var(--accent-600); white-space: nowrap; }
@container (min-width: 620px) { .org-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- открытые блоки (гл. 14–16) ---------- */
.near-block { padding: 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.near-block__head { display: flex; align-items: center; gap: 16px; }
.near-block__t { font-weight: 700; font-size: 19px; line-height: 1.3; }
@media (min-width: 720px) { .near-block { padding: 24px 26px; } }
@media (max-width: 420px) { .near-block { padding: 18px 14px; } .near-block__head { gap: 12px; } }

.urgent { background: var(--danger-bg); border-color: #f6c4ce; box-shadow: none; color: var(--ink-2); }
.urgent .icon-tile { background: #fff; color: var(--danger); }
.urgent .near-ch__n { color: var(--danger); }
.urgent .dots li::before { background: var(--danger); }
.urgent .dots li { color: var(--ink); font-weight: 500; }
.urgent__key { color: var(--ink); }
.urgent__key strong { color: var(--danger) !important; }
.urgent__call { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: var(--r-md); background: #fff; font-size: 14.5px; }
.urgent__num { font-family: var(--ff-display); font-weight: 800; font-size: 26px; line-height: 1; color: var(--danger); }
.urgent__num:hover { text-decoration: underline; }

/* мифы — переворачиваемые карточки */
.flips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.flips li { display: grid; }
.flip { display: grid; width: 100%; padding: 0; border: 0; background: none; text-align: left; perspective: 1200px; border-radius: var(--r-lg); }
.flip__inner { display: grid; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__face { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; min-height: 190px; padding: 20px; border-radius: var(--r-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip__front { background: var(--bg-soft); border: 1px solid var(--line); }
.flip__back { background: var(--plum-grad); color: #fff; transform: rotateY(180deg); }
.flip__k { font-family: var(--ff-display); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.flip__back .flip__k { color: rgba(255, 255, 255, .7); }
.flip__q { font-style: italic; font-size: 17.5px; line-height: 1.4; color: var(--ink); }
.flip__hint { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.flip__hint svg { width: 15px; height: 15px; }
.flip__v { font-family: var(--ff-display); font-weight: 800; font-size: 20px; }
.flip__a { font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.flip:hover .flip__front { border-color: var(--accent-300); }
@container (min-width: 520px) { .flips { grid-template-columns: 1fr 1fr; } }
@container (min-width: 780px) { .flips { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 519px) { .flip__face { min-height: 150px; } }
@media (prefers-reduced-motion: reduce) { .flip__inner { transition: none; } }

/* частые вопросы */
.faq-list .acc + .acc { margin-top: 8px; }
.faq { box-shadow: none; border-radius: var(--r-md); background: var(--bg-soft); border-color: transparent; }
.faq .acc__head { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
.faq .acc__title { font-size: 16px; }
.faq .acc__plus { width: 30px; height: 30px; background: #fff; }
.faq .acc__content { padding: 0 16px 16px; font-size: 15.5px; }

/* ---------- печать: только план помощи ---------- */
#near-print { display: none; }
@media print {
  body.near-printing > *:not(#near-print) { display: none !important; }
  body.near-printing { background: #fff; }
  body.near-printing #near-print { display: block; color: #000; font: 12pt/1.5 Arial, 'Segoe UI', sans-serif; }
  #near-print h1 { font: 700 18pt/1.25 Arial, sans-serif; margin: 0 0 10pt; color: #000; }
  #near-print ol, #near-print ul { margin: 0 0 6pt 18pt; padding: 0; }
  #near-print li { margin-bottom: 6pt; }
  #near-print p { margin: 0 0 6pt; }
  #near-print .near-print__foot { margin-top: 18pt; font-size: 9pt; color: #555; }
}
