/* The normal desktop / portrait flow stays intact outside short landscape screens. */
.boothWorkspace, .boothControls, .resultContent, .resultDetails, .previewStage { display: contents; }
.compactThemeField { display: none; }
.phoneKeypad.hidden { display: none; }
.booth-page button, .booth-page input, .booth-page select { touch-action: manipulation; }

@media (min-width: 600px) and (max-height: 700px) {
  .booth-page { height: 100dvh; min-height: 0; }
  .booth-page .layout {
    box-sizing: border-box;
    width: 100%; max-width: 1440px; height: 100dvh;
    padding: 8px; gap: 0;
  }
  .booth-page .panel {
    box-sizing: border-box; min-width: 0; min-height: 0;
    padding: 12px; border-radius: 12px;
    grid-template-rows: auto minmax(0, 1fr); gap: 10px;
  }
  .booth-page .screen.hidden { display: none; }
  .booth-page .heroTitle, .booth-page .resultTitle {
    margin: 0; font-size: clamp(20px, 3vw, 28px); line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .booth-page #themePicker { display: none; }
  .booth-page .boothWorkspace {
    display: grid; grid-template-columns: minmax(0, 1fr) 252px;
    min-height: 0; gap: 12px;
  }
  .booth-page .previewShell {
    box-sizing: border-box; width: 100%; height: 100%; min-height: 0;
    padding: 0; margin: 0; overflow: hidden; background: #000;
    display: grid; place-items: center; container-type: size;
  }
  .booth-page .previewStage {
    display: block; position: relative;
    width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9;
  }
  .booth-page video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
  .booth-page .liveBranding { box-sizing: border-box; padding: 16px; }
  .booth-page .liveBrandingLine1 { font-size: clamp(18px, 2.5vw, 30px); }
  .booth-page .liveBrandingLine2 { font-size: 12px; }
  .booth-page .boothControls {
    display: flex; flex-direction: column; justify-content: center;
    min-width: 0; min-height: 0; gap: 12px;
  }
  .booth-page .compactThemeField:not(.hidden) { display: grid; gap: 4px; color: var(--ds-copy); font-size: 12px; }
  .booth-page .compactThemeField select {
    width: 100%; min-height: 44px; border: 1px solid var(--ds-line);
    border-radius: 8px; color: var(--ds-ink); background: var(--ds-white); font: inherit; font-size: 15px;
  }
  .booth-page .captureOptions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .booth-page .toggleGroup { gap: 5px; }
  .booth-page .toggleLabel { font-size: 11px; }
  .booth-page .segmentedControl { box-sizing: border-box; display: flex; width: 100%; gap: 3px; padding: 3px; }
  .booth-page .toggleOption { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 8px 4px; font-size: 16px; }
  .booth-page .captureActions { margin: 0; }
  .booth-page .captureButton { width: 100%; min-width: 0; min-height: 50px; }
  .booth-page .status { font-size: 13px; line-height: 1.25; min-height: 0; overflow-wrap: anywhere; }
  .booth-page .status:empty { display: none; }
  .booth-page .resultContent {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
    min-height: 0; gap: 14px;
  }
  .booth-page .capturedShots {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr); align-items: stretch;
    width: 100%; min-height: 0; margin: 0; gap: 8px;
  }
  .booth-page .capturedShot {
    box-sizing: border-box; width: 100%; height: 100%; min-height: 0; min-width: 0;
    max-width: 100%; max-height: 100%; object-fit: contain;
  }
  .booth-page .capturedShot:only-child { grid-column: 1 / -1; }
  .booth-page .resultDetails {
    display: grid; grid-template-columns: minmax(0, 1fr) 128px;
    grid-template-rows: auto minmax(100px, 1fr) auto auto auto;
    align-items: center; align-content: center; gap: 8px;
    min-width: 0; min-height: 0;
  }
  .booth-page #resultStatus { grid-column: 1 / -1; grid-row: 1; }
  .booth-page .shootCodeBlock { grid-column: 1; grid-row: 2; gap: 6px; }
  .booth-page .shootCodeLabel { font-size: 10px; }
  .booth-page .shootCode { font-size: clamp(28px, 4.5vw, 44px); letter-spacing: .12em; }
  .booth-page .shootQrCode { grid-column: 2; grid-row: 2; }
  .booth-page .shootQrCode svg { width: 128px; height: 128px; max-width: 100%; }
  .booth-page .shareRow { grid-column: 1 / -1; grid-row: 3; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .booth-page .phoneField { min-width: 0; font-size: 13px; }
  .booth-page .phoneField input { min-width: 0; min-height: 46px; margin-top: 4px; padding: 10px; font-size: 17px; }
  .booth-page #sharePhotosBtn { min-height: 46px; padding: 10px 12px; font-size: 15px; }
  .booth-page #shareLink { grid-column: 1 / -1; grid-row: 4; }
  .booth-page .takeMoreRow { grid-column: 1 / -1; grid-row: 5; }
  .booth-page #takeMoreBtn { width: 100%; min-height: 46px; }
  .booth-page .phone-entry .capturedShots { display: none; }
  .booth-page .phoneKeypad:not(.hidden) {
    display: grid; grid-template-rows: auto minmax(0, 1fr);
    min-width: 0; min-height: 0; gap: 8px;
  }
  .booth-page .keypadHeader { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
  .booth-page .keypadHeader button { min-height: 44px; padding: 8px 12px; }
  .booth-page .keypadKeys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(44px, 1fr)); gap: 8px; }
  .booth-page .keypadKeys button { min-height: 44px; min-width: 0; padding: 6px; font-size: 22px; }
  .booth-page .keypadKeys [data-phone-key="clear"] { font-size: 15px; }
}

@media (min-width: 600px) and (max-width: 720px) and (max-height: 700px) {
  .booth-page .boothWorkspace { grid-template-columns: minmax(0, 1fr) 224px; gap: 8px; }
  .booth-page .resultContent { grid-template-columns: minmax(0, 1fr) minmax(320px, 1.2fr); gap: 8px; }
}
