.program-page {
  box-sizing: border-box;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f1efeb;
  color: #241d28;
  font-family: "Inter", Arial, sans-serif;
}

.program-page *,
.program-page *::before,
.program-page *::after {
  box-sizing: inherit;
}

.program-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(20px, 5vw, 72px);
  background: #24142d;
  color: #fff;
}

.program-header__logo {
  display: block;
  width: 58px;
  line-height: 0;
}

.program-header__logo img {
  width: 100%;
  height: auto;
}

.program-header__back {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.program-header__back span {
  margin-right: 7px;
  font-size: 17px;
}

.program-main {
  width: min(100% - 40px, 1180px);
  min-height: calc(100vh - 196px);
  margin: 0 auto;
  padding: 26px 0 42px;
}

.program-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.program-eyebrow {
  margin: 0 0 5px;
  color: #65447a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.program-topbar h1 {
  margin: 0;
  color: #24142d;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.program-select {
  display: grid;
  gap: 5px;
  color: #68616b;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.program-select select {
  min-width: 190px;
  padding: 9px 34px 9px 12px;
  border: 1px solid #d5d0d6;
  border-radius: 2px;
  background-color: #fff;
  color: #24142d;
  font: inherit;
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

.program-select select:focus-visible,
.program-tool:focus-visible {
  outline: 2px solid #8a64a1;
  outline-offset: 3px;
}

.program-viewer {
  position: relative;
  display: flex;
  min-height: min(76vh, 760px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 14px;
  background:
    radial-gradient(ellipse at 50% 70%, rgb(61 46 68 / 10%), transparent 58%),
    #e8e5e1;
}

.program-toolbar {
  z-index: 1;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 14px;
  padding: 4px 10px;
  border: 1px solid rgb(50 39 55 / 9%);
  border-radius: 3px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 3px 12px rgb(34 24 39 / 8%);
}

.program-tool {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #35273e;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.program-tool:hover {
  background: #eee9f1;
}

.program-tool:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.program-toolbar__divider {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: #ded9df;
}

.program-page-count {
  min-width: 54px;
  color: #5a525d;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.program-book-stage {
  display: flex;
  width: 100%;
  height: min(66vh, 690px);
  min-height: 350px;
  align-items: center;
  justify-content: center;
}

.program-book {
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
}

.program-book .page {
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgb(34 24 39 / 10%);
}

.program-book .page.--hard {
  background: #492c55;
}

.program-book .page canvas,
.program-book .page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}

.program-book .page--blank {
  background:
    linear-gradient(90deg, #f8f6f2 0%, #fff 9%, #fff 100%);
}

.program-loading,
.program-error {
  width: 100%;
  margin: 0;
  color: #625969;
  font-size: 14px;
  text-align: center;
}

.program-error a {
  display: inline-block;
  margin-top: 12px;
  color: #4a1f68;
  text-decoration: underline;
}

.program-status {
  min-height: 18px;
  margin: 9px 0 0;
  color: #6d6570;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
}

.program-footer {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(22px, 5vw, 76px);
  background: #080808;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.program-footer a {
  color: inherit;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 24px;
  text-decoration: none;
}

.program-footer span {
  color: rgb(255 255 255 / 62%);
}

.program-viewer:fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 28px;
  background: #e8e5e1;
}

.program-viewer:fullscreen .program-book-stage {
  height: calc(100vh - 130px);
}

@media (max-width: 700px) {
  .program-header {
    min-height: 68px;
  }

  .program-header__logo {
    width: 52px;
  }

  .program-header__back {
    font-size: 10px;
  }

  .program-main {
    width: calc(100% - 20px);
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .program-topbar {
    align-items: flex-end;
    margin-bottom: 14px;
  }

  .program-select select {
    min-width: 154px;
    max-width: 44vw;
  }

  .program-viewer {
    min-height: 70vh;
    padding: 12px 8px;
  }

  .program-book-stage {
    height: 58vh;
    min-height: 320px;
  }

  .program-toolbar {
    margin-bottom: 8px;
  }

  .program-viewer:fullscreen {
    padding: 10px;
  }

  .program-viewer:fullscreen .program-book-stage {
    height: calc(100vh - 80px);
  }

  .program-footer {
    min-height: 94px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
