#program > .container {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

#program .program-shell {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#program .program-grid[data-days="2"] {
  grid-template-columns: repeat(2, minmax(0, min(42vw, 650px)));
  align-items: stretch;
  min-height: 0;
  height: 100%;
  gap: clamp(18px, 3vw, 48px);
}

#program .program-column {
  display: block;
  min-width: 0;
  min-height: 0;
}

#program .program-document {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--programGlassBorder);
  border-radius: var(--programCardRadius);
  background: var(--programGlassStrong);
  box-shadow: var(--programShadow);
}

#program .program-document-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--programDivider);
  color: var(--programInk);
}

#program .program-document-title {
  margin: 0;
  font: 800 clamp(1rem, 1.5vw, 1.25rem) / 1.25 var(--fontA);
}

#program .program-document-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

#program .program-document-actions button,
#program .program-document-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid rgba(132, 111, 66, .35);
  border-radius: 8px;
  background: #fff;
  color: #5d492b;
  font: 700 .9rem / 1 var(--fontA);
  text-decoration: none;
  cursor: pointer;
}

#program .program-document-actions button:hover:not(:disabled),
#program .program-document-download:hover {
  background: #f5ede0;
}

#program .program-document-actions button:focus-visible,
#program .program-document-download:focus-visible,
#program .program-summary-link:focus-visible,
#program .program-pdf-scroll:focus-visible {
  outline: 3px solid #654321;
  outline-offset: 2px;
}

#program .program-summary-action {
  display: flex;
  justify-content: center;
  width: 100%;
}

#program .program-summary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 24px;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 999px;
  background: #f3c969;
  box-shadow: 0 0 0 3px rgba(101, 67, 33, .22), 0 10px 28px rgba(24, 14, 7, .34);
  color: #3b270f;
  font: 800 clamp(.92rem, 1.2vw, 1.05rem) / 1.15 var(--fontA);
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#program .program-summary-link:hover {
  border-color: #fff;
  background: #ffe29a;
  box-shadow: 0 0 0 3px rgba(101, 67, 33, .28), 0 12px 30px rgba(24, 14, 7, .4);
}

#program .program-document-actions button:disabled {
  opacity: .45;
  cursor: default;
}

#program .program-document-zoom {
  min-width: 44px;
  color: #5d492b;
  font: 700 .85rem / 1 var(--fontA);
  text-align: center;
}

#program .program-pdf-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #e8e6e2;
  scrollbar-color: #a79577 #e8e6e2;
}

#program .program-pdf-pages {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 100%;
  width: max-content;
  padding: 12px;
  box-sizing: border-box;
}

#program .program-pdf-page {
  display: block;
  max-width: none;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

#program .program-pdf-message {
  width: min(100%, 25rem);
  margin: 16px auto;
  padding: 14px;
  color: #463a2d;
  text-align: center;
}

#program .program-pdf-message a {
  color: #5d492b;
  text-decoration: underline;
}

#program .program-pdf-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(94vw, 1280px);
  height: min(92vh, 980px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(132, 111, 66, .4);
  border-radius: 16px;
  background: #f8f5ef;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

#program .program-pdf-dialog::backdrop {
  background: rgba(18, 12, 8, .78);
}

#program .program-pdf-dialog .program-document-bar {
  background: #f8f5ef;
}

#program .program-pdf-dialog .program-pdf-scroll {
  min-height: 0;
}

@media (max-width: 900px) {
  #program > .container,
  #program .program-shell,
  #program .program-grid[data-days="2"] {
    height: auto;
  }

  #program .program-shell {
    grid-template-rows: auto auto auto;
  }

  #program .program-grid[data-days="2"] {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 650px);
  }

  #program .program-document {
    height: min(72vh, 690px);
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  #program .program-document-bar {
    padding: 10px 12px;
  }

  #program .program-document-title {
    font-size: 1rem;
  }

  #program .program-document {
    height: min(70vh, 600px);
    min-height: 330px;
  }

  #program .program-summary-link {
    width: min(100%, 320px);
    min-height: 40px;
    padding: 8px 18px;
  }
}
