.reservations-demo {
  padding: clamp(1.25rem, 4vw, 3rem);
}

.demo-page-heading,
.demo-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.demo-page-heading h1,
.demo-section-heading h2 {
  margin-bottom: 0.45rem;
}

.demo-section-heading p,
.reservations-demo > [data-demo-screen] > p {
  margin-bottom: 0;
  color: var(--muted);
}

.reservations-demo [data-demo-screen] > p,
.reservations-demo .demo-section-heading p {
  display: none;
}

.demo-section-heading--secondary {
  margin-top: 2.5rem;
}

.demo-disclaimer,
.demo-status {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid #e6cca4;
  border-radius: 0.8rem;
  color: #704d18;
  background: #fff7e9;
}

.demo-status {
  border-color: #bcd9d3;
  color: var(--brand-dark);
  background: #edf8f5;
}

.demo-reservation-list,
.demo-specialist-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.demo-reservation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid #bcd9d3;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f2faf8, #fbfdfc);
}

.demo-reservation-summary-count {
  font-weight: 800;
  white-space: nowrap;
}

.demo-reservation-summary-number {
  margin-right: 0.15rem;
  color: var(--brand-dark);
  font-size: 1.65rem;
  line-height: 1;
}

.demo-reservation-summary-breakdown {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

#demo-reservation-list {
  --demo-list-accent: #147b68;
  --demo-list-border: #add4ca;
  --demo-list-background: #f1faf7;
}

.demo-reservation-card--internal {
  --demo-list-accent: #147b68;
  --demo-list-border: #add4ca;
  --demo-list-background: #f3faf8;
}

.demo-reservation-card--cardiology {
  --demo-list-accent: #a33a4a;
  --demo-list-border: #e1b6bd;
  --demo-list-background: #fdf5f6;
}

.demo-reservation-card--dermatology {
  --demo-list-accent: #a66d18;
  --demo-list-border: #e5cca4;
  --demo-list-background: #fff9ef;
}

.demo-reservation-card--neurology {
  --demo-list-accent: #5c4db2;
  --demo-list-border: #cec7ed;
  --demo-list-background: #f7f5fd;
}

.demo-specialist-grid--assigned,
#demo-assigned-specialists {
  --demo-list-accent: #397a45;
  --demo-list-border: #bed8b7;
  --demo-list-background: #f2f9ee;
}

.demo-specialist-grid--other,
#demo-other-specialists {
  --demo-list-accent: #a66d18;
  --demo-list-border: #e5cca4;
  --demo-list-background: #fff8ec;
}

.demo-specialist-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-reservation-card {
  display: grid;
  grid-template-columns: minmax(8.5rem, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem;
  border: 1px solid var(--demo-list-border);
  border-inline-start: 0.38rem solid var(--demo-list-accent);
  border-radius: 1rem;
  background: var(--demo-list-background);
}

.demo-reservation-time {
  display: grid;
  gap: 0.15rem;
  color: var(--demo-list-accent);
}

.demo-reservation-time strong {
  font-size: 1.35rem;
}

.demo-reservation-relative {
  width: fit-content;
  margin-top: 0.25rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--demo-list-border);
  border-radius: 999px;
  color: var(--demo-list-accent);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.demo-reservation-body h3,
.demo-specialist-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
}

.demo-reservation-body p,
.demo-specialist-card p {
  margin: 0.2rem 0;
  color: var(--muted);
}

.demo-reservation-specialist {
  color: var(--ink) !important;
  font-weight: 700;
}

.demo-expertise {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.22rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.demo-reservation-body > .demo-expertise {
  margin-bottom: 0.55rem;
}

.demo-expertise--internal {
  color: #0c514b;
  border-color: #add4ca;
  background: #e3f4f0;
}

.demo-expertise--cardiology {
  color: #842d3b;
  border-color: #e1b6bd;
  background: #fbeaec;
}

.demo-expertise--dermatology {
  color: #70470d;
  border-color: #e5cca4;
  background: #fff2d6;
}

.demo-expertise--neurology {
  color: #40347c;
  border-color: #cec7ed;
  background: #eeeafe;
}

.demo-reservation-clinic,
.demo-specialist-clinic {
  font-size: 0.9rem;
}

.demo-reservation-actions {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
}

.demo-reservation-card .tag {
  color: #0b5e4f;
  background: #d7f0e8;
}

.demo-specialist-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.1rem;
  border: 1px solid var(--demo-list-border);
  border-inline-start: 0.38rem solid var(--demo-list-accent);
  border-radius: 1rem;
  background: var(--demo-list-background);
}

.demo-specialist-card--assigned .tag {
  color: #245b2b;
  background: #dcefd8;
}

.demo-specialist-card--available .tag {
  color: #70470d;
  background: #f9e5c4;
}

.demo-specialist-card .tag {
  margin-bottom: 0.8rem;
}

.demo-specialist-card .button {
  width: 100%;
  margin-top: 1rem;
}

.feature-card-actions,
.demo-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feature-card-actions {
  margin-top: 1rem;
}

.feature-card-actions .button {
  width: 100%;
}

.demo-overview-button {
  margin-bottom: 1rem;
}

.demo-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.demo-form .demo-summary {
  margin-top: 0;
}

.demo-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.demo-form legend {
  padding: 0 0.35rem;
  font-weight: 800;
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.demo-form-grid--term {
  grid-template-columns: minmax(0, 1.7fr) minmax(9rem, 0.7fr);
  align-items: start;
}

.demo-date-field,
.demo-time-field {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
}

.demo-field-label {
  color: var(--ink);
  font-weight: 700;
}

.demo-date-select-fallback {
  display: none !important;
}

.demo-calendar-mount,
.demo-calendar {
  min-width: 0;
}

.demo-calendar {
  width: min(100%, 27rem);
  padding: 0.75rem;
  border: 1px solid #bcd9d3;
  border-radius: 0.9rem;
  background: #f8fcfb;
}

.demo-calendar-navigation {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: 0.45rem;
}

.demo-calendar-navigation-button {
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 1px solid #a9cbc5;
  border-radius: 0.65rem;
  color: var(--brand-dark);
  background: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}

.demo-calendar-navigation-button:disabled {
  color: #8b969e;
  border-color: var(--line);
  background: #f1f3f4;
}

.demo-calendar-title {
  margin: 0;
  text-align: center;
  font-size: 1rem;
}

.demo-calendar-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.demo-calendar-legend-dot {
  width: 0.72rem;
  height: 0.72rem;
  border: 1px solid #78bd8e;
  border-radius: 50%;
  background: #dff3e5;
}

.demo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.22rem;
}

.demo-calendar-row {
  display: contents;
}

.demo-calendar-weekday {
  padding-block: 0.3rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.demo-calendar-day,
.demo-calendar-blank {
  width: 100%;
  min-width: 0;
  min-height: clamp(2.1rem, 8.5vw, 2.75rem);
  border-radius: 0.55rem;
}

.demo-calendar-day {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f1f3f4;
  font-weight: 700;
}

.demo-calendar-day.is-available {
  color: #205f34;
  border-color: #84c99d;
  background: #e3f5e8;
}

.demo-calendar-day.is-available::after {
  position: absolute;
  right: 0.25rem;
  bottom: 0.2rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #2f7d45;
  content: "";
}

.demo-calendar-day.is-unavailable {
  cursor: default;
}

.demo-calendar-day.is-selected {
  color: #fff;
  border-color: var(--brand-dark);
  background: var(--brand);
  box-shadow: inset 0 0 0 2px #fff;
}

.demo-calendar-day.is-selected::after {
  background: #fff;
}

.demo-calendar-day[aria-current="date"] {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.demo-calendar-day:focus-visible,
.demo-calendar-navigation-button:focus-visible {
  z-index: 1;
  outline: 3px solid rgba(12, 81, 75, 0.38);
  outline-offset: 2px;
}

.demo-calendar-empty {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.demo-form label {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 700;
}

.demo-form select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.65rem 2.2rem 0.65rem 0.75rem;
  border: 1px solid #b8c6cc;
  border-radius: 0.65rem;
  color: var(--ink);
  background: #fff;
}

.demo-form select:focus-visible {
  outline: 3px solid rgba(18, 107, 99, 0.3);
  outline-offset: 2px;
  border-color: var(--brand);
}

.demo-rule {
  margin: 0.85rem 0 0;
  padding: 0.75rem;
  border-radius: 0.65rem;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.demo-rule[data-assigned="false"] {
  color: #704d18;
  background: #fff2dc;
}

.demo-summary {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #bcd9d3;
  border-radius: 0.8rem;
  color: var(--brand-dark);
  background: #f2faf8;
  overflow-wrap: anywhere;
}

.demo-summary p:last-child {
  margin-bottom: 0;
}

.demo-empty {
  padding: 1.2rem;
  border: 1px dashed #b8c6cc;
  border-radius: 0.8rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .demo-page-heading,
  .demo-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-page-heading .button,
  .demo-section-heading .button,
  .demo-form-actions .button {
    width: 100%;
  }

  .demo-specialist-grid,
  .demo-form-grid {
    grid-template-columns: 1fr;
  }

  .demo-calendar {
    width: 100%;
  }

  .demo-reservation-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-reservation-summary-count {
    white-space: normal;
  }

  .demo-reservation-summary-breakdown {
    justify-content: flex-start;
  }

  .demo-reservation-card {
    grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr);
    align-items: stretch;
  }

  .demo-reservation-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr minmax(8rem, auto);
    align-items: center;
    justify-items: start;
  }

  .demo-reservation-actions .button {
    width: 100%;
  }
}

@media (forced-colors: active) {
  .demo-calendar-day.is-available {
    border-width: 2px;
  }

  .demo-calendar-day.is-available::after {
    background: ButtonText;
  }

  .demo-calendar-day.is-selected {
    color: HighlightText;
    background: Highlight;
    forced-color-adjust: none;
  }
}

@media (max-width: 430px) {
  .demo-reservation-card {
    grid-template-columns: 1fr;
  }

  .demo-reservation-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
}

@media (max-width: 390px) {
  .feature-card-actions,
  .demo-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feature-card-actions .button,
  .demo-form-actions .button {
    width: 100%;
  }
}
