#sds [hidden], .sds-open[hidden], #sds dialog:not([open]) { display: none; }

.sds-open {
  align-items: center;
  background: #fff;
  border: 1px solid #aebc8e;
  border-radius: 100px;
  color: #0f0f0f;
  cursor: pointer;
  display: inline-flex;
  flex: none;
  font: inherit;
  font-size: .875rem;
  gap: .3rem;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 .5rem;
  position: relative;
  white-space: nowrap;
  z-index: 1;
}

.sds-open svg { transform: scale(1.27); }
header .sds-open:hover { background: #f0f5df; }

nav[data-sd-mobile-nav] > .sds-menu-search {
  --sds-menu-search-width: 12rem;
  background: #f8faf1 !important;
  border: 1px solid #bccb9a;
  color: #2d2d2d !important;
  cursor: pointer;
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 1.625rem !important;
  font-weight: 400 !important;
  gap: .6rem;
  justify-content: center;
  letter-spacing: -.02em !important;
  line-height: 1.3;
  inline-size: min(var(--sds-menu-search-width), 100%);
  min-block-size: 2.8rem;
  padding-block: .25rem;
  padding-inline: clamp(14px, 5vw, 28px);
  text-transform: none;
}

nav[data-sd-mobile-nav] > .sds-menu-search:lang(en) { --sds-menu-search-width: 15.7rem; }

nav[data-sd-mobile-nav] > .sds-menu-search + a.sd-mobile-cta { margin-block-start: 0; }

nav[data-sd-mobile-nav] > .sds-menu-search:is(:hover,:focus-visible) {
  background: #eef4dc !important;
  border-color: #839659;
}

nav[data-sd-mobile-nav] > .sds-menu-search > svg {
  flex: none;
  inline-size: 30px;
  block-size: 30px;
}

@media (max-width: 480px) {
  html.sds-iphone {
    --sds-iphone-main-height: 64px;
    --sds-iphone-actions-height: 54px;
    --sds-iphone-two-row-height: calc(var(--sds-iphone-main-height) + var(--sds-iphone-actions-height));
  }

  html.sds-iphone:has(header[data-sd-manual-info="true"]) {
    --sd-header-expanded-height: calc(var(--sds-iphone-two-row-height) + var(--sds-iphone-info-height, 111px));
  }

  .sds-iphone header[data-sd-manual-info="true"] > div.relative {
    display: flex;
    flex-direction: column;
  }

  .sds-iphone header[data-sd-manual-info="true"] > div.relative > :first-child {
    order: 1;
  }

  /* Reserve both rows before the search and navigation scripts run. The theme
     measures this same element when it calculates clearance for the hero. */
  .sds-iphone header[data-sd-manual-info="true"] > div.relative > .container-default {
    box-sizing: border-box;
    height: var(--sds-iphone-two-row-height);
    padding-bottom: var(--sds-iphone-actions-height);
    gap: 10px;
  }

  html.sds-iphone body header[data-sd-manual-info="true"] .container-default.h-16 > a:first-child {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 208px;
  }

  .sds-iphone header[data-sd-manual-info="true"] .container-default.h-16 > a:first-child > span {
    width: 100%;
    height: auto !important;
  }

  .sds-iphone header[data-sd-manual-info="true"] .container-default.h-16 > div:has(> [data-sd-menu-toggle]) {
    flex: none;
    gap: 8px;
  }

  html.sds-iphone body header[data-sd-manual-info="true"] .container-default.h-16 a.btn {
    width: auto !important;
    min-width: 100px !important;
    max-width: none !important;
    min-height: 48px !important;
    padding-inline: 13px !important;
    font-size: 13px !important;
    gap: 7px;
  }

  html.sds-iphone body header[data-sd-manual-info="true"] .container-default.h-16 a.btn > svg {
    display: block !important;
  }

  html.sds-iphone body header[data-sd-manual-info="true"] .container-default.h-16 a[href^="tel:"] {
    top: calc(var(--sds-iphone-two-row-height) + 4px) !important;
  }

  .sds-iphone header[data-sd-start-compact="true"] ~ main#main {
    padding-block-start: var(--sds-iphone-actions-height);
  }

  /* Match the theme's first-section styles before its deferred script runs. */
  html.sds-iphone body.sd-redesign-stage.sd-redesign-approved header[data-scrolled="true"] ~ #main
  [data-sds-iphone-hero="framed"] {
    padding-top: 89px !important;
  }

  html.sds-iphone body.sd-home-design-v2 header[data-scrolled="true"] ~ #main #intro.isolate {
    --sd-home-clearance: var(--sds-iphone-two-row-height);
  }

  .sds-iphone body:not(.sd-home-design-v2, .page-id-5, .page-id-6, .page-id-7, .post-type-archive-team)
  main#main > [data-sds-iphone-hero="background"] > img {
    top: var(--sd-background-header-clearance, var(--sd-header-expanded-height)) !important;
    height: calc(100% - var(--sd-background-header-clearance, var(--sd-header-expanded-height))) !important;
  }

  .sds-iphone body:not(.sd-home-design-v2, .page-id-5, .page-id-6, .page-id-7, .post-type-archive-team)
  main#main > [data-sds-iphone-hero="background"] > div[aria-hidden="true"] {
    top: var(--sd-background-header-clearance, var(--sd-header-expanded-height));
  }

  .sds-iphone body:not(.sd-home-design-v2) [data-sds-iphone-hero="background"] > .container-default.pt-40 {
    padding-top: max(10rem, calc(var(--sd-header-expanded-height) + 1.5rem));
  }

  .sds-iphone-actions {
    position: absolute;
    inset-inline: 0;
    top: var(--sds-iphone-main-height);
    box-sizing: border-box;
    height: var(--sds-iphone-actions-height);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline: 12px;
    background: var(--color-bg, #f7f7f2);
    border-top: 1px solid var(--color-line, #d9dcd3);
    color: var(--color-ink, #202020);
  }

  html.sds-iphone body header .sds-iphone-actions button:not([hidden]) {
    flex: none;
    width: auto;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0 8px;
    gap: 5px;
    border-radius: 22px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  .sds-iphone-actions .sds-open span { display: inline; }
  .sds-iphone-actions .sd-header-info-inline svg { width: 18px; height: 18px; }
  .sds-iphone-actions .sd-header-info-inline[aria-expanded="true"] { background: #eef3da; }

  .sds-iphone-return {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
  }

  html.sds-iphone body header .sds-iphone-return :is(.sd-pilot-return-host, .sd-single-top-row):not([hidden]) {
    display: contents;
  }

  .sds-iphone-return button[hidden] { display: none !important; }
  .sds-iphone-return .sd-pilot-top-toggle span { display: none; }

  html.sds-iphone body.sd-redesign-stage.sd-redesign-approved header[data-sd-manual-info="true"]
  .sds-iphone-return .sd-pilot-return {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 8px !important;
    gap: 5px;
  }

  html.sds-iphone body.sd-redesign-stage.sd-redesign-approved header[data-sd-manual-info="true"]
  .sds-iphone-return .sd-pilot-top-toggle {
    width: 44px;
    padding: 0 !important;
  }
}

@media (max-width: 360px) {
  .sds-iphone-actions:has(.sd-pilot-return:not(.sd-pilot-top-toggle):not([hidden])) .sd-header-info-inline > span,
  .sds-iphone-return .sd-pilot-return:not(.sd-pilot-top-toggle) > svg {
    display: none;
  }
}

#sds dialog {
  --sds-available: var(--sds-viewport-height, 100dvh);
  --sds-panel-height: min(36rem, calc(var(--sds-available) - 1.25rem));
  --sds-panel-padding: clamp(1rem, 3vw, 1.65rem);
  background: #fcfdf9;
  border: 1px solid #e3e8d5;
  border-radius: 1.35rem;
  box-shadow: 0 18px 66px rgb(20 23 13 / .27);
  box-sizing: border-box;
  color: var(--color-ink, #2d2d2d);
  display: grid;
  font: inherit;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: var(--sds-panel-height);
  inset: calc(var(--sds-viewport-top, 0px) + (var(--sds-available) - var(--sds-panel-height)) / 2) 0 auto;
  margin: 0 auto;
  max-height: none;
  max-width: none;
  overflow: hidden;
  padding: 0;
  position: fixed;
  width: min(38rem, calc(100vw - 1.2rem));
}

#sds dialog::backdrop { background: rgb(25 29 15 / .64); }

#sds .sds-top {
  align-items: center;
  background: #f0f5df;
  border-bottom: 1px solid #e1e8cc;
  display: flex;
  gap: .85rem;
  padding: .95rem var(--sds-panel-padding);
}

#sds .sds-brand {
  background: #fff url("/wp-content/uploads/2026/10/smiledentity-sd-website-icon-512-150x150.png") center / 88% no-repeat;
  border: 1px solid #e1e8cc;
  border-radius: .75rem;
  flex: 0 0 2.75rem;
  height: 2.75rem;
}

#sds h2 {
  flex: 1 1 auto;
  font: inherit;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
}

#sds .sds-close {
  align-items: center;
  background: #fff;
  border: 1px solid #dbe4c5;
  border-radius: 100%;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

#sds .sds-form { padding: .9rem var(--sds-panel-padding) .7rem; }
#sds label { display: block; font-size: .9rem; font-weight: 600; margin: 0 0 .3rem; }
#sds input {
  background: #fff;
  border: 1px solid #a0ab81;
  border-radius: .8rem;
  box-sizing: border-box;
  color: inherit;
  display: block;
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  padding: .62rem .8rem;
  width: 100%;
}

#sds input::placeholder { color: #6b6b6b; opacity: 1; }

#sds .sds-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: .35rem var(--sds-panel-padding) 1.2rem;
  scrollbar-gutter: stable;
}

#sds .sds-body > * { flex: 0 0 auto; }
#sds .sds-intro { color: #374026; font-size: .94rem; line-height: 1.45; margin: .15rem 0 .85rem; }
#sds .sds-links { display: grid; gap: .5rem; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: .8rem; }
#sds .sds-links a {
  align-items: center;
  background: #f0f5df;
  border: 1px solid #e0e8c8;
  border-radius: .75rem;
  color: #3f5204;
  display: flex;
  font-size: .9rem;
  font-weight: 600;
  min-height: 48px;
  padding: .5rem .75rem;
  text-decoration: none;
}

#sds .sds-links a:hover, #sds .sds-close:hover { background: #e6efcf; }
#sds .sds-support {
  background: #f0f5df;
  border: 1px solid #e0e8c8;
  border-radius: .85rem;
  margin-top: auto;
  padding: .72rem .85rem;
}
#sds .sds-support p { font-size: .86rem; line-height: 1.35; margin: 0; }
#sds .sds-support a {
  align-items: center;
  color: #3f5204;
  display: inline-flex;
  font-weight: 650;
  min-height: 38px;
  text-decoration: underline;
  text-underline-offset: .18em;
  white-space: nowrap;
}
#sds .sds-results { display: grid; gap: .42rem; list-style: none; margin: 0 0 .8rem; padding: 0; }
#sds .sds-results:empty { display: none; }
#sds .sds-results a {
  background: #fff;
  border: 1px solid #e2e7d6;
  border-radius: .78rem;
  color: inherit;
  display: grid;
  gap: .16rem;
  line-height: 1.26;
  overflow-wrap: anywhere;
  padding: .52rem .72rem;
  text-decoration: none;
}

#sds .sds-results a:hover { background: #f0f5df; border-color: #cbd7ab; }
#sds .sds-results small { color: #465a08; font-size: .76rem; font-weight: 650; }
#sds .sds-results span, #sds .sds-status { font-size: .875rem; }
#sds .sds-status { line-height: 1.3; margin: .1rem 0 .55rem; }
#sds .sds-status:empty { display: none; }
#sds :focus-visible, .sds-open:focus-visible { outline: 2px solid #536b06; outline-offset: 2px; }
header[data-theme="dark"] .sds-open:focus-visible { outline-color: #fff; }

@media (max-width: 1130px) {
  .sds-open { padding: 0; }
  .sds-open span { display: none; }
}

@media (1131px <= width <= 1370px) {
  header [class]:has(> .sds-open) { column-gap: .35rem; }
  header .sds-open { gap: .2rem; padding: 0; }
  header .sds-open svg { width: 17px; }
}

@media (max-width: 570px) {
  #sds dialog { --sds-panel-height: min(42rem, max(31rem, 82dvh), calc(var(--sds-available) - .9rem)); }
}

@media (max-width: 360px) {
  .sds-iphone-return {
    min-width: 0;
  }

  html.sds-iphone body.sd-redesign-stage.sd-redesign-approved header[data-sd-manual-info="true"]
  .sds-iphone-return .sd-pilot-return:not(.sd-pilot-top-toggle) {
    flex: 0 1 auto;
    min-width: 44px;
    white-space: normal;
  }

  .sds-iphone-return .sd-pilot-return:not(.sd-pilot-top-toggle) .sd-pilot-return-label {
    white-space: normal;
    line-height: 1.1;
  }
}
