/* jepreet.in booth UI - optimized for a touch-operated iPad Air in landscape. */

:root {
  --sky-50: #eef9ff;
  --sky-100: #d9f2ff;
  --sky-300: #8fd5ff;
  --sky-500: #2e9bea;
  --navy: #09245b;
  --navy-2: #123678;
  --pink: #ff6f9e;
  --pink-soft: #ffe5ee;
  --yellow: #ffd657;
  --white: #fff;
  --ink: #102450;
  --muted: #617092;
  --line: #cfe7f7;
  --danger: #b42345;
  --success: #198754;
  --shadow: 0 18px 50px rgba(9, 36, 91, 0.13);
  --shadow-small: 0 8px 24px rgba(9, 36, 91, 0.1);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 34px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--sky-50);
  color: var(--ink);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
}

button,
input { font: inherit; }

button { -webkit-touch-callout: none; }

button:focus-visible {
  outline: 4px solid rgba(255, 214, 87, 0.9);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.booth,
.screen { width: 100%; height: 100%; }

.screen { display: none; }

body[data-screen="idle"] .screen[data-for="idle"],
body[data-screen="background"] .screen[data-for="background"],
body[data-screen="capture"] .screen[data-for="capture"],
body[data-screen="review"] .screen[data-for="review"],
body[data-screen="customize"] .screen[data-for="customize"],
body[data-screen="done"] .screen[data-for="done"] { display: flex; }

.screen {
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--sky-500);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.eyebrow--pink { color: var(--pink); }

.button {
  min-height: 54px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: 18px;
  appearance: none;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.button:active { transform: scale(0.975); }
.button:disabled { opacity: 0.45; cursor: default; }

.button--primary {
  border-color: #dbeeff;
  background: var(--sky-500);
  color: var(--white);
  box-shadow: inset 0 -5px 0 rgba(9, 36, 91, 0.16), 0 10px 22px rgba(46, 155, 234, 0.28);
}

.button--navy {
  background: var(--navy);
  color: var(--white);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.15);
}

.button--outline {
  border-color: var(--sky-300);
  background: var(--white);
  color: var(--navy);
}

.button--soft {
  border-color: var(--line);
  background: var(--sky-50);
  color: var(--navy);
}

.button--compact { min-height: 48px; padding: 11px 18px; }

.button--hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 285px;
  min-height: 72px;
  padding: 17px 21px 17px 32px;
  border-radius: 24px;
  font-size: 21px;
}

.button__arrow {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--sky-500);
  font-size: 25px;
  line-height: 1;
}

/* Idle / instructions */

.screen--idle {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vh, 40px);
  padding: max(28px, var(--safe-top)) max(38px, var(--safe-right)) max(28px, var(--safe-bottom)) max(38px, var(--safe-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 17%, rgba(46, 155, 234, 0.14) 0 8px, transparent 9px),
    radial-gradient(circle at 92% 75%, rgba(255, 111, 158, 0.13) 0 7px, transparent 8px),
    linear-gradient(145deg, #c9edff 0%, #f8fdff 47%, #e5f6ff 100%);
}

.welcome-operator-link {
  position: absolute;
  z-index: 6;
  top: max(12px, calc(var(--safe-top) + 8px));
  right: max(12px, calc(var(--safe-right) + 8px));
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(9, 36, 91, .13);
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  color: rgba(9, 36, 91, .48);
  font: 20px/1 Arial, sans-serif;
  text-decoration: none;
  opacity: .62;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.welcome-operator-link:hover,
.welcome-operator-link:focus-visible {
  background: rgba(255, 255, 255, .78);
  color: var(--navy);
  opacity: 1;
}

.welcome-operator-link:focus-visible {
  outline: 3px solid rgba(255, 214, 87, .9);
  outline-offset: 3px;
}

.welcome-operator-link:active { transform: scale(.92); }

.screen--idle::before,
.screen--idle::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  filter: blur(1px);
}

.screen--idle::before { width: 480px; height: 230px; top: -125px; left: 19%; }
.screen--idle::after { width: 420px; height: 210px; right: -150px; bottom: -110px; }

.idle__hero {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1120px, 94vw);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(28px, 4vw, 48px);
  border: 4px solid var(--white);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.idle__hero::after {
  position: absolute;
  content: "";
  inset: 11px;
  border: 2px dashed rgba(46, 155, 234, 0.3);
  border-radius: 24px;
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: clamp(165px, 19vw, 240px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 3.5vw, 44px);
}

.brand-lockup__logo {
  width: 100%;
  filter: drop-shadow(0 10px 15px rgba(9, 36, 91, 0.13));
}

.brand-lockup__copy h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(35px, 4.4vw, 60px);
  font-weight: 900;
  line-height: 0.99;
  letter-spacing: -0.045em;
}

.brand-lockup__copy h1 span { color: var(--sky-500); }

.idle__lead {
  max-width: 520px;
  margin: 17px 0 0;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(16px, 1.6vw, 21px);
  font-weight: 600;
  line-height: 1.5;
}

.idle__actions { position: relative; z-index: 1; text-align: center; }

.idle__note {
  max-width: 250px;
  margin: 13px auto 0;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

.howto {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(980px, 90vw);
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
}

.howto__item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 13px 18px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.howto__number {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 18px;
  box-shadow: 0 5px 0 rgba(9, 36, 91, 0.15);
}

.howto strong,
.howto small { display: block; }
.howto strong { margin-bottom: 3px; font-size: 15px; }
.howto small { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; }

.confetti > * { position: absolute; z-index: 1; }
.confetti__heart { color: var(--pink); font-size: 38px; transform: rotate(-12deg); }
.confetti__heart--one { top: 9%; right: 7%; }
.confetti__heart--two { bottom: 17%; left: 4%; font-size: 25px; transform: rotate(16deg); }
.confetti__star { width: 30px; height: 30px; background: var(--yellow); transform: rotate(45deg); border: 5px solid var(--white); border-radius: 8px; }
.confetti__star--one { top: 13%; left: 5%; }
.confetti__star--two { right: 4%; bottom: 12%; width: 21px; height: 21px; background: var(--sky-500); }
.confetti__dot { width: 17px; height: 17px; border: 5px solid var(--sky-500); border-radius: 50%; }
.confetti__dot--one { left: 8%; bottom: 8%; }
.confetti__dot--two { top: 9%; left: 44%; border-color: var(--pink); }

/* Shared app header */

.app-header {
  display: grid;
  min-height: 92px;
  padding: 14px 28px;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 2fr) minmax(180px, 1fr);
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.app-header__brand img { width: 58px; height: 58px; object-fit: contain; }

.app-header__title { text-align: center; }
.app-header__title h2 { margin: 0; font-size: 24px; line-height: 1.1; }
.app-header__title p { margin: 5px 0 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; }
.app-header > :last-child { justify-self: end; }

.app-header__status {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
}

.app-header--dark {
  position: absolute;
  z-index: 20;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  min-height: 76px;
  grid-template-columns: 80px 1fr 170px;
  border: 0;
  background: linear-gradient(to bottom, rgba(4, 16, 41, 0.84), rgba(4, 16, 41, 0));
}

.app-header--dark .app-header__brand { justify-self: center; color: var(--white); }
.app-header--dark .app-header__brand img { width: 48px; height: 48px; }

.icon-button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(9, 36, 91, 0.54);
  color: var(--white);
  font-family: Arial, sans-serif;
  font-size: 34px;
  font-weight: 300;
  cursor: pointer;
}

/* Background choice */

.screen--background {
  flex-direction: column;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 111, 158, .14), transparent 24%),
    radial-gradient(circle at 86% 82%, rgba(46, 155, 234, .16), transparent 27%),
    linear-gradient(145deg, #f9fdff, #e3f5ff);
}

.background-select-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
}

.background-select-card {
  width: min(1080px, 96vw);
  padding: 28px 32px;
  border: 4px solid var(--white);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.background-select-card__head { margin-bottom: 18px; text-align: center; }
.background-select-card__head h2 { margin: 0; color: var(--navy); font-size: clamp(28px, 3vw, 40px); }
.background-select-card__head > p:last-child { max-width: 680px; margin: 10px auto 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }

.screen--background .background-list {
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-columns: auto;
  grid-auto-flow: row;
  overflow: visible;
}

.screen--background .background-option {
  width: 100%;
  min-height: 154px;
  justify-content: flex-start;
  font-size: 13px;
}

.screen--background .background-option img,
.screen--background .background-option canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.screen--background .background-status { min-height: 20px; margin: 8px 0 0; text-align: center; }
.background-select-actions { display: flex; justify-content: center; margin-top: 12px; }
.background-select-actions .button--hero { min-width: 310px; }

/* Camera */

.screen--capture { position: relative; background: #050d1e; color: var(--white); }

.capture-layout { display: grid; width: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr) clamp(285px, 30vw, 380px); }

.camera-stage { position: relative; min-width: 0; overflow: hidden; background: #071128; }

#video,
#live-background-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#live-background-preview {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  background: #071128;
}

#live-background-preview[hidden] { display: none; }

.camera-stage::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.17), transparent 30%, transparent 73%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.camera-guide { position: absolute; z-index: 2; inset: 19% 22%; pointer-events: none; }
.camera-guide__corner { position: absolute; width: 64px; height: 64px; border-color: rgba(255, 255, 255, 0.9); border-style: solid; }
.camera-guide__corner--tl { top: 0; left: 0; border-width: 4px 0 0 4px; border-radius: 16px 0 0; }
.camera-guide__corner--tr { top: 0; right: 0; border-width: 4px 4px 0 0; border-radius: 0 16px 0 0; }
.camera-guide__corner--bl { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-radius: 0 0 0 16px; }
.camera-guide__corner--br { right: 0; bottom: 0; border-width: 0 4px 4px 0; border-radius: 0 0 16px; }

.capture-badge {
  min-width: 140px;
  padding: 11px 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 6px 18px rgba(255, 111, 158, 0.28);
}

.countdown {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  width: 164px;
  height: 164px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 8px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(46, 155, 234, 0.92);
  color: var(--white);
  font-size: 78px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 12px rgba(46, 155, 234, 0.3), var(--shadow);
  animation: count-pulse 900ms ease-in-out infinite;
}

@keyframes count-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.flash { position: absolute; z-index: 10; inset: 0; pointer-events: none; background: var(--white); opacity: 0; }
.flash.is-firing,
.flash.active { animation: camera-flash 340ms ease-out; }

@keyframes camera-flash { 0% { opacity: 0.98; } 100% { opacity: 0; } }

.camera-error {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 48px;
  background: var(--navy);
  color: #ffdbe6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  text-align: center;
}

.capture-side {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 94px 28px 28px;
  overflow: hidden;
  background: linear-gradient(160deg, #f8fdff, #d9f2ff);
  color: var(--ink);
}

.capture-side::before { position: absolute; content: ""; width: 190px; height: 190px; right: -88px; bottom: -70px; border: 28px solid rgba(46, 155, 234, 0.12); border-radius: 50%; }
.capture-side h2 { margin: 0; font-size: clamp(31px, 3.2vw, 45px); line-height: 1.02; letter-spacing: -0.035em; }
.capture-side p:not(.eyebrow) { margin: 13px 0 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }

.shot-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.shot-strip:empty::before,
.shot-strip:empty::after {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
  border: 3px dashed var(--sky-300);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 105px 0 0 -3px rgba(255, 255, 255, 0.58), 105px 0 0 0 var(--sky-300), 105px 92px 0 -3px rgba(255, 255, 255, 0.58), 105px 92px 0 0 var(--sky-300);
}

.shot-strip > * {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 4px solid var(--white);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  object-fit: cover;
  box-shadow: var(--shadow-small);
}

.shot-strip img,
.shot-strip canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.capture-side__hint { position: relative; z-index: 1; font-size: 12px !important; }
.capture-side__hint span { margin-right: 6px; color: var(--success); }

/* Customize / result */

.screen--review {
  flex-direction: column;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 111, 158, .14), transparent 27%),
    linear-gradient(145deg, #f9fdff, #e5f6ff);
}

.review-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) clamp(310px, 31vw, 390px);
  gap: 24px;
  padding: 24px 30px 30px;
}

.review-photo {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  border: 3px solid var(--white);
  border-radius: var(--radius-lg);
  background: var(--navy);
  box-shadow: var(--shadow);
}

#review-canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #06132e;
}

.review-photo__label {
  position: absolute;
  right: 42px;
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--navy);
  box-shadow: var(--shadow-small);
}

.review-photo__label span { font-size: 13px; font-weight: 900; }
.review-photo__label small { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.review-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-small);
}

.review-panel h3 { margin: 0; font-size: 30px; line-height: 1.05; }
.review-panel p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
.review-actions { display: grid; gap: 10px; }

.retake-list--review { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.retake-list--review > button { min-height: 110px; }
.retake-list > button.is-active,
.retake-list > button[aria-pressed="true"] { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 111, 158, .2); }

.screen--customize { flex-direction: column; background: linear-gradient(150deg, #f6fcff, #e6f7ff); }

.customize-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(310px, 38%) minmax(0, 1fr);
  gap: 24px;
  padding: 20px 28px 24px;
}

.result-preview {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(45deg, rgba(143, 213, 255, 0.22) 25%, transparent 25%, transparent 75%, rgba(143, 213, 255, 0.22) 75%),
    linear-gradient(45deg, rgba(143, 213, 255, 0.22) 25%, #fff 25%, #fff 75%, rgba(143, 213, 255, 0.22) 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  box-shadow: var(--shadow-small);
}

.result-preview__stage {
  height: min(620px, calc(100dvh - 172px));
  max-width: 100%;
  aspect-ratio: 682 / 2400;
  overflow: hidden;
  border: 5px solid var(--white);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 15px 32px rgba(9, 36, 91, 0.24);
}

#result-canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.result-preview > p { margin: 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; }
.result-preview > p span { color: var(--sky-500); }

.customize-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  padding-right: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.control-card,
.save-card {
  flex: 0 0 auto;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-small);
}

.control-card__head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.control-card__step { margin: 0 0 4px; color: var(--sky-500); font-size: 10px; font-weight: 900; letter-spacing: 0.14em; }
.control-card h3,
.save-card h3 { margin: 0; color: var(--navy); font-size: 19px; }
.control-card__hint { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; text-align: right; }
.control-card__description { margin: 8px 0 12px; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; line-height: 1.4; }

.background-list {
  display: grid;
  margin-top: 12px;
  grid-auto-columns: 148px;
  grid-auto-flow: column;
  gap: 11px;
  padding: 3px 4px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.background-list::-webkit-scrollbar { display: none; }

.background-option {
  display: flex;
  width: 148px;
  min-height: 132px;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 3px solid transparent;
  border-radius: 16px;
  background: var(--sky-50);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  scroll-snap-align: center;
  cursor: pointer;
}

.background-option img,
.background-option canvas {
  display: block;
  width: 128px;
  height: 96px;
  border: 3px solid var(--white);
  border-radius: 10px;
  object-fit: cover;
  background: var(--sky-100);
  box-shadow: 0 4px 12px rgba(9, 36, 91, .13);
}

.background-option.is-active,
.background-option[aria-pressed="true"] {
  border-color: var(--pink);
  background: var(--pink-soft);
  box-shadow: 0 0 0 3px rgba(255, 111, 158, .15);
}

.background-option:disabled { cursor: wait; opacity: .58; }
.background-status { min-height: 16px; margin: 1px 4px 0; color: var(--success); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; font-weight: 700; }
.background-status:empty { display: none; }
.background-status.is-error { color: var(--danger); }

.frame-list {
  display: grid;
  margin-top: 14px;
  grid-auto-columns: 88px;
  grid-auto-flow: column;
  gap: 11px;
  padding: 2px 3px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.frame-list > button,
.frame-option,
.frame-card {
  position: relative;
  display: flex;
  width: 88px;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  border: 3px solid transparent;
  border-radius: 15px;
  background: var(--sky-50);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.frame-list > button[aria-pressed="true"],
.frame-option.is-active,
.frame-card.is-active {
  border-color: var(--pink);
  background: var(--pink-soft);
  box-shadow: 0 0 0 3px rgba(255, 111, 158, 0.15);
}

.frame-list img,
.frame-list canvas,
.frame-card__thumb { display: block; width: 52px; height: 72px; border-radius: 4px; object-fit: contain; background: var(--white); }
.frame-card__name { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-card__meta { display: none; }

.retake-list { display: grid; grid-template-columns: repeat(4, minmax(92px, 1fr)); gap: 11px; }

.beauty-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.beauty-option {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--navy);
  text-align: center;
}

.beauty-option canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; background: var(--sky-100); }
.beauty-option strong { font-size: 13px; }
.beauty-option span { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 10px; }
.beauty-option.is-active,
.beauty-option[aria-pressed="true"] { border-color: var(--pink); background: var(--pink-soft); }

.retake-list > button,
.retake-item {
  position: relative;
  min-width: 0;
  min-height: 80px;
  padding: 5px;
  overflow: hidden;
  border: 3px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--sky-100);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.retake-list > button:active,
.retake-item:active { border-color: var(--pink); }

.retake-list img,
.retake-list canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; }

.retake-list > button span,
.retake-item__label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.save-card { display: grid; grid-template-columns: minmax(180px, 0.72fr) minmax(350px, 1.28fr); align-items: center; gap: 18px; border-color: #bfe6ff; background: linear-gradient(125deg, #fff, #e7f7ff); }
.save-card__copy > p:last-child { margin: 6px 0 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; line-height: 1.4; }
.save-actions { display: grid; grid-template-columns: 1fr 1.25fr .75fr .75fr; gap: 9px; }
.save-actions .button { min-width: 0; padding-right: 13px; padding-left: 13px; font-size: 13px; }
.whatsapp-form { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr); gap: 9px; }
#whatsapp-number {
  min-width: 0;
  min-height: 54px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  outline: none;
  appearance: none;
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 700;
  -webkit-user-select: text;
  user-select: text;
}
#whatsapp-number::placeholder { color: var(--muted); opacity: .8; }
#whatsapp-number:focus { border-color: var(--sky-500); box-shadow: 0 0 0 4px rgba(46, 155, 234, .16); }
#whatsapp-number[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 69, .12); }
.whatsapp-form .button { min-width: 0; padding-right: 13px; padding-left: 13px; font-size: 13px; }
.save-feedback { grid-column: 1 / -1; min-height: 16px; margin: -6px 0 0; color: var(--success); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 700; text-align: right; }
.save-feedback:empty { display: none; }
.save-feedback.is-error { color: var(--danger); }

/* Done */

.screen--done {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: max(28px, var(--safe-top)) max(28px, var(--safe-right)) max(28px, var(--safe-bottom)) max(28px, var(--safe-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 214, 87, 0.72) 0 10px, transparent 11px),
    radial-gradient(circle at 83% 25%, rgba(255, 111, 158, 0.52) 0 9px, transparent 10px),
    radial-gradient(circle at 89% 80%, rgba(46, 155, 234, 0.55) 0 9px, transparent 10px),
    linear-gradient(145deg, #cceeff, #f8fdff);
}

.done-card {
  position: relative;
  width: min(700px, 92vw);
  padding: 34px 72px 44px;
  border: 5px solid var(--white);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.done-card::after { position: absolute; content: ""; inset: 12px; border: 2px dashed var(--line); border-radius: 23px; pointer-events: none; }
.done-card > * { position: relative; z-index: 1; }
.done-card__logo { position: absolute; z-index: 2; top: -73px; left: 50%; width: 135px; transform: translateX(-50%); filter: drop-shadow(0 8px 12px rgba(9, 36, 91, 0.15)); }
.done-card__badge { display: grid; width: 82px; height: 82px; margin: 30px auto 18px; place-items: center; border: 7px solid var(--sky-100); border-radius: 50%; background: var(--sky-500); color: var(--white); font-family: Arial, sans-serif; font-size: 45px; font-weight: 900; box-shadow: 0 8px 0 rgba(9, 36, 91, 0.12); }
.done-card h2 { margin: 0; color: var(--navy); font-size: clamp(32px, 4vw, 48px); line-height: 1.05; }
.done-card > p:not(.eyebrow) { max-width: 540px; margin: 18px auto 28px; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }

/* Smaller iPad and portrait safeguards */

@media (max-height: 720px) and (orientation: landscape) {
  .screen--idle { gap: 18px; padding-top: 18px; padding-bottom: 18px; }
  .idle__hero { padding: 24px 32px; }
  .brand-lockup { grid-template-columns: 150px minmax(0, 1fr); }
  .brand-lockup__copy h1 { font-size: 38px; }
  .howto__item { min-height: 68px; }
  .app-header { min-height: 78px; padding-top: 9px; padding-bottom: 9px; }
  .app-header__brand img { width: 50px; height: 50px; }
  .customize-layout { padding-top: 14px; padding-bottom: 14px; }
  .control-card, .save-card { padding: 14px 17px; }
  .frame-list { margin-top: 9px; }
  .frame-list > button, .frame-option, .frame-card { min-height: 99px; }
  .frame-list img, .frame-list canvas, .frame-card__thumb { height: 59px; }
}

@media (orientation: portrait) {
  .background-select-layout { padding: 12px; }
  .background-select-card { padding: 16px 14px; }
  .background-select-card__head { margin-bottom: 10px; }
  .background-select-card__head h2 { font-size: clamp(22px, 4.5vw, 32px); }
  .background-select-card__head > p:last-child { font-size: 13px; margin-top: 6px; }
  .screen--background .background-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100dvh - 260px);
    gap: 10px;
  }
  .screen--background .background-option {
    width: 100%;
    min-height: 110px;
    font-size: 12px;
    padding: 8px 6px;
  }
  .screen--background .background-option img,
  .screen--background .background-option canvas {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .background-select-actions { margin-top: 10px; }
  .background-select-actions .button--hero { min-width: 0; width: 100%; }
  .screen--background .app-header { padding: 10px 14px; }
  .screen--idle { justify-content: center; overflow-y: auto; }
  .idle__hero { grid-template-columns: 1fr; text-align: center; }
  .brand-lockup { grid-template-columns: 150px 1fr; text-align: left; }
  .howto { grid-template-columns: 1fr; }
  .capture-layout { grid-template-columns: 1fr; grid-template-rows: minmax(52%, 1fr) auto; }
  .capture-side { padding: 22px 26px; }
  .capture-side > div:first-child { display: none; }
  .shot-strip { grid-template-columns: repeat(4, 1fr); }
  .app-header { grid-template-columns: 1fr auto; }
  .app-header__title { display: none; }
  .review-layout { grid-template-columns: 1fr; grid-template-rows: minmax(48%, 1fr) auto; }
  .review-panel { padding: 18px; }
  .review-panel > div:first-child { display: none; }
  .retake-list--review { grid-template-columns: repeat(4, 1fr); }
  .review-actions { grid-template-columns: 1fr 1fr; }
  .customize-layout { grid-template-columns: 34% 1fr; padding-right: 16px; padding-left: 16px; }
  .save-card { grid-template-columns: 1fr; }
  .save-actions { grid-template-columns: 1fr; }
  .screen--customize .retake-list { grid-template-columns: repeat(2, 1fr); }
  .beauty-list { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Motion polish and touch-first filter carousel. */
.screen {
  transform-origin: 50% 52%;
  will-change: transform, opacity;
}

body[data-screen="idle"] .screen[data-for="idle"],
body[data-screen="background"] .screen[data-for="background"],
body[data-screen="capture"] .screen[data-for="capture"],
body[data-screen="review"] .screen[data-for="review"],
body[data-screen="customize"] .screen[data-for="customize"],
body[data-screen="done"] .screen[data-for="done"] {
  animation: screen-reveal 460ms cubic-bezier(.2, .85, .25, 1) both;
}

@keyframes screen-reveal {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.screen .app-header {
  animation: header-drop 520ms cubic-bezier(.2, .85, .25, 1) both;
}

@keyframes header-drop {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

.button,
.icon-button,
.background-option,
.frame-option,
.beauty-option,
.retake-list > button {
  transform: translateZ(0);
  transition: transform 160ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:active,
.icon-button:active,
.background-option:active,
.frame-option:active,
.beauty-option:active,
.retake-list > button:active { transform: scale(.955); }

@media (hover: hover) {
  .button:not(:disabled):hover,
  .background-option:not(:disabled):hover,
  .frame-option:hover,
  .beauty-option:hover { transform: translateY(-2px); }
}

body[data-screen="idle"] .brand-lockup__logo {
  animation: logo-float 3.8s ease-in-out 500ms infinite;
}

body[data-screen="idle"] .idle__hero,
body[data-screen="idle"] .howto__item {
  animation: card-rise 620ms cubic-bezier(.2, .85, .25, 1) both;
}

body[data-screen="idle"] .howto__item:nth-child(1) { animation-delay: 100ms; }
body[data-screen="idle"] .howto__item:nth-child(2) { animation-delay: 170ms; }
body[data-screen="idle"] .howto__item:nth-child(3) { animation-delay: 240ms; }

@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1deg); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.camera-guide { animation: guide-breathe 2.2s ease-in-out infinite; }
.camera-guide__corner { filter: drop-shadow(0 0 8px rgba(143, 213, 255, .45)); }

@keyframes guide-breathe {
  0%, 100% { opacity: .72; transform: scale(.99); }
  50% { opacity: 1; transform: scale(1.015); }
}

.countdown {
  animation: countdown-beat 1s cubic-bezier(.16, .85, .3, 1) infinite;
  background: linear-gradient(145deg, rgba(46, 155, 234, .98), rgba(18, 54, 120, .96));
}

@keyframes countdown-beat {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-7deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
  38%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.shot-slot.is-latest {
  animation: shot-land 580ms cubic-bezier(.15, .9, .25, 1) both;
  border-color: var(--pink);
}

@keyframes shot-land {
  0% { opacity: 0; transform: scale(.72) rotate(-4deg); }
  60% { opacity: 1; transform: scale(1.06) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

body[data-screen="review"] .review-photo { animation: preview-arrive 620ms cubic-bezier(.2, .85, .25, 1) 80ms both; }
body[data-screen="review"] .review-panel { animation: panel-arrive 620ms cubic-bezier(.2, .85, .25, 1) 150ms both; }

@keyframes preview-arrive {
  from { opacity: 0; transform: translateX(-22px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes panel-arrive {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

.retake-list > button.is-active canvas,
.retake-list > button[aria-pressed="true"] canvas { transform: scale(1.025); }

.result-preview__stage { transition: transform 240ms ease, box-shadow 240ms ease; }
body[data-screen="customize"] .result-preview__stage { animation: strip-drop 650ms cubic-bezier(.15, .9, .25, 1) both; }
body[data-screen="customize"] .control-card,
body[data-screen="customize"] .save-card { animation: card-rise 520ms cubic-bezier(.2, .85, .25, 1) both; }
body[data-screen="customize"] .control-card:nth-child(1) { animation-delay: 90ms; }
body[data-screen="customize"] .control-card:nth-child(2) { animation-delay: 150ms; }
body[data-screen="customize"] .save-card { animation-delay: 210ms; }

@keyframes strip-drop {
  from { opacity: 0; transform: translateY(-20px) rotate(2deg) scale(.96); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.beauty-list {
  display: grid;
  grid-template-columns: none;
  grid-auto-columns: 118px;
  grid-auto-flow: column;
  gap: 9px;
  margin: 10px -8px 0;
  padding: 8px 14px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.beauty-list::-webkit-scrollbar { display: none; }

.beauty-option {
  position: relative;
  width: 118px;
  min-height: 145px;
  justify-content: flex-start;
  gap: 5px;
  padding: 8px 7px 6px;
  border-color: transparent;
  border-radius: 18px;
  background: transparent;
  scroll-snap-align: center;
  cursor: pointer;
}

.beauty-option canvas {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  aspect-ratio: 1;
  border: 4px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(9, 36, 91, .16);
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1), outline-color 180ms ease, box-shadow 180ms ease;
}

.beauty-option strong { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.beauty-option span { max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.beauty-option.is-active,
.beauty-option[aria-pressed="true"] { border-color: transparent; background: transparent; }

.beauty-option.is-active canvas,
.beauty-option[aria-pressed="true"] canvas {
  outline: 4px solid var(--pink);
  outline-offset: 3px;
  box-shadow: 0 7px 20px rgba(255, 111, 158, .3);
  transform: scale(1.045);
}

.beauty-option::after {
  position: absolute;
  top: 76px;
  right: 10px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--pink);
  color: var(--white);
  content: "✓";
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.5);
  transition: opacity 160ms ease, transform 180ms cubic-bezier(.2, .85, .25, 1);
}

.beauty-option.is-active::after,
.beauty-option[aria-pressed="true"]::after { opacity: 1; transform: scale(1); }

.screen--done::before,
.screen--done::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  content: "";
  animation: celebration-drift 2.4s ease-in-out infinite alternate;
}

.screen--done::before { top: 18%; left: 12%; background: var(--pink); box-shadow: 120px 440px 0 var(--yellow), 740px 40px 0 var(--sky-500), 880px 420px 0 var(--pink); transform: rotate(25deg); }
.screen--done::after { right: 16%; bottom: 16%; background: var(--yellow); box-shadow: -690px -70px 0 var(--sky-500), -450px -410px 0 var(--pink); transform: rotate(-20deg); animation-delay: -1.1s; }
.done-card { animation: done-pop 680ms cubic-bezier(.15, .9, .25, 1) 80ms both; }
.done-card__badge { animation: badge-bounce 1.9s ease-in-out 650ms infinite; }

@keyframes celebration-drift { to { translate: 0 -16px; rotate: 18deg; } }
@keyframes done-pop {
  from { opacity: 0; transform: translateY(25px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes badge-bounce {
  0%, 72%, 100% { transform: translateY(0) scale(1); }
  82% { transform: translateY(-9px) scale(1.05); }
  90% { transform: translateY(0) scale(.98); }
}

@media (orientation: portrait) {
  .beauty-list { grid-template-columns: none; grid-auto-columns: 108px; }
  .beauty-option { width: 108px; }
  .beauty-option canvas { width: 84px; height: 84px; flex-basis: 84px; }
  .beauty-option::after { top: 69px; right: 8px; }
}

/* Portrait iPad layout and front-camera direction cue. */
.camera-position-indicator { display: none; }

@keyframes camera-position-arrow {
  0%, 100% { opacity: .7; transform: translateY(4px) scale(.92); }
  50% { opacity: 1; transform: translateY(-5px) scale(1.08); }
}

@keyframes camera-position-lens {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 111, 158, .55); transform: scale(.9); }
  50% { box-shadow: 0 0 0 9px rgba(255, 111, 158, 0); transform: scale(1.08); }
}

@supports (height: 100dvh) {
  html,
  body,
  .booth,
  .screen { height: 100dvh; }
}

@media (orientation: portrait) {
  .screen--idle {
    gap: clamp(18px, 3vh, 30px);
    padding: max(24px, var(--safe-top)) max(28px, var(--safe-right)) max(24px, var(--safe-bottom)) max(28px, var(--safe-left));
  }

  .idle__hero,
  .howto {
    width: 100%;
    max-width: 720px;
  }

  .idle__hero {
    gap: 22px;
    padding: clamp(24px, 4vw, 34px);
  }

  .brand-lockup {
    grid-template-columns: clamp(105px, 18vw, 135px) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 28px);
  }

  .brand-lockup__copy h1 { font-size: clamp(32px, 5.7vw, 46px); }
  .idle__lead { font-size: clamp(15px, 2.25vw, 18px); }

  .howto {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .howto__item {
    min-width: 0;
    min-height: 76px;
    gap: 9px;
    padding: 11px 12px;
  }

  .howto__number {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 16px;
  }

  .howto strong { font-size: 13px; }
  .howto small { font-size: 10px; line-height: 1.25; }

  .capture-layout {
    height: 100%;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 62%) minmax(0, 38%);
  }

  .app-header--dark {
    min-height: 74px;
    padding: 10px 18px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
  }

  .app-header--dark .app-header__brand {
    opacity: 0;
    pointer-events: none;
  }

  .app-header--dark .icon-button { justify-self: start; }
  .app-header--dark .capture-badge { justify-self: end; }

  .capture-badge {
    min-width: 132px;
    padding: 10px 13px;
    font-size: 13px;
  }

  .camera-stage { min-height: 0; }

  .camera-position-indicator {
    position: absolute;
    z-index: 4;
    top: 82px;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transform: translateX(-50%);
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(2, 12, 33, .35));
  }

  .camera-position-indicator__arrow {
    color: var(--white);
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 900;
    line-height: .8;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
    animation: camera-position-arrow 1.05s ease-in-out infinite;
  }

  .camera-position-indicator__callout {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 9px;
    padding: 7px 13px 7px 10px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    background: rgba(9, 36, 91, .82);
    color: var(--white);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .07em;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .camera-position-indicator__lens {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--pink);
    animation: camera-position-lens 1.3s ease-out infinite;
  }

  .camera-guide {
    inset: clamp(145px, 24%, 182px) 12% 13%;
  }

  .countdown {
    width: 150px;
    height: 150px;
    border-width: 7px;
    font-size: 72px;
  }

  .capture-side {
    min-height: 0;
    justify-content: center;
    gap: 13px;
    padding: 16px 22px max(16px, var(--safe-bottom));
  }

  .shot-strip { gap: 8px; }
  .shot-strip > * { border-width: 3px; border-radius: 11px; }
  .capture-side__hint { margin: 0; text-align: center; }

  .screen--review > .app-header,
  .screen--customize > .app-header {
    min-height: 76px;
    padding: 9px 17px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .screen--review .app-header__brand img,
  .screen--customize .app-header__brand img {
    width: 48px;
    height: 48px;
  }

  .review-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 18px max(16px, var(--safe-bottom));
  }

  .review-photo {
    padding: 14px;
    border-radius: 24px;
  }

  #review-canvas { max-height: none; }

  .review-photo__label {
    right: 26px;
    bottom: 24px;
    padding: 8px 12px;
  }

  .review-panel {
    min-height: 0;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border-radius: 24px;
  }

  .retake-list--review { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .retake-list--review > button { min-height: 88px; }
  .review-actions { gap: 8px; }
  .review-actions .button { min-height: 50px; padding: 12px 14px; font-size: 14px; }

  .customize-layout {
    min-height: 0;
    grid-template-columns: minmax(190px, 32%) minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px max(14px, var(--safe-bottom));
  }

  .result-preview {
    gap: 6px;
    padding: 10px;
    border-radius: 18px;
  }

  .result-preview__stage {
    height: min(760px, calc(100dvh - 136px));
    border-width: 4px;
  }

  .customize-panel { gap: 10px; padding-right: 2px; }
  .control-card,
  .save-card { padding: 14px; border-radius: 18px; }
  .control-card__head { gap: 10px; }
  .control-card__hint { max-width: 130px; }
  .frame-list { margin-top: 9px; }

  .save-card { gap: 12px; }
  .save-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .save-actions .button { min-height: 48px; padding: 11px 9px; font-size: 12px; }
  .save-feedback { text-align: left; }

  .screen--done {
    padding: max(32px, var(--safe-top)) max(24px, var(--safe-right)) max(28px, var(--safe-bottom)) max(24px, var(--safe-left));
  }

  .done-card {
    width: 100%;
    max-width: 680px;
    padding: 34px clamp(34px, 8vw, 64px) 40px;
  }
}

@media (orientation: portrait) and (max-height: 1050px) {
  .screen--idle { gap: 16px; }
  .idle__hero { padding: 22px 26px; }
  .brand-lockup__copy h1 { font-size: 34px; }
  .idle__lead { margin-top: 10px; }
  .button--hero { min-height: 64px; }
  .howto__item { min-height: 68px; }

  .capture-layout { grid-template-rows: minmax(0, 60%) minmax(0, 40%); }
  .camera-guide { inset: 138px 12% 12%; }
  .capture-side { padding-top: 12px; padding-bottom: 12px; }

  .review-layout { grid-template-rows: minmax(0, 1fr) auto; }
  .retake-list--review > button { min-height: 78px; }
  .review-photo__label small { display: none; }

  .control-card__description { margin-top: 6px; margin-bottom: 8px; }
  .beauty-list { padding-bottom: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .camera-position-indicator__arrow,
  .camera-position-indicator__lens { animation: none !important; }
}

/* Welcome emphasis, tap cue, and compact action layout. */
.idle__hero {
  grid-template-areas:
    "logo logo"
    "brand action";
  row-gap: clamp(18px, 3vh, 30px);
}

.brand-lockup__logo {
  position: relative;
  z-index: 1;
  width: clamp(240px, 26vw, 350px);
  grid-area: logo;
  justify-self: center;
}

.brand-lockup {
  grid-area: brand;
  grid-template-columns: minmax(0, 1fr);
}

.idle__actions {
  min-width: 285px;
  grid-area: action;
}

.idle__start-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.idle__start-hand {
  display: inline-block;
  font-size: 31px;
  line-height: 1;
  transform-origin: 50% 20%;
  animation: start-hand-point 1s ease-in-out infinite;
}

@keyframes start-hand-point {
  0%, 100% { transform: translateY(-3px) rotate(-7deg) scale(.96); }
  50% { transform: translateY(8px) rotate(4deg) scale(1.08); }
}

.save-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (orientation: portrait) {
  .idle__hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "logo"
      "brand"
      "action";
    gap: 14px;
    text-align: center;
  }

  .brand-lockup {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .brand-lockup__logo { width: clamp(220px, 42vw, 310px); }
  .idle__lead { margin-right: auto; margin-left: auto; }
  .idle__actions { min-width: min(100%, 285px); justify-self: center; }
}

@media (orientation: portrait) and (max-height: 1050px) {
  .brand-lockup__logo { width: clamp(205px, 36vw, 270px); }
  .idle__start-cue { margin-bottom: 5px; }
}

@media (orientation: landscape) and (max-height: 720px) {
  .brand-lockup__logo { width: clamp(190px, 22vw, 250px); }
  .idle__start-cue { margin-bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .idle__start-hand { animation: none !important; }
}

/* Discoverable customize carousels and Normal/Mirror selector. */
.frame-list {
  scroll-snap-type: x proximity;
  scroll-padding-inline: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--sky-300) transparent;
}
.frame-option { scroll-snap-align: center; }

.choice-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin: 2px 2px 0;
  color: var(--sky-500);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
}
.choice-scroll-cue span { display: inline-block; font-size: 17px; }

.orientation-card { border-color: #ead9ff; background: linear-gradient(125deg, #fff, #f7f0ff); }
.orientation-options { display: grid; margin-top: 12px; grid-template-columns: 1fr 1fr; gap: 10px; }
.orientation-option {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
}
.orientation-option > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: var(--sky-100);
  font-family: Arial, sans-serif;
  font-weight: 900;
}
.orientation-option__mirror { transform: scaleX(-1); }
.orientation-option.is-active,
.orientation-option[aria-pressed="true"] { border-color: var(--pink); background: var(--pink-soft); box-shadow: 0 0 0 3px rgba(255, 111, 158, .14); }

/* AI Style toggle */
.style-mode-card { border-color: #d4edff; background: linear-gradient(125deg, #fff, #eef8ff); }
.style-mode-toggle { display: grid; margin-top: 12px; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-mode-option {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: var(--radius);
  background: var(--white); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: border-color 160ms, background 160ms, box-shadow 160ms;
}
.style-mode-option.is-active,
.style-mode-option[aria-pressed="true"] { border-color: var(--primary); background: #e8f4ff; box-shadow: 0 0 0 3px rgba(46, 155, 234, .14); }
.style-mode-option:disabled { opacity: .6; cursor: wait; }
.style-mode-status { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }

/* A livelier welcome that remains slow, soft, and non-distracting. */
@media (prefers-reduced-motion: no-preference) {
  .screen--idle::before { animation: welcome-orb-left 9s ease-in-out infinite alternate; }
  .screen--idle::after { animation: welcome-orb-right 11s ease-in-out infinite alternate; }
  .screen--idle .confetti > * { animation: welcome-confetti 4.8s ease-in-out infinite alternate; }
  .screen--idle .confetti > *:nth-child(even) { animation-delay: -2.2s; animation-duration: 5.8s; }
  .screen--idle .button--hero { animation: welcome-cta 2.7s ease-in-out infinite; }
  .screen--idle .idle__hero::after { animation: welcome-dash 4s ease-in-out infinite; }
  .choice-scroll-cue span { animation: carousel-cue 1.45s ease-in-out infinite; }
}

@keyframes welcome-orb-left { to { translate: 55px 28px; scale: 1.08; } }
@keyframes welcome-orb-right { to { translate: -48px -24px; scale: .94; } }
@keyframes welcome-confetti { to { translate: 0 -13px; rotate: 8deg; } }
@keyframes welcome-cta {
  0%, 100% { box-shadow: inset 0 -5px 0 rgba(9, 36, 91, .16), 0 10px 22px rgba(46, 155, 234, .28); }
  50% { box-shadow: inset 0 -5px 0 rgba(9, 36, 91, .12), 0 13px 30px rgba(46, 155, 234, .44), 0 0 0 7px rgba(143, 213, 255, .16); }
}
@keyframes welcome-dash { 50% { border-color: rgba(255, 111, 158, .42); } }
@keyframes carousel-cue { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(5px); } }

@media (prefers-reduced-motion: reduce) {
  .screen--idle::before,
  .screen--idle::after,
  .screen--idle .confetti > *,
  .screen--idle .button--hero,
  .screen--idle .idle__hero::after,
  .choice-scroll-cue span { animation: none !important; }
}

/* Landscape-first layout for the fixed iPad holder. */
@keyframes camera-position-arrow-left {
  0%, 100% { opacity: .72; transform: translateX(4px) rotate(-90deg) scale(.92); }
  50% { opacity: 1; transform: translateX(-5px) rotate(-90deg) scale(1.08); }
}

@media (orientation: landscape) {
  .idle__hero {
    grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
    grid-template-areas:
      "logo brand"
      "logo action";
    column-gap: clamp(30px, 5vw, 66px);
    row-gap: 14px;
  }

  .brand-lockup__logo {
    width: clamp(290px, 32vw, 410px);
    align-self: center;
    justify-self: center;
  }
  .brand-lockup { min-width: 0; align-self: end; }
  .brand-lockup__copy h1 { font-size: clamp(36px, 4.1vw, 52px); }
  .idle__lead { max-width: 460px; font-size: clamp(15px, 1.5vw, 19px); }
  .idle__actions {
    width: 100%;
    align-self: start;
    justify-self: stretch;
    text-align: center;
  }
  .idle__actions .button--hero { width: 100%; }

  .camera-position-indicator {
    position: absolute;
    z-index: 4;
    top: 46%;
    left: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    transform: translateY(-50%);
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(2, 12, 33, .38));
  }

  .camera-position-indicator__arrow {
    color: var(--white);
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 900;
    line-height: .8;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
    animation: camera-position-arrow-left 1.05s ease-in-out infinite;
  }

  .camera-position-indicator__callout {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 14px 8px 10px;
    border: 2px solid rgba(255, 255, 255, .92);
    border-radius: 999px;
    background: rgba(9, 36, 91, .86);
    color: var(--white);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .camera-position-indicator__callout > span:last-child { font-size: 0; }
  .camera-position-indicator__callout > span:last-child::after {
    content: "LIHAT CAMERA DISINI YA";
    font-size: 11px;
  }

  .camera-position-indicator__lens {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--pink);
    animation: camera-position-lens 1.3s ease-out infinite;
  }
}

@media (orientation: landscape) and (max-width: 1100px) {
  .screen--idle { gap: 18px; }
  .idle__hero {
    grid-template-columns: minmax(250px, .88fr) minmax(0, 1.12fr);
    column-gap: 28px;
    row-gap: 10px;
    padding: 26px 32px;
  }
  .brand-lockup__logo { width: clamp(250px, 29vw, 300px); }
  .brand-lockup__copy h1 { font-size: 34px; }
  .idle__lead { max-width: 390px; margin-top: 10px; font-size: 14px; }
  .idle__start-cue { margin-bottom: 5px; }
  .button--hero { min-height: 64px; }
  .howto { gap: 10px; }
  .howto__item { min-height: 72px; padding: 10px 13px; }
}

@media (orientation: landscape) and (max-height: 840px) {
  .screen--customize .app-header {
    min-height: 76px;
    padding: 9px 20px;
  }

  .screen--customize .app-header__brand img { width: 48px; height: 48px; }
  .screen--customize .app-header__title h2 { font-size: 21px; }
  .screen--customize .app-header__title p { margin-top: 3px; font-size: 12px; }

  .customize-layout {
    grid-template-columns: minmax(250px, 30%) minmax(0, 1fr);
    gap: 16px;
    padding: 12px 18px 14px;
  }

  .result-preview { gap: 6px; padding: 10px; border-radius: 18px; }
  .result-preview__stage {
    height: min(600px, calc(100dvh - 170px));
    border-width: 4px;
  }
  .result-preview > p { font-size: 11px; }

  .customize-panel { gap: 10px; padding-right: 2px; }
  .control-card,
  .save-card { padding: 13px 15px; border-radius: 18px; }
  .control-card__head { gap: 10px; }
  .control-card h3,
  .save-card h3 { font-size: 17px; }
  .control-card__hint { max-width: 145px; font-size: 10px; }
  .control-card__description { margin: 6px 0 8px; }

  .frame-list { margin-top: 8px; padding-bottom: 5px; }
  .frame-list > button,
  .frame-option,
  .frame-card { min-height: 96px; }
  .frame-list img,
  .frame-list canvas,
  .frame-card__thumb { height: 58px; }
  .choice-scroll-cue { margin-top: 0; font-size: 10px; }

  .beauty-list {
    grid-auto-columns: 108px;
    margin-top: 5px;
    padding-top: 6px;
    padding-bottom: 8px;
  }
  .beauty-option { width: 108px; min-height: 126px; padding-top: 6px; }
  .beauty-option canvas { width: 78px; height: 78px; flex-basis: 78px; }
  .beauty-option::after { top: 62px; right: 8px; }

  .orientation-options { margin-top: 8px; gap: 8px; }
  .orientation-option { min-height: 50px; border-radius: 14px; }
  .orientation-option > span { width: 31px; height: 31px; }

  .save-card {
    grid-template-columns: minmax(150px, .72fr) minmax(0, 1.28fr);
    gap: 12px;
  }
  .save-actions { gap: 8px; }
  .save-actions .button,
  .whatsapp-form .button { min-height: 48px; padding: 11px 9px; font-size: 12px; }
  .whatsapp-form { grid-template-columns: minmax(0, 1fr) minmax(150px, .4fr); gap: 8px; }
  #whatsapp-number { min-height: 48px; padding: 10px 13px; font-size: 15px; }
  .save-feedback { margin-top: -3px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .camera-position-indicator__arrow,
  .camera-position-indicator__lens { animation: none !important; }
}

/* A clear, touch-inviting bounce for the full-width landscape CTA. */
@keyframes welcome-cta-bounce {
  0%, 24%, 72%, 100% {
    translate: 0 0;
    box-shadow: inset 0 -5px 0 rgba(9, 36, 91, .16), 0 10px 22px rgba(46, 155, 234, .28);
  }
  38% {
    translate: 0 -10px;
    box-shadow: inset 0 -5px 0 rgba(9, 36, 91, .12), 0 18px 34px rgba(46, 155, 234, .48), 0 0 0 8px rgba(143, 213, 255, .18);
  }
  50% { translate: 0 0; }
  60% { translate: 0 -4px; }
}

@media (prefers-reduced-motion: no-preference) {
  .screen--idle .idle__actions .button--hero.is-bouncing {
    will-change: translate, box-shadow;
    animation: welcome-cta-bounce 2s cubic-bezier(.3, .75, .3, 1) infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen--idle .idle__actions .button--hero.is-bouncing { animation: none !important; }
}

/* Keep review thumbnails inside the narrow landscape side panel. */
@media (orientation: landscape) {
  .retake-list.retake-list--review {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (orientation: landscape) and (max-height: 840px) {
  .review-panel {
    gap: 12px;
    padding: 18px;
  }

  .retake-list.retake-list--review > button { min-height: 88px; }
  .review-actions { gap: 8px; }
  .review-actions .button {
    min-height: 48px;
    padding: 11px 13px;
    font-size: 13px;
  }
}


/* Operator-only diagnostics and local recovery, enabled with ?operator=1. */
.operator-panel {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, var(--safe-top)) max(24px, var(--safe-right)) max(24px, var(--safe-bottom)) max(24px, var(--safe-left));
  background: rgba(4, 16, 41, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.operator-panel__card {
  width: min(760px, 94vw);
  max-height: 92dvh;
  padding: 26px;
  overflow-y: auto;
  border: 4px solid var(--white);
  border-radius: var(--radius-lg);
  background: var(--sky-50);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.operator-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.operator-panel__header h2 { margin: 0; color: var(--navy); font-size: 28px; }
.operator-panel__close { flex: 0 0 54px; background: var(--navy); }

.operator-status {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.operator-status > div {
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.operator-status dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.operator-status dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.operator-panel__message {
  min-height: 48px;
  margin: 14px 0;
  padding: 12px 15px;
  border-radius: 14px;
  background: var(--white);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.operator-panel__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.operator-panel__actions .button { min-width: 0; padding-right: 12px; padding-left: 12px; }

@media (max-width: 700px), (orientation: portrait) {
  .operator-panel__card { padding: 20px; }
  .operator-status { grid-template-columns: 1fr; }
  .operator-panel__actions { grid-template-columns: 1fr; }
}

/* Token-protected operator asset management. */
.operator-panel__card { width: min(1040px, 94vw); }

.operator-assets-shell {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.operator-assets-shell__header h3,
.operator-asset-card h4 { margin: 0; color: var(--navy); }
.operator-assets-shell__header .eyebrow { margin-bottom: 4px; font-size: 10px; }

.operator-asset-auth { margin-top: 14px; }
.operator-asset-auth > label,
.operator-upload-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.operator-asset-auth__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.operator-asset-auth input,
.operator-upload-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--sky-50);
  color: var(--ink);
  font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: text;
  user-select: text;
}

.operator-asset-auth input:focus,
.operator-upload-form input:focus { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(46, 155, 234, .14); }
.operator-asset-auth small { display: block; margin-top: 7px; color: var(--muted); font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.operator-assets-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.operator-assets-toolbar p { margin: 0; color: var(--muted); font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.operator-assets-toolbar > div { display: flex; gap: 8px; }
.operator-assets-toolbar .button { min-height: 44px; padding: 9px 13px; font-size: 12px; }

.operator-asset-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.operator-asset-card {
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--sky-50);
}
.operator-asset-card > p { min-height: 34px; margin: 6px 0 12px; color: var(--muted); font: 11px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.operator-upload-form { display: grid; gap: 7px; }
.operator-upload-form label { margin: 0; }
.operator-upload-form input[type="file"] { padding: 9px; background: var(--white); font-size: 11px; }
.operator-upload-form .button { min-height: 46px; margin-top: 3px; font-size: 12px; }

.operator-asset-list { display: grid; gap: 8px; margin-top: 14px; }
.operator-asset-list__empty { margin: 0; padding: 12px; border-radius: 12px; background: var(--white); color: var(--muted); font: 11px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: center; }
.operator-asset-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.operator-asset-row.is-disabled { opacity: .72; }
.operator-asset-row__preview {
  display: grid;
  width: 64px;
  height: 64px;
  grid-row: span 2;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  font-size: 8px;
  font-weight: 900;
}
.operator-asset-row__preview--frame { height: 92px; }
.operator-asset-row__preview img { display: block; width: 100%; height: 100%; object-fit: contain; background: #eef4f8; }
.operator-asset-row__preview--background img { object-fit: cover; }
.operator-asset-row__details { min-width: 0; }
.operator-asset-row__details strong,
.operator-asset-row__details span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-asset-row__details strong { color: var(--navy); font-size: 12px; }
.operator-asset-row__details span { margin-top: 4px; color: var(--muted); font: 10px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.operator-asset-row__actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-self: end; }
.operator-asset-row__actions .button { min-height: 36px; padding: 7px 9px; border-radius: 11px; font-size: 10px; }
.operator-asset-delete { color: var(--danger); }
.operator-asset-message { margin-bottom: 0; }
.operator-asset-message.is-error { color: var(--danger); background: #fff1f4; }

@media (max-width: 760px), (orientation: portrait) {
  .operator-asset-auth__controls,
  .operator-asset-columns { grid-template-columns: 1fr; }
  .operator-assets-toolbar { align-items: stretch; flex-direction: column; }
  .operator-assets-toolbar > div { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Operator sessions, friendly status helpers, and pre-capture alignment. */
.capture-alignment {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 2px solid var(--sky-300);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-small);
}
.capture-alignment .eyebrow,
.capture-alignment h3,
.capture-alignment p { margin: 0; }
.capture-alignment h3 { color: var(--navy); font-size: 22px; line-height: 1.1; }
.capture-alignment p:not(.eyebrow) { color: var(--muted); font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.capture-alignment .button { width: 100%; min-height: 58px; }
body[data-capture-phase="alignment"] .capture-side { justify-content: center; }
body[data-capture-phase="alignment"] .shot-strip,
body[data-capture-phase="alignment"] .capture-side__hint { display: none; }

.operator-status > div > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 10px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#operator-countdown {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--sky-50);
  color: var(--navy);
  font: 700 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#operator-countdown:disabled { opacity: .55; }
.operator-login-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.operator-login-fields label {
  color: var(--muted);
  font: 800 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.operator-login-fields input { display: block; margin-top: 5px; }
.operator-asset-auth > .button { width: 100%; margin-top: 9px; }

@media (orientation: portrait) {
  body[data-capture-phase="alignment"] .capture-layout {
    grid-template-rows: minmax(0, 58%) minmax(250px, 42%);
  }
  body[data-capture-phase="alignment"] .capture-side {
    display: flex;
    padding: 12px 18px max(14px, var(--safe-bottom));
    overflow-y: auto;
  }
  body[data-capture-phase="alignment"] .capture-side > div:first-child { display: none; }
  .capture-alignment { flex: 0 0 auto; padding: 15px; }
  .capture-alignment h3 { font-size: 20px; }
  .capture-alignment .button { min-height: 54px; }
  .operator-login-fields { grid-template-columns: 1fr; }
}

@media (orientation: portrait) and (max-height: 820px) {
  body[data-capture-phase="alignment"] .capture-layout {
    grid-template-rows: minmax(0, 54%) minmax(245px, 46%);
  }
  .capture-alignment { gap: 7px; padding: 12px; }
  .capture-alignment h3 { font-size: 18px; }
  .capture-alignment .button { min-height: 50px; }
}
