/* AudioWriter — identidade "Vinil": papel lilás claro, tinta, roxo próprio (voz/disco), distinto do teal do Papyr/PolicyForge.
   Motivo: a forma de onda REAL do arquivo, que também é a barra de progresso. */
:root {
    --paper: #f7f5f9; --card: #fff; --ink: #17161c; --muted: #5e5b68; --faint: #8b8796;
    --line: #e6e2ec; --line-2: #d5cfde;
    --accent: #6a35c9; --accent-2: #56299f; --accent-soft: #f0eafb; --accent-ink: #41207a;
    --rec: #c8372a; --rec-soft: #fbe9e6; --warn: #8a5a00; --warn-soft: #fdf3dc;
    --r: 14px; --r-sm: 9px;
    --shadow: 0 1px 2px rgba(22,23,27,.05), 0 8px 24px -12px rgba(22,23,27,.12);
    --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
[x-cloak] { display: none !important; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.12; margin: 0; }

/* nav */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(247,245,249,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 700 1.12rem var(--display); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a, .nav-links button { background: none; border: 0; color: var(--muted); text-decoration: none; font-size: .9rem; padding: 8px 10px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; }
.nav-links a:hover, .nav-links button:hover { color: var(--ink); background: rgba(22,23,27,.05); }
.pill { font: 600 .72rem var(--mono); background: var(--accent-soft); color: var(--accent-ink); padding: 1px 7px; border-radius: 99px; }

/* hero */
.hero { padding-top: 36px; padding-bottom: 18px; }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 2.9rem); font-weight: 800; max-width: 17ch; }
.hero p { color: var(--muted); margin: 12px 0 0; font-size: 1.05rem; max-width: 56ch; }

/* tool card */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.engine { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.engine button { text-align: left; background: var(--paper); border: 0; padding: 14px 16px; display: grid; gap: 2px; border-bottom: 3px solid transparent; transition: background .15s; min-width: 0; }
.engine button + button { border-left: 1px solid var(--line); }
.engine button[aria-pressed="true"] { background: var(--card); border-bottom-color: var(--accent); }
.engine button:disabled { cursor: not-allowed; opacity: .6; }
.engine b { font: 700 .98rem var(--display); display: flex; gap: 7px; align-items: center; }
.engine b i { color: var(--accent); }
.engine span { color: var(--muted); font-size: .8rem; line-height: 1.4; }

.body { padding: 18px; display: grid; gap: 16px; }

.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 30px 16px; text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: center; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--accent); }
.drop .wavehint { display: flex; gap: 3px; align-items: center; height: 34px; }
.drop .wavehint i { width: 4px; border-radius: 2px; background: var(--line-2); display: block; }
.drop h2 { font-size: 1.3rem; }
.drop p { margin: 0; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--card); padding: 10px 16px; font-weight: 600; font-size: .93rem; text-decoration: none; color: var(--ink); min-height: 44px; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.rec { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: rgba(22,23,27,.05); }
.btn.sm { min-height: 36px; padding: 6px 11px; font-size: .86rem; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.kbd { font: 600 .75rem var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--paper); color: var(--ink); }

/* ajustes */
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: .88rem; color: var(--muted); }
.opts label { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; min-height: 32px; }
.opts select { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; background: var(--card); }
.opts input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.opts .off { opacity: .45; }
.opts .vocab { flex: 1 1 100%; display: grid; gap: 5px; }
.opts .vocab label { min-height: 0; cursor: default; color: var(--ink); font-weight: 500; display: block; }
.opts .vocab label span { color: var(--muted); font-weight: 400; }
.opts .vocab input { width: 100%; border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; background: var(--card); font-size: .92rem; min-height: 42px; }
.opts .vocab input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* fila */
.queue { display: grid; gap: 8px; }
.qi { display: grid; grid-template-columns: 38px 1fr; gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--card); }
.qi.err { border-color: #efc4be; background: var(--rec-soft); }
.play { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--paper); display: grid; place-items: center; font-size: 1.05rem; grid-row: span 2; }
.play:hover { border-color: var(--accent); color: var(--accent); }
.qi-top { display: flex; justify-content: space-between; gap: 10px; min-width: 0; font-size: .88rem; }
.qi-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qi-meta { color: var(--muted); font: .78rem var(--mono); white-space: nowrap; }
.wave { display: flex; align-items: center; gap: 2px; height: 30px; min-width: 0; overflow: hidden; }
.wave i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--line-2); display: block; transition: background .25s; }
.wave i.on { background: var(--accent); }
.wave.idle i { background: var(--line-2); }
.wave.loading { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); border-radius: 4px; }
.qi-note { grid-column: 2; font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.qi.err .qi-note { color: var(--rec); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner { border-radius: var(--r-sm); padding: 12px 14px; font-size: .88rem; display: grid; gap: 10px; }
.banner.warn { background: var(--warn-soft); color: #4d3500; }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner .actions { justify-content: flex-start; }
.meter { height: 6px; border-radius: 3px; background: rgba(65,32,122,.15); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* gravação */
.recbar { display: flex; align-items: center; gap: 14px; border: 1px solid #efc4be; background: var(--rec-soft); border-radius: var(--r); padding: 14px 16px; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); flex: none; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.recbar .lvl { flex: 1; height: 8px; background: rgba(200,55,42,.15); border-radius: 4px; overflow: hidden; }
.recbar .lvl i { display: block; height: 100%; background: var(--rec); transition: width .08s; }
.recbar time { font: 600 1rem var(--mono); }

/* resultado */
.result { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.result-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.result-bar .grp { display: flex; gap: 6px; flex-wrap: wrap; }
.count { font: .78rem var(--mono); color: var(--muted); }
.result textarea { display: block; width: 100%; min-height: 260px; border: 0; resize: vertical; padding: 16px; font: 1.02rem/1.7 var(--body); background: var(--card); field-sizing: content; max-height: 70vh; }
.result textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.privacy-line { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.privacy-line i { color: var(--accent); margin-top: 2px; }

/* overlay de arrastar */
.dropzone-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(74,36,140,.93); color: #fff; display: grid; place-items: center; text-align: center; padding: 16px; }
.dropzone-overlay div { border: 3px dashed rgba(255,255,255,.7); border-radius: 22px; padding: 48px 28px; max-width: 520px; width: 100%; }
.dropzone-overlay h2 { font-size: 1.8rem; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

/* histórico (gaveta) */
.drawer-bg { position: fixed; inset: 0; background: rgba(22,23,27,.35); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); background: var(--paper); z-index: 51; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 1.15rem; }
.drawer .list { overflow-y: auto; padding: 12px 16px; display: grid; gap: 8px; align-content: start; flex: 1; }
.hist { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-sm); padding: 10px 10px 10px 12px; }
.hist button.open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.hist .t { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .s { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .m { color: var(--faint); font: .74rem var(--mono); margin-top: 2px; }
.drawer footer { padding: 12px 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* seções de conteúdo */
section.block { padding: 52px 0 0; }
section.block h2 { font-size: clamp(1.4rem, 3.6vw, 1.85rem); margin-bottom: 8px; }
section.block > .wrap > p.lead { color: var(--muted); margin: 0 0 22px; max-width: 60ch; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.step h3 { font-size: 1rem; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.step ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; }
.modes { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: .92rem; }
.modes th, .modes td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.modes thead th { background: var(--paper); font: 700 .95rem var(--display); }
.modes tbody th { font-weight: 600; color: var(--muted); width: 28%; }
.modes tr:last-child th, .modes tr:last-child td { border-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 600 1.2rem var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: '−'; }
.faq p { color: var(--muted); margin: 10px 0 0; font-size: .95rem; }

/* link do YouTube: uma linha só, no estado vazio */
.linkbox { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 520px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); padding: 4px 4px 4px 12px; }
.linkbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.linkbox > i { color: var(--muted); font-size: 1.15rem; flex: none; }
.linkbox input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: .93rem; outline: none; }
.linkbox .btn { flex: none; }
.banner.social { max-width: 560px; text-align: left; }
.banner.social a { font-weight: 600; color: var(--accent-ink); }

footer.site { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0 36px; text-align: center; font-size: .9rem; color: var(--muted); }
footer.site p { margin: 4px 0; }
footer.site .b { font-family: var(--display); font-weight: 700; color: var(--ink); text-decoration: none; }

@media (max-width: 640px) {
    .hero { padding-top: 24px; padding-bottom: 14px; }
    .body { padding: 14px; }
    .engine button { padding: 12px; }
    .engine span { font-size: .76rem; }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .modes tbody th { width: 34%; }
    .modes th, .modes td { padding: 10px; }
    .result-bar { padding: 8px; gap: 6px; }
    .result-bar .grp { gap: 4px; }
    .result-bar .btn.sm { padding: 6px 9px; }
    .hide-sm { display: none !important; }
    .opts .vocab input, .opts select, .linkbox input { font-size: 16px; } /* < 16px o Safari do iPhone dá zoom ao focar */
    .btn.sm { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
