:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #152b25;
  background: #eeebe7;
  scrollbar-gutter: stable;
  --alente: #40816b;
  --alente-blue: #064881;
  --control: #27614f;
  --muted: #53665f;
  --border: #dce5e1;
  --tint: #ebf4f0;
  --bar-height: 52px;
  --rail-width: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--alente-blue); outline-offset: 3px; }

.demo-bar {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px #142d2210;
}

.demo-bar::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--alente), var(--alente-blue));
}

.demo-bar__content {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.2fr) 1fr;
  align-items: center;
  gap: 24px;
  max-width: 1920px;
  min-height: calc(var(--bar-height) - 4px);
  margin-inline: auto;
  padding: 4px clamp(12px, 2vw, 32px);
}

.demo-brand, .demo-actions { display: flex; align-items: center; gap: 12px; }
.demo-brand img { display: block; width: 100px; height: auto; }
.demo-brand span { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.demo-context { min-width: 0; }
.demo-context__label { display: none; }
.current-layout { overflow: hidden; margin: 0; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: .9375rem; }
.demo-actions { justify-content: flex-end; }

.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 650;
  font-size: .875rem;
  white-space: nowrap;
}

.control--quiet { background: #fff; color: var(--control); }
.control--quiet:hover { background: var(--tint); border-color: #b9d3c8; }

.back-to-top {
  position: fixed;
  z-index: 2;
  right: max(clamp(12px, 2vw, 24px), env(safe-area-inset-right));
  bottom: max(clamp(12px, 2vw, 24px), env(safe-area-inset-bottom));
  height: 44px;
  color: #fff;
  background: var(--control);
  border-color: var(--control);
  box-shadow: 0 3px 12px #142d2233;
}
.back-to-top:hover { background: #1a4b3d; }

.demo-stage {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: calc(100svh - var(--bar-height));
}

.layout-rail {
  position: sticky;
  z-index: 1;
  top: var(--bar-height);
  align-self: start;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  height: calc(100dvh - var(--bar-height));
  overflow: auto;
  padding: 14px 4px;
  border-right: 1px solid var(--border);
  background: #fff;
}

.rail-list, .pager-step {
  display: grid;
  justify-items: center;
  align-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.rail-list {
  width: min(62px, 100%);
  min-height: 58px;
  gap: 3px;
  padding: 5px 0;
  background: var(--control);
  color: #fff;
  font-size: .875rem;
  font-weight: 650;
}

.rail-list:hover { background: #1a4b3d; }
.rail-list svg, .pager-step svg { width: 22px; height: 22px; }

.layout-pager {
  position: fixed;
  z-index: 2;
  top: 50%;
  right: max(clamp(12px, 2vw, 24px), env(safe-area-inset-right));
  transform: translateY(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid #b9d3c8;
  border-radius: 14px;
  background: #ffffffe0;
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px #142d2226;
}
.pager-step { width: 44px; min-height: 44px; padding: 0; background: transparent; color: var(--control); }
.pager-step:not(:disabled):hover,
.pager-step:focus-visible { background: var(--tint); }
.pager-step:disabled { color: #84958b; }
.pager-position { margin: 0 2px; font-size: .875rem; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

.demo-canvas { width: 100%; max-width: 1920px; min-width: 0; margin-inline: auto; }
.demo-canvas img { display: block; width: 100%; height: auto; }
.clinic-header { position: sticky; top: var(--bar-height); z-index: 1; background: #efece9; }
.image-error { position: sticky; top: 0; margin: 0; padding: 16px; background: #fff; text-align: center; }

.panel {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: inherit;
  background: #fff;
  box-shadow: 0 24px 80px #102b2360;
}

.panel::backdrop { background: #102b2385; }
.demo-stage:has(#layouts:not([hidden])) {
  grid-template-columns: var(--rail-width) clamp(230px, 23vw, 310px) minmax(0, 1fr);
}
.panel--layouts {
  position: sticky;
  top: var(--bar-height);
  align-self: start;
  width: 100%;
  height: calc(100dvh - var(--bar-height));
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-anchor: none;
}
@media (max-width: 700px) {
  .demo-stage:has(#layouts:not([hidden])) {
    grid-template-columns: var(--rail-width) min(51vw, 240px) minmax(0, 1fr);
  }
  .panel--layouts .panel__header, .panel--layouts .panel__body { padding: 8px; }
  .panel--layouts h1 { font-size: 1rem; }
  .panel--layouts .panel__caption { display: none; }
  .panel--layouts .close { width: 30px; height: 30px; }
  .panel--layouts .layout-button { overflow-wrap: anywhere; }
}
.panel--contacts { width: min(610px, calc(100% - 32px)); }
.panel__header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: #f7faf8;
}

.panel h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.025em; }
.panel__caption { margin: 7px 0 0; color: var(--muted); font-size: .9375rem; }
.panel__body { padding: 20px 28px 28px; }
.close { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 9px; color: var(--control); background: #fff; }
.close:hover { background: var(--tint); }
.close svg, .search svg { width: 20px; height: 20px; }

.search { position: relative; max-width: 420px; margin-bottom: 22px; }
.search svg { position: absolute; top: 12px; left: 12px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 44px; padding: 8px 12px 8px 39px; border: 1px solid #c7d7d0; border-radius: 8px; color: inherit; background: #fff; }
.search input::placeholder { color: var(--muted); }
.layout-groups { display: grid; gap: 18px; }
.layout-number { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.layout-group { min-width: 0; }
.layout-group h2, .office-heading { margin: 0 0 8px; font-size: .875rem; line-height: 1.35; color: var(--muted); font-weight: 650; }
.layout-group ul, .office-list { list-style: none; padding: 0; margin: 0; }
.layout-group li + li { margin-top: 4px; }
.layout-button { display: grid; grid-template-columns: 2ch 1fr; align-items: baseline; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px; text-align: left; border: 1px solid transparent; border-radius: 7px; background: #f4f7f5; color: inherit; font-size: .875rem; line-height: 1.25; }
.layout-button:hover { background: var(--tint); }
.layout-button[aria-current="true"] { border-color: #91bba9; color: #1a513f; background: #e5f1ea; font-weight: 700; }
.empty-search { margin: 0 0 8px; color: var(--muted); }

.contact-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 24px; font-style: normal; }
.contact-details > div { padding: 16px; border-radius: 12px; background: var(--tint); }
.contact-details span, .office-list span { display: block; }
.contact-details__value { color: #1a513f; font-size: clamp(1.075rem, 3.4vw, 1.375rem); font-weight: 700; }
.contact-details__note { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.office-list li { padding-top: 10px; border-top: 1px solid var(--border); }
.office-list span { margin-top: 4px; color: var(--muted); font-size: .875rem; line-height: 1.45; }

@media (max-width: 940px) {
  .demo-bar__content { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; }
  .demo-brand span { display: none; }
}

@media (max-width: 560px) {
  :root { --bar-height: 54px; --rail-width: 58px; }
  .demo-bar__content { gap: 8px; padding: 6px 10px; }
  .demo-brand img { width: 85px; }
  .control { min-height: 40px; padding: 0 9px; }
  .demo-context__label { display: block; color: var(--muted); font-size: .8125rem; text-align: center; white-space: nowrap; }
  .current-layout { font-size: .875rem; }
  .panel--contacts { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .panel__header { padding: 16px; }
  .panel__body { padding: 16px; }
  .contact-details { grid-template-columns: 1fr; }
}

@media (max-width: 410px) {
  .layout-groups { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .demo-brand img { width: 70px; }
  .control { padding-inline: 7px; }
}
.panel--layouts .panel__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.panel--layouts .search { grid-column: 1 / -1; max-width: none; margin: 0; }
.layout-button { scroll-margin-top: 165px; }

:root.is-reading { --bar-height: 44px; }
.is-reading .demo-bar__content { padding-block: 1px; }
.is-reading .demo-brand img { width: 84px; }
.rail-list[aria-expanded="true"] { background: #173e32; }
.layout-button[aria-current="true"] { box-shadow: inset 3px 0 var(--control); }
@media (max-width: 700px) {
  :root { --bar-height: 54px; --pager-height: 48px; }
  .demo-bar__content { grid-template-columns: auto minmax(0,1fr) auto; padding-block: 3px; }
  .is-reading .demo-brand img { width: 70px; }
  .demo-stage { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; }
  .demo-stage:has(#layouts:not([hidden])) { grid-template-columns: minmax(138px, 42%) minmax(0,1fr); }
  .layout-rail {
    grid-column: 1 / -1; flex-direction: row; justify-content: space-between;
    height: var(--pager-height); padding: 2px 8px; z-index: 2;
    border: 0; border-bottom: 1px solid var(--border); overflow: visible;
  }
  .rail-list { display: flex; align-items: center; justify-content: center; gap: 5px; width: auto; min-height: 44px; padding: 0 10px; }
  .clinic-header { top: calc(var(--bar-height) + var(--pager-height)); }
  .panel--layouts { top: calc(var(--bar-height) + var(--pager-height)); height: calc(100dvh - var(--bar-height) - var(--pager-height)); }
  .panel--layouts .panel__header { gap: 6px; padding: 8px; }
  .panel--layouts .panel__body { padding: 8px; }
  .panel--layouts .close { width: 36px; height: 36px; }
}
.is-reading .control { min-height: 38px; }

.design-section { overflow-anchor: none; }
#artwork { display: grid; row-gap: clamp(24px, 4vw, 64px); background: #dce3e0; }
.design-section:last-child { min-height: calc(100dvh - 44px); }
.layout-button { text-decoration: none; }
