:root {
  --bg: #f7f7f8; --card: #fff; --ink: #0b0b0f; --ink2: #3f3f46; --mute: #71717a; --line: #e7e7ea; --soft: #f1f1f3;
  --navy: #2e3192; --orange: #f7941d; --red: #e8452c; --ok: #15803d; --bad: #b91c1c;
  --r: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 Inter, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: inherit; cursor: pointer; }
h1 { font-size: 22px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 18px 0 4px; }
h3 { font-size: 15px; font-weight: 650; margin: 0 0 12px; }
.muted, .ph p { color: var(--mute); margin: 0; }
label { display: block; font-size: 12.5px; color: var(--ink2); font-weight: 550; margin: 12px 0 0; }
label > span { display: block; margin-bottom: 6px; }
label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
label.inline > span { margin: 0; white-space: nowrap; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: #a1a1aa; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
textarea { resize: vertical; }
input[type=range] { padding: 0; border: 0; box-shadow: none; accent-color: var(--ink); height: 22px; }
input[type=checkbox] { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #27272a; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 18px; padding: 11px; }
.btn:disabled { opacity: .5; cursor: wait; }
.row { display: flex; align-items: flex-end; flex-wrap: wrap; }
.row.gap { gap: 10px; margin-top: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; }
.grow { flex: 1; }
.msg { margin-top: 10px; font-size: 13px; white-space: pre-wrap; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.hint { color: var(--mute); font-size: 12px; margin-top: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two > .card { margin-bottom: 16px; }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #eef0ff, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,.06); text-align: left; }
.auth-crest { width: 64px; display: block; margin: 0 auto 10px; }
.auth-brand { text-align: center; font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.auth-app { text-align: center; color: var(--mute); font-size: 13px; }
.auth-lang { margin-top: 18px; justify-content: center; }
.ver { color: #a1a1aa; font-size: 11px; text-align: center; margin-top: 8px; }

/* layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand img { width: 34px; }
.brand b { display: block; font-size: 13px; color: var(--navy); }
.brand span { display: block; font-size: 12px; color: var(--mute); }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink2); font-weight: 550; text-decoration: none; margin-bottom: 2px; }
nav a:hover { background: var(--soft); }
nav a.on { background: var(--soft); color: var(--ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; font-size: 12.5px; }
.me span { display: block; font-weight: 600; } .me small { color: var(--mute); }
.side-links { margin: 6px 0; color: var(--mute); }
.lang { display: flex; gap: 4px; margin-bottom: 10px; }
.lang button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.lang button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.search { max-width: 300px; }

/* icons (CSS masks) */
.ic { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; flex: none; }
.ic-wave { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 12h2M7 8v8M11 4v16M15 7v10M19 10v4M21 12h0'/%3E%3C/svg%3E"); }
.ic-stack { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 8l9 5 9-5-9-5zM3 13l9 5 9-5M3 17l9 5 9-5'/%3E%3C/svg%3E"); }
.ic-mic { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); }
.ic-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ic-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
.ic-plug { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 2v5M15 2v5M6 7h12v4a6 6 0 0 1-12 0V7zM12 17v5'/%3E%3C/svg%3E"); }
.ic-gear { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
.ic-play-w { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4v16l13-8z'/%3E%3C/svg%3E"); width: 14px; height: 14px; }

/* studio */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.editor { padding: 0; overflow: hidden; }
.editor-top { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.editor-top input { max-width: 260px; }
.editor textarea { border: 0; border-radius: 0; min-height: 360px; padding: 18px; font-size: 16px; line-height: 1.75; box-shadow: none; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fcfcfd; }
.stats { color: var(--mute); font-size: 12.5px; }
.panel { position: sticky; top: 20px; }
.panel h3 { margin-bottom: 4px; }
.scale { display: flex; justify-content: space-between; color: var(--mute); font-size: 11.5px; margin-top: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { background: var(--soft); }
.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.more summary { cursor: pointer; color: var(--ink2); font-size: 12.5px; font-weight: 550; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dim { opacity: .45; pointer-events: none; }
.result { display: flex; flex-direction: column; gap: 10px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.result audio, .list audio, .tbl audio { width: 100%; height: 36px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; background: var(--soft); color: var(--ink2); font-weight: 600; }
.pill.ok { background: #dcfce7; color: var(--ok); } .pill.bad { background: #fee2e2; color: var(--bad); } .pill.run { background: #e0e7ff; color: var(--navy); }
.list .item { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(160px, 240px) minmax(0, auto); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item-btns { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.item b { word-break: break-all; }
.list .item:first-child { border-top: 0; }
.item b { display: block; } .item small { color: var(--mute); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--mute); font-weight: 550; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.tbl td.script { max-width: 420px; color: var(--ink2); }
.tbl td.script div { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.paste { min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; margin-top: 10px; }
.progress { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress div { height: 100%; width: 0; background: var(--ink); transition: width .3s; }

/* voices */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.vcard.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.vhead { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--navy), var(--orange)); flex: none; }
.vhead b { display: block; } .vhead small { color: var(--mute); font-size: 11.5px; word-break: break-all; }
.vactions { display: flex; gap: 6px; flex-wrap: wrap; }
.drop { display: grid; place-items: center; text-align: center; border: 1.5px dashed #d4d4d8; border-radius: 12px; padding: 26px; color: var(--mute); cursor: pointer; margin-top: 12px; font-weight: 500; }
.drop.over { border-color: var(--ink); background: var(--soft); }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; font-weight: 500; }

/* usage */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi small { color: var(--mute); display: block; }
.kpi b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar div { height: 100%; background: var(--ink); }

/* codex */
.code { background: #0b0b0f; color: #e4e4e7; border-radius: 12px; padding: 14px 16px; font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 0 0 10px; }
.tok-new { margin: 14px 0; padding: 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; }
.tok-new code { display: block; font: 13px ui-monospace, Menlo, Consolas, monospace; margin: 8px 0; word-break: break-all; }

/* settings */
.model-rows .mrow { display: grid; grid-template-columns: 120px 1.4fr 1fr 1fr 1fr 1fr; gap: 10px; align-items: end; padding: 10px 0; border-top: 1px solid var(--soft); }
.model-rows .mrow:first-child { border-top: 0; }
.model-rows label { margin: 0; }
.rep-rows .rrow { display: grid; grid-template-columns: 120px 1fr 36px; gap: 8px; margin-bottom: 6px; }
.keyrow { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: grid; place-items: center; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; padding: 22px; width: 360px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .studio, .two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .panel { position: static; }
  .list .item { grid-template-columns: 1fr; }
  .model-rows .mrow { grid-template-columns: 1fr 1fr; }
}
.row.gap > input, .row.gap > select { width: auto; flex: 1 1 180px; }

/* microphone recording */
.mic { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfd; }
.mic-head { display: flex; align-items: center; gap: 12px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; display: inline-block; }
#micBtn.recording { background: #ef4444; border-color: #ef4444; }
#micBtn.recording .rec-dot { background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.mic-time { font: 600 14px ui-monospace, Menlo, Consolas, monospace; min-width: 48px; }
.meter { flex: 1; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.meter div { height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); transition: width .08s; }
.read-this { margin: 10px 0 0; padding: 12px 14px; border-left: 3px solid var(--navy); background: #fff; border-radius: 8px; font-size: 15px; line-height: 1.7; color: var(--ink); }
.or { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 12px; margin: 14px 0 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Show / hide password eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  display: grid; place-items: center; border: 0; background: transparent; color: #6b7280; cursor: pointer; border-radius: 8px; padding: 0; }
.pw-eye:hover { background: #f3f4f6; color: #111; }
.pw-eye svg { width: 18px; height: 18px; }

/* How-to guide */
.ph { display: flex; align-items: flex-start; gap: 12px; }
.guide-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.guide-btn .g-q { width: 20px; height: 20px; border-radius: 50%; background: #111; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.g-ring { position: fixed; z-index: 900; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 4px #f5b301, 0 0 0 9999px rgba(15, 23, 42, .55); transition: all .25s ease; }
.g-card { position: fixed; z-index: 901; width: min(360px, 92vw); background: #fff; border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); font-size: 14px; line-height: 1.55; }
.g-card h4 { margin: 6px 0 6px; font-size: 17px; }
.g-card p { margin: 0 0 8px; }
.g-card code { background: #f3f4f6; padding: 1px 5px; border-radius: 5px; }
.g-top { display: flex; align-items: baseline; gap: 4px; }
.g-num { background: #f5b301; color: #111; font-weight: 800; border-radius: 999px; min-width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: 14px; }
.g-of { color: #6b7280; font-size: 13px; }
.g-x { margin-left: auto; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #6b7280; }
.g-tip { color: #6b7280; font-size: 12.5px; }
.g-dots { display: flex; gap: 5px; margin: 8px 0 10px; }
.g-dots i { width: 7px; height: 7px; border-radius: 50%; background: #e5e7eb; }
.g-dots i.past { background: #9ca3af; } .g-dots i.on { background: #f5b301; width: 18px; border-radius: 4px; }
.g-btns { display: flex; justify-content: space-between; }
.g-arrow { position: absolute; width: 16px; height: 16px; background: #fff; transform: rotate(45deg); }
.g-card[data-side=below] .g-arrow { top: -7px; }
.g-card[data-side=above] .g-arrow { bottom: -7px; }
.g-card[data-side=side] .g-arrow { display: none; }
details.bulk { margin: 10px 0; }
details.bulk summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
details.bulk textarea { width: 100%; margin-bottom: 8px; }

/* voice rename + people name */
.vname { cursor: pointer; } .vname .pen { color: #a1a1aa; font-weight: 400; font-size: 12px; margin-left: 2px; }
.vname:hover .pen { color: var(--ink); }
.ren-row { display: flex; gap: 6px; align-items: center; } .ren-row input { padding: 5px 8px; width: 150px; }
.name-in { padding: 5px 8px; min-width: 120px; border-color: transparent; background: transparent; } .name-in:hover, .name-in:focus { border-color: var(--line); background: #fff; }

/* AI helper */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 800; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 650; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ai-fab:hover { transform: translateY(-1px); }
.ai-spark { color: #f5b301; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 800; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 44px)); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.ai-head { display: flex; align-items: center; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-head b { margin-right: auto; font-size: 15px; }
.ai-x { border: 0; background: transparent; cursor: pointer; color: var(--mute); font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 6px; } .ai-x:hover { background: var(--soft); color: var(--ink); }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #fafafa; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; line-height: 1.5; font-size: 13.5px; white-space: normal; word-break: break-word; }
.ai-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-card { align-self: stretch; background: #fffbea; border: 1px solid #f5d76e; border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.ai-card.done { background: #effaf3; border-color: #a7e3bd; } .ai-card.cancel { opacity: .6; }
.ai-card-t { font-weight: 700; margin-bottom: 4px; } .ai-card .row { margin-top: 8px; justify-content: flex-end; }
.ai-ok { color: #15803d; font-weight: 650; margin-top: 6px; } .ai-note { margin-top: 4px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #fafafa; }
.ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-form textarea { resize: none; min-height: 42px; }
.ai-typing { display: flex; gap: 4px; } .ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #a1a1aa; animation: aib 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aib { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* AI helper window: drag by the title bar, resize from the bottom-right corner */
.ai-panel { resize: both; min-width: 300px; min-height: 360px; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); }
.ai-head { cursor: grab; user-select: none; touch-action: none; }
.ai-panel.dragging { opacity: .92; } .ai-panel.dragging .ai-head { cursor: grabbing; }
.ai-grip { color: #a1a1aa; margin-right: 6px; font-size: 14px; }

.ai-clip { margin: 0; width: 38px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 18px; flex: none; background: #fff; }
.ai-clip:hover { background: var(--soft); }
.ai-pending { display: flex; gap: 6px; padding: 0 10px; flex-wrap: wrap; }
.ai-pending:not(:empty) { padding-top: 8px; }
.ai-pend { position: relative; } .ai-pend img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.ai-pend button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 11px; cursor: pointer; }
.ai-thumb { max-width: 160px; max-height: 120px; border-radius: 8px; display: block; margin-bottom: 4px; }
.ai-panel.drop-on { outline: 3px dashed #f5b301; outline-offset: -6px; }
.ai-pw { margin: 8px 0 0; } .ai-pw input { background: #fff; }

.mic-src { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--soft); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.mic-dev { flex: 1; min-width: 180px; max-width: 360px; padding: 6px 10px; }

.nowrap { white-space: nowrap; }
.del-btn.sure { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 650; }

.hist-tabs { margin: -6px 0 12px; align-items: center; }
.seg .count:not(:empty) { background: #ef4444; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 2px; }

/* logo = home */
a.brand { text-decoration: none; color: inherit; border-radius: 12px; cursor: pointer; }
a.brand:hover { background: var(--soft); }

.linklike { background: none; border: 0; padding: 6px 0; color: var(--ink2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.linklike:hover { color: var(--ink); }
.code-in { font-size: 22px; letter-spacing: 6px; text-align: center; }
.msg.ok { color: #15803d; }
ol.how { margin: 6px 0 0 18px; padding: 0; line-height: 1.7; font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin: 10px 0; }

/* voices: pictures, grid / list */
.vtools { margin: -4px 0 12px; align-items: center; }
.small { font-size: 12.5px; }
.avatar-wrap { position: relative; flex: none; }
button.avatar { border: 0; padding: 0; cursor: pointer; position: relative; overflow: hidden; width: 52px; height: 52px; font: inherit; font-weight: 700; color: #fff; font-size: 18px; }
button.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.avatar .cam { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); font-size: 16px; opacity: 0; transition: opacity .15s; }
button.avatar:hover .cam, button.avatar:focus-visible .cam { opacity: 1; }
.pic-x { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: #111; color: #fff; font-size: 10px; cursor: pointer; display: none; place-items: center; padding: 0; }
.avatar-wrap:hover .pic-x { display: grid; }
.voice-grid.list { grid-template-columns: 1fr; gap: 8px; }
.voice-grid.list .vcard { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 14px; gap: 12px; }
.voice-grid.list .vhead { flex: 1 1 320px; min-width: 0; }
.voice-grid.list .vhead small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-grid.list button.avatar { width: 44px; height: 44px; }
.voice-grid.list .vactions { flex: none; }
.voice-grid.list audio { flex: 1 1 100%; }

/* voice categories */
.cat-chips { margin: 0 0 12px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.count-s { opacity: .6; font-size: 11px; margin-left: 2px; }
.cat-head { grid-column: 1 / -1; margin: 10px 0 -2px; font-size: 14px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.cat-head:first-child { margin-top: 0; }
.cat-tag { border: 1px solid var(--line); background: #f8fafc; color: var(--ink2); border-radius: 999px; font: inherit; font-size: 11.5px; padding: 1px 8px; cursor: pointer; vertical-align: 2px; }
.cat-tag.empty { color: #a1a1aa; border-style: dashed; background: transparent; }
.cat-tag:hover { border-color: var(--ink); color: var(--ink); }
.vhead small { display: block; margin-top: 2px; }
.cat-tag { margin-left: 2px; }
#genStop { color: #b91c1c; border-color: #fca5a5; }
#histTbl td:nth-child(5), #histTbl td:nth-child(6), #histTbl td:nth-child(7) { white-space: nowrap; }
.vhead small.vmade { color: var(--ink2); }
.cat-rows { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.cat-row { display: flex; gap: 4px; align-items: center; }
.cat-row input { width: 170px; padding: 7px 10px; }
.ren-row select { padding: 4px 8px; font-size: 13px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.perm { border: 1px solid var(--line, #ddd); background: transparent; color: var(--ink2); border-radius: 999px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.perm.on { background: var(--ink, #111); color: #fff; border-color: var(--ink, #111); }
#peopleTbl select { min-width: 88px; }
#peopleTbl th { white-space: nowrap; }
.ic-chat { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 5h11v8H8l-4 3V5z'/%3E%3Cpath d='M15 9h5v8l-3-2h-6v-2'/%3E%3C/svg%3E"); }
.cast { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.cast-row { display: grid; grid-template-columns: minmax(70px, 110px) 1fr; gap: 8px; align-items: center; }
.cast-name { font-weight: 700; font-size: 13px; color: var(--c); overflow-wrap: anywhere; }
.cast-name::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.cast-row select { width: 100%; }
.mode-tabs { display: inline-flex; gap: 4px; background: var(--bg2, #f1f1f3); border-radius: 12px; padding: 4px; margin: -4px 0 16px; }
.mode-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink2); }
.mode-tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dlg-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: #fff6e0; border-bottom: 1px solid #f1dfb0; font-size: 14px; }
.dlg-hint.hidden { display: none; }
.hl-wrap { position: relative; }
.hl-back { position: absolute; overflow: hidden; white-space: pre-wrap; pointer-events: none; color: var(--ink); box-sizing: border-box; }
.hl-wrap textarea { position: relative; z-index: 1; background: transparent; color: transparent; caret-color: var(--ink); width: 100%; display: block; }
.hl-wrap textarea::placeholder { color: var(--ink2); }
.hl-name { color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border-radius: 4px; }
.hl-name.nov { text-decoration: underline wavy #d9534f; text-underline-offset: 3px; }
.sel-col { width: 34px; text-align: center; }
.sel-col input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--ink, #111); }
.sel-bar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--ink, #111); color: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.sel-bar.hidden { display: none; }
.sel-bar .btn.ghost { background: #fff; color: #111; }
.sel-bar .grow { flex: 1; }
#histTbl tr.picked td { background: color-mix(in srgb, var(--ink, #111) 6%, transparent); }
#histTbl .pill { white-space: nowrap; }
.timings { margin-top: 10px; }
.timings summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.tbl.tm tr[data-seek] { cursor: pointer; }
.tbl.tm tr[data-seek]:hover td { background: color-mix(in srgb, var(--ink, #111) 5%, transparent); }
.tbl.tm td { padding: 6px 8px; font-size: 13px; vertical-align: top; }
.mono { font-variant-numeric: tabular-nums; }
.vnote { margin: 4px 0 2px; font-size: 13px; color: var(--ink); background: #fff8e6; border-radius: 6px; padding: 4px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.vnote.ed { cursor: pointer; }
.vnote.ed:hover { outline: 1px dashed #d8b45a; }
.vnote-add { display: block; margin: 4px 0 2px; padding: 0; border: 0; background: none; color: var(--ink2); font-size: 12px; cursor: pointer; text-decoration: underline dotted; }
.note-edit { margin: 6px 0; display: flex; flex-direction: column; gap: 6px; }
.note-edit textarea { width: 100%; font-size: 13px; }
.hl-stage { color: #9aa3ad !important; background: repeating-linear-gradient(90deg, rgba(154,163,173,.12) 0 6px, transparent 6px 8px); }
.mail-h { margin: 14px 0 4px; font-size: 14px; }
.vis-tag { display: inline-block; margin: 4px 0 2px; padding: 2px 9px; border-radius: 999px; font-size: 12px; border: 1px solid #cfe8d8; background: #eef9f2; color: #1f7a4a; cursor: pointer; }
span.vis-tag { cursor: default; }
.vis-tag.priv { border-color: #f1d3a6; background: #fff4e3; color: #9a5b00; }
.vis-tabs { margin: 6px 0 10px; }
.vis-tabs button .count-s { margin-left: 4px; }
.cx-steps { margin: 6px 0 12px 20px; padding: 0; line-height: 1.75; }
.cx-steps li { margin: 2px 0; }
details.adv > summary { cursor: pointer; font-weight: 600; color: var(--ink2); }
details.adv[open] > summary { margin-bottom: 8px; }
details.adv h3 { margin-top: 18px; }
.readas h3 { margin: 0; }
.chg-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chg { font-size: 13px; background: #f4f6fb; border: 1px solid #e3e8f2; border-radius: 8px; padding: 3px 8px; }
.chg s { color: #b4232f; text-decoration-thickness: 1px; }
.chg b { color: #1f6b3a; font-weight: 600; }
pre.spoken { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.7; background: #fafafa; border-radius: 10px; padding: 12px 14px; margin: 6px 0 0; }
.check { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.check.good { background: #eef8f0; color: #1f6b3a; }
.check.bad { background: #fff3f2; color: #8a1f17; }
.check s.miss { color: #b4232f; }
.check b.heard { color: #b4232f; background: #ffe1de; padding: 0 3px; border-radius: 4px; }
.check tr[data-seek2] { cursor: pointer; }
p.spoken { margin: 4px 0; font-size: 13px; line-height: 1.6; }
