:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--page);font-size:calc(14px * var(--studio-ui-scale));color-scheme:light;--accent:var(--accent-text);--accent-solid:var(--primary);--on-accent:var(--on-primary);--border:#dce5e5;--text:#192d34;--page:#f2f5f5;--surface:#fff;--soft:#f4f7f7;--muted:#61777c;--label:#52666b;--active:var(--selected-bg);--danger:var(--danger-text);--focus:var(--selected-border);--handle:#9aacaf;--pill-bg:#e8f4ef;--pill-text:#33756d;--replay-bg:#edf1ff;--replay-text:#596aba;--fcc-bg:#fff1df;--fcc-text:#8b5a0f;--empty-border:#bacdcd;--logo-bg:#a1acae;--backdrop:#102e3d60;--shadow:#122a3430;--auth-glow:var(--selected-bg);--toast:#183c41}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;border:calc(1px * var(--studio-ui-scale)) solid var(--border);background:var(--surface);border-radius:calc(8px * var(--studio-ui-scale));padding:calc(9px * var(--studio-ui-scale)) calc(13px * var(--studio-ui-scale));color:inherit}button:hover{border-color:var(--accent-text);color:var(--accent-text)}button.primary{background:var(--primary);color:var(--on-primary);border-color:var(--accent-text)}button.danger{color:var(--danger-text)}input,select,textarea{padding:calc(10px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale));border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(8px * var(--studio-ui-scale));background:var(--surface);min-width:0;width:100%;color:inherit}input:focus,select:focus,textarea:focus{outline:calc(2px * var(--studio-ui-scale)) solid var(--focus)}header{height:calc(76px * var(--studio-ui-scale));padding:0 calc(30px * var(--studio-ui-scale));background:var(--surface);border-bottom:calc(1px * var(--studio-ui-scale)) solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:calc(12px * var(--studio-ui-scale))}header>div{display:flex;gap:calc(20px * var(--studio-ui-scale));align-items:center}.brand{font-weight:800;font-size:calc(24px * var(--studio-ui-scale));letter-spacing:calc(-1px * var(--studio-ui-scale));color:var(--accent-text)}.muted,.hint{color:var(--muted)}.hint{font-size:calc(12px * var(--studio-ui-scale));line-height:1.8}.layout{display:grid;grid-template-columns:calc(235px * var(--studio-ui-scale)) 1fr;min-height:calc(100vh - calc(76px * var(--studio-ui-scale)))}aside{padding:calc(22px * var(--studio-ui-scale)) calc(16px * var(--studio-ui-scale));background:var(--surface);border-right:calc(1px * var(--studio-ui-scale)) solid var(--border)}.section-title{display:flex;align-items:center;justify-content:space-between;font-weight:700;margin:0 0 calc(10px * var(--studio-ui-scale))}.section-title:nth-of-type(2){margin-top:calc(28px * var(--studio-ui-scale))}.section-title button{padding:calc(2px * var(--studio-ui-scale)) calc(8px * var(--studio-ui-scale))}nav{display:grid;gap:calc(5px * var(--studio-ui-scale))}.nav-item{display:flex;align-items:center;gap:calc(5px * var(--studio-ui-scale));border-radius:calc(8px * var(--studio-ui-scale))}.nav-item.active{background:var(--selected-bg)}.nav-item.dragover{outline:calc(2px * var(--studio-ui-scale)) dashed var(--selected-border)}.nav-item>button:first-child{background:transparent;border:0;text-align:left;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.nav-item>button.small{padding:calc(4px * var(--studio-ui-scale));border:0;background:transparent;font-size:calc(12px * var(--studio-ui-scale))}.aside-bottom{margin-top:calc(30px * var(--studio-ui-scale));display:grid;gap:calc(8px * var(--studio-ui-scale))}main{padding:calc(28px * var(--studio-ui-scale)) calc(32px * var(--studio-ui-scale));min-width:0}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:calc(12px * var(--studio-ui-scale));margin-bottom:calc(22px * var(--studio-ui-scale))}.toolbar>div:last-child{display:flex;gap:calc(8px * var(--studio-ui-scale));flex-wrap:wrap}h1{font-size:calc(24px * var(--studio-ui-scale));margin:0 0 calc(6px * var(--studio-ui-scale))}h2{font-size:calc(20px * var(--studio-ui-scale));margin:0}p{margin:calc(8px * var(--studio-ui-scale)) 0}.searchline{display:flex;gap:calc(18px * var(--studio-ui-scale));align-items:center;margin-bottom:calc(18px * var(--studio-ui-scale))}.searchline input{max-width:calc(450px * var(--studio-ui-scale))}.channel{background:var(--surface);border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(12px * var(--studio-ui-scale));margin:calc(9px * var(--studio-ui-scale)) 0;padding:calc(13px * var(--studio-ui-scale));display:grid;grid-template-columns:calc(24px * var(--studio-ui-scale)) calc(82px * var(--studio-ui-scale)) minmax(0,1fr) auto;gap:calc(15px * var(--studio-ui-scale));align-items:center}.channel.dragover{border:calc(2px * var(--studio-ui-scale)) dashed var(--accent-text)}.handle{cursor:grab;font-size:calc(24px * var(--studio-ui-scale));color:var(--handle)}.logo{height:calc(48px * var(--studio-ui-scale));display:flex;align-items:center;justify-content:center;background:var(--soft);border:0;padding:calc(2px * var(--studio-ui-scale))}.logo img{max-width:calc(78px * var(--studio-ui-scale));max-height:calc(46px * var(--studio-ui-scale));object-fit:contain}.channel-title{font-size:calc(16px * var(--studio-ui-scale));font-weight:650}.pill{display:inline-block;font-size:calc(11px * var(--studio-ui-scale));background:var(--pill-bg);color:var(--pill-text);padding:calc(3px * var(--studio-ui-scale)) calc(6px * var(--studio-ui-scale));border-radius:calc(4px * var(--studio-ui-scale));margin-left:calc(8px * var(--studio-ui-scale))}.stream{font-size:calc(12px * var(--studio-ui-scale));color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:calc(7px * var(--studio-ui-scale))}.actions{display:flex;gap:calc(4px * var(--studio-ui-scale))}.actions button{padding:calc(6px * var(--studio-ui-scale)) calc(8px * var(--studio-ui-scale))}.empty{text-align:center;color:var(--muted);padding:calc(70px * var(--studio-ui-scale)) calc(15px * var(--studio-ui-scale));border:calc(1px * var(--studio-ui-scale)) dashed var(--empty-border);border-radius:calc(16px * var(--studio-ui-scale))}dialog{border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(16px * var(--studio-ui-scale));padding:calc(25px * var(--studio-ui-scale));width:min(calc(700px * var(--studio-ui-scale)),94vw);max-height:90vh;overflow:auto;box-shadow:0 calc(20px * var(--studio-ui-scale)) calc(70px * var(--studio-ui-scale)) var(--shadow)}dialog::backdrop{background:var(--backdrop)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:calc(22px * var(--studio-ui-scale))}.dialog-head .close{border:0;padding:calc(2px * var(--studio-ui-scale)) calc(8px * var(--studio-ui-scale));font-size:calc(26px * var(--studio-ui-scale))}label{display:grid;gap:calc(7px * var(--studio-ui-scale));margin:calc(12px * var(--studio-ui-scale)) 0;color:var(--label);font-size:calc(13px * var(--studio-ui-scale))}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 calc(16px * var(--studio-ui-scale))}.wide{grid-column:1 / -1}.inputrow{display:flex;gap:calc(8px * var(--studio-ui-scale))}.check{display:flex;align-items:center}.check input{width:auto}footer{display:flex;justify-content:flex-end;gap:calc(8px * var(--studio-ui-scale));margin-top:calc(22px * var(--studio-ui-scale))}textarea{margin-top:calc(15px * var(--studio-ui-scale));resize:vertical}#toast{position:fixed;bottom:calc(25px * var(--studio-ui-scale));left:50%;transform:translateX(-50%);background:var(--toast);color:var(--toast-text);padding:calc(12px * var(--studio-ui-scale)) calc(22px * var(--studio-ui-scale));border-radius:calc(10px * var(--studio-ui-scale));display:none;z-index:10;max-width:90vw}#links a{display:block;color:var(--accent-text);overflow-wrap:anywhere;padding:calc(8px * var(--studio-ui-scale));background:var(--soft);border-radius:calc(6px * var(--studio-ui-scale));margin:calc(4px * var(--studio-ui-scale)) 0}#links strong{display:block;margin-top:calc(16px * var(--studio-ui-scale))}#logoGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:calc(10px * var(--studio-ui-scale))}#logoGrid button img{max-width:100%;height:calc(45px * var(--studio-ui-scale));object-fit:contain}#logoGrid button small{display:block;overflow:hidden;text-overflow:ellipsis}
@media(max-width:880px){header{padding:calc(12px * var(--studio-ui-scale)) calc(15px * var(--studio-ui-scale));height:auto}.brand{font-size:calc(21px * var(--studio-ui-scale))}header .muted{display:none}header>div{gap:calc(8px * var(--studio-ui-scale))}#status{font-size:calc(11px * var(--studio-ui-scale))}.layout{grid-template-columns:1fr}aside{padding:calc(12px * var(--studio-ui-scale)) calc(15px * var(--studio-ui-scale));border-right:0;border-bottom:calc(1px * var(--studio-ui-scale)) solid var(--border)}nav{display:flex;flex-wrap:wrap}.nav-item{max-width:100%}.section-title:nth-of-type(2){margin-top:calc(12px * var(--studio-ui-scale))}.aside-bottom{display:flex;flex-wrap:wrap;margin-top:calc(12px * var(--studio-ui-scale))}.hint{font-size:calc(11px * var(--studio-ui-scale))}aside>.hint{display:none}main{padding:calc(20px * var(--studio-ui-scale)) calc(14px * var(--studio-ui-scale))}.toolbar{align-items:flex-start;flex-direction:column}.searchline{flex-direction:column;align-items:stretch;gap:calc(4px * var(--studio-ui-scale))}.searchline input{max-width:none}.channel{grid-template-columns:calc(16px * var(--studio-ui-scale)) calc(52px * var(--studio-ui-scale)) minmax(0,1fr);gap:calc(9px * var(--studio-ui-scale))}.logo img{max-width:calc(48px * var(--studio-ui-scale))}.actions{grid-column:2 / -1;justify-content:flex-end}.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.inputrow{flex-wrap:wrap}.inputrow input{flex-basis:100%}#logoGrid{grid-template-columns:repeat(3,1fr)}}

/* v0.2：页面外壳不滚动，仅频道内容滚动。 */
[hidden]{display:none!important}
html,body{height:100%;overflow:hidden}
.app-shell{height:100vh;height:100dvh;display:flex;flex-direction:column}
.app-shell>header{flex:0 0 calc(76px * var(--studio-ui-scale))}
.layout{flex:1;min-height:0;overflow:hidden}
aside{min-height:0;overflow:hidden;display:flex;flex-direction:column}
#lists,#groups{display:block;min-height:0;overflow-y:auto;flex-shrink:1;overscroll-behavior:contain}
#lists{max-height:26vh}#groups{flex:1}
.section-title,aside>.hint,.aside-bottom{flex-shrink:0}
.aside-bottom{margin-top:calc(16px * var(--studio-ui-scale))}
main{min-height:0;overflow:hidden;display:flex;flex-direction:column;padding-bottom:0}
.toolbar,.searchline{flex-shrink:0}
.channel-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-bottom:calc(24px * var(--studio-ui-scale))}
.pill.replay{background:var(--replay-bg);color:var(--replay-text)}.pill.fcc{background:var(--fcc-bg);color:var(--fcc-text)}
.channel-title{display:flex;gap:calc(5px * var(--studio-ui-scale));align-items:center;flex-wrap:wrap}.channel-title .pill{margin-left:0}
.handle{touch-action:none;user-select:none;-webkit-user-select:none}
.touch-dragging{opacity:.65;border-color:var(--accent-text)}
.auth-screen{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:calc(24px * var(--studio-ui-scale));overflow-y:auto;background:radial-gradient(ellipse at top,var(--auth-glow),transparent 70%),var(--page)}
.auth-card{width:min(calc(400px * var(--studio-ui-scale)),100%);padding:calc(32px * var(--studio-ui-scale));background:var(--surface);border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(18px * var(--studio-ui-scale));box-shadow:0 calc(14px * var(--studio-ui-scale)) calc(60px * var(--studio-ui-scale)) #173e3910}
.auth-card h1{margin:calc(26px * var(--studio-ui-scale)) 0 calc(6px * var(--studio-ui-scale));font-size:calc(20px * var(--studio-ui-scale));line-height:1.4}.auth-card>.primary{width:100%;margin-top:calc(8px * var(--studio-ui-scale))}.error{color:var(--danger-text);min-height:calc(20px * var(--studio-ui-scale));font-size:calc(13px * var(--studio-ui-scale))}
@media(max-width:880px){
.app-shell>header{flex:0 0 auto}.layout{display:flex;flex-direction:column}
aside{flex:0 0 auto;max-height:30dvh;padding:calc(8px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale));display:block;overflow:hidden}
#lists,#groups{display:flex;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;max-height:none;gap:calc(4px * var(--studio-ui-scale))}#groups{max-height:calc(40px * var(--studio-ui-scale))}
.nav-item{flex:0 0 auto}.section-title{margin-bottom:calc(4px * var(--studio-ui-scale))!important}.section-title:nth-of-type(2){margin-top:calc(6px * var(--studio-ui-scale))}
.aside-bottom{margin-top:calc(8px * var(--studio-ui-scale));flex-wrap:nowrap;overflow-x:auto}.aside-bottom button{white-space:nowrap;padding:calc(5px * var(--studio-ui-scale)) calc(8px * var(--studio-ui-scale));font-size:calc(11px * var(--studio-ui-scale))}
main{flex:1;padding:calc(12px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale)) 0}.toolbar{flex-direction:row;gap:calc(7px * var(--studio-ui-scale));margin-bottom:calc(10px * var(--studio-ui-scale))}.toolbar h1{font-size:calc(18px * var(--studio-ui-scale))}.toolbar>div:last-child{gap:calc(4px * var(--studio-ui-scale));justify-content:flex-end}.toolbar button{font-size:calc(11px * var(--studio-ui-scale));padding:calc(6px * var(--studio-ui-scale)) calc(8px * var(--studio-ui-scale))}
.searchline{margin-bottom:calc(8px * var(--studio-ui-scale))}.searchline>.hint{display:none}.channel-scroll{padding-bottom:calc(14px * var(--studio-ui-scale))}header button{padding:calc(7px * var(--studio-ui-scale)) calc(9px * var(--studio-ui-scale));font-size:calc(12px * var(--studio-ui-scale))}
}

/* v0.2.2：统一设置入口与紧凑工具栏。 */
.toolbar{align-items:center;gap:calc(20px * var(--studio-ui-scale));margin-bottom:calc(16px * var(--studio-ui-scale))}
.toolbar-title{flex:0 1 auto;min-width:calc(130px * var(--studio-ui-scale));max-width:28%}.toolbar-title h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.toolbar-controls{flex:1;display:flex;align-items:center;justify-content:flex-end;gap:calc(8px * var(--studio-ui-scale));min-width:0}
.toolbar-controls #search{flex:1;max-width:calc(430px * var(--studio-ui-scale));min-width:calc(150px * var(--studio-ui-scale));width:auto}
.toolbar-controls button{flex:0 0 auto;white-space:nowrap}
.nav-handle{cursor:grab;font-size:calc(18px * var(--studio-ui-scale));color:var(--handle);padding-left:calc(8px * var(--studio-ui-scale));touch-action:none;user-select:none;-webkit-user-select:none;flex-shrink:0}
.nav-item>button:not(.small){background:transparent;border:0;text-align:left;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.setting-row{display:flex;align-items:center;justify-content:space-between;gap:calc(20px * var(--studio-ui-scale));padding:calc(18px * var(--studio-ui-scale)) 0;border-bottom:calc(1px * var(--studio-ui-scale)) solid var(--border)}
.setting-row:last-child{border-bottom:0}.setting-row h3{margin:0 0 calc(6px * var(--studio-ui-scale));font-size:calc(16px * var(--studio-ui-scale))}.setting-row p{font-size:calc(13px * var(--studio-ui-scale));margin:0;line-height:1.7}.setting-row>button{flex-shrink:0}
@media(min-width:881.1px) and (max-width:1210px){.toolbar{flex-wrap:wrap;gap:calc(10px * var(--studio-ui-scale))}.toolbar-title{max-width:none}.toolbar-controls{flex-basis:100%;justify-content:flex-start}.toolbar-controls #search{max-width:none}}
@media(max-width:880px){
.toolbar{display:grid;grid-template-columns:1fr;gap:calc(8px * var(--studio-ui-scale));align-items:center;margin-bottom:calc(10px * var(--studio-ui-scale))}
.toolbar-title{max-width:none;min-width:0;display:flex;align-items:baseline;justify-content:space-between;gap:calc(8px * var(--studio-ui-scale))}.toolbar-title h1{margin:0}.toolbar-title p{margin:0;white-space:nowrap;font-size:calc(11px * var(--studio-ui-scale))}
.toolbar>div.toolbar-controls{display:grid;grid-template-columns:minmax(calc(90px * var(--studio-ui-scale)),1fr) auto auto auto;gap:calc(4px * var(--studio-ui-scale));min-width:0}
.toolbar-controls #search{min-width:0;max-width:none;width:100%;padding:calc(8px * var(--studio-ui-scale));font-size:calc(12px * var(--studio-ui-scale))}.toolbar-controls button{padding:calc(7px * var(--studio-ui-scale)) calc(6px * var(--studio-ui-scale));font-size:calc(11px * var(--studio-ui-scale))}
.nav-handle{font-size:calc(16px * var(--studio-ui-scale));padding-left:calc(5px * var(--studio-ui-scale))}.setting-row{gap:calc(10px * var(--studio-ui-scale))}.setting-row p{font-size:calc(12px * var(--studio-ui-scale))}
}

/* v0.3: batch editing, logo matching, draft undo and publish history. */
header>div{gap:calc(10px * var(--studio-ui-scale))}header button{white-space:nowrap}
.bulk-toolbar{display:flex;align-items:center;gap:calc(10px * var(--studio-ui-scale));flex-wrap:wrap;flex-shrink:0;padding:0 0 calc(10px * var(--studio-ui-scale))}
.bulk-toolbar label{margin:0}.bulk-toolbar button{padding:calc(6px * var(--studio-ui-scale)) calc(10px * var(--studio-ui-scale))}.bulk-toolbar #selectionCount{margin-right:auto}
.channel{grid-template-columns:calc(18px * var(--studio-ui-scale)) calc(24px * var(--studio-ui-scale)) calc(82px * var(--studio-ui-scale)) minmax(0,1fr) auto;gap:calc(12px * var(--studio-ui-scale))}
.channel-select{width:calc(17px * var(--studio-ui-scale));height:calc(17px * var(--studio-ui-scale));padding:0;accent-color:var(--accent-text)}
.inputrow>button{flex-shrink:0;white-space:nowrap}.inputrow>input{flex:1;width:auto;min-width:0}
.preview-list{max-height:32vh;overflow:auto;overscroll-behavior:contain}.preview-row{padding:calc(12px * var(--studio-ui-scale)) calc(4px * var(--studio-ui-scale));border-bottom:calc(1px * var(--studio-ui-scale)) solid var(--border);overflow-wrap:anywhere}.preview-row p{white-space:pre-wrap}.preview-row:last-child{border-bottom:0}
#autoLogoPreview .preview-row{display:grid;grid-template-columns:calc(88px * var(--studio-ui-scale)) 1fr;gap:0 calc(12px * var(--studio-ui-scale));align-items:center}#autoLogoPreview img{grid-row:1 / 3;width:calc(88px * var(--studio-ui-scale));height:calc(53px * var(--studio-ui-scale));object-fit:contain;background:var(--logo-bg);border-radius:calc(6px * var(--studio-ui-scale))}#autoLogoPreview p{grid-column:2}
#logoGrid button img{background:var(--logo-bg);border-radius:calc(4px * var(--studio-ui-scale));width:100%;height:calc(64px * var(--studio-ui-scale))}.logo-recommend{color:var(--accent-text);font-weight:700}
.subscription-row{display:flex;align-items:center;gap:calc(8px * var(--studio-ui-scale))}.subscription-row a{flex:1;min-width:0}.subscription-row button{flex-shrink:0;white-space:nowrap}
.clipboard-helper{position:fixed;left:0;top:0;width:calc(1px * var(--studio-ui-scale));height:calc(1px * var(--studio-ui-scale));opacity:0}
#historyEntries .preview-row>button{margin-top:calc(6px * var(--studio-ui-scale))}button:disabled{cursor:default;opacity:.45}
#batchForm footer{position:sticky;bottom:calc(-25px * var(--studio-ui-scale));background:var(--surface);padding:calc(12px * var(--studio-ui-scale)) 0}
@media(max-width:880px){
header{flex-wrap:wrap;padding:calc(8px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale))}header>div:last-child{width:100%;justify-content:flex-end;gap:calc(6px * var(--studio-ui-scale))}header #status{margin-right:auto}
.bulk-toolbar{gap:calc(6px * var(--studio-ui-scale))}.bulk-toolbar button{font-size:calc(11px * var(--studio-ui-scale));padding:calc(5px * var(--studio-ui-scale)) calc(7px * var(--studio-ui-scale))}.bulk-toolbar label,.bulk-toolbar span{font-size:calc(11px * var(--studio-ui-scale))}
.channel{grid-template-columns:calc(17px * var(--studio-ui-scale)) calc(16px * var(--studio-ui-scale)) calc(52px * var(--studio-ui-scale)) minmax(0,1fr);gap:calc(7px * var(--studio-ui-scale))}.actions{grid-column:3 / -1}
.inputrow>input{flex-basis:100%;width:100%}dialog{padding:calc(18px * var(--studio-ui-scale))}#batchForm footer{bottom:calc(-18px * var(--studio-ui-scale));gap:calc(5px * var(--studio-ui-scale))}#batchForm footer button{padding:calc(8px * var(--studio-ui-scale));font-size:calc(12px * var(--studio-ui-scale))}
#logoGrid button{padding:calc(6px * var(--studio-ui-scale))}#logoGrid button img{height:calc(48px * var(--studio-ui-scale))}.preview-list{max-height:30dvh}
}
.inputrow .check{white-space:nowrap}.inputrow .check input{flex:0 0 auto;width:calc(13px * var(--studio-ui-scale))}

.logo-tabs{display:flex;gap:calc(8px * var(--studio-ui-scale));margin:calc(14px * var(--studio-ui-scale)) 0}.logo-tabs button{flex:1}.logo-tabs [aria-selected="true"]{background:var(--selected-bg);color:var(--accent-text)}.logo-source-row{border-top:calc(1px * var(--studio-ui-scale)) solid var(--border);padding:calc(14px * var(--studio-ui-scale)) 0}.logo-source-row p{overflow-wrap:anywhere}.logo-source-actions{display:flex;gap:calc(8px * var(--studio-ui-scale));flex-wrap:wrap}#logosDialog [hidden]{display:none}#logoGrid img{object-fit:contain}#logoGrid small{overflow-wrap:anywhere}#logoGrid{max-height:42dvh;overflow-y:auto}#sourceEntries{max-height:38dvh;overflow-y:auto}

#logoManagerDialog{width:min(calc(880px * var(--studio-ui-scale)),94vw)}#managerLogoGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(150px * var(--studio-ui-scale)),1fr));gap:calc(12px * var(--studio-ui-scale));max-height:52dvh;overflow-y:auto;margin-top:calc(12px * var(--studio-ui-scale))}.library-logo-card{display:flex;flex-direction:column;gap:calc(8px * var(--studio-ui-scale));padding:calc(12px * var(--studio-ui-scale));border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(10px * var(--studio-ui-scale));min-width:0}.library-logo-card img{width:100%;height:calc(80px * var(--studio-ui-scale));object-fit:contain;background:var(--logo-bg);border-radius:calc(6px * var(--studio-ui-scale))}.library-logo-card strong,.library-logo-card small{overflow-wrap:anywhere}.library-logo-card small{color:var(--muted)}.library-logo-actions{display:flex;gap:calc(6px * var(--studio-ui-scale));margin-top:auto}.library-logo-actions button{flex:1}.logo-tabs button{white-space:nowrap}#logoConflictDialog{max-width:calc(440px * var(--studio-ui-scale))}

/* Shared colors keep every dialog and native control consistent with the theme. */
:root[data-theme="dark"]{color-scheme:dark;--accent:var(--accent-text);--accent-solid:var(--primary);--on-accent:var(--on-primary);--border:#343434;--text:#e7e7e7;--page:#101010;--surface:#1c1c1c;--soft:#252525;--muted:#ababab;--label:#cccccc;--active:var(--selected-bg);--danger:var(--danger-text);--focus:var(--selected-border);--handle:#929292;--pill-bg:#303735;--pill-text:#b2cdc4;--replay-bg:#2c3245;--replay-text:#bacbff;--fcc-bg:#403521;--fcc-text:#f3cf92;--empty-border:#484848;--logo-bg:#242424;--backdrop:#000000b3;--shadow:#00000070;--auth-glow:var(--selected-bg);--toast:#333333}
dialog{background:var(--surface);color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}input[type="checkbox"]{accent-color:var(--primary)}button:focus-visible,a:focus-visible,select:focus-visible{outline:calc(2px * var(--studio-ui-scale)) solid var(--focus);outline-offset:calc(3px * var(--studio-ui-scale))}::selection{background:var(--selected-bg);color:var(--text)}:root{scrollbar-color:var(--handle) var(--surface)}#toast{color:#fff}

/* Project identity: the same mark appears in the browser tab and app header. */
.brand{display:inline-flex;align-items:center;gap:calc(9px * var(--studio-ui-scale));letter-spacing:calc(-.5px * var(--studio-ui-scale));white-space:nowrap}.brand-icon{display:block;width:calc(32px * var(--studio-ui-scale));height:calc(32px * var(--studio-ui-scale));flex-shrink:0}@media(max-width:880px){header .brand{font-size:calc(17px * var(--studio-ui-scale));gap:calc(6px * var(--studio-ui-scale))}header .brand-icon{width:calc(26px * var(--studio-ui-scale));height:calc(26px * var(--studio-ui-scale))}}

.brand-play{fill:var(--text)}

/* English labels need room without pushing controls off a narrow screen. */
header>div:last-child{flex-wrap:wrap;justify-content:flex-end;gap:calc(8px * var(--studio-ui-scale))}
@media(min-width:881.1px) and (max-width:1320px){header{height:auto;min-height:calc(76px * var(--studio-ui-scale));padding-top:calc(10px * var(--studio-ui-scale));padding-bottom:calc(10px * var(--studio-ui-scale))}.app-shell>header{flex-basis:auto}.toolbar-controls{flex-wrap:wrap}.toolbar-controls input{min-width:calc(160px * var(--studio-ui-scale))}}
:root[lang="en"] .nav-item button{overflow-wrap:anywhere}
@media(max-width:880px){
 :root[lang="en"] .toolbar-controls{display:flex;flex-wrap:wrap;justify-content:flex-start}
 :root[lang="en"] .toolbar-controls #search{flex:1 0 100%;width:100%;margin:0}
 :root[lang="en"] .setting-row{flex-wrap:wrap}
 :root[lang="en"] .setting-row>div{min-width:0}
}
/* Compact language and theme menus share the same header position. */
.appearance-controls{display:flex;gap:calc(8px * var(--studio-ui-scale));align-items:center;flex-shrink:0}
.icon-menu{display:inline-flex}.icon-button,#themeToggle{width:calc(38px * var(--studio-ui-scale));height:calc(38px * var(--studio-ui-scale));min-width:calc(38px * var(--studio-ui-scale));padding:calc(8px * var(--studio-ui-scale));display:inline-flex;align-items:center;justify-content:center}
.icon-button svg{width:calc(22px * var(--studio-ui-scale));height:calc(22px * var(--studio-ui-scale));fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.icon-button svg[hidden]{display:none}
.preference-menu{position:fixed;inset:auto;margin:0;width:calc(168px * var(--studio-ui-scale));padding:calc(5px * var(--studio-ui-scale));border:calc(1px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(10px * var(--studio-ui-scale));background:var(--surface);color:var(--text);box-shadow:0 calc(8px * var(--studio-ui-scale)) calc(28px * var(--studio-ui-scale)) var(--shadow)}
.preference-menu:popover-open{display:grid;gap:calc(2px * var(--studio-ui-scale))}
.preference-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;padding:calc(9px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale));border:0;border-radius:calc(6px * var(--studio-ui-scale));text-align:left;background:transparent}
.preference-menu button:hover,.preference-menu button:focus-visible{background:var(--soft)}
.preference-menu button[aria-checked="true"]{color:var(--accent-text);background:var(--selected-bg)}
.preference-menu button[aria-checked="true"]::after{content:'✓';margin-left:calc(12px * var(--studio-ui-scale))}
.auth-brand-row{display:flex;align-items:center;justify-content:space-between;gap:calc(16px * var(--studio-ui-scale))}
.auth-brand-row .brand{font-size:calc(22px * var(--studio-ui-scale));gap:calc(9px * var(--studio-ui-scale))}
.auth-brand-row .brand-icon{width:calc(30px * var(--studio-ui-scale));height:calc(30px * var(--studio-ui-scale))}
.auth-brand-row .icon-menu{flex-shrink:0}
.auth-brand-row .icon-button{width:calc(34px * var(--studio-ui-scale));height:calc(34px * var(--studio-ui-scale));min-width:calc(34px * var(--studio-ui-scale));padding:calc(7px * var(--studio-ui-scale))}
.auth-card #authHint{margin:0 0 calc(20px * var(--studio-ui-scale));line-height:1.6}
.auth-card label{margin:calc(16px * var(--studio-ui-scale)) 0}
.auth-card #authError:empty{display:none}
.auth-card>.primary{margin-top:calc(8px * var(--studio-ui-scale))}
@media(max-width:440px){.auth-card{padding:calc(24px * var(--studio-ui-scale))}.auth-brand-row{gap:calc(10px * var(--studio-ui-scale))}.auth-brand-row .brand{font-size:calc(20px * var(--studio-ui-scale));gap:calc(7px * var(--studio-ui-scale))}.auth-brand-row .brand-icon{width:calc(28px * var(--studio-ui-scale));height:calc(28px * var(--studio-ui-scale))}}

@media(max-width:396px){.auth-brand-row{gap:calc(6px * var(--studio-ui-scale))}.auth-brand-row .brand{font-size:calc(16px * var(--studio-ui-scale));gap:calc(6px * var(--studio-ui-scale))}.auth-brand-row .brand-icon{width:calc(24px * var(--studio-ui-scale));height:calc(24px * var(--studio-ui-scale))}.auth-brand-row .appearance-controls{gap:calc(6px * var(--studio-ui-scale))}.auth-brand-row .icon-button{width:calc(32px * var(--studio-ui-scale));height:calc(32px * var(--studio-ui-scale));min-width:calc(32px * var(--studio-ui-scale))}}

.source-latency{display:inline-block;font-size:calc(12px * var(--studio-ui-scale));font-weight:600;padding:calc(3px * var(--studio-ui-scale)) calc(7px * var(--studio-ui-scale));border-radius:calc(5px * var(--studio-ui-scale));white-space:nowrap}
.source-latency.green{color:#13743a;background:#dff6e7}.source-latency.yellow{color:#815000;background:#fff0ba}.source-latency.red{color:#a32828;background:#ffe1e1}.source-latency.muted{color:var(--muted);background:var(--soft)}
[data-theme="dark"] .source-latency.green{color:#8ee3ac;background:#163925}[data-theme="dark"] .source-latency.yellow{color:#f4d779;background:#423719}[data-theme="dark"] .source-latency.red{color:#ffaaaa;background:#482525}
#sourceCheckProgress{width:100%;accent-color:var(--accent-text)}.source-check-controls{display:flex;align-items:center;gap:calc(10px * var(--studio-ui-scale));flex-wrap:wrap}.source-check-controls label{margin:0;margin-right:auto}.source-check-results{max-height:45vh;overflow:auto;margin-top:calc(16px * var(--studio-ui-scale))}.source-check-row{display:flex;justify-content:space-between;align-items:center;gap:calc(12px * var(--studio-ui-scale));padding:calc(10px * var(--studio-ui-scale));border-bottom:calc(1px * var(--studio-ui-scale)) solid var(--border)}.source-check-row>span:first-child{overflow-wrap:anywhere;min-width:0}

button.source-latency{border:calc(1px * var(--studio-ui-scale)) solid transparent;cursor:pointer;line-height:1.3}button.source-latency:hover:not(:disabled){border-color:currentColor}button.source-latency:focus-visible{outline:calc(2px * var(--studio-ui-scale)) solid var(--focus);outline-offset:calc(2px * var(--studio-ui-scale))}button.source-latency:disabled{cursor:wait;opacity:.7}

.channel-title .source-latency{font-size:calc(11px * var(--studio-ui-scale));font-weight:inherit;line-height:calc(15px * var(--studio-ui-scale));padding:calc(3px * var(--studio-ui-scale)) calc(6px * var(--studio-ui-scale));border:0;border-radius:calc(4px * var(--studio-ui-scale))}
.channel-title button.source-latency:hover:not(:disabled){box-shadow:inset 0 0 0 calc(1px * var(--studio-ui-scale)) currentColor}

/* Keep each bulk action title visually attached to its own controls. */
#batchDialog .batch-section{border:calc(2px * var(--studio-ui-scale)) solid var(--border);border-radius:calc(12px * var(--studio-ui-scale));padding:calc(16px * var(--studio-ui-scale));margin:calc(16px * var(--studio-ui-scale)) 0;background:var(--surface)}
#batchDialog .batch-section-title{font-size:calc(16px * var(--studio-ui-scale));font-weight:700;color:var(--text);margin:0 0 calc(12px * var(--studio-ui-scale));gap:calc(10px * var(--studio-ui-scale));line-height:1.5}
#batchDialog .batch-section-title input{width:calc(18px * var(--studio-ui-scale));height:calc(18px * var(--studio-ui-scale));flex:0 0 calc(18px * var(--studio-ui-scale))}
.batch-step{display:inline-grid;place-items:center;width:calc(24px * var(--studio-ui-scale));height:calc(24px * var(--studio-ui-scale));flex:0 0 calc(24px * var(--studio-ui-scale));border-radius:50%;background:var(--selected-bg);color:var(--accent-text);font-size:calc(13px * var(--studio-ui-scale))}
#batchDialog .batch-section>label:not(.batch-section-title){margin:calc(12px * var(--studio-ui-scale)) 0 0}
#batchDialog .batch-section .form-grid{margin:0;gap:calc(12px * var(--studio-ui-scale))}
#batchDialog .batch-section .form-grid label{margin:0}
#batchDialog .batch-section .inputrow{margin-top:calc(10px * var(--studio-ui-scale))}
#batchDialog .batch-section .hint{margin:calc(10px * var(--studio-ui-scale)) 0 0}
#batchDialog .batch-transfer-section{margin-top:calc(24px * var(--studio-ui-scale))}
#batchDialog .batch-section.is-selected{border-color:var(--selected-border)}
#batchDialog .batch-transfer-section.is-move{border-color:var(--danger-text)}
.transfer-notice{padding:calc(10px * var(--studio-ui-scale)) calc(12px * var(--studio-ui-scale));border-radius:calc(8px * var(--studio-ui-scale));background:var(--selected-bg);color:var(--text);font-size:calc(14px * var(--studio-ui-scale));line-height:1.6;margin:0 0 calc(12px * var(--studio-ui-scale))}
.is-move .transfer-notice{color:var(--danger-text);border:calc(1px * var(--studio-ui-scale)) solid var(--danger-text);background:var(--soft);font-weight:700}
@media(max-width:660px){#batchDialog .batch-section{padding:calc(12px * var(--studio-ui-scale))}#batchDialog .batch-section-title{font-size:calc(15px * var(--studio-ui-scale))}}
