.profile-page, .directory-page { min-height: 100vh; }
.profile-page .topbar, .directory-page .topbar { height: 56px; padding: 0 16px; }
.profile-page .brand-logo, .directory-page .brand-logo { width: 32px; height: 32px; }
.profile-back { color: var(--green); font-size: .88rem; font-weight: 700; text-decoration: none; }
.profile-main { max-width: 760px; margin: 0 auto; padding: 16px 16px 28px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: .76rem; }
.breadcrumbs a { color: var(--green); }
.profile-hero { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; }
.profile-photo { display: grid; place-items: center; width: min(72vw, 320px); aspect-ratio: 3 / 4; margin: 20px auto 0; border-radius: 18px; overflow: hidden; color: var(--green); background: var(--mint); font-family: Georgia, serif; font-size: 3rem; }
.profile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-heading { padding: 20px; text-align: center; }
.profile-heading h1, .directory-page h1 { margin: 0; color: var(--green); font-family: Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 500; line-height: 1.17; }
.profile-specialty { margin: 12px 0 0; color: var(--green-2); font-weight: 700; }
.profile-specialty a { text-decoration-color: #acc5ba; text-underline-offset: 3px; }
.profile-experience { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.profile-about { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.profile-about h2 { margin: 0 0 14px; color: var(--green); font-size: 1.1rem; }
.profile-branch { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.profile-branches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.profile-branches button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: var(--paper); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.profile-branches button[aria-pressed="true"] { border-color: var(--green); color: white; background: var(--green); }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.profile-actions.is-only { grid-template-columns: 1fr; }
.profile-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 12px; border-radius: 13px; font-size: .88rem; font-weight: 750; text-align: center; text-decoration: none; }
.profile-actions .action-book { color: white; background: var(--green); }
.profile-actions .action-wa { color: #176b43; background: #dff3e7; }
.profile-actions .action-book[hidden] { display: none; }
.profile-slots { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.profile-slots[hidden] { display: none; }
.profile-slots h2 { margin: 0 0 6px; color: var(--green); font-size: 1.1rem; }
.profile-slots h3 { margin: 14px 0 4px; color: var(--green); font-size: .9rem; }
.slots-note { margin: 0 0 10px; color: var(--muted); font-size: .82rem; }
.slots-day { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.slots-date { padding-top: 8px; color: var(--green); font-size: .84rem; font-weight: 750; }
.slots-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--green); border-radius: 999px; color: var(--green); background: var(--paper); font-size: .84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.slot-chip:hover, .slot-chip:focus-visible { color: white; background: var(--green); }
.slots-wa { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 13px; color: #176b43; background: #dff3e7; font-size: .88rem; font-weight: 750; text-decoration: none; }
@media (max-width: 380px) { .slots-day { grid-template-columns: 1fr; gap: 4px; } .slots-date { padding-top: 0; } }
.profile-about p { margin: 0 0 12px; white-space: normal; line-height: 1.6; }
.profile-about p:last-child { margin-bottom: 0; }
.profile-prices { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.profile-prices h2 { margin: 0 0 8px; color: var(--green); font-size: 1.1rem; }
.profile-prices > p { margin: 0 0 14px; color: var(--muted); font-size: .82rem; }
.profile-prices ul { margin: 0; padding: 0; list-style: none; }
.profile-prices li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.profile-prices li strong { flex: none; color: var(--green); text-align: right; font-size: .82rem; }
.profile-fineprint { margin: 20px 0 0; color: var(--muted); font-size: .85rem; }
.profile-fineprint a { color: var(--green); font-weight: 700; }
.legal-footer { max-width: 760px; margin: 0 auto; padding: 12px 16px 28px; color: var(--muted); font-size: .76rem; text-align: center; }
.legal-footer p { margin: 0 0 6px; }
.legal-footer a { color: var(--green); }

.directory-lead { margin: 12px 0 18px; color: var(--muted); }
.directory-cities, .directory-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-cities { margin-bottom: 14px; }
.directory-categories { margin-bottom: 22px; }
.directory-cities a, .directory-categories a { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: white; font-size: .82rem; font-weight: 700; text-decoration: none; }
.directory-cities a[aria-current="page"], .directory-categories a[aria-current="page"] { color: white; background: var(--green); }
.directory-categories small { font-size: .72rem; opacity: .75; }
.directory-count { margin: 0 0 10px; color: var(--muted); font-size: .82rem; }
.directory-list { display: grid; gap: 10px; }
.directory-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: white; text-decoration: none; }
.directory-card:hover, .directory-card:focus-visible { border-color: var(--green-2); }
.directory-photo { display: grid; flex: none; place-items: center; width: 88px; height: 100px; overflow: hidden; border-radius: 13px; color: var(--green); background: var(--mint); font-family: Georgia, serif; font-size: 1.6rem; }
.directory-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.directory-info { display: grid; min-width: 0; gap: 3px; font-size: .83rem; line-height: 1.3; }
.directory-info strong { font-size: .94rem; line-height: 1.25; }
.directory-specialty { color: var(--green-2); font-weight: 700; }
.directory-info small { color: var(--muted); font-size: .76rem; }
.directory-arrow { margin-left: auto; color: var(--green-2); font-size: 1.6rem; }

@media (max-width: 760px) {
  .profile-heading h1 { font-size: 1.6rem; }
  .profile-prices li { flex-direction: column; gap: 4px; }
  .profile-prices li strong { text-align: left; }
  .profile-page .legal-footer { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .profile-page .profile-actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 25; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
  .directory-categories { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .directory-categories::-webkit-scrollbar { display: none; }
  .directory-categories a { flex: none; white-space: nowrap; }
}
@media (min-width: 761px) {
  .profile-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .profile-photo { width: 280px; margin: 20px 0 20px 20px; }
  .profile-heading { padding: 24px; text-align: left; }
  .profile-actions { max-width: 470px; }
}

.profile-reviews { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.profile-reviews[hidden] { display: none; }
.profile-reviews h2 { margin: 0 0 8px; color: var(--green); font-size: 1.1rem; }
.profile-reviews .review-list { margin: 0; padding: 0; list-style: none; }
.profile-reviews .review { padding: 12px 0; border-top: 1px solid var(--line); }
.profile-reviews .review-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; }
.profile-reviews .review-head b { color: #9a6712; letter-spacing: 1px; }
.profile-reviews .review p { margin: 6px 0 0; font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }

/* Нижний таббар (mobile-tabbar.js): панель действий над ним, отступ у футера под обе панели. */
@media (max-width: 760px) {
  .has-mobile-tabbar .profile-page .legal-footer { padding-bottom: calc(var(--tabbar-h) + 87px); }
  .has-mobile-tabbar .directory-page .legal-footer { padding-bottom: calc(var(--tabbar-h) + 24px); }
  .has-mobile-tabbar .profile-page .profile-actions { bottom: var(--tabbar-h); padding-bottom: 10px; }
}
/* Блок «За что хвалят пациенты» (doctorSummaries из reviews.json) */
.profile-praise { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--mint); }
.profile-praise h2 { margin: 0 0 10px; color: var(--green); font-size: 1.1rem; }
.praise-summary { margin: 0; font-size: .95rem; line-height: 1.55; }
.praise-count { display: inline-block; margin-top: 10px; color: var(--green); font-size: .84rem; font-weight: 700; text-underline-offset: 3px; }
.praise-quotes { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.praise-quote { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.praise-quote .review-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; }
.praise-quote .review-head b { color: #9a6712; letter-spacing: 1px; }
.praise-quote p { margin: 6px 0 0; font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }
.profile-page .profile-praise .profile-actions.praise-actions { position: static; z-index: auto; margin-top: 16px; padding: 0; border: 0; background: none; backdrop-filter: none; }
@media (min-width: 720px) { .praise-quotes { grid-template-columns: 1fr 1fr; } }
.profile-praise .praise-actions .action-wa { background: white; border: 1px solid #b9dfc8; }
