/* Shared layout safeguards; fix content sizing rather than clipping the page. */
[hidden] { display: none !important; }
header, main, section, article, form, nav, dialog { min-width: 0; }
h1, h2, h3, p, summary, .notice { overflow-wrap: anywhere; }
button, .button, .secondary { white-space: normal; }
a.secondary { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; line-height: 1.5; }
input, select, textarea { max-width: 100%; min-width: 0; }
.haunted-heading { max-width: 100%; }
.discord-server-icon { background-image: url('../assets/logo-180.png'); }
.season-settings, .season-settings * { box-sizing: border-box; }
.season-settings-body { max-height: min(70dvh, 600px); }
.season-settings select, .season-settings button { min-height: 40px; }
.haunt-music-settings > span { display: block; font-size: 11px; line-height: 1.6; margin-top: 12px; }
@media (max-width: 760px) {
  body:not(.studio-app) > header:not(.navbar) { flex-wrap: wrap; gap: 14px; }
  body:not(.studio-app) > header:not(.navbar) nav { flex-wrap: wrap; gap: 12px; }
  .card-actions { flex-wrap: wrap; }
  dialog { max-height: 88dvh; overflow: auto; }
}
@media (max-width: 1100px) {
  html[data-layout] .navbar .nav-menu > a { display: block; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; padding-top: 32px; padding-right: 32px; transform: none; }
  html[data-layout] .navbar .nav-menu > a::before { position: absolute; top: 12px; left: 14px; }
  html[data-layout] .navbar .nav-directory { grid-row: 3; }
  html[data-layout] .navbar .nav-directory > summary { white-space: normal; min-height: 44px; }
}
@media (max-width: 540px) {
  html[data-layout] .navbar .nav-menu { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .voting-page .vote-directory h2 { font-size: clamp(1.2rem, 6vw, 1.7rem); }
}
