/* The guide has its own rail, so it follows browsing without covering posters. */
body[data-page="catalog"] { --shell: 1280px; }
.gallery-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 36px; align-items: start; }
.catalog-content { min-width: 0; }
.gallery-layout .intro { display: block; min-height: 210px; padding: 37px 0 26px; }
.intro-actions { margin-top: 13px; }
.intro-actions .text-link { margin-top: 0; }
.intro-hint { margin-top: 7px; color: var(--muted); font-size: .875rem; }
.companion-rail { position: sticky; top: 24px; align-self: start; margin-top: 22px; z-index: 20; }
.gallery-companion { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.companion-character { order: -1; display: grid; place-items: center; width: 176px; min-height: 204px; padding: 7px; background: transparent; border-radius: 12px; }
.companion-stage { position: relative; display: block; width: 160px; height: 190px; transform-origin: 50% 85%; }
.companion-bubble { position: relative; width: 100%; padding: 17px 18px; border-radius: 12px; background: var(--surface); box-shadow: 0 4px 20px rgb(32 53 75 / 6%); }
.companion-bubble::before { content: ""; position: absolute; top: -8px; left: calc(50% - 8px); width: 16px; height: 16px; background: var(--surface); transform: rotate(45deg); }
.companion-context { position: relative; color: var(--blue); font-size: .875rem; font-weight: 650; line-height: 1.5; margin-bottom: 7px; overflow-wrap: anywhere; }
#companion-speech { position: relative; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.companion-hint { margin-top: 1px; color: var(--muted); text-align: center; font-size: .875rem; }
.advice-trigger { display: none; min-height: 44px; margin-top: 2px; padding: 8px 1px; background: transparent; color: var(--blue); font-size: .875rem; font-weight: 600; text-align: left; }
.play-card.is-speaking .cover { outline: 2px solid var(--blue); outline-offset: 4px; }
.play-card.is-speaking h3 { color: var(--blue); }
.detail-actions { flex-shrink: 0; }
@media (min-width: 761px) and (max-width: 1150px) {
  .gallery-layout { grid-template-columns: minmax(0, 1fr) 190px; gap: 26px; }
  .gallery-layout .play-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 18px; }
  .gallery-layout .catalog-heading { align-items: flex-start; }
  .gallery-layout .catalog-heading > div { display: block; }
  .gallery-layout .search-form { width: 230px; }
  .companion-bubble { padding: 15px; }
}
@media (max-width: 760px) {
  html:has(body[data-page="catalog"]) { scroll-padding-top: 148px; }
  .gallery-layout { display: flex; flex-direction: column; gap: 0; }
  .catalog-content { width: 100%; }
  .companion-rail { order: -1; top: 0; width: 100%; margin: 0; padding-block: 8px; background: var(--page); }
  .gallery-companion { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 12px; align-items: center; }
  .companion-character { order: 0; width: 88px; min-height: 105px; height: 105px; padding: 0; }
  .companion-stage { --companion-width: 80px; --companion-height: 100px; width: 80px; height: 100px; }
  .companion-bubble { min-height: 112px; padding: 10px 13px; box-shadow: none; }
  .companion-bubble::before { top: 34px; left: auto; right: -6px; width: 12px; height: 12px; }
  .companion-context { margin-bottom: 4px; font-size: .875rem; }
  #companion-speech { font-size: .9375rem; line-height: 1.6; }
  .companion-hint { display: none; }
  .gallery-layout .intro { min-height: 0; padding: 20px 0 24px; }
  .gallery-layout .intro h1 { font-size: 1.75rem; }
  .gallery-layout .intro-copy > p { max-width: none; font-size: .9375rem; margin-top: 9px; }
  .intro-hint { display: none; }
  .gallery-layout .play-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advice-trigger { display: inline-flex; align-items: center; }
  .detail-actions { margin-top: 16px; }
}
@media (hover: none) { .advice-trigger { display: inline-flex; align-items: center; } }
@media (max-width: 359px) {
  .gallery-companion { grid-template-columns: minmax(0, 1fr) 66px; gap: 8px; }
  .companion-character { width: 66px; }
  .companion-stage { --companion-width: 64px; --companion-height: 90px; width: 64px; height: 90px; }
  .companion-bubble { min-height: 136px; }
  html:has(body[data-page="catalog"]) { scroll-padding-top: 166px; }
}
