/* Территория Улыбки — custom UI */
:root {
  --bg: #faf7f2;
  --bg-cream: #f3ede4;
  --bg-dark: #1c1b1a;
  --surface: #ffffff;
  --text: #1c1b1a;
  --text-muted: #5c5854;
  --text-light: #a39e97;
  --accent: #c4694f;
  --accent-hover: #a8563f;
  --accent-soft: rgba(196, 105, 79, 0.12);
  --border: rgba(28, 27, 26, 0.08);
  --shadow: 0 20px 50px rgba(28, 27, 26, 0.08);
  --shadow-lg: 0 30px 80px rgba(28, 27, 26, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --header-h: 76px;
  --font: "Onest", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute; left: -9999px; z-index: 9999;
  padding: 10px 16px; background: var(--surface); border-radius: 8px;
}
.skip-link:focus { left: 16px; top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--font); cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px rgba(196, 105, 79, 0.35);
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost {
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }
.btn--sm { padding: 10px 20px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.65; cursor: wait; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.header.is-scrolled {
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.header.is-scrolled .header__bar { height: 64px; }
.header.is-scrolled .brand__name,
.header.is-scrolled .header__nav a,
.header.is-scrolled .header__phone { color: var(--text); }
.header.is-scrolled .brand__tag { color: var(--text-muted); }
.header.is-scrolled .burger span { background: var(--text); }

.header__bar {
  display: flex; align-items: center; gap: 12px;
  width: min(1180px, calc(100% - 40px)); margin: 0 auto;
  height: var(--header-h); transition: height 0.3s;
}

.brand {
  display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none;
  min-width: 0; flex: 1 1 auto;
}
.brand:hover { color: #fff; opacity: 0.92; }
.brand__mark { display: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 600; font-size: 15px; }
.brand__tag { font-size: 12px; opacity: 0.75; }
.brand--footer .brand__name,
.brand--footer .brand__tag { color: #fff; }

.header__nav {
  display: none; gap: 32px;
}
.header__nav a {
  color: rgba(255,255,255,0.9); font-size: 14px; font-weight: 500;
  position: relative;
}
.header__nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: var(--accent);
  transition: width 0.25s var(--ease);
}
.header__nav a:hover { color: #fff; }
.header__nav a:hover::after { width: 100%; }

.header__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.header__phone {
  display: none; color: rgba(255,255,255,0.9); font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.header__phone:hover { color: #fff; }
.header__cta { display: none; }

.burger {
  width: 44px; height: 44px; border: 0; background: transparent;
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 7px; cursor: pointer; padding: 0;
}
.burger span {
  display: block; width: 22px; height: 2px; background: #fff;
  border-radius: 2px; transition: 0.25s var(--ease);
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.mobile-menu.is-open { pointer-events: auto; }
.mobile-menu__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.3s;
}
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu__panel {
  position: absolute; top: 0; right: 0; width: min(340px, 100%);
  height: 100%; background: var(--surface); padding: 88px 28px 28px;
  transform: translateX(100%); transition: transform 0.35s var(--ease);
  display: flex; flex-direction: column;
}
.mobile-menu.is-open .mobile-menu__panel { transform: translateX(0); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mobile-menu__nav a {
  padding: 14px 0; font-size: 20px; font-weight: 500; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mobile-menu__footer { margin-top: auto; }
.mobile-menu__phone {
  display: block; font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.mobile-menu__footer p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* Hero */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 48px) 0 64px; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(28,27,26,0.82) 0%, rgba(28,27,26,0.55) 50%, rgba(28,27,26,0.75) 100%);
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.hero__content { color: #fff; }
.pill {
  display: inline-block; padding: 6px 14px; margin-bottom: 20px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
}
.hero__title {
  font-family: var(--font-display); font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 600; line-height: 1.05; margin-bottom: 20px;
}
.hero__title em { font-style: italic; color: #e8b4a4; }
.hero__lead {
  font-size: clamp(16px, 2vw, 18px); opacity: 0.88; max-width: 520px; margin-bottom: 32px;
}
.hero__stats {
  display: flex; flex-wrap: wrap; gap: 24px 40px; margin-bottom: 36px;
  padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.stat strong { display: block; font-size: 18px; margin-bottom: 2px; }
.stat span { font-size: 13px; opacity: 0.7; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Booking card */
.booking {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 32px;
}
.booking__head { margin-bottom: 24px; }
.booking__head h2 {
  font-family: var(--font-display); font-size: 28px; margin-bottom: 8px;
}
.booking__head p { color: var(--text-muted); font-size: 14px; }
.booking__legal { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 14px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted);
}
.field input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: 16px;
  background: var(--bg); transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field input::placeholder { color: var(--text-light); }

.field--check {
  display: flex; align-items: flex-start; gap: 10px;
}
.field--check input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.field--check label {
  margin: 0; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--text-muted);
}
.field--check a { text-decoration: underline; text-underline-offset: 2px; }

.form-msg {
  display: none; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 14px; text-align: center;
}
.form-msg.is-success { display: block; background: #e8f5ec; color: #1a6b38; }
.form-msg.is-error { display: block; background: #fdecea; color: #b42318; }

/* Sections */
.section { padding: 96px 0; }
.section--cream { background: var(--bg-cream); }
.section--dark { background: var(--bg-dark); color: #fff; }
.section--dark a { color: #e8b4a4; }

.section-head { max-width: 560px; margin-bottom: 48px; }
.section-head--light .eyebrow,
.section-head--light h2,
.section-head--light p { color: #fff; }
.section-head--light p { opacity: 0.75; }
.eyebrow {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 12px;
}
.section-head p { color: var(--text-muted); font-size: 17px; }

/* Cards */
.cards--services {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 16/10; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 24px 28px 28px; }
.card__tag {
  font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em;
}
.card__body h3 { font-size: 22px; margin: 8px 0 10px; }
.card__body p { color: var(--text-muted); font-size: 15px; line-height: 1.55; }

/* About */
.about {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.about__text h2 {
  font-family: var(--font-display); font-size: clamp(30px, 3.5vw, 40px);
  margin-bottom: 20px;
}
.about__text p { color: var(--text-muted); margin-bottom: 16px; }
.checklist { margin-top: 24px; }
.checklist li {
  position: relative; padding-left: 28px; margin-bottom: 12px;
  font-weight: 500; color: var(--text);
}
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-soft); border: 2px solid var(--accent);
}
.about__gallery {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px;
}
.about__photo { border-radius: var(--radius); overflow: hidden; margin: 0; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__photo--main { aspect-ratio: 4/5; }
.about__photo--secondary { aspect-ratio: 3/4; margin-top: 48px; }

/* Doctors */
.cards--doctors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  gap: 28px;
}
.doctor {
  position: relative; border-radius: var(--radius); overflow: hidden;
  display: block; color: #fff; text-decoration: none;
  aspect-ratio: 3/4; max-height: 520px;
  transition: transform 0.35s var(--ease);
}
.doctor:hover { color: #fff; transform: translateY(-4px); }
.doctor__photo { position: absolute; inset: 0; }
.doctor__photo img { width: 100%; height: 100%; object-fit: cover; }
.doctor__photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
}
.doctor__info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px; z-index: 1;
}
.doctor__role {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #e8b4a4; margin-bottom: 8px;
}
.doctor h3 { font-family: var(--font-display); font-size: 26px; margin-bottom: 8px; }
.doctor__link { font-size: 14px; opacity: 0.85; }

/* Contacts */
.contact-grid {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 24px; margin-bottom: 56px;
}
.contact-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.info-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); padding: 20px;
}
.info-card__label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #e8b4a4; margin-bottom: 8px;
}
.info-card p { font-size: 15px; line-height: 1.5; }
.info-card a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.info-card small { opacity: 0.7; }
.map-wrap {
  border-radius: var(--radius); overflow: hidden; min-height: 320px;
  border: 1px solid rgba(255,255,255,0.1);
}
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; filter: grayscale(0.3) contrast(1.05); }

.docs__title { font-size: 20px; margin-bottom: 16px; opacity: 0.9; }
.acc {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.acc summary {
  padding: 18px 36px 18px 0; cursor: pointer; font-weight: 500; font-size: 15px;
  list-style: none; position: relative;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 300; opacity: 0.6; transition: transform 0.2s;
}
.acc[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.acc__body { padding: 0 0 18px; font-size: 14px; line-height: 1.6; opacity: 0.85; }
.acc__body p { margin-bottom: 8px; }

/* Inner pages */
.page-hero {
  padding: calc(var(--header-h) + 56px) 0 48px;
  background: var(--bg-dark); color: #fff;
}
.page-hero h1 {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
}
.page-hero p { margin-top: 8px; color: #e8b4a4; font-size: 18px; }

.profile {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px;
  padding: 64px 0; align-items: start;
}
.profile__photo {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1;
  box-shadow: var(--shadow);
}
.profile__photo img { width: 100%; height: 100%; object-fit: cover; }
.profile__bio h2 { font-size: 22px; margin: 28px 0 16px; }
.profile__bio p { color: var(--text-muted); margin-bottom: 14px; font-size: 17px; }
.certs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.cert {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.cert:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cert img {
  width: auto; height: auto;
  max-width: 100%; max-height: 196px;
  object-fit: contain;
}
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-top: 24px; }

.policy-page { padding: 48px 0 80px; max-width: 720px; }
.policy-page h1 { font-family: var(--font-display); font-size: 40px; margin-bottom: 32px; }
.policy-page h2 { font-size: 22px; margin: 32px 0 12px; }
.policy-page p, .policy-page li { color: var(--text-muted); line-height: 1.7; }
.policy-page ul { padding-left: 20px; list-style: disc; margin-bottom: 16px; }

/* Footer */
.footer {
  background: #141312; color: rgba(255,255,255,0.7); padding: 64px 0 0;
}
.footer__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 48px;
}
.footer__copy { margin-top: 16px; font-size: 13px; opacity: 0.6; }
.footer__title {
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 16px;
}
.footer__links li { margin-bottom: 10px; }
.footer__links a { color: rgba(255,255,255,0.7); }
.footer__links a:hover { color: #fff; }
.footer__legal {
  padding: 22px 20px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer__legal__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.footer__disclaimer {
  margin: 0; flex: 1;
  font-size: 13px; font-weight: 600; line-height: 1.45;
  letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9;
  color: #fff;
}
.footer__credit {
  margin: 0; flex-shrink: 0; text-align: right;
  font-size: 12px; letter-spacing: normal; text-transform: none; opacity: 0.65;
  color: rgba(255,255,255,0.85);
}
.footer__credit a {
  color: rgba(255,255,255,0.9); text-decoration: underline; text-underline-offset: 2px;
}
.footer__credit a:hover { color: #fff; }

/* FAB */
.fab {
  position: fixed; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 32px rgba(196, 105, 79, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 40px rgba(196, 105, 79, 0.5); }

/* Lidrekon removed — med-a11y widget */
/* Шрифт: на сайте почти везде px, поэтому масштабируем через zoom + rem у body */
html.a11y-font-lg {
  font-size: 112.5%;
  zoom: 1.125;
}
html.a11y-font-xl {
  font-size: 125%;
  zoom: 1.25;
}
@supports not (zoom: 1) {
  html.a11y-font-lg body { font-size: 1.125rem !important; }
  html.a11y-font-xl body { font-size: 1.25rem !important; }
  html.a11y-font-lg .hero__lead,
  html.a11y-font-lg .section-head p,
  html.a11y-font-lg .card__body p,
  html.a11y-font-lg .card__body h3,
  html.a11y-font-lg .profile__bio p,
  html.a11y-font-lg .profile__bio h2,
  html.a11y-font-lg .acc summary,
  html.a11y-font-lg .acc__body,
  html.a11y-font-lg .info-card p,
  html.a11y-font-lg .booking__head h2,
  html.a11y-font-lg .booking__head p,
  html.a11y-font-lg .field label,
  html.a11y-font-lg .field input,
  html.a11y-font-lg .btn,
  html.a11y-font-lg .doctor h3,
  html.a11y-font-lg .policy-page,
  html.a11y-font-lg p,
  html.a11y-font-lg li {
    font-size: 1.15em !important;
  }
  html.a11y-font-xl .hero__lead,
  html.a11y-font-xl .section-head p,
  html.a11y-font-xl .card__body p,
  html.a11y-font-xl .card__body h3,
  html.a11y-font-xl .profile__bio p,
  html.a11y-font-xl .profile__bio h2,
  html.a11y-font-xl .acc summary,
  html.a11y-font-xl .acc__body,
  html.a11y-font-xl .info-card p,
  html.a11y-font-xl .booking__head h2,
  html.a11y-font-xl .booking__head p,
  html.a11y-font-xl .field label,
  html.a11y-font-xl .field input,
  html.a11y-font-xl .btn,
  html.a11y-font-xl .doctor h3,
  html.a11y-font-xl .policy-page,
  html.a11y-font-xl p,
  html.a11y-font-xl li {
    font-size: 1.3em !important;
  }
}

html.a11y-contrast {
  --bg: #fff;
  --bg-cream: #f3f3f3;
  --bg-dark: #000;
  --surface: #fff;
  --text: #000;
  --text-muted: #1a1a1a;
  --text-light: #333;
  --accent: #003d7a;
  --accent-hover: #002952;
  --accent-soft: #e6eef7;
  --border: rgba(0, 0, 0, 0.85);
}
html.a11y-contrast body {
  background: #fff;
  color: #000;
}
html.a11y-contrast .hero__bg,
html.a11y-contrast .hero__overlay {
  display: none !important;
}
html.a11y-contrast .hero,
html.a11y-contrast .header,
html.a11y-contrast .page-hero,
html.a11y-contrast .section--dark,
html.a11y-contrast .footer {
  background: #fff !important;
  color: #000 !important;
}
html.a11y-contrast .hero__content,
html.a11y-contrast .hero__title,
html.a11y-contrast .hero__lead,
html.a11y-contrast .hero__title em,
html.a11y-contrast .stat,
html.a11y-contrast .stat strong,
html.a11y-contrast .stat span,
html.a11y-contrast .pill,
html.a11y-contrast .brand,
html.a11y-contrast .brand__name,
html.a11y-contrast .brand__tag,
html.a11y-contrast .header__nav a,
html.a11y-contrast .header__phone,
html.a11y-contrast .page-hero h1,
html.a11y-contrast .page-hero p,
html.a11y-contrast .section--dark *,
html.a11y-contrast .footer * {
  color: #000 !important;
}
html.a11y-contrast .btn--ghost {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
}
html.a11y-contrast .btn--primary,
html.a11y-contrast .fab {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #000 !important;
  box-shadow: none !important;
}

html.a11y-spacing body {
  letter-spacing: 0.04em;
  line-height: 1.75;
}
html.a11y-spacing p,
html.a11y-spacing li {
  margin-bottom: 0.75em;
}

.a11y-slot {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.a11y-widget {
  position: relative;
  left: auto;
  top: auto;
  z-index: 5;
}
.a11y-widget__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(28, 27, 26, 0.55);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: none;
  cursor: pointer;
  font: 600 13px/1.2 var(--font);
}
.a11y-widget__toggle:hover {
  background: rgba(28, 27, 26, 0.85);
  color: #fff;
}
.a11y-widget__icon {
  flex-shrink: 0;
  display: block;
}
.a11y-widget__label {
  display: none;
}
.a11y-widget.is-open .a11y-widget__label,
.a11y-widget__toggle:focus .a11y-widget__label,
.a11y-widget__toggle:hover .a11y-widget__label {
  display: none;
}
.header.is-scrolled .a11y-widget__toggle {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.a11y-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.a11y-panel__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.a11y-panel__group {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}
.a11y-panel__group legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}
.a11y-panel label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.a11y-panel__check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.a11y-panel input {
  accent-color: var(--accent);
}

@media (min-width: 900px) {
  .a11y-widget__label {
    display: inline;
    max-width: none;
    overflow: visible;
  }
  .a11y-widget.is-open .a11y-widget__label,
  .a11y-widget__toggle:focus .a11y-widget__label,
  .a11y-widget__toggle:hover .a11y-widget__label {
    display: inline;
  }
  .a11y-widget__toggle {
    padding: 8px 12px;
  }
  .a11y-panel {
    left: 0;
    right: auto;
  }
  /* Только a11y у края экрана; лого/меню остаются в центрированном баре */
  .a11y-slot {
    position: absolute;
    left: max(12px, env(safe-area-inset-left, 0px));
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 6;
  }
}

/* Mobile: лого слева, глаз справа у бургера */
@media screen and (max-width: 899px) {
  .a11y-slot {
    order: 2;
    margin-left: auto;
  }
  .brand {
    order: 1;
    flex: 1 1 auto;
  }
  .header__actions {
    order: 3;
    margin-left: 0;
  }
  .a11y-widget__toggle {
    width: 40px;
    height: 40px;
    padding: 0;
  }
  .a11y-panel {
    left: auto;
    right: 0;
  }
}

/* Reveal animation — без opacity:0 */
.reveal {
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  opacity: 1;
}
.reveal.is-visible { transform: none; }

/* Responsive */
@media (min-width: 900px) {
  .header__nav { display: flex; margin-left: auto; }
  .header__actions { margin-left: 0; }
  .header__phone { display: block; }
  .header__cta { display: inline-flex; }
  .burger { display: none; }
  .fab { display: none; }
  .brand { flex: 0 0 auto; }
}

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .hero__content { text-align: center; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  .hero__stats { justify-content: center; }
  .hero__actions { justify-content: center; }
  .cards--services,
  .about,
  .cards--doctors,
  .contact-grid,
  .profile,
  .footer__grid { grid-template-columns: 1fr; }
  .about__gallery { grid-template-columns: 1fr 1fr; }
  .about__photo--secondary { margin-top: 0; }
  .contact-cards { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
}

@media (max-width: 600px) {
  .cards--services .card__body { padding: 20px; }
  .booking { padding: 24px 20px; }
  .hero__stats { gap: 16px; }
  .stat { flex: 1 1 40%; }
  .certs { grid-template-columns: 1fr; }

  .footer__legal {
    padding: 20px 16px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .footer__legal__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    /* справа оставляем место под FAB «Запись» */
    max-width: calc(100% - 118px);
  }
  .footer__disclaimer {
    font-size: 11px;
    letter-spacing: 0.02em;
    line-height: 1.45;
    width: 100%;
    text-transform: uppercase;
  }
  .footer__credit {
    align-self: flex-start;
    text-align: left;
    font-size: 12px;
    opacity: 0.85;
  }
  .fab {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
