.command-workspace{--category:#3769d7;--category-soft:#eef3ff}
.command-category-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.command-category-tabs>button{display:flex;align-items:center;text-align:left;gap:8px;min-width:0;padding:12px 10px;border:1px solid #dce4ee;border-radius:10px;background:#fff;color:#5e718d;cursor:pointer;box-shadow:0 2px 6px #253b5b03}
.command-category-tabs>button>i{display:grid;place-items:center;width:26px;height:28px;flex-shrink:0;font-size:19px;font-style:normal;color:var(--category);background:var(--category-soft);border-radius:7px}
.command-category-tabs>button>span{min-width:0}.command-category-tabs b{font-size:11px;white-space:nowrap}.command-category-tabs small{display:block;font-size:9px;color:#8c9bb0;margin-top:3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.command-category-tabs em{margin-left:auto;font-style:normal;font-size:10px;color:#9babc1}.command-category-tabs>button.selected{border-color:var(--category);background:var(--category-soft);box-shadow:0 0 0 2px color-mix(in srgb,var(--category) 8%,transparent)}
.category-basic{--category:#3769d7;--category-soft:#edf3ff}.category-combo{--category:#258773;--category-soft:#eaf7f1}.category-special{--category:#8951b4;--category-soft:#f4edfb}.category-sum{--category:#b0742b;--category-soft:#fff6e7}.category-triple{--category:#bf5775;--category-soft:#fff0f4}.category-action{--category:#5d7193;--category-soft:#eef2f7}
.command-search-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0}
.command-search-row>label{display:flex;align-items:center;gap:7px;background:#fff;border:1px solid #dce5ef;border-radius:7px;padding:0 10px;width:290px;max-width:50%;color:#94a1b3}
.command-search-row input{height:34px;border:0;outline:none;background:transparent;min-width:0;width:100%;font-size:12px;color:#3d5576}.command-search-row>span{font-size:10px;color:#8b9bb1}.command-search-row b{background:#e8eef8;padding:3px 5px;border-radius:4px;color:#5977a2}.command-search-row i{margin:0 7px;font-style:normal}
.command-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.command-card{min-width:0;border:1px solid #dbe4ef;border-radius:10px;background:#fff;overflow:hidden;box-shadow:0 3px 8px #243b5804}
.command-card>header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;background:var(--category-soft);border-bottom:1px solid color-mix(in srgb,var(--category) 13%,white)}
.command-card>header>span{color:var(--category);font-size:13px;font-weight:700}.command-card>header>small{font-size:9px;color:#91a0b4}
.command-card>label{display:grid;gap:5px;padding:11px 12px 8px;font-size:10px;color:#8b9ab0}.command-card textarea{box-sizing:border-box;resize:none;min-width:0;width:100%;height:48px;padding:7px 8px;line-height:1.5;border:1px solid #dce5f0;border-radius:6px;background:#fbfcff;color:#3c5270;font-size:12px;outline:none;overflow:hidden}
.command-card textarea:focus{border-color:var(--category);box-shadow:0 0 0 2px var(--category-soft)}
.command-card>footer{display:flex;align-items:center;justify-content:space-between;padding:0 12px 11px;font-size:9px;color:#94a2b7}.command-card code{font-size:11px;color:var(--category);background:var(--category-soft);padding:4px 8px;border-radius:5px}
.command-pagination{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#8a9ab0;margin-top:12px}.command-pagination>div{display:flex;align-items:center;gap:10px}.command-pagination button{height:28px;border:1px solid #d7e1ef;border-radius:5px;padding:4px 10px;background:#fff;color:#617a9b;font-size:11px;cursor:pointer}.command-pagination button:disabled{opacity:.4;cursor:default}.command-pagination b{font-weight:500;color:#7187a5}.command-empty{padding:30px;text-align:center;background:#fff;border-radius:10px;color:#899ab1;font-size:12px}
.preference-page .advanced-save{position:static;min-height:46px;padding:8px 15px}
.command-category-tabs{grid-template-columns:repeat(7,minmax(0,1fr))}.category-new{--category:#8951b4;--category-soft:#f4edfb}.category-position{--category:#bf5775;--category-soft:#fff0f4}
.command-card>header>small{margin-left:8px;white-space:nowrap}.control-switch{display:inline-flex;align-items:center;gap:5px;margin-left:auto;border:0;background:transparent;color:#8896aa;cursor:pointer;white-space:nowrap;font-size:11px}.control-switch>i{position:relative;width:30px;height:18px;border-radius:20px;background:#cad3df;flex-shrink:0}.control-switch>i:after{content:'';position:absolute;width:14px;height:14px;background:#fff;left:2px;top:2px;border-radius:50%;box-shadow:0 1px 3px #0002}.control-switch.on{color:#15966d}.control-switch.on>i{background:#16b57d}.control-switch.on>i:after{left:14px}.control-switch[disabled]{opacity:.5;cursor:wait}
.msg-template-items>div{display:flex;align-items:center;min-height:34px;border-radius:7px}.msg-template-items>div.selected{background:#edf3ff}.msg-template-items>div>button[data-msg-template]{flex:1;min-width:0;width:auto;border:0;background:transparent}.msg-template-items>div>.control-switch{padding:4px;margin-right:4px;font-size:10px}.msg-template-items>div>.control-switch>i{width:26px;height:16px}.msg-template-items>div>.control-switch>i:after{height:12px;width:12px}.msg-template-items>div>.control-switch.on>i:after{left:12px}.msg-template-indicator.paused{background:#c6ceda}.msg-template-indicator.active{background:#15b57f}.msg-use-status{font-size:11px;color:#8a99af}.msg-parameter-list{margin-top:8px;border:1px solid #dce5ef;border-radius:7px;padding:8px;color:#71839d;font-size:11px}.msg-parameter-list summary{cursor:pointer;font-weight:600}.msg-parameter-list>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;max-height:190px;overflow:auto}.msg-parameter-list button{border:1px solid #d8e4f5;border-radius:5px;background:#f3f7ff;color:#406ca9;padding:4px 7px;cursor:pointer}.msg-parameter-list p{line-height:1.6;margin:8px 0 0}.preference-page .advanced-save{display:flex;justify-content:space-between;align-items:center;border:1px solid #dce5ef;border-radius:10px;background:white;margin-top:14px}.command-card textarea{overflow-y:auto}
@media(max-width:1100px){.command-category-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.command-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.command-card-grid{grid-template-columns:1fr}.command-category-tabs>button{padding:8px}.command-category-tabs small,.command-category-tabs>button>i,.command-search-row>span{display:none}.command-search-row>label{max-width:none;width:100%}}
.msg-studio{grid-template-rows:auto auto minmax(0,1fr)}.msg-state-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 2px 12px}.msg-state-toolbar>div{display:flex;gap:6px}.msg-state-toolbar button{border:1px solid #e0e8f2;background:#fff;color:#7c8da6;border-radius:6px;padding:5px 12px;font-size:12px;cursor:pointer}.msg-state-toolbar button.selected{background:#edf4ff;color:#2d69db;border-color:#a8c8fa}.msg-state-toolbar>small{font-size:11px;color:#899ab1}.msg-template-items>div{min-height:58px;border:1px solid transparent;margin-bottom:4px}.msg-template-items>div.selected{border-color:#adcaf7;background:#edf4ff}.msg-template-items>div>button[data-msg-template]{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:9px 7px 9px 12px;min-height:54px}.msg-template-items>div>button[data-msg-template]>b{font-size:13px;line-height:1.4;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.msg-template-items>div>button[data-msg-template]>small{font-size:10px;color:#8c9bb1}.msg-template-items>div>button[data-msg-template]>.msg-template-indicator{display:none}.msg-use-status{display:block!important;max-width:100%;line-height:1.6;white-space:normal!important;margin-top:7px!important}.msg-use-status>b{display:inline-block;padding:1px 6px;background:#edf4ff;border-radius:4px;color:#4279bf;font-size:10px;margin-right:4px}.msg-editor-heading{min-height:78px!important;height:auto!important}.msg-studio-toolbar>nav{gap:7px}.msg-studio-toolbar>nav>button{white-space:nowrap}.msg-studio-toolbar>nav>button>small{margin-left:6px}.msg-parameter-list button:hover{background:#e8f1ff;border-color:#90b9f4}.msg-template-list>header>b{color:#405a7e}.msg-template-list>header{padding-bottom:10px}.msg-state-toolbar button:focus-visible,.control-switch:focus-visible,.msg-parameter-list button:focus-visible{outline:2px solid #4a8df1;outline-offset:2px}
@media(max-width:1100px){.msg-studio-toolbar{flex-wrap:wrap!important}.msg-studio-toolbar>label{max-width:230px}.msg-state-toolbar>small{max-width:45%;text-align:right}}
@media(max-width:700px){.msg-state-toolbar>small{display:none}.msg-studio-toolbar>nav{width:100%;overflow-x:auto}.msg-studio-toolbar>nav>button{flex-shrink:0}.msg-state-toolbar{padding:5px 0 10px}.msg-template-items>div{min-height:58px}.msg-use-status{max-width:100%}}
.msg-layout{grid-template-columns:224px minmax(0,1fr)}.msg-editor-heading>div{flex-wrap:wrap;gap:6px 9px}.msg-editor-heading .msg-use-status{flex-basis:100%}.msg-state-toolbar{flex-shrink:0}.msg-studio-toolbar{height:auto;min-height:35px}.msg-template-list>header>b{font-size:12px}.msg-editor-heading h2{font-size:16px}.msg-template-list .control-switch{font-size:11px}.msg-state-toolbar+ .msg-layout{min-height:0}
@media(max-width:1100px){.msg-layout{grid-template-columns:200px minmax(0,1fr)}}@media(max-width:700px){.msg-layout{grid-template-columns:1fr}.msg-template-items>div{width:100%}.msg-editor-heading h2{font-size:15px}}

/* One compact desktop toolbar; recovered height belongs to the workbench. */
.msg-studio{gap:6px;grid-template-rows:auto minmax(0,1fr)}
.msg-studio-toolbar{display:grid;grid-template-columns:auto minmax(320px,1fr) auto minmax(180px,.48fr);grid-template-areas:"heading categories filters search";align-items:center;gap:8px;height:auto;min-height:36px;padding:0 0 2px}
.msg-studio-toolbar>h1{grid-area:heading;font-size:18px;margin:0 4px 0 0}
.msg-studio-toolbar>nav{grid-area:categories;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;min-width:0;width:auto;order:initial}
.msg-studio-toolbar>nav>button{display:flex;justify-content:center;align-items:center;gap:6px;height:32px;padding:4px 8px;min-width:0;white-space:nowrap}
.msg-studio-toolbar>nav>button>small{margin-left:0}
.msg-state-filters{grid-area:filters;display:flex;align-items:center;gap:3px;padding:2px;border:1px solid #dce5ef;background:#edf2f8;border-radius:7px;min-width:0}
.msg-studio .msg-state-filters>button{height:27px;padding:3px 8px;white-space:nowrap;font-size:11px;border:1px solid transparent;background:transparent;color:#7c8da6}
.msg-studio .msg-state-filters>button.selected{background:#fff;color:#2f6ac8;border-color:#c3d7f4;box-shadow:0 1px 2px #253b5b08}
.msg-studio-toolbar>.msg-toolbar-search{grid-area:search;width:auto;max-width:none;min-width:0;margin:0;height:32px;padding:0 8px}
.msg-studio-toolbar>.msg-toolbar-search>input{width:100%;height:30px;padding:4px 3px}
.msg-studio .msg-editor-heading{min-height:36px!important;height:auto!important;padding:5px 10px;gap:8px}
.msg-studio .msg-editor-heading>div{display:flex;align-items:center;flex-wrap:nowrap;gap:7px;min-width:0;flex:1}
.msg-studio .msg-editor-heading h2{font-size:15px;line-height:1.35;min-width:0;max-width:45%}
.msg-studio .msg-editor-heading>div>small:not(.msg-use-status){flex-shrink:0}
.msg-studio .msg-editor-heading .msg-use-status{display:inline-flex!important;align-items:center;gap:5px;flex:0 1 auto;flex-basis:auto!important;margin:0!important;line-height:1.4;min-width:0;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;font-size:10px}
.msg-studio .msg-use-status>b{margin:0;font-size:10px;flex-shrink:0;line-height:1.5}
.msg-editor-heading>[data-msg-dirty]{flex-shrink:0}
@media(max-width:1180px){
 .msg-studio-toolbar{grid-template-columns:auto minmax(240px,1fr) minmax(150px,.5fr);grid-template-areas:"heading categories search" "filters filters filters";gap:5px 8px}
 .msg-state-filters{justify-self:start}
 .msg-studio-toolbar>nav>button{padding:4px 6px;font-size:11px}
}
@media(max-width:700px){
 .msg-studio-toolbar{grid-template-columns:auto minmax(120px,1fr);grid-template-areas:"heading search" "categories categories" "filters filters";gap:5px}
 .msg-studio-toolbar>nav{width:auto;overflow:visible}
 .msg-studio-toolbar>nav>button{font-size:11px;padding:4px 5px}
 .msg-studio-toolbar>.msg-toolbar-search{max-width:none}
 .msg-state-filters{justify-self:stretch}
 .msg-state-filters>button{flex:1}
 .msg-studio .msg-editor-heading>div{flex-wrap:wrap;gap:4px 6px}
 .msg-studio .msg-editor-heading h2{max-width:65%;font-size:14px}
 .msg-studio .msg-editor-heading .msg-use-status{flex-basis:auto!important}
}

/* One 36px row + 2px gap; keep the existing 13px type and live controls. */
.msg-studio .msg-template-items>div{min-height:36px;height:36px;margin-bottom:2px;gap:2px}
.msg-studio .msg-template-items>div>button[data-msg-template]{min-height:32px;height:32px;display:flex;flex-direction:row;align-items:center;padding:5px 7px 5px 10px;gap:0;overflow:hidden}
.msg-studio .msg-template-items>div>button[data-msg-template]>b{flex:1;min-width:0;font-size:13px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.msg-studio .msg-template-items>div>.control-switch{flex-shrink:0;min-height:26px;height:26px;padding:3px 4px;margin:0 4px 0 0;font-size:11px;line-height:18px}
.msg-studio .msg-template-list>header{min-height:28px;padding:4px 5px 6px}
.msg-studio .msg-template-list>footer{padding-top:4px;margin-top:2px}
@media(max-width:700px){.msg-studio .msg-template-items{gap:0 4px}.msg-studio .msg-template-items>div{min-height:36px;height:36px}}
