.site-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:12px 24px; padding:24px 16px; color:var(--muted); font-family:inherit; }
.site-footer small,.site-footer a { font-size:13px; }
.site-footer a { color:var(--muted); text-underline-offset:4px; }
@media print { .site-footer { display:none!important; } }
@media(max-width:500px) { .site-footer { flex-direction:column; gap:8px; } }
.frame-gallery { width: min(960px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.frame-gallery::backdrop { background: rgba(7, 19, 40, .55); }
.frame-gallery[open] { display: flex; flex-direction: column; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.gallery-header h2 { font-size: 1.48rem; margin: 0; word-break: keep-all; }
.gallery-header button { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--radius-control); color: var(--text); background: var(--background); }
.gallery-content { overflow-y: auto; min-height: 0; padding: 24px; overscroll-behavior: contain; }
.gallery-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.gallery-categories button, .gallery-back { min-height: 48px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-weight: 700; }
.gallery-categories button[aria-pressed="true"] { background: var(--primary); color: white; border-color: var(--primary); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gallery-grid > button { min-width: 0; padding: 8px; background: var(--background); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-small); }
.gallery-grid > button:hover { border-color: var(--primary); }
.gallery-grid b { display: block; padding: 12px 0 4px; font-size: .93rem; word-break: keep-all; }
.frame-gallery .frame-stage { display: block; width: 100%; height: auto; border: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.frame-gallery .frame-canvas { width: 100%; height: auto; max-height: none; box-shadow: none; }
.gallery-detail { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gallery-back { display: flex; align-items: center; gap: 8px; align-self: flex-start; }
.gallery-large { width: min(320px, 100%); }
.gallery-detail .primary-action { width: min(320px, 100%); }
.frame-gallery button { cursor: pointer; }
.frame-gallery button:focus-visible, .landing-browse:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.landing-controls { flex-direction: column; align-items: center; gap: 12px; }
.landing-browse { min-height: 48px; padding: 8px 16px; border: 0; border-radius: var(--radius-control); color: var(--text); background: transparent; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.landing-browse:hover { background: var(--surface-strong); }
@media (max-width: 720px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gallery-content { padding: 16px; } .gallery-header { padding: 12px 16px; } .gallery-header h2 { font-size: 1.12rem; } }
.frame-gallery .photo-slot > svg { display: block; width: 100%; height: 100%; }
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-bold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

.photo-landing {
  --landing-bg: var(--background);
  --landing-ink: var(--text);
  --landing-muted: var(--muted);
  --landing-line: var(--line);
  --landing-action-ink: #ffffff;
  --landing-controls-width: 470px;
  --landing-action-width: 230px;
  min-height: 100svh;
  background: var(--landing-bg);
  color: var(--landing-ink);
}

.landing-shell {
  width: min(1380px, calc(100% - 112px));
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}



.landing-hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  grid-template-areas: "intro sample" "controls sample";
  align-content: center;
  column-gap: 28px;
  row-gap: 32px;
  padding: 52px 0 44px;
}

.landing-intro { grid-area: intro; align-self: end; width: 100%; max-width: var(--landing-controls-width); }
/* Display the artwork bounds (94, 100, 1976, 547), excluding PNG padding. */
.landing-logo { position: absolute; display: block; width: calc(100% * 2162 / 1976); max-width: none; height: auto; left: calc(-100% * 94 / 1976); top: calc(-100% * 100 / 547); }
.landing-intro h1 { position: relative; overflow: hidden; aspect-ratio: 1976 / 547; margin: 0; font-size: clamp(48px, 5.5vw, 76px); line-height: 1.13; letter-spacing: -.055em; font-weight: 900; word-break: keep-all; }
.landing-sample { grid-area: sample; align-self: center; min-width: 0; margin: 0 -24px 0 -12px; text-align: center; }
.landing-sample img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.landing-controls { grid-area: controls; width: 100%; max-width: var(--landing-controls-width); align-self: start; display: flex; justify-content: center; }
.landing-start { display: flex; align-items: center; justify-content: center; gap: 16px; width: var(--landing-action-width); min-height: 68px; margin-top: 4px; padding: 12px 24px; border: 0; border-radius: var(--radius-pill); background: var(--primary); color: var(--landing-action-ink); cursor: pointer; box-shadow: var(--shadow-primary); transition: transform 160ms ease, background-color 160ms ease; }
.landing-start span { font-family: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif; font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: 0.035em; }
.landing-start svg { width: 32px; height: 32px; stroke-width: 2; }
.landing-start:hover { background: var(--primary-strong); transform: translateY(-1px); }
.landing-start:active { transform: scale(0.98); }
.landing-start:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }

@media (min-width: 901px) and (max-height: 800px) {
  .landing-hero { padding-block: 28px; row-gap: 22px; }
  .landing-intro h1 { font-size: 60px; }
}

@media (max-width: 1100px) {
  .landing-shell { width: calc(100% - 64px); }
  .landing-hero { column-gap: 12px; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); }
}

@media (max-width: 900px) {
  .landing-shell { width: min(640px, calc(100% - 40px)); }
  .landing-hero { grid-template-columns: 1fr; grid-template-areas: "intro" "sample" "controls"; padding: 28px 0; row-gap: 20px; }
  .landing-intro { text-align: center; justify-self: center; }
  .landing-intro h1 { font-size: 44px; }
  .landing-sample { width: min(100%, 460px); justify-self: center; margin: -8px 0 0; }
  .landing-controls { justify-self: center; }
}

@media (max-width: 480px) {
  .landing-shell { width: calc(100% - 32px); }
  .landing-hero { padding: 24px 0; row-gap: 16px; }
  .landing-intro h1 { font-size: 38px; }
  .landing-sample { width: 290px; max-width: 100%; }
  .landing-start { width: 210px; min-height: 64px; margin-top: 2px; gap: 20px; }
  .landing-start span { font-size: 1.55rem; }
  .landing-start svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-start { transition: none; }
  .landing-start:hover, .landing-start:active { transform: none; }
}

.landing-controls { flex-direction: column; align-items: center; gap: 16px; }
.landing-start span { font-family: inherit; font-size: 1.48rem; letter-spacing: -.02em; }
.landing-create { display: grid; justify-items: center; gap: 8px; width: 100%; }
.landing-create .secondary-action { width: var(--landing-action-width); }
.landing-create small { color: var(--muted); text-align: center; line-height: 1.5; word-break: keep-all; }
@font-face {
  font-family: "Pretendard";
  src: url("/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family:
    "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--background);
  color: #1e2f4d;
  --radius-small: 12px;
  --radius-control: 18px;
  --radius-panel: 28px;
  --radius-pill: 999px;
  --background: #f7faff;
  --surface: #ffffff;
  --surface-strong: #eaf2ff;
  --text: #1e2f4d;
  --muted: #62718a;
  --line: #dce6f3;
  --line-strong: #b8c8df;
  --primary: #2764db;
  --primary-rgb: 39, 100, 219;
  --primary-strong-rgb: 27, 79, 181;
  --primary-strong: #1b4fb5;
  --accent: #f97316;
  --success: #0f9f6e;
  --danger: #b42318;
  --shadow: 0 8px 32px rgba(30, 47, 77, 0.04);
  --ink-soft: #344054;
  --ink-deep: #071328;
  --surface-soft: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --surface-glass-strong: rgba(255, 255, 255, 0.96);
  --deep-overlay: rgba(7, 19, 40, 0.8);
  --primary-border: rgba(var(--primary-rgb), 0.18);
  --focus-ring: var(--primary);
  --shadow-soft: 0 4px 16px rgba(30, 47, 77, 0.04);
  --shadow-primary: 0 4px 16px rgba(var(--primary-rgb), 0.08);
  --welcome-ink: #071328;
  --welcome-coral: #ff634f;
  --welcome-blue: #70a9f6;
  --welcome-teal: #64c4ad;
  --welcome-red: #ff7568;
  --welcome-panel: rgba(255, 255, 255, 0.9);
  --welcome-soft: rgba(248, 250, 252, 0.94);
  --welcome-border: rgba(148, 163, 184, 0.26);
  --welcome-shadow: 0 20px 54px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: var(--background);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

svg {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.welcome-screen,
.booth-screen,
.result-screen {
  min-height: 100vh;
}

.welcome-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(620px, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  align-content: center;
  justify-content: center;
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  padding: clamp(22px, 3.2vw, 44px) max(20px, calc((100vw - 1500px) / 2));
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.96) 48%, rgba(255, 255, 255, 0.98)),
    linear-gradient(120deg, #f9fbff 0%, #fff8ef 100%);
}

.welcome-screen::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.8) 40%, rgba(255, 255, 255, 0.96) 64%),
    radial-gradient(circle at 22% 88%, rgba(var(--primary-rgb), 0.08), transparent 28%),
    radial-gradient(circle at 96% 10%, rgba(249, 115, 22, 0.08), transparent 26%);
  content: "";
}

.welcome-copy {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-left: clamp(0px, 1.6vw, 28px);
}

.welcome-kicker {
  width: fit-content;
  margin-bottom: 18px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.9);
  padding: 9px 12px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
}

.welcome-copy h1 {
  display: grid;
  gap: 4px;
  margin: 0;
  max-width: 590px;
  font-size: clamp(4.2rem, 6.7vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--welcome-ink);
  text-shadow: 0 5px 18px rgba(3, 11, 43, 0.08);
  word-break: keep-all;
}

.welcome-copy h1 span:last-child {
  color: var(--welcome-coral);
}

.welcome-copy p {
  max-width: 520px;
  margin: 32px 0 0;
  font-size: clamp(1.06rem, 1.45vw, 1.42rem);
  font-weight: 700;
  line-height: 1.55;
  color: #17243d;
  word-break: keep-all;
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-control);
  padding: 0 22px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.primary-action {
  min-height: 74px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.12);
  font-size: 1.35rem;
}

.primary-action:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled,
.ghost-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary-action.wide {
  width: 100%;
}

.secondary-action {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.secondary-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ghost-action {
  min-height: 48px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.ghost-action:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.ghost-action.compact {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.95rem;
}

.welcome-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  margin-top: 34px;
}

.flow-step {
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--welcome-border);
  border-radius: 8px;
  background: var(--welcome-panel);
  padding: 14px;
  color: #15254c;
  box-shadow: 0 4px 16px rgba(30, 47, 77, 0.04);
}

.flow-step svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.flow-step strong {
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.1;
}

.flow-step small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.25;
  word-break: keep-all;
}

.welcome-theme-list {
  grid-column: 2;
  display: grid;
  min-width: 0;
  gap: 16px;
  align-self: center;
}

.featured-theme-card,
.theme-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--welcome-border);
  border-radius: 8px;
  background: var(--welcome-panel);
  color: var(--text);
  box-shadow: var(--welcome-shadow);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.featured-theme-card {
  display: grid;
  grid-template-columns: 72px minmax(280px, 1fr) minmax(210px, 0.72fr) 42px;
  align-items: center;
  gap: 18px;
  min-height: 280px;
  padding: 28px 24px 28px 30px;
}

.featured-theme-card::before,
.theme-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 12px;
  background: var(--welcome-blue);
  content: "";
}

.featured-theme-card.theme-card-primary {
  border-color: rgba(112, 169, 246, 0.36);
}

.theme-card-seasonal::before {
  background: var(--accent);
}

.theme-card-teachers::before {
  background: var(--welcome-red);
}

.theme-card-digital::before {
  background: var(--welcome-teal);
}

.featured-theme-card:hover,
.theme-card:hover {
  border-color: var(--primary);
  box-shadow: 0 24px 70px rgba(var(--primary-rgb), 0.2);
  transform: translateY(-2px);
}

.theme-card-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--welcome-blue);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(var(--primary-rgb), 0.24);
}

.theme-card-icon svg {
  width: 31px;
  height: 31px;
  stroke-width: 2.3;
}

.theme-card-seasonal .theme-card-icon {
  background: var(--accent);
  box-shadow: 0 14px 24px rgba(249, 115, 22, 0.2);
}

.theme-card-teachers .theme-card-icon {
  background: var(--welcome-red);
  box-shadow: 0 14px 24px rgba(255, 117, 104, 0.24);
}

.theme-card-digital .theme-card-icon {
  background: var(--welcome-teal);
  box-shadow: 0 14px 24px rgba(100, 196, 173, 0.24);
}

.theme-card-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.theme-card-label {
  width: fit-content;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.94);
  padding: 7px 9px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 950;
  line-height: 1;
}

.theme-card-title {
  font-size: clamp(1.48rem, 1.7vw, 1.86rem);
  font-weight: 950;
  line-height: 1.05;
  text-wrap: balance;
  word-break: keep-all;
}

.theme-card-meta {
  color: #475569;
  font-size: 1.04rem;
  font-weight: 900;
}

.theme-card-description {
  max-width: 330px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1.42;
  word-break: keep-all;
}

.theme-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-card-tags span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 8px;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.welcome-preview {
  display: grid;
  min-width: 0;
  align-items: stretch;
  gap: 8px;
}

.welcome-preview-featured {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-card-arrow {
  justify-self: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(112, 169, 246, 0.16);
  color: #3b82f6;
  padding: 8px;
}

.featured-theme-card .theme-card-arrow {
  display: none;
}

.theme-card-seasonal .theme-card-arrow {
  background: rgba(249, 115, 22, 0.14);
  color: var(--accent);
}

.theme-card-teachers .theme-card-arrow {
  background: rgba(255, 117, 104, 0.15);
  color: #ef5f53;
}

.theme-card-digital .theme-card-arrow {
  background: rgba(100, 196, 173, 0.16);
  color: #39a98f;
}

.welcome-preview img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 7px;
  background: #ffffff;
  filter: drop-shadow(0 12px 14px rgba(15, 23, 42, 0.12));
}

.theme-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 76px;
  grid-template-rows: auto auto;
  gap: 12px;
  align-items: center;
  min-height: 188px;
  padding: 18px 16px 16px 22px;
}

.theme-card .theme-card-icon {
  width: 46px;
  height: 46px;
}

.theme-card .theme-card-icon svg {
  width: 23px;
  height: 23px;
}

.theme-card .theme-card-copy {
  grid-column: 2 / span 2;
}

.theme-card .theme-card-title {
  font-size: 1.12rem;
  line-height: 1.18;
}

.theme-card .theme-card-meta {
  font-size: 0.82rem;
}

.theme-card .theme-card-description {
  display: none;
}

.theme-card .theme-card-tags span {
  min-height: 24px;
  font-size: 0.68rem;
}

.theme-card .welcome-preview {
  grid-column: 1 / span 2;
  grid-row: 2;
  justify-self: start;
  width: 58px;
}

.theme-card .theme-card-arrow {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

.welcome-privacy-note {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--welcome-border);
  border-radius: 8px;
  background: var(--welcome-soft);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
}

.booth-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1680px, calc(100vw - 24px));
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  padding: 14px 0;
}

.booth-header {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 128px;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.booth-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.3vw, 2.8rem);
  line-height: 1.05;
}

.booth-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.shot-progress {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px 14px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(36, 48, 76, 0.08);
}

.booth-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1fr) minmax(430px, 500px);
  gap: 14px;
  min-height: 0;
  align-items: stretch;
}

.frame-stage {
  display: grid;
  min-height: 0;
  height: 100%;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 251, 0.88)),
    radial-gradient(circle at 18% 20%, rgba(var(--primary-rgb), 0.09), transparent 30%);
  box-shadow: var(--shadow);
  padding: 12px;
}

.frame-canvas {
  position: relative;
  aspect-ratio: 2 / 3;
  height: 100%;
  max-height: 860px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0;
  background: #e2e8f0;
  box-shadow: var(--shadow-soft);
}

.photo-slot {
  position: absolute;
  overflow: hidden;
  border-radius: 0;
  background: #111827;
  z-index: 1;
}

.background-frame .photo-slot {
  border-radius: 0;
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.18),
    0 0 0 8px rgba(255, 255, 255, 0.76),
    0 16px 34px rgba(15, 23, 42, 0.2);
}

.photo-slot img,
.live-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-video {
  transform: scaleX(-1);
}

.empty-slot {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.56);
  font-size: clamp(2rem, 5vw, 5.5rem);
  font-weight: 950;
}

.frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.frame-foreground {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.frame-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(14px, 5%, 28px);
  background: transparent;
  pointer-events: none;
}

.countdown-overlay span {
  display: grid;
  width: auto;
  height: auto;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: clamp(2.75rem, 7vw, 5.75rem);
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 3px 10px rgba(15, 23, 42, 0.62),
    0 0 2px rgba(15, 23, 42, 0.8);
}

.control-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.panel-section,
.capture-actions,
.error-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(36, 48, 76, 0.08);
  padding: 12px;
}

.panel-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.2;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.panel-heading-row h2 {
  margin: 0;
}

.panel-heading-row span,
.progress-pill {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.frame-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-pill {
  display: inline-flex;
  min-width: 82px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--primary);
}

.priority-actions {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
}

.capture-primary {
  min-height: clamp(58px, 8.2vh, 74px);
}

.settings-panel {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.settings-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.locked-settings-tabs {
  grid-template-columns: 1fr;
}

.settings-tabs button {
  display: grid;
  min-height: 62px;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  cursor: pointer;
}

.settings-tabs button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.settings-tabs span {
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1.1;
}

.settings-tabs small {
  overflow: hidden;
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.setting-pane {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
}

.setting-pane-heading {
  flex: 0 0 auto;
}

.large-frame-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  flex: 1 1 auto;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.selected-frame-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
  padding: 12px;
}

.selected-frame-copy {
  min-width: 0;
}

.frame-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.94);
  padding: 0 8px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.selected-frame-copy h3 {
  margin: 8px 0 0;
  font-size: 1rem;
  line-height: 1.2;
  word-break: keep-all;
}

.frame-description {
  margin: 6px 0 0;
  color: #344054;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.frame-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.frame-meta-chips span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 8px;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.selected-frame-preview {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.selected-frame-preview img {
  width: 100%;
  max-width: 108px;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 6px;
  background: #e5e7eb;
}

.frame-grid-hint {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.4;
}

.large-frame-grid .frame-card {
  gap: 7px;
  padding: 8px;
}

.large-frame-grid .frame-card img {
  height: clamp(114px, 17.5vh, 148px);
}

.large-frame-grid .frame-card span {
  min-height: 30px;
  font-size: 0.82rem;
}

.cut-card-grid {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cut-card-grid button {
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
}

.cut-card-grid button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cut-card-grid strong {
  font-size: clamp(3rem, 7vh, 5.2rem);
  line-height: 0.95;
}

.cut-card-grid span {
  margin-top: -10px;
  font-size: 1rem;
  font-weight: 950;
}

.large-layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  flex: 1 1 auto;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.large-layout-grid .layout-card {
  gap: 8px;
  padding: 9px;
}

.large-layout-grid .layout-miniature {
  height: clamp(100px, 15.5vh, 136px);
  aspect-ratio: auto;
}

.large-layout-grid .layout-card > span:last-child {
  min-height: 26px;
  font-size: 0.84rem;
}

.segmented,
.mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mode-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-mode {
  gap: 7px;
}

.segmented button,
.mode-switch button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #f8fafc;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.selected,
.mode-switch button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.frame-card {
  display: grid;
  gap: 5px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px;
  color: var(--text);
  cursor: pointer;
}

.layout-card {
  display: grid;
  gap: 5px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px;
  color: var(--text);
  cursor: pointer;
}

.frame-card.selected {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.layout-card.selected {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.frame-card img {
  width: 100%;
  height: clamp(58px, 8.8vh, 78px);
  object-fit: contain;
  border-radius: 5px;
  background: #e5e7eb;
}

.frame-section {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.cut-count-section,
.layout-section {
  flex: 0 0 auto;
  overflow: hidden;
}

.frame-section .frame-grid {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 3px;
}

.layout-miniature {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  background: #1e2f4d;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.layout-miniature span {
  position: absolute;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.42);
}

.frame-card span {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
}

.layout-card > span:last-child {
  min-height: 22px;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.2;
}

.compact-layout-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.compact-layout-grid .layout-card {
  flex: 0 0 98px;
}

.compact-layout-grid .layout-miniature {
  height: clamp(44px, 7.2vh, 64px);
  aspect-ratio: auto;
}

.upload-button {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcff;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 950;
  cursor: pointer;
}

.compact-upload {
  width: auto;
  min-height: 30px;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 9px;
  font-size: 0.78rem;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.adjustment-panel {
  background: #fff9f2;
}

.slider-control {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.slider-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 900;
}

.slider-control strong {
  color: var(--accent);
}

.slider-control input {
  width: 100%;
  accent-color: var(--accent);
}

.error-message {
  margin: 0;
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff1f0;
  color: var(--danger);
  font-weight: 600;
  line-height: 1.45;
}

.result-screen {
  display: grid;
  grid-template-columns: minmax(360px, 0.76fr) minmax(320px, 0.64fr);
  gap: 34px;
  align-items: center;
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 36px 0;
}

.result-preview {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.result-preview img {
  width: min(100%, 560px);
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 0;
  box-shadow: var(--shadow-soft);
}

.result-actions h1 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  line-height: 1.2;
  font-weight: 800;
}

.result-actions p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.55;
}

.result-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.qr-share-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 72px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
}

.qr-share-panel.idle,
.qr-share-panel.uploading,
.qr-share-panel.error {
  grid-template-columns: 1fr;
}

.qr-share-panel.error {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff1f0;
  color: var(--danger);
}

.qr-share-panel img {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.qr-share-panel strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.3;
}

.qr-share-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.45;
}

.qr-share-panel a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 950;
  text-decoration: none;
}

.print-sheet {
  display: none;
}

@media (max-width: 1120px), (max-height: 680px) {
  .welcome-screen,
  .result-screen,
  .booth-layout {
    grid-template-columns: 1fr;
  }

  .welcome-screen {
    height: auto;
    min-height: 100dvh;
    align-content: start;
    overflow: visible;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.94) 48%, rgba(255, 255, 255, 0.98) 100%),
      linear-gradient(120deg, #f9fbff 0%, #fff8ef 100%);
  }

  .welcome-copy,
  .welcome-theme-list {
    grid-column: 1;
  }

  .booth-screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .welcome-preview {
    max-width: 760px;
  }

  .featured-theme-card {
    grid-template-columns: 72px minmax(280px, 1fr) minmax(180px, 0.62fr) 42px;
    min-height: 240px;
  }

  .control-panel {
    height: auto;
    overflow: visible;
  }

  .frame-section .frame-grid {
    overflow: visible;
  }

  .frame-canvas {
    width: min(100%, 560px);
    height: auto;
  }
}

@media (max-width: 720px) {
  .welcome-screen,
  .result-screen,
  .booth-screen {
    width: min(100vw - 24px, 100%);
  }

  .welcome-screen {
    width: 100%;
    padding: 22px 12px 30px;
  }

  .welcome-copy h1 {
    max-width: 420px;
    font-size: clamp(3.15rem, 15vw, 4.8rem);
  }

  .welcome-copy p {
    margin-top: 24px;
  }

  .welcome-flow {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 24px;
  }

  .flow-step {
    min-height: 62px;
    grid-template-columns: auto minmax(0, 0.34fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .welcome-theme-list {
    max-height: none;
    overflow: visible;
  }

  .featured-theme-card {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 14px;
    padding: 20px 18px;
  }

  .featured-theme-card .theme-card-icon,
  .featured-theme-card .theme-card-arrow {
    display: none;
  }

  .featured-theme-card .welcome-preview-featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 260px;
  }

  .theme-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 1px 2px 6px;
    scroll-snap-type: x proximity;
  }

  .theme-card {
    grid-template-columns: 1fr;
    flex: 0 0 min(82vw, 320px);
    min-height: 0;
    gap: 10px;
    padding: 18px;
    scroll-snap-align: start;
  }

  .theme-card > .theme-card-icon,
  .theme-card > .theme-card-arrow {
    display: none;
  }

  .theme-card-title,
  .theme-card-meta,
  .theme-card-description,
  .theme-card-tags,
  .theme-card .welcome-preview {
    grid-column: 1;
    grid-row: auto;
  }

  .selected-frame-spotlight {
    grid-template-columns: 1fr;
  }

  .selected-frame-preview {
    max-width: 180px;
  }

  .theme-card .welcome-preview {
    grid-template-columns: 1fr;
  }

  .welcome-preview img {
    max-height: 130px;
  }

  .booth-header {
    grid-template-columns: 1fr;
  }

  .shot-progress {
    width: 100%;
  }

  .frame-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-button-row {
    display: grid;
  }

  .qr-share-panel {
    grid-template-columns: 1fr;
  }

  .qr-share-panel img {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html,
  body,
  #root {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  body {
    background: #ffffff;
  }

  body * {
    visibility: hidden;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible;
  }

  .print-sheet {
    position: fixed;
    inset: 0;
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10mm;
    padding: 0;
    background: #ffffff;
  }

  .print-copy {
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
    outline: 0.2mm dashed #cbd5e1;
    outline-offset: -0.8mm;
    break-inside: avoid;
  }

  .print-copy img {
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}

.start-screen,
.workflow-screen {
  width: min(1500px, calc(100vw - 48px));
  min-height: 100dvh;
  margin: 0 auto;
}

.start-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding: 40px 0;
}

.start-copy h1 {
  margin: 16px 0;
  color: var(--welcome-ink);
  font-size: clamp(4.2rem, 9vw, 8.5rem);
  font-weight: 950;
  line-height: 0.88;
}

.start-copy > p {
  max-width: 680px;
  margin: 0;
  color: #344054;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.5;
  word-break: keep-all;
}

.start-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.start-steps li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-glass);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.start-steps svg {
  width: 28px;
  color: var(--primary);
}

.start-steps span,
.start-steps b,
.start-steps small {
  display: block;
}

.start-steps b {
  font-size: 1rem;
}

.start-steps small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.start-card {
  border: 1px solid var(--primary-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(112, 169, 246, 0.28), transparent 42%),
    var(--surface-glass-strong);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 30px 80px rgba(30, 64, 175, 0.18);
}

.start-lens {
  display: grid;
  width: 132px;
  height: 132px;
  margin: 0 auto 24px;
  place-items: center;
  border: 14px solid var(--text);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--welcome-blue), var(--primary-strong) 56%, var(--ink-deep));
  box-shadow: 0 16px 34px rgba(var(--primary-strong-rgb), 0.3), inset 0 0 0 8px rgba(255,255,255,0.18);
}

.start-lens span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  filter: blur(1px);
  transform: translate(-14px, -14px);
}

.start-card h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  text-align: center;
}

.target-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.target-choice button {
  display: grid;
  min-height: 92px;
  gap: 5px;
  place-content: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.target-choice button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.target-choice strong {
  font-size: 1.5rem;
}

.target-choice small {
  color: currentColor;
  font-weight: 800;
  opacity: 0.8;
}

.start-action {
  width: 100%;
  min-height: 68px;
  margin-top: 14px;
  font-size: 1.12rem;
}

.privacy-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.workflow-screen {
  padding: 18px 0 28px;
}

.flow-header {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  align-items: center;
  min-height: 64px;
}

.flow-home {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-self: start;
}

.flow-home img {
  display: block;
  width: 136px;
  height: auto;
}

.flow-home span { font-size: 0.75rem; }

.flow-progress {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 680px;
  width: 100%;
  justify-self: center;
}

.flow-progress span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.flow-progress span::before {
  position: absolute;
  top: 15px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--line);
  content: "";
  transform: translateX(-50%);
  z-index: -1;
}

.flow-progress span:first-child::before {
  display: none;
}

.flow-progress i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--background);
  font-style: normal;
  font-weight: 700;
}

.flow-progress svg {
  width: 16px;
}

.flow-progress .current {
  color: var(--primary);
}

.flow-progress .current i {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.flow-progress .done {
  color: var(--primary);
}

.flow-progress .done i {
  border-color: var(--surface-strong);
  background: var(--surface-strong);
  color: var(--primary);
}

.workflow-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 18px;
}

.workflow-heading span,
.result-kicker {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.workflow-heading h1 {
  margin: 5px 0 0;
  font-size: clamp(1.65rem, 2.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  word-break: keep-all;
}

.workflow-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.workflow-heading > strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  padding: 10px 16px;
  white-space: nowrap;
}

.capture-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius-panel);
  background: var(--ink-deep);
  box-shadow: var(--shadow-soft);
}

.capture-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}

.camera-placeholder,
.capture-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #fff;
}

.camera-placeholder svg {
  width: 52px;
  height: 52px;
  opacity: 0.72;
}

.capture-countdown {
  align-content: start;
  padding-top: 24px;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  text-shadow: 0 4px 18px rgba(7, 19, 40, 0.8);
  pointer-events: none;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255,255,255,0.24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: booth-spin 800ms linear infinite;
}

@keyframes booth-spin {
  to { transform: rotate(360deg); }
}

.capture-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.capture-controls .error-message { word-break: keep-all; overflow-wrap: break-word; }

.capture-target { margin: 0; padding: 0; border: 0; min-width: 0; }
.capture-target legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.capture-target-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-control); font-size: 0.88rem; cursor: pointer; }
.capture-target-option:last-child { margin-bottom: 0; }
.capture-target-option input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--primary); }
.capture-target-option:has(input:checked) { border-color: var(--primary); background: var(--surface-strong); font-weight: 600; }
.capture-target-option:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.capture-target:disabled .capture-target-option { cursor: default; opacity: 0.65; }

.mode-switch.countdown-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.capture-main-action {
  min-height: 72px;
}

.capture-shutter-control {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: auto;
  padding-block: 8px;
}

.capture-shutter {
  position: relative;
  display: grid;
  width: 94px;
  height: 94px;
  padding: 0;
  place-items: center;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: #fff;
  color: #fff;
  box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.18), inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  isolation: isolate;
}

.capture-shutter::before {
  position: absolute;
  z-index: 0;
  inset: 8px;
  border-radius: 50%;
  background: var(--primary);

  content: "";
}

.capture-shutter svg {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  stroke-width: 2.2;
}

.capture-shutter:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 26px rgba(var(--primary-rgb), 0.24), inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
}

.capture-shutter:active {
  transform: scale(0.93);
}

.capture-shutter:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 5px;
}

.capture-shutter-control > span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.camera-help {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.camera-help > summary {
  min-height: 48px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
  border-radius: inherit;
}

.camera-help > summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.camera-help-content {
  padding: 0 12px 12px;
}

.camera-help-content ol {
  margin: 0;
  padding-left: 20px;
}

.camera-help-content li + li {
  margin-top: 12px;
}

.camera-help-content p {
  margin: 4px 0 0;
  color: var(--muted);
}

.camera-help-content > p {
  margin-top: 12px;
}

.capture-hint {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .capture-shutter {
    transition: none;
  }

  .capture-shutter:hover,
  .capture-shutter:active {
    transform: none;
  }
}

.shot-filmstrip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.shot-filmstrip > div {
  display: grid;
  min-height: 82px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  font-weight: 700;
}

.shot-filmstrip > div.filled {
  border-style: solid;
  border-color: var(--primary);
}

.shot-filmstrip img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.selection-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.selection-order-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-glass-strong);
  padding: 14px;
  box-shadow: var(--shadow);
}

.selection-order-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.selection-order-heading span {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.selection-order-heading h2 {
  margin: 3px 0 0;
  font-size: 1.2rem;
}

.selection-order-heading strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.selection-order-panel .frame-stage {
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 2 / 3;
  justify-self: center;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.selection-order-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection-order-list li {
  display: grid;
  min-width: 0;
  gap: 4px;
  justify-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  padding: 7px 4px;
  color: var(--muted);
  text-align: center;
}

.selection-order-list li.filled {
  border-style: solid;
  border-color: var(--primary);
  background: var(--surface-strong);
  color: var(--primary);
}

.selection-order-list b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--line-strong);
  color: var(--surface);
  font-size: 0.75rem;
}

.selection-order-list li.filled b {
  background: var(--primary);
}

.selection-order-list span {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-order-panel > p {
  word-break: keep-all;
  overflow-wrap: break-word;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.photo-choice {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: none;
}

.photo-choice.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.08);
}

.photo-choice-main {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: #071328;
  padding: 0;
  cursor: pointer;
}

.photo-choice-main img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.choice-number {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--deep-overlay);
  color: #fff;
  font-weight: 700;
}

.selected .choice-number {
  background: var(--primary);
}

.choice-state {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-small);
  background: rgba(7, 19, 40, 0.78);
  padding: 0 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.choice-state svg {
  width: 15px;
}

.photo-choice-actions {
  display: grid;
  grid-template-columns: 48px 48px minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
}

.photo-choice-actions button,
.edit-result-actions button,
.crop-heading button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.photo-choice-actions svg,
.edit-result-actions svg,
.crop-heading svg {
  width: 17px;
}

.photo-choice-actions button:last-child {
  padding-inline: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.selection-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.selection-help svg {
  width: 16px;
}

.workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
}

.start-copy h1,
.start-copy p,
.workflow-heading h1,
.workflow-heading p,
.result-actions h1,
.result-actions p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.start-copy h1,
.workflow-heading h1,
.result-actions h1 {
  text-wrap: balance;
}

button:focus-visible,
input:focus-visible,
.upload-button:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.workflow-footer button {
  min-width: 180px;
  min-height: 56px;
}

.frame-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(420px, 1fr);
  gap: 18px;
  min-height: 610px;
}

.frame-preview-panel {
  display: grid;
  min-height: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: rgba(255,255,255,0.86);
  padding: 14px;
  box-shadow: var(--shadow);
}

.frame-preview-panel .frame-stage {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.frame-browser {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.category-tabs button,
.slot-tabs button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}

.category-tabs button.selected,
.slot-tabs button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.frame-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
}

.frame-choice-grid > button {
  display: grid;
  gap: 5px;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  background: #fff;
  padding: 6px;
  color: var(--text);
  cursor: pointer;
}

.frame-choice-grid > button.selected {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.mini-frame {
  display: block;
  height: 136px;
  overflow: hidden;
}

.mini-frame .frame-stage {
  border: 0;
  padding: 0;
  box-shadow: none;
}

.mini-frame .empty-slot {
  font-size: 1rem;
}

.frame-choice-grid b {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crop-disclosure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.crop-disclosure summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.crop-disclosure summary::-webkit-details-marker {
  display: none;
}

.crop-disclosure summary > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crop-disclosure summary small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.crop-disclosure summary > svg {
  transition: transform 160ms ease;
}

.crop-disclosure[open] summary > svg {
  transform: rotate(180deg);
}

.crop-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.crop-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  animation: crop-panel-enter 160ms ease both;
}

@keyframes crop-panel-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.crop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.crop-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crop-heading button {
  min-height: 48px;
  padding: 0 10px;
}

.slot-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.crop-panel label {
  display: grid;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.crop-panel label span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.crop-panel input {
  width: 100%;
  accent-color: var(--primary);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.75fr) minmax(360px, 0.65fr);
  gap: 36px;
  align-items: center;
  min-height: calc(100dvh - 100px);
}

.result-actions h1 {
  margin: 8px 0 0;
}

.edit-result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.print-note {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 1120px) {
  .start-screen,
  .capture-workspace,
  .selection-workspace,
  .frame-workspace,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .start-screen {
    align-items: start;
  }

  .start-card {
    max-width: 680px;
    width: 100%;
    justify-self: center;
  }

  .capture-controls {
    min-height: 190px;
  }

  .frame-preview-panel {
    height: auto;
  }

  .selection-order-panel {
    position: static;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    grid-template-areas:
      "preview heading"
      "preview list"
      "preview copy";
    align-items: center;
  }

  .selection-order-heading {
    grid-area: heading;
    align-self: start;
  }

  .selection-order-panel .frame-stage {
    grid-area: preview;
  }

  .selection-order-list {
    grid-area: list;
  }

  .selection-order-panel > p {
    grid-area: copy;
  }

  .frame-preview-panel .frame-stage {
    height: auto;
  }

  .frame-preview-panel .frame-canvas {
    width: min(100%, 480px);
    height: auto;
    max-height: none;
  }

  .result-preview img {
    width: auto;
    height: min(46vh, 500px);
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .start-screen,
  .workflow-screen {
    width: calc(100vw - 24px);
  }

  .start-screen {
    gap: 24px;
    padding: 24px 0;
  }

  .start-steps {
    grid-template-columns: 1fr;
  }

  .flow-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .flow-progress {
    grid-column: 1;
  }

  .flow-progress b {
    font-size: 0.68rem;
  }

  .workflow-heading {
    flex-wrap: wrap;
    gap: 12px;
    align-items: start;
  }

  .workflow-heading p {
    font-size: 0.88rem;
  }

  .shot-filmstrip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-order-panel {
    grid-template-columns: minmax(120px, 0.82fr) minmax(0, 1fr);
    grid-template-areas:
      "heading heading"
      "preview list"
      "preview copy";
  }

  .selection-order-panel .frame-stage {
    width: min(100%, 160px);
  }

  .selection-order-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-order-panel > p {
    align-self: end;
    text-align: left;
  }

  .crop-disclosure summary small {
    display: none;
  }

  .photo-choice-actions {
    grid-template-columns: repeat(2, 48px);
  }

  .photo-choice-actions button:last-child {
    grid-column: 1 / -1;
  }

  .workflow-footer button {
    min-width: 0;
    padding-inline: 10px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .frame-workspace {
    min-height: 0;
  }

  .result-preview img {
    height: min(40vh, 360px);
  }

  .category-tabs,
  .frame-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-result-actions {
    grid-template-columns: 1fr;
  }
}

.chosen-frame-notice { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); }
.chosen-frame-thumb { width: 48px; flex: 0 0 48px; }
.chosen-frame-notice > div:nth-child(2) { flex: 1; min-width: 0; }
.chosen-frame-notice span, .chosen-frame-notice strong { display: block; line-height: 1.5; overflow-wrap: anywhere; }
.chosen-frame-notice span, .frame-choice-caption { color: var(--muted); font-size: .93rem; }
.chosen-frame-notice button { min-height: 48px; }
.frame-source-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.frame-source-tabs button[aria-pressed="true"] { color: var(--primary); background: var(--surface-strong); border-color: var(--primary); }
.frame-picker-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.frame-choice-caption { margin-top: 0; line-height: 1.6; }
@media (max-width: 480px) { .chosen-frame-notice { flex-wrap: wrap; } .chosen-frame-notice button { margin-left: auto; } }
.chosen-frame-thumb .frame-stage { height: auto; padding: 0; border: 0; box-shadow: none; }
.chosen-frame-thumb .frame-canvas { width: 100%; height: auto; }
.chosen-frame-thumb .empty-slot { font-size: .6rem; }
