@import url('https://fonts.googleapis.com/css2?family=Bowlby+One&family=IBM+Plex+Sans+Thai:wght@400;600&family=VT323&display=swap');

:root {
  --ink: #17151b;
  --muted: #726e77;
  --paper: #f8f6f1;
  --card: #ffffff;
  --line: #e6e1dc;
  --coral: #ef6c57;
  --yellow: #f4c75d;
  --purple: #1f1a2d;
  --shadow: 0 22px 60px rgba(35, 27, 38, 0.09);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 27px 32px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.04em; font-size: 18px; }
.brand-button { border: 0; padding: 0; color: inherit; background: transparent; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--purple); border-radius: 11px; font-size: 16px; transform: rotate(-6deg); }
.topbar-note { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.page { max-width: 1240px; margin: 0 auto; padding: 50px 32px 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 70px; align-items: end; margin-bottom: 65px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 24px; height: 2px; background: currentColor; }
h1, h2, h3, p { margin: 0; }
h1 { max-width: 720px; margin-top: 18px; font-size: clamp(52px, 8vw, 108px); line-height: .9; letter-spacing: -.085em; font-weight: 850; }
.hero-copy { max-width: 370px; color: var(--muted); font-size: 15px; line-height: 1.7; padding-bottom: 5px; }
.hero-copy strong { color: var(--ink); }
.section-label { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-label h2 { font-size: 17px; letter-spacing: -.03em; }
.section-label span { font-size: 12px; color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.template-card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); transition: transform .22s ease, box-shadow .22s ease; }
.template-card:hover { transform: translateY(-4px); box-shadow: 0 28px 70px rgba(35, 27, 38, .13); }
.template-thumb { display: block; width: 100%; aspect-ratio: 1 / 1.65; object-fit: cover; object-position: top center; background: #ece9e3; }
.template-card-body { padding: 22px; }
.template-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.template-card h3 { font-size: 21px; letter-spacing: -.05em; }
.pill { color: var(--muted); font-size: 11px; white-space: nowrap; }
.template-card p { color: var(--muted); min-height: 44px; margin: 10px 0 18px; font-size: 13px; line-height: 1.55; }
.primary-btn, .secondary-btn, .ghost-btn { border: 0; border-radius: 999px; padding: 14px 20px; font-weight: 750; transition: transform .18s ease, opacity .18s ease, background .18s ease; }
.primary-btn { color: white; background: var(--purple); box-shadow: 0 8px 20px rgba(31, 26, 45, .2); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover { transform: translateY(-2px); }
.secondary-btn { color: var(--ink); background: #ece8e2; }
.ghost-btn { color: var(--muted); background: transparent; padding-inline: 12px; }
.full-btn { width: 100%; }
.flow-page { max-width: 1180px; margin: 0 auto; padding: 25px 32px 70px; }
.flow-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: none; border: none; padding: 8px 0; font-size: 13px; }
.step-count { color: var(--muted); font-size: 12px; }
.flow-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 72px; align-items: start; }
.poster-stage { display: flex; justify-content: center; position: sticky; top: 22px; }
.poster-frame { position: relative; width: min(100%, 390px); overflow: hidden; border-radius: 18px; background: #e9e4de; box-shadow: 0 28px 70px rgba(35, 27, 38, .16); }
.poster-frame img, .poster-frame canvas { display: block; width: 100%; height: auto; }
.poster-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-panel { min-width: 0; padding: 8px 0; }
.flow-panel h1 { font-size: clamp(42px, 6vw, 72px); max-width: 550px; margin: 0 0 16px; }
.flow-panel > p { max-width: 480px; color: var(--muted); line-height: 1.65; font-size: 15px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.spec-list { display: grid; gap: 1px; margin-top: 36px; border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.spec-row span:last-child { color: var(--muted); text-align: right; }
.camera-panel { max-width: 600px; }
.camera-wrap { position: relative; overflow: hidden; aspect-ratio: 3 / 4; margin: 26px 0 16px; border-radius: 24px; background: #1c1a21; box-shadow: var(--shadow); }
#camera-video { display: block; width: 100%; height: 100%; object-fit: cover; }
#camera-video.mirrored { transform: scaleX(-1); }
.camera-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.countdown { color: white; font-weight: 900; font-size: clamp(80px, 18vw, 150px); line-height: 1; text-shadow: 0 5px 25px rgba(0,0,0,.35); }
.countdown:empty { display: none; }
.camera-badge { position: absolute; top: 16px; left: 16px; color: white; background: rgba(21, 19, 26, .6); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 8px 12px; font-size: 12px; backdrop-filter: blur(12px); }
.camera-select { display: grid; gap: 8px; margin: 14px 0 4px; }
.camera-select-label { color: var(--muted); font-family: 'VT323', monospace; font-size: 15px; text-transform: uppercase; }
.camera-option-list { display: flex; flex-wrap: wrap; gap: 8px; }
.camera-option { min-height: 40px; padding: 7px 12px; color: var(--ink); background: var(--card); border: 2px solid var(--ink); font-family: 'VT323', monospace; font-size: 15px; }
.camera-option.active { color: white; background: var(--coral); box-shadow: 3px 3px 0 var(--ink); }
.camera-controls { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.camera-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.shutter { width: 68px; height: 68px; padding: 0; border: 7px solid white; outline: 2px solid var(--ink); border-radius: 50%; background: var(--coral); box-shadow: 0 8px 24px rgba(239,108,87,.3); }
.error-box { margin-top: 22px; padding: 18px; color: #812d27; background: #fff0ed; border: 1px solid #f1b8ae; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.photo-editor { position: relative; width: min(100%, 330px); aspect-ratio: 1 / 1; overflow: hidden; margin: 28px 0 10px; border: 2px solid rgba(31, 26, 45, .18); background: #eee; touch-action: none; cursor: grab; }
.photo-editor:active { cursor: grabbing; }
.photo-editor.circle { border-radius: 50%; }
.photo-editor.rounded { border-radius: 12px; aspect-ratio: 1.08 / 1; }
.template-photo-editor { position: absolute; z-index: 3; margin: 0; border: 0; outline: 2px dashed white; outline-offset: -3px; }
.template-photo-editor .editor-label { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 7px; color: white; background: rgba(32, 38, 79, .72); font-family: 'VT323', monospace; font-size: 12px; letter-spacing: .04em; white-space: nowrap; pointer-events: none; }
.review-poster-frame { position: relative; }
.editor-photo { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: center; user-select: none; pointer-events: none; }
.editor-grid { position: absolute; inset: 0; pointer-events: none; opacity: .35; background: linear-gradient(90deg, transparent 49.5%, white 50%, transparent 50.5%), linear-gradient(0deg, transparent 49.5%, white 50%, transparent 50.5%); }
.zoom-control { display: flex; align-items: center; gap: 12px; width: min(100%, 330px); color: var(--muted); font-size: 12px; }
.zoom-control input { flex: 1; accent-color: var(--coral); }
.adjustment-note { display: block; width: min(100%, 330px); color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.customize-grid { display: grid; gap: 24px; margin-top: 26px; }
.control-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.control-card label { display: block; margin-bottom: 8px; font-weight: 750; font-size: 13px; }
.control-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.control-card input[type="text"] { width: 100%; border: 1px solid #d9d2cc; border-radius: 11px; padding: 12px 13px; color: var(--ink); background: #fbfaf8; outline: none; }
.control-card input[type="text"]:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(239, 108, 87, .12); }
.option-row { display: flex; gap: 9px; flex-wrap: wrap; }
.option-btn { border: 1px solid #ddd6cf; border-radius: 999px; padding: 9px 14px; color: var(--muted); background: white; font-size: 13px; }
.option-btn.active { color: white; border-color: var(--purple); background: var(--purple); }
.final-note { padding: 15px 17px; border-radius: 14px; color: #655b50; background: #fff4d7; font-size: 13px; line-height: 1.55; }
.debug-toggle { position: fixed; right: 14px; bottom: 14px; z-index: 20; color: var(--muted); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 99px; padding: 8px 11px; font-size: 11px; backdrop-filter: blur(12px); }
.debug-label { fill: #111; font: 12px ui-monospace, monospace; }
.empty-state { padding: 24px; color: var(--muted); background: white; border: 1px dashed #d8d0c8; border-radius: 18px; font-size: 13px; }
@media (max-width: 850px) {
  .topbar, .page, .flow-page { padding-left: 20px; padding-right: 20px; }
  .hero { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; }
  .hero-copy { max-width: 500px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .poster-stage { position: relative; top: auto; order: -1; }
  .poster-frame { width: min(100%, 360px); }
  .flow-panel { padding: 0; }
}

/* Pixel-perfect-render design system */
:root {
  --ink: #20264f;
  --paper: #f7f0df;
  --card: #fffdf7;
  --line: #20264f;
  --coral: #bd391c;
  --purple: #20264f;
  --yellow: #f8d45d;
  --muted: #6d6a6c;
  --shadow: 5px 5px 0 var(--ink);
  --background: var(--paper);
  --foreground: var(--ink);
}

body { background: var(--paper); color: var(--ink); font-family: 'IBM Plex Sans Thai', system-ui, sans-serif; }
.app-shell { background: var(--paper); background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.topbar { position: sticky; top: 0; z-index: 30; max-width: none; height: 64px; margin: 0; padding: 0 max(20px, calc((100vw - 1200px) / 2)); border-bottom: 2px solid var(--ink); border-radius: 0; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); }
.brand { color: var(--ink); font-family: 'Bowlby One', system-ui, sans-serif; font-size: 0; letter-spacing: -.04em; text-transform: uppercase; }
.brand-button { min-height: 44px; }
.brand-button .brand-mark { display: none; }
.brand-button::after { content: 'PHOTO★BOOTH'; font-size: 22px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a, .design-footer a { color: var(--ink); font-family: 'VT323', monospace; font-size: 16px; letter-spacing: .03em; text-transform: uppercase; }
.nav-start { min-height: 44px; padding: 8px 16px; border: 2px solid var(--ink); color: white; background: var(--coral); box-shadow: 3px 3px 0 var(--ink); font-family: 'Bowlby One', system-ui, sans-serif; font-size: 13px; }
.nav-start:active { transform: translate(2px, 2px); box-shadow: none; }
.site-nav .clock-return { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border: 2px solid var(--ink); background: var(--card); font-family: 'IBM Plex Sans Thai', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap; }
.site-nav .clock-return:hover { background: var(--yellow); }
.site-nav .clock-return:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
@media (max-width: 760px) {
  .site-nav > a:not(.clock-return) { display: none; }
  .site-header .site-nav { gap: 8px; }
}
@media (max-width: 380px) {
  .site-header.topbar { padding-left: 10px; padding-right: 10px; }
  .site-header .brand-button::after { font-size: 14px; }
  .site-header .clock-return { padding: 6px; font-size: 12px; }
  .site-header .nav-start { padding-left: 8px; padding-right: 8px; }
  .site-header .site-nav { gap: 6px; }
}
.landing-main { min-height: 100vh; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); align-items: center; gap: 56px; max-width: 1200px; margin: 0 auto; padding: 58px 20px 72px; }
.rec-sticker { display: inline-block; margin: 0 0 18px; padding: 7px 12px; border: 2px solid var(--ink); background: var(--yellow); font-family: 'VT323', monospace; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); }
.landing-hero h1 { max-width: 650px; margin: 0; color: var(--ink); font-family: 'Bowlby One', system-ui, sans-serif; font-size: clamp(44px, 7vw, 90px); line-height: .92; letter-spacing: -.06em; }
.landing-hero h1 span { color: var(--coral); }
.landing-subtitle { max-width: 390px; margin: 22px 0 0; font-size: 18px; color: var(--muted); }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.design-primary, .design-secondary { min-height: 54px; border-radius: 0; border: 2px solid var(--ink); font-family: 'Bowlby One', system-ui, sans-serif; }
.design-primary { color: white; background: var(--coral); box-shadow: var(--shadow); font-size: 16px; }
.design-secondary { color: var(--ink); background: var(--card); box-shadow: none; font-size: 14px; }
.hero-collage { position: relative; display: flex; justify-content: center; max-width: 500px; margin: 0 auto; padding: 24px 0 34px; }
.collage-card { position: relative; z-index: 1; width: 34%; margin: 0 -5%; padding: 7px; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow); transition: transform .25s ease; }
.collage-card img { display: block; width: 100%; height: auto; }
.collage-1 { transform: rotate(-4deg) translateY(22px); }
.collage-2 { z-index: 3; transform: rotate(3deg) translateY(-8px); }
.collage-3 { transform: rotate(-2deg) translateY(28px); }
.collage-card:hover { z-index: 5; transform: translateY(-10px) rotate(0deg) scale(1.02); }
.collage-tape { position: absolute; top: -12px; left: 50%; width: 56px; height: 20px; transform: translateX(-50%) rotate(-6deg); border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); background: color-mix(in srgb, var(--yellow) 70%, transparent); }
.collage-star, .collage-heart, .collage-flash { position: absolute; z-index: 8; }
.collage-star { left: -4px; top: 0; color: var(--yellow); font-size: 42px; text-shadow: 2px 2px 0 var(--ink); }
.collage-heart { right: 0; top: 34px; color: var(--coral); font-family: 'VT323', monospace; font-size: 38px; }
.collage-flash { right: 22px; bottom: 0; padding: 5px 8px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-family: 'VT323', monospace; font-size: 14px; transform: rotate(6deg); }
.design-marquee { overflow: hidden; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 8px 0; color: var(--paper); background: var(--ink); font-family: 'VT323', monospace; font-size: 17px; white-space: nowrap; animation: marquee 40s linear infinite; }
.how-section, .showcase-inner { max-width: 1200px; margin: 0 auto; padding: 72px 20px; }
.how-section h2, .showcase-inner h2 { margin: 0; font-family: 'Bowlby One', system-ui, sans-serif; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.05em; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 0; padding: 0; list-style: none; }
.how-grid li { border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow); }
.window-bar { display: flex; justify-content: space-between; padding: 5px 10px; border-bottom: 2px solid var(--ink); color: var(--paper); background: var(--ink); font-family: 'VT323', monospace; font-size: 15px; }
.how-body { display: flex; align-items: center; gap: 16px; padding: 22px; }
.how-body b { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 2px solid var(--ink); background: var(--yellow); font-size: 28px; font-weight: 400; }
.how-body small { color: var(--muted); font-family: 'VT323', monospace; font-size: 15px; }
.how-body h3 { margin: 2px 0 0; font-family: 'Bowlby One', system-ui, sans-serif; font-size: 25px; }
.how-body p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.showcase-section { border-top: 2px solid var(--ink); background: color-mix(in srgb, var(--yellow) 19%, var(--paper)); }
.showcase-inner > p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.design-template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 38px 0 0; padding: 0; }
.design-template-grid > li { list-style: none; }
.design-template-card { overflow: visible; padding: 12px; border: 2px solid var(--ink); border-radius: 0; background: var(--card); box-shadow: var(--shadow); transition: transform .2s ease; }
.design-template-card:hover, .design-template-card:focus-visible { transform: translateY(-5px); }
.design-card-image { position: relative; max-width: 230px; margin: 0 auto; }
.design-template-card .template-thumb { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; border: 2px solid var(--ink); }
.template-shot-tag { position: absolute; top: 16px; right: -14px; padding: 3px 8px; border: 2px solid var(--ink); background: var(--yellow); font-family: 'VT323', monospace; font-size: 15px; transform: rotate(5deg); }
.design-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.design-card-footer h3 { margin: 0; font-family: 'Bowlby One', system-ui, sans-serif; font-size: 21px; line-height: 1; }
.design-card-footer span { padding: 8px 10px; border: 2px solid var(--ink); font-family: 'VT323', monospace; font-size: 14px; white-space: nowrap; }
.design-template-card:hover .design-card-footer span, .design-template-card:focus-visible .design-card-footer span { color: white; background: var(--coral); }
.design-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 28px 20px; border-top: 2px solid var(--ink); color: var(--ink); font-family: 'VT323', monospace; font-size: 15px; }
.design-footer nav { display: flex; gap: 20px; }
.live-poster-frame { position: relative; }
.live-slot { position: absolute; overflow: hidden; background: #1c1a21; }
.live-slot.circle { border-radius: 50%; }
.live-slot.rounded { border-radius: 8px; }
.live-slot video { display: block; width: 100%; height: 100%; object-fit: cover; }
.live-slot .camera-overlay { z-index: 2; }
.live-slot .camera-badge { z-index: 3; top: 8px; left: 8px; padding: 5px 8px; font-size: 10px; }
.upload-note { display: block; margin-top: 10px; color: var(--muted); font-family: 'VT323', monospace; font-size: 15px; }
.flow-page { max-width: 1200px; }
.flow-header { border-bottom: 2px solid var(--ink); }
.flow-panel h1 { font-family: 'Bowlby One', system-ui, sans-serif; letter-spacing: -.06em; }
.poster-frame { border: 2px solid var(--ink); border-radius: 0; box-shadow: var(--shadow); }
.primary-btn, .secondary-btn, .ghost-btn, .back-btn { border-radius: 0; }
.primary-btn { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.primary-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.secondary-btn { border: 2px solid var(--ink); }
.control-card, .final-note, .error-box { border-radius: 0; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.control-card input[type="text"] { border-radius: 0; border: 2px solid var(--ink); }
.option-btn { border-radius: 0; border: 2px solid var(--ink); }
.option-btn.active { color: white; background: var(--coral); }

@media (max-width: 850px) {
  .landing-hero { grid-template-columns: 1fr; gap: 34px; padding-top: 42px; }
  .hero-collage { order: -1; max-width: 410px; }
  .landing-copy { text-align: center; }
  .rec-sticker { margin-left: auto; margin-right: auto; }
  .landing-hero h1, .landing-subtitle { margin-left: auto; margin-right: auto; }
  .landing-actions { justify-content: center; }
  .design-template-grid { grid-template-columns: repeat(2, 1fr); }

  .camera-flow { padding-bottom: 190px; }
  .camera-flow .flow-layout { display: block; }
  .camera-flow .poster-stage { position: relative; top: auto; order: 0; }
  .camera-flow .camera-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: none; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: 0 -4px 0 var(--ink); backdrop-filter: blur(12px); }
  .camera-flow .camera-panel > .eyebrow,
  .camera-flow .camera-panel > h1,
  .camera-flow .camera-panel > p { display: none; }
  .camera-flow .camera-select { margin: 0 0 7px; }
  .camera-flow .camera-controls { margin: 0; }
  .camera-flow .panel-actions { margin-top: 8px; }
  .camera-flow .upload-note { margin-top: 7px; text-align: center; }

  /* Keep photo placement and the next-step actions in one continuous mobile flow. */
  .review-flow { padding-bottom: 146px; }
  .review-flow .flow-layout { display: block; }
  .review-flow .poster-stage { position: relative; top: auto; order: 0; }
  .review-flow .flow-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: none; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: 0 -4px 0 var(--ink); backdrop-filter: blur(12px); }
  .review-flow .flow-panel > .eyebrow,
  .review-flow .flow-panel > h1,
  .review-flow .flow-panel > p { display: none; }
  .review-flow .zoom-control,
  .review-flow .adjustment-note { width: min(100%, 330px); margin-left: auto; margin-right: auto; }
  .review-flow .zoom-control { margin-top: 0; }
  .review-flow .adjustment-note { text-align: center; }
  .review-flow .review-actions { display: flex; gap: 10px; margin-top: 8px; }
  .review-flow .review-actions button { flex: 1; min-height: 48px; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; padding: 0 14px; }
  .brand-button::after { font-size: 18px; }
  .site-nav a { display: none; }
  .site-nav { gap: 0; }
  .nav-start { min-height: 40px; padding: 6px 12px; font-size: 11px; }
  .landing-hero { padding: 34px 16px 52px; }
  .landing-hero h1 { font-size: clamp(39px, 12vw, 64px); }
  .landing-subtitle { font-size: 16px; }
  .how-section, .showcase-inner { padding: 54px 16px; }
  .how-grid, .design-template-grid { grid-template-columns: 1fr; }
  .design-template-grid { gap: 18px; }
  .design-card-image { max-width: 245px; }
  .design-footer { align-items: flex-start; flex-direction: column; padding-left: 16px; padding-right: 16px; }
  .design-footer nav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .design-marquee { animation: none; }
  .collage-card, .design-template-card { transition: none; }
}
@media (max-width: 520px) {
  .topbar { padding-top: 18px; padding-bottom: 18px; }
  .topbar-note { display: none; }
  .page { padding-top: 36px; }
  h1 { font-size: 58px; }
  .template-grid { grid-template-columns: 1fr; gap: 16px; }
  .template-thumb { aspect-ratio: 1 / 1.5; }
  .template-card p { min-height: 0; }
  .flow-page { padding-top: 12px; }
  .flow-header { margin-bottom: 22px; }
  .flow-panel h1 { font-size: 48px; }
  .camera-wrap { margin-top: 22px; border-radius: 20px; }
  .camera-controls { align-items: flex-end; }
  .panel-actions .primary-btn, .panel-actions .secondary-btn { flex: 1; }
  .poster-frame { border-radius: 14px; }
}

/* The controls occupy their own row, so they can never cover the active photo. */
.booth-active { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.booth-active .topbar { position: relative; height: 54px; padding: 0 16px; }
.booth-active .booth-workspace { display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: 100%; min-height: 0; padding: 0 16px; overflow: hidden; }
.booth-workspace .flow-header { margin: 0; min-height: 40px; }
.slot-navigation { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
.slot-step, .view-toggle { min-height: 36px; padding: 5px 12px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); font-size: 13px; }
.slot-step.active { background: var(--ink); color: white; }
.view-toggle { margin-left: auto; }
.booth-active .booth-workspace .flow-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 24px; min-height: 0; align-items: stretch; }
.booth-active .booth-workspace .poster-stage { display: block; position: relative; top: auto; min-height: 0; overflow: hidden; order: 0; }
.template-viewport { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; background: rgba(32,38,79,.05); scrollbar-width: thin; }
.template-viewport .poster-frame { margin: 12px auto; flex: none; max-width: none; border: 0; border-radius: 0; }
.poster-frame .editor-photo { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.live-slot { z-index: 2; }
.template-photo-editor.rounded { border-radius: 1.7%; }
.template-photo-editor .editor-label { display: none; }
.booth-active .booth-workspace .flow-panel { position: relative; left: auto; right: auto; bottom: auto; z-index: 4; align-self: center; width: 100%; max-width: none; padding: 14px 8px; margin: 0; box-shadow: none; border: 0; background: var(--paper); backdrop-filter: none; overflow: auto; max-height: 100%; }
.booth-workspace .camera-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.booth-workspace .camera-controls button { min-width: 0; font-size: 13px; padding: 8px; min-height: 44px; }
.booth-workspace .shutter { width: 60px; height: 60px; flex: none; }
.booth-workspace .flow-panel > .camera-hint { display: block; margin: 8px 0 0; font-size: 12px; text-align: center; max-width: none; }
.booth-workspace .camera-select { margin: 0 0 10px; }
.booth-workspace .camera-select:empty { display: none; }
.booth-workspace .camera-select-label { display: none; }
.booth-workspace .camera-option-list { flex-wrap: nowrap; overflow-x: auto; padding: 0 0 4px; }
.booth-workspace .camera-option { flex: none; min-height: 32px; padding: 4px 8px; }
.booth-workspace .camera-facing-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.booth-workspace .camera-facing-options .camera-option { font-family: inherit; font-size: 14px; min-height: 40px; }
.booth-workspace .camera-lens-options { display: flex; flex-wrap: wrap; gap: 6px; }
.booth-workspace .camera-lens-options .camera-option { flex: 1; font-family: inherit; font-size: 12px; min-height: 36px; }
.camera-current { font-size: 12px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.camera-more { min-width: 0; font-size: 12px; }
.camera-more summary { cursor: pointer; min-height: 32px; padding: 6px 0; text-align: center; color: var(--ink); }
.camera-more label, .camera-more small { display: block; margin: 4px 0; color: var(--muted); }
.camera-more select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }
.booth-workspace .zoom-control { width: 100%; margin: 0; }
.booth-workspace .zoom-control input { min-width: 0; width: 100%; min-height: 36px; }
.booth-workspace .adjustment-note { width: 100%; text-align: center; }
.booth-workspace .review-actions { flex-wrap: nowrap; margin-top: 8px; }
.booth-workspace .review-actions button { flex: 1; min-height: 46px; padding: 8px; }
.booth-active .booth-workspace .flow-panel > .booth-error { display: block; margin-top: 6px; color: #9b2a16; font-size: 12px; line-height: 1.4; }
.booth-active [hidden] { display: none !important; }
.booth-active .summary-workspace { grid-template-rows: auto minmax(0, 1fr); }
.booth-active .summary-workspace .flow-panel h1 { font-size: 28px; margin: 0 0 10px; }
.booth-active .summary-workspace .flow-panel > p { font-size: 13px; }
.booth-active .summary-workspace .panel-actions { margin-top: 14px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.countdown { font-size: clamp(52px, 15vw, 110px); }
@media (max-width: 850px) {
  .booth-active .booth-workspace { padding: 0 12px; }
  .booth-active .booth-workspace .flow-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
  .booth-active .booth-workspace .flow-panel { align-self: stretch; max-height: 42dvh; padding: 10px 4px max(10px, env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); }
  .booth-active .summary-workspace .flow-panel > .eyebrow,
  .booth-active .summary-workspace .flow-panel > p,
  .booth-active .summary-workspace .spec-list,
  .booth-active .summary-workspace .final-note { display: none; }
  .booth-active .summary-workspace .flow-panel h1 { font-size: 22px; margin-bottom: 4px; }
  .booth-active .summary-workspace .customize-grid { gap: 10px; margin-top: 10px; }
  .booth-active .summary-workspace .control-card { padding: 10px; }
  .booth-active .summary-workspace .panel-actions { position: sticky; bottom: 0; padding: 8px 0 4px; background: var(--paper); margin-top: 6px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .booth-active .topbar { height: 42px; }
  .booth-active .booth-workspace .flow-layout { grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .booth-active .booth-workspace .flow-panel { max-height: 100%; }
}
