[hidden] { display: none !important; }
:root {
  --bg: #ffffff; --soft: #f7f7f6; --line: #e8e7e4; --ink: #111110; --muted: #6f6e6b; --faint: #a3a19c;
  --pend: #fefbf2; --pend-line: #f3e3a3; --ok: #2f8f5b; --stale: #c98a0c; --sel: #111110;
  --play: #fff1b8; --shadow: 0 10px 34px rgba(20, 18, 14, .14);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .4; cursor: default; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.center { justify-content: center; }
.spacer { flex: 1; }
.dark { background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.dark:hover:not(:disabled) { background: #000; }
.btn { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; background: #fff; font-weight: 500; }
.btn:hover:not(:disabled) { background: var(--soft); }
.btn.sm { padding: 4px 9px; font-size: 13px; border-radius: 8px; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.ic { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #3b3a37; font-size: 18px; }
.ic:hover:not(:disabled) { background: var(--soft); }

/* top bar */
.top { height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line); }
.top-l { display: flex; align-items: center; gap: 4px; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 8px; }
.top-c { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.book-title { font-weight: 600; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash { color: var(--faint); }
.chap-pick { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 8px; max-width: 320px; }
.chap-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chap-pick:hover { background: var(--soft); }
.chap-pick svg { width: 16px; height: 16px; flex: none; }
.top-r { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.credits { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; cursor: pointer; white-space: nowrap; }
.credits svg { width: 20px; height: 20px; stroke: #d4d2cd; stroke-width: 2.2; }
.credits svg .arc { stroke: #8c8a85; }
.credits.warn { color: #a3361f; }

/* layout */
.main { flex: 1; display: flex; min-height: 0; }
.rail { width: 96px; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding-top: 14px; gap: 6px; flex: none; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: #4d4c48; width: 94px; white-space: nowrap; padding: 6px 0 8px; }
.rail button svg { width: 22px; height: 22px; }
.rail button.on svg { background: var(--ink); color: #fff; width: 42px; height: 42px; padding: 10px; border-radius: 11px; }
.rail button.on { color: var(--ink); font-weight: 600; }
.rail button:not(.on):hover { color: var(--ink); }
.panel { width: 440px; border-right: 1px solid var(--line); overflow: auto; flex: none; }
.panel.closed { display: none; }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 3; }
.p-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.sec { padding: 18px 20px 6px; }
.sec h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.sec + .sec { border-top: 0; }
.ctl { display: grid; grid-template-columns: 92px 34px 1fr 74px; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); }
.ctl .ico { color: #8a8884; display: flex; align-items: center; justify-content: center; }
.ctl .ico svg { width: 18px; height: 18px; }
.ctl input[type=range] { width: 100%; accent-color: var(--ink); }
.num { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; gap: 4px; }
.num input { width: 100%; border: 0; outline: none; text-align: left; background: transparent; }
.num span { color: var(--faint); }
.sel { position: relative; }
.sel select, .field { width: 100%; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 12px; padding: 11px 38px 11px 14px; background: #fff; font-size: 15px; }
.sel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.7px solid #555; border-bottom: 1.7px solid #555; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.field { padding-right: 14px; }
textarea.field { resize: vertical; min-height: 64px; line-height: 1.45; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.box + .box { margin-top: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.sw { width: 32px; height: 19px; border-radius: 10px; background: #e2e0dc; position: relative; flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle.on .sw { background: var(--ink); } .toggle.on .sw::after { left: 15px; }
.vs { margin-top: 12px; }
.vs .ctl { grid-template-columns: 116px 1fr 56px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a6a4a, #1d1408); flex: none; }
.char { display: flex; align-items: center; gap: 10px; }
.empty-box { text-align: center; padding: 22px 10px; }
.empty-box b { display: block; font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.empty-box span { color: var(--muted); font-size: 13px; }
.take { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.take:last-child { border-bottom: 0; }
.take .pl { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.take .pl svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.take .tx { flex: 1; min-width: 0; }
.take .tx small { display: block; color: var(--muted); }
.take.cur { font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 4px 0 10px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.list-item:hover { background: var(--soft); }
.list-item.on { background: var(--soft); font-weight: 600; }
.list-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog { width: 44px; height: 5px; border-radius: 3px; background: #ebe9e5; overflow: hidden; display: flex; flex: none; }
.prog i { display: block; height: 100%; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; font-size: 13px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.voice { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.voice .grow { flex: 1; min-width: 0; }
.voice small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice .pv { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.voice .pv svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.badge { font-size: 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; color: var(--muted); }
.rule { display: grid; grid-template-columns: 1fr 20px 1fr 28px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rule .t { color: var(--muted); font-size: 11px; display: block; }
.addrule { display: grid; grid-template-columns: 1fr 76px 1fr; gap: 6px; margin-top: 10px; }
.addrule input, .addrule select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; background: #fff; }
.set { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; margin-bottom: 9px; }
.set input, .set select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; background: #fff; }
.set.wide { grid-template-columns: 1fr; }
.presets { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }

/* document */
.doc { flex: 1; overflow: auto; min-width: 0; position: relative; }
.doc-tools { position: sticky; top: 0; z-index: 4; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 14px 0; background: rgba(255,255,255,.96); }
.tool { display: inline-flex; align-items: center; gap: 7px; font-size: 15.5px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.tool:hover:not(:disabled) { background: var(--soft); }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.blocks { max-width: 1100px; margin: 0 auto; padding: 22px 60px 160px 70px; --fs: 17px; }
.p { display: grid; grid-template-columns: 34px 3px 1fr 26px; gap: 0 18px; margin-bottom: 22px; cursor: text; }
.p .who { width: 32px; height: 32px; border-radius: 50%; border: 1.6px solid #c6a23e; color: #b08a24; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; margin-top: 2px; background: #fff; }
.p.ok .who { border-color: #cfcdc8; color: #8b8984; }
.p .rail2 { width: 2px; background: #e9e7e3; border-radius: 2px; }
.p.ok .rail2 { background: var(--ink); }   /* black = audio generated for the current text (Studio) */
.p textarea { width: 100%; border: 0; resize: none; outline: none; background: transparent; font-size: var(--fs); line-height: 1.85; padding: 0; overflow: hidden; display: block; font-family: inherit; }
.p .txt { padding: 0 6px; margin: -1px -6px; border-radius: 4px; }
.p .txt { background: #fbfaf2; }                       /* every paragraph: one very faint tint (Studio) */
.p.cur .txt { background: #f4edcf; }                   /* only the selected paragraph stands out; playback moves the selection */
.p.picture .txt { background: transparent; }
.p.heading textarea { font-size: calc(var(--fs) * 1.75); font-weight: 700; line-height: 1.35; }
.p.heading2 textarea { font-size: calc(var(--fs) * 1.35); font-weight: 650; line-height: 1.4; }
.p.heading3 textarea { font-size: calc(var(--fs) * 1.15); font-weight: 620; line-height: 1.45; }
.p.caption textarea { font-style: italic; }
.p .gut { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.p .sayico { font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 8px; background: #f3e6c4; color: #8a5a00; font-weight: 600; letter-spacing: .02em; cursor: pointer; }
.p .body { position: relative; }
.p .side { display: flex; align-items: flex-start; padding-top: 4px; }
.p .saybtn { visibility: hidden; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #a39f96; cursor: pointer; }
.p .saybtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.p.cur .saybtn, .p.said .saybtn { visibility: visible; }
.p .saybtn:hover { color: var(--ink); background: var(--soft); }
.p.said .saybtn { color: #b07a10; }
.p .sayedit { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.p .sayedit textarea { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-family: inherit; font-size: var(--fs); line-height: 1.6; color: var(--ink); display: block; overflow: hidden; }
.p .sayedit .row { display: flex; gap: 8px; margin-top: 6px; }
.p.picture .who { border-color: #d6d4cf; color: #999; }
.p.picture img { max-width: 360px; max-height: 260px; border-radius: 8px; display: block; cursor: zoom-in; }
.p .pnote { font-size: 13px; color: var(--muted); margin-top: 6px; }
.flash .txt { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: #ffd9c9; } }
.empty { max-width: 520px; margin: 14vh auto; text-align: center; }
.empty h1 { font-size: 30px; margin-bottom: 6px; }
.empty .row { margin: 22px 0 10px; }

/* bottom bar */
.bar { height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 22px; border-top: 1px solid var(--line); }
.bar-c { display: flex; align-items: center; gap: 18px; }
.bar .txt { font-size: 15.5px; min-width: 40px; }
.play { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.play svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
.play .i-pause { display: none; } .play.on .i-pause { display: block; } .play.on .i-play { display: none; }
.time { font-size: 15.5px; font-variant-numeric: tabular-nums; color: #3b3a37; min-width: 110px; }
.bar-r { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-r input { width: 110px; accent-color: var(--ink); }

/* menus, toasts, modals */
.menu { position: fixed; z-index: 75; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 230px; max-height: 70vh; overflow: auto; }
.menu button { display: flex; width: 100%; text-align: left; border-radius: 8px; padding: 8px 10px; gap: 8px; }
.menu button:hover:not(:disabled) { background: var(--soft); }
.menu button.danger { color: #b3261e; }
.menu button.primary { background: var(--ink); color: #fff; font-weight: 600; justify-content: center; margin: 2px 2px 6px; }
.menu button.primary:hover:not(:disabled) { background: #000; }
.menu button.on { font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .mc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.menu .mc:hover { background: var(--soft); }
.menu .mc input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.menu .mh { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }
.jobs { position: fixed; right: 18px; bottom: 92px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.job { width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13.5px; }
.job .pb { height: 5px; background: #eeece8; border-radius: 3px; margin: 9px 0 6px; overflow: hidden; }
.job .pb i { display: block; height: 100%; background: var(--ink); transition: width .3s; }
.job .err { color: #b3261e; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; box-shadow: var(--shadow); max-width: 70vw; }
.modal { position: fixed; inset: 0; background: rgba(15, 14, 12, .32); display: flex; align-items: center; justify-content: center; z-index: 70; }
.modal-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 22px 24px; width: 540px; max-width: 92vw; max-height: 86vh; overflow: auto; }
.modal-card h2 { margin: 0 0 10px; font-size: 18px; }
.modal-card .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cost { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; margin: 12px 0; font-size: 14px; }
.cost .big { font-size: 20px; font-weight: 700; }
.list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 12.5px; }
.list div { padding: 3px 0; border-bottom: 1px solid #f2f1ee; }
textarea.paste { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
input.txtin { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.drop { position: fixed; inset: 0; background: rgba(17, 17, 16, .06); border: 3px dashed var(--ink); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; z-index: 90; }
.zoombox { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; z-index: 95; cursor: zoom-out; }
.zoombox img { max-width: 92vw; max-height: 92vh; }
.gotobox { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 50; width: 330px; }
.optrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.optrow:hover { background: var(--soft); }
.optrow .ico { width: 20px; height: 20px; color: var(--ink); display: flex; }
.optrow .ico svg { width: 20px; height: 20px; }
.optrow.goto { cursor: default; }
.optrow.goto input { width: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 14px; }
.sw2 { width: 38px; height: 22px; border-radius: 11px; background: #d9d7d2; position: relative; flex: none; transition: background .12s; }
.sw2::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .12s; }
.sw2.on { background: var(--ink); } .sw2.on::after { left: 19px; }

.p.joined { margin-top: -8px; }
/* split pieces show their letter like any paragraph (his call, 8 Nov) */
.split-prev { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; line-height: 1.5; }
.split-prev .blk { padding: 6px 0; border-bottom: 1px solid var(--line); }
.split-prev .blk:last-child { border-bottom: 0; }
.split-prev .pc { display: block; padding: 3px 8px; margin: 3px 0; background: var(--soft); border-radius: 6px; }
.split-opts { display: grid; grid-template-columns: 1fr 160px; gap: 8px; align-items: center; margin: 10px 0; }
.split-opts select, .split-opts input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; background: #fff; }

.library { flex: 1; overflow: auto; padding: 34px 48px 80px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; }
.lib-head h1 { font-size: 26px; margin: 0; }
.library > .hint { max-width: 1100px; margin: 6px auto 20px; }
.lib-list { max-width: 1100px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lib-row { display: grid; grid-template-columns: 1fr 120px 150px 120px 130px 40px; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lib-row:last-child { border-bottom: 0; }
.lib-row:hover { background: var(--soft); }
.lib-row.hd { cursor: default; background: var(--soft); font-size: 12.5px; color: var(--muted); padding: 9px 18px; }
.lib-row .t { font-weight: 600; font-size: 15px; }
.lib-row .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.lib-row .bar2 { height: 6px; border-radius: 3px; background: #ebe9e5; overflow: hidden; }
.lib-row .bar2 i { display: block; height: 100%; background: var(--ok); }
.lib-row .sm { font-size: 13px; color: var(--muted); }
body.lib .rail, body.lib .panel, body.lib #doc, body.lib .bar { display: none !important; }

.lib-search, .lib-sort { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: #fff; }
.lib-search { width: 220px; }
.lib-row { grid-template-columns: 1fr 90px 150px 110px 120px 40px; }
.lib-del { max-width: 1100px; margin: 26px auto 0; }
.lib-del summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.lib-del .lib-list { margin-top: 8px; }
.lib-del .lib-row { grid-template-columns: 1fr 160px 120px 200px; cursor: default; }
.lib-del .lib-row:hover { background: #fff; }
body.lib #btnExport, body.lib #btnQC, body.lib #btnUndo, body.lib #btnRedo, body.lib .top-l .sep { visibility: hidden; }

.sug { padding: 9px 0; border-bottom: 1px solid var(--line); }
.sug:last-child { border-bottom: 0; }
.sug-w { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.sug-r { display: grid; grid-template-columns: 64px 1fr auto 30px 30px; gap: 6px; align-items: center; }
.sug-r select, .sug-r input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; background: #fff; width: 100%; font-size: 13.5px; }
.sug-r .ic { width: 30px; height: 30px; }
.sug-r .ic svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

.panel.wide { width: 720px; }
.pr-top { display: grid; grid-template-columns: 1fr 190px auto auto; gap: 10px; padding: 16px 20px 12px; position: sticky; top: 57px; background: #fff; z-index: 2; }
.pr-top .field { padding: 11px 14px; }
.pr-voice { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding-left: 10px; }
.pr-voice select { border: 0; padding-left: 8px; }
.pr-list { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 14px 6px 10px; }
.pr { display: grid; grid-template-columns: 24px minmax(150px, 1.25fr) 1fr 1.2fr; grid-template-rows: auto auto; gap: 8px 8px; align-items: center; padding: 6px 0 10px; }
.pr-more { grid-row: 1; }
.pr-word { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 4px 6px 4px 14px; gap: 4px; }
.pr-word input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 15.5px; padding: 6px 0; background: transparent; }
.tg { width: 26px; height: 26px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: #9a9893; border: 1.4px solid #cfcdc8; display: inline-flex; align-items: center; justify-content: center; }
.tg[data-wb] { border: 0; text-decoration: underline; text-underline-offset: 3px; }
.tg.on { background: #e9e8e5; color: var(--ink); border-color: #9a9893; }
.pr .sel select { padding: 11px 36px 11px 14px; }
.pr-out { border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 15px; background: #fff; width: 100%; outline: none; }
.pr-out:focus, .pr-word:focus-within { border-color: #8f8d88; }
.pr.saved .pr-out { border-color: #bfd9c9; }
.pr-ctx { grid-column: 2 / 5; grid-row: 2; text-align: center; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; }
.pr-ctx b { color: var(--ink); font-weight: 600; }
.pr-play { grid-column: 4; grid-row: 2; justify-self: end; width: 28px; height: 28px; }
.pr-more { color: #9a9893; width: 24px; height: 24px; padding: 0; justify-self: start; }
.pr-more svg { width: 16px; height: 16px; }
.pr-more:hover { color: #b43b3b; }
.pr-play svg { width: 16px; height: 16px; fill: var(--ink); stroke: none; }
.pr-dicts { border-top: 0; }

.pr-drafts { display: flex; align-items: center; gap: 8px; margin: 0 20px 10px; padding: 10px 12px; border-radius: 12px; background: #f1edfb; color: #3d2f7a; font-size: 14px; }
.pr-drafts span { flex: 1; }
.pr.draft .pr-out { border-color: #c9bdf0; background: #faf8ff; font-style: italic; }
.pr-why { font-size: 12.5px; color: #5b4aa6; white-space: normal; margin-top: 2px; }
.pr-ctx { white-space: normal; }

.dropzone { border: 2px dashed #b9b4ab; border-radius: 14px; padding: 46px 20px; text-align: center; background: #faf9f6; transition: background .12s, border-color .12s; }
.dropzone .dz-big { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.dropzone.over { border-color: var(--ink); background: #f0eee8; }
.voice .pv.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.p .txt { position: relative; }
.p .txt textarea { position: relative; z-index: 1; }
.p .txt .hl { position: absolute; top: 0; left: 6px; right: 6px; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; z-index: 0; }
.p .txt .hl .on { background: rgba(120, 100, 40, .28); border-radius: 3px; box-shadow: 0 0 0 2px rgba(120, 100, 40, .28); }
.vmode { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.vmode button { padding: 7px 12px; font-size: 14px; font-weight: 550; color: #77736b; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.vmode button.on { color: var(--ink); border-bottom-color: var(--ink); }
.ratable { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14.5px; }
.ratable th { background: #f4f3f1; color: #77736b; font-weight: 500; text-align: left; padding: 9px 12px; }
.ratable td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
#btnPlay.busy { opacity: .55; }
.charbtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 4px 0; font-size: 14.5px; }
.charbtn .chev { color: var(--muted); font-size: 12px; }
.modal-card.wide { width: 720px; }
.pv-browser { margin-top: 8px; }
.dark.sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.p.generating .who { border-style: dashed; border-color: var(--ink); color: transparent; animation: spin 1.1s linear infinite; }
.vrow { cursor: pointer; }
.vrow .chev { color: var(--muted); font-size: 16px; margin-left: 6px; }
.vcfg { padding: 4px 0 12px 42px; cursor: default; }
.vcfg-row { margin: 8px 0; }
.vcfg-row b { display: block; font-weight: 550; margin-bottom: 2px; }
.vcfg-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.vcfg input[type=range] { width: 100%; accent-color: var(--ink); }
.vcfg .row input[type=range] { flex: 1; min-width: 0; width: auto; }
.doc-tools { flex-wrap: wrap; }
.findbar { flex: 0 0 100%; display: flex; align-items: center; gap: 4px; width: 760px; max-width: 96%; margin: -4px auto 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px 6px; flex-basis: auto; }
.doc-tools .findwrap { flex: 0 0 100%; display: flex; justify-content: center; }
.findbar input { flex: 1; border: 0; outline: none; font-size: 15px; padding: 4px 6px; min-width: 0; }
.findbar .muted { white-space: nowrap; font-size: 13px; }
.findbar .ic { width: 28px; height: 28px; }
.p .txt .fl .fm { background: #ffe58a; border-radius: 3px; }
.p .txt .fl .fm.cur { background: #ffb347; }
.fmtmenu { position: absolute; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; }
.fmtmenu .mh { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }
.fmtmenu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.fmtmenu button.on, .fmtmenu button:hover { background: var(--soft); }
.fmtmenu button b { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 650; }
.needs { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--stale); font-weight: 500; }
.needs.done { color: var(--muted); }
.needs .ic { width: 26px; height: 26px; }
.needs.done .ic { visibility: hidden; }
.checkbar { display: flex; align-items: center; gap: 6px; width: 860px; max-width: 96%; margin: -4px auto 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px 8px; font-size: 14px; }
.checkbar #ckGood { width: 92px; flex: none; }
.checkbar .ic { width: 28px; height: 28px; }
.checkbar .ck-where { white-space: nowrap; color: var(--muted); font-size: 13px; min-width: 64px; }
.checkbar .ck-what { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p .txt .fl .fm.ok { background: #d8f0d0; }
.p .txt .fl .fm.cur { background: #ffb347; }
.ck-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ck-row .btn.ok { color: #2f8f5b; border-color: #bfe3cc; }
#btnCheck.on { background: var(--soft); }
.checkbar .ck-done { background: #ececea; color: #9a9792; border-color: #e3e1dc; font-weight: 500; }

.lib-view { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 10px; }
.lib-view button { padding: 7px 12px; font-size: 14px; font-weight: 550; color: #77736b; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lib-view button.on { color: var(--ink); border-bottom-color: var(--ink); }

.sts-list { max-height: 40vh; overflow: auto; }
.sts-sent { padding: 8px 10px; border-radius: 8px; cursor: pointer; line-height: 1.5; }
.sts-sent:hover { background: var(--soft); }
.sts-sent.on { background: #f4edcf; }
.sts-words { line-height: 2; max-height: 40vh; overflow: auto; }
.sts-w { padding: 2px 4px; border-radius: 5px; cursor: pointer; }
.sts-w:hover { background: var(--soft); }
.sts-w.on { background: #f4edcf; }
.sts-step { display: flex; align-items: center; gap: 10px; margin-top: 12px; min-height: 36px; }
.sts-n { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; border: 1.4px solid #c6a23e; color: #b08a24; font-size: 11px; font-weight: 600; align-items: center; justify-content: center; margin-right: 8px; flex: none; }
.sts-recbtn .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e0493e; margin-right: 8px; vertical-align: 1px; }
.sts-recbtn.rec { background: #b3261e; }
.sts-recbtn.rec .dot { background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: .2; } }
.sts-recbtn { white-space: nowrap; min-width: 150px; }
.sts-step button { white-space: nowrap; }
.p .joinico { font-size: 12px; color: #a39f96; line-height: 1; }

.sts-lib { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0 36px; font-size: 14px; }
.sts-lib .chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.sts-lib .chip:hover { border-color: #8f8d88; }
.sts-lib .chip.hit { background: #f4edcf; border-color: #d9c98a; }
.sts-lib .chip .x { width: 18px; height: 18px; border-radius: 50%; color: #9a9893; font-size: 14px; line-height: 1; }
.sts-lib .chip .x:hover { background: #e9e8e5; color: var(--ink); }
.sts-save { font-size: 14px; margin-left: 36px; }
.sts-save .chk { display: inline-flex; align-items: center; gap: 6px; }
.sts-saveas { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 14px; width: 180px; }

.sts-libbtn { margin-left: 4px; }
.sts-lib .chip.inst { padding-left: 4px; max-width: 100%; }
.sts-lib .chip.inst small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.sts-lib .chip.inst .ic { width: 22px; height: 22px; }
.sts-lib .chip.inst .ic svg { width: 12px; height: 12px; fill: currentColor; }

/* the splice editor */
.sts-edit { margin: 8px 0 0 36px; }
.sts-lane { position: relative; margin-top: 10px; padding-bottom: 16px; }
.sts-lane-h { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; letter-spacing: .01em; text-transform: uppercase; }
.sts-lane-r { display: inline-flex; gap: 2px; text-transform: none; font-weight: 400; }
.sts-lane-r .ic { width: 22px; height: 22px; font-size: 15px; }
.sts-lane canvas { display: block; width: 100%; height: 72px; border: 1px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; user-select: none; }
.sts-times { position: relative; height: 14px; }
.sts-times span { position: absolute; top: 1px; width: 60px; text-align: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sts-times span.on { color: var(--ink); font-weight: 600; }
.sts-lane-b { display: flex; gap: 6px; margin-top: 2px; align-items: center; }
.sts-lane-b button { white-space: nowrap; }
.sts-lane-b button svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; fill: currentColor; }
.sts-lane-b .btn.on, .sts-lane-b .dark.on { background: #b4433b; color: #fff; border-color: #b4433b; }
.sts-lane-h > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.lane-play { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.lane-play svg { width: 11px; height: 11px; fill: currentColor; margin-left: 1px; }
.lane-play.on { background: #b4433b; border-color: #b4433b; color: #fff; }
.modal-card h2 em { font-style: normal; background: #f4edcf; padding: 0 6px; border-radius: 6px; }
.inst-list { width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 38vh; overflow-y: auto; }
.inst-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; cursor: pointer; border-top: 1px solid var(--line); font-size: 14.5px; }
.inst-row:first-child { border-top: 0; }
.inst-row:hover { background: var(--soft); }
.inst-ctx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst-ctx small { color: var(--muted); font-size: 13.5px; }
.inst-ch { font-size: 12px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
#stsInst { margin-left: 0; }
.mechip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; margin-right: 8px; background: #fff; }
.mechip:hover { border-color: var(--ink); }
.lib-row .who { color: var(--ink); font-size: 12.5px; }
