/* Shared visual language with the voice workspace. */
:root{--accent:#0f766e;--accent-hover:#115e59;--accent-soft:#e7f6f2;--accent-text:#115e59;--page:#fff;--surface:#fff;--surface-alt:#fbfbfd;--text:#202127;--muted:#777780;--border:#e9e9ef}
@font-face{font-family:Caption;src:url('/caption-font.ttf') format('truetype');font-display:swap}
*{box-sizing:border-box}
html{font-size:16px}
body{margin:0;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;background:var(--page);color:var(--text);line-height:1.55}
button,input,textarea,select{font:inherit}
button,a,input,textarea,select{touch-action:manipulation}
button{cursor:pointer}
button:disabled{opacity:.55;cursor:wait}
button,a,input,textarea,select,summary{outline-offset:4px}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}
button{border:0;background:none;color:inherit}
a{color:inherit;text-decoration:none}
h1,h2,h3,p{margin:0}
h1{font-size:1.5rem;font-weight:650;letter-spacing:-.025em}
h2{font-size:1.2rem;letter-spacing:-.025em}
h3{font-size:1rem}
p+p{margin-top:.65rem}
label{display:block;font-size:.875rem;font-weight:600}
input:not([type=checkbox]):not([type=radio]),textarea,select{display:block;width:100%;padding:.8rem 1rem;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text)}
input{margin-top:.4rem}
textarea{resize:vertical;font-size:1rem;line-height:1.8}
input[type=checkbox],input[type=radio]{accent-color:var(--accent)}
input[type=checkbox]{width:17px;height:17px}
select{font-size:.875rem}
small,.small{font-size:.8rem}
.muted{color:var(--muted);font-weight:400}
.wrap{overflow-wrap:anywhere}
[hidden]{display:none!important}
.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:1rem;padding:.78rem 1.25rem;border-radius:10px;font-size:.9rem;font-weight:650;white-space:nowrap}
.primary{background:var(--accent);color:#fff;border:1px solid var(--accent);border-radius:999px;box-shadow:0 2px 4px #0f766e12}
.primary:hover{background:var(--accent-hover)}
.secondary{background:#fff;border:1px solid var(--border)}
.secondary:hover{background:var(--surface-alt)}
.wide{width:100%}
.text-button{padding:.2rem 0;font-size:.85rem;color:var(--accent-text)}
.badge{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:30px;padding:.22rem .7rem;color:var(--muted);font-size:.75rem;white-space:nowrap}
.error,.notice{padding:.8rem 1rem;border-radius:10px;font-size:.875rem;margin-bottom:1rem}
.error{background:#fff0ec;color:#963d2e;border:1px solid #f1cfc7}
.notice{background:#fff6dc;border:1px solid #e9ddb7;color:#796522}
.sidebar{position:fixed;inset:0 auto 0 0;width:216px;background:white;border-right:1px solid var(--border);padding:28px 16px;display:flex;flex-direction:column;z-index:5}
.brand{display:flex;align-items:center;gap:10px;padding:0 10px;font-weight:700;font-size:.95rem}
.brand small{display:block;font-size:.58rem;letter-spacing:.1em;color:#92999e;margin-top:2px}
.brand-mark{font-size:2rem;font-weight:850;letter-spacing:-.12em;line-height:1.1;position:relative;padding-right:8px}
.brand-mark span{color:var(--accent);font-size:.6rem;letter-spacing:0;margin-left:4px}
.nav-label{margin:46px 14px 10px;font-size:.7rem;letter-spacing:.1em;color:#9ca3a7}
.sidebar nav{display:flex;flex-direction:column;gap:5px}
.sidebar nav button{text-align:left;font-size:.875rem;padding:12px 14px;border-radius:9px;display:flex;gap:12px;align-items:center;color:#6c757a}
.sidebar nav button span{font-size:1.1rem;width:20px;text-align:center}
.sidebar nav button.active{background:var(--accent-soft);color:var(--accent-text);font-weight:650}
.sidebar nav button:hover{background:var(--surface-alt)}
.sidebar-bottom{margin-top:auto}
.device-card{display:flex;align-items:center;gap:8px;font-size:.75rem;border:1px solid var(--border);border-radius:10px;padding:12px 9px;width:100%}
.device-card span:last-child{margin-left:auto}
.status-dot{width:7px;height:7px;border-radius:50%;background:#b2b8bb;flex-shrink:0}
.status-dot.online{background:var(--accent)}
.user-line{display:flex;justify-content:space-between;align-items:center;font-size:.8rem;margin:20px 10px 0}
.user-line>span{max-width:135px;overflow:hidden;text-overflow:ellipsis}
main{margin-left:216px;padding:28px 32px 64px;max-width:none}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}
.eyebrow{font-size:.65rem;color:#8c979d;letter-spacing:.18em;margin-bottom:5px}
.create-grid{display:grid;grid-template-columns:minmax(390px,1fr) minmax(300px,370px);gap:26px}
.creation-panel,.preview-panel,.panel{background:white;border:1px solid var(--border);border-radius:14px;padding:24px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.creation-panel #script{height:215px;background:var(--surface-alt);border-color:var(--border);margin-bottom:26px}
.creation-panel h3{font-size:.9rem}
.voice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:26px}
.voice-card{border:1px solid var(--border);border-radius:10px;display:flex;align-items:center;gap:9px;padding:11px;cursor:pointer;font-size:.82rem}
.voice-card.selected{border-color:#b7a4f5;background:#faf8ff}
.voice-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);font-weight:600;color:var(--accent-text)}
.voice-card:nth-child(2n) .voice-avatar{background:var(--accent-soft);color:var(--accent-text)}
.voice-card small{display:block;font-size:.65rem;color:#92999b;font-weight:400}
.voice-card .play{margin-left:auto;width:28px;height:28px;border:1px solid var(--border);border-radius:50%;display:grid;place-items:center;font-size:.6rem;background:white}
.voice-card input{position:absolute;opacity:0;pointer-events:none}
.voice-card:focus-within{outline:2px solid var(--accent)}
.style-card{display:flex;align-items:center;gap:13px;border:1px solid #b7a4f5;border-radius:11px;padding:12px;width:100%;text-align:left;margin-bottom:26px;background:#faf8ff}
.style-card>span{margin-left:auto;color:var(--accent-text)}
.style-example{background:#121716;min-width:145px;height:74px;border-radius:6px;display:grid;place-content:center;font-family:Caption,sans-serif;font-size:.75rem;color:white;text-shadow:0 0 6px #fffffc80}
.style-example em{color:#bbecb0;font-style:normal;text-align:center;text-shadow:0 0 7px #95ef6780}
.style-card strong{font-size:.85rem}
.style-card small{display:block;color:var(--muted);font-size:.72rem;margin-top:6px}
.generate-footer{border-top:1px solid var(--border);margin-top:24px;padding-top:20px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.generate-footer p{max-width:220px}
.preview-panel{align-self:start;position:sticky;top:20px}
.preview-panel h3{font-size:.85rem}
.preview-empty,#preview{width:100%;aspect-ratio:9/16;border-radius:10px;background-color:#171d25;background-image:conic-gradient(#202835 25%,#171d25 0 50%,#202835 0 75%,#171d25 0);background-size:32px 32px;max-height:580px;object-fit:contain}
.preview-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;color:#b2bdcb;gap:8px}
.preview-empty strong{font-size:.95rem;color:#dae1e9;font-weight:550}
.preview-empty>span{font-size:.75rem;color:#8391a2}
.preview-symbol{width:48px;height:48px;background:#ffffff09;border:1px solid #ffffff1a;border-radius:50%;display:grid;place-items:center;font-size:.9rem;margin-bottom:12px}
.preview-panel #result-actions,.preview-panel #job-progress{margin-top:16px}
progress{width:100%;height:6px;accent-color:var(--accent)}
.review-box{margin:16px 0;border:1px solid #e7dfbc;background:#fffbeb;border-radius:8px;padding:12px;font-size:.8rem}
.review-box ul{padding-left:20px;font-size:.75rem}
.check-label{display:flex;align-items:center;gap:8px;font-size:.75rem;margin-top:12px;font-weight:400}
.preview-panel .secondary{margin-top:8px}
#saved-path{margin:10px 0}
.panel{margin-top:24px}
.cue-row{display:grid;grid-template-columns:70px 1fr;gap:15px;align-items:center;margin:10px 0}
.cue-row time{font-size:.8rem;color:#87949d}
.cue-row textarea{min-height:50px;height:65px;font-size:.875rem;padding:9px 12px}
.channel-input{margin-top:0}
.channel-input p{font-size:.9rem;margin-top:8px}
.channel-input form{display:flex;gap:14px;margin-top:22px}
.channel-input input{margin:0}
.reference-card{display:flex;gap:22px;align-items:flex-start}
.reference-card img{width:84px;height:84px;border-radius:50%;object-fit:cover}
.reference-copy{min-width:0;flex:1}
.reference-copy h2{margin-bottom:5px}
.reference-copy p{font-size:.875rem;white-space:pre-wrap;overflow-wrap:anywhere}
.reference-copy details{margin-top:14px;font-size:.82rem;color:#657079}
.reference-copy a{color:var(--accent-text);font-size:.8rem}
.asset-grid,.brand-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin-top:22px}
.asset-card,.brand-option{background:#fff;border:1px solid var(--border);border-radius:14px;padding:18px;min-width:0}
.asset-card .asset-image{height:165px;display:flex;align-items:center;justify-content:center;border-radius:8px;background-color:#202735;background-image:conic-gradient(#273143 25%,#202735 0 50%,#273143 0 75%,#202735 0);background-size:28px 28px;margin-bottom:16px;overflow:hidden;position:relative}
.asset-image img{max-width:75%;max-height:60%}
.asset-image.floating img{max-width:35%;animation:float-logo 12s ease-in-out infinite alternate}
@keyframes float-logo{from{transform:translate(-65px,-25px)}
to{transform:translate(65px,25px)}
}
.asset-card h3{font-size:.9rem}
.asset-card p{font-size:.8rem;margin-top:4px}
.brand-option img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:10px;margin-bottom:15px}
.brand-option textarea{height:140px;font-size:.85rem;margin:10px 0}
.brand-option .meaning{font-size:.8rem;color:#657079;white-space:pre-wrap;margin:10px 0}
.brand-option .option-index{font-size:.7rem;color:#96a0a6;letter-spacing:.1em;margin-bottom:10px}
.brand-option .actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.empty{padding:65px 25px;text-align:center;color:#8c969c;font-size:.9rem;border:1px dashed #d8dde1;border-radius:14px;background:var(--surface-alt)}
.history-row,.account-row{display:flex;align-items:center;gap:20px;padding:20px;background:white;border:1px solid var(--border);border-radius:12px;margin-bottom:10px}
.history-row .history-title{flex:1;min-width:0}
.history-title strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.95rem}
.history-title small{display:block;color:#8c969a;margin-top:4px}
.history-row button{font-size:.8rem}
.account-row strong{flex:1}
.auth-shell{min-height:100vh;display:grid;place-items:center;padding:20px;background:var(--surface-alt)}
.auth-card{background:white;border:1px solid var(--border);border-radius:20px;box-shadow:0 12px 40px #20212708;padding:40px;width:min(100%,430px)}
.auth-card .brand-mark{margin-bottom:20px}
.auth-card h1{font-size:1.35rem;margin-bottom:5px}
.auth-card p{font-size:.85rem}
.auth-card label{margin:18px 0}
.tabs{display:flex;gap:8px;border-bottom:1px solid var(--border);margin-top:26px}
.tabs button{padding:10px 20px;font-size:.875rem}
.tabs .active{border-bottom:2px solid var(--accent);color:var(--accent-text)}
.auth-card #register-note{margin-top:16px}
dialog{width:min(95vw,520px);border:1px solid var(--border);border-radius:18px;padding:28px;box-shadow:0 20px 100px #0002;max-height:90vh;overflow:auto}
dialog::backdrop{background:#10191866;backdrop-filter:blur(3px)}
.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}
.dialog-head button{font-size:1.6rem;color:#7a858c}
dialog p{font-size:.875rem}
dialog label{margin:16px 0}
dialog fieldset{border:0;padding:0;margin-top:20px}
dialog legend{font-size:.875rem;font-weight:600}
.radio-card{display:flex;align-items:center;gap:10px;font-weight:400!important}
.radio-card span{font-size:.75rem;color:#8c969b}
.setup-steps{padding-left:22px;font-size:.9rem}
.setup-steps li{margin:24px 0}
.setup-steps p{margin:6px 0 12px;color:#7c878b;font-size:.8rem}
.pair-code{font-size:1.6rem;letter-spacing:.2em;background:#f8f6ff;border:1px dashed #d7cbfa;border-radius:8px;padding:10px;text-align:center;margin:10px 0}
.upload-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.upload-line label{margin:5px 0;cursor:pointer}
.wm-preview{max-width:100%;max-height:120px;margin-top:14px;background:#27313f;border-radius:8px}
#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:var(--text);color:#fff;padding:13px 24px;border-radius:10px;font-size:.875rem;z-index:20;box-shadow:0 5px 24px #0002}
.device-row{padding:12px 0;border-top:1px solid var(--border);display:flex;justify-content:space-between;font-size:.8rem}
@media(min-width:1600px){.preview-empty,#preview{max-height:680px}
}
@media(max-width:1120px){.sidebar{width:200px}
main{margin-left:200px;padding:28px 22px}
.create-grid{gap:18px;grid-template-columns:minmax(330px,1.2fr) minmax(240px,.8fr)}
.creation-panel,.preview-panel{padding:18px}
.style-card{flex-wrap:wrap}
.style-example{min-width:110px}
.generate-footer{align-items:stretch;flex-direction:column}
.generate-footer p{max-width:none}
.asset-grid,.brand-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:850px){.sidebar{position:relative;width:100%;padding:15px;gap:16px;border-bottom:1px solid var(--border)}
.nav-label,.sidebar-bottom .user-line,.brand small{display:none}
.sidebar nav{flex-direction:row;overflow:auto;gap:3px}
.sidebar nav button{white-space:nowrap;font-size:.8rem;padding:8px}
.sidebar nav button span{display:none}
.sidebar-bottom{position:absolute;right:16px;top:18px}
.device-card{font-size:.7rem;padding:8px}
main{margin-left:0;padding:24px 16px}
.create-grid{grid-template-columns:minmax(0,1fr)}
.preview-panel{position:static}
.preview-empty,#preview{max-height:580px}
.topbar h1{font-size:1.4rem}
.topbar>.badge{font-size:.65rem}
.channel-input form{flex-direction:column}
.brand-grid,.asset-grid{grid-template-columns:1fr}
.history-row{gap:12px;padding:14px}
.history-row .badge{display:none}
.section-head{flex-wrap:wrap}
.reference-card{gap:14px}
.reference-card img{width:60px;height:60px}
.creation-panel #script{height:230px}
.style-card{flex-wrap:nowrap}
.generate-footer{flex-direction:row}
.generate-footer p{max-width:170px}
.auth-card{padding:26px}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}
}


.preset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 22px}
.preset-card{display:flex;flex-direction:column;align-items:stretch;gap:6px;text-align:left;padding:8px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:10px;cursor:pointer;min-width:0}
.preset-card[aria-pressed="true"]{border-color:var(--accent);background:#faf8ff;box-shadow:0 0 0 1px var(--accent)}
.preset-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.preset-card video{display:block;width:100%;height:100px;object-fit:cover;border-radius:5px;background:#111827}
.preset-card strong{font-size:13px;padding:0 3px}
.preset-card small{font-size:10px;line-height:1.5;color:var(--muted);padding:0 3px}
.project-style-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:16px 0;padding:12px;border:1px solid #526070;border-radius:9px}
.project-style-row select{width:auto;flex:1;min-width:110px}
.project-style-row small{width:100%;color:#8997a8}
.project-style-row[hidden]{display:none}
@media(prefers-reduced-motion:reduce){.preset-card video{visibility:hidden}
}
@media(max-width:420px){.preset-grid{grid-template-columns:1fr}
}


@media(max-width:850px){.sidebar-bottom{position:static;display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0}
.sidebar-bottom .device-card{width:auto}
.sidebar-bottom>a{margin:0!important}
.sidebar-bottom .user-line{display:flex;margin:0 0 0 auto;gap:10px}
.sidebar-bottom .user-line>span{max-width:90px}
}


.local-workflow{padding:28px 4px;color:var(--muted)}
.local-workflow h2{font-size:1rem;color:var(--text);margin:16px 0 12px}
.local-workflow p,.local-workflow ol{font-size:.85rem}
.local-workflow li{margin:12px 0}
.local-workflow .preview-symbol{background:var(--accent-soft);color:var(--accent-text);border-color:#e4dcfc}


/* Calm controls, light surfaces, and the voice platform's purple selection. */
button,input,textarea,select,a{transition:background-color .16s,border-color .16s,color .16s,box-shadow .16s}

.primary:active{background:#5835c9}
.secondary:hover{border-color:#d7cbfa;color:var(--accent-text)}

.brand-mark{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;background:var(--text);color:#fff;border-radius:13px;font-size:26px;letter-spacing:-2px;padding:0 3px 0 0}

.brand-mark span{position:absolute;right:5px;top:4px;font-size:6px;margin:0;color:#b9a6ff}
.auth-card .brand-mark{width:44px;height:44px}

.sidebar nav button span{display:grid;place-items:center;flex:0 0 18px}
.sidebar nav svg{width:18px;height:18px}

.sidebar nav button.active:hover{background:var(--accent-soft)}

.voice-card:hover{border-color:#d7cbfa;background:#fdfbff}
.voice-card.selected .play{color:var(--accent-text);border-color:#ddd3fa}

.preset-card:hover{border-color:#b7a4f5}
.preset-card video{height:112px;object-fit:contain}
.preset-card strong{padding-top:3px;font-weight:600}
.preset-card small{padding-bottom:3px}

.local-workflow{padding:20px 0}
.local-workflow ol{padding-left:21px;margin:22px 0 0}
.local-workflow li::marker{color:var(--accent);font-weight:600}
.local-workflow .preview-symbol{border:0;border-radius:12px;margin-bottom:20px}

#local-review-hint{background:#f8f6ff;border-color:#e6defc;color:var(--accent-text)}

.creation-panel #script:focus{border-color:#b7a4f5;box-shadow:0 0 0 3px #0f766e0a}
.badge{background:var(--surface-alt)}

@media(min-width:1450px){.preset-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(prefers-reduced-motion:reduce){button,input,textarea,select,a{transition:none}
}


.task-toolbar{display:flex;gap:14px;margin-bottom:18px}.task-toolbar input{flex:1;min-width:0}.task-toolbar select{width:180px}.task-buttons{display:flex;gap:10px;flex-wrap:wrap}.task-error{color:#9b473d}.history-row{flex-wrap:wrap}.history-title{min-width:220px}.history-title small{display:block}

.job-summary{margin:16px 0;border-bottom:1px solid var(--border);padding-bottom:16px}.job-summary>strong{font-size:14px;overflow-wrap:anywhere}.job-summary p{margin-top:8px}.task-source{white-space:pre-wrap;font-size:13px;overflow-wrap:anywhere}

/* Receipt history ends at durable delivery; render progress stays on the desktop. */
.receipt-panel{max-height:calc(100vh - 80px);overflow:auto}.receipt-note{margin:10px 0 20px}.receipt-card{padding:18px 0;border-top:1px solid var(--border)}.receipt-heading{display:flex;align-items:flex-start;gap:10px;justify-content:space-between}.receipt-heading strong{font-size:13px;overflow-wrap:anywhere}.receipt-badge{font-size:11px;font-weight:600;white-space:nowrap;padding:3px 8px;border-radius:6px}.receipt-badge.received{background:#eee8ff;color:#6742c8}.receipt-badge.waiting{background:#fff1d7;color:#94601b}.receipt-time{font-size:12px;color:var(--muted);margin-top:5px}.receipt-card dl{display:grid;grid-template-columns:65px 1fr;gap:7px 12px;font-size:12px;margin:14px 0}.receipt-card dt{color:var(--muted)}.receipt-card dd{margin:0;overflow-wrap:anywhere}.receipt-card summary{font-size:12px;color:var(--accent);cursor:pointer}.receipt-card .task-source{max-height:220px;overflow:auto;margin-top:10px}.receipt-history{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.receipt-history .receipt-card{padding:20px;border:1px solid var(--border);border-radius:12px}@media(max-width:850px){.receipt-panel{max-height:none}.receipt-history{grid-template-columns:1fr}.task-toolbar{flex-wrap:wrap}.task-toolbar select{width:150px}.task-toolbar input{flex-basis:100%}}

.draft-options{margin-top:24px;border-top:3px solid #0f766e}.draft-options label{display:flex;flex-direction:column;gap:8px;margin:16px 0}.draft-options select{padding:12px;border:1px solid #d2e5df;border-radius:8px;background:#fff} .brand-mark{font-family:inherit} body{background:#f7faf9} .creation-panel,.preview-panel{background:white}
