/* Keep content readable without hiding layout overflow. */
:root { --muted: #64675c; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.hero > *, .editor-layout > *, .detail-layout > *, .auth-shell > *,
.profile-header > *, .profile-columns > *, .community-prompt > *,
.community-punchline > *, .fun-grid > *, .nv-result-grid > *,
.nv-mascot-stage > *, .page-heading > *, .topbar > *, .info-list > div > * { min-width: 0; }
.hero-copy, .card-body, .fun-featured, .detail-text, .profile-shell,
.community-caption-foot, .community-admin-story, .queue-meta, .info-list dd,
.workspace-footer, .auth-card { overflow-wrap: anywhere; }
.mascot { max-width: 100%; }
.card-nerves .big-reaction { min-width: 0; }
.big-reaction small, .card-nerves .big-reaction small, .nv-style-choice small { font-size: 10px; }
.editor-layout { align-items: start; }
.canvas-wrap { position: sticky; top: 0; }
.header nav { flex-wrap: wrap; }
#account-button { max-width: 240px; min-width: 0; overflow-wrap: anywhere; }
dialog { overflow-wrap: anywhere; overscroll-behavior: contain; max-height: min(90vh, calc(100dvh - 24px)); }
dialog form, dialog fieldset, dialog label, dialog input, dialog select, dialog textarea { min-width: 0; max-width: 100%; }
.nv-studio-tabs, .dialog-actions, .community-list-heading, .community-pager { flex-wrap: wrap; }
.nv-studio-tabs button { min-width: 0; }
.sidebar { overflow-y: auto; }
.workspace, .workspace main, .table-wrap, .panel { min-width: 0; }
.page-heading, .panel-heading, .topbar, .info-list > div { flex-wrap: wrap; }
.session-chip { min-width: 0; }
.session-chip .avatar { flex-shrink: 0; }
.community-admin-toolbar select { min-width: 0; max-width: 100%; }
.community-admin-form input[type="datetime-local"] { min-width: 0; width: 100%; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.button { max-width: 100%; white-space: normal; text-align: center; }

@media (max-width: 1024px) {
  .editor-dialog input:not([type="range"]), .editor-dialog select,
  .editor-dialog textarea, .nv-share-kit textarea { font-size: 16px; }
}
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .canvas-wrap { position: static; }
  #export-canvas { max-height: 48vh; }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .header { height: auto; flex-wrap: wrap; padding-block: 22px; }
  .header nav { order: 3; width: 100%; justify-content: center; gap: 12px 24px; }
  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header nav { gap: 4px 16px; justify-content: flex-start; font-size: 14px; }
  .header nav a, .header nav button { display: inline-flex; align-items: center; min-height: 44px; }
  .header .button { font-size: 13px; min-height: 44px; }
  #account-button { max-width: 100%; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(42px, 11vw, 60px); letter-spacing: -.055em; }
  .hero h1 > span { letter-spacing: -.05em; }
  .hero-actions, .hero-note { flex-wrap: wrap; }
  .hero-copy > p, .card p, .community p, .how p, .fun-small,
  .auth-copy, .auth-story > p, .profile-header p { font-size: 14px; line-height: 1.7; }
  .subtle, dialog .subtle, .nv-share-kit .subtle, .nv-play .nv-play-intro,
  .nv-play-footnote, .nv-play .nv-result-link, .nv-result-copy p,
  .nv-result-copy .subtle, .nv-play #nv-result-privacy,
  .nv-play-link-actions .text-button, .nv-play-styles .nv-style-description,
  .nv-play-styles > .subtle, .nv-style-choice > span:last-child,
  .auth-privacy, .auth-switch, .auth-recovery, .profile-note,
  .nv-studio-card .subtle, .nv-studio-actions .text-button,
  .workspace .subtle, .page-description, .panel-heading p, .queue-body,
  .stat-note, .chart-caption, .chart-details, .status-strip p,
  .attention-row small, .info-list > div, .workspace-footer { font-size: 12px; line-height: 1.65; }
  .nv-play-footnote { font-size: 12px !important; }
  dialog input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  dialog select, dialog textarea, .auth-form input:not([type="hidden"]),
  .search input, .workspace input, .workspace select, .workspace textarea { font-size: 16px; }
  .nv-share-kit textarea, .nv-result-description textarea { font-size: 16px; }
  .button, .text-button, .chip { min-height: 44px; }
  .chip, .card-footer button, .nv-studio-actions .button { font-size: 12px; }
  .big-reaction small, .card-nerves .big-reaction small, .nv-style-choice small { font-size: 10px; }
  .card-footer { gap: 10px; flex-wrap: wrap; }
  .fun-featured { grid-template-columns: minmax(0, 1fr); }
  .community-list-heading, .community-caption-foot { align-items: flex-start; }
  .community-prompt img, .community-punchline img { flex-shrink: 0; }
  .topbar { height: auto; min-height: 55px; padding-block: 12px; gap: 10px; }
  .page-heading { gap: 14px; }
  .panel-heading { align-items: flex-start; }
  .workspace table { font-size: 12px; }
  .workspace th { font-size: 11px; }
  .sidebar .navigation > a { font-size: 12px; min-height: 44px; }
  .community-admin-form { margin-inline: 0; }
}
@media (max-width: 480px) {
  .feed-grid { grid-template-columns: minmax(0, 1fr); }
  .card-image { height: auto; aspect-ratio: 4 / 3; }
  .community-prompt { flex-direction: column; }
  .community-prompt img { width: 72px; height: 88px; align-self: center; }
  .nv-style-choices { grid-template-columns: minmax(0, 1fr); }
  .nv-studio-tabs { flex-direction: column; }
  .nv-studio-tabs button { flex: auto; }
  .info-list > div { flex-direction: column; gap: 6px; }
  .info-list dd { text-align: left; }
}
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .nv-mascot-stage { grid-template-columns: minmax(0, 1fr); }
  .nv-mascot-stage img { height: 170px; object-fit: contain; border-radius: 0; }
  .nv-mascot-bubble { margin: 0 12px 14px; }
  .comment-login { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .tribuna-seats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tribuna-seat { min-height: 2.15rem; }
}
