@font-face { font-family: Manrope; src: url(fonts/manrope.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Sora; src: url(fonts/sora.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: Montserrat; src: url(fonts/montserrat.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Lexend; src: url(fonts/lexend.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #08080B;
  --panel: #131318;
  --panel-2: #1B1B22;
  --line: #292932;
  --ink: #F4F4F6;
  --muted: #9C9CA8;
  --brand: #FF4200;
  --brand-hover: #FF5A1F;
  --blue: #2A23B4;
  --danger: #FF4D57;
  --r-lg: 18px;
  --r: 12px;
  --ui: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: Sora, Manrope, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
symbol .fill, .fill { fill: currentColor; stroke: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; margin: 0; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 216px 1fr; height: 100dvh; }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 26px 14px; border-right: 1px solid var(--line); }
.rail-logo { width: 96px; margin: 0 10px 26px; display: block; }
.rail-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r); color: var(--muted); font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.rail-item:hover { color: var(--ink); background: var(--panel); }
.rail-item.on { color: var(--ink); background: var(--panel-2); }
.view { overflow-y: auto; min-width: 0; padding: 34px clamp(18px, 4vw, 52px) 60px; }
.page { max-width: 880px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.actions { display: flex; gap: 8px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: #24242D; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { color: var(--danger); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--panel-2); }
.icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--ink); transition: background .15s; }
.icon:hover { background: rgba(255,255,255,.1); }
.icon.on { background: #fff; color: #000; }

/* Lista de roteiros */
.search { position: relative; margin-bottom: 14px; }
.search .ic { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.search input::placeholder { color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, background .15s; }
.row:hover { border-color: #3B3B47; background: #16161C; }
.row-main { flex: 1; min-width: 0; text-align: left; padding: 8px 0; }
.row-main strong { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main span { display: block; color: var(--muted); font-size: 13px; }
.row-play { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); transition: background .15s, color .15s; }
.row-play:hover { background: var(--brand); color: #fff; }
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.empty .actions { justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.drop-on .view { outline: 2px dashed var(--brand); outline-offset: -10px; }

/* Menu */
.menu { position: fixed; z-index: 60; min-width: 180px; padding: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; font-weight: 600; }
.menu button:hover { background: rgba(255,255,255,.08); }
.menu button.danger { color: var(--danger); }

/* Editor */
.editor { display: grid; grid-template-columns: 1fr 240px; gap: 20px; height: calc(100dvh - 94px); max-width: 1120px; margin: 0 auto; }
.editor-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-top { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.editor-title { flex: 1; min-width: 0; height: 44px; background: none; border: 0; font: 600 24px var(--display); letter-spacing: -.02em; }
.editor-title:focus { outline: 0; }
.editor-tools { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.editor-tools .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.editor-text { flex: 1; width: 100%; min-height: 200px; resize: none; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); font-size: 17px; line-height: 1.65; }
.editor-text:focus { outline: 0; border-color: #4A4A58; }
.editor-side { display: flex; flex-direction: column; gap: 12px; padding-top: 56px; }
.editor-side .btn { width: 100%; height: 50px; font-size: 16px; }
.stats { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 16px; }
.stats div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stats div:last-child { border: 0; }
.stats span { color: var(--muted); }
.stats b { font-weight: 700; font-variant-numeric: tabular-nums; }
.saved { color: var(--muted); font-size: 13px; text-align: center; }

/* Gravações */
.takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.take { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.take video { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #000; cursor: pointer; }
.take-info { padding: 12px 14px 4px; }
.take-info strong { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.take-info span { color: var(--muted); font-size: 13px; }
.take-actions { display: flex; justify-content: flex-end; padding: 2px 6px 6px; }
.note { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* Ajustes */
details.fold { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 8px; }
details.fold summary { padding: 16px 18px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: '+'; font-size: 20px; line-height: 1; color: var(--muted); }
details.fold[open] summary::after { content: '\2212'; }
.fold-body { padding: 0 18px 18px; color: #C9C9D2; }
.fold-body p { margin: 0 0 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
kbd { font: 600 12px var(--ui); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; white-space: nowrap; justify-self: start; }
.compat { width: 100%; border-collapse: collapse; font-size: 14px; }
.compat th, .compat td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.compat th { color: var(--muted); font-weight: 600; }

/* Diálogo */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; max-width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog h3 { font-size: 18px; margin-bottom: 8px; }
dialog p { color: var(--muted); margin: 0 0 18px; }
dialog .actions { justify-content: flex-end; }
dialog.player { max-width: min(960px, calc(100vw - 32px)); padding: 10px; }
dialog.player video { display: block; max-width: 100%; max-height: 76vh; border-radius: var(--r); margin: auto; background: #000; }
dialog.player .actions { padding-top: 10px; }

/* Avisos */
.toasts { position: fixed; z-index: 80; top: calc(16px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.5); font-weight: 600; animation: toast .2s ease-out; }
.toast button { color: var(--brand-hover); font-weight: 700; }
@keyframes toast { from { opacity: 0; transform: translateY(-6px); } }

/* Prompter */
.prompter { position: fixed; inset: 0; z-index: 40; background: #000; overflow: hidden; }
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--p-bg, #000); color: var(--p-ink, #fff); user-select: none; -webkit-user-select: none; touch-action: none; cursor: default; }
.mirror-box { position: absolute; inset: 0; transform: scale(var(--flip-x, 1), var(--flip-y, 1)); }
.column { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--col, 100%); transform: translateX(-50%); padding: 0 max(var(--margin, 10%), var(--safe-r), var(--safe-l)); overflow: hidden; }
.fade { position: absolute; left: 0; right: 0; pointer-events: none; display: none; }
.foco .fade { display: block; }
.fade.top { top: 0; height: var(--guide, 30%); background: linear-gradient(color-mix(in srgb, var(--fade-c, #000) 82%, transparent), transparent); }
.fade.bottom { bottom: 0; height: calc(100% - var(--guide, 30%) - 32%); background: linear-gradient(transparent, color-mix(in srgb, var(--fade-c, #000) 86%, transparent)); }
.text { position: relative; font-family: var(--p-font, Manrope), system-ui, sans-serif; font-size: var(--p-size, 64px); line-height: var(--p-lh, 1.4); font-weight: var(--p-weight, 600); text-align: var(--p-align, left); will-change: transform; overflow-wrap: anywhere; }
.text p { margin: 0 0 .55em; min-height: 1em; }
.text .w { transition: opacity .25s; }
.text .w.done { opacity: .38; }
.text em { font-style: normal; color: var(--p-accent, #FF7A45); }
.text .sec { font-size: .5em; font-weight: 700; letter-spacing: .02em; color: var(--p-muted, #A8A8B4); margin: 1.4em 0 .6em; line-height: 1.3; }
.text .pause { font-size: .36em; font-weight: 700; color: var(--p-ink); opacity: .75; border-top: 2px dashed currentColor; padding-top: .5em; margin: 0 0 1.4em; line-height: 1.3; }
.text .end-space { height: 70vh; }
.guide { position: absolute; left: 0; right: 0; top: var(--guide, 30%); height: calc(var(--p-size, 64px) * var(--p-lh, 1.4)); pointer-events: none; }
.guide::before, .guide::after { content: ''; position: absolute; top: 50%; border-style: solid; border-color: transparent; border-width: 11px 0 11px 15px; border-left-color: var(--p-accent, #FF7A45); transform: translateY(-50%); }
.guide::before { left: 6px; }
.guide::after { right: 6px; transform: translateY(-50%) scaleX(-1); }
.guide.off { display: none; }

.cam-frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: var(--cam-w, 100%); height: var(--cam-h, 100%); background: #000; }
.cam-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-frame::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,var(--cam-dim, .45)); }
.cam-frame.selfie video { transform: scaleX(-1); }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); font: 700 min(38vh, 38vw)/1 var(--display); color: #fff; z-index: 3; }
.mini { display: none; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); gap: 4px; padding: 4px; background: rgba(20,20,26,.86); border-radius: 12px; z-index: 4; }
.mini button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #fff; }
.mini button:hover { background: rgba(255,255,255,.14); }
body.in-pip { background: #000; overflow: hidden; }
.in-pip .mini { display: flex; }

.progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.1); z-index: 5; }
#progressBar { height: 100%; width: 0; background: var(--brand); }

.p-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 22px calc(8px + var(--safe-l)); background: linear-gradient(rgba(0,0,0,.72), transparent); z-index: 5; transition: opacity .25s; }
.p-top .icon { color: #fff; }
.p-top .icon.on { color: #000; }
.p-title { flex: 1; min-width: 0; }
.p-title strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; line-height: 1.3; }
.p-title span { display: block; color: rgba(255,255,255,.72); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.p-tools { display: flex; gap: 2px; }

.dock { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 30px calc(10px + var(--safe-r)) calc(14px + var(--safe-b)) calc(10px + var(--safe-l)); background: linear-gradient(transparent, rgba(0,0,0,.78)); z-index: 5; transition: opacity .25s; }
.dock .icon { color: #fff; }
.dock .icon.on { color: #000; }
.dock-center { display: flex; align-items: center; gap: 12px; }
.stepper { display: flex; align-items: center; height: 52px; padding: 0 4px; border-radius: 16px; background: rgba(32,32,40,.9); color: #fff; }
.stepper > button:not(.stepper-value) { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 12px; }
.stepper > button:not(.stepper-value):hover { background: rgba(255,255,255,.1); }
.stepper-value { display: flex; flex-direction: column; align-items: center; min-width: 66px; line-height: 1.15; color: #fff; }
button.stepper-value { border-radius: 10px; padding: 5px 2px; }
button.stepper-value:hover { background: rgba(255,255,255,.1); }
.stepper-value b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper-value small { font-size: 11px; color: rgba(255,255,255,.66); font-weight: 600; }
.stepper.voice > button:not(.stepper-value) { display: none; }
.play { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--brand); color: #fff; transition: transform .12s, background .15s; flex: none; }
.play:hover { background: var(--brand-hover); }
.play:active { transform: scale(.94); }
.play .ic { width: 30px; height: 30px; }
.rec:disabled { opacity: .5; }
.rec { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; flex: none; }
.rec i { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--danger); transition: all .15s; }
.rec.on i { width: 20px; height: 20px; border-radius: 5px; }
.rec-badge { position: absolute; top: calc(16px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: rgba(0,0,0,.72); border-radius: 10px; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; z-index: 6; }
.rec-badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.prompter.idle .p-top, .prompter.idle .dock { opacity: 0; pointer-events: none; }
.prompter.idle .stage { cursor: none; }

/* Margem lateral: arrasta direto na tela com o texto pausado */
.alca { position: absolute; top: 22%; bottom: 22%; width: 44px; margin-left: -22px; display: grid; place-items: center; z-index: 4; touch-action: none; cursor: ew-resize; transition: opacity .25s; }
.alca i { display: block; width: 4px; height: 64px; border-radius: 2px; background: #fff; opacity: .55; box-shadow: 0 0 0 1px rgba(0,0,0,.45); transition: opacity .15s, height .15s; }
.alca:hover i, .alca.ativa i { opacity: 1; }
.alca.ativa i { height: 100%; }
.prompter.tocando .alca, .prompter.idle .alca, .prompter.contando .alca { display: none; }
.alca-valor { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 8px 14px; background: rgba(0,0,0,.82); color: #fff; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; z-index: 6; pointer-events: none; }

/* Painel de ajustes */
.prompter.com-sheet #sizeStep { display: none !important; }
@media (min-width: 761px), (max-height: 500px) {
  .prompter.com-sheet .stage, .prompter.com-sheet .dock, .prompter.com-sheet .p-top, .prompter.com-sheet .progress { right: var(--sheet-w, 370px); }
}
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: var(--sheet-w, 370px); max-width: 100%; display: flex; flex-direction: column; background: rgba(19,19,24,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-left: 1px solid var(--line); z-index: 7; }
.sheet-head { display: flex; align-items: center; gap: 4px; padding: calc(10px + var(--safe-t)) 8px 10px 12px; border-bottom: 1px solid var(--line); }
.tabs { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 7px 8px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--panel-2); color: var(--ink); }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(24px + var(--safe-b)); }
.field { margin-bottom: 20px; }
.field > label, .field > .label { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field > label output { color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet-body > .hint { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: -12px 0 20px; }
.field .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
input[type=range] { width: 100%; accent-color: #fff; height: 24px; margin: 0; }
.seg { display: flex; gap: 3px; padding: 3px; background: var(--panel-2); border-radius: 11px; }
.seg button { flex: 1; min-width: 0; padding: 7px 4px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: 13px; }
.seg button.on { background: #fff; color: #000; }
.seg button:disabled { opacity: .35; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 45%; }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 12px; background: #3A3A46; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.check input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.check input:checked { background: var(--brand); }
.check input:checked::after { left: 21px; }
select.input, input.input { width: 100%; height: 40px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.swatches { display: flex; gap: 8px; }
.swatch { flex: 1; height: 46px; border-radius: 10px; border: 2px solid var(--line); font-weight: 800; font-size: 16px; }
.swatch.on { border-color: #fff; }
.sec-list button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; font-weight: 600; }
.sec-list button:hover { background: var(--panel-2); }
.time-input { display: flex; align-items: center; gap: 6px; }
.time-input input { width: 70px; text-align: center; }

/* Celular */
@media (max-width: 760px), (max-height: 500px) {
  /* Fica abaixo da barra do prompter, sem cobrir os botões de cima. */
  .toasts { top: calc(60px + var(--safe-t)); }
}
.so-celular { display: none; }
.aviso-topo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-lg); font-size: 14px; }
.aviso-topo span { flex: 1; }
.aviso-topo .btn { height: 38px; padding: 0 12px; font-size: 14px; flex: none; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { order: 2; flex-direction: row; padding: 6px 8px calc(6px + var(--safe-b)); border-right: 0; border-top: 1px solid var(--line); gap: 2px; }
  .rail-logo { display: none; }
  .rail-item { flex: 1; flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 12px; align-items: center; min-height: 52px; justify-content: center; }
  .view { padding: calc(18px + var(--safe-t)) 16px 32px; }
  .page-head h1 { font-size: 24px; }
  .page-head .btn { height: 44px; }
  .so-celular { display: inline-flex; }
  .so-grande { display: none; }
  .editor { display: flex; flex-direction: column; height: calc(100dvh - 118px - var(--safe-t) - var(--safe-b)); gap: 10px; }
  .editor-main { flex: 1; }
  .editor-title { font-size: 20px; }
  .editor-top { margin-bottom: 8px; }
  .editor-text { min-height: 0; font-size: 16px; padding: 14px; }
  .editor-side { padding-top: 0; flex-direction: row; align-items: center; gap: 10px; }
  .editor-side > .btn { display: none; }
  .stats { display: flex; flex: 1; padding: 2px 8px; }
  .stats div { flex: 1; flex-direction: column; align-items: center; border: 0; padding: 4px 0; font-size: 12px; gap: 0; }
  .saved { display: none; }
  .row { padding: 6px 6px 6px 14px; }
  .icon { width: 44px; height: 44px; }
  .p-title strong { font-size: 14px; }
  .p-title span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock { padding: 26px calc(6px + var(--safe-r)) calc(10px + var(--safe-b)) calc(6px + var(--safe-l)); }
  .dock-center { gap: 6px; }
  .stepper { height: 48px; padding: 0 2px; border-radius: 14px; }
  .stepper > button:not(.stepper-value) { width: 36px; height: 44px; }
  .stepper-value { min-width: 46px; }
  .stepper-value b { font-size: 14px; }
  .stepper-value small { font-size: 10px; }
  .play { width: 60px; height: 60px; }
  .rec { width: 50px; height: 50px; }
  .rec i { width: 30px; height: 30px; }
  .sheet { top: auto; left: 0; width: 100%; height: min(70dvh, 560px); border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .seg button { min-height: 40px; }
  .tabs button { padding: 9px 8px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 430px) {
  .stepper > button:not(.stepper-value) { width: 40px; }
  .stepper-value { min-width: 42px; }
  .stepper-value small { font-size: 9px; letter-spacing: -.01em; }
  /* Câmera ligada em tela estreita: gravar vale mais que o tamanho do texto, que continua em Ajustes. */
  .dock.com-rec #sizeStep { display: none; }
}
@media (max-width: 345px) {
  .stepper > button:not(.stepper-value) { width: 34px; }
  .stepper-value { min-width: 38px; }
  .play { width: 54px; height: 54px; }
  .p-title span { display: none; }
}
/* Celular deitado: pouca altura, os controles não podem cobrir o texto */
@media (max-height: 500px) {
  :root { --sheet-w: min(340px, 50vw); }
  .shell { grid-template-columns: calc(72px + var(--safe-l)) 1fr; grid-template-rows: 1fr; }
  .rail { order: 0; flex-direction: column; padding: 8px 6px 8px calc(6px + var(--safe-l)); border-right: 1px solid var(--line); border-top: 0; }
  .rail-logo { display: none; }
  .rail-item { flex: none; flex-direction: column; gap: 2px; padding: 8px 2px; font-size: 11px; align-items: center; justify-content: center; }
  .view { padding: 12px calc(14px + var(--safe-r)) 16px 14px; }
  .page-head { margin-bottom: 10px; }
  .editor { display: flex; flex-direction: column; height: calc(100dvh - 28px); gap: 0; }
  .editor-main { flex: 1; }
  .editor-side { display: none; }
  .editor-top { margin-bottom: 4px; }
  .editor-tools { margin-bottom: 6px; }
  .editor-text { min-height: 0; padding: 10px 12px; }
  .so-celular { display: inline-flex; }
  .p-top { padding-top: calc(4px + var(--safe-t)); padding-bottom: 12px; }
  .dock { padding-top: 12px; padding-bottom: calc(6px + var(--safe-b)); }
  .stepper { height: 42px; }
  .stepper > button:not(.stepper-value) { height: 40px; }
  .play { width: 48px; height: 48px; }
  .play .ic { width: 24px; height: 24px; }
  .rec { width: 42px; height: 42px; }
  .rec i { width: 24px; height: 24px; }
  .sheet { top: 0; left: auto; right: 0; bottom: 0; width: var(--sheet-w); height: auto; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); }
  .dock.com-rec #sizeStep { display: flex; }
}

/* Teste do aparelho */
.check-list { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 16px; margin-bottom: 14px; }
.check-row { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border: 0; }
.check-row strong { font-weight: 700; }
.check-row small { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.4; }
.marca { width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; background: #3A3A46; }
.marca.ok { background: #2FBF71; }
.marca.alerta { background: #F2B233; }
.marca.falha { background: var(--danger); }
.leitura { padding: 18px; margin-bottom: 14px; background: #000; border: 1px solid var(--line); border-radius: var(--r-lg); font: 700 22px/1.35 var(--ui); }
.leitura small { display: block; font: 600 13px var(--ui); color: var(--muted); margin-bottom: 6px; }
.veredito { padding: 16px; margin-bottom: 14px; background: var(--panel-2); border-radius: var(--r-lg); font-weight: 600; }
.veredito h2 { font-size: 18px; margin-bottom: 6px; }
.veredito p { margin: 0 0 6px; color: #C9C9D2; font-weight: 500; }
.acoes-coluna { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.acoes-coluna .btn { flex: 1 1 200px; height: 50px; }
@media (prefers-reduced-motion: reduce) {
  .toast, .rec-badge i { animation: none; }
}
