/* Production chrome — scene picker, Quick Tune, srcdoc scene, no-dev defaults */

body:not(.is-local) .dev-only,
body.is-prod-chrome .dev-only { display: none !important; }

body.role-guest .member-only { display: none !important; }

.scene-picker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.scene-picker-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9eeff1;
}
.scene-picker {
  max-width: 220px;
  background: #0b1018;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font: 650 12px/1.2 Inter, system-ui, sans-serif;
}
.scene-picker:focus {
  outline: 2px solid rgba(42,209,214,0.45);
  border-color: var(--cyan);
}

.btn-wrap-mode[aria-pressed="true"] {
  background: rgba(42, 209, 214, 0.16);
  color: #7eecef;
  border-color: rgba(42, 209, 214, 0.45);
}

.editor-pane {
  background: var(--panel);
}
.tuner-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0c1118;
  overflow: auto;
}
.tuner-panel[hidden] { display: none !important; }
.tuner-head {
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.tuner-head h2 {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: 0.05em;
  color: #fff;
}
.tuner-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.tuner-knobs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tuner-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 4.4rem;
  gap: 10px;
  align-items: center;
}
.tuner-row.is-color { grid-template-columns: 7.5rem 44px 1fr; }
.tuner-label { font-size: 12px; font-weight: 700; color: #d7e0e7; }
.tuner-value {
  font: 600 11px/1 "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  color: #9eeff1;
  text-align: right;
}
.tuner-row input[type="range"] {
  width: 100%;
  accent-color: #2ad1d6;
  height: 4px;
}
.tuner-row input[type="color"] {
  width: 40px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1018;
  padding: 0;
}
.tuner-empty { color: var(--muted); font-size: 13px; padding: 12px 4px; }
.tuner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* Mode: tuner hides the code column; code hides the tuner (already hidden attr). */
body.tuner-mode #editor-code { display: none; }
body.code-mode #tuner-panel { display: none !important; }

/* Quick Tune: full-screen 3D scene with a floating glass overlay panel. */
body.tuner-mode .app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100%;
}
body.tuner-mode .workspace {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
body.tuner-mode .scene-pane,
body.tuner-mode .scene-frame-wrap {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
}
body.tuner-mode .editor-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent !important;
  border: 0 !important;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}
body.tuner-mode #tuner-panel {
  pointer-events: auto;
  position: absolute;
  top: 14px;
  right: 16px;
  width: 320px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(11, 16, 28, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(42, 209, 214, 0.28);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  flex: 0 1 auto;
  z-index: 7;
}
body.tuner-mode #tuner-panel.is-collapsed {
  width: auto;
  max-height: none;
  overflow: hidden;
}
body.tuner-mode #tuner-panel.is-collapsed .tuner-knobs,
body.tuner-mode #tuner-panel.is-collapsed .tuner-actions,
body.tuner-mode #tuner-panel.is-collapsed .tuner-head p {
  display: none;
}
.tuner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tuner-collapse {
  flex: 0 0 auto;
  padding: 5px 10px !important;
  font-size: 11px !important;
  border-radius: 999px;
}

@media (max-width: 900px) and (orientation: portrait) {
  .scene-picker { max-width: 100%; }
  .scene-picker-wrap { width: 100%; }
  .tuner-row, .tuner-row.is-color {
    grid-template-columns: 1fr auto;
    grid-template-areas: "label value" "input input";
  }
  .tuner-label { grid-area: label; }
  .tuner-value { grid-area: value; }
  .tuner-row input { grid-area: input; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .scene-picker-label { display: none; }
  .scene-picker { max-width: 160px; padding: 4px 8px; }
  .tuner-head { padding: 6px 10px 4px; }
  .tuner-head h2 { font-size: 20px; }
  .tuner-head p { display: none; }
  .tuner-knobs { padding: 8px 10px; gap: 8px; }
  .tuner-actions { padding: 6px 10px 8px; }
  .tuner-row { grid-template-columns: 6.2rem minmax(0, 1fr) 3.6rem; gap: 6px; }
}

@media (max-width: 640px) {
  .scene-picker-label { display: none; }
}


/* Viewport containment + compact topbar so 1024/1280/1440 never clip chrome. */
html, body, .app {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
html { overflow-x: clip; }
body { overflow-x: hidden; }
.pane, .toolbar, .brand, .status, .scene-picker-wrap {
  min-width: 0;
}
.full-tab, #btn-wrap, .wrap-toggle {
  flex: 0 0 auto;
}

@media (max-width: 1440px) {
  .topbar { gap: 8px; padding: 6px 14px 6px 18px; }
  .btn { padding: 6px 10px; }
  .scene-picker { max-width: 180px; }
  .status { min-width: 0; max-width: 10rem; }
  .brand h1 { font-size: 24px; letter-spacing: 0.08em; }
  .brand p { max-width: 16rem; }
}

@media (max-width: 1280px) {
  .label-full { display: none; }
  .label-short { display: inline; }
  .scene-picker-label { display: none; }
  .scene-picker { max-width: 160px; }
  .btn { padding: 6px 8px; font-size: 12px; }
  .brand p { max-width: 12rem; }
  .status { font-size: 11px; max-width: 8rem; }
}

@media (max-width: 1024px) {
  .brand p { display: none; }
  .toolbar { flex: 1 1 100%; justify-content: flex-start; }
  .scene-picker { max-width: 140px; }
}


/* right-edge safety: Windows classic scrollbars are ~15–17px and 100vw includes them.
   Keep chrome inset so Running / Full file / WRAP cannot be clipped. */
html, body {
  overflow: hidden !important;
  width: 100%;
  max-width: 100%;
  scrollbar-width: none;
}
html { overflow-x: hidden !important; scrollbar-gutter: auto; }
.topbar {
  padding-left: 18px;
  padding-right: 16px;
  box-sizing: border-box;
}
.editor-head {
  padding-right: 16px;
  box-sizing: border-box;
}
.workspace, .app, .editor-pane, .scene-pane {
  max-width: 100%;
}
.status {
  margin-right: 4px;
}

@media (max-width: 1600px) {
  .label-full { display: none; }
  .label-short { display: inline; }
  .scene-picker-label { display: none; }
  .status { min-width: 0; max-width: 9rem; }
}

/* WRAP lives in .editor-subbar (not .editor-head). Keep >=16px right inset. */
.editor-subbar {
  padding-right: 16px !important;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .status {
    display: inline-block !important;
    min-width: 0;
    max-width: 7rem;
  }
}


@media (max-width: 900px) and (orientation: portrait) {
  body.tuner-mode .workspace {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
  body.tuner-mode .editor-pane,
  body.tuner-mode .scene-pane {
    display: flex;
  }
  body.tuner-mode #tuner-panel {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: 42%;
    border-radius: 16px 16px 12px 12px;
  }
  body.tuner-mode #tuner-panel.is-collapsed {
    left: 10px;
    right: auto;
    width: auto;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body.tuner-mode .workspace {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
  body.tuner-mode #tuner-panel {
    top: 8px;
    right: 8px;
    left: auto;
    bottom: auto;
    width: 260px;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }
  body.tuner-mode #tuner-panel .tuner-head p { display: none; }
}


/* Support / Report */
.btn-support {
  white-space: nowrap;
}
.help-support-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #7eecef;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}
.support-backdrop {
  z-index: 80;
}
.support-modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: rgba(11, 16, 28, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 209, 214, 0.28);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  padding: 18px 18px 16px;
  color: var(--text);
}
.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.support-head h2 {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: 0.05em;
  color: #fff;
}
.support-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.support-form { display: flex; flex-direction: column; gap: 12px; }
.support-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: #d7e0e7; }
.support-field input,
.support-field select,
.support-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0b1018;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: 500 13px/1.4 Inter, system-ui, sans-serif;
}
.support-field textarea { resize: vertical; min-height: 110px; }
.support-context { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.support-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.support-error {
  color: #fb7185;
  font-size: 13px;
  font-weight: 650;
}
.support-error[hidden],
.support-thanks[hidden] { display: none !important; }
.support-thanks {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0 4px;
}
.support-thanks strong { font-size: 16px; color: #34d399; }
.support-thanks p { margin: 0; color: #c5d0d8; }

@media (max-width: 640px) {
  .support-modal { width: calc(100vw - 16px); padding: 14px 12px 12px; }
  .support-head h2 { font-size: 24px; }
}


/* GEM-17: keep 1440 desktop topbar on one row after adding Analytics. */
@media (min-width: 1280px) and (min-height: 600px) {
  .topbar, .toolbar, .toolbar-cluster { flex-wrap: nowrap; }
  .topbar { gap: 6px; padding: 6px 10px 6px 12px; }
  .toolbar { gap: 6px; }
  .toolbar-cluster { gap: 6px; }
  .btn { padding: 6px 8px; }
  .scene-picker { max-width: 148px; }
  .brand h1 { font-size: 22px; }
  .brand p { max-width: 11rem; }
  .status {
    min-width: 0;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 1 5.5rem;
  }
}


/* GEM-21: keep full "LIVE CODE EDITOR" title visible at 1280 and 1440.
   Shane's ~1280 desktop screenshot clipped the brand to "ODE EDITOR" because
   the nowrap topbar (brand + project label + Scene + long button labels)
   was slightly wider than the viewport and overflow-x clipped the left. */
@media (max-width: 1500px) and (min-width: 768px) {
  .brand-meta,
  .brand p,
  .scene-picker-label { display: none !important; }
  .label-full { display: none !important; }
  .label-short { display: inline !important; }
  .topbar {
    gap: 4px;
    padding: 6px 12px 6px 18px;
    overflow: visible;
  }
  .toolbar,
  .toolbar-cluster { gap: 4px; }
  .btn { padding: 6px 7px; font-size: 12px; }
  .brand { flex: 0 0 auto; min-width: auto; overflow: visible; padding-left: 2px; }
  .brand h1,
  .brand-full {
    font-size: 20px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    overflow: visible;
    white-space: nowrap;
    padding-left: 6px;
    margin-left: 0;
  }
  .scene-picker { max-width: 128px; }
  .status { max-width: 4.5rem; flex: 0 1 4.5rem; }
  .toolbar { min-width: 0; flex: 1 1 auto; }
}

/* ---- GEM-18: grouped Quick Tune + Content chips ---- */
.tuner-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.tuner-group + .tuner-group {
  border-top: 1px solid rgba(42, 209, 214, 0.14);
  padding-top: 10px;
}
.tuner-group-title {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9eeff1;
}
.tuner-group-help {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.tuner-row.is-asset,
.tuner-row.is-select,
.tuner-row.is-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  grid-template-columns: none;
}
.tuner-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tuner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tuner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b1018;
  color: var(--text);
  font: 650 11px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.tuner-chip[aria-pressed="true"] {
  border-color: rgba(42, 209, 214, 0.55);
  background: rgba(42, 209, 214, 0.16);
  color: #7eecef;
}
.tuner-chip-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}
.tuner-chip-tag {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9aa8b5;
}
.tuner-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a2230;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}
.tuner-toggle[aria-pressed="true"] {
  background: rgba(42, 209, 214, 0.35);
  border-color: #2ad1d6;
}
.tuner-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s ease;
}
.tuner-toggle[aria-pressed="true"]::after { left: 20px; }
.tuner-apply-hint {
  font-size: 10px;
  color: #fbbf24;
  font-weight: 650;
}

.brand-compact { display: none; }

/* Overflow ⋯ menu is portrait-mobile only; desktop + landscape keep the full toolbar. */
.toolbar-overflow { display: none; position: relative; flex: 0 0 auto; }
.btn-toolbar-more {
  min-width: 36px;
  padding: 6px 8px;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}
.more-icon { display: block; transform: translateY(-2px); font-weight: 800; }
.toolbar-overflow-menu {
  position: fixed;
  z-index: 80;
  min-width: 198px;
  max-width: calc(100vw - 16px);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(42, 209, 214, 0.28);
  background: rgba(11, 16, 28, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toolbar-overflow-menu[hidden] { display: none !important; }
.overflow-status {
  margin: 0 4px 6px;
  padding: 6px 8px 8px;
  border-bottom: 1px solid rgba(42, 209, 214, 0.16);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overflow-status:empty { display: none; }
.overflow-item {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 10px;
  padding: 10px 10px;
  font: 650 13px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.overflow-item:hover,
.overflow-item:focus-visible {
  background: rgba(42, 209, 214, 0.14);
  color: #7eecef;
  outline: none;
}

/* GEM-20: portrait mobile only — one clean <=56px row, maximize the 3D scene.
   Desktop and landscape mobile keep the full inline toolset. */
@media (max-width: 767px) and (orientation: portrait) {
  :root { --header-h: 48px; }
  .brand { display: flex !important; align-items: center; flex: 0 0 auto; min-width: 0; gap: 0; }
  .brand-full,
  .brand-meta,
  .brand p { display: none !important; }
  .brand-compact {
    display: inline-block !important;
    margin: 0;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 18px;
    letter-spacing: 0.06em;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
  }
  #btn-help,
  #btn-support,
  .view-toggle,
  #btn-show-code,
  #save-projects-group,
  #btn-publish,
  #btn-reset,
  #btn-analytics,
  #status { display: none !important; }
  .toolbar-overflow { display: inline-flex; }
  .topbar {
    flex-wrap: nowrap !important;
    align-items: center;
    min-height: 48px;
    max-height: 56px;
    height: 48px;
    padding: 4px 8px !important;
    gap: 6px;
    overflow: visible;
  }
  .toolbar,
  .toolbar-cluster {
    flex-wrap: nowrap !important;
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
  }
  #tune-code-group,
  #run-reset-group { flex: 0 0 auto; }
  .scene-picker-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none;
  }
  .scene-picker-label { display: none !important; }
  .scene-picker {
    min-width: 0;
    width: 100%;
    max-width: none !important;
    padding: 6px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .btn { padding: 6px 8px; font-size: 12px; }
  .qt-sub,
  #tuner-subtitle,
  .tuner-head p,
  .tuner-group-help { display: none !important; }
  .tuner-head { padding: 8px 10px 4px; align-items: center; }
  .tuner-head h2 { font-size: 20px; }
  .tuner-knobs { padding: 8px 10px; gap: 8px; }
  .tuner-actions { padding: 6px 10px 8px; }
  body.tuner-mode #tuner-panel {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: min(42dvh, 300px);
    border-radius: 16px 16px 12px 12px;
  }
  body.tuner-mode #tuner-panel.is-collapsed {
    left: 10px;
    right: auto;
    width: auto;
    max-height: none;
  }
}


/* GEM-22: first-load Beta Notice — dark glass card, once per session. */
.beta-backdrop {
  z-index: 85;
  padding: 16px;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 12, 0.55);
}
.beta-backdrop[hidden] { display: none !important; }
.beta-modal {
  position: relative;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: rgba(11, 16, 28, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(42, 209, 214, 0.42);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(42, 209, 214, 0.12),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(42, 209, 214, 0.14);
  padding: 22px 22px 20px;
  color: var(--text);
}
.beta-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.beta-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-right: 36px;
  margin-bottom: 12px;
}
.beta-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(42, 209, 214, 0.16);
  border: 1px solid rgba(42, 209, 214, 0.45);
  color: #7eecef;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.beta-head h2,
.beta-modal h2 {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 30px;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1;
}
.beta-copy {
  margin: 0 0 18px;
  color: #c5d0d8;
  font-size: 14px;
  line-height: 1.55;
}
.beta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.beta-actions .btn-run {
  flex: 1 1 auto;
}
.beta-actions .btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .beta-backdrop { padding: 12px; }
  .beta-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px 16px 16px;
  }
  .beta-head h2,
  .beta-modal h2 { font-size: 26px; }
  .beta-copy { font-size: 13px; margin-bottom: 14px; }
  .beta-actions { flex-direction: column; }
  .beta-actions .btn { width: 100%; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .beta-backdrop { padding: 8px; }
  .beta-modal {
    width: min(640px, calc(100vw - 16px));
    max-height: calc(100dvh - 12px);
    padding: 12px 16px 12px;
  }
  .beta-head { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 6px; padding-right: 36px; }
  .beta-head h2,
  .beta-modal h2 { font-size: 22px; }
  .beta-copy { font-size: 13px; margin-bottom: 10px; }
  .beta-actions { flex-wrap: nowrap; }
  .beta-close { top: 8px; right: 8px; }
}
