/* Genuine screen captures, with one quiet control for each viewport. */
.case-visual { min-width: 0; }
.case-preview-title { display: none; }
.case-extra > summary { display: none; }
.case-dialog .case-content { padding: 28px; }
.case-device-controls { display: flex; gap: 4px; padding: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 5px; }
.case-device-controls > button { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--secondary); font: 500 12px/1.5 var(--sans); }
.case-device-controls > button > .ax-icon { width: 17px; height: 17px; stroke-width: 1.25; }
.case-device-controls > button:hover { background: var(--panel); color: var(--ink); }
.case-device-controls > button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.case-visual .case-image-wrap { transform: none; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.case-visual .case-image-bar { border-bottom: 1px solid var(--line); }
.case-dialog[data-preview-device="mobile"] .case-image-bar, .case-dialog[data-preview-device="tablet"] .case-image-bar { display: none; }
.case-preview-stage { --preview-height: clamp(220px, calc(100dvh - 380px), 650px); position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 16px; }
.case-device-frame { flex: 0 1 auto; overflow: hidden; background: #f9f8f2; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.case-preview-stage[data-device="desktop"] { padding: 0; min-height: 0; }
.case-preview-stage[data-device="desktop"] .case-device-frame { width: 100%; aspect-ratio: 1280 / 720; box-shadow: none; }
.case-preview-stage[data-device="mobile"] .case-device-frame { width: min(100%, calc(var(--preview-height) * 390 / 844)); aspect-ratio: 390 / 844; border: 5px solid #292f2b; border-radius: 22px; }
.case-preview-stage[data-device="tablet"] .case-device-frame { width: min(100%, calc(var(--preview-height) * 768 / 1024)); aspect-ratio: 768 / 1024; border: 5px solid #292f2b; border-radius: 14px; }
.case-preview-stage[data-device="mobile"] .case-device-frame, .case-preview-stage[data-device="tablet"] .case-device-frame { box-sizing: content-box; max-width: calc(100% - 10px); }
.case-device-frame > img { display: block; width: 100%; height: auto; aspect-ratio: auto; }
.case-device-frame > img[hidden], .case-preview-status[hidden] { display: none; }
.case-preview-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--secondary); font: 12px/1.5 var(--sans); text-align: center; }
.case-preview-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; color: var(--secondary); font: 400 11px/1.5 var(--display); }
@media (max-width: 1000px) {
  .case-visual { grid-row: 1; }
}
@media (max-width: 700px) {
  .case-dialog .case-content { padding: 20px; }
  .case-device-controls { gap: 2px; }
  .case-device-controls > button { gap: 6px; padding: 7px 6px; font-size: 11px; }
  .case-device-controls > button > .ax-icon { width: 16px; height: 16px; }
  .case-preview-stage { padding: 16px; }
  .case-preview-stage[data-device="desktop"] { padding: 0; }
  .case-preview-caption { font-size: 10px; }
}

/* Only the opened project gets a live, correctly sized viewport. */
.case-device-frame { position: relative; }
.case-live-frame { position: absolute; top: 0; left: 0; display: block; max-width: none; margin: 0; padding: 0; border: 0; transform-origin: top left; background: #f9f8f2; }
.case-preview-status { pointer-events: none; z-index: 1; background: var(--panel); }
.case-preview-caption { align-items: center; gap: 8px; margin-top: 4px; }
.case-preview-caption > #case-device-size { white-space: nowrap; }
.case-preview-modes { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.case-preview-modes > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px; border: 0; border-radius: 3px; background: transparent; color: var(--secondary); font: 500 11px/1.5 var(--sans); }
.case-preview-modes > button:hover, .case-preview-modes > button[aria-pressed="true"] { color: var(--ink); }
.case-preview-modes > button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.case-preview-modes > button:disabled { opacity: .4; cursor: default; text-decoration: none; }
.preview-live-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.case-preview-help { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 12px; margin: 0; color: var(--secondary); font: 400 11px/1.6 var(--sans); }
.case-preview-help > a { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; color: var(--ink); text-underline-offset: 3px; }
.case-preview-help > a > .ax-icon { width: 12px; height: 12px; stroke-width: 1.2; }
.case-preview-stage { --preview-height: clamp(180px, calc(100dvh - 440px), 650px); }
@media (max-width: 700px) {
  .case-preview-help > a { min-height: 44px; }
  .case-preview-help { font-size: 10px; }
}
