/* Legendador — editor calmo, na mesma família da página de apresentação (papel, tinta, lima), com traços finos e sem sombra dura */
@font-face { font-family: "LG Inter"; src: url(/fonts/Inter-VF.ttf); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "LG Grotesk"; src: url(/fonts/SpaceGrotesk-VF.ttf); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "LG Anton"; src: url(/fonts/Anton-Regular.ttf); font-display: swap; }

:root {
  --paper: #F2EDE3;
  --paper2: #E8E1D3;
  --ink: #14110F;
  --violet: #5B2EFF;
  --lime: #C8FF3E;
  --lime-soft: #E7F7B4;
  --coral: #FF5533;
  --sky: #9AD8FF;
  --white: #FFFDF8;
  --on-lime: #14110F;
  /* traços finos: --hair para superfícies, --hair2 para controles e campos */
  --hair: rgba(20, 17, 15, .12);
  --hair2: rgba(20, 17, 15, .24);
  --tint: rgba(20, 17, 15, .05);
  --tint2: rgba(20, 17, 15, .09);
  --focus: rgba(91, 46, 255, .2);
  --bd: 1px solid var(--hair);
  --bd2: 1px solid var(--hair2);
  --sh: none;
  --sh-sm: none;
  --float: 0 1px 2px rgba(20, 17, 15, .05), 0 18px 44px -12px rgba(20, 17, 15, .22);
  --disp: "LG Anton", "Anton", Impact, "Arial Narrow", sans-serif;

  /* nomes antigos (usados também em estilos inline do JS) */
  --bg: var(--paper);
  --s1: var(--white);
  --s2: var(--paper);
  --s3: var(--paper2);
  --line: var(--hair);
  --line2: var(--hair2);
  --text: var(--ink);
  --muted: #5E564C;
  --accent: var(--lime);
  --accent-ink: var(--on-lime);
  --blue: var(--violet);
  --purple: var(--violet);
  --danger: #C4290B;
  --low: #B23C0A;
  --ok: #16794C;
  --r: 12px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tools-h: 72px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 500 15px/1.4 "LG Grotesk", -apple-system, "Segoe UI", system-ui, sans-serif; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
b, strong { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { display: block; flex: none; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--hair2); border-radius: 99px; border: 4px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--lime); color: var(--on-lime); }

/* ------------------------------------------------ botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; background: var(--white); border: var(--bd2); border-radius: 12px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, filter .15s; text-decoration: none; color: var(--ink); }
.btn:active { background: var(--paper2); }
.btn.primary { background: var(--lime); color: var(--on-lime); border-color: rgba(20, 17, 15, .18); }
.btn.primary:active { background: var(--lime); filter: brightness(.93); }
.btn.danger { background: rgba(255, 85, 51, .08); color: var(--danger); border-color: rgba(255, 85, 51, .38); }
.btn.danger:active { background: rgba(255, 85, 51, .18); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:active { background: var(--tint2); }
.btn.sm { min-height: 40px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn.big { min-height: 50px; font-size: 15.5px; padding: 0 20px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--ink); transition: background .15s, opacity .15s, color .15s; }
.icon-btn:active { background: var(--tint2); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.pill { flex: none; height: 40px; padding: 0 18px; border: 1px solid rgba(20, 17, 15, .18); border-radius: 99px; background: var(--lime); color: var(--on-lime); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; transition: filter .15s; }
.pill:active { filter: brightness(.93); }
.chip-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; white-space: nowrap; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--white); color: var(--ink); border: var(--bd2); font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s; }
.chip-btn:active { background: var(--paper2); }
@media (hover: hover) {
  .btn:hover { border-color: var(--ink); }
  .btn.primary:hover { border-color: rgba(20, 17, 15, .18); filter: brightness(.96); }
  .btn.danger:hover { border-color: var(--danger); }
  .btn.ghost:hover { border-color: transparent; background: var(--tint); color: var(--ink); }
  .icon-btn:hover { background: var(--tint); }
  .pill:hover { filter: brightness(.96); }
  .chip-btn:hover { border-color: var(--ink); }
}

/* ------------------------------------------------ marca */
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brand.big { font-size: 22px; justify-content: center; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #14110F; position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: var(--lime); border-radius: 2px; height: 3.5px; }
.logo::before { width: 18px; bottom: 11.5px; }
.logo::after { width: 11px; bottom: 5.5px; }

/* ------------------------------------------------ PIN */
.pin-screen { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--paper); }
.pin-card { width: 100%; max-width: 380px; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 14px; background: var(--white); border: var(--bd); border-radius: 16px; box-shadow: var(--float); padding: 28px 22px 22px; }
.pin-card h2 { margin: 14px 0 0; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.pin-card p { margin: 0; }
.pin-input { width: 100%; min-width: 0; height: 60px; text-align: center; font-size: 28px; font-weight: 600; letter-spacing: 10px; padding-left: 10px; background: var(--paper); border: var(--bd2); border-radius: 12px; outline: none; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s; }
.pin-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--focus); }
.pin-msg { min-height: 20px; color: var(--danger); font-size: 14px; font-weight: 600; }

/* ------------------------------------------------ home */
#home { min-height: 100%; display: flex; justify-content: center; padding: calc(18px + var(--sat)) 18px calc(32px + var(--sab)); background: var(--paper); }
.home-inner { width: min(1040px, 100%); }
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; min-height: 48px; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 30px 20px 28px; border-radius: 16px; cursor: pointer; background: var(--white); border: 1px dashed var(--hair2); transition: border-color .15s, background .15s; text-align: center; }
.hero:active { background: var(--paper2); }
.hero.over { background: var(--lime-soft); border-color: var(--ink); border-style: solid; }
.hero-glow { display: none; }
.hero-plus { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); margin-bottom: 10px; }
.hero-plus svg { width: 24px; height: 24px; }
.hero-title { position: relative; font-size: clamp(22px, 5.2vw, 28px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.hero-sub { position: relative; color: var(--muted); font-size: 14.5px; font-weight: 500; margin-top: 4px; }
.upload-bar { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 16px; background: var(--white); border-radius: 12px; border: var(--bd); }
.upload-bar span { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.bar { flex: 1; height: 6px; background: var(--tint2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 99px; transition: width .25s; }
.recent-title { margin: 34px 2px 14px; font-size: 18px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.proj { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--white); aspect-ratio: 3/4; border: var(--bd); transition: border-color .15s, opacity .15s; }
.proj:active { opacity: .85; }
.proj .th { position: absolute; inset: 0 0 54px; background: #14110F center/cover no-repeat; }
.proj .meta { position: absolute; left: 0; right: 0; bottom: 0; height: 54px; z-index: 1; padding: 8px 11px 0; background: var(--white); border-top: var(--bd); }
.proj .meta b { display: block; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .meta span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .dur { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: rgba(20, 17, 15, .72); color: #FFFDF8; font-variant-numeric: tabular-nums; }
.proj .del { position: absolute; top: 0; right: 0; z-index: 2; width: 46px; height: 46px; display: grid; place-items: center; background: transparent; border: 0; color: #FFFDF8; }
.proj .del span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(20, 17, 15, .6); transition: background .15s; }
.empty { grid-column: 1/-1; color: var(--muted); font-weight: 500; padding: 34px 16px; text-align: center; border: 1px dashed var(--hair2); border-radius: 14px; background: transparent; }
.home-foot { color: var(--muted); font-size: 13px; font-weight: 500; text-align: center; margin: 34px 0 0; }
@media (hover: hover) {
  .hero:hover { border-color: var(--ink); }
  .proj:hover { border-color: var(--hair2); }
  .proj .del:hover span { background: var(--danger); }
}

/* ------------------------------------------------ editor (celular primeiro) */
.editor { position: fixed; inset: 0; height: 100dvh; display: flex; flex-direction: column; padding-top: var(--sat); overflow: hidden; background: var(--bg); }
.topbar { flex: none; height: 56px; display: flex; align-items: center; gap: 2px; padding: 0 12px 0 4px; background: var(--paper); border-bottom: var(--bd); }
.name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.proj-name { width: 100%; background: transparent; border: 0; outline: none; font-weight: 600; font-size: 15.5px; letter-spacing: -.02em; padding: 0 4px; height: 24px; text-overflow: ellipsis; border-radius: 6px; }
.proj-name:focus { background: var(--white); box-shadow: 0 0 0 2px var(--violet); }
.save-state { font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 0 4px; height: 14px; line-height: 14px; }
.topbar .pill { margin-left: 6px; }

.stage { order: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: var(--push, 0px); transition: margin-bottom .34s var(--ease); }
.editor.dragging .stage { transition: none; }
.viewer { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px 14px; overflow: hidden; }
/* a moldura usa sombra em vez de borda para não mudar o tamanho interno do vídeo */
.frame { position: relative; overflow: hidden; border-radius: 12px; background: #000; box-shadow: 0 0 0 1px var(--hair), 0 14px 34px -16px rgba(20, 17, 15, .35); }
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; will-change: transform; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
#overlay.grab { cursor: grab; }
#overlay.grabbing { cursor: grabbing; }
.snap-v, .snap-h { position: absolute; background: var(--lime); pointer-events: none; opacity: .9; }
.snap-v { left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.snap-h { top: 50%; left: 0; right: 0; height: 1px; margin-top: -.5px; }
.big-play { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; display: grid; place-items: center; background: rgba(20, 17, 15, .62); color: #FFFDF8; opacity: 0; pointer-events: none; }
.big-play.flash { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

.transport { flex: none; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px 4px 12px; }
.play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: opacity .15s; }
.play:active { opacity: .8; }
.time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 86px; margin-left: 4px; }
.scrub { position: relative; flex: 1; height: 44px; touch-action: none; cursor: pointer; }
.scrub-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 99px; background: var(--hair2); overflow: hidden; }
.scrub-track i { display: block; height: 100%; width: 0; background: var(--ink); }
.scrub b { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--lime); border: 1px solid rgba(20, 17, 15, .4); box-shadow: 0 1px 3px rgba(20, 17, 15, .25); transition: transform .12s; }
.scrub.drag b { transform: scale(1.15); }
.speed { display: none; height: 36px; background: var(--white); border: var(--bd2); border-radius: 10px; padding: 0 8px; outline: none; font-weight: 600; font-size: 13.5px; }
.transport .icon-btn { margin-right: -8px; }

/* barra de ferramentas (rolagem horizontal) */
.tools { order: 2; flex: none; height: calc(var(--tools-h) + var(--sab)); padding: 6px 8px var(--sab); display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; border-top: var(--bd); background: var(--paper); }
.tools::-webkit-scrollbar { display: none; }
.tool { flex: none; width: 68px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: transparent; border: 0; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: -.005em; transition: background .15s, color .15s; position: relative; }
.tool:active { background: var(--tint2); }
.tool.on { background: var(--lime-soft); color: var(--ink); }
.tool .dot { position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--paper); }
.tool.desk-only { display: none; }

/* folha de baixo para cima */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--sheet-h, 52dvh); max-height: calc(100dvh - 120px - var(--sat)); display: flex; flex-direction: column; background: var(--white); border-radius: 18px 18px 0 0; border-top: var(--bd); box-shadow: 0 -12px 34px -14px rgba(20, 17, 15, .22); transform: translateY(105%); transition: transform .34s var(--ease), height .34s var(--ease); will-change: transform; }
.editor.sheet-open .sheet { transform: none; }
.editor.dragging .sheet { transition: none; }
.sheet-grab { flex: none; height: 20px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab i { width: 36px; height: 4px; border-radius: 99px; background: var(--hair2); }
.sheet-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 8px 18px; min-height: 48px; touch-action: none; }
.sheet-head > b { font-size: 18px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.sheet-head-acts { flex: 1; display: flex; justify-content: flex-end; gap: 8px; min-width: 0; }
.sheet-close { border-radius: 50%; width: 40px; height: 40px; margin: 0 4px; color: var(--muted); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(18px + var(--sab)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-body.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.timeline { display: none; }
.tl-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; height: 100%; }
.tl-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 2px 16px 6px; }
.tl-bar input { width: 130px; }
.tl-bar .muted { font-weight: 500; }
.tl-tip { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-scroll { position: relative; flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: var(--paper); border-top: var(--bd); }
.tl-scroll::-webkit-scrollbar { display: none; }
#tlSpacer { height: 100%; position: relative; }
#tl { position: sticky; left: 0; top: 0; display: block; touch-action: none; }

/* ------------------------------------------------ transcrição (documento) */
.doc-tools { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 2px 20px 6px 16px; }
.doc-tools::-webkit-scrollbar { display: none; }
.hint { font-size: 13px; color: var(--muted); padding: 0 2px 8px; }
.hint u.low { text-decoration: underline wavy var(--coral); text-decoration-thickness: 1.5px; text-underline-offset: 3px; color: var(--text); font-weight: 600; }
.cap { position: relative; display: grid; grid-template-columns: 52px 1fr 40px 40px; align-items: start; border-radius: 10px; border: 1px solid transparent; transition: background .15s; }
.cap + .cap { margin-top: 2px; }
.cap.on { background: var(--lime-soft); }
.cap-t { height: 44px; padding: 0 0 0 9px; text-align: left; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cap.on .cap-t { color: var(--ink); }
.cap-text { padding: 6px 0; font-size: 16.5px; line-height: 1.8; min-width: 0; font-weight: 500; }
.cap-more { width: 40px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); }
.w { display: inline-block; padding: 0 4px; margin: 0 -3px; border-radius: 6px; cursor: pointer; transition: background .1s; }
.w.low { text-decoration: underline wavy var(--coral); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.w.has-color { box-shadow: inset 0 -2px 0 var(--wc); }
.w.cut { text-decoration: line-through; color: #746B60; text-decoration-color: var(--coral); text-decoration-thickness: 1.5px; box-shadow: none; }
.w.now { background: var(--lime); color: var(--on-lime); }
.w.sel { background: var(--ink); color: var(--white); box-shadow: none; }
.w .em { font-size: .85em; }
@media (hover: hover) { .w:hover { background: var(--tint2); } .w.now:hover { background: var(--lime); } .w.sel:hover { background: var(--ink); } .cap-more:hover, .cap-t:hover { color: var(--ink); } }
.empty-caps { text-align: center; color: var(--muted); padding: 26px 10px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty-caps .big-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--lime-soft); color: var(--ink); margin-bottom: 4px; }

/* ------------------------------------------------ controles */
.sec-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 24px 0 8px; display: flex; align-items: center; gap: 10px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.sec-title:first-child { margin-top: 6px; }
.note { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.ctl { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 10px; min-height: 50px; }
.ctl > label { font-size: 14px; font-weight: 500; color: var(--ink); }
.ctl .row { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ctl .val { width: 44px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctl select, .field { width: 100%; min-height: 44px; background: var(--paper); border: var(--bd2); border-radius: 10px; padding: 0 12px; outline: none; font-size: 16px; font-weight: 500; transition: box-shadow .15s, border-color .15s; }
textarea.field { padding: 11px 12px; min-height: 92px; resize: vertical; line-height: 1.45; }
.field::placeholder { color: #746B60; font-weight: 500; }
.field:focus, .ctl select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--focus); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 44px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: var(--hair2); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--hair2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: border-box; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--lime); border: 1px solid rgba(20, 17, 15, .4); box-shadow: 0 1px 3px rgba(20, 17, 15, .25); }
input[type=range]::-moz-range-thumb { box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); border: 1px solid rgba(20, 17, 15, .4); box-shadow: 0 1px 3px rgba(20, 17, 15, .25); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--violet); }
input[type=color] { flex: none; width: 36px; height: 36px; padding: 0; border: var(--bd2); border-radius: 50%; background: none; overflow: hidden; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.sw { flex: none; width: 40px; height: 40px; border-radius: 50%; border: var(--bd2); padding: 0; transition: opacity .12s; }
.sw:active { opacity: .8; }
.sw.on { box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--ink); }
.swatches { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; padding: 7px 6px; flex: 1; min-width: 0; align-items: center; }
.swatches::-webkit-scrollbar { display: none; }
.toggle { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.toggle input { position: absolute; inset: -8px 0; opacity: 0; width: 100%; height: calc(100% + 16px); margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--hair2); transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFDF8; box-shadow: 0 1px 3px rgba(20, 17, 15, .3); transition: transform .2s var(--ease), background .2s; }
.toggle input:checked + i { background: var(--lime); box-shadow: inset 0 0 0 1px rgba(20, 17, 15, .22); }
.toggle input:checked + i::after { transform: translateX(20px); background: #14110F; box-shadow: none; }
.toggle input:focus-visible + i { outline: 2px solid var(--violet); outline-offset: 2px; }
.seg { display: flex; background: var(--paper); border: var(--bd); border-radius: 12px; padding: 3px; gap: 2px; flex: 1; min-width: 0; }
.seg button { flex: 1; min-height: 38px; border: 0; background: transparent; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, color .15s; }
.seg button.on { background: var(--lime-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair2); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; }
.opt > div { min-width: 0; }
.opt b { display: block; font-weight: 600; font-size: 14.5px; }
.opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 1px; }
.opt .ic-wrap { border: var(--bd); }
.card { background: var(--paper); border: var(--bd); border-radius: 12px; padding: 12px 14px; }
.card + .card { margin-top: 10px; }
.card .field, .card select { background: var(--white); }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { flex: none; white-space: nowrap; min-height: 40px; padding: 0 14px; border-radius: 10px; background: transparent; border: var(--bd2); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, border-color .15s; }
.chip.on { background: var(--lime-soft); color: var(--ink); }
.chip .x { display: grid; place-items: center; width: 24px; height: 24px; margin-right: -8px; border-radius: 50%; }

/* estilos prontos */
.presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.preset { position: relative; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--white); border: var(--bd); transition: border-color .15s, box-shadow .15s, opacity .15s; padding: 0; text-align: left; }
.preset:active { opacity: .85; }
/* fundo escuro neutro: qualquer cor de legenda continua legível */
.preset canvas { display: block; width: 100%; aspect-ratio: 3/2; background: #26211D; }
.preset span { display: block; padding: 7px 10px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.preset.on span { background: var(--lime-soft); }
.preset .x { position: absolute; top: 5px; right: 5px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(20, 17, 15, .6); color: #FFFDF8; display: grid; place-items: center; }
#saveStyle.preset { border: 1px dashed var(--hair2) !important; color: var(--muted) !important; background: transparent !important; font-weight: 600; }
@media (hover: hover) { .preset:hover { border-color: var(--hair2); } .preset.on:hover { border-color: var(--ink); } }

/* listas (cortes, zooms) */
.stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); border: var(--bd); margin: 0 0 16px; }
.stat .ic-wrap { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); flex: none; }
.stat b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.stat small { color: var(--muted); font-size: 13px; font-weight: 500; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 4px 6px 4px 12px; border-radius: 12px; background: var(--paper); border: var(--bd); }
.item .main { flex: 1; min-width: 0; cursor: pointer; padding: 6px 0; }
.item .main b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main small { color: var(--muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.item .icon-btn { width: 44px; height: 44px; color: var(--muted); }
.item.off { opacity: .55; }
.tag { flex: none; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; color: var(--ink); background: var(--tint2); }
.tag.pause { background: rgba(120, 190, 240, .32); }
.tag.filler { background: rgba(255, 160, 80, .32); }
.tag.manual { background: rgba(255, 85, 51, .22); }
.tag.zoom { background: rgba(110, 75, 255, .2); }
.check { position: relative; flex: none; width: 26px; height: 26px; }
.check input { position: absolute; inset: -9px; width: 44px; height: 44px; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.check i { position: absolute; inset: 0; border-radius: 8px; border: var(--bd2); background: var(--white); display: grid; place-items: center; transition: .15s; }
.check input:checked + i { background: var(--lime); border-color: rgba(20, 17, 15, .3); }
.check input:checked + i::after { content: ""; width: 11px; height: 6px; border-left: 2px solid #14110F; border-bottom: 2px solid #14110F; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + i { outline: 2px solid var(--violet); outline-offset: 2px; }
.sticky-foot { position: sticky; bottom: calc(-18px - var(--sab)); margin: 12px -16px calc(-18px - var(--sab)); padding: 14px 16px calc(16px + var(--sab)); background: linear-gradient(transparent, var(--white) 24%); display: flex; gap: 10px; z-index: 2; }
.sticky-foot .btn { flex: 1; }

/* celular (QR) */
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px 14px; }
.qr { width: 192px; height: 192px; padding: 10px; background: #fff; border: var(--bd); border-radius: 12px; margin-bottom: 4px; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.pin-digits { display: flex; gap: 6px; justify-content: center; }
.pin-digits span { width: 36px; height: 46px; display: grid; place-items: center; background: var(--white); border: var(--bd2); border-radius: 10px; font-size: 22px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.url { font-size: 14px; font-weight: 600; word-break: break-all; color: var(--violet); user-select: all; -webkit-user-select: all; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink); }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--lime-soft); display: grid; place-items: center; font-size: 12.5px; line-height: 1; font-weight: 600; color: var(--ink); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--hair2); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ editor de palavra (folha / popover) */
.pop-bg { position: fixed; inset: 0; z-index: 39; background: rgba(20, 17, 15, .32); animation: fade .2s; }
.pop { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; max-height: min(80dvh, 620px); overflow-y: auto; background: var(--white); border-radius: 18px 18px 0 0; border-top: var(--bd); box-shadow: var(--float); padding: 10px 16px calc(18px + var(--sab)); animation: up .3s var(--ease); overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.pop h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; font-size: 17px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; min-height: 46px; }
.pop h4 .icon-btn { border-radius: 50%; width: 40px; height: 40px; color: var(--muted); margin-right: -6px; }
.pop .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
.pop .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.pop .two label { font-size: 13px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 4px; }
.nudge { display: flex; align-items: center; gap: 4px; }
.nudge .field { text-align: center; padding: 0 2px; min-width: 0; font-variant-numeric: tabular-nums; }
.nudge button { flex: none; width: 40px; height: 44px; border-radius: 10px; border: var(--bd2); background: var(--white); font-size: 18px; font-weight: 600; transition: background .15s; }
.nudge button:active { background: var(--paper2); }
.emojis { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.emojis::-webkit-scrollbar { display: none; }
.emojis button { flex: none; width: 44px; height: 44px; border-radius: 10px; border: var(--bd); background: transparent; font-size: 20px; transition: background .15s; }
.emojis button.on { background: var(--lime-soft); border-color: var(--hair2); }
.pop .acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.pop .acts .wide { grid-column: 1/-1; }
.pop .acts .btn { min-width: 0; padding: 4px 10px; white-space: normal; line-height: 1.15; font-size: 14px; text-align: center; }

/* ------------------------------------------------ modal */
.modal-bg { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 17, 15, .45); animation: fade .2s; }
.modal { width: 100%; max-height: 92dvh; overflow-y: auto; background: var(--white); border-radius: 20px 20px 0 0; border-top: var(--bd); box-shadow: var(--float); padding: 24px 18px calc(22px + var(--sab)); animation: up .32s var(--ease); }
.modal h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.modal p { margin: 0 0 14px; color: #4A433B; line-height: 1.45; }
.modal .f { margin-bottom: 14px; }
.modal .f > label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.modal .acts { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal .acts .btn { flex: 1; min-height: 48px; }
.modal .warn { color: var(--low); font-weight: 600; }
.prog { height: 6px; margin: 18px 0 10px; }
.prog-msg { font-size: 14px; font-weight: 500; color: var(--muted); min-height: 20px; font-variant-numeric: tabular-nums; }
.exp-prev { border: var(--bd); }
.exp-list { display: flex; flex-direction: column; gap: 8px; }
.exp-opt { display: flex; align-items: center; gap: 13px; min-height: 62px; padding: 8px 14px; border-radius: 12px; background: transparent; border: var(--bd2); text-align: left; width: 100%; transition: background .15s, border-color .15s; }
.exp-opt:active { background: var(--tint2); }
.exp-opt .ic-wrap { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); flex: none; }
.exp-opt.main { border-color: var(--ink); }
.exp-opt.main .ic-wrap { background: var(--lime); color: var(--on-lime); }
.exp-opt b { display: block; font-size: 15px; }
.exp-opt small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.exp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.exp-row .exp-opt { flex-direction: column; gap: 2px; min-height: 62px; justify-content: center; text-align: center; padding: 8px; }
@media (hover: hover) { .exp-opt:hover { background: var(--tint); border-color: var(--ink); } }
.done-ring { width: 64px; height: 64px; margin: 6px auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); animation: popin .3s ease-out; }
.done-ring svg { width: 30px; height: 30px; }
@keyframes popin { from { transform: scale(.92); opacity: 0; } }
.center { text-align: center; }

.toast { position: fixed; left: 12px; right: 12px; margin: 0 auto; width: fit-content; top: calc(14px + var(--sat)); z-index: 100; transform: translateY(-260%); max-width: min(calc(100vw - 30px), 460px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; text-align: center; box-shadow: var(--float); transition: transform .3s var(--ease); pointer-events: none; }
.toast.on { transform: none; }

/* ------------------------------------------------ computador */
@media (min-width: 900px) {
  html, body { font-size: 14.5px; }
  .projects { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 16px; }
  .hero { padding: 44px 20px 42px; }
  .hero-title { font-size: 30px; }
  #home { padding-top: 34px; }

  .editor { display: grid; grid-template-columns: 84px minmax(0, 1fr) 400px; grid-template-rows: 58px minmax(0, 1fr) 258px; grid-template-areas: "top top top" "tools stage sheet" "tools tl tl"; }
  .topbar { grid-area: top; height: auto; padding: 0 16px 0 10px; gap: 4px; }
  .name-wrap { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; flex: 1; }
  .proj-name { width: auto; min-width: 120px; max-width: 420px; height: 34px; padding: 0 8px; field-sizing: content; font-size: 15.5px; border-radius: 8px; }
  .proj-name:hover { background: var(--tint); }
  .proj-name:focus { background: var(--white); }
  .save-state { font-size: 12.5px; }
  .pill { height: 38px; padding: 0 22px; }

  .tools { grid-area: tools; height: auto; flex-direction: column; align-items: center; overflow-x: hidden; overflow-y: auto; padding: 10px 0; gap: 4px; border-top: 0; scrollbar-width: none; border-right: var(--bd); background: var(--paper); }
  .tool { width: 68px; height: 56px; margin: 0; flex: none; }
  .tool:hover { background: var(--tint); color: var(--ink); }
  .tool.on, .tool.on:hover { background: var(--lime-soft); color: var(--ink); }
  .tool.desk-only { display: flex; }
  .tool.phone-only { display: none; }

  .stage { grid-area: stage; margin: 0 !important; background: var(--paper); }
  .viewer { padding: 22px 24px 12px; }
  .transport { height: 60px; padding: 0 22px 6px; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
  .speed { display: block; }

  .sheet { grid-area: sheet; position: static; transform: none !important; height: auto !important; max-height: none; border-radius: 0; box-shadow: none; border-top: 0; border-left: var(--bd); min-height: 0; }
  .sheet-grab, .sheet-close { display: none; }
  .sheet-head { padding: 14px 14px 8px 20px; min-height: 58px; touch-action: auto; }
  .sheet-head > b { font-size: 19px; }
  .sheet-body { padding: 4px 18px 22px; }
  .sticky-foot { bottom: -22px; margin: 12px -18px -22px; padding: 14px 18px 18px; }

  .timeline { grid-area: tl; display: flex; flex-direction: column; min-height: 0; border-top: var(--bd); background: var(--white); }
  .tl-bar { padding: 4px 16px 2px; }
  .tl-bar input { height: 30px; }
  .tl-tip { display: block; }

  .ctl { grid-template-columns: 112px 1fr; min-height: 46px; }
  .ctl select, .field { font-size: 14.5px; min-height: 40px; }
  .seg button { min-height: 32px; }
  .cap-text { font-size: 15.5px; line-height: 1.75; }
  .presets { grid-template-columns: repeat(2, 1fr); }

  .pop-bg { display: none; }
  .pop { left: auto; right: auto; bottom: auto; width: 368px; max-height: min(86vh, 640px); border-radius: 14px; border: var(--bd); padding: 6px 16px 16px; animation: popin2 .16s ease-out; box-shadow: var(--float); }
  @keyframes popin2 { from { opacity: 0; transform: translateY(4px); } }
  .emojis { flex-wrap: wrap; margin: 0; padding: 0; }
  .emojis button { width: 38px; height: 38px; font-size: 18px; border-radius: 9px; }

  .modal-bg { align-items: center; padding: 24px; }
  .modal { width: min(480px, 100%); border-radius: 16px; border: var(--bd); padding: 26px 24px 24px; animation: popin2 .2s ease-out; }
  .toast { top: auto; bottom: 28px; transform: translateY(260%); }
  .toast.on { transform: none; }
}

/* celular: estilos em carrossel horizontal para o vídeo continuar grande */
@media (max-width: 899px) {
  .presets.carousel { display: flex; overflow-x: auto; gap: 10px; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .presets.carousel::-webkit-scrollbar { display: none; }
  .presets.carousel .preset { flex: none; width: 132px; scroll-snap-align: start; }
}
@media (max-height: 520px) and (max-width: 899px) { :root { --tools-h: 64px; } .tool { height: 50px; } .transport { height: 50px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* ================================================================ TEMA ESCURO
   Mesma linguagem calma (traço fino, sem sombra dura, lima como destaque), invertida:
   fundo escuro quente e traço creme. Os blocos de tinta usam var(--ink) + var(--paper)/var(--white),
   então se invertem sozinhos; só os blocos de lima precisam voltar à tinta escura. */

/* ---------------------------------------------------------------- planos */
.plan-chip { background: var(--lime); color: var(--on-lime); border-color: rgba(20, 17, 15, .18); }
.plan-chip.is-pro { color: var(--ink); }
.plan-chip.is-pro { background: var(--white); border-color: var(--hair2); }
.plans h2 { margin-bottom: 6px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.plan-col { padding: 14px; border: 1px solid var(--hair2); border-radius: 14px; background: var(--white); }
.plan-col.pro { background: var(--lime-soft); border-color: var(--ink); }
[data-theme="dark"] .plan-col.pro { border-color: var(--lime); }
.plan-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.plan-col.pro .plan-name { color: var(--ink); }
.plan-price { font-size: 26px; font-weight: 800; margin-top: 4px; }
.plan-once { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.plan-col ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.35; }
.plan-acts { margin-top: 8px; }
.auth-terms { font-size: 12.5px; line-height: 1.4; color: var(--muted); text-align: center; margin: 4px 0 0; }
.auth-terms a, .home-legal a, .modal .small a { color: inherit; text-decoration: underline; }
.home-legal { margin-top: 4px; }
@media (max-width: 520px) { .plan-grid { grid-template-columns: 1fr; } }

:root[data-theme="dark"] {
  --paper: #16130F;
  --paper2: #2A2520;
  --white: #1F1B17;
  --ink: #F2EDE3;
  --violet: #9B7BFF;
  --lime-soft: #333F12;
  --hair: rgba(242, 237, 227, .11);
  --hair2: rgba(242, 237, 227, .24);
  --tint: rgba(242, 237, 227, .06);
  --tint2: rgba(242, 237, 227, .11);
  --focus: rgba(155, 123, 255, .3);
  --float: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 44px -12px rgba(0, 0, 0, .7);
  --muted: #A9A093;
  --danger: #FF8266;
  --low: #FF9E63;
  --ok: #57D98F;
  color-scheme: dark;
}
/* blocos de lima: por dentro tudo volta a ser tinta escura */
[data-theme="dark"] :is(.btn.primary, .pill, .hero-plus, .stat .ic-wrap, .exp-opt.main .ic-wrap, .done-ring) {
  --ink: #14110F; --text: #14110F; --muted: #3A342D; --hair: rgba(20, 17, 15, .14); --hair2: rgba(20, 17, 15, .26); color: #14110F;
}
[data-theme="dark"] .logo { box-shadow: 0 0 0 1px var(--hair2); }
[data-theme="dark"] .frame { box-shadow: 0 0 0 1px var(--hair), 0 14px 34px -16px rgba(0, 0, 0, .8); }
[data-theme="dark"] .sheet { box-shadow: 0 -12px 34px -14px rgba(0, 0, 0, .7); }
[data-theme="dark"] .btn.danger { background: rgba(255, 130, 102, .1); border-color: rgba(255, 130, 102, .4); }
[data-theme="dark"] .modal p { color: #CFC7B9; }
[data-theme="dark"] .w.cut, [data-theme="dark"] .field::placeholder { color: #8F867A; }
[data-theme="dark"] .proj .th { background-color: #000; }
[data-theme="dark"] .preset canvas { background: #0F0D0B; }
[data-theme="dark"] ::selection { background: #C8FF3E; color: #14110F; }
[data-theme="dark"] .qr { background: #fff; }
@media (min-width: 900px) { [data-theme="dark"] .sheet { box-shadow: none; } }

/* botão de tema */
.theme-btn { flex: none; }
.home-head .brand { margin-right: auto; }
.home-head { gap: 8px; }
.u-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#homeUser { min-width: 0; flex: 0 1 auto; }
@media (max-width: 460px) {
  .home-head .brand { font-size: 0; gap: 0; }
  .u-out { display: none; }
  .u-name { max-width: 110px; }
}
@media (max-width: 899px) { #themeEd { display: none; } }

/* área segura das redes: guia por cima do vídeo (não entra na exportação) */
.safe-zone { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.safe-zone i { position: absolute; display: block; background: repeating-linear-gradient(135deg, rgba(20, 17, 15, .42) 0 6px, rgba(20, 17, 15, .24) 6px 12px); outline: 1px dashed rgba(255, 253, 248, .7); outline-offset: -1px; }
.safe-zone .sz-top { left: 0; right: 0; top: 0; height: 11%; }
.safe-zone .sz-bottom { left: 0; right: 0; bottom: 0; height: 21%; display: grid; place-items: center; }
.safe-zone .sz-side { right: 0; top: 46%; bottom: 21%; width: 15%; }
.safe-zone b { font: 600 10.5px "LG Grotesk", sans-serif; color: #FFFDF8; background: rgba(20, 17, 15, .72); padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
@media (hover: hover) { .cap-more[data-a="del"]:hover { color: var(--danger); } }

/* ---------------------------------------------------------------- transcrever (só texto) */
.home-actions { display: grid; gap: 12px; }
@media (min-width: 720px) { .home-actions { grid-template-columns: 1.4fr 1fr; } }
.tlist { display: grid; gap: 8px; }
.titem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 8px 12px 16px; background: var(--white); border: var(--bd2); border-radius: 12px; text-align: left; cursor: pointer; }
.titem > span { flex: 1; min-width: 0; }
.titem b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titem small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tscreen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); padding-top: var(--sat); }
.t-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px calc(30px + var(--sab)); }
.t-body > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.t-tools { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.t-tools::-webkit-scrollbar { display: none; }
.t-tools .chip { flex: none; }
.t-text { background: var(--white); border: var(--bd2); border-radius: 14px; padding: 18px 18px 6px; }
.t-par { display: flex; gap: 12px; margin-bottom: 14px; }
.t-time { display: none; flex: none; width: 104px; padding-top: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-text.show-times .t-time { display: block; }
.t-p { flex: 1; min-width: 0; font-size: 16.5px; line-height: 1.62; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 6px; -webkit-user-select: text; user-select: text; }
.t-p:focus { background: var(--tint); }
.t-hint { margin-top: 12px; }
@media (max-width: 560px) { .t-text.show-times .t-par { flex-direction: column; gap: 1px; } .t-time { width: auto; padding-top: 0; } }

/* ---------------------------------------------------------------- entrar / criar conta */
.auth-card { text-align: left; gap: 12px; }
.auth-card .brand, .auth-card h2, .auth-card > p, .auth-card .pin-msg { text-align: center; }
.auth-f { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; }
.auth-f .field { width: 100%; min-height: 48px; font-size: 16px; }
.auth-card .btn.ghost { font-size: 14px; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; color: var(--muted); cursor: pointer; }
.auth-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.auth-check a { color: var(--ink); text-decoration: underline; }
.auth-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.auth-links:not(:has(> :not([hidden]))) { display: none; }
.auth-links .link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; cursor: pointer; }
.auth-links .link-btn:disabled { opacity: .5; cursor: default; }
.code-in { text-align: center; letter-spacing: .5em; font-size: 24px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.pin-msg.ok { color: var(--ink); }
.pin-msg a { color: inherit; text-decoration: underline; font-weight: 700; }

/* ---------------------------------------------------------------- listas de escolha no visual do app (no lugar do <select> do sistema) */
.sel { position: relative; display: block; flex: 1; min-width: 0; }
.sel > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.sel-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px 0 14px; background: var(--white); border: 1px solid var(--hair2); border-radius: 12px; color: var(--text); font-weight: 600; font-size: 15px; text-align: left; transition: background .15s, border-color .15s; }
.sel-btn:disabled { opacity: .55; cursor: default; }
.sel-btn[aria-expanded="true"] { border-color: var(--ink); }
.sel-v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-ch { flex: none; color: var(--muted); transition: transform .18s; }
.sel-btn[aria-expanded="true"] .sel-ch { transform: rotate(180deg); }
.sel-sm { flex: none; width: 82px; }
.sel-sm .sel-btn { min-height: 40px; padding: 0 8px 0 12px; font-size: 14px; }
@media (hover: hover) { .sel-btn:not(:disabled):hover { background: var(--tint); } }
.sel-bg { position: fixed; inset: 0; z-index: 140; background: transparent; }
.sel-menu { position: fixed; z-index: 141; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--hair2); border-radius: 14px; box-shadow: var(--float); overflow: hidden; }
.sel-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.sel-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; background: none; border: 0; border-radius: 9px; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; }
.sel-opt span { flex: 1; min-width: 0; }
.sel-opt svg { flex: none; }
.sel-opt.on { background: var(--lime-soft); font-weight: 700; }
@media (hover: hover) { .sel-opt:not(.on):hover { background: var(--tint); } }
/* no celular a lista sobe de baixo, como os outros painéis */
.sel-menu.sheet { left: 0; right: 0; bottom: 0; max-height: min(70dvh, 560px); border-radius: 20px 20px 0 0; border-width: 1px 0 0; padding-bottom: var(--sab); animation: sel-up .22s var(--ease); }
.sel-menu.sheet + .sel-bg, .sel-bg:has(+ .sel-menu.sheet) { background: rgba(20, 17, 15, .35); }
.sel-menu.sheet .sel-opt { min-height: 50px; font-size: 16px; }
.sel-title { flex: none; padding: 16px 18px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
@keyframes sel-up { from { transform: translateY(24px); opacity: 0; } }
[data-theme="dark"] .sel-opt.on { color: #14110F; }
[data-theme="dark"] .sel-bg:has(+ .sel-menu.sheet) { background: rgba(0, 0, 0, .5); }

/* cartões de escolha (níveis de precisão) */
.picks { display: grid; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 12px 14px; background: var(--white); border: 1px solid var(--hair2); border-radius: 12px; color: var(--text); text-align: left; transition: background .15s, border-color .15s; }
.pick-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pick-t b { font-size: 15.5px; font-weight: 700; }
.pick-t small { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pick-d { font-size: 13.5px; line-height: 1.35; color: var(--muted); font-weight: 500; }
.pick.on { background: var(--lime-soft); border-color: var(--ink); }
@media (hover: hover) { .pick:not(.on):hover { background: var(--tint); } }
[data-theme="dark"] .pick.on { --text: #14110F; --muted: #3A342D; color: #14110F; }
[data-theme="dark"] .pick.on .pick-t small, [data-theme="dark"] .pick.on .pick-d { color: #3A342D; }

/* ---------------------------------------------------------------- selecionar um trecho de legendas e mover junto */
.pick-bar { position: sticky; top: 0; z-index: 3; margin: 0 -16px 8px; padding: 2px 16px 0; background: var(--white); border-bottom: 1px solid var(--hair); }
.pick-bar .doc-tools { margin-bottom: 0; }
.pick-n { display: flex; flex-direction: column; gap: 1px; padding: 0 2px 8px; }
.pick-n b { font-size: 15px; }
.pick-n span { font-size: 13px; color: var(--muted); }
.chip:disabled { opacity: .45; cursor: default; }
#capList.picking .cap { cursor: pointer; }
#capList.picking .cap-more { visibility: hidden; }
#capList.picking .w { pointer-events: none; }
.cap.picked { background: var(--lime-soft); border-color: var(--ink); }
.cap.picked .cap-t { color: var(--ink); }
#capList.picking .cap.on:not(.picked) { background: var(--tint); }
/* legenda com posição própria: um pontinho ao lado do tempo */
.cap.own .cap-t::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--violet, #6B4EFF); vertical-align: 1px; }

/* botões do topo da aba Legendas: todos aparecem, quebrando em duas linhas se preciso (sem cortar nem rolar pro lado) */
.doc-tools { flex-wrap: wrap; overflow: visible; gap: 6px; margin: 0 0 8px; padding: 2px 0; }
.doc-tools .chip { min-height: 36px; padding: 0 9px; font-size: 13px; gap: 5px; }
.pick-bar .doc-tools { margin-bottom: 8px; }
@media (max-width: 400px) { .doc-tools { gap: 5px; } .doc-tools .chip { padding: 0 8px; font-size: 12.5px; gap: 4px; } }
