:root {
  color-scheme: light dark;
  --bg: #f4f5f2;
  --card: #ffffff;
  --ink: #15201a;
  --muted: #5d6b63;
  --line: #d9ded9;
  --accent: #128c4b;
  --accent-ink: #ffffff;
  --sel: rgba(18, 140, 75, 0.22);
  --danger: #b42318;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --card: #171e1a;
    --ink: #e8eee9;
    --muted: #9aa8a0;
    --line: #2a332e;
    --accent: #25b866;
    --accent-ink: #06140c;
    --sel: rgba(37, 184, 102, 0.25);
    --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.app { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.app.center { text-align: center; padding-top: 20vh; }
h1 { font-size: 1.25rem; margin: 0; }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 0.9rem; }
.top { margin-bottom: 12px; }
#title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stage-wrap { display: flex; justify-content: center; background: #000; border-radius: var(--radius); overflow: hidden; }
.stage { position: relative; display: inline-block; line-height: 0; overflow: hidden; touch-action: none; }
.stage video { display: block; max-width: 100%; max-height: 52vh; }
.crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  touch-action: none;
}
.crop::before, .crop::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.crop::before { border-left: 1px solid rgba(255,255,255,.35); border-right: 1px solid rgba(255,255,255,.35); left: 33.3%; right: 33.3%; }
.crop::after { border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); top: 33.3%; bottom: 33.3%; }
.crop-grip { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(255,255,255,.85); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.buttons > .btn { flex: 1 1 0; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: none; color: var(--ink); padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; }
.seg-btn.is-on { background: var(--accent); color: var(--accent-ink); }
.zoom { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; font-size: .9rem; color: var(--muted); }
.zoom input { flex: 1; accent-color: var(--accent); }

.timeline-block { display: grid; gap: 6px; }
.track { position: relative; height: 48px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10%); border: 1px solid var(--line); border-radius: 8px; touch-action: none; }
.sel { position: absolute; top: 0; bottom: 0; background: var(--sel); border: 2px solid var(--accent); border-radius: 8px; cursor: grab; touch-action: none; }
.handle { position: absolute; top: -2px; bottom: -2px; width: 22px; background: var(--accent); cursor: ew-resize; }
.handle::after { content: ""; position: absolute; left: 9px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--accent-ink); opacity: .8; }
.handle-l { left: -2px; border-radius: 8px 0 0 8px; }
.handle-r { right: -2px; border-radius: 0 8px 8px 0; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); pointer-events: none; }
.times { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.times b { color: var(--ink); font-variant-numeric: tabular-nums; }

.btn { border-radius: 10px; padding: 12px 14px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent; min-height: 46px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn:focus-visible, .seg-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.status { margin: 0; min-height: 1.4em; font-size: .95rem; }
.status.error { color: var(--danger); }
.result { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.result img { width: 160px; height: 160px; border-radius: 8px; background: repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.result audio { width: 100%; max-width: 280px; margin-top: 6px; }
[hidden] { display: none !important; }

/* ---------- página inicial e rodapé ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin: 4px 0 20px; }
.hero h1 { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; }
.hero p { font-size: 1rem; margin-top: 8px; }
.stack { display: grid; gap: 10px; }
.label { font-weight: 600; font-size: .95rem; }
input[type="url"] {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
input[type="url"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.file-btn { display: flex; justify-content: center; align-items: center; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.small { font-size: .82rem; }
.steps { display: grid; gap: 10px; margin: 18px 0; }
.steps div { display: flex; gap: 12px; align-items: center; }
.steps b {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sel); color: var(--accent); font-size: .9rem;
}
.bot-card { gap: 10px; }
.bot-card p { margin: 0; }
.bot-card .btn { text-align: center; text-decoration: none; }
.footer { text-align: center; margin-top: 24px; display: grid; gap: 8px; justify-items: center; }
.coffee {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; background: var(--card);
}
.coffee:hover { border-color: var(--accent); }
.coffee:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wa-box { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--accent); border-radius: 10px; }
.wa-box p { margin: 0; }
.wa-box .btn { text-align: center; text-decoration: none; }
.dl { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---------- biopage ---------- */
.bio { text-align: center; padding-top: 48px; display: grid; justify-items: center; gap: 6px; }
.bio-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.bio-name { font-size: 1.4rem; margin-top: 10px; }
.bio-links { display: grid; gap: 12px; width: 100%; max-width: 380px; margin-top: 22px; }
.bio-links .btn { display: block; text-decoration: none; text-align: center; }
.made-by { color: var(--muted); font-size: .85rem; text-decoration: none; }
.made-by:hover { color: var(--ink); text-decoration: underline; }
