/* V4 destinations; keep mounted content, note storage and audio untouched. */
.site-main [data-app-view][hidden] { display: none !important; }
.site-header { gap: 24px; overflow-y: auto; }
.site-header nav { gap: 4px; }
.site-header nav a { gap: 10px; padding: 10px; font-size: 13px; line-height: 1.4; }
.site-header nav a > span { flex: 0 0 24px; }
.site-header .sidebar-note { padding-bottom: 8px; }
.app-placeholder { padding: clamp(24px, 5vw, 56px); margin: 24px auto 48px; min-height: 300px; border: 1px solid #9acfff30; border-radius: 20px; background: linear-gradient(120deg, #142436b8, #172032aa); box-shadow: inset 0 1px 0 #d6eeff14; }
.app-placeholder .hero-eyebrow { display: block; line-height: 1.7; }
.app-placeholder h2 { margin: 0 0 20px; font-size: clamp(26px, 4vw, 40px); color: #e0efff; overflow-wrap: anywhere; }
.app-placeholder p { max-width: 620px; color: #b7c9db; font-size: 15px; line-height: 1.8; }
.app-placeholder a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 20px; color: #c5e1fa; font-size: 14px; }
.site-main [data-app-view], #frankFilesystemLibrary { scroll-margin-top: 24px; }
@media (min-width: 951px) and (max-height: 760px) {
  .site-header { padding-top: 20px; padding-bottom: 20px; gap: 16px; }
  .site-header .brand { padding-bottom: 12px; }
  .site-header .sidebar-note, .frank-hud { display: none; }
}
@media (max-width: 950px) {
  .site-header { width: 100%; overflow: visible; }
  /* The legacy corner HUD has no sidebar space here and covers the player. */
  .frank-hud { display: none; }
  .site-header .brand { padding-bottom: 0; border-bottom: 0; }
  .site-main { margin-left: 0; padding-bottom: 24px; }
  .site-header nav { max-height: calc(100dvh - 200px); overflow-y: auto; overscroll-behavior: contain; }
  .site-header nav a { min-height: 44px; flex-shrink: 0; }
  .site-header nav a:hover { transform: none; }
  .site-main [data-app-view], #frankFilesystemLibrary { scroll-margin-top: 100px; }
  /* Match the shell breakpoint; fixes the former 901–950px overlap. */
  body > .glass-player { left: 8px !important; right: 8px; bottom: 8px; width: auto; margin: 0; }
}
@media (max-width: 620px) {
  .board-form textarea { font-size: 16px; }

}
@media (prefers-reduced-motion: reduce) {
  .site-header nav a { transition: none; }
}

/* Measured once per player resize, including expanded controls and safe area. */
body { --player-clearance: 0px; padding-bottom: var(--player-clearance); }
@media (max-width: 950px) {
  .site-header nav { max-height: max(44px, calc(100dvh - 110px - var(--player-clearance))); }
  body > .glass-player { position: fixed; bottom: max(8px, env(safe-area-inset-bottom)); max-height: calc(100dvh - 100px); overflow-y: auto; }
}
@media (max-width: 620px) {
  #home.cyber-hero { padding: 28px 16px !important; }
  #home.cyber-hero h1 { font-size: clamp(28px, 8.5vw, 48px) !important; overflow-wrap: anywhere; }
  .portal-copy, .playing-copy { min-width: 0; }
  .portal-copy strong, .portal-copy small { overflow-wrap: anywhere; }
  body > .glass-player { grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding: 6px; }
  body > .glass-player .playing-summary { min-width: 0; }
  body > .glass-player .playing-art { display: none; }
  body > .glass-player .player-controls { justify-content: end; }
  body > .glass-player .player-controls button, body > .glass-player #playerExpand { min-width: 44px; min-height: 44px; }
  body > .glass-player .player-main-button { width: 44px; height: 44px; }
  body > .glass-player #playerTrackLabel { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body > .glass-player.is-expanded #playerTrackLabel { white-space: normal; max-height: 4.5em; overflow-y: auto; }
  body > .glass-player .player-options { flex-wrap: wrap; }
  body > .glass-player #playerVolume { width: 60px; }
  body > .glass-player button:active { background: #285e8d; }
}
