:root {
  --bamboo: #0b4a36;
  --bamboo-deep: #073c2c;
  --bamboo-soft: #e7efe9;
  --ivory: #f8f2e7;
  --ivory-light: #fffdf8;
  --mustard: #d9a621;
  --terracotta: #c94735;
  --charcoal: #1f1f1f;
  --muted: #68645d;
  --line: #ded3c2;
  --shadow: 0 14px 40px rgba(21, 45, 35, 0.12);
  --app-width: 780px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--charcoal);
  background: #e9e2d6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 44rem),
    #e9e2d6;
}

body.dialog-open {
  overflow: hidden;
}

button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

/*
 * Safari may keep its native disclosure marker when a cached stylesheet and
 * newer HTML are mixed. Reset both marker implementations globally so the
 * explicit SVG chevrons remain the only disclosure icons.
 */
summary {
  list-style: none;
}

summary::marker {
  content: "";
  font-size: 0;
}

summary::-webkit-details-marker {
  display: none;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: white;
  background: var(--terracotta);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  position: relative;
  width: min(100%, var(--app-width));
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  overflow: hidden;
  overflow: clip;
  background: var(--ivory);
  box-shadow: 0 0 50px rgba(26, 35, 31, 0.12);
}

.top-chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 7px 22px rgba(7, 60, 44, 0.13);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
  padding:
    calc(0.6rem + env(safe-area-inset-top))
    max(0.85rem, env(safe-area-inset-right)) 0.65rem
    max(0.85rem, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(11, 74, 54, 0.1);
  background: rgba(255, 253, 248, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.68rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 0.72rem;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  display: block;
  margin-bottom: 0.08rem;
  color: var(--terracotta);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.brand-copy h1 {
  overflow: hidden;
  margin: 0;
  color: var(--bamboo);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.22rem, 5vw, 1.72rem);
  line-height: 1.06;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.download-button {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.4rem 0.56rem;
  border: 1px solid rgba(11, 74, 54, 0.25);
  border-radius: 0.78rem;
  color: var(--bamboo);
  background: var(--ivory-light);
  font-size: 0.7rem;
  font-weight: 830;
  line-height: 1.05;
  text-align: left;
  text-decoration: none;
}

.download-button:hover {
  border-color: var(--bamboo);
  background: white;
}

.download-button-full {
  color: white;
  border-color: var(--bamboo);
  background: var(--bamboo);
}

.download-button-full:hover {
  color: white;
  background: var(--bamboo-deep);
}

.download-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.download-button span,
.download-button small {
  display: block;
}

.download-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-button small {
  margin-bottom: 0.1rem;
  font-size: 0.52rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.page-control-bar {
  display: grid;
  min-height: 74px;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem max(0.85rem, env(safe-area-inset-right)) 0.5rem
    max(0.85rem, env(safe-area-inset-left));
  color: white;
  background: var(--bamboo);
}

.square-control {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 0.78rem;
  color: white;
  background: transparent;
  cursor: pointer;
}

.square-control:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.square-control:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.square-control svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-status {
  display: grid;
  min-width: 0;
  justify-items: center;
  line-height: 1.1;
  text-align: center;
}

.section-badge {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 0.22rem;
  overflow: hidden;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  color: var(--bamboo-deep);
  background: var(--mustard);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-badge[data-section="advanced"] {
  color: white;
  background: var(--terracotta);
}

.page-status strong {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.page-title {
  display: block;
  max-width: 100%;
  margin-top: 0.16rem;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.67rem;
  font-weight: 740;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

main {
  display: block;
  padding: clamp(0.72rem, 3vw, 1.25rem);
}

.document-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(11, 74, 54, 0.16);
  border-radius: clamp(0.78rem, 3vw, 1.15rem);
  background: var(--ivory-light);
  box-shadow: var(--shadow);
}

.document-link {
  position: relative;
  display: block;
  color: inherit;
  background: var(--ivory);
}

#guideImage {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  background: var(--ivory);
  transition: opacity 160ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.document-shell.is-loading #guideImage {
  opacity: 0;
}

.loading-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 70vh;
  background:
    linear-gradient(
      110deg,
      transparent 20%,
      rgba(255, 255, 255, 0.75) 38%,
      transparent 56%
    ),
    #eee7da;
  background-size: 220% 100%;
  animation: loading 1.2s linear infinite;
}

.full-size-hint {
  position: absolute;
  right: 0.72rem;
  bottom: 0.72rem;
  z-index: 3;
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: white;
  background: rgba(7, 60, 44, 0.84);
  box-shadow: 0 4px 14px rgba(7, 60, 44, 0.25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.full-size-hint svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.transcript-panel {
  margin-top: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--ivory-light);
}

.transcript-panel summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--bamboo);
  font-size: 0.82rem;
  font-weight: 820;
  list-style: none;
  cursor: pointer;
}

.transcript-panel summary::-webkit-details-marker,
.page-group summary::-webkit-details-marker {
  display: none;
}

.transcript-panel summary:hover {
  background: rgba(11, 74, 54, 0.04);
}

.transcript-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.transcript-summary-label svg,
.summary-chevron {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.summary-chevron {
  transition: transform 180ms ease;
}

.transcript-panel[open] .summary-chevron {
  transform: rotate(180deg);
}

.transcript-content {
  padding: 0.2rem 1rem 1rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  color: #34322e;
  font-size: 0.9rem;
  line-height: 1.62;
}

.transcript-content h2 {
  margin: 1rem 0 0.65rem;
  color: var(--bamboo);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  line-height: 1.2;
}

.transcript-content h3,
.transcript-content h4 {
  margin: 1.05rem 0 0.4rem;
  color: var(--bamboo-deep);
  font-size: 0.78rem;
  font-weight: 880;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.transcript-content p,
.transcript-content ul,
.transcript-content ol,
.transcript-content dl {
  margin: 0.55rem 0;
}

.transcript-content ul,
.transcript-content ol {
  padding-left: 1.35rem;
}

.transcript-content li + li {
  margin-top: 0.35rem;
}

.transcript-content dt {
  margin-top: 0.75rem;
  color: var(--bamboo-deep);
  font-weight: 840;
}

.transcript-content dd {
  margin: 0.15rem 0 0 0;
}

.transcript-content table {
  width: 100%;
  min-width: 430px;
  margin: 0.7rem 0;
  border-spacing: 0;
  border-collapse: separate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.transcript-content th,
.transcript-content td {
  padding: 0.48rem 0.55rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.transcript-content th {
  color: white;
  background: var(--bamboo);
  font-size: 0.69rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transcript-content th:last-child,
.transcript-content td:last-child {
  border-right: 0;
}

.transcript-content tr:last-child td {
  border-bottom: 0;
}

.load-error {
  margin: 0.8rem 0 0;
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
  color: #75251c;
  background: #fbe8e4;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.45;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 -8px 22px rgba(25, 45, 37, 0.11);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.bottom-control {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.3rem;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--bamboo);
  background: transparent;
  cursor: pointer;
}

.bottom-control:last-child {
  border-right: 0;
}

.bottom-control:hover:not(:disabled) {
  background: rgba(11, 74, 54, 0.05);
}

.bottom-control:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.bottom-control svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bottom-control span {
  overflow: hidden;
  font-size: clamp(0.66rem, 2.8vw, 0.84rem);
  font-weight: 770;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-list-control {
  color: white;
  background: var(--bamboo);
}

.page-list-control:hover:not(:disabled) {
  background: var(--bamboo-deep);
}

.progress-track {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 31;
  height: 4px;
  overflow: hidden;
  background: rgba(217, 166, 33, 0.18);
  pointer-events: none;
}

.progress-track span {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: 0 99px 99px 0;
  background: var(--mustard);
  transition: width 220ms ease;
}

.page-dialog {
  width: min(94vw, 720px);
  max-width: none;
  height: min(88vh, 900px);
  height: min(88dvh, 900px);
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1.25rem;
  color: var(--charcoal);
  background: var(--ivory-light);
  box-shadow: 0 28px 80px rgba(5, 34, 24, 0.35);
}

.page-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.page-dialog::backdrop {
  background: rgba(5, 34, 24, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.page-dialog.is-fallback-open {
  position: fixed;
  inset: 6vh auto auto 50%;
  inset: 6dvh auto auto 50%;
  z-index: 90;
  transform: translateX(-50%);
}

.dialog-header {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.98);
}

.dialog-kicker {
  margin: 0 0 0.16rem;
  color: var(--terracotta);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.dialog-header h2 {
  margin: 0;
  color: var(--bamboo);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  line-height: 1.1;
}

.dialog-close {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--bamboo);
  background: white;
  cursor: pointer;
}

.dialog-close:hover {
  border-color: var(--bamboo);
  background: var(--bamboo-soft);
}

.dialog-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.dialog-body {
  min-height: 0;
  padding: 0.9rem 0.9rem calc(1rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-tools {
  position: sticky;
  top: -0.9rem;
  z-index: 2;
  margin: -0.9rem -0.9rem 0.75rem;
  padding: 0.9rem 0.9rem 0.1rem;
  border-bottom: 1px solid rgba(222, 211, 194, 0.8);
  background: rgba(255, 253, 248, 0.98);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.82rem;
  width: 20px;
  height: 20px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

#pageSearch {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 4.1rem 0.7rem 2.65rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--charcoal);
  background: white;
  font-size: 0.86rem;
  appearance: none;
}

#pageSearch::placeholder {
  color: #807b73;
}

#pageSearch:focus {
  border-color: var(--bamboo);
}

#pageSearch::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 0.45rem;
  min-height: 34px;
  padding: 0.25rem 0.48rem;
  border: 0;
  border-radius: 0.5rem;
  color: var(--bamboo);
  background: var(--bamboo-soft);
  font-size: 0.66rem;
  font-weight: 820;
  cursor: pointer;
}

.search-results {
  min-height: 1rem;
  margin: 0.45rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 680;
}

.page-groups {
  display: grid;
  gap: 0.75rem;
}

.page-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
}

.page-group > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.68rem 0.78rem;
  color: var(--bamboo);
  background: #fff;
  list-style: none;
  cursor: pointer;
}

.page-group > summary:hover {
  background: rgba(11, 74, 54, 0.04);
}

.page-group[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--bamboo-soft);
}

.group-summary-inner {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.group-heading {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.group-eyebrow {
  overflow: hidden;
  color: var(--terracotta);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-heading strong {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 880;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-range {
  flex: 0 0 auto;
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  color: white;
  background: var(--bamboo);
  font-size: 0.62rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.group-chevron {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.page-group[open] .group-chevron {
  transform: rotate(180deg);
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem;
  list-style: none;
}

.page-choice {
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.78rem;
  color: var(--charcoal);
  background: white;
  text-align: left;
  cursor: pointer;
}

.page-choice:hover {
  border-color: var(--bamboo);
  transform: translateY(-1px);
}

.page-choice[aria-current="page"] {
  border-color: var(--mustard);
  box-shadow: 0 0 0 3px rgba(217, 166, 33, 0.22);
}

.page-choice img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-bottom: 1px solid var(--line);
  background: var(--ivory);
  object-fit: contain;
}

.choice-label {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.52rem;
  padding: 0.58rem;
  font-size: 0.74rem;
  font-weight: 740;
  line-height: 1.2;
}

.choice-label b {
  display: inline-grid;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 1.6rem;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--bamboo);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.page-choice[aria-current="page"] .choice-label b {
  color: var(--bamboo-deep);
  background: var(--mustard);
}

.empty-search {
  margin: 1.2rem 0 0.4rem;
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 0.8rem;
  color: var(--muted);
  background: var(--ivory);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.noscript-guide {
  width: min(calc(100% - 2rem), var(--app-width));
  margin: 1rem auto;
  padding: 1rem;
  border: 1px solid #dba095;
  border-radius: 1rem;
  color: #4c211b;
  background: #fff3ef;
  box-shadow: var(--shadow);
}

.noscript-guide h2 {
  margin: 0;
  color: #75251c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.noscript-guide p {
  margin: 0.45rem 0 0.8rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

.noscript-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.noscript-downloads a,
.noscript-guide li a {
  color: var(--bamboo);
  font-weight: 780;
}

.noscript-downloads a {
  padding: 0.55rem 0.7rem;
  border-radius: 0.58rem;
  color: white;
  background: var(--bamboo);
  text-decoration: none;
}

.noscript-guide ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  padding-left: 1.3rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes loading {
  to {
    background-position-x: -220%;
  }
}

@media (min-width: 560px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding-inline: 1.2rem;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .download-actions {
    width: 360px;
  }

  .download-button {
    min-height: 48px;
  }

  .page-control-bar {
    padding-inline: 1.3rem;
  }

  main {
    padding: 1.25rem 2.7rem 1.7rem;
  }

  .bottom-control {
    min-height: 78px;
  }

  .progress-track {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .thumbnail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .choice-label {
    align-items: flex-start;
    min-height: 58px;
    font-size: 0.7rem;
  }
}

@media (max-width: 370px) {
  .brand-name {
    display: none;
  }

  .download-button {
    gap: 0.28rem;
    padding-inline: 0.35rem;
    font-size: 0.64rem;
  }

  .download-button svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .page-control-bar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 0.5rem;
  }

  .square-control {
    width: 44px;
    height: 44px;
  }

  .bottom-control {
    flex-direction: column;
    gap: 0.1rem;
  }

  .bottom-control:last-child {
    flex-direction: column-reverse;
  }

  .thumbnail-grid {
    gap: 0.55rem;
    padding: 0.6rem;
  }

  .choice-label {
    gap: 0.35rem;
    padding: 0.45rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body,
  .app-shell {
    background: white;
    box-shadow: none;
  }

  .top-chrome,
  .bottom-nav,
  .progress-track,
  .transcript-panel,
  .load-error,
  .noscript-guide {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .document-shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .full-size-hint {
    display: none;
  }
}
