/* Full-HD living-room layout: reserve space for controls and the destination row. */
@media (min-width: 1600px) and (max-height: 1200px) {
  body:not(.sky-mode) .app-shell { height: 100svh; min-height: 0; padding-bottom: 32px; }
  body:not(.sky-mode) .header { flex: 0 0 76px; height: 76px; min-height: 76px; }
  body:not(.sky-mode) .main { flex: 1 1 0; min-height: 0; padding: 16px 0; }
  body:not(.sky-mode) .destination-panel { width: 560px; max-width: 38%; max-height: 100%; overflow-y: auto; padding: 22px 26px; }
  body:not(.sky-mode) .destination-panel h1 { font-size: 72px; letter-spacing: -2px; line-height: 1.08; margin-bottom: 14px; overflow-wrap: anywhere; }
  body:not(.sky-mode) .destination-panel h1.long-title,
  body:not(.sky-mode) .destination-panel h1.very-long-title { font-size: 52px; }
  .destination-panel .overline { margin: 12px 0 8px; }
  .destination-description { margin-bottom: 16px; min-height: 0; max-width: 100%; }
  .destination-panel .fact-grid { max-width: 100%; padding: 14px 0; }
  .destination-panel .primary-actions { margin-top: 16px; }
  .destination-panel .interpretation { margin-top: 14px; font-size: 12px; max-width: 100%; }
  .destination-section { flex: 0 0 auto; padding-top: 6px; }
  .section-top { margin-bottom: 10px; }
  .destination-card { height: 122px; }
  .footer { flex: 0 0 34px; min-height: 34px; }
  .scene-toolbar { bottom: 24px; }
  .tool-button { width: 48px; height: 44px; }
  .help-button,.app-exit-button,.dialog-fullscreen,.book-control { font-size: 18px; min-height: 48px; }
  .close-button { min-width: 48px; min-height: 48px; }
  .sky-screen-actions button,.sky-view-controls button { font-size: 18px; min-height: 48px; }
  .sky-stage > .sky-timebar .sky-time-copy strong, .sky-stage > .sky-timebar .sky-time-copy > span { font: 400 16px/1.4 system-ui,sans-serif; }
  #sky-layers-button, .sky-page .sky-view-controls button { font-size: 18px; min-height: 48px; }
  body:not(.sky-immersive) .sky-stage,
  body:not(.sky-immersive) .sky-highlights { height: calc(100svh - 220px); }
  .sky-mode .app-shell { padding-bottom: 40px; }
  .sky-object-button strong { font-size: 18px; }
  .sky-object-button small { font-size: 14px; }
  .sky-stage .sky-selection { width: 480px; top: 102px; bottom: 72px; }
  .sky-selection .sky-preview-intro { font-size: 19px; line-height: 1.65; }
  .sky-selection .sky-preview-fact { font-size: 17px; }
  .sky-selection .planet-viewer-preview .planet-viewer-controls button { font-size: 16px; min-height: 44px; }
  .sky-immersive .sky-stage .sky-selection { top: 244px; bottom: 190px; }
  #info-dialog[open],#explorers-dialog[open],#learning-dialog[open],#reader-dialog.science-reader[open] {
    width: min(1280px, calc(100vw - 96px)); max-height: calc(100svh - 96px);
    display: flex; flex-direction: column; overflow: hidden;
  }
  #info-dialog > .dialog-top,#explorers-dialog > .dialog-top,#learning-dialog > .dialog-top { flex-shrink: 0; }
  #info-content,#explorers-content,#learning-content { min-height: 0; overflow-y: auto; max-height: calc(100svh - 210px); }
  #info-content p,#info-content li,#info-content .solar-facts { font-size: 19px; line-height: 1.65; }
  #info-content figure { margin-inline: 0; }
  #info-content figcaption { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
  #info-content h2 { font-size: 40px; }
  .book-learn-title { font-size: 18px; }
  .book-learn-summary { font-size: 16px; }
  #reader-dialog.book-reader > .book-controls { top: 20px; left: 24px; }
  #reader-dialog.book-reader > .dialog-top { top: 20px; right: 24px; }
  #reader-dialog.book-reader .book-page-counter { font-size: 18px; }
  #reader-dialog.book-reader .book-control { min-width: 48px; min-height: 48px; font-size: 18px; }
  .journal-entry strong, #info-content .help-row { font-size: 18px; }
  .journal-entry small, #info-content .help-row kbd { font-size: 16px; }
  .dialog-actions button, #learning-back { min-height: 48px; font-size: 18px; }
  #info-content .celestial-portrait img, .reader-body .celestial-portrait img { max-height: 320px; }
  #info-content .planet-viewer-stage canvas, .reader-body .planet-viewer-stage canvas { max-height: 320px; }
  .learning-figure svg { max-height: 360px; }
  .sky-location-dialog { width: 900px; max-height: calc(100svh - 96px); }
  .sky-location-dialog > .dialog-top, .library-dialog > .dialog-top { position: sticky; top: 0; z-index: 5; background-color: #0c1b23; }
  .sky-location-dialog p, .sky-location-dialog label, .sky-city-option { font-size: 17px; }
  .library-dialog { max-height: calc(100svh - 96px); }
  .dialog-actions .close-button { font-size: 27px; }
  dialog select { min-height: 48px; padding: 8px 14px; font: 18px var(--sans); color: var(--ink); background: #17252c; border: 1px solid #63777d; border-radius: 6px; }
  .library-dialog { width: 1280px; }
  .library-dialog input, .library-filters button { font-size: 18px; min-height: 48px; }
  .library-dialog button strong { font-size: 18px; }
  .library-dialog button small { font-size: 15px; }
  .sky-stage > .sky-timebar #sky-catalog-counts { font: 400 16px/1.4 system-ui,sans-serif; }
}

/* TV has one viewing mode. Keep shared controls available to tablet adapters. */
.tv-always-expanded [data-fullscreen-toggle],
.tv-always-expanded #sky-fullscreen { display: none !important; }

/* Expanded Explore still needs its destination picker. Reserve layout space
   rather than covering the scene controls with a fixed overlay. */
.tv-always-expanded.app-fullscreen:not(.sky-mode) .app-shell { padding-bottom: 34px; }
.tv-always-expanded.app-fullscreen:not(.sky-mode) .destination-section {
  display: block;
  flex: 0 0 auto;
  padding-top: 8px;
}
.tv-always-expanded.app-fullscreen:not(.sky-mode) .section-top { margin-bottom: 10px; }
.tv-always-expanded.app-fullscreen:not(.sky-mode) .destination-card { height: clamp(100px, 12svh, 140px); }

/* TV book reading uses the remote; keep the page free of overlay controls.
   Touch editions retain their visible navigation controls. */
.tv-always-expanded #reader-dialog.book-reader > .dialog-top,
.tv-always-expanded #reader-dialog.book-reader > .book-controls { display: none; }

/* Full-HD audit: size content within its dialog, not the entire viewport. */
@media (min-width: 1600px) and (max-height: 1200px) {
  .tv-always-expanded #learning-content { padding: 8px 48px 40px; }
  .tv-always-expanded .learning-library-card > span:not(.learning-library-visual) { font-size: 17px; }
  .tv-always-expanded .learning-library-card small,
  .tv-always-expanded .learning-dialog-nav > span,
  .tv-always-expanded .learning-library-tools label { font-size: 16px; }
  .tv-always-expanded .learning-library-tools input { font-size: 18px; }
  .tv-always-expanded .learning-topic-table { font-size: 18px; line-height: 1.6; }
  .tv-always-expanded #info-content p.kid-explanation { font-size: 21px; line-height: 1.75; }
  .tv-always-expanded #info-content .science-details p,
  .tv-always-expanded #info-content .star-profile-fact p { font-size: 17px; }
  .tv-always-expanded #info-content .book-learn-copy .book-learn-summary { font-size: 16px; }
  .tv-always-expanded #info-content .catalog-summary-status,
  .tv-always-expanded #info-content .catalog-fact-credit,
  .tv-always-expanded .catalog-summary-facts dt,
  .tv-always-expanded .catalog-summary-choice small,
  .tv-always-expanded .catalog-search-label,
  .tv-always-expanded .catalog-treatment-badge,
  .tv-always-expanded .star-profile-fact dt { font-size: 16px; }
  .tv-always-expanded .catalog-summary-choice strong { font-size: 20px; overflow-wrap: anywhere; }
  .tv-always-expanded .catalog-search-facts,
  .tv-always-expanded .catalog-summary-back,
  .tv-always-expanded dialog summary { font-size: 17px; min-height: 44px; }
  .tv-always-expanded .catalog-summary-facts a,
  .tv-always-expanded .catalog-summary-sources a { font-size: 16px; overflow-wrap: anywhere; }
  .tv-always-expanded .sky-city-result strong { font-size: 18px; }
  .tv-always-expanded .sky-city-result span { font-size: 16px; }
  .tv-always-expanded .sky-layers-dialog .button { font-size: 17px; white-space: normal; }
  .tv-always-expanded .book-supplement-copy > span,
  .tv-always-expanded .book-supplement-library > p,
  .tv-always-expanded .explorer-story-card .explorer-fiction-note,
  .tv-always-expanded .explorer-story-card .explorer-source,
  .tv-always-expanded .explorer-result-count { font-size: 16px; }
  .tv-always-expanded dialog { overflow-wrap: break-word; }
}

/* Keep reading content near the top without shrinking remote targets. */
.tv-always-expanded dialog:not(.book-reader) > .dialog-top {
  min-height: 48px;
  padding-block: 0 !important;
}
.tv-always-expanded dialog:not(.book-reader) > .dialog-top > .eyebrow { margin-block: 0; }
.tv-always-expanded.app-fullscreen .info-dialog #info-content,
.tv-always-expanded.app-fullscreen .reader-dialog:not(.book-reader) .reader-scroll,
.tv-always-expanded #learning-content,
.tv-always-expanded.app-fullscreen .explorers-dialog #explorers-content,
.tv-always-expanded .sky-location-content { padding-top: 0; }
.tv-always-expanded .learning-dialog-nav { padding-block: 4px; }
.tv-always-expanded .catalog-summary-back { margin-bottom: 10px; }
.tv-always-expanded .catalog-summary > h2:first-child { margin-top: 0; }

.catalog-summary-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.catalog-summary-actions .catalog-summary-back { margin: 0; }


/* Journeys fills the available TV frame instead of leaving a dark side strip. */
.tv-always-expanded.app-fullscreen #explorers-dialog[open] {
  width: calc(100vw - 64px);
  max-width: none;
}
/* A warm, visible remote focus highlight across app buttons. */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #efd18a;
  outline-offset: 3px;
  box-shadow: 0 0 7px 3px #e2b85c99, 0 0 20px 6px #dba54655;
}

/* Give expedition learning cards their own generous column on television. */
.tv-always-expanded.app-fullscreen #info-dialog[open] {
  width: calc(100vw - 64px);
  max-width: none;
}
.tv-always-expanded.app-fullscreen #info-dialog #info-content > * {
  max-width: 1640px;
}
@media (min-width: 1200px) {
  .tv-always-expanded #info-dialog .book-linked-layout {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 21vw, 360px);
  }
}

/* Pictured discovery cards retain a square target and separate facts shortcut. */
#catalog-world-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
#catalog-world-results .catalog-search-row { display: flex; flex-direction: column; min-width: 0; }
#catalog-world-results .catalog-summary-choice { aspect-ratio: 1; width: 100%; flex: none; grid-template-rows: minmax(0, 1fr) auto auto auto auto; gap: 5px; padding: 14px; overflow: hidden; }
#catalog-world-results .celestial-portrait { width: 100%; height: 100%; min-height: 0; margin: 0; pointer-events: none; }
#catalog-world-results .celestial-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; }
#catalog-world-results .celestial-portrait figcaption { display: none; }
#catalog-world-results .catalog-search-facts { min-height: 44px; }
#catalog-world-results .catalog-summary-choice strong { font-size: clamp(16px, 1.1vw, 21px); }
#catalog-world-results .catalog-summary-choice small { font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 1200px) { #catalog-world-results { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { #catalog-world-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { #catalog-world-results { grid-template-columns: 1fr; } }
