/* Shared control alignment for the local responsive and foldable preview. */
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .setting-button {
  --control-text-inset: calc(.55em + var(--setting-icon-size) * .065 + 2px);
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .theme-button {
  margin-inline-end: var(--control-text-inset);
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell > .brand-details {
  column-gap: calc(clamp(.8rem, 2vw, 2rem) - var(--control-text-inset-px, 0px));
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .playback-panel .sound-button {
  width: calc(var(--setting-icon-size) + var(--setting-gap) + var(--setting-label-width) + 2 * var(--control-text-inset));
  padding-inline: calc(var(--control-text-inset) - 2px);
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .sound-button #sound-label {
  width: var(--setting-label-width);
  flex-basis: var(--setting-label-width);
  text-align: right;
  transform: none;
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .sound-button .setting-icon {
  transform: none;
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .sound-button .setting-icon use {
  /* The speaker drawing sits right of centre within its shared SVG box. */
  transform: translateX(-2.4px);
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .playback-panel {
  grid-template-columns: max-content minmax(44px, 1fr) minmax(44px, 1fr) max-content;
}
:root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .time-display {
  display: flex;
  flex-wrap: nowrap;
  align-content: center;
  align-items: center;
  column-gap: .15em;
  min-width: max-content;
  white-space: nowrap;
}
@media (max-width: 1024px) and (orientation: portrait), (max-width: 699px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text):not([data-fold-source]) .site-shell .actions #contact-button {
    width: var(--sound-control-width, auto);
    max-width: 100%;
    padding-inline: .35em;
    margin-inline-start: auto;
  }
}
@media (max-width: 499px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .actions #contact-button {
    font-size: .9rem;
    padding-inline: .3em;
  }
}
@media (max-width: 350px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .playback-panel {
    column-gap: .125rem;
  }
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .time-display {
    font-size: .55rem;
  }
}
@media (min-width: 700px) and (max-width: 1000px) and (orientation: landscape) and (min-height: 560px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell {
    grid-template-columns: minmax(8rem, .6fr) minmax(8rem, .6fr) minmax(0, 2fr);
  }
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .playback-panel {
    column-gap: .125rem;
  }
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .time-display {
    font-size: .6rem;
    line-height: 1.2;
  }
}
@media (min-width: 700px) and (max-width: 850px) and (orientation: landscape) and (min-height: 560px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .sound-button {
    --setting-icon-size: 1.5rem;
    --setting-gap: .5rem;
    font-size: .8rem;
  }
}
@media (min-width: 500px) and (max-width: 1024px) and (orientation: portrait) and (min-height: 560px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell .sound-button {
    --setting-icon-size: clamp(2rem, 5.8vw, 2.7rem);
    --setting-gap: clamp(.6rem, 1vw, 1rem);
    font-size: var(--portrait-support-type);
  }
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell > .brand-details {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: minmax(0, 1fr) max-content;
    justify-content: normal;
    column-gap: clamp(2.5rem, 10vw, 5.5rem);
  }
}

@media (min-width: 1025px) and (orientation: portrait) and (min-height: 560px) {
  :root[data-site-mode="enhanced"]:not(.is-large-text) .site-shell > .brand-details {
    column-gap: calc(clamp(.8rem, 1.25vw, 1.25rem) - var(--control-text-inset-px, 0px));
  }
}

/* Book-fold geometry stays scoped to a verified fold or an explicit local mockup. */
:root[data-fold-motion="enabled"][data-fold-source][data-site-mode="enhanced"] .site-shell {
  transition: grid-template-columns .45s cubic-bezier(.4, 0, .2, 1),
    column-gap .45s cubic-bezier(.4, 0, .2, 1),
    padding-inline-start .45s cubic-bezier(.4, 0, .2, 1),
    padding-inline-end .45s cubic-bezier(.4, 0, .2, 1);
}
@media (prefers-reduced-motion: reduce) {
  :root[data-fold-motion="enabled"][data-fold-source][data-site-mode="enhanced"] .site-shell {
    transition: none;
  }
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell {
  --fp-sound-text-inset: var(--fp-measured-text-inset);
  display: grid;
  grid-template-columns: minmax(0, var(--fp-left-width)) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand transcript" "details transcript" "playback transcript" ". transcript" "actions transcript" ". privacy";
  column-gap: var(--fp-content-gap);
  height: 100dvh;
  min-height: 0;
  padding-inline: var(--fp-outer) var(--fp-outer);
  padding-block: .75rem;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-block {
  grid-area: brand;
  width: 100%;
  max-width: none;
  justify-self: stretch;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-details {
  display: grid;
  grid-area: details;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: calc(clamp(.8rem, 2vw, 2rem) - var(--fp-sound-text-inset));
  row-gap: 0;
  container-type: inline-size;
  container-name: fold-controls;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  margin-top: clamp(.75rem, 2vh, 1.5rem);
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-details > .tagline,
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-details > .theme-button {
  grid-area: auto;
  align-self: center;
  min-width: 0;
  margin: 0;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-details > .theme-button {
  margin-inline-end: var(--fp-sound-text-inset);
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell .sound-button #sound-label {
  width: var(--fp-setting-label-width);
  flex-basis: var(--fp-setting-label-width);
  text-align: right;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell .sound-button {
  --setting-icon-size: var(--fp-setting-icon-size);
  --setting-gap: var(--fp-setting-gap);
  width: calc(var(--fp-setting-icon-size) + var(--fp-setting-gap) + var(--fp-setting-label-width) + 2 * var(--fp-sound-text-inset));
  padding-inline: calc(var(--fp-sound-text-inset) - 2px);
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .playback-panel {
  grid-area: playback;
  align-self: start;
  container-type: inline-size;
  container-name: fold-controls;
  grid-template-columns: max-content minmax(44px, 1fr) minmax(44px, 1fr) max-content;
  column-gap: .0625rem;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell .restart-button,
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell .play-button {
  width: 44px;
  height: 44px;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .actions {
  grid-area: actions;
  flex-direction: column;
  align-items: flex-start;
  align-self: end;
  gap: .375rem;
  margin-top: .75rem;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .transcript-stage {
  grid-area: transcript;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding-top: 0;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .privacy-note {
  grid-area: privacy;
  min-width: 0;
  max-width: 100%;
  padding-top: .75rem;
  transform: none;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .privacy-note p {
  text-align: right;
}
:root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .time-display {
  display: flex;
  flex-wrap: nowrap;
  align-content: center;
  align-items: center;
  column-gap: .15em;
  max-width: 100%;
  font-size: .6rem;
  line-height: 1.15;
  white-space: nowrap;
}
@container fold-controls (max-width: 450px) {
  :root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell .setting-button {
    --setting-icon-size: 1.75rem;
    --setting-gap: .5rem;
    --setting-label-width: 5.25em;
    --fp-setting-icon-size: var(--setting-icon-size);
    --fp-setting-gap: var(--setting-gap);
    --fp-setting-label-width: var(--setting-label-width);
    --fp-sound-text-inset: var(--control-text-inset);
    font-size: .9rem;
  }
  :root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .site-shell > .brand-details > .tagline {
    font-size: clamp(.8rem, 5.6cqi, 1.25rem);
  }
}
@container fold-controls (max-width: 280px) {
  :root[data-fold-preview="book"][data-fold-source][data-site-mode="enhanced"] .time-display {
    font-size: .5rem;
  }
}
