html {
  scroll-padding-top: 96px;
}

.schedule-page {
  background:
    linear-gradient(180deg, rgba(239, 246, 241, 0.86), rgba(247, 244, 238, 0.96)),
    var(--paper);
  overflow-x: hidden;
}

.schedule-shell {
  padding-top: 86px;
  overflow-x: hidden;
}

.schedule-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(22px, 5vw, 72px);
  align-items: start;
  min-width: 0;
  padding: clamp(72px, 10vw, 118px) clamp(18px, 5vw, 72px) clamp(34px, 5vw, 58px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.97), rgba(111, 137, 119, 0.78)),
    var(--forest);
}

.schedule-hero h1 {
  max-width: 1020px;
  margin-bottom: 22px;
  color: #fff;
  text-shadow: none;
}

.schedule-hero p:not(.section-kicker) {
  max-width: 840px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.62;
}

.schedule-jump-button {
  min-width: 160px;
  color: #1e1707;
  box-shadow: 0 18px 42px rgba(214, 168, 79, 0.24);
}

.schedule-workspace {
  display: grid;
  gap: 20px;
  min-width: 0;
  scroll-margin-top: 92px;
  padding: clamp(28px, 5vw, 72px);
}

.schedule-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.68fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: end;
}

.schedule-header h2 {
  max-width: 900px;
  margin: 0;
  color: var(--forest);
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  line-height: 1;
}

.schedule-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.schedule-metrics article,
.schedule-picker,
.appointments-panel,
.queue-panel,
.draft-panel,
.appointment-card,
.schedule-action-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.05);
}

.schedule-metrics article {
  display: grid;
  gap: 7px;
  align-items: center;
  justify-items: center;
  justify-content: center;
  min-width: 0;
  padding: 16px 12px;
  text-align: center;
}

.schedule-metrics span {
  display: block;
  color: var(--forest);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
}

.schedule-metrics p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.schedule-picker {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  min-width: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.schedule-picker label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.schedule-picker select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.schedule-picker p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 0.88fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.appointments-panel,
.queue-panel,
.draft-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.panel-heading h3 {
  margin: 0;
  color: var(--forest);
  font-size: 1.3rem;
}

.swipe-cue,
.carousel-dots {
  display: none;
}

.appointment-list,
.action-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.appointment-card,
.schedule-action-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}

.appointment-card {
  background: rgba(255, 255, 255, 0.76);
}

.appointment-topline,
.action-topline,
.action-footer,
.detail-topline,
.detail-actions,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.appointment-time {
  color: var(--forest);
  font-weight: 950;
}

.appointment-card h4,
.schedule-action-card h4,
.draft-panel h3 {
  margin: 0;
  color: var(--forest);
  line-height: 1.22;
}

.appointment-card p,
.schedule-action-card p,
.draft-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.schedule-action-card:hover,
.schedule-action-card:focus-visible {
  border-color: rgba(32, 61, 52, 0.32);
  background: #fff;
  outline: none;
}

.schedule-action-card {
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.schedule-action-card.is-selected {
  border-color: rgba(214, 168, 79, 0.86);
  background:
    linear-gradient(135deg, rgba(255, 247, 231, 0.76), rgba(255, 255, 255, 0.96)),
    #fff;
}

.type-pill,
.status-pill,
.priority-pill,
.value-pill,
.channel-pill,
.tag-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
}

.type-pill,
.channel-pill {
  color: var(--forest);
  background: rgba(111, 137, 119, 0.14);
}

.status-pill {
  color: #33423d;
  background: rgba(32, 61, 52, 0.08);
}

.priority-pill {
  color: #8f2f1e;
  background: #fff0e8;
}

.value-pill {
  color: #755113;
  background: #fff7dc;
}

.tag-pill {
  color: var(--muted);
  background: rgba(32, 61, 52, 0.07);
}

.draft-panel {
  position: sticky;
  top: 106px;
}

.draft-panel strong {
  color: var(--forest);
}

.detail-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(32, 61, 52, 0.11);
}

.detail-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-section h5 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-section p {
  margin: 0;
  color: var(--forest);
  font-weight: 500;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.detail-subsection {
  padding-top: 12px;
  border-top: 1px solid rgba(32, 61, 52, 0.11);
}

.message-draft {
  font-weight: 500;
}

.status-button {
  min-height: 40px;
  border: 1px solid rgba(32, 61, 52, 0.2);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--forest);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
}

.status-button.is-primary {
  border-color: var(--gold);
  color: #1e1707;
  background: var(--gold);
}

.detail-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  text-align: center;
}

@media (max-width: 1160px) {
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .draft-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .schedule-hero,
  .schedule-header,
  .schedule-picker,
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .schedule-metrics article {
    gap: 5px;
    min-height: 76px;
    padding: 12px 6px;
  }

  .schedule-metrics span {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .schedule-metrics p {
    font-size: clamp(0.64rem, 2.7vw, 0.74rem);
    white-space: normal;
  }

  .schedule-hero {
    padding-top: 60px;
  }

  .schedule-jump-button {
    width: fit-content;
  }

  .panel-heading {
    position: relative;
  }

  .swipe-cue {
    display: flex;
    gap: 5px;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    margin-top: 4px;
  }

  .swipe-cue::before,
  .swipe-cue::after {
    color: rgba(32, 61, 52, 0.56);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
  }

  .swipe-cue::before {
    content: "<";
  }

  .swipe-cue::after {
    content: ">";
  }

  .swipe-cue span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(214, 168, 79, 0.76);
  }

  .queue-panel {
    overflow: hidden;
  }

  .queue-panel .action-list {
    display: flex;
    gap: 12px;
    margin-inline: -18px;
    padding: 0 18px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .queue-panel .action-list::-webkit-scrollbar {
    display: none;
  }

  .schedule-action-card {
    flex: 0 0 min(78vw, 340px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .schedule-action-card p {
    display: none;
  }

  .carousel-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    min-height: 8px;
    margin-top: -2px;
  }

  .carousel-dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(32, 61, 52, 0.22);
    transition:
      width 160ms ease,
      background-color 160ms ease;
  }

  .carousel-dots span.is-active {
    width: 18px;
    background: var(--gold);
  }

  .draft-panel {
    scroll-margin-top: 92px;
  }
}

@media (max-width: 620px) {
  .schedule-shell {
    padding-top: 78px;
  }

  .schedule-workspace,
  .appointments-panel,
  .queue-panel,
  .draft-panel {
    padding-inline: 16px;
  }

  .schedule-header h2 {
    font-size: 2.2rem;
  }
}
