:root {
  color-scheme: light;
  --ink: #1d2324;
  --muted: #7d827e;
  --line: #e7e9e3;
  --paper: #fff;
  --bg: #f6f7f2;
  --purple: #6a55d7;
  --purple-dark: #4a3e9b;
  --lime: #d9fa82;
  --radius: 24px;
  font-family: "Inter", "Avenir Next", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, a { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .46; cursor: not-allowed; transform: none !important; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; white-space: nowrap; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #8e75ed; outline-offset: 3px; }

/* Shared navigation */
.topbar { height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 max(30px, calc((100% - 1250px)/2)); border-bottom: 1px solid #e8e9e3; background: #fff; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: #242927; font-size: 19px; font-weight: 850; letter-spacing: -.9px; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: #19201e; background: var(--lime); }
.brand-dot { color: #705bd9; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; color: #4c6854; font-weight: 700; font-size: 12px; }
.admin-link { text-decoration: none; color: #787e79; font-size: 12px; font-weight: 750; }
.admin-link:hover { color: #272d29; }

/* Main layout */
.page { max-width: 1250px; margin: 0 auto; padding: 27px 24px 20px; }
.simple-workspace { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(345px, .82fr); grid-template-areas: "preview controls" "preview effects"; gap: 18px 22px; align-items: start; }
.simple-workspace.no-effect-choice { grid-template-areas: "preview controls"; }
.panel, .preview-panel { min-width: 0; border-radius: 25px; }
.panel { background: #fff; padding: 27px; border: 1px solid #e9ebe5; box-shadow: 0 7px 25px #28322906; }
.simple-controls { grid-area: controls; }
.simple-effects { grid-area: effects; }
.section-overline { display: flex; gap: 8px; align-items: center; color: #858b83; font-size: 10px; font-weight: 850; letter-spacing: 1.4px; }
.overline-dot { width: 8px; height: 8px; border-radius: 50%; background: #92ae67; }
.simple-title { font-size: clamp(25px, 3vw, 31px); font-weight: 850; letter-spacing: -1.2px; margin: 12px 0 7px; line-height: 1.13; }
.panel-description { font-size: 13px; line-height: 1.5; color: #777e79; margin: 0 0 22px; }
.upload-actions { display: grid; gap: 10px; }
.upload-tile { display: flex; align-items: center; min-height: 75px; gap: 14px; padding: 12px 13px; width: 100%; border: 1px solid #e4e6df; border-radius: 16px; text-align: left; color: var(--ink); background: #fff; transition: background .18s, transform .18s, border-color .18s, box-shadow .18s; }
.upload-tile:not(:disabled):hover { transform: translateY(-2px); border-color: #c4cfaa; box-shadow: 0 8px 18px #3c492311; }
.upload-tile-camera { background: var(--lime); border-color: var(--lime); }
.upload-tile-camera:hover { background: #e2ffa3; }
.tile-icon { display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 45px; border-radius: 13px; background: #161f19; color: #fff; }
.upload-tile-gallery .tile-icon { background: #f0f1ec; color: #373d39; }
.tile-copy { flex: 1; min-width: 0; }
.tile-copy strong { display: block; font-size: 14px; letter-spacing: -.2px; font-weight: 800; }
.tile-copy small { display: block; color: #737e72; font-weight: 500; font-size: 11px; margin-top: 4px; }
.tile-arrow { font-size: 22px; line-height: 1; color: #3a4337; }
.panel-divider { border-top: 1px solid var(--line); margin: 24px 0 20px; }
.controls-heading, .effect-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.simple-section-title { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 820; letter-spacing: -.45px; }
.controls-label { color: #999f98; font-size: 9px; font-weight: 850; letter-spacing: .8px; }
.zoom-controls { margin-top: 17px; }
.zoom-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 770; }
.zoom-label output { font-size: 12px; font-weight: 800; color: #4a4b51; background: #f2f3ee; border-radius: 7px; padding: 4px 8px; }
input[type="range"] { accent-color: #272e2b; width: 100%; cursor: pointer; margin: 14px 0 0; }
.zoom-ends { display: flex; justify-content: space-between; margin-top: 1px; font-size: 17px; color: #949a94; }
.secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.button-secondary { border: 1px solid #e4e7e1; color: #414944; background: #fff; padding: 12px 9px; border-radius: 12px; font-size: 12px; font-weight: 780; text-align: center; transition: background .18s, border-color .18s; }
.button-secondary:not(:disabled):hover { background: #f3f5ef; border-color: #cbd4c8; }
.button-secondary > span { font-size: 16px; margin-right: 4px; }
.advanced-details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.advanced-details summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; color: #515a55; font-size: 12px; font-weight: 750; }
.advanced-details summary::-webkit-details-marker { display:none; }
.advanced-details[open] summary span { transform: rotate(180deg); }
.support-text { color: #717a73; font-size: 12px; line-height: 1.5; }
.face-status { background: #f4f6f0; border-radius: 12px; padding: 11px 12px; }
.accessory-adjust { margin-top: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.adjust-field { margin-top: 15px; }
.adjust-field label { color: #59635b; font-size: 12px; font-weight: 720; }
.btn-full { display: block; width: 100%; margin-top: 7px; }

/* Photo stage */
.preview-panel { grid-area: preview; position: sticky; top: 20px; overflow: hidden; isolation: isolate; background: #202327; color: white; padding: 25px 26px 26px; min-height: 685px; box-shadow: 0 18px 50px #272a3020; display: flex; flex-direction: column; }
.preview-panel::before { content: ''; position: absolute; z-index: -1; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle,#51496680 0,#38334358 41%, transparent 72%); left: -150px; top: -110px; pointer-events: none; }
.preview-panel::after { content: ''; position: absolute; z-index: -1; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle,#5a665038,transparent 71%); right: -130px; bottom: 60px; pointer-events: none; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #f2f2eb; font-size: 10px; font-weight: 850; letter-spacing: 1.3px; }
.preview-top > div { display: flex; align-items: center; gap: 11px; }
.live-circle { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px #dafa821b; }
.preview-format { font-size: 9px; letter-spacing: .7px; color: #c7cbc3; border: 1px solid #ffffff2f; border-radius: 6px; padding: 8px 9px; white-space: nowrap; }
.preview-outer { flex: 1; min-height: 505px; position: relative; display: flex; align-items: center; justify-content: center; padding: 26px 0 18px; }
.stage-spark { position: absolute; color: #d9fa82; opacity: .72; pointer-events: none; line-height: 1; }
.stage-spark-one { top: 19%; right: 9%; font-size: 29px; }
.stage-spark-two { bottom: 18%; left: 7%; font-size: 20px; opacity: .36; }
.photo-frame { width: min(100%, 334px); aspect-ratio: 3 / 4; position: relative; isolation: isolate; overflow: hidden; border: 7px solid #fff; background: #eee8df; border-radius: 7px; box-shadow: 0 24px 45px #0005, 0 2px 6px #0002; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.photo-frame:not(.is-empty) { border-width: 5px; }
.photo-frame:active { cursor: grabbing; }
.photo-frame canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.photo-frame.is-empty canvas { display: none; }
.empty-preview { display: grid; place-items: center; position: absolute; inset: 0; overflow: hidden; background: #f6e5d7; z-index: 2; }
.empty-pattern { position: absolute; inset: 0; background: radial-gradient(circle at 75% 16%, #fbc799 0 17%, transparent 17.3%),radial-gradient(circle at 9% 62%, #b4bcee 0 13%, transparent 13.3%), linear-gradient(140deg,#f9e6d6,#dfdff8); }
.empty-person { position: absolute; width: 86%; height: auto; bottom: -7%; max-height: 96%; }
.empty-message { position: absolute; z-index: 3; bottom: 17px; left: 50%; transform: translateX(-50%); white-space: nowrap; border-radius: 50px; padding: 11px 17px; background: #fff; color: #292b2d; font-size: 11px; font-weight: 800; box-shadow: 0 5px 12px #31315118; }
.empty-message span { color: #6c5ed5; margin-left: 4px; }
.face-guide { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.guide-oval { position: absolute; width: 52%; height: 55%; left: 24%; top: 15.5%; border: 2.5px dashed rgba(255,255,255,.98); border-radius: 50%; box-shadow: 0 0 0 1px #262a3b70; }
.eye-marker { position: absolute; height: 1px; width: 10%; background: #fff; top: 44%; box-shadow: 0 0 3px #363445; }
.eye-left { left: 22%; }.eye-right { right: 22%; }
.nose-marker { position: absolute; left: 50%; top: 53%; border-left: 1px solid #fffc; height: 8%; }
.drag-hint { position: absolute; z-index: 4; bottom: 6%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #202327d9; color: #fff; font-size: 11px; font-weight: 750; border-radius: 40px; padding: 10px 16px; pointer-events: none; }
.photo-frame.edit-accessory { outline: 4px solid #d9fa82; outline-offset: 3px; cursor: move; }
.photo-frame.edit-accessory .drag-hint { background: #4e6f38; }
.preview-footer { margin-top: auto; }
.preview-caption { color: #a7aba7; font-size: 11px; line-height: 1.5; text-align: center; margin: 0 0 16px; }
.preview-caption span { color: #c6cbc5; }
.button-primary { display: inline-flex; justify-content: center; align-items: center; gap: 14px; background: var(--ink); color: #fff; border: 0; border-radius: 13px; font-size: 13px; font-weight: 800; padding: 15px 20px; text-decoration: none; transition: transform .18s, box-shadow .18s, background .18s; }
.button-primary:not(:disabled):hover { background: #333c35; box-shadow: 0 10px 22px #17201b23; transform: translateY(-2px); }
.preview-panel > .preview-footer > .button-primary { display: flex; width: 100%; max-width: 390px; margin: 0 auto; color: #202721; background: var(--lime); font-size: 14px; padding: 12px 12px 12px 24px; justify-content: space-between; }
.preview-panel > .preview-footer > .button-primary:not(:disabled):hover { background: #e6ffa6; }
.primary-arrow { display: grid; place-items: center; width: 37px; height: 37px; background: #1e2821; color: #fff; border-radius: 9px; font-size: 22px; }
.preview-panel > .preview-footer > .button-primary:disabled { opacity: .64; }

/* Effect choices */
.effects-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.effects-header .simple-section-title { margin-top: 7px; font-size: 19px; }
.effects-star { display: grid; place-items: center; height: 35px; width: 35px; border-radius: 10px; background: #eee9ff; color: #7466ce; font-size: 21px; }
.effect-heading { margin: 0 0 13px; }
.effect-label { margin: 0; font-size: 12px; color: #434b45; font-weight: 800; }
.effect-heading > span { color: #b7bab1; font-size: 11px; font-weight: 800; }
.effect-divider { border-top: 1px solid #eceee9; margin: 19px 0 21px; }
.overlay-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.overlay-option { min-width: 0; padding: 5px; border: 1px solid #e5e9e1; background: #fff; border-radius: 11px; color: #727a71; font-size: 10px; font-weight: 700; text-align: center; transition: border-color .18s, background .18s, transform .18s; }
.overlay-option:hover { transform: translateY(-2px); border-color: #b5c3a9; }
.overlay-option.selected { border-color: #658456; background: #f3f9e9; box-shadow: 0 0 0 1px #658456; color: #3f6245; }
.overlay-thumbnail { height: 68px; width: 100%; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg,#eeece4,#d9e3de); border-radius: 7px; }
.overlay-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.overlay-thumbnail.no-overlay { font-size: 27px; color: #a0a9a0; }
.overlay-name { display: block; font-size: 9px; line-height: 1.25; min-height: 26px; margin-top: 7px; overflow-wrap: anywhere; }
.loading-message { color: var(--muted); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #9da29b; font-size: 11px; padding: 22px 4px 0; }
.site-footer span span { color: #7c6db1; }

/* Camera + result dialogs */
.modal { width: min(92vw, 900px); max-height: min(94dvh, 910px); overflow: auto; border: 1px solid #e1e4dc; border-radius: 22px; padding: 25px; box-shadow: 0 25px 100px #0007; background: #fff; color: var(--ink); }
.modal::backdrop { background: #1c211ed4; backdrop-filter: blur(7px); }
.camera-modal { max-width: 490px; }
.dialog-header { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 17px; }
.dialog-header h2 { font-size: 25px; letter-spacing: -.7px; margin: 6px 0 0; }
.modal-eyebrow { color: #858c7f; font-size: 10px; letter-spacing: 1px; font-weight: 850; }
.icon-close { border: none; border-radius: 9px; width: 33px; height: 33px; background: #f1f3ed; color: #464d46; font-size: 17px; }
.camera-view { position: relative; display: grid; place-items: center; max-height: 65dvh; overflow: hidden; aspect-ratio: 3/4; border-radius: 15px; background: #191d1b; }
.camera-view video { width: 100%; height: 100%; object-fit: contain; background: #191d1b; }
.camera-view video.mirror { transform: scaleX(-1); }
.camera-face-guide { position: absolute; width: 52%; height: 53%; top: 17%; left: 24%; border: 2px dashed #fffffff0; border-radius: 50%; pointer-events: none; }
.camera-actions { display: flex; gap: 11px; margin-top: 16px; }
.camera-actions > * { flex: 1; }
.result-content { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); align-items: center; gap: 33px; }
.result-content > img { display: block; width: 100%; max-width: 310px; aspect-ratio: 3/4; object-fit: contain; border-radius: 10px; box-shadow: 0 12px 30px #1a251b1b; background: #e7e8e2; }
.result-done { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #e5f7c7; color: #39704e; font-weight: 850; font-size: 28px; }
.result-side h3 { font-size: 31px; letter-spacing: -1px; margin: 16px 0 8px; }
.result-side p { color: #7c837c; font-size: 13px; line-height: 1.5; margin: 0 0 21px; }
.result-side .button-primary, .result-side .button-secondary { display: flex; width: 100%; margin-bottom: 9px; }
.result-side small { color: #a0a49c; display: block; text-align: center; padding-top: 7px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); max-width: calc(100vw - 25px); transform: translate(-50%, 25px); opacity: 0; pointer-events: none; background: #232e26; color: #fff; padding: 13px 18px; border-radius: 11px; font-size: 12px; font-weight: 720; text-align: center; box-shadow: 0 15px 35px #0e1e1380; z-index: 50; transition: transform .2s, opacity .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Admin */
.admin-page { max-width: 1200px; margin: 0 auto 65px; padding: 38px 24px 0; }
.admin-intro { margin-bottom: 25px; }
.admin-intro .eyebrow { font-size: 10px; color: #678052; font-weight: 850; letter-spacing: 1.6px; }
.admin-intro h1 { margin: 9px 0 9px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -1.5px; line-height: 1.1; }
.admin-intro p { margin: 0; max-width: 680px; color: #777f76; font-size: 13px; line-height: 1.6; }
.admin-card { background: #fff; border: 1px solid #e9ebe4; border-radius: 24px; padding: 28px; box-shadow: 0 10px 25px #28322909; }
.admin-login { max-width: 490px; margin: 35px auto; }
.admin-login h2, .admin-topline h2 { margin: 0; font-size: 23px; letter-spacing: -.7px; }
.admin-login form { margin-top: 24px; }
.admin-login label, .upload-form label { display: block; font-size: 12px; color: #444e46; font-weight: 800; margin-bottom: 8px; }
.admin-login input, .upload-form input[type="text"], .upload-form input[type="file"], .upload-form select, .upload-form input[type="number"], .admin-default-grid select { width: 100%; min-width: 0; font-size: 13px; color: #29312d; background: #fff; border: 1px solid #dfe4dc; border-radius: 11px; padding: 12px; outline-offset: 2px; }
.admin-login button { width: 100%; margin-top: 17px; }
.admin-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 23px; }
.admin-topline h2 { font-size: 20px; }
.admin-settings { margin-bottom: 27px; padding: 23px; border: 1px solid #e5e9e0; border-radius: 19px; background: #f8faf5; }
.admin-settings h3 { font-size: 18px; margin: 0 0 16px; letter-spacing: -.4px; }
.admin-mode-toggle { display: flex; gap: 13px; align-items: center; cursor: pointer; padding: 17px; border: 1px solid #e4e9dc; border-radius: 14px; background: white; }
.admin-mode-toggle input { width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: #5a835c; }
.admin-mode-toggle strong, .admin-mode-toggle small { display: block; }
.admin-mode-toggle strong { font-size: 13px; font-weight: 800; }
.admin-mode-toggle small { color: #828880; font-size: 11px; line-height: 1.5; margin-top: 5px; }
.admin-mode-help { color: #777e76; font-size: 12px; line-height: 1.5; margin: 14px 0 18px; }
.admin-settings .is-locked .admin-mode-toggle { border-color: #bccaa5; background: #f0f6e4; }
.admin-default-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.admin-default-grid .field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
.admin-settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 17px; }
.admin-settings-actions .button-primary { padding: 12px 18px; }
.admin-settings .admin-error { min-height: 0; }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px; align-items: start; }
.upload-box { min-width: 0; background: #fff; border: 1px solid #e5e9e0; border-radius: 18px; padding: 23px; }
.admin-list { min-width: 0; padding: 17px 4px; }
.upload-box h3, .admin-list h3 { font-size: 19px; margin: 0 0 9px; letter-spacing: -.5px; }
.upload-box p, .admin-list p { font-size: 12px; line-height: 1.6; color: #7e867d; margin: 0 0 18px; }
.upload-form .field { margin-bottom: 17px; }
.upload-form input[type="file"] { font-size: 11px; }
.upload-form .button-primary { min-width: 0; }
.admin-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; }
.face-admin-options { background: #f8faf5; border: 1px solid #e5e9e0; border-radius: 13px; padding: 17px; margin: 17px 0; }
.admin-checkbox { display: flex !important; align-items: center; gap: 9px; line-height: 1.45; margin: 4px 0 14px !important; }
.admin-checkbox input { width: 17px; height: 17px; margin: 0; accent-color: #547a4c; }
.preview-admin-wrap { background: #f7f8f4; border: 1px solid #e8ebe4; border-radius: 14px; padding: 14px; text-align: center; margin: 15px 0; }
.preview-admin-wrap h4 { font-size: 13px; margin: 0 0 12px; text-align: left; }
#adminPreviewCanvas { width: min(100%, 205px); height: auto; aspect-ratio: 3/4; display: block; border-radius: 9px; margin: 0 auto; }
.anchor-picker { padding: 14px 0 0; }
.anchor-picker > span { display: block; color: #798079; font-size: 11px; margin-bottom: 9px; }
.anchor-picture { width: min(100%, 200px); margin: 0 auto; max-height: 240px; position: relative; overflow: hidden; border-radius: 8px; background: #ece9fa; cursor: crosshair; }
.anchor-picture img { width: 100%; height: 100%; display: block; object-fit: fill; }
.anchor-cross { position: absolute; transform: translate(-50%,-50%); top: 53%; left: 46%; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; font-weight: 900; font-size: 15px; line-height: 1; background: #7553c1; box-shadow: 0 1px 5px #0005; pointer-events: none; }
.admin-edit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-edit-actions .button-primary { flex: 1 1 180px; }
.admin-edit-actions .button-secondary { flex: 1 1 110px; }
.admin-item { display: flex; align-items: center; gap: 13px; min-height: 88px; padding: 10px; margin-bottom: 9px; border: 1px solid #e9ece5; border-radius: 13px; background: #fff; }
.admin-item.is-off { opacity: .53; }
.admin-item img { width: 53px; height: 68px; object-fit: contain; background: #e9ece5; border-radius: 8px; }
.admin-item-main { flex: 1; min-width: 80px; }
.admin-item-main strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-main small { color: #929990; display: block; margin-top: 5px; font-size: 11px; }
.admin-item-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.admin-smallbtn { color: #596359; border: 1px solid #e4e9e1; background: #fff; border-radius: 8px; padding: 8px; font-size: 12px; min-width: 32px; }
.admin-smallbtn:hover { color: #3f6146; background: #f2f8e9; }
.admin-smallbtn.danger:hover { color: #ac3e3e; background: #fff1f1; }
.admin-error { color: #a83e3e !important; font-size: 12px; line-height: 1.5; min-height: 20px; }
.admin-ok { color: #30794f; font-size: 12px; line-height: 1.5; min-height: 20px; }
.admin-small-note { display: inline-block; font-size: 11px; color: #9aa198; }

@media (max-width: 980px) {
  .simple-workspace { grid-template-columns: minmax(0, 1fr) minmax(300px,.8fr); gap: 13px; }
  .panel { padding: 20px; }
  .preview-panel { padding: 20px; }
  .overlay-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-columns { grid-template-columns: minmax(0,1fr); }
  .admin-list { padding: 10px 0; }
}
@media (max-width: 720px) {
  .topbar { height: 65px; padding: 0 17px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-right { gap: 9px; }
  .privacy-pill { font-size: 0; gap: 0; }
  .privacy-pill svg { width: 18px; height: 18px; }
  .admin-link { font-size: 11px; }
  .page { padding: 15px 12px 16px; }
  .simple-workspace, .simple-workspace.no-effect-choice { grid-template-columns: minmax(0,1fr); grid-template-areas: "controls" "preview" "effects"; gap: 12px; max-width: 540px; margin: 0 auto; }
  .simple-controls { padding: 21px 18px; }
  .simple-title { font-size: 26px; }
  .panel-description { margin-bottom: 17px; }
  .upload-actions { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .upload-tile { flex-wrap: wrap; align-content: start; gap: 8px; min-height: 113px; padding: 12px; }
  .tile-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; }
  .tile-copy { flex-basis: calc(100% - 50px); }
  .tile-copy strong { font-size: 12px; line-height: 1.3; }
  .tile-copy small { font-size: 10px; margin-top: 3px; }
  .tile-arrow { display: none; }
  .panel-divider { margin: 20px 0 18px; }
  .preview-panel { position: relative; top: auto; min-height: 0; padding: 19px 16px 19px; border-radius: 23px; }
  .preview-top { letter-spacing: .7px; font-size: 9px; }
  .preview-format { font-size: 9px; }
  .preview-outer { min-height: 410px; padding: 22px 0; }
  .photo-frame { width: min(100%, 268px); }
  .preview-caption { font-size: 10px; }
  .preview-panel > .preview-footer > .button-primary { max-width: 350px; }
  .simple-effects { padding: 22px 18px; }
  .overlay-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .overlay-thumbnail { height: 74px; }
  .site-footer { flex-direction: column; gap: 5px; padding-top: 22px; text-align: center; }
  .admin-page { padding: 24px 13px 0; }
  .admin-card { padding: 16px; }
  .admin-settings { padding: 15px 12px; }
  .admin-default-grid { grid-template-columns: minmax(0,1fr); }
  .admin-item { flex-wrap: wrap; }
  .admin-item-main { flex: 1 1 125px; }
  .admin-item-actions { flex: 1 1 100%; }
  .modal { padding: 18px; border-radius: 15px; width: min(94vw,900px); }
  .result-content { grid-template-columns: minmax(0,1fr); gap: 17px; }
  .result-content > img { max-width: 210px; margin: 0 auto; }
  .result-side { text-align: center; }
  .result-done { margin: 0 auto; }
  .result-side h3 { margin: 7px 0; }
}
@media (max-width: 385px) {
  .upload-tile { min-height: 124px; }
  .overlay-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .photo-frame { width: min(100%, 245px); }
  .preview-outer { min-height: 385px; }
  .topbar-right { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Feedback for the first automatic crop, without adding another panel. */
.auto-frame-status { margin: 11px 1px 0; font-size: 11px; line-height: 1.45; color: #647064; }
.auto-frame-status[hidden] { display: none; }

/* Straightening: compact by default, full controls only when requested. */
.straighten-details { border: 1px solid #e6e9e3; border-radius: 13px; margin-top: 15px; background: #fafbf8; overflow: hidden; }
.straighten-details > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 13px; font-size: 12px; font-weight: 780; color: #404b45; list-style: none; user-select: none; }
.straighten-details > summary::-webkit-details-marker { display: none; }
.straighten-details > summary:focus-visible { outline: 2px solid #5b65d8; outline-offset: -2px; }
.straighten-summary-icon { font-size: 17px; color: #656bc5; line-height: 1; }
.straighten-details output { margin-left: auto; font-size: 12px; color: #666b73; font-weight: 750; padding: 3px 7px; background: #eef0ea; border-radius: 6px; font-variant-numeric: tabular-nums; }
.straighten-details[open] > summary { border-bottom: 1px solid #e6e9e3; }
.straighten-body { padding: 13px; }
.straighten-body > label { display: block; font-size: 11px; font-weight: 760; margin: 0 0 9px; }
.straighten-body input[type="range"] { display: block; width: 100%; accent-color: #676fdd; }
.straighten-ends { display: flex; justify-content: space-between; font-size: 10px; color: #858b88; font-weight: 650; margin: 4px 0 13px; }
.straighten-actions { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, .8fr); gap: 6px; }
.straighten-actions .button-secondary { font-size: 11px; padding: 10px 5px; }

/* V9: redressement toujours visible, commande précise et accessible au toucher. */
.straighten-details { padding:14px 14px 15px; overflow:visible; }
.straighten-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:13px; }
.straighten-heading h3 { margin:0; font-size:13px; font-weight:800; letter-spacing:-.2px; color:#303a33; }
.straighten-details .straighten-heading output { margin-left:auto; min-width:54px; text-align:center; font-size:13px; padding:6px 9px; color:#30583e; background:#e9f4e3; }
.straighten-details .straighten-body { padding:0; }
.straighten-slider-row { display:flex; align-items:center; gap:11px; }
.straighten-slider-row input[type=range] { min-width:0; flex:1; height:26px; accent-color:#425f49; cursor:pointer; }
.tilt-step { border:1px solid #dfe5dc; background:white; color:#254231; border-radius:10px; height:36px; width:38px; min-width:38px; font-size:22px; line-height:1; font-weight:700; }
.tilt-step:disabled { opacity:.38; }
.straighten-details .straighten-ends { margin:2px 48px 9px; }
.straighten-precision { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.straighten-precision label { font-size:11px; color:#636f64; font-weight:750; }
.angle-input-wrap { display:flex; align-items:center; border:1px solid #dfe5dc; background:white; border-radius:9px; padding:0 10px 0 0; }
.angle-input-wrap input { width:68px; min-height:34px; padding:7px 4px 7px 10px; border:0; background:transparent; color:#213c2c; font-weight:800; font-size:13px; }
.angle-input-wrap span { color:#718074; font-size:12px; }
.straighten-precision .button-secondary { font-size:10px; margin-left:auto; padding:9px; }
.straighten-explainer { font-size:10px; line-height:1.55; color:#7b847c; margin:9px 0 0; }
.straighten-separator { height:1px; background:#e8ebe4; margin:14px 0 12px; }
.orientation-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:11px; font-weight:780; margin-bottom:9px; color:#4e5e52; }
.orientation-heading output { background:#edeff0; padding:4px 7px; border-radius:6px; color:#526055; font-variant-numeric:tabular-nums; }
.straighten-details .straighten-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
.straighten-details .straighten-actions .button-secondary { font-size:10px; line-height:1.35; padding:9px 5px; }
@media (max-width:380px) { .straighten-precision .button-secondary { width:100%; } .straighten-details .straighten-actions .button-secondary { font-size:9px; } }

/* V11 · Interaction tactile et mise en page téléphone. La zone photo vient
   immédiatement après les actions de prise/import, avant les réglages. */
.mobile-preview-tools,.mobile-action-bar { display:none; }
@media (max-width:720px) {
  html { scroll-padding-top:12px; }
  body.studio-site { overscroll-behavior-y:contain; }
  .studio-site .topbar { height:54px; padding:0 15px; }
  .studio-site .topbar .brand { font-size:17px; }
  .studio-site .topbar .brand-mark { width:32px; height:32px; }
  .studio-site .privacy-pill { display:none; }
  .studio-site .admin-link { display:inline-flex; min-height:44px; align-items:center; }
  .studio-site .page { padding:9px 10px 24px; }
  .studio-site.has-photo .page { padding-bottom:calc(95px + env(safe-area-inset-bottom)); }
  .studio-site .simple-workspace,
  .studio-site .simple-workspace.no-effect-choice {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"upload" "preview" "framing" "effects";
    gap:10px;
    max-width:540px;
    margin:0 auto;
  }
  .studio-site .simple-controls { display:contents; }
  .studio-site .capture-controls,
  .studio-site .framing-controls {
    min-width:0;
    border:1px solid #e8ebe4;
    background:#fff;
    box-shadow:0 4px 18px #28322905;
    border-radius:17px;
  }
  .studio-site .capture-controls { grid-area:upload; padding:13px 14px; }
  .capture-controls .section-overline { font-size:9px; letter-spacing:.8px; }
  .studio-site .capture-controls .simple-title { font-size:20px; letter-spacing:-.7px; margin:4px 0 11px; }
  .studio-site .capture-controls .panel-description { display:none; }
  .studio-site .capture-controls .upload-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .studio-site .capture-controls .upload-tile {
    min-height:62px; display:flex; flex-wrap:nowrap; align-items:center;
    padding:9px 10px; gap:9px; border-radius:12px;
  }
  .capture-controls .tile-icon { width:36px; height:36px; flex-basis:36px; border-radius:9px; }
  .capture-controls .tile-icon svg { width:20px; height:20px; }
  .capture-controls .tile-copy { flex-basis:auto; }
  .capture-controls .tile-copy strong { font-size:12px; line-height:1.2; }
  .capture-controls .tile-copy small { display:none; }
  .studio-site .framing-controls { grid-area:framing; padding:16px; scroll-margin-top:12px; }
  .framing-controls .panel-divider { display:none; }
  .framing-controls .simple-section-title { font-size:16px; }
  .framing-controls .controls-label { font-size:9px; }
  .framing-controls .zoom-controls { margin-top:14px; }
  .framing-controls input[type="range"] { min-height:38px; margin:5px 0 0; touch-action:pan-y; }
  .framing-controls .zoom-ends { margin-top:-1px; }
  .framing-controls .straighten-details { padding:12px; margin-top:12px; }
  .framing-controls .straighten-explainer { display:none; }
  .framing-controls .tilt-step { min-width:44px; height:44px; }
  .framing-controls .straighten-precision .button-secondary { min-height:44px; }
  .framing-controls .straighten-actions .button-secondary { min-height:44px; font-size:11px; }
  .framing-controls .secondary-actions { margin-top:12px; }
  .framing-controls .secondary-actions .button-secondary { min-height:44px; }
  .studio-site .preview-panel {
    grid-area:preview; width:100%; min-height:0; top:auto; position:relative;
    overflow:hidden; padding:13px 13px 11px; border-radius:18px;
  }
  .studio-site .preview-top { letter-spacing:.5px; }
  .studio-site .preview-format { font-size:9px; padding:6px; }
  .studio-site .preview-outer { min-height:0; padding:14px 0 10px; }
  .studio-site .photo-frame {
    width:min(100%,330px,calc((100dvh - 190px) * .75));
    border-width:4px; box-shadow:0 10px 27px #0005;
  }
  .studio-site .photo-frame.has-photo { border-width:4px; }
  .studio-site .drag-hint { font-size:10px; padding:7px 11px; bottom:5%; }
  .studio-site .stage-spark { display:none; }
  .studio-site .preview-caption { font-size:10px; margin:5px 0 0; }
  .studio-site .preview-caption span { display:none; }
  .studio-site .preview-footer > .button-primary { display:none; }
  .studio-site .mobile-preview-tools { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; margin:2px 0 7px; }
  .mobile-tool-button {
    flex:1 1 0; min-width:0; min-height:44px; padding:7px 6px;
    border-radius:10px; border:1px solid #526054; background:#2f3b35;
    color:#f1f3eb; font-size:11px; font-weight:750; line-height:1.15;
  }
  .mobile-tool-button:active { background:#43554a; }
  .studio-site .simple-effects { grid-area:effects; border-radius:17px; padding:17px 14px; scroll-margin-top:12px; }
  .studio-site .effects-header { margin-bottom:13px; }
  .studio-site .effects-header .simple-section-title { font-size:16px; }
  .studio-site .overlay-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
  .studio-site .overlay-option { min-height:90px; padding:5px; touch-action:manipulation; }
  .studio-site .overlay-thumbnail { height:60px; }
  .studio-site .overlay-name { min-height:22px; font-size:10px; margin-top:4px; }
  .studio-site .mobile-action-bar {
    position:fixed; display:block; z-index:30;
    left:0; right:0; bottom:0;
    background:rgba(255,255,255,.97);
    border-top:1px solid #dfe5da;
    box-shadow:0 -8px 26px #15251a14;
    padding:9px max(14px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
    -webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);
  }
  .mobile-action-inner { display:flex; max-width:540px; margin:0 auto; align-items:center; gap:9px; justify-content:space-between; }
  .mobile-ready-label { color:#435449; font-size:11px; line-height:1.2; font-weight:760; display:flex; gap:5px; align-items:center; }
  .mobile-ready-dot { width:7px; height:7px; background:#65a361; border-radius:50%; flex:none; }
  .mobile-submit { display:flex; justify-content:center; align-items:center; gap:18px; flex:1; max-width:270px; min-height:51px; padding:12px 16px; border:0; border-radius:12px; background:#1e2b23; color:white; font-size:14px; font-weight:800; }
  .mobile-submit:active { background:#3a4b3b; }
  .mobile-submit:disabled { opacity:.5; }
  .mobile-submit span { font-size:19px; line-height:1; }
  .studio-site .site-footer { font-size:10px; padding-top:18px; }
  .studio-site .toast { bottom:calc(86px + env(safe-area-inset-bottom)); z-index:50; }
  .studio-site:not(.has-photo) .toast { bottom:calc(20px + env(safe-area-inset-bottom)); }
  .studio-site .modal { max-width:100vw; }
  .studio-site dialog:not([open]) { display:none !important; }
  .studio-site .camera-modal {
    position:fixed; inset:0; margin:0; width:100vw; height:100dvh; max-height:100dvh;
    max-width:none; border:0; border-radius:0;
    display:flex; flex-direction:column; overflow:hidden;
    padding:calc(14px + env(safe-area-inset-top)) 14px calc(13px + env(safe-area-inset-bottom));
  }
  .studio-site .camera-modal .dialog-header { flex:none; }
  .studio-site .camera-view { flex:1; min-height:0; width:min(100%,480px); max-height:none; aspect-ratio:auto; align-self:center; }
  .studio-site .camera-view video { width:100%; height:100%; }
  .studio-site .camera-actions { flex:none; width:min(100%,480px); align-self:center; }
  .studio-site .camera-actions > button { min-height:56px; font-size:14px; }
  .studio-site .result-modal {
    position:fixed; inset:0; margin:0; width:100vw; max-width:none;
    height:100dvh; max-height:100dvh; border:0; border-radius:0;
    padding:calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y:auto; overscroll-behavior:contain;
  }
  .studio-site .result-modal .dialog-header { margin-bottom:10px; }
  .studio-site .result-modal .dialog-header h2 { font-size:22px; }
  .studio-site .result-modal .result-content { display:flex; flex-direction:column; gap:12px; }
  .studio-site .result-modal .result-content > img { width:auto; height:auto; max-height:min(48dvh,390px); max-width:min(100%,295px); margin:0 auto; }
  .studio-site .result-side { width:100%; max-width:420px; margin:0 auto; }
  .studio-site .result-done,.studio-site .result-side h3,.studio-site .result-side p { display:none; }
  .studio-site .result-side .button-primary,.studio-site .result-side .button-secondary { min-height:52px; justify-content:center; }
  .studio-site .result-side small { padding-top:3px; }
  .studio-site .icon-close { min-width:44px; min-height:44px; }
  .studio-site .button-secondary,.studio-site .button-primary { touch-action:manipulation; }
  /* Avoid Safari's automatic page zoom when a numeric field takes focus. */
  .studio-site input[type="number"] { font-size:16px; }
}
@media (max-width:390px) {
  .studio-site .capture-controls .upload-tile { padding:7px; gap:6px; }
  .studio-site .capture-controls .tile-icon { width:32px; height:32px; flex-basis:32px; }
  .studio-site .capture-controls .tile-copy strong { font-size:11px; }
  .studio-site .overlay-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .mobile-ready-label { display:none; }
  .mobile-submit { max-width:none; }
  .studio-site .photo-frame { width:min(100%,305px,calc((100dvh - 195px)*.75)); }
}
@media (max-width:720px) and (orientation:landscape) and (max-height:520px) {
  .studio-site .photo-frame { width:min(100%,calc((100dvh - 150px)*.75)); }
  .studio-site .camera-view { width:min(100%,480px); }
  .studio-site .camera-modal .dialog-header { margin-bottom:8px; }
}
@media (max-width:720px) {
  /* On small screens many admin-published effects become a swipeable strip
     instead of an extremely long wall of tiles. */
  .studio-site .overlay-grid {
    display:grid;
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:clamp(88px,25vw,112px);
    gap:9px;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    padding:3px 2px 9px;
  }
  .studio-site .overlay-option { scroll-snap-align:start; }
}

/* V12 — Free accessory placement, visible and touch-friendly next to the photo. */
.accessory-placement-toolbar {display:flex;flex-direction:column;align-items:center;gap:7px;max-width:390px;margin:9px auto 13px;text-align:center;}
.accessory-placement-toolbar[hidden],.accessory-anchor-marker[hidden] {display:none!important;}
.button-accessory-placement {min-height:44px;width:100%;max-width:300px;display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:10px 18px;border:1px solid #b5c29b;border-radius:12px;background:#d9fa82;color:#213222;font-size:13px;font-weight:800;cursor:pointer;touch-action:manipulation;}
.button-accessory-placement[aria-pressed="true"] {background:#fff;color:#23372c;border-color:#acc39e;box-shadow:0 0 0 2px #d9fa82;}
.button-accessory-placement:disabled {opacity:.5;cursor:default;}
.accessory-placement-help {font-size:11px;line-height:1.35;color:#c7cdc7;max-width:355px;}
.accessory-anchor-marker {position:absolute;z-index:5;pointer-events:none;transform:translate(-50%,-50%);width:32px;height:32px;border:2px solid #122c19;border-radius:50%;background:#dbff88d9;color:#152a1c;box-shadow:0 0 0 2px #fff,0 1px 8px #0006;display:grid;place-items:center;}
.accessory-anchor-cross {font-size:24px;line-height:1;transform:translateY(-1px);}
.accessory-anchor-caption {position:absolute;top:calc(100% + 9px);left:50%;transform:translateX(-50%);white-space:nowrap;max-width:170px;padding:5px 9px;border-radius:8px;font-size:10px;font-weight:800;background:#1c3323e6;color:#fff;}
.photo-frame.edit-accessory .face-guide {display:none;}
.photo-frame.edit-accessory .drag-hint {background:#2b4934;}
@media (max-width:720px) {
  .studio-site .accessory-placement-toolbar {margin:3px auto 9px;gap:6px;max-width:350px;}
  .studio-site .button-accessory-placement {min-height:48px;max-width:100%;font-size:13px;}
  .studio-site .accessory-placement-help {font-size:10px;}
}

/* V13: real camera field-of-view and simultaneous pinch/twist on the photo. */
.mobile-gesture-help { display: none; font-size: 11px; line-height: 1.45; color: #536057; margin: 8px 0 2px; }
.camera-device-row,.camera-hardware-zoom { width: 100%; flex: none; margin: 10px 0 0; }
.camera-device-row label,.camera-zoom-heading label { display: block; font-size: 12px; font-weight: 780; margin-bottom: 5px; }
.camera-device-row select { width: 100%; max-width: 100%; border: 1px solid #c8d1c7; border-radius: 10px; min-height: 44px; padding: 8px 12px; background: white; color: #26342c; font-size: 16px; }
.camera-zoom-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.camera-zoom-heading output { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.camera-hardware-zoom input { width: 100%; height: 28px; accent-color: #476647; }
.camera-help { font-size: 11px; color: #5e6d61; line-height: 1.4; margin: 9px 0 0; flex: none; }
.camera-device-row[hidden],.camera-hardware-zoom[hidden] { display: none !important; }
@media (max-width: 720px) {
  .mobile-gesture-help { display: block; }
  .studio-site .camera-device-row,.studio-site .camera-hardware-zoom,
  .studio-site .camera-help { width: min(100%,480px); align-self: center; }
  .studio-site .camera-device-row select { min-height: 48px; }
  .studio-site .camera-help { margin-top: 6px; }
  .studio-site .camera-modal { gap: 0; }
}


/* V15 — Camera UX: one-tap front/rear, optional lenses and a truly centered feed. */
.camera-modal { display:flex; flex-direction:column; max-width:540px; width:min(94vw,540px); max-height:min(94dvh,870px); height:min(86dvh,790px); overflow:hidden; }
.camera-modal .dialog-header { flex:none; margin-bottom:12px; }
.camera-toolbar { flex:none; display:flex; align-items:center; justify-content:space-between; gap:9px; margin-bottom:11px; }
.camera-facing-switch { display:flex; flex:1; min-width:0; gap:4px; background:#edf0e9; padding:4px; border-radius:14px; }
.camera-facing-button { flex:1; min-width:0; height:42px; border:0; background:transparent; color:#5b685c; border-radius:10px; font-size:14px; font-weight:800; }
.camera-facing-button[aria-pressed="true"] { background:#fff; color:#18281f; box-shadow:0 2px 8px #0e20121e; }
.camera-more-button { flex:none; height:49px; padding:0 12px; border:1px solid #dfe5dc; background:white; border-radius:12px; font-size:12px; color:#405347; font-weight:800; }
.camera-more-button span { display:inline-block; margin-left:3px; transition:transform .2s; }
.camera-more-button[aria-expanded="true"] span { transform:rotate(180deg); }
.camera-lens-panel { flex:none; background:#f3f5ef; border:1px solid #e1e7de; border-radius:14px; padding:9px 10px 8px; margin:-3px 0 10px; }
.camera-lens-panel > p { margin:0 0 7px; color:#5a645c; font-size:11px; font-weight:800; }
.camera-lens-list { display:flex; gap:7px; width:100%; overflow-x:auto; scrollbar-width:thin; overscroll-behavior-x:contain; padding:0 0 4px; }
.camera-lens-button { flex:none; min-height:40px; padding:7px 12px; border:1px solid #c9d4c5; background:#fff; border-radius:12px; color:#425046; font-size:12px; font-weight:750; }
.camera-lens-button[aria-pressed="true"] { background:#203b29; border-color:#203b29; color:#fff; }
.camera-stage { position:relative; flex:1; min-height:0; width:100%; padding:11px; background:#151917; border-radius:18px; display:flex; justify-content:center; align-items:center; overflow:hidden; }
.camera-stage .camera-view { position:relative; flex:none; width:min(100%,360px); height:auto; max-height:100%; max-width:100%; aspect-ratio:3/4; border-radius:11px; background:#161916; overflow:hidden; }
.camera-stage .camera-view video { display:block; width:100%; height:100%; object-fit:contain; background:#161916; }
.camera-stage .camera-face-guide { position:absolute; width:auto; height:55%; max-width:62%; aspect-ratio: .78; left:50%; top:50%; transform:translate(-50%,-50%); border:2px dashed #fffffff0; border-radius:50%; box-shadow:0 0 0 1px #151c1670; pointer-events:none; }
.camera-stage-status { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); color:#f0f3ed; background:#263229cf; padding:10px 16px; border-radius:100px; font-size:13px; font-weight:700; text-align:center; white-space:nowrap; }
.camera-modal .camera-help { flex:none; margin:9px 2px 0; line-height:1.35; color:#6b756d; font-size:11px; text-align:center; }
.camera-modal .camera-hardware-zoom { flex:none; margin:8px 0 0; }
.camera-modal .camera-hardware-zoom .camera-zoom-heading { margin-bottom:0; }
.camera-actions { flex:none; display:grid; grid-template-columns:1fr 1fr 1fr; align-items:center; gap:10px; margin-top:10px; }
.camera-flip-button { width:52px; height:52px; border:1px solid #dfe6dc; background:#f5f7f2; color:#20332a; border-radius:17px; font-size:28px; justify-self:center; font-weight:600; }
.camera-shutter { display:grid; place-items:center; width:72px; height:72px; padding:5px; border:4px solid #242e28; border-radius:50%; background:#fff; justify-self:center; touch-action:manipulation; }
.camera-shutter span { display:block; width:53px; height:53px; background:#d9fa82; border-radius:50%; border:1px solid #aec77b; }
.camera-shutter:active span { transform:scale(.88); }
.camera-actions-spacer { display:block; width:52px; }
@media (max-width:720px) {
  .studio-site .camera-modal { position:fixed; inset:0; margin:0; max-width:none; width:100vw; height:100dvh; max-height:100dvh; padding:calc(10px + env(safe-area-inset-top)) 12px calc(9px + env(safe-area-inset-bottom)); border:0; border-radius:0; }
  .studio-site .camera-modal .dialog-header { margin-bottom:10px; }
  .studio-site .camera-modal .dialog-header h2 { font-size:21px; }
  .studio-site .camera-toolbar, .studio-site .camera-lens-panel, .studio-site .camera-actions, .studio-site .camera-help, .studio-site .camera-hardware-zoom { width:100%; max-width:480px; align-self:center; }
  .studio-site .camera-stage { width:100%; max-width:480px; align-self:center; padding:9px; min-height:0; }
  .studio-site .camera-stage .camera-view { flex:none; width:min(100%,360px); height:auto; aspect-ratio:3/4; }
  .studio-site .camera-stage video { width:100%; height:100%; }
  .studio-site .camera-actions { min-height:74px; margin-top:7px; }
  .studio-site .camera-actions > button { min-height:0; font-size:inherit; }
  .studio-site .camera-flip-button { min-height:52px !important; font-size:28px !important; }
  .studio-site .camera-shutter { min-height:72px !important; }
  .studio-site .camera-help { margin-top:7px; }
}
@media (max-width:720px) and (max-height:630px) {
  .studio-site .camera-modal .dialog-header { margin-bottom:5px; }
  .studio-site .camera-toolbar { margin-bottom:5px; }
  .studio-site .camera-lens-panel { margin-bottom:5px; }
  .studio-site .camera-more-button { height:41px; }
  .studio-site .camera-facing-button { height:37px; }
  .studio-site .camera-shutter { width:60px;height:60px;min-height:60px!important; }
  .studio-site .camera-shutter span { width:43px;height:43px; }
  .studio-site .camera-actions { min-height:60px; }
  .studio-site .camera-help { display:none; }
}

/* Small landscape phones: keep the feed large instead of squeezing it below controls. */
@media (orientation:landscape) and (max-height:520px) and (max-width:950px) {
  .studio-site .camera-modal {
    position:fixed; inset:0; margin:0; width:100vw; height:100dvh;
    max-width:none; max-height:100dvh; border:0; border-radius:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(215px,35%);
    grid-template-rows:auto auto minmax(0,1fr) auto;
    grid-template-areas:"stage header" "stage toolbar" "stage zoom" "stage actions";
    gap:6px 12px; overflow:hidden;
    padding:calc(7px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  }
  .studio-site .camera-modal .dialog-header { grid-area:header; margin:0; align-items:center; }
  .studio-site .camera-modal .dialog-header h2 { font-size:18px; margin-top:1px; }
  .studio-site .camera-modal .modal-eyebrow { font-size:8px; }
  .studio-site .camera-toolbar { grid-area:toolbar; flex-direction:column; align-items:stretch; gap:5px; width:100%; margin:0; }
  .studio-site .camera-facing-switch { width:100%; flex:none; }
  .studio-site .camera-facing-button { height:32px; font-size:12px; }
  .studio-site .camera-more-button { width:100%; height:33px; font-size:11px; }
  .studio-site .camera-stage { grid-area:stage; width:100%; height:100%; max-width:none; align-self:stretch; min-height:0; padding:8px; }
  .studio-site .camera-hardware-zoom { grid-area:zoom; width:100%; align-self:center; min-width:0; margin:0; }
  .studio-site .camera-help { display:none; }
  .studio-site .camera-actions { grid-area:actions; width:100%; min-height:59px; margin:0; align-self:end; }
  .studio-site .camera-shutter { width:56px; height:56px; min-height:56px !important; border-width:3px; }
  .studio-site .camera-shutter span { width:41px; height:41px; }
  .studio-site .camera-flip-button { width:44px; height:44px; min-height:44px !important; }
  .studio-site .camera-lens-panel { position:absolute; z-index:12; right:10px; bottom:75px; width:min(260px,43vw); padding:9px; box-shadow:0 12px 30px #0005; }
}
/* CSS grid/flex must never make a closed native dialog visible. */
dialog:not([open]) { display:none !important; }
