.ms-scope-toolbar{flex-shrink:0;position:sticky;top:0;z-index:24;padding:8px 10px;background:var(--s1,#15171d);border-bottom:1px solid var(--border,#333);display:grid;gap:6px}
.ms-scope-toolbar strong{font-size:12px;color:var(--a,#00e5a0)}
.ms-scope-toolbar>div,.ms-selection-tools,.ms-save-actions{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.ms-scope-toolbar button,.ms-selection-tools button,.ms-save-actions button,.ms-project-row button,.ms-time-error button{min-height:30px;border:1px solid var(--border,#444);border-radius:6px;background:var(--s2,#222);color:var(--txt,#eee);padding:4px 8px;font:inherit;font-size:11px;cursor:pointer}
.ms-scope-toolbar button:disabled{opacity:.4;cursor:default}
.ms-selection-tools{padding:5px 0;font-size:11px}.ms-selection-tools span{color:var(--a,#00e5a0)}
.ms-size-exact{width:64px;min-width:55px;background:var(--s1,#191919);color:var(--txt,#eee);border:1px solid var(--border,#444);border-radius:6px;padding:4px;font-size:12px}
.ms-reset-field{border:0;border-radius:4px;background:transparent;color:var(--txt2,#bbb);cursor:pointer;min-width:26px;min-height:26px;margin-left:4px;font-size:15px}
.ms-mixed-badge{font-size:9px;background:#fbbf2422;color:#fbbf24;padding:2px 4px;border-radius:4px;margin-left:4px}
input[data-ms-mixed="true"]{outline:1px dashed #fbbf24;outline-offset:2px}
input[type=color][data-ms-mixed="true"]{opacity:.55}
[aria-invalid="true"]{border-color:#fb7185!important;outline:1px solid #fb7185!important}
.ms-time-error{padding:8px;border-radius:6px;font-size:12px;background:#fb718518;color:#fda4af;line-height:1.5}
.ms-replace-preview{max-height:180px;overflow:auto;overflow-wrap:anywhere;font-size:12px;white-space:pre-wrap}.ms-replace-preview p{margin:5px 0}
.ms-inline-scope{font-size:11px;display:flex;gap:5px;align-items:center;margin:5px 0}
.ms-project-search input,.ms-project-rename input{width:100%;box-sizing:border-box;padding:8px;border:1px solid var(--border,#444);border-radius:6px;background:var(--s1,#151515);color:var(--txt,#eee)}
.ms-project-list{display:grid!important;gap:6px!important;min-width:0}.ms-project-row{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.ms-project-open{flex:1;min-width:130px!important;white-space:normal!important;overflow-wrap:anywhere}
.ms-project-rename{flex-basis:100%;display:flex;gap:4px}.ms-project-rename input{min-width:0;flex:1}
@media(max-width:1023px){.ms-scope-toolbar button,.ms-selection-tools button,.ms-project-row button,.ms-save-actions button,.ms-reset-field{min-height:40px}.ms-scope-toolbar{padding:7px 8px}.ms-scope-toolbar>div{gap:4px}.ms-scope-toolbar button{font-size:10px}.ms-size-exact{min-height:36px}}

.ms-selection-tools[hidden]{display:none!important}

/* Typography is one group. Explicit grid tracks reserve space for the slider;
   generic .setting number-input width rules cannot squeeze its track to zero. */
#secText #secFont{margin:0!important;padding:12px!important;border:0!important;display:flex;flex-direction:column;gap:10px}
#secText #secFont>.sec-title{padding:0!important;margin:0!important}
#secText #secFont>.setting{padding:0;border:0;display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:stretch!important}
#secText #secFont .font-row{display:flex;gap:6px;width:100%;min-width:0}
#secText #secFont .font-row select{flex:1 1 0;min-width:0;width:0}
#secText #secFont .font-row button{flex:0 0 auto}
#secText #secFont .ms-size-control{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;width:100%;min-width:0}
#secText #secFont .ms-size-range,#secText #secFont .fe-range-row{display:grid;grid-template-columns:minmax(0,1fr) 76px;align-items:center;gap:12px;width:100%;min-width:0;min-height:36px}
#secText #secFont input[type=range]{display:block;width:100%;min-width:0;max-width:100%;height:32px!important;margin:0;padding:0;cursor:ew-resize;touch-action:pan-y}
#secText #secFont input[type=number]{box-sizing:border-box;width:76px!important;min-width:0;max-width:76px;min-height:36px;padding:6px;background:var(--s1,#15171d);border:1px solid var(--border2,#444);border-radius:6px;color:var(--txt,#eee);font:inherit;font-size:13px;text-align:center}
#secText #cSizeV,#secText #secFont .fe-val{display:none}
#secText #secFont .ms-size-presets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
#secText #secFont .ms-size-presets button{width:auto;min-width:0;min-height:32px;padding:4px;font-size:12px}
#secText #secFont .font-style-row{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}
#secText #secFont .fe-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:0;border:0}
#secText #secFont .fe-field{padding:0;border:0;display:grid;gap:4px;min-width:0}
#secText #secFont label{font-family:var(--font);font-size:12px!important;letter-spacing:0;text-transform:none;white-space:normal}
#secText #secFont input[type=range]:focus-visible{outline:2px solid var(--a,#3ca0ff);outline-offset:3px;border-radius:4px}
/* Place type controls before the color/outline block without splitting the group. */
#secText{display:flex;flex-direction:column}
#secText>.sec-title{order:0}
#secText>#secFont{order:1}
#secText>.settings-grid{order:2}
#secText>#secPos{order:3}
#secText.collapsed>:not(.sec-title){display:none!important}

/* A single, persistent scope + preset surface replaces three repeated banners. */
#editorSettings #styleSelectBanner,#editorSettings #msPresetScopeLabel{display:none!important}
#editorSettings #stylePanel>div:has(>#msPresetScopeLabel){display:none!important}
.ms-scope-toolbar{gap:8px;box-shadow:0 4px 10px #0003}
.ms-scope-toolbar .ms-scope-options{display:flex;flex-wrap:wrap;gap:5px}
.ms-scope-options strong{flex:1 0 100%;font-size:12px}
.ms-scope-toolbar button[aria-pressed=true]:not(#msPreviewSfx){background:#3ca0ff25;border-color:var(--a,#3ca0ff);color:var(--txt,#eee)}
.ms-scope-toolbar .ms-subtitle-nav{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;gap:6px;align-items:center}
#msSelectedRows{font-size:11px;color:var(--txt2,#bbb);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
.ms-preset-picker-label{display:grid;grid-template-columns:46px minmax(0,1fr);align-items:center;gap:6px;font-size:12px}
#editorSettings #msPresetPicker{box-sizing:border-box;width:100%;min-width:0;min-height:36px;background:var(--s2,#222);color:var(--txt,#eee);border:1px solid var(--border2,#444);border-radius:6px;padding:5px 8px}
.ms-style-actions{gap:4px}
.ms-style-actions button{flex:1 1 auto;font-size:10px;padding:4px}
.ms-row-style{color:var(--a,#3ca0ff);border:1px solid var(--border2,#444);border-radius:5px;background:var(--s2,#222);min-height:28px;padding:3px 6px;cursor:pointer;font:inherit;font-size:11px;white-space:nowrap}
.ms-row-style:focus-visible{outline:2px solid var(--a,#3ca0ff)}
#timelineWrap .tl-controls-row{justify-content:flex-start!important}
#timelineWrap .tl-controls{flex-wrap:wrap;justify-content:flex-start}
#timelineWrap button[aria-pressed=true]{border-color:var(--a,#3ca0ff);background:#3ca0ff25;color:var(--txt,#eee)}
.ms-timeline-hint{font-size:11px;color:var(--txt2,#bbb);line-height:1.5;margin:5px 0 0}
#tlRollModeBtn:disabled{opacity:.4;cursor:default}
@media(max-width:1023px){.ms-scope-toolbar{position:relative;top:auto}.ms-style-actions{display:none!important}.ms-scope-options strong{flex-basis:auto;font-size:11px}.ms-scope-toolbar button{min-height:36px}.ms-row-style{min-height:36px}}

/* Keep the subtitle list visible; advanced tools expand within a bounded area. */
#editorSettings:not([data-ms-tab="style"]) #msScopeToolbar{display:none!important}
#editorSettings:not([data-ms-tab="edit"]) #msEditTools{display:none!important}
#msEditTools{flex:0 0 auto;border-bottom:1px solid var(--border,#333);padding:0 10px}
#msEditTools #editStats{margin:0;padding:6px 0;border:0;font-size:11px;gap:5px}
#msEditTools #editTimingHint{font-size:11px;padding:6px;margin:4px 0}
#msEditTools #msEditorStatus{padding:5px 0;gap:6px;flex-wrap:wrap}
#msEditTools .ms-search-actions{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0}
#msEditTools .ms-search-actions button{font-size:11px!important;min-height:32px;padding:4px 7px!important}
#editorSettings[data-ms-tab="edit"] #editSearchWrap{padding:6px 10px!important;margin:0!important;flex:0 0 auto}
#editorSettings[data-ms-tab="edit"] #editPanel{min-height:120px;flex:1 1 0;overflow:auto}
/* The original route rows were above the text and could fill the whole viewport. */
#editPanel .seg .seg-txt{order:0}
#editPanel .seg-meta{display:block;margin-bottom:5px}
#editPanel .seg-meta>div:first-child{display:flex;flex-wrap:wrap;align-items:center;gap:4px!important;min-width:0}
#editPanel .seg-meta .seg-time{flex:1 0 100%;max-width:100%;flex-wrap:nowrap;gap:2px}
#editPanel .seg-meta .time-inp{flex:1 1 60px!important;min-width:0!important;width:60px!important;max-width:100px}
#editPanel .seg-meta .seg-dur{margin-left:auto}
#editPanel .ms-row-style{flex:0 0 auto;width:auto;height:auto;min-width:80px;min-height:28px!important}
#editPanel .seg>.seg-acts{margin:4px 0;justify-content:flex-end}
#editPanel .seg.selected>.seg-acts,#editPanel .seg.active>.seg-acts,#editPanel .seg:focus-within>.seg-acts{opacity:1}

/* Tools and saved work get the full window instead of a 240px sidebar slot. */
.ms-projects-trigger{width:auto;gap:5px;padding:0 9px;font:inherit;font-size:11px;min-height:34px}
.ms-workspace-dialog{padding:16px;box-sizing:border-box}
.ms-workspace-box{display:flex;flex-direction:column;width:min(860px,100%);max-height:calc(100dvh - 32px);min-height:min(560px,calc(100dvh - 32px));background:var(--s1,#15171d);border:1px solid var(--border2,#444);border-radius:14px;box-shadow:0 24px 80px #0008;overflow:hidden;text-align:left}
.ms-workspace-head{display:flex;align-items:center;gap:16px;justify-content:space-between;flex:0 0 auto;padding:18px 22px;border-bottom:1px solid var(--border,#333)}
.ms-workspace-head h2{font-size:19px;margin:0 0 5px;color:var(--txt,#eee)}
.ms-workspace-head p{font-size:12px;margin:0;color:var(--txt2,#aaa)}
.ms-workspace-head button{flex-shrink:0;min-width:40px;min-height:40px}
.ms-workspace-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 22px}
#msProjectsDialog #historyPanel{display:block;overflow:visible;padding:0}
#msProjectsDialog details>summary{cursor:pointer;padding:12px 0;font-size:14px;color:var(--txt,#eee)}
#msProjectsDialog .ms-project-row button{min-height:38px;font-size:12px}
#msEditTools{padding:8px 10px}
#msToolsTrigger{display:flex;flex-direction:column;align-items:flex-start;gap:5px;width:100%;padding:10px 12px;min-height:54px;border:1px solid #60a5fa66;border-radius:8px;background:#60a5fa12;color:var(--txt,#eee);font:inherit;font-size:13px;font-weight:650;cursor:pointer}
#msToolsTrigger small{font-size:11px;font-weight:400;color:var(--txt2,#aaa)}
#editPanel .seg-meta{display:flex;gap:4px;align-items:flex-start}
#editPanel .seg-meta>div:first-child{flex:1;min-width:0}
#editPanel .seg-meta .seg-dur{flex:0 0 auto;margin:3px 0}
#msToolsDialog .ms-edit-tools-body{display:flex;flex-direction:column;gap:12px;max-height:none;overflow:visible}
#msToolsDialog #editStats{display:flex!important;flex-wrap:wrap;gap:8px;padding:0;border:0;background:none}
#msToolsDialog #editStats>button,#msToolsDialog .ms-search-actions button,#msToolsDialog .ms-selection-tools button{min-height:40px;padding:8px 12px!important;font-size:13px!important}
#msToolsDialog .ms-search-actions{display:flex;flex-wrap:wrap;gap:8px}
#msToolsDialog #msEditorStatus{display:flex;flex-wrap:wrap;gap:8px}
#msToolsDialog #providedTextBox{order:1;margin:0;padding:18px}
#msToolsDialog #providedTextInput{min-height:220px;max-height:45dvh;line-height:1.7;font-size:16px}
#msToolsDialog #providedTextBox button{min-height:44px}
#msToolsDialog #frPanel{order:2;flex-shrink:0;padding:14px}
#msToolsDialog .fr-row{flex-wrap:wrap;gap:8px}
#msToolsDialog .fr-inp{min-width:140px;flex:1 1 180px;min-height:40px;font-size:14px}
#msToolsDialog .fr-btn{min-height:40px;font-size:12px}
#msToolsDialog #autoSplitPanel{order:3;flex-shrink:0;font-size:13px}
#msToolsDialog #autoSplitPanel label{min-height:32px;font-size:13px!important}
.ms-control-preview{display:block!important;width:100%;box-sizing:border-box;grid-column:1/-1;padding:7px 9px;border:1px solid var(--border,#333);border-radius:8px;background:linear-gradient(135deg,#090d14,#161f2c);overflow:hidden}
.ms-example-stage{display:flex;align-items:center;justify-content:center;position:relative;min-height:74px;overflow:hidden;border-radius:4px;background:linear-gradient(90deg,transparent 49.7%,#ffffff05 50%,transparent 50.3%)}
.ms-example-sample{position:relative;z-index:1;display:inline-block;font-size:18px;font-weight:700;text-align:center;line-height:1.3;white-space:nowrap;text-shadow:0 2px 5px #0008;transform-origin:center}
.ms-example-baseline:after{content:'';position:absolute;top:62%;left:12%;right:12%;border-top:1px dashed #60a5fa99}
.ms-example-caption{display:flex;justify-content:space-between;gap:6px;font-size:10px;color:var(--txt2,#aaa);line-height:1.5;padding-top:4px}
.ms-example-caption output{font:inherit;color:#93c5fd;flex-shrink:0;max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms-workspace-dialog button:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}
@media(max-width:600px){
  .ms-workspace-dialog{padding:8px}
  .ms-workspace-box{max-height:calc(100dvh - 16px);min-height:calc(100dvh - 16px);border-radius:10px}
  .ms-workspace-head{padding:14px 12px}.ms-workspace-head h2{font-size:17px}
  .ms-workspace-body{padding:12px}
  #msToolsDialog #providedTextBox{padding:12px}#msToolsDialog #providedTextInput{min-height:180px}
  .ms-projects-trigger>span:not(.tab-badge){display:none}
}

/* Keep the reference's four colour-coded word actions immediately available. */
#editPanel .ms-word-actions{display:flex;flex-direction:column;gap:5px;margin:6px 0}
#editPanel .ms-word-actions>:is(.wmove-prev-row,.wsplit-row,.wmove-row,.word-emphasis-row){margin:0;padding:7px 8px;align-items:center;min-width:0;flex-wrap:wrap}
#editPanel .ms-word-actions .word-route-tag{flex:1 0 100%;margin:0 0 3px;font:700 10px/1.4 var(--font);white-space:nowrap;letter-spacing:.02em;text-align:left;border:0;background:transparent;padding:0}
#editPanel .word-emphasis-row .word-route-tag{background:none;border:0;padding:0;color:#62e3b7}
#editPanel .ms-word-actions .word-emphasis-row{background:#35c99909;border-color:#35c99944}
#editPanel .ms-word-actions .reel-word-row{flex:1 1 100%}
#editPanel .ms-word-actions .wsplit-word,#editPanel .ms-word-actions .wmove-word{min-height:30px}

/* Clear style hierarchy: find a preset, then adjust its appearance. */
#stylePanel .ms-panel-intro{order:-3;padding:18px 16px 12px;border-bottom:1px solid var(--ui-border)}
.ms-panel-intro h2{font:700 18px/1.3 var(--font);letter-spacing:-.3px;color:var(--ui-text);margin:0 0 6px}
.ms-panel-intro p{font:400 12px/1.6 var(--font);color:#a6b3c8;margin:0}
#stylePanel #styleQuicknav{order:-2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:10px 12px!important;background:var(--ui-bg);border-bottom:1px solid var(--ui-border);overflow:visible}
#styleQuicknav .qn-btn{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:36px!important;padding:6px!important;font-size:11px!important;white-space:nowrap}
#styleQuicknav .qn-btn span{font-size:12px}
#stylePanel .ms-preset-search{order:2;padding:14px 12px 6px;display:grid;gap:7px}
.ms-preset-search label{color:var(--ui-text);font:650 14px/1.5 var(--font)}
#msPresetSearch{width:100%;box-sizing:border-box;min-height:40px;padding:9px 11px;border:1px solid #364255;border-radius:8px;background:#10151e;color:var(--ui-text);font:400 13px var(--font);outline:none}
#msPresetSearch::placeholder{color:#8493ab}
#msPresetSearch:focus-visible{border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa22}
#msPresetSearchStatus{font-size:11px;line-height:1.5;min-height:16px;color:#9daec8}
#stylePanel #styleFilter{padding:7px 12px!important;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
#styleFilter .sf-btn{min-width:0;min-height:34px;padding:5px;font:600 11px/1.3 var(--font);letter-spacing:0;border-radius:7px;white-space:normal}
#stylePanel #tplGrid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px;padding:4px 12px 16px!important}
#tplGrid .tpl{height:84px!important;min-height:84px!important;min-width:0;padding:9px 7px!important;gap:9px;border:1px solid #313d50!important;border-radius:9px!important;background:#151d29!important;box-shadow:none!important;transform:none!important}
#tplGrid .tpl:hover{border-color:#7493bc!important;background:#1b293d!important}
#tplGrid .tpl.active{border-color:#60a5fa!important;background:#192e49!important;box-shadow:0 0 0 1px #60a5fa55!important}
#tplGrid .tpl.active::after{content:'✓';position:absolute;right:7px;top:4px;font-size:12px;color:#93c5fd}
#tplGrid .tpl-name{font:600 11px/1.3 var(--font)!important;letter-spacing:0!important;text-transform:none!important;color:#bbcbe1!important}
#tplGrid .tpl-preview{font-size:16px!important;min-height:24px;display:flex!important;align-items:center;justify-content:center;max-width:100%;width:100%;padding:0 2px;gap:3px}
#tplGrid .tpl-preview>span{font-size:15px!important}
#tplGrid .tpl[data-ms-search-hidden]{display:none!important}
#stylePanel .sec,#stylePanel .collapsible-sec{border-color:#263346!important;background:transparent!important}
#stylePanel .sec-title,#stylePanel .collapse-hdr{font-family:var(--font)!important;font-size:13px!important;letter-spacing:0!important;text-transform:none;color:#d7e1ef!important;min-height:36px}
#secText #secFont{padding:12px!important;gap:13px}
#secText #secFont>.sec-title{min-height:24px}
#secText #secFont label{color:#aebed3}
#stylePanel .ms-control-preview{background:#101722;border-color:#2b384b}
.ms-example-stage{min-height:54px}
.ms-example-caption{font-size:11px;color:#a1b1c8}
#stylePanel .setting{min-width:0}

/* Stable subtitle cards put the editable sentence ahead of compact word tools. */
#editPanel{padding:10px 10px 18px!important;scroll-padding-top:12px}
#editPanel .seg{padding:11px!important;border:1px solid #293548!important;border-radius:10px!important;background:#111923!important;margin-bottom:10px;gap:7px!important}
#editPanel .seg:hover{border-color:#415675!important}
#editPanel .seg.selected,#editPanel .seg.active{border-color:#4b88c9!important;background:#152339!important}
#editPanel .seg-meta{margin-bottom:3px}
#editPanel .seg-meta>div:first-child{gap:6px!important}
#editPanel .seg-dur{font-size:10px;color:#a1b3cd}
#editPanel .seg-time{margin-top:3px;gap:3px!important}
#editPanel .time-inp{min-height:30px;font-size:11px!important;color:#9cc9ff!important}
#editPanel .seg-txt{padding:9px!important;font-size:14px!important;line-height:1.65!important;color:#f0f4fb;background:#0d141e!important;border:1px solid #2e4058!important;border-radius:8px!important;min-height:58px;white-space:pre-wrap}
#editPanel .seg-txt:focus{border-color:#60a5fa!important;box-shadow:0 0 0 2px #60a5fa18}
#editPanel .seg-acts{justify-content:flex-start!important;gap:5px;flex-wrap:wrap;margin:0!important}
#editPanel .seg-acts .seg-btn{width:auto!important;min-height:32px;height:auto;padding:5px 8px;font-size:11px;display:inline-flex;align-items:center;gap:4px;color:#b9cce5;border:1px solid #33465f;background:#1b283a;border-radius:6px}
#editPanel .seg-acts .js-del{margin-left:auto;color:#fda4af;border-color:#fb718533;background:#fb718509}
#editPanel .ms-word-actions{gap:5px;margin:3px 0}
#editPanel .ms-word-actions>:is(.wmove-prev-row,.wsplit-row,.wmove-row,.word-emphasis-row){display:grid!important;grid-template-columns:88px minmax(0,1fr);gap:6px;align-items:center;padding:6px 8px;min-height:40px;border-radius:7px}
#editPanel .ms-word-actions .word-route-tag{margin:0!important;width:auto;min-width:0;font:650 10px/1.5 var(--font);white-space:normal;text-align:left}
#editPanel .ms-route-words,#editPanel .ms-word-actions .reel-word-row{display:flex;flex-wrap:wrap;gap:3px;min-width:0}
#editPanel .ms-word-actions .wsplit-word,#editPanel .ms-word-actions .wmove-word{font-size:12px;min-height:28px;padding:3px 4px}
#editPanel .ms-word-actions .rwc{font-size:12px!important;padding:4px 6px!important;min-height:28px!important;border-radius:6px}
#editPanel .seg-footer{padding-top:5px;border-top:1px solid #293548;margin-top:2px;font-size:10px}
#editPanel .ms-row-style{font-size:11px;background:#203550;border-color:#426086;color:#afcfff;min-height:28px!important}
#editSearchWrap .edit-search-inp{min-height:40px;font-size:13px!important;border-radius:8px}
@media(max-width:600px){
 #editPanel .seg{padding:9px!important}
 #editPanel .seg-txt{font-size:16px!important}
 #editPanel .ms-word-actions>:is(.wmove-prev-row,.wsplit-row,.wmove-row,.word-emphasis-row){grid-template-columns:80px minmax(0,1fr);padding:6px}
 #editPanel .seg-acts .seg-btn{min-height:38px;padding:5px 7px}
 #stylePanel .ms-panel-intro{padding:14px 12px 10px}
}

#styleFilter .sf-btn.active{background:#25466e!important;color:#e8f2ff!important;border-color:#6ba7ed!important}
#tplGrid .tpl.active::after{display:block!important;left:auto;background:none;height:auto;opacity:1;border-radius:0}

/* Mixed selection: neutral informational state rather than an alarming warning. */
.ms-mixed-badge{font-size:10px;letter-spacing:0;background:rgba(148,163,184,.12);color:var(--txt2);border:1px solid rgba(148,163,184,.22);padding:3px 7px;border-radius:999px;white-space:nowrap}
.ms-size-exact::placeholder{color:var(--txt2);opacity:.85}

/* The sidebar packs more controls into rows as the user widens it. */
#editorSettings{container-type:inline-size;min-width:0}
#stylePanel #styleQuicknav{position:static!important;top:auto!important;z-index:auto!important;flex-shrink:0;grid-template-columns:repeat(auto-fit,minmax(84px,1fr));box-shadow:none}
#stylePanel #tplGrid{grid-template-columns:repeat(auto-fill,minmax(min(100%,124px),1fr))!important;align-items:start}
#tplGrid .tpl{max-height:84px;overflow:hidden}
#secText #secFont .fe-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));align-items:start;gap:12px}
#stylePanel #secText>.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:10px}
#stylePanel #secText>.settings-grid>.setting{grid-column:auto;align-content:start}
#stylePanel #secText>.settings-grid>.setting.full{grid-column:1/-1}
@container (min-width:550px){
 #secText #secFont{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 #secText #secFont>.sec-title,#secText #secFont>.font-style-row,#secText #secFont>.fe-grid{grid-column:1/-1}
 #stylePanel .ms-example-stage{min-height:38px}
}

/* One quiet mixed-value badge; warning outlines do not belong on editable controls. */
#editorSettings input[data-ms-mixed="true"]{outline:none;outline-offset:0}
#editorSettings input[data-ms-mixed="true"]:focus-visible{outline:2px solid #79b6ff;outline-offset:2px}
#editorSettings input[type=color][data-ms-mixed="true"]{opacity:.8}
#editorSettings .ms-mixed-badge{display:inline-flex;align-items:center;margin-left:6px;padding:2px 6px;border:1px solid #47566c;background:#223044;color:#b9cee8;border-radius:5px;font:500 10px/1.4 var(--font);vertical-align:middle;white-space:nowrap}
#editorSettings [data-ms-mixed="true"]~.range-val{font-weight:500;color:#98abc3}

/* Word chips are small dark controls, with the chosen text colour as a subtle accent. */
#editPanel .ms-word-actions .word-emphasis-row{background:#101d26;border:1px solid #27434c;border-left:2px solid #48b8ab}
#editPanel .word-emphasis-row .word-route-tag{font-weight:600;color:#86cfc5}
#editPanel .word-emphasis-row .reel-word-row{gap:5px}
#editPanel .word-emphasis-row .rwc{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;background:#142731!important;border:1px solid #2d4856!important;border-radius:5px!important;padding:5px 8px!important;min-height:30px!important;font:500 12px/1.35 var(--font)!important;letter-spacing:0;text-shadow:none;box-shadow:none;-webkit-text-stroke:0;transition:background .12s,border-color .12s;outline:none}
#editPanel .word-emphasis-row .rwc:hover{background:#1d3644!important;border-color:#5d9eaa!important;transform:none}
#editPanel .word-emphasis-row .rwc:focus-visible,#editPanel .word-emphasis-row .rwc[aria-pressed="true"]{outline:2px solid #62c9be;outline-offset:2px;background:#1c3a43!important}
#editPanel .word-emphasis-row .rwc::after{position:static;font-size:8px;color:#68cbbd}
#editPanel .word-emphasis-row .rwc>span{font-size:8px!important;font-weight:500!important;color:#8fc9c3!important;margin:0!important}
#editPanel .word-emphasis-row .rwc .word-sfx-badge{color:#8ecabb;background:transparent}

/* Tools starts with the text editor. Advanced operations stay one click away. */
#msToolsDialogBody{display:flex;flex-direction:column;gap:16px}
#msToolsDialog #providedTextBox{order:0;flex-shrink:0;margin:0;padding:0;border:0;background:transparent}
#msToolsDialog #providedTextBox[hidden]{display:none}
#msToolsDialog .provided-text-head{gap:12px;margin-bottom:16px}
#msToolsDialog .provided-text-head strong{font-size:17px;color:#e2ebf7}
#msToolsDialog .provided-text-head p{font-size:13px;line-height:1.6;color:#9cafc7;margin:6px 0 0}
#msToolsDialog .provided-text-label{font-size:12px;color:#b8c8dc}
#msToolsDialog #providedTextInput{min-height:200px;max-height:40dvh;border:1px solid #344963;border-radius:9px;background:#0d141e;padding:13px;font:400 15px/1.7 var(--font);color:#e5edf7;resize:vertical}
#msToolsDialog .provided-text-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}
#msToolsDialog .provided-text-actions button{min-height:38px;padding:7px 11px;font-size:12px;border-radius:7px}
#msToolsDialog .provided-text-note{font-size:12px;line-height:1.6;color:#93a7c1}
#msToolsDialog .ms-tools-advanced{order:1;border:1px solid #293a50;border-radius:9px;background:#101722;flex-shrink:0}
#msToolsDialog .ms-tools-advanced>summary{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:space-between;padding:13px 14px;cursor:pointer;list-style:none;color:#c9d9ee;font-size:13px}
#msToolsDialog .ms-tools-advanced>summary::after{content:'⌄';margin-left:auto;color:#8ca9c9}
#msToolsDialog .ms-tools-advanced[open]>summary::after{content:'⌃'}
#msToolsDialog .ms-tools-advanced>summary small{font-size:11px;color:#8ea3bf}
#msToolsDialog .ms-tools-advanced>.ms-edit-tools-body{padding:4px 14px 14px}
#msToolsDialog #editStats{font-size:11px;line-height:1.6}
#msToolsDialog #editStats>button,#msToolsDialog .ms-search-actions button,#msToolsDialog .ms-selection-tools button{min-height:34px;padding:6px 9px!important;font-size:12px!important}
#msToolsDialog .ms-projects-trigger{align-self:flex-start;margin-top:6px;min-height:34px;font-size:12px}
#msToolsDialog #editTimingHint{font-size:11px;line-height:1.6}
header .hdr-right{min-width:0;gap:8px}
header #statusPill{max-width:160px;overflow:hidden}
header #statusTxt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:600px){#msToolsDialog #providedTextInput{min-height:170px}#msToolsDialog .ms-tools-advanced>summary small{flex-basis:100%}}
