:root {
  --top-gap: calc(max(env(safe-area-inset-top, 0px), 16px) + 30px);
  --bg: #0a0a0d;
  --surface: #15151b;
  --surface-2: #1d1d25;
  --stroke: rgba(255,255,255,.08);
  --text: #f5f5f7;
  --muted: #8f8f9c;
  --accent: #ffd60a;
  --accent-2: #ff9f0a;
  --brand: linear-gradient(135deg, #ffd60a 0%, #ffb20a 55%, #ff8a0a 100%);
  --rec: #ff3b30;
  --ok: #30d158;
  --ease: cubic-bezier(.22,.8,.24,1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button, label { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sprite { display: none; }
.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
#safeProbe { position: fixed; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }

/* ---------- pantallas ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.screen.active { display: flex; animation: enter .28s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#cam.screen.active { animation: camIn .32s var(--ease); background: #000; }
@keyframes camIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

.top { display: flex; align-items: center; gap: 8px; flex: none;
  padding: var(--top-gap) calc(env(safe-area-inset-right, 0px) + 16px) 14px calc(env(safe-area-inset-left, 0px) + 16px); }
.grow { flex: 1; }
.brand { flex: 1; display: flex; align-items: center; gap: 11px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 6px 20px rgba(255,214,10,.15); }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
  transition: transform .15s var(--ease), background .2s; }
.round:active { transform: scale(.9); }
.round.sm { width: 36px; height: 36px; }
.round.sm .i { width: 20px; height: 20px; }

.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 96px) calc(env(safe-area-inset-left, 0px) + 16px); }

.hero { width: 100%; display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 24px; text-align: left;
  background: var(--brand); color: #1a1300; box-shadow: 0 14px 40px -12px rgba(255,170,10,.55);
  transition: transform .18s var(--ease); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.18); }
.hero:active { transform: scale(.97); }
.hero-icon { width: 52px; height: 52px; border-radius: 16px; background: rgba(0,0,0,.85); color: var(--accent); display: grid; place-items: center; flex: none; }
.hero-icon .i { width: 28px; height: 28px; stroke-width: 2.6; }
.hero-txt b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.hero-txt small { display: block; font-size: 14px; opacity: .75; margin-top: 2px; font-weight: 500; }

.section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 28px 4px 12px; }
#scriptList { display: flex; flex-direction: column; gap: 10px; }
.card-wrap { position: relative; border-radius: 20px; overflow: hidden; animation: rise .35s var(--ease) both;
  transition: opacity .25s, transform .25s var(--ease), max-height .25s; max-height: 200px; }
.card-wrap.gone { opacity: 0; transform: translateX(-30px); max-height: 0; }
.card-del { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: var(--rec); color: #fff; font-size: 13px; font-weight: 700; }
.card { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--stroke); border-radius: 20px;
  touch-action: pan-y; will-change: transform; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card-main { flex: 1; min-width: 0; text-align: left; padding: 16px 6px 16px 18px; }
.card-title { display: block; font-weight: 700; font-size: 17px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-prev { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; gap: 6px; margin-top: 10px; }
.pill { font-size: 12px; font-weight: 600; color: #c9c9d3; background: var(--surface-2); padding: 4px 9px; border-radius: 99px; }
.card-go { width: 56px; height: 56px; margin: 0 14px 0 6px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--rec); color: #fff; box-shadow: 0 8px 22px -6px rgba(255,59,48,.65); transition: transform .15s var(--ease); }
.card-go:active { transform: scale(.88); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .i { width: 40px; height: 40px; color: var(--accent); }

.install { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px;
  background: var(--surface-2); border: 1px solid var(--stroke); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: rise .4s var(--ease) both .3s; }
.install span { flex: 1; }
.install b { color: var(--accent); font-weight: 650; }

/* ---------- editor ---------- */
.ed-title { flex: none; background: transparent; border: 0; outline: none; color: var(--text);
  font: 800 30px/1.15 inherit; font-family: inherit; letter-spacing: -.6px;
  padding: 4px calc(env(safe-area-inset-right, 0px) + 20px) 8px calc(env(safe-area-inset-left, 0px) + 20px); }
.ed-title::placeholder { color: #45454f; }
#edText { flex: 1; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: #e9e9ee;
  padding: 8px calc(env(safe-area-inset-right, 0px) + 20px) 20px calc(env(safe-area-inset-left, 0px) + 20px); font: 19px/1.65 inherit; font-family: inherit; }
#edText::placeholder { color: #4a4a55; }
.ed-bar { flex: none; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--stroke); background: var(--bg);
  padding: 12px calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 20px); }
#edStats { flex: 1; font-size: 14px; color: var(--muted); }

.cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: 99px;
  background: var(--brand); color: #1a1300; font-weight: 800; font-size: 17px; letter-spacing: -.2px;
  box-shadow: 0 10px 28px -10px rgba(255,170,10,.7); transition: transform .15s var(--ease), background .3s; }
.cta:active { transform: scale(.95); }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 99px;
  background: rgba(255,255,255,.14); font-weight: 700; font-size: 16px; transition: transform .15s var(--ease); }
.ghost:active { transform: scale(.95); }

/* ---------- cámara ---------- */
#stage { position: absolute; inset: 0; overflow: hidden; background: #000; touch-action: none; }
#preview { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .16s ease; }
#stage.live #preview { opacity: 1; }
#preview.mirror, #freeze.mirror { transform: scaleX(-1); }
#freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none;
  filter: blur(18px) brightness(.8); transition: opacity .25s ease; }
#freeze.on { opacity: 1; transition: none; }
#grid { position: absolute; inset: 0; pointer-events: none; }
#grid i { position: absolute; background: rgba(255,255,255,.22); }
#grid i:nth-child(1) { left: 33.33%; top: 0; bottom: 0; width: 1px; }
#grid i:nth-child(2) { left: 66.66%; top: 0; bottom: 0; width: 1px; }
#grid i:nth-child(3) { top: 33.33%; left: 0; right: 0; height: 1px; }
#grid i:nth-child(4) { top: 66.66%; left: 0; right: 0; height: 1px; }

/* teleprompter: sin máscaras ni desenfoques (se mueve solo por GPU) */
#prompter { position: absolute; overflow: hidden; border-radius: 24px; touch-action: none; background: rgba(0,0,0,.46); contain: strict; }
#ptext { position: absolute; left: 0; right: 0; top: 0; padding: 0 22px 60vh; will-change: transform; transform: translate3d(0,0,0);
  font-weight: 700; color: #fff; letter-spacing: -.1px; word-break: break-word; }
#ptext p { margin: 0 0 .65em; }
#ptext .cue { color: var(--accent); font-style: italic; font-weight: 600; font-size: .72em; }
.fade { position: absolute; left: 0; right: 0; pointer-events: none; }
.fade-top { top: 0; height: 18%; background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,0)); }
.fade-bottom { bottom: 0; height: 30%; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.7)); }
#readmark { position: absolute; left: 6px; width: 4px; border-radius: 4px; background: var(--accent); pointer-events: none; opacity: .9; }
#pReset { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); color: #fff; }
#pReset .i { width: 18px; height: 18px; }
#hear { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); transition: color .15s, background .15s, transform .15s; }
#hear .i { width: 16px; height: 16px; }
#prompter.hearing #hear { color: #04230d; background: var(--ok); transform: scale(1.08); }
#prompter.manual #hear { display: none; }

#eye { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; display: grid; place-items: center;
  color: var(--accent); pointer-events: none; z-index: 5; transform: rotate(var(--rot, 0deg)); }
#eye .i { width: 34px; height: 34px; stroke-width: 3; animation: nudge 1.3s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255,214,10,.6)); }
@keyframes nudge { 0%, 100% { transform: translateY(3px); opacity: .7; } 50% { transform: translateY(-4px); opacity: 1; } }

#zoomPill { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 236px); transform: translateX(-50%);
  background: rgba(0,0,0,.6); padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--accent);
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 7; }
#zoomPill.on { opacity: 1; }

#camMsg { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 30px 30px 220px; text-align: center; background: rgba(0,0,0,.85); line-height: 1.5; font-size: 16px; }
#countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 150px; font-weight: 800; color: #fff;
  text-shadow: 0 6px 40px rgba(0,0,0,.6); z-index: 9; pointer-events: none; }
#countdown.tick { animation: pop .9s var(--ease); }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } 25% { opacity: 1; } to { transform: scale(1); opacity: .85; } }
#busy { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0,0,0,.35); }
#busy i { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px calc(env(safe-area-inset-right, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 14px) calc(env(safe-area-inset-left, 0px) + 14px);
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.55) 45%, rgba(0,0,0,.75)); pointer-events: none; }
#bottom > * { pointer-events: auto; }
#tools { display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 440px; transition: opacity .25s, transform .25s var(--ease); }
.tool { flex: 1; max-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6); transition: transform .15s var(--ease); }
.tool:active { transform: scale(.88); }
.tool-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.tool.on .tool-ic { background: var(--accent); color: #1a1300; }
.tool .ic-pause { display: none; }
.tool.running .ic-play { display: none; }
.tool.running .ic-pause { display: block; }
.tool.running .tool-ic { background: #fff; color: #000; }

.mid { position: relative; height: 32px; display: grid; place-items: center; width: 100%; }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: rgba(0,0,0,.35); transition: opacity .25s; }
.tabs button { height: 26px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.6); transition: all .2s; }
.tabs button.on { background: #fff; color: #000; }
#recPill { position: absolute; display: flex; align-items: center; gap: 7px; background: var(--rec); color: #fff; padding: 5px 12px; border-radius: 99px;
  font-size: 15px; font-variant-numeric: tabular-nums; opacity: 0; transform: scale(.8); transition: all .25s var(--ease); pointer-events: none; }
#recPill i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.shutter-row { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 360px; }
.round.lg { width: 50px; height: 50px; background: rgba(255,255,255,.16); }
.round.lg .i { width: 26px; height: 26px; }
#flipBtn .i { transition: transform .45s var(--ease); }
#flipBtn.spin .i { transform: rotate(180deg); }
#recBtn { width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; position: relative;
  border: 5px solid rgba(255,255,255,.95); transition: transform .15s var(--ease); }
#recBtn:active { transform: scale(.92); }
#recBtn span { width: 64px; height: 64px; border-radius: 50%; background: var(--rec); transition: all .25s var(--ease); }

/* grabando */
#cam.recording #recBtn { border-color: rgba(255,255,255,.5); }
#cam.recording #recBtn span { width: 32px; height: 32px; border-radius: 8px; }
#cam.recording #recPill { opacity: 1; transform: none; }
#cam.recording #formats, #cam.recording #camClose, #cam.recording #flipBtn, #cam.recording #tTimer, #cam.recording #tMore { opacity: 0; pointer-events: none; }
#cam.counting #tools, #cam.counting #formats { opacity: 0; pointer-events: none; }

/* cámara en horizontal: controles del lado opuesto al lente */
#cam.land #bottom { top: 0; bottom: 0; left: auto; right: 0; width: auto; flex-direction: row; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 10px) 40px;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.55) 40%, rgba(0,0,0,.75)); }
#cam.land.cam-right #bottom { right: auto; left: 0; flex-direction: row-reverse;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 40px calc(env(safe-area-inset-bottom, 0px) + 10px) calc(env(safe-area-inset-left, 0px) + 14px);
  background: linear-gradient(270deg, rgba(0,0,0,0), rgba(0,0,0,.55) 40%, rgba(0,0,0,.75)); }
#cam.land .shutter-row { flex-direction: column; width: auto; height: 100%; max-height: 330px; }
#cam.land #tools { flex-direction: column; width: auto; gap: 8px; }
#cam.land .tool { max-width: none; }
#cam.land .tool-ic { width: 40px; height: 40px; }
#cam.land .tool > span:not(.tool-ic) { display: none; }
#cam.land #tools { gap: 10px; }
#cam.land .mid { width: auto; height: auto; }
#cam.land .tabs { flex-direction: column; }
#cam.land #zoomPill { bottom: 20px; }

/* popover de herramientas */
#popCatch { position: absolute; inset: 0; z-index: 7; }
#pop { position: absolute; z-index: 8; width: min(340px, calc(100vw - 24px)); padding: 16px 16px 8px; border-radius: 22px;
  background: rgba(24,24,30,.97); border: 1px solid var(--stroke); box-shadow: 0 20px 50px rgba(0,0,0,.6);
  animation: popIn .22s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
#pop > div { display: none; }
#pop > div.on { display: block; }

/* ---------- controles de formulario ---------- */
.field { margin: 12px 0 14px; }
.field label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.field output { color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.16); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.16); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; }
.seg { display: flex; background: rgba(255,255,255,.08); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 36px; border-radius: 9px; font-size: 14px; font-weight: 650; color: var(--muted); transition: all .2s; }
.seg button.on { background: #fff; color: #000; }
.seg button:disabled { opacity: .3; pointer-events: none; }
.caps { color: var(--muted); font-size: 12px; line-height: 1.4; }
.switch { -webkit-appearance: none; appearance: none; width: 50px; height: 30px; border-radius: 99px; background: rgba(255,255,255,.18);
  position: relative; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform .22s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- revisión ---------- */
#review { position: absolute; inset: 0; z-index: 10; background: #000; display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: scale(1.03); transition: opacity .28s var(--ease), transform .28s var(--ease); }
#review.open { opacity: 1; transform: none; }
#revVideo { width: 100%; height: 100%; object-fit: contain; background: #000; }
.rev-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: var(--top-gap) calc(env(safe-area-inset-right, 0px) + 14px) 30px calc(env(safe-area-inset-left, 0px) + 14px);
  background: linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,0)); }
.rev-top .round { background: rgba(255,255,255,.16); }
#revSound { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 16px; animation: popIn .25s var(--ease); }
#revInfo { font-size: 14px; font-weight: 600; color: #ddd; }
.rev-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; justify-content: center;
  padding: 40px calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 70px) calc(env(safe-area-inset-left, 0px) + 16px);
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.7)); pointer-events: none; }
.rev-bottom > * { pointer-events: auto; }
#revSave { min-width: 170px; }
#revSave .ic-ok { display: none; }
#revSave.done { background: var(--ok); color: #03200b; box-shadow: 0 10px 28px -10px rgba(48,209,88,.7); }
#revSave.done .ic-ok { display: block; animation: checkIn .4s var(--ease); }
#revSave.done .ic-dl { display: none; }
@keyframes checkIn { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }

/* ---------- panel de ajustes ---------- */
#backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 90%; display: flex; flex-direction: column;
  background: #121217; border-radius: 26px 26px 0 0; border-top: 1px solid var(--stroke); max-width: 620px; margin: 0 auto;
  transform: translateY(105%); transition: transform .32s var(--ease); }
.sheet.open { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; padding: 10px 16px 4px 22px; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 24px) calc(env(safe-area-inset-left, 0px) + 16px); }
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 8px 8px; }
.group { background: var(--surface); border-radius: 18px; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 16px; font-size: 16px; }
.row + .row { border-top: 1px solid var(--stroke); }
.row.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
.foot { color: var(--muted); font-size: 13px; text-align: center; margin: 22px 10px 4px; line-height: 1.5; }

/* ---------- aviso ---------- */
#toast { position: fixed; left: 50%; top: calc(var(--top-gap) + 52px); z-index: 40;
  display: flex; align-items: center; gap: 8px; max-width: 88%; padding: 11px 18px; border-radius: 99px;
  background: rgba(28,28,34,.97); border: 1px solid var(--stroke); font-size: 15px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); pointer-events: none;
  opacity: 0; transform: translate(-50%, -16px) scale(.96); transition: all .3s var(--ease); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .i { display: none; width: 20px; height: 20px; stroke-width: 2.8; }
#toast.ok { background: var(--ok); color: #03200b; border-color: transparent; }
#toast.ok .i { display: block; }
#toast.act { pointer-events: auto; padding-right: 8px; }
#toastAction { color: var(--accent); font-weight: 800; font-size: 15px; padding: 6px 12px; border-radius: 99px; background: rgba(255,214,10,.12); margin-left: 6px; }

#stage { perspective: 1200px; }
#stage.flipping #preview, #stage.flipping #freeze { animation: flipCam .42s var(--ease); }
@keyframes flipCam { 0% { transform: rotateY(0) scale(1); } 45% { transform: rotateY(80deg) scale(.94); } 55% { transform: rotateY(-80deg) scale(.94); } 100% { transform: rotateY(0) scale(1); } }
#stage.flipping #preview.mirror, #stage.flipping #freeze.mirror { animation-name: flipCamM; }
@keyframes flipCamM { 0% { transform: scaleX(-1) rotateY(0); } 45% { transform: scaleX(-1) rotateY(80deg) scale(.94); } 55% { transform: scaleX(-1) rotateY(-80deg) scale(.94); } 100% { transform: scaleX(-1) rotateY(0); } }

/* zoom como la cámara del celular */
#zoomChips { display: flex; gap: 6px; padding: 4px; border-radius: 99px; background: rgba(0,0,0,.35); }
#zoomChips button { min-width: 36px; height: 36px; padding: 0 6px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.12); transition: all .2s var(--ease); }
#zoomChips button.on { color: var(--accent); background: rgba(0,0,0,.6); transform: scale(1.12); }
#cam.land #zoomChips { flex-direction: column; }

/* imagen procesada (estabilización / recorte): misma vista que lo que se graba */
#glview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; }
#glview.mirror { transform: scaleX(-1); }
#cam.gl #glview { opacity: 1; }
#stage.flipping #glview { animation: flipCam .42s var(--ease); }
#stage.flipping #glview.mirror { animation-name: flipCamM; }
.row-note { margin: -4px 16px 8px; }
/* tocar para enfocar */
#focusRing { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border: 1.5px solid var(--accent); border-radius: 6px;
  pointer-events: none; opacity: 0; z-index: 4; }
#focusRing.on { animation: focus 1.1s var(--ease) forwards; }
@keyframes focus { 0% { opacity: 0; transform: scale(1.5); } 15% { opacity: 1; transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(.96); } }
