:root {
  --mint: #7ccfc1;
  --mint-soft: #e7f7f3;
  --coral: #f7748b;
  --coral-soft: #fff0f3;
  --sky: #dff2ff;
  --lavender: #f1ecff;
  --ink: #303438;
  --muted: #7b8188;
  --line: #e9edf1;
  --surface: #ffffff;
  --shadow: 0 18px 50px rgba(83, 104, 118, 0.12);
  --shot-ratio: 4 / 3;
  --shot-scale: 1.3333;
  --topbar-h: 0px;
  --stepper-h: 74px;
  --safe-bottom: 86px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #fbfcfd;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
}

body[data-frame-type="classic"] {
  --shot-ratio: 4 / 3;
  --shot-scale: 1.3333;
}

body[data-frame-type="multi4"] {
  --shot-ratio: 3 / 4;
  --shot-scale: 0.75;
}

body[data-frame-type="multi6"] {
  --shot-ratio: 9 / 8;
  --shot-scale: 1.125;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.topbar {
  display: none;
  height: 0;
  padding: 14px 20px 8px;
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  align-items: center;
  gap: 6px;
}

.topbar h1 {
  margin: 0;
  color: var(--mint);
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.icon-button,
.ghost-button,
.round-tool {
  border: 0;
  background: transparent;
  color: #4e5358;
}

.icon-button {
  min-width: 62px;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 12px;
}

.icon {
  font-size: 27px;
  line-height: 1;
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.type-layout,
.timer-layout,
.select-layout,
#frameScreen {
  padding-bottom: var(--safe-bottom);
}

.type-layout {
  padding: 18px 22px 0;
  display: grid;
  gap: 14px;
}

.timer-layout {
  flex: 1;
  min-height: 0;
  padding: 18px 22px 0;
  display: grid;
  align-content: center;
  gap: 18px;
}

.type-intro p {
  margin: 0 0 6px;
  color: var(--mint);
  font-weight: 900;
}

.type-intro h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.type-options {
  display: grid;
  gap: 12px;
}

.type-card {
  min-height: 124px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 92px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  text-align: left;
}

.type-card.active {
  border-color: var(--mint);
  background: var(--mint-soft);
}

.type-card strong {
  font-size: 17px;
}

.type-card small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 700;
}

.mini-frame {
  grid-row: 1 / span 2;
  height: 96px;
  border-radius: 14px;
  padding: 7px;
  background: #fff;
  display: grid;
  gap: 5px;
  box-shadow: inset 0 0 0 1px rgba(124, 207, 193, 0.35);
}

.mini-frame i {
  display: block;
  border-radius: 7px;
  background: linear-gradient(135deg, #f6b7c6, #bfe9df);
}

.mini-frame.classic {
  width: 50px;
  justify-self: center;
  grid-template-rows: repeat(4, 1fr);
}

.mini-frame.multi4,
.mini-frame.multi6 {
  width: 86px;
  grid-template-columns: repeat(2, 1fr);
}

.mini-frame.multi4 {
  grid-template-rows: repeat(2, 1fr);
}

.mini-frame.multi6 {
  grid-template-rows: repeat(3, 1fr);
}

.type-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7f9fa;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.timer-panel {
  padding: 15px;
  border-radius: 18px;
  background: #f7f9fa;
  display: grid;
  gap: 12px;
}

.timer-panel strong,
.timer-panel span {
  display: block;
}

.timer-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.timer-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.timer-choice {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.timer-choice.active {
  border-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint);
}

.camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--shot-ratio);
  height: auto;
  overflow: hidden;
  background: linear-gradient(180deg, #f6f8fa, #fff);
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scaleX(-1);
  display: none;
}

#cameraVideo.ready {
  display: block;
}

body.no-mirror #cameraVideo {
  transform: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

.camera-placeholder strong {
  color: var(--ink);
  font-size: 22px;
}

.record-pill {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 21px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  color: #596067;
  font-weight: 700;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--coral);
}

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.flash.on {
  animation: flash 180ms ease-out;
}

.timer-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #fff;
  font-size: clamp(88px, 15vw, 190px);
  font-weight: 900;
  text-shadow: 0 8px 38px rgba(48, 52, 56, 0.42);
  pointer-events: none;
}

.timer-overlay.show {
  display: grid;
}

@keyframes flash {
  0% { opacity: 0; }
  35% { opacity: 0.85; }
  100% { opacity: 0; }
}

.capture-panel {
  padding: 16px 22px 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0;
}

.section-heading p,
.video-chip span {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.shot-track {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.shot-slot {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #a4a8ad;
  background: #f6f7f8;
  overflow: hidden;
  font-weight: 800;
}

.shot-slot.done {
  border-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint);
}

.shot-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 14px;
}

.round-tool {
  display: grid;
  justify-items: center;
  gap: 9px;
  font-size: 13px;
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  color: #454b50;
  font-size: 25px;
}

.shutter {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  border: 11px solid #c4ebe4;
  background: #fff;
  color: var(--coral);
  font-size: 48px;
  font-weight: 800;
  box-shadow: inset 0 0 0 8px #fff, 0 8px 24px rgba(124, 207, 193, 0.2);
}

.shutter.running {
  border-color: #ffd1d9;
}

.center-copy {
  min-height: 36px;
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink);
  font-weight: 800;
}

.select-layout,
#frameScreen {
  padding: 16px 22px 0;
}

.select-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto minmax(120px, auto) auto auto auto;
  gap: 10px;
  overflow: hidden;
}

.selected-preview {
  min-height: 0;
  aspect-ratio: var(--shot-ratio);
  align-self: start;
  overflow: hidden;
  border-radius: 22px;
  background: #f7f8f9;
}

.selected-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.section-heading {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f7f9fa;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drop-frame {
  --select-frame-ratio: 1020 / 1520;
  margin-bottom: 0;
  padding: 10px;
  border-radius: 18px;
  background: var(--mint-soft);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.drop-frame.classic {
  --select-frame-ratio: 1 / 3;
  grid-template-columns: 1fr;
}

.drop-frame.multi4,
.drop-frame.multi6 {
  --select-frame-ratio: 1020 / 1520;
  grid-template-columns: repeat(2, 1fr);
}

.drop-slot {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  padding: 0;
  border: 1.5px dashed rgba(98, 189, 174, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--mint);
  font-weight: 900;
}

.drop-slot:disabled {
  cursor: default;
  opacity: 1;
}

.drop-slot:not(:disabled) {
  cursor: pointer;
}

.drop-frame.multi4 .drop-slot {
  aspect-ratio: 3 / 4;
}

.drop-frame.multi6 .drop-slot {
  aspect-ratio: 9 / 8;
}

.drop-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card {
  position: relative;
  aspect-ratio: var(--shot-ratio);
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background: #f7f8f9;
  touch-action: manipulation;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.photo-card.selected {
  border-color: transparent;
}

.photo-card.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(17, 20, 24, 0.42);
  pointer-events: none;
}

.photo-card.previewing {
  border-color: var(--mint);
}

.photo-card span {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: none;
  transform: translate(-50%, -50%);
  place-items: center;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.photo-card.selected span {
  display: grid;
}

.video-chip {
  margin: 0;
  display: none;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: var(--mint-soft);
}

.video-chip video {
  width: 86px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.video-chip strong {
  display: block;
  margin-bottom: 3px;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--mint);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(124, 207, 193, 0.22);
}

.primary-button:disabled {
  background: #d5dadd;
  box-shadow: none;
  cursor: not-allowed;
}

.next-button {
  position: fixed;
  right: 28px;
  bottom: calc(var(--stepper-h) + 18px);
  z-index: 12;
  width: 176px;
  min-height: 56px;
  border-radius: 999px;
}

.composer {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
}

.video-frame {
  background: #f7f9fa;
}

.print-frame {
  margin: 0 auto;
  height: 100%;
  max-height: 100%;
  width: auto;
  padding: clamp(8px, 2.1%, 16px);
  border-radius: 20px;
  background: var(--mint-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}

.four-cut-frame {
  width: min(100%, 400px, calc((100dvh - var(--stepper-h) - 86px) / 3));
  max-width: 400px;
  height: auto;
  aspect-ratio: 1 / 3;
  object-fit: contain;
}

.print-frame.multi4,
.print-frame.multi6 {
  aspect-ratio: 1020 / 1520;
}

.frame-photo-grid {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: clamp(4px, 1.45%, 10px);
  align-content: center;
}

.print-frame.classic .frame-photo-grid {
  grid-template-rows: repeat(4, auto);
}

.print-frame.multi4 .frame-photo-grid,
.print-frame.multi6 .frame-photo-grid {
  grid-template-columns: repeat(2, 1fr);
}

.print-frame.multi4 .frame-photo-grid {
  grid-template-rows: repeat(2, auto);
}

.print-frame.multi6 .frame-photo-grid {
  grid-template-rows: repeat(3, auto);
}

.frame-photo-grid img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
}

.print-frame.classic .frame-photo-grid img {
  aspect-ratio: 4 / 3;
}

.print-frame.multi4 .frame-photo-grid img {
  aspect-ratio: 3 / 4;
}

.print-frame.multi6 .frame-photo-grid img {
  aspect-ratio: 9 / 8;
}

.frame-photo-grid video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.print-frame.classic .frame-photo-grid video {
  aspect-ratio: 4 / 3;
}

.print-frame.multi4 .frame-photo-grid video {
  aspect-ratio: 3 / 4;
}

.print-frame.multi6 .frame-photo-grid video {
  aspect-ratio: 9 / 8;
}

.shared-frame .frame-photo-grid {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.shared-frame .shared-frame-asset {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.frame-tools {
  display: grid;
  gap: 13px;
}

.swatches {
  margin-top: 9px;
  display: flex;
  gap: 10px;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.swatch.active {
  box-shadow: 0 0 0 3px var(--coral);
}

.upload-status {
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f9fa;
  color: var(--muted);
}

.qr-box {
  display: none;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: var(--coral-soft);
}

.qr-box.show {
  display: grid;
}

.qr-box img {
  width: 104px;
  height: 104px;
  border-radius: 12px;
  background: #fff;
}

.qr-box a {
  color: #cc5266;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.download-links {
  display: grid;
  gap: 8px;
}

.stepper {
  margin-top: auto;
  height: var(--stepper-h);
  padding: 9px 16px 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.step {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #868b91;
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.step strong {
  max-width: 100%;
  line-height: 1.25;
  word-break: keep-all;
}

.step span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
}

.step.active {
  color: var(--mint);
}

.step.active span {
  border-color: var(--mint);
  background: var(--mint-soft);
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(40, 47, 54, 0.28);
}

.dialog-card {
  width: min(86vw, 340px);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.dialog-card h2 {
  margin: 0;
}

.dialog-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.dialog-card select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 820px) {
  body {
    background: linear-gradient(90deg, #f7fbfa, #fff8fa);
  }

  .app-shell {
    width: 100vw;
  }

  .type-layout {
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }

  .type-intro,
  .type-note,
  #typeContinueButton {
    grid-column: 1 / -1;
  }

  .timer-layout {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  .type-options {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .select-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1fr);
    grid-template-rows: auto auto minmax(160px, 1fr) minmax(120px, 0.9fr) auto auto;
    gap: 18px;
    align-items: start;
    overflow: hidden;
  }

  .select-layout .section-heading,
  .select-layout .drop-frame,
  .select-layout .photo-grid,
  .select-layout .video-chip,
  .select-layout #toFrameButton {
    grid-column: 2;
  }

  .select-layout .selected-preview {
    position: sticky;
    top: 12px;
    grid-row: 1 / span 5;
  }

  .drop-frame.multi4,
  .drop-frame.multi6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .composer {
    grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1fr) minmax(240px, 1fr);
    align-items: start;
  }

  .frame-tools {
    order: -1;
  }
}

@media (max-height: 760px) {
  .topbar {
    height: 0;
    padding-top: 8px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .type-layout,
  .timer-layout,
  .select-layout,
  #frameScreen {
    padding-top: 10px;
  }

  .type-card {
    min-height: 118px;
    padding: 12px;
  }

  .mini-frame {
    height: 88px;
  }

  .camera-stage {
    height: min(330px, 42vh);
  }

  .shutter {
    width: 106px;
    height: 106px;
    font-size: 40px;
  }

  .capture-actions {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .step strong {
    font-size: 11px;
  }
}

/* Adaptive tablet portrait: iPad 세로형은 두 영역씩 차분하게 쌓습니다. */
@media (min-width: 768px) and (max-width: 1100px) and (orientation: portrait) {
  .app-shell {
    width: 100vw;
  }

  .topbar {
    height: 76px;
  }

  .type-layout {
    grid-template-columns: 1fr 1fr;
    align-content: start;
    padding: 22px 28px 0;
  }

  .type-intro,
  .type-note,
  #typeContinueButton {
    grid-column: 1 / -1;
  }

  .type-options {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timer-layout {
    max-width: 640px;
    margin: 0 auto;
  }

  #captureScreen.active {
    display: grid;
    grid-template-rows: minmax(360px, 1fr) auto;
    overflow: hidden;
  }

  .camera-stage {
    height: auto;
    min-height: 0;
    border-radius: 0 0 28px 28px;
  }

  .capture-panel {
    padding: 18px 28px;
  }

  .select-layout {
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    grid-template-rows: auto auto minmax(260px, 1fr) minmax(120px, 0.65fr) auto auto;
    padding: 22px 28px 0;
    gap: 16px;
  }

  .select-layout .selected-preview {
    grid-row: 1 / span 5;
  }

  .select-layout .section-heading,
  .select-layout .drop-frame,
  .select-layout .photo-grid,
  .select-layout .video-chip,
  .select-layout #toFrameButton {
    grid-column: 2;
  }

  #frameScreen {
    padding: 22px 28px 0;
  }

  .composer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .frame-tools {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

/* Adaptive tablet landscape: iPad 가로형은 미리보기/작업/도구의 3분할에 가깝게 둡니다. */
@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
  .app-shell {
    width: 100vw;
  }

  .type-layout {
    grid-template-columns: 0.85fr 1.4fr 0.85fr;
    align-content: stretch;
    padding: 18px 24px 0;
  }

  .type-intro,
  .type-note {
    grid-column: 1;
  }

  .type-options {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  #typeContinueButton {
    grid-column: 3;
    align-self: end;
  }

  .timer-layout {
    grid-template-columns: 0.9fr 1.2fr 0.9fr;
    align-items: center;
    padding: 22px 24px 0;
  }

  .timer-layout .type-intro {
    grid-column: 1;
  }

  .timer-panel {
    grid-column: 2;
  }

  #timerContinueButton {
    grid-column: 3;
  }

  #captureScreen.active {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.4fr) minmax(220px, 0.8fr);
    gap: 18px;
    padding: 18px 22px 0;
    overflow: hidden;
  }

  #captureScreen .camera-stage {
    grid-column: 2;
    grid-row: 1 / span 3;
    height: 100%;
    min-height: 0;
    border-radius: 24px;
  }

  #captureScreen .capture-panel {
    display: contents;
  }

  #captureScreen .shot-track {
    grid-column: 1;
  }

  #captureScreen .shot-track {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
    align-self: start;
  }

  #captureScreen .capture-actions,
  #captureScreen .center-copy {
    grid-column: 3;
  }

  #captureScreen .capture-actions {
    grid-template-columns: 1fr;
    align-self: center;
    justify-items: center;
  }

  .select-layout {
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.25fr) minmax(220px, 0.8fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 18px 22px 0;
    gap: 16px;
  }

  .selected-preview {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
  }

  .select-layout .section-heading,
  .select-layout .drop-frame,
  .select-layout #toFrameButton {
    grid-column: 3;
  }

  .photo-grid {
    grid-column: 2;
    grid-row: 1 / span 3;
    grid-template-columns: repeat(2, 1fr);
  }

  .drop-frame.multi4,
  .drop-frame.multi6 {
    grid-template-columns: repeat(2, 1fr);
  }

  #frameScreen {
    padding: 18px 22px 0;
  }

  .composer {
    grid-template-columns: minmax(220px, 0.75fr) minmax(260px, 1fr) minmax(260px, 1fr);
    align-items: start;
  }

  .frame-tools {
    order: -1;
  }
}

/* Responsive 16:9 kiosk/monitor: 좌측 정보, 중앙 작업, 우측 도구의 확실한 3분할입니다. */
@media (min-width: 1200px) and (min-aspect-ratio: 16 / 10) {
  body {
    background: #f7fbfa;
  }

  .app-shell {
    width: 100vw;
  }

  .topbar {
    --topbar-h: 0px;
    height: 0;
    grid-template-columns: 120px 1fr 120px;
    padding-inline: 28px;
  }

  .type-layout {
    grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.4fr) minmax(260px, 0.8fr);
    padding: 22px 28px 0;
    gap: 20px;
  }

  .type-intro,
  .type-note {
    grid-column: 1;
  }

  .type-options {
    grid-column: 2;
    grid-row: 1 / span 3;
    grid-template-columns: 1fr;
  }

  #typeContinueButton {
    grid-column: 3;
    align-self: end;
  }

  .timer-layout {
    width: min(680px, calc(100vw - 56px));
    margin: 0 auto;
    grid-template-columns: 1fr;
    place-content: center;
    padding: 0 28px var(--safe-bottom);
  }

  .timer-layout .type-intro {
    grid-column: 1;
    text-align: center;
  }

  .timer-panel {
    grid-column: 1;
  }

  #timerContinueButton {
    grid-column: 1;
  }

  #captureScreen.active {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.6fr) minmax(230px, 0.7fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 22px;
    padding: 14px 28px 0;
    overflow: hidden;
  }

  #captureScreen .camera-stage {
    grid-column: 2;
    grid-row: 1;
    width: min(calc(100vw - 560px), calc((100dvh - var(--topbar-h) - var(--stepper-h) - 32px) * var(--shot-scale)));
    max-width: 100%;
    height: auto;
    align-self: center;
    justify-self: center;
    min-height: 0;
    border-radius: 28px;
  }

  #captureScreen .capture-panel {
    display: contents;
  }

  #captureScreen .shot-track {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, 1fr);
    width: min(100%, calc((100dvh - var(--topbar-h) - var(--stepper-h) - 36px) / 2));
    margin-top: 0;
    align-self: start;
    justify-self: center;
    max-height: calc(100dvh - var(--topbar-h) - var(--stepper-h) - 28px);
    overflow: hidden;
  }

  #captureScreen .capture-actions {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 1fr;
    justify-items: center;
    align-self: center;
  }

  #captureScreen .center-copy {
    grid-column: 3;
    grid-row: 1;
    align-self: end;
  }

  .select-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(430px, 0.88fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 14px 28px 0;
    gap: 20px;
  }

  .selected-preview {
    display: none;
  }

  .select-layout .section-heading {
    grid-column: 1 / span 2;
    grid-row: 1;
    align-self: end;
  }

  .select-layout .drop-frame {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: center;
    width: auto;
    height: min(100%, calc(100dvh - var(--topbar-h) - var(--stepper-h) - 52px));
    aspect-ratio: var(--select-frame-ratio);
    padding: 14px;
    gap: 12px;
    max-width: 100%;
    max-height: calc(100dvh - var(--topbar-h) - var(--stepper-h) - 52px);
    overflow: hidden;
  }

  .select-layout .drop-frame.classic {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    align-content: center;
  }

  .select-layout .drop-frame.multi4 {
    grid-template-rows: repeat(2, auto);
    align-content: center;
  }

  .select-layout .drop-frame.multi6 {
    grid-template-rows: repeat(3, auto);
    align-content: center;
  }

  .select-layout #toFrameButton {
    grid-column: 3;
    grid-row: 3;
    position: static;
    width: 100%;
    align-self: end;
  }

  .photo-grid {
    grid-column: 1 / span 2;
    grid-row: 2 / span 2;
    align-content: stretch;
    justify-content: center;
    align-items: stretch;
    justify-items: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 14px;
    max-height: calc(100dvh - var(--topbar-h) - var(--stepper-h) - 92px);
    overflow: hidden;
  }

  .photo-grid .photo-card {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }

  .drop-frame.multi4,
  .drop-frame.multi6 {
    grid-template-columns: repeat(2, 1fr);
  }

  #frameScreen {
    padding: 22px 28px 0;
  }

  .composer {
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1fr) minmax(360px, 1fr);
    gap: 22px;
    align-items: stretch;
  }

  .frame-tools {
    order: -1;
  }

  .print-frame {
    height: 100%;
    max-height: calc(100dvh - 160px);
  }

  .four-cut-frame {
    width: min(100%, 400px, calc((100dvh - 160px) / 3));
    height: auto;
  }
}

/* Photo and print surfaces stay square so previews match physical prints. */
.mini-frame,
.mini-frame i,
.camera-stage,
.shot-slot,
.selected-preview,
.drop-frame,
.drop-slot,
.photo-card,
.print-frame,
.frame-photo-grid img,
.frame-photo-grid video {
  border-radius: 0;
}
