/* Shared finishes for the approved layouts; content and composition stay local. */
:root {
  --pm-ui-canvas: #f3f5f2;
  --pm-ui-paper: #fff;
  --pm-ui-accent: #e3efeb;
  --pm-ui-portrait: #e6eee7;
  --pm-ui-photo-radius: 16px;
  --pm-ui-card-radius: 20px;
  --pm-ui-surface-radius: 24px;
  --pm-ui-section-gap: 24px;
}
html:root, html body { background: var(--pm-ui-canvas); }
body .pm-about-v2 { --canvas: var(--pm-ui-canvas); }
body .home-b,
body:has(.service-design-b) { background: var(--pm-ui-canvas); }

/* The site container already owns the outer gutters. */
body .cx-footer { margin-inline: 0; }
body .cx-footer-head > * { min-width: 0; }

/* Match the portrait frame used in the directory and personal profiles. */
body .pm-about-v2 .chief-photo {
  width: auto;
  min-width: 0;
  margin: 12px;
  background: var(--pm-ui-portrait);
  border-radius: var(--pm-ui-photo-radius);
  overflow: hidden;
  isolation: isolate;
}
body .home-b .pm-doctors .pm-doctor-card:not([hidden]) {
  border-radius: var(--pm-ui-card-radius);
  background: var(--pm-ui-paper);
}
body .home-b .pm-doctor-card__content { padding: 24px; }

/* Readable document columns keep their width, with a common surface rhythm. */
body :is(.pm-patients__surface, .pm-legal__body, .pm-info__surface) {
  border-radius: var(--pm-ui-card-radius);
}
body .pm-patients__content { gap: var(--pm-ui-section-gap); }
body .pm-patients__title { margin-bottom: var(--pm-ui-section-gap); }
body :is(.pm-legal, .pm-info, .pm-promotions) { gap: var(--pm-ui-section-gap); }
body :is(.pm-patients__surface, .pm-legal__body, .pm-info__surface) { padding: 36px 32px; }
body :is(.pm-patients__title, .pm-legal__title, .pm-info__title,
  .svc-catalog__title, .pm-promotions__title, .pm-promotions__hero) {
  border-radius: var(--pm-ui-surface-radius);
  background: var(--pm-ui-accent);
}

/* The same campaign is a standalone white card on the home and offers pages. */
body .pm-promotions__surface { padding: 0; background: transparent; border-radius: 0; }
body .pm-promotions__list { gap: var(--pm-ui-section-gap); }
body .pm-promotions__offer,
body .pm-promotions__offer:not([hidden]) ~ .pm-promotions__offer:not([hidden]) {
  padding: 24px;
  border-radius: var(--pm-ui-card-radius);
  background: var(--pm-ui-paper);
  border-top: 0;
  gap: 24px;
}
body .pm-promotions__offer > a,
body .pm-promotions__offer img { border-radius: 12px; }
body .pm-promotions__detail { border-radius: var(--pm-ui-card-radius); }

/* Accent surfaces share a role; portrait and navigation backgrounds remain distinct. */
body .home-b :is(.home-b-direction--medicine, .home-b-tour, .home-b-booking),
body :is(.medicine-group-consult, .sp-help, .pm-promotions__booking),
body .pm-about-v2 :is(.hero, .documents) { background: var(--pm-ui-accent); }
body :is(.medicine-group-consult, .sp-help) { border-radius: var(--pm-ui-surface-radius); }

@media (max-width: 700px) {
  body :is(.pm-patients__surface, .pm-legal__body, .pm-info__surface) { padding: 24px; }
  body .pm-promotions__offer,
  body .pm-promotions__offer:not([hidden]) ~ .pm-promotions__offer:not([hidden]) { padding: 20px; gap: 16px; }
}
@media (max-width: 360px) {
  body .cx-footer-head { flex-direction: column; align-items: stretch; }
  body .cx-footer-invite { width: 100%; }
  body .cx-footer-invite .cx-button { width: 100%; max-width: none; }
}
