/* OrthoSmile: porcelain surfaces, sea-glass accents and a curved smile motif. */
:root {
  --clinic-teal: #177d78;
  --clinic-teal-dark: #115752;
  --clinic-ink: #193d3b;
  --clinic-blue: #3e727f;
  --clinic-violet: #536f75;
  --clinic-amber: #9a671e;
  --primary: #177d78;
  --primary-dark: #115752;
  --line: #dbe6e2;
}

/* SVG geometry stays centered regardless of font or platform. */
svg.ui-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  vertical-align: middle;
  pointer-events: none;
}
.field-checkbox > .checkbox-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  column-gap: 14px;
  width: 100%;
  min-height: 44px;
}
/* Keep the appointment checkbox at the far edge of its full-width callout. */
.booking-for-other .field-checkbox > .checkbox-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  width: 100%;
}
.field-checkbox > .checkbox-label > span {
  grid-column: 1;
  grid-row: 1;
}
.field-checkbox > .checkbox-label > input[type="checkbox"] {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
input[type="checkbox"]:focus {
  outline: none;
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 125, 120, .2);
}
:is(.home-login-close, .home-gallery-arrow, .home-slider-controls > button,
    .live-filter-clear, .current-records-close, .content-icon-button,
    .appointment-week-arrow, .working-date-nav) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.back-link { display: inline-flex; align-items: center; gap: 7px; }
.home-hero-actions span[aria-hidden], .home-login-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.live-pagination .pagination-arrow::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
}
.live-pagination .pagination-arrow-prev::before { transform: rotate(-135deg); }
.maps-location-link::after,
.home-hero-locations .maps-location-link::after {
  display: inline-block;
  content: "";
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  background: linear-gradient(135deg, transparent 44%, currentColor 45% 56%, transparent 57%);
}

body:not(.public-home-page) {
  --primary: var(--clinic-teal);
  --primary-dark: var(--clinic-teal-dark);
  --surface: #fffefa;
  --surface-muted: #f0f5f2;
  --shadow: 0 12px 38px rgba(25, 61, 59, .055);
  background-color: #f6f7f1;
  background-image: radial-gradient(ellipse at 90% 0%, #dcece5 0, transparent 45%),
    linear-gradient(150deg, #f8f8f2, #f0f5f2);
  color: var(--clinic-ink);
}
body:not(.public-home-page).has-site-background {
  background-image: linear-gradient(145deg, rgba(248, 248, 242, .94), rgba(235, 244, 239, .95)), var(--site-bg);
}
body:not(.public-home-page) .topbar {
  background: rgba(255, 254, 250, .94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(25, 61, 59, .035);
}
body:not(.public-home-page) .page-head > div:first-child { padding-left: 0; }
body:not(.public-home-page) .page-head > div:first-child::before { display: none; }
body:not(.public-home-page) :is(.section-title, .section-mini-head h2)::after {
  width: 38px;
  height: 10px;
  margin-top: 6px;
  border-bottom: 2px solid #86b9ad;
  border-radius: 0 0 50% 50%;
  background: none;
}
body:not(.public-home-page) :is(.card, .section-card, .doctor-panel, .overview-card,
    .doctor-dashboard-profile, .patient-dashboard-profile, .doctor-dashboard-card,
    .service-manager-item, .workplace-row, .admin-stat,
    .action-group, .content-admin-row, .content-list li, .table-wrap) {
  border: 1px solid var(--line);
  border-radius: 20px;
  background-color: #fffefa;
  box-shadow: var(--shadow);
}
body:not(.public-home-page) :is(.service-manager-item, .doctor-panel, .overview-card):nth-child(n) {
  border-color: var(--line);
  border-width: 1px;
}
body:not(.public-home-page) :is(.service-manager-item:last-child, .workplace-row:last-child) {
  border-bottom: 1px solid var(--line);
}
body:not(.public-home-page) :is(.admin-stat, .overview-card) {
  background-image: radial-gradient(ellipse at 100% 0%, #e4f1e9, transparent 72%);
}
body:not(.public-home-page) :is(.admin-stat, .overview-card):nth-child(n) strong,
body:not(.public-home-page) .overview-card:nth-child(n) .overview-value {
  color: var(--clinic-teal-dark);
}
body:not(.public-home-page) :is(.live-filter-bar, .doctor-profile-about,
    .booking-final, .appointment-photo-section, .record-entry-editor,
    .appointment-decision-panel, .appointment-reschedule-panel,
    .reschedule-waiting-panel, .patient-reschedule-decision) {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f0f6f2;
}
body:not(.public-home-page) .doctor-profile-overview .doctor-profile-about {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f0f6f2;
}
.telegram-connect-banner { border-radius: 18px; }
body:not(.public-home-page) :is(.page-tabs, .doctor-tabs) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  margin-bottom: 24px;
  border: 1px solid #dce7e0;
  border-radius: 20px;
  background: #eaf1eb;
}
body:not(.public-home-page) :is(.page-tabs, .doctor-tabs) .page-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  color: #4b6762;
  font-weight: 600;
}
body:not(.public-home-page) :is(.page-tabs, .doctor-tabs) .page-tab:hover {
  background: #fffefa;
  color: var(--clinic-teal-dark);
  transform: none;
}
body:not(.public-home-page) :is(.page-tabs, .doctor-tabs) .page-tab.active {
  border: 1px solid #195f58;
  background: #195f58;
  box-shadow: 0 4px 12px #195f581a;
  color: #fff;
}
body:not(.public-home-page) .page-tabs .page-tab.active::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #b9e2cb;
}
body:not(.public-home-page) .admin-tabs .page-tab::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: transparent;
}
body:not(.public-home-page) .admin-tabs .page-tab.active::before { background: #b9e2cb; }
body:not(.public-home-page) .admin-tabs .page-tab,
body:not(.public-home-page) .admin-tabs .page-tab.active { font-weight: 600; }
body:not(.public-home-page) .admin-tabs {
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 0;
  scrollbar-width: thin;
}
body:not(.public-home-page) .admin-tabs .page-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}
body:not(.public-home-page) .admin-dashboard {
  grid-template-columns: minmax(0, 1fr);
}
body:not(.public-home-page) .admin-dashboard > * { min-width: 0; }
body:not(.public-home-page) .admin-tabs-head {
  align-items: center;
  height: 40px;
  min-height: 40px;
  margin: 0;
}
body:not(.public-home-page) .admin-tabs-head .page-title {
  font-size: 34px;
  line-height: 1.1;
  white-space: nowrap;
}
body:not(.public-home-page) .content-admin {
  display: grid;
  gap: 18px;
}
body:not(.public-home-page) .content-admin > .admin-tabs-head,
body:not(.public-home-page) .content-admin > .admin-tabs { margin: 0; }
.content-admin-toolbar { display: flex; justify-content: flex-end; }
.admin-broadcast-shell > .admin-broadcast-count {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: 0;
  padding: 0 0 0 12px;
}
.admin-broadcast-shell > .admin-broadcast-count strong { font-size: 22px; }
.admin-broadcast-shell > .admin-broadcast-count span { white-space: nowrap; }
@media (max-width: 720px) {
  body:not(.public-home-page) .admin-tabs-head { min-height: 32px; height: 32px; }
  body:not(.public-home-page) .admin-tabs-head .page-title { font-size: 26px; }
}
body:not(.public-home-page) :is(.btn, button):not(.working-date-day):not(.time-pill) {
  border-radius: 12px;
}
body:not(.public-home-page) :is(.btn, button) { box-shadow: none; }
body:not(.public-home-page) :is(input:not([type="checkbox"]), select, textarea) {
  border-radius: 12px;
  border-color: #cfdfd7;
}
body:not(.public-home-page) thead { background: #eaf2ec; }
body:not(.public-home-page) th { color: #345b54; }
body:not(.public-home-page) .service-manager-item.editing {
  border-color: #83b5a6;
  background: #f0f8f2;
}

.public-home-page .home-clinic-news { background: #f8f8f2; }
.public-home-page .home-doctor-news { background: #edf4ef; }
.public-home-page .home-doctors-section { background: #fffefa; }
.public-home-page :is(.home-news-card, .home-doctor-news-item, .home-doctor-card) {
  border: 1px solid #dbe6df;
  border-radius: 22px;
  overflow: hidden;
  background: #fffefa;
}
.public-home-page .home-section-kicker { color: #39796f; }
.public-home-page .home-hero-copy .home-section-kicker { color: #d4eee3; }
.home-login-dialog { border: 1px solid #d9e5de; border-radius: 24px; background: #fffefa; }
.admin-login-dialog[open] { opacity: 1; transform: none; }
.admin-login-dialog::backdrop { background: rgba(10, 27, 25, .68); backdrop-filter: blur(7px); }
.admin-login-form { display: grid; gap: 16px; margin-top: 22px; }
.admin-login-submit {
  width: 100%;
  min-height: 48px;
  border: 1px solid #0d756c;
  border-radius: 12px;
  background: #177d78;
  color: #fff;
  font-weight: 700;
}
.admin-login-submit:hover,
.admin-login-submit:focus-visible { background: #115752; }
.admin-login-dialog .login-recovery-link { display: inline-block; margin-top: 16px; }
.public-home-page .home-empty-state { border-radius: 18px; border: 1px dashed #c9d9d0; background: #ffffff70; }

/* Center the brand on the photo; keep only the two patient actions. */
.public-home-page .home-hero-brand > span { display: none; }
.public-home-page .home-hero-copy {
  left: 50%;
  right: auto;
  display: flex;
  width: min(calc(100% - 40px), 1000px);
  max-width: 1000px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  isolation: isolate;
  top: 47%;
  transform: translate(-50%, -50%);
}
.public-home-page .home-hero-copy::before {
  position: absolute;
  z-index: -1;
  inset: -100px -12% -70px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #c6efda35 0%, #d9bb8c20 35%, transparent 70%);
  content: "";
  filter: blur(18px);
  pointer-events: none;
}
.public-home-page .home-hero-copy .home-hero-wordmark {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0;
  background: linear-gradient(108deg, #fff3dc 4%, #fff 45%, #c5f1d8 88%, #e9d5b1 100%);
  background-clip: text;
  color: transparent;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(42px, 11.5vw, 124px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
  text-shadow: 0 5px 38px #061c1a72;
  white-space: nowrap;
  -webkit-background-clip: text;
}
.public-home-page .home-hero-copy .home-hero-wordmark::after {
  position: absolute;
  left: 50%;
  bottom: -25px;
  width: clamp(100px, 18vw, 205px);
  height: 20px;
  border-bottom: 2px solid #d8f2dfd9;
  border-radius: 0 0 50% 50%;
  content: "";
  filter: drop-shadow(0 3px 10px #c6efda75);
  transform: translateX(-50%);
}
.public-home-page .home-hero-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 52px;
}
.public-home-page .home-hero-actions .home-hero-primary-action,
.public-home-page .home-hero-actions .home-hero-secondary-action {
  min-height: 54px;
  padding: 0 20px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 700;
  text-shadow: none;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.public-home-page .home-hero-actions .home-hero-primary-action {
  border-color: #fffdf5;
  background: #fffdf5;
  box-shadow: 0 12px 32px #071d1b45;
  color: #174943;
}
.public-home-page .home-hero-actions .home-hero-secondary-action {
  border-color: #ffffffa6;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.public-home-page .home-hero-actions .home-hero-primary-action > span,
.public-home-page .home-hero-actions .home-hero-secondary-action > span {
  width: 27px;
  height: 27px;
  border-color: #ffffff85;
}
.public-home-page .home-hero-actions .home-hero-primary-action > span {
  border-color: #d3e4d9;
  background: #edf4eb;
  color: #175d55;
}
.public-home-page .home-hero-actions .home-hero-primary-action:hover,
.public-home-page .home-hero-actions .home-hero-primary-action:focus-visible {
  border-color: #fff;
  background: #e9f2e7;
  box-shadow: 0 16px 38px #071d1b55;
  color: #123f39;
  transform: translateY(-2px);
}
.public-home-page .home-hero-actions .home-hero-secondary-action:hover,
.public-home-page .home-hero-actions .home-hero-secondary-action:focus-visible {
  border-color: #fff;
  background: #ffffff1c;
  box-shadow: 0 10px 28px #071d1b3d;
  color: #fff;
  transform: translateY(-2px);
}
.public-home-page .home-hero-actions :is(a, button):focus-visible {
  outline: 3px solid #c6e9cf;
  outline-offset: 4px;
}
@media (max-width: 620px) {
  .public-home-page .home-hero-copy { top: 47%; }
  .public-home-page .home-hero-copy .home-hero-wordmark { font-size: clamp(42px, 12vw, 74px); }
  .public-home-page .home-hero-copy .home-hero-wordmark::after { bottom: -20px; height: 15px; }
  .public-home-page .home-hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 44px;
  }
  .public-home-page .home-hero-actions .home-hero-primary-action,
  .public-home-page .home-hero-actions .home-hero-secondary-action {
    min-height: 50px;
    gap: 8px;
    padding: 0 13px;
    font-size: 12px;
    min-width: 0;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }
  .public-home-page .home-hero-actions :is(.home-hero-primary-action, .home-hero-secondary-action) > span { width: 23px; height: 23px; }
}
@media (max-width: 350px) {
  .public-home-page .home-hero-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the appointment-for-someone-else checkbox against the callout edge. */
.booking-for-other .field-checkbox > .checkbox-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.booking-for-other .field-checkbox > .checkbox-label > span { flex: 1 1 auto; order: 0; }
.booking-for-other .field-checkbox > .checkbox-label > input[type="checkbox"] {
  flex: 0 0 17px;
  order: 1;
  margin-left: auto;
}

.account-menu { position: relative; flex: 0 0 auto; }
.account-menu-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 3px 10px 3px 4px;
  border: 1px solid #ffffff42;
  border-radius: 999px;
  background: #ffffff13;
  color: inherit;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.account-menu-toggle::-webkit-details-marker { display: none; }
.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #ffffffa8;
  border-radius: 50%;
  background: linear-gradient(140deg, #d5efe0, #b1d8cb 54%, #f3dfbc);
  box-shadow: 0 2px 9px #102b2733;
  color: #174943;
  font-size: 13px;
  font-weight: 800;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu-caret {
  width: 7px;
  height: 7px;
  margin: -4px 1px 0 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.account-menu[open] .account-menu-caret { margin-top: 4px; transform: rotate(225deg); }
.account-menu-panel {
  position: absolute;
  z-index: 150;
  top: calc(100% + 9px);
  right: 0;
  width: min(270px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid #dce7e1;
  border-radius: 16px;
  background: #fffefa;
  box-shadow: 0 18px 48px #102b2740;
  color: #193d3b;
  white-space: normal;
}
.account-menu-heading { display: grid; gap: 3px; padding: 10px 11px 12px; border-bottom: 1px solid #e4ebe6; }
.account-menu-heading strong { min-width: 0; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.account-menu-heading > span { min-width: 0; color: #6a8078; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.account-menu-profile-link { color: #193d3b; text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.account-menu-profile-link:hover,
.account-menu-profile-link:focus-visible { border-radius: 10px; background: #edf4ee; color: #115752; }
.account-menu-panel > a,
.account-menu-panel > form > button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: #254d46;
  font: 600 13px/1.25 "Inter", Arial, sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-panel > a:hover,
.account-menu-panel > form > button:hover,
.account-menu-panel > a:focus-visible,
.account-menu-panel > form > button:focus-visible { background: #edf4ee; color: #174943; }
.account-menu-panel > a.account-menu-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  gap: 3px;
  white-space: normal;
}
.account-menu-panel > form { margin: 0; }
.account-menu-panel .account-menu-logout { margin-top: 5px; border-top: 1px solid #e4ebe6; border-radius: 0 0 10px 10px; color: #8a4c43; }
.account-menu-toggle:focus-visible { outline: 3px solid #c6e9cf; outline-offset: 3px; }
.public-home-page .home-hero-nav .account-menu { color: #fff; }
.public-home-page .home-hero-nav .account-menu-toggle { border-color: #ffffff55; background: #102b274d; backdrop-filter: blur(8px); }
.public-home-page .home-hero-nav .account-menu-toggle:hover { border-color: #fff; background: #102b2775; }
.public-home-page .home-hero-nav .account-menu-panel { color: #193d3b; }
.recovery-request-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #dbe6e2; }
.recovery-request-row:last-child { border-bottom: 0; }
.recovery-request-row > div { display: grid; gap: 5px; }
.recovery-request-row > div > span { color: #6c8179; font-size: 12px; }
.recovery-request-row form { margin: 0; }
.login-recovery-link { display: inline-flex; margin-top: 14px; color: var(--primary-dark); font-weight: 700; }
@media (max-width: 720px) {
  .account-menu-name { display: none; }
  body:not(.public-home-page) .nav .account-menu-toggle { min-height: 34px; padding: 0 8px 0 3px; border-color: #d5e0dd; background: #fffefa; color: #254d46; }
  body:not(.public-home-page) .nav .account-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }
  body:not(.public-home-page) .nav .account-menu-panel { position: fixed; top: 80px; right: 10px; }
  .public-home-page .home-hero-nav .account-menu-panel { position: fixed; top: 58px; right: 12px; }
  .recovery-request-row { align-items: flex-start; flex-direction: column; }
}

/* A shallow 3D drum: the current frame remains bright and fully visible. */
.public-home-page .home-gallery-section {
  padding-bottom: 80px;
  background: radial-gradient(ellipse at 50% 58%, #d0e6db, transparent 65%), #eef3eb;
}
.home-gallery-slider { max-width: 1440px; padding: 0 24px; touch-action: pan-y; }
.home-gallery-stage { height: clamp(320px, 42vw, 590px); perspective: 1400px; }
.home-gallery-slide {
  inset: 18px 20%;
  padding: 0;
  visibility: visible;
  opacity: 0;
  transform: translateX(0) translateZ(-280px) scale(.72);
  transition: transform 700ms cubic-bezier(.22,.75,.25,1), opacity 650ms ease, filter 650ms ease;
  filter: brightness(.75) saturate(.65);
  z-index: 0;
}
.home-gallery-slide img {
  width: 100%;
  height: 100%;
  border: 6px solid #fffefa;
  border-radius: 24px;
  background: #e6ede6;
  box-shadow: 0 24px 44px #193d3b26;
  object-fit: contain;
}
.home-gallery-slide[data-position="-1"] {
  opacity: .65;
  transform: translateX(-64%) translateZ(-180px) rotateY(25deg) scale(.86);
  z-index: 1;
}
.home-gallery-slide[data-position="1"] {
  opacity: .65;
  transform: translateX(64%) translateZ(-180px) rotateY(-25deg) scale(.86);
  z-index: 1;
}
.home-gallery-slide.is-active {
  opacity: 1;
  filter: none;
  transform: translateX(0) translateZ(0) rotateY(0);
  z-index: 2;
}
.home-gallery-slide figcaption {
  max-width: calc(100% - 36px);
  padding: 10px 18px;
  border: 1px solid #ffffff80;
  border-radius: 30px;
  background: #173f38e8;
  box-shadow: none;
  color: white;
  text-align: center;
  opacity: 0;
  transition: opacity 300ms ease;
}
.home-gallery-slide.is-active figcaption { opacity: 1; }
.home-gallery-arrow { z-index: 3; width: 48px; height: 48px; min-height: 48px; }
.home-gallery-arrow-prev { left: 8px; }
.home-gallery-arrow-next { right: 8px; }
.home-gallery-dots { gap: 2px; padding-top: 16px; }
.home-gallery-dots button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  background: transparent;
  border-radius: 50%;
}
.home-gallery-dots button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db8ab;
}
.home-gallery-dots button:is(:hover, .is-active) { background: #d5e7dc; transform: none; }
.home-gallery-dots button.is-active::before { background: #195f58; }
.home-gallery-toolbar { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 8px; color: #41685f; font-size: 12px; }
.home-gallery-toolbar > span { font-variant-numeric: tabular-nums; letter-spacing: .15em; }
@media (max-width: 680px) {
  .home-gallery-slider { padding: 0 8px; }
  .home-gallery-stage { height: clamp(250px, 70vw, 350px); }
  .home-gallery-slide { inset: 18px 15%; padding: 0; }
  .home-gallery-slide img { border-width: 4px; border-radius: 18px; }
  .home-gallery-arrow { width: 40px; height: 40px; min-height: 40px; }
  .home-gallery-arrow-prev { left: 3px; }
  .home-gallery-arrow-next { right: 3px; }
  .home-gallery-slide figcaption { bottom: 12px; font-size: 12px; padding: 7px 12px; }
  body:not(.public-home-page) :is(.page-tabs, .doctor-tabs) .page-tab { padding: 9px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-gallery-slide, .home-gallery-slide figcaption { transition: none; }
}

/* Patient records dialog follows the porcelain and sea-glass clinic palette. */
body:not(.public-home-page) dialog.current-records-dialog {
  border: 1px solid #d8e6df;
  border-radius: 20px;
  background: #fffefa;
  color: var(--clinic-ink);
  box-shadow: 0 28px 80px #102f2938;
}
body:not(.public-home-page) .current-records-dialog-head {
  border-bottom-color: #e2ebe5;
}
body:not(.public-home-page) .current-records-dialog-head h2,
body:not(.public-home-page) .current-record-item-head h3 {
  color: var(--clinic-ink);
}
body:not(.public-home-page) .current-records-dialog-head p,
body:not(.public-home-page) .current-record-item-head time {
  color: #687f77;
}
body:not(.public-home-page) .current-records-dialog-head .current-visit-label {
  color: var(--clinic-teal-dark);
}
body:not(.public-home-page) .current-records-dialog .current-records-close {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  flex-basis: 40px;
  border: 1px solid #d5e5dc;
  border-radius: 50%;
  background: #edf5ef;
  color: var(--clinic-teal-dark);
  box-shadow: none;
}
body:not(.public-home-page) .current-records-dialog .current-records-close:hover {
  background: #dcece2;
  color: #0d4e47;
}
body:not(.public-home-page) .current-record-item {
  border: 1px solid #dfe9e3;
  border-radius: 14px;
  background: #fcfdfb;
}
body:not(.public-home-page) .current-records-dialog .record-kind {
  background: #e7f3ec;
  color: #176457;
}
body:not(.public-home-page) .current-records-dialog .record-entry-text,
body:not(.public-home-page) .current-records-dialog .record-recommendations {
  color: #35564e;
}
body:not(.public-home-page) .current-records-dialog-actions {
  border-top-color: #e2ebe5;
  background: #f4f8f3;
}
body:not(.public-home-page) .current-records-dialog .btn.current-record-create {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--clinic-teal);
  border-radius: 999px;
  background: var(--clinic-teal);
  color: #fffefa;
  box-shadow: 0 5px 12px #177d7824;
  font-size: 14px;
  font-weight: 700;
}
body:not(.public-home-page) .current-records-dialog .btn.current-record-create:hover {
  transform: translateY(-1px);
  border-color: var(--clinic-teal-dark);
  background: var(--clinic-teal-dark);
  color: #fffefa;
  box-shadow: 0 8px 16px #1157522e;
}

/* Lift the menu's whole stacking context above banners and floating notices. */
.topbar:has(.account-menu[open]) { z-index: 1000; }
.public-home-page .home-hero-nav:has(.account-menu[open]) { z-index: 1000; }
.account-menu-panel { z-index: 1001; }
.account-menu-panel > a,
.account-menu-panel > form > button {
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.account-menu-panel > a:hover,
.account-menu-panel > form > button:hover,
.account-menu-panel > a:focus-visible,
.account-menu-panel > form > button:focus-visible {
  background: #e5f3eb;
  color: #115752;
  box-shadow: inset 0 0 0 1px #d2e7db;
}
.account-menu-panel .account-menu-profile-link:hover,
.account-menu-panel .account-menu-profile-link:focus-visible {
  background: #dff2e7;
  color: #0e6659;
}
.account-menu-panel .account-menu-logout:hover,
.account-menu-panel .account-menu-logout:focus-visible {
  background: #fff0ee;
  color: #a8322b;
  box-shadow: inset 0 0 0 1px #f5d1cc;
}

.home-hero-nav-links {
  margin-left: auto;
  margin-right: 18px;
}

.public-home-page .home-hero-nav-links .home-hero-signin {
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid #ffffffa6;
  border-radius: 999px;
  background: #102b2766;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.public-home-page .home-hero-nav-links .home-hero-signin:hover,
.public-home-page .home-hero-nav-links .home-hero-signin:focus-visible {
  border-color: #fff;
  background: #ffffff2e;
  color: #fff;
}
.home-registration-banner ul { display: flex; flex-wrap: wrap; gap: 5px 22px; margin: 8px 0 0; padding-left: 19px; font-size: 13px; }
.home-registration-banner .telegram-connect-button { font: inherit; font-weight: 800; cursor: pointer; }
.home-login-admin-link { display: block; margin-top: 14px; color: #5c7770; font-size: 11px; font-weight: 600; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.home-login-admin-link:hover, .home-login-admin-link:focus-visible { color: #0b7168; }
.booking-guest-fields { display: grid; gap: 12px; margin: 18px 0; padding: 20px; border: 1px solid #d5e5dd; border-radius: 16px; background: #f2f8f4; }
.booking-guest-fields p { margin: 0 0 4px; color: #486965; }
.reschedule-time-picker { position: relative; }
.reschedule-time-picker.is-enhanced input[type="time"] { display: none; }
.appointment-reschedule-panel .reschedule-time-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #b9cec8;
  background: #fff;
  color: #143d37;
  font-weight: 700;
  text-align: left;
}
.appointment-reschedule-panel .reschedule-time-trigger:hover:not(:disabled),
.appointment-reschedule-panel .reschedule-time-trigger[aria-expanded="true"] { border-color: var(--clinic-teal); background: #f2fbf8; }
.appointment-reschedule-panel .reschedule-time-trigger:disabled { opacity: .65; cursor: not-allowed; }
.reschedule-time-trigger[hidden], .reschedule-time-options[hidden] { display: none; }
.reschedule-time-options {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #b8cec8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 38px #183d3630;
}
.appointment-reschedule-panel .reschedule-time-options .time-pill { min-height: 40px; border-radius: 10px; cursor: pointer; }
@media (max-width: 700px) {
  .home-registration-banner ul { display: grid; gap: 3px; }
  .public-home-page .home-hero-nav-links .home-hero-signin { min-height: 34px; padding: 7px 12px; font-size: 12px; }
}

.account-avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.account-request-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fffefa;
  border-radius: 999px;
  background: #d83c42;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px #152c2838;
}
.account-avatar-wrap > .account-request-count { position: absolute; top: -5px; right: -5px; }
.account-menu-panel .account-menu-request-link { justify-content: space-between; gap: 12px; }
.account-menu-panel .account-menu-request-link .account-request-count { flex: 0 0 auto; color: #fff; }
.appointment-row-actions { align-items: center; gap: 16px; }
.appointment-row-actions .appointment-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 4px;
  color: #416b64;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.appointment-row-actions .appointment-detail-link:hover,
.appointment-row-actions .appointment-detail-link:focus-visible {
  color: var(--clinic-teal-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.appointment-row-actions .appointment-detail-link .ui-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
}
.appointment-patient-card-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appointment-patient-card-link:hover,
.appointment-patient-card-link:focus-visible {
  color: var(--clinic-teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.appointment-history-detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--clinic-teal-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.appointment-history-detail:hover,
.appointment-history-detail:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.appointment-history-detail .ui-icon { width: 16px; height: 16px; }

/* Keep menu controls independent from the navigation link rules on inner pages. */
.account-menu-panel > form { width: 100%; }
body:not(.public-home-page) .nav .account-menu-panel > a:not(.account-menu-heading),
body:not(.public-home-page) .nav .account-menu-panel > form > button {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: #254d46;
  transform: none;
}
body:not(.public-home-page) .nav .account-menu-panel > a:not(.account-menu-heading):hover,
body:not(.public-home-page) .nav .account-menu-panel > form > button:hover,
body:not(.public-home-page) .nav .account-menu-panel > a:not(.account-menu-heading):focus-visible,
body:not(.public-home-page) .nav .account-menu-panel > form > button:focus-visible {
  border-color: #d2e7db;
  background: #e5f3eb;
  box-shadow: inset 0 0 0 1px #d2e7db;
  color: #115752;
  outline: none;
  transform: none;
}
body:not(.public-home-page) .nav .account-menu-panel > a.account-menu-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  white-space: normal;
  min-height: 0;
  padding: 10px 11px 12px;
  border: 0;
  border-bottom: 1px solid #e4ebe6;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #193d3b;
  transform: none;
}
body:not(.public-home-page) .nav .account-menu-panel > a.account-menu-heading:hover,
body:not(.public-home-page) .nav .account-menu-panel > a.account-menu-heading:focus-visible {
  border-radius: 10px;
  background: #edf4ee;
  color: #115752;
  outline: none;
  box-shadow: none;
  transform: none;
}
body:not(.public-home-page) .nav .account-menu-panel > a.account-menu-logout:hover,
body:not(.public-home-page) .nav .account-menu-panel > a.account-menu-logout:focus-visible {
  border-color: #f5d1cc;
  background: #fff0ee;
  box-shadow: inset 0 0 0 1px #f5d1cc;
  color: #a8322b;
}

.current-visit-banner { position: relative; }
.current-visit-banner-actions { align-items: center; padding-right: 56px; }
.current-visit-dismiss {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #b8d8c5;
  border-radius: 50%;
  background: #eff8f2;
  color: #286350;
  box-shadow: none;
  cursor: pointer;
}
.current-visit-dismiss:hover,
.current-visit-dismiss:focus-visible {
  border-color: #dc4b45;
  background: #fff0ee;
  color: #b42318;
  box-shadow: 0 0 0 3px #dc262626, 0 4px 12px #dc262633;
  transform: none;
}
.current-visit-dismiss .ui-icon { width: 17px; height: 17px; min-width: 17px; }
[data-current-visit-banner][hidden] { display: none; }
@media (max-width: 720px) {
  .current-visit-banner-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the booking-for-someone-else option compact until it is selected. */
.booking-for-other {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 12px;
  transition: width .24s ease, padding .24s ease, background-color .24s ease;
}
.booking-for-other > .field > .checkbox-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: auto;
  min-height: 32px;
  font-size: 13px;
  font-weight: 700;
}
.booking-for-other > .field > .field-help { display: none; }
.booking-for-other-fields {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top-color: transparent;
  opacity: 0;
  visibility: hidden;
  transition: max-height .28s ease, margin-top .24s ease, padding-top .24s ease,
    border-color .24s ease, opacity .18s ease, visibility .24s ease;
}
.booking-for-other.is-expanded {
  width: 100%;
  padding: 14px 16px;
}
.booking-for-other.is-expanded > .field > .field-help { display: block; }
.booking-for-other.is-expanded .booking-for-other-fields {
  max-height: 420px;
  margin-top: 12px;
  padding-top: 14px;
  border-top-color: rgba(185, 111, 22, 0.22);
  opacity: 1;
  visibility: visible;
}
@media (max-width: 720px) {
  .booking-for-other-fields { grid-template-columns: minmax(0, 1fr); }
  .booking-for-other.is-expanded .booking-for-other-fields { max-height: 560px; }
}
