:root { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; color:#f4f4f6; background:#050506; font-synthesis:none; }
* { box-sizing:border-box; }
body { margin:0; min-width:320px; min-height:100vh; background:radial-gradient(circle at top,#17131f 0,#0a0a0d 32%,#050506 68%); }
button,input,textarea,select { font:inherit; }
button,select,input[type=file] { min-height:44px; }
button { border:0; border-radius:14px; padding:11px 16px; background:#6f5cff; color:white; font-weight:750; cursor:pointer; }
button.secondary { background:#17171c; color:#ededf2; }
.file-button { display:inline-flex; align-items:center; min-height:44px; border-radius:14px; padding:11px 16px; background:#17171c; color:#ededf2; font-weight:750; cursor:pointer; }
button.ghost { background:transparent; border:1px solid #34343d; color:#d9d9e2; }
button.danger { background:#32171d; color:#ffc6d0; }
button:disabled { opacity:.45; cursor:default; }
code { color:#cfc7ff; }
.app { max-width:1080px; margin:0 auto; padding:max(18px,env(safe-area-inset-top)) 16px max(32px,env(safe-area-inset-bottom)); }
.hero { padding:12px 4px 18px; }
.hero h1 { font-size:clamp(28px,5vw,46px); margin:0; letter-spacing:-.035em; }
.hero p { color:#9d9da8; margin:8px 0 0; line-height:1.45; }
.badge { display:inline-flex; padding:6px 10px; border-radius:999px; background:#15151b; color:#d5d1ff; font-size:12px; font-weight:700; margin-top:10px; }
.activity-panel { margin-top:12px; max-width:680px; padding:10px 12px; border:1px solid #24242b; border-radius:14px; background:rgba(7,7,9,.82); }
.activity-head,.section-title-row { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.activity-head { font-size:12px; color:#e3e3e8; }
.grid { display:grid; gap:14px; }
.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.section-gap { margin-top:14px; }
.card { background:rgba(12,12,15,.96); border:1px solid #24242b; border-radius:20px; padding:18px; box-shadow:0 14px 40px rgba(0,0,0,.18); }
.card h2,.card h3 { margin:0 0 12px; }
.card h2 { font-size:19px; }
.section-title-row h2 { margin-bottom:0; }
.help { color:#9898a4; font-size:13px; line-height:1.45; }
.field-label { display:grid; gap:6px; color:#9898a4; font-size:13px; margin:10px 0; }
textarea { width:100%; min-height:220px; resize:vertical; border-radius:16px; border:1px solid #303038; background:#070709; color:#f4f4f6; padding:14px; outline:none; line-height:1.5; }
textarea:focus,select:focus,input:focus { border-color:#7563ff; box-shadow:0 0 0 3px rgba(117,99,255,.16); }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.progress,.mini-progress { height:12px; border-radius:999px; overflow:hidden; background:#1b1b21; margin:9px 0; }
.mini-progress { height:7px; margin:7px 0 2px; }
.progress>div,.mini-progress>div { height:100%; background:linear-gradient(90deg,#6e5cff,#9d63ff); width:0%; transition:width .2s ease; }
.progress>div.indeterminate,.mini-progress>div.indeterminate { width:35%!important; animation:indeterminate 1.1s infinite ease-in-out; }
@keyframes indeterminate { 0%{transform:translateX(-110%)} 100%{transform:translateX(310%)} }
.status { font-size:13px; color:#aaaab5; overflow-wrap:anywhere; }
.blocks { display:grid; gap:10px; max-height:620px; overflow:auto; padding-right:2px; }
.block { border:1px solid #25252d; border-radius:16px; padding:12px; background:#0a0a0d; }
.block.dialogue { border-left:4px solid #7563ff; }
.block.thought { border-left:4px solid #b77cff; background:#0d0a12; }
.block.narration { border-left:4px solid #3d8079; }
.block-kind{font-size:11px;color:#9f98ad;margin:-2px 0 7px 2px}
.block-head { display:grid; grid-template-columns:minmax(120px,210px) 1fr auto; gap:8px; align-items:center; margin-bottom:8px; }
.block textarea { min-height:76px; }
select,input[type=text] { width:100%; border-radius:12px; background:#070709; color:#f4f4f6; border:1px solid #303038; padding:10px 12px; }
.voice-list { display:grid; gap:10px; margin-top:12px; }
.voice { background:#0a0a0d; border:1px solid #25252d; border-radius:16px; padding:12px; }
.voice-row { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; }
.voice strong { display:block; margin-bottom:4px; }
.voice .pill { margin-right:5px; }
.voice input[type=file] { width:100%; margin-top:10px; color:#bdbdc7; }
.voice-buttons { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.pill { display:inline-flex; border-radius:999px; padding:4px 8px; font-size:12px; background:#1e1e27; color:#c3c3d8; }
.pill.good { background:#123027; color:#b4f0dc; }
.pill.warn { background:#322815; color:#f3d78d; }
.jobs { display:grid; gap:7px; max-height:380px; overflow:auto; margin-top:12px; }
.job { display:grid; grid-template-columns:28px 110px minmax(0,1fr) auto; gap:8px; align-items:center; font-size:13px; padding:9px; background:#0a0a0d; border-radius:12px; }
.job .txt { color:#c6c6cf; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.job .job-state { max-width:230px; overflow-wrap:anywhere; color:#aaaab8; }
.job.done { border-left:3px solid #35b88f; }
.job.generating { border-left:3px solid #d5a53e; }
.job.error { border-left:3px solid #da5d72; }
.job-progress { grid-column:1 / -1; width:100%; }
.music { display:grid; gap:12px; }
audio { width:100%; }
.range { display:grid; grid-template-columns:130px 1fr 48px; align-items:center; gap:8px; margin-top:12px; }
input[type=range] { width:100%; }
.hidden-input { display:none; }
.debug-card details { margin-top:14px; }
.debug-card summary { cursor:pointer; color:#e3e3e8; font-weight:700; }
.debug-log { max-height:300px; overflow:auto; white-space:pre-wrap; word-break:break-word; background:#050506; border:1px solid #24242b; border-radius:12px; padding:12px; color:#c9c9d2; font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; }
.footer-note { color:#777782; font-size:12px; padding:18px 4px 0; line-height:1.45; }
@media (max-width:760px) {
  .two { grid-template-columns:1fr; }
  .block-head { grid-template-columns:1fr auto; }
  .block-head .type { display:none; }
  .job { grid-template-columns:24px 90px minmax(0,1fr); }
  .job .job-state,.job button { grid-column:1 / -1; }
  .voice-row { grid-template-columns:1fr; }
  .voice-buttons { justify-content:flex-start; }
  .range { grid-template-columns:100px 1fr 44px; }
}

.speaker-name-input{min-width:150px;flex:1 1 170px;max-width:260px;padding:10px 12px;border-radius:10px;border:1px solid #303038;background:#070709;color:#fff;font:inherit}

.function-progress-panel{margin-top:14px;max-width:980px;border:1px solid #24242b;border-radius:14px;padding:10px 12px;background:rgba(7,7,9,.82)}
.function-progress-panel summary{cursor:pointer;font-weight:750;color:#e7e7eb}
.function-progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px;margin-top:12px}
.function-progress-row{padding:8px 10px;border-radius:12px;background:#0a0a0d;border:1px solid #24242b}
.function-progress-head{display:flex;justify-content:space-between;gap:8px;font-size:12px;font-weight:700;color:#e3e3e8}
@media(max-width:760px){.function-progress-grid{grid-template-columns:1fr}}


.local-ai-box{margin:10px 0 14px;padding:12px;border:1px solid #2b2840;border-radius:14px;background:#070708;box-shadow:inset 0 0 0 1px rgba(117,99,255,.04)}
.local-ai-box .status{margin-top:8px}
.character-review{margin-top:14px;padding:12px;border:1px solid #24242b;border-radius:14px;background:#08080a}
.review-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
.review-list{display:grid;gap:7px}
.review-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:9px 10px;border-radius:11px;background:#0d0d11;border:1px solid #202027}
.review-row>span{font-size:12px;color:#9c9ca8;white-space:nowrap}
.review-aliases{margin-top:3px;color:#898994;font-size:12px;line-height:1.35}
.review-unassigned{border-color:#5a451f;background:#151107}
.review-warnings{display:grid;gap:5px;margin-bottom:10px;color:#e3c77e;font-size:12px;line-height:1.4}
strong{color:#f4f4f6}


.tag-format-box{margin:14px 0 16px;padding:14px;border:1px solid #27232f;border-radius:14px;background:#08070a}
.prompt-box{min-height:300px;font-size:12px;line-height:1.45;background:#030304;color:#bdb7c9}
.review-summary{margin:10px 0;padding:10px 12px;border:1px solid #282331;border-radius:10px;background:#070609;color:#d8d3df}


.resume-panel{margin:14px 0;padding:14px;border:1px solid #2b2840;border-radius:14px;background:#08070b;box-shadow:inset 0 0 0 1px rgba(117,99,255,.04)}
.resume-controls{display:grid;grid-template-columns:minmax(170px,1fr) auto minmax(170px,1fr) auto;gap:10px;align-items:end;margin-top:12px}
.resume-controls label{display:grid;gap:6px;color:#b9b9c4;font-size:12px;font-weight:650}
.resume-controls input[type=number]{width:100%;border-radius:12px;background:#050507;color:#f4f4f6;border:1px solid #303038;padding:10px 12px;font:inherit}
.job.playing-now{outline:2px solid #7563ff;background:#12101a;box-shadow:0 0 0 4px rgba(117,99,255,.10)}
@media(max-width:760px){.resume-controls{grid-template-columns:1fr 1fr}.resume-controls label{grid-column:1/-1}.resume-controls button{width:100%}}

.job.current-job{outline:2px solid #d5a53e;background:#151209;box-shadow:0 0 0 4px rgba(213,165,62,.08)}
.job.playing-now.current-job{outline-color:#7563ff;background:#12101a}

/* v21 RAVEN Soura emotion steering + permanent master voice library */
.block-head{grid-template-columns:minmax(130px,210px) minmax(100px,135px) minmax(120px,175px) auto}
.emotion-fixed{display:flex;align-items:center;min-height:44px;padding:0 4px}
.voice-variants{display:grid;gap:9px;margin-top:10px}
.voice-variant{padding:10px;border:1px solid #202028;border-radius:12px;background:#070709}
.voice-variant-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.voice-variant-head>div:first-child{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.voice-variant-head strong{margin:0}
.voice-variant input[type=file]{margin-top:8px}
.job-emotion{display:block;margin-top:2px;color:#a99cff;font-size:10px;font-weight:700;line-height:1.2}
@media(max-width:760px){
  .block-head{grid-template-columns:1fr 1fr}
  .block-head .deleteBlock{justify-self:end}
  .block-head .emotion-fixed{grid-column:1/-1}
  .voice-variant-head{display:grid;grid-template-columns:1fr}
  .voice-variant-head .voice-buttons{justify-content:flex-start}
}
.voice>summary{cursor:pointer;list-style:none}
.voice>summary::-webkit-details-marker{display:none}
.voice>summary:after{content:'›';font-size:20px;color:#8f86d8;transition:transform .15s ease}
.voice[open]>summary:after{transform:rotate(90deg)}
.voice>summary.voice-row{grid-template-columns:1fr auto auto}
@media(max-width:760px){.voice>summary.voice-row{grid-template-columns:1fr auto}.voice>summary.voice-row>.status{grid-column:1/-1}}
/* v2.7 AI Studio */
#pronunciationDictionary{min-height:140px}

.pronunciation-candidates{display:grid;gap:8px;margin-top:10px}.pron-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,1fr) auto;gap:8px;align-items:center;padding:9px;border:1px solid #2b2b31;border-radius:10px}.pron-row input{width:100%}@media(max-width:700px){.pron-row{grid-template-columns:1fr}.pron-row button{justify-self:start}}
/* v3.0 RAVEN Max */
.trial-audio-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}.trial-audio-grid label{display:grid;gap:5px;color:#b9b9c4;font-size:12px;font-weight:700}.trial-audio-grid audio{width:100%;max-width:100%}.voice-quality,.voice-performance{margin-top:8px}.voice-quality summary,.voice-performance summary{cursor:pointer;color:#d7d3e4;font-weight:700}@media(max-width:700px){.trial-audio-grid{grid-template-columns:1fr}}

/* v3.1 ordered manual SFX matching */
.sfx-cue-scroll{display:flex;flex-direction:column;gap:12px;max-height:72vh;overflow:auto;padding:4px 4px 12px;scroll-behavior:smooth}
.sfx-cue-row{border:1px solid var(--line,#d7dbe2);border-radius:14px;padding:14px;background:rgba(255,255,255,.035);transition:box-shadow .18s ease,transform .18s ease,border-color .18s ease}
.sfx-cue-row.sfx-cue-focus{box-shadow:0 0 0 3px rgba(89,132,255,.28);transform:scale(1.006)}
.sfx-cue-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.sfx-cue-number{font-weight:800;font-variant-numeric:tabular-nums;min-width:2.8em}
.sfx-cue-family{font-size:1.02rem;margin-bottom:8px;overflow-wrap:anywhere}
.sfx-match-hint{border-left:4px solid currentColor;padding:9px 11px;margin:8px 0;border-radius:8px;background:rgba(127,127,127,.09);line-height:1.45}
.sfx-match-hint span{display:block;font-size:.72rem;font-weight:800;letter-spacing:.08em;opacity:.7;margin-bottom:3px}
.sfx-selected-files{font-size:.82rem;opacity:.8;margin-top:6px;overflow-wrap:anywhere}

.sfx-cue-row[data-selectable="1"]{cursor:pointer;}
.sfx-cue-row[data-selectable="1"]:active{transform:scale(.998);}

/* v3.1.3 tap-to-assign cue cards */
.sfx-cue-row[data-selectable="1"]{cursor:pointer;position:relative;}
.sfx-cue-row[data-selectable="1"]:hover{border-color:rgba(89,132,255,.55);}
.sfx-cue-row[data-selectable="1"]:focus{outline:3px solid rgba(89,132,255,.35);outline-offset:2px;}
.sfx-cue-row[data-ready="1"]{border-color:rgba(75,190,120,.42);}
.sfx-tap-action{margin-top:10px;padding:10px 12px;border-radius:10px;background:rgba(89,132,255,.10);font-weight:700;font-size:.9rem;}
.sfx-cue-row[data-ready="1"] .sfx-tap-action{background:rgba(75,190,120,.10);}

/* v3.2 importer hardening */
.import-preview{margin-top:14px;padding:14px;border:1px solid #353045;border-radius:14px;background:#09080d}
.import-summary{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.import-summary .pill{background:#181521;color:#ddd7ff}
.import-issues{display:grid;gap:6px;margin-top:10px}
.import-issue{padding:8px 10px;border-radius:10px;background:#121017;border:1px solid #2d2836;color:#c9c4d0;font-size:12px;line-height:1.4}
.import-issue.warn{border-color:#5a451f;background:#151107;color:#efd487}
.import-issue.error{border-color:#6b2934;background:#1a0d10;color:#ffc1cb}
.import-issue.good{border-color:#24523f;background:#0c1713;color:#b8eed7}
.import-preview-blocks{display:grid;gap:6px;max-height:320px;overflow:auto;margin-top:12px;padding-right:2px}
.import-preview-row{display:grid;grid-template-columns:42px minmax(86px,140px) minmax(0,1fr);gap:8px;align-items:start;padding:8px 10px;border:1px solid #23232b;border-radius:10px;background:#0b0b0e;font-size:12px}
.import-preview-row .n{color:#777787;font-variant-numeric:tabular-nums}
.import-preview-row .kind{color:#b7adff;font-weight:700}
.import-preview-row .txt{color:#c9c9d2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){.import-preview-row{grid-template-columns:34px 105px minmax(0,1fr)}}

/* DEBUG16 lightweight directing / QC */
.bookmark-controls{display:grid;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #24242b}
.bookmark-list{display:flex;flex-wrap:wrap;gap:7px}
.bookmark-row{display:flex;gap:4px;align-items:center}
.bookmark-row .bookmark-jump{padding:7px 9px;font-size:11px}
.bookmark-row .bookmark-delete{padding:7px 8px;font-size:11px}
.chapter-meta-grid{display:grid;grid-template-columns:2fr .7fr 1.5fr;gap:10px;margin:10px 0 12px}
.chapter-meta-grid label{display:grid;gap:6px;color:#b9b9c4;font-size:12px;font-weight:650}
.chapter-meta-grid input{width:100%;border-radius:12px;background:#050507;color:#f4f4f6;border:1px solid #303038;padding:10px 12px;font:inherit}
.level-overview{height:58px;display:flex;align-items:flex-end;gap:2px;margin-top:12px;padding:8px;border:1px solid #26262e;border-radius:10px;background:#050507;overflow:hidden}
.level-bar{flex:1 1 3px;min-width:2px;max-width:10px;height:8%;border-radius:2px 2px 0 0;background:#34343d;opacity:.72}
.level-bar.done{background:#7b73a8;opacity:.9}
.level-bar.warn{background:#b98a3f}
@media(max-width:760px){.chapter-meta-grid{grid-template-columns:1fr}.level-overview{height:48px}}
