:root{color-scheme:dark;font:15px/1.5 Inter,"Noto Sans Thai",system-ui,sans-serif;color:#e8f0fb;background:#0a101c}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.47}.layout{min-height:100vh;display:grid;grid-template-columns:275px minmax(0,1fr)}.sidebar{background:#101a2a;border-right:1px solid #2a3c56;display:flex;flex-direction:column;padding:24px 17px;gap:9px}.brand{font-size:22px;font-weight:800;letter-spacing:-.05em}.brand span{color:#82bfff}.eyebrow{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#8baccd}.account{padding:15px 0;color:#d1e0f4;font-weight:600;border-bottom:1px solid #293a50}.sidebar h3{font-size:12px;color:#9eb0c8;margin:27px 8px 10px;font-weight:500}.soft{border:1px solid #4e6482;background:#1c3151;color:#e8f1ff;border-radius:11px;padding:12px;text-align:left;margin-top:20px}#chat-list{min-width:0;flex:1;overflow:auto;display:flex;flex-direction:column;gap:4px}#chat-list button{background:transparent;border:0;text-align:left;color:#bfd0e6;padding:12px;border-radius:8px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#chat-list button:hover,#chat-list button.active{background:#223652;color:#fff}.side-footer{border-top:1px solid #2e4056;padding-top:12px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;color:#99b0cc}.quiet{background:transparent;border:0;color:#f1c19e;padding:7px}.main{min-width:0}header{height:76px;padding:20px 36px;border-bottom:1px solid #25364c;display:flex;align-items:center;justify-content:space-between;gap:16px}.small-title{font-weight:700}.pills{display:flex;gap:8px}.pill{border:1px solid #36516f;padding:7px 11px;border-radius:100px;font-size:12px;color:#bbdbfa}.pill.warn{border-color:#67522c;color:#ebc78a}.login-screen{min-height:calc(100vh - 76px);display:grid;place-items:center;padding:34px}.login-box{width:min(440px,100%);background:#121f32;border:1px solid #2c4263;padding:37px;border-radius:20px;box-shadow:0 20px 90px #0003}.login-box h1,.hero h1{font-size:29px;line-height:1.25;margin:14px 0}.muted{color:#9eb3ca}.login-box p{font-size:13px}.login-box label{display:block;margin-top:18px;font-size:13px}.login-box input{width:100%;background:#0b1524;color:white;border:1px solid #395270;border-radius:10px;padding:13px;margin-top:8px}.login-box .primary{width:100%;margin-top:25px}.primary{background:#397fff;border:0;color:white;font-weight:650;padding:13px 19px;border-radius:11px}.primary:hover:not(:disabled){background:#5b96ff}#login-error{color:#ffb1a8;font-size:13px;margin-top:15px}.workspace{height:calc(100vh - 76px)}.workspace-inner{width:min(940px,100%);height:100%;padding:32px 26px 20px;margin:0 auto;display:flex;flex-direction:column}.hero p{margin-top:4px;color:#9cb2cd;font-size:13px}.messages{flex:1;overflow-y:auto;padding:20px 0;display:flex;flex-direction:column;gap:16px}.empty-chat{color:#8399b5;line-height:1.9;margin:auto;text-align:center}.message{max-width:min(680px,90%);border:1px solid #34506f;background:#1c2e49;border-radius:16px 16px 3px 16px;padding:15px 18px;white-space:pre-wrap;overflow-wrap:anywhere;align-self:flex-end}.message.assistant{align-self:flex-start;background:#151f30;border-radius:16px 16px 16px 3px}.composer{border:1px solid #385370;border-radius:17px;background:#152337;padding:15px}.composer-head,.composer-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:#b0c3de}.composer textarea{display:block;background:transparent;width:100%;border:0;outline:0;color:#fff;padding:17px 0;resize:vertical;min-height:95px;max-height:230px}.composer-footer{font-size:12px}.footnote{text-align:center;color:#819bb8;padding-top:13px;font-size:11px}.small{font-size:11px}.customer-summary{border:1px solid #2e4868;background:#14243b;padding:13px;border-radius:12px;margin-top:12px;font-size:12px}.customer-summary[hidden]{display:none}.customer-summary .eyebrow{margin-bottom:7px}.member-row{padding:7px 0;border-top:1px solid #2d3e56;overflow-wrap:anywhere}.member-row:first-child{border-top:0}.c4-preview{margin-top:12px;border:1px solid #2f4261;border-radius:15px;padding:13px;background:#101d30}.c4-preview-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.c4-preview-controls{display:flex;align-items:center;gap:7px}.c4-preview .soft{margin-top:0}.c4-demo-output{border-radius:10px;border:1px solid #2b3c52;background:#0b1626;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;min-height:62px;max-height:220px;overflow:auto;font-size:13px;color:#cfe1f8}.c4-preview[hidden]{display:none}#change-password-form label{display:block;margin:9px 0 5px;font-size:12px;color:#bcd1e8}
#change-password-form input{width:100%;padding:10px 12px;background:#0c192a;border:1px solid #3c5270;border-radius:9px;color:#f5faff}
#change-password-form .c4-preview-controls{margin-top:14px}
#mfa-settings label{display:block;margin:9px 0 5px;font-size:12px}
#mfa-settings input,#mfa-login-code{width:100%;padding:10px;background:#0c192a;border:1px solid #3c5270;border-radius:9px;color:#f5faff}
#mfa-seed,#mfa-uri{display:block;overflow-wrap:anywhere;white-space:pre-wrap;padding:8px;background:#0c192a;border-radius:8px;font-size:12px}
#mfa-recovery-export{padding:12px;border:1px solid #3c5270;border-radius:10px;margin-top:12px}
#mfa-recovery-codes{white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}
#mfa-recovery-export[hidden],#mfa-enrollment[hidden],#mfa-disable-form[hidden],#mfa-login-row[hidden],#mfa-begin-form[hidden]{display:none}
@media(max-width:760px){.layout{grid-template-columns:1fr}.sidebar{padding:13px 17px;gap:5px;border-right:0;border-bottom:1px solid #2d3b55}.sidebar h3,.sidebar #chat-list,.sidebar .side-footer{display:none}.sidebar .soft{margin-top:8px}header{height:65px;padding:13px 16px}.login-screen{min-height:calc(100dvh - 140px);padding:19px}.login-box{padding:25px}.workspace{height:calc(100dvh - 180px);min-height:460px}.workspace-inner{padding:18px 13px}.hero h1{font-size:23px}.message{max-width:95%}.pills .pill:first-child{display:none}}
[hidden]{display:none!important}

/* C19B owner-only API key metering table with responsive horizontal scrolling */
.key-usage-title{font-size:15px;line-height:1.35;margin:22px 0 8px;color:#e8f3ff}
.key-usage-table-wrap{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:#365270 transparent;border:1px solid #314864;border-radius:12px;background:#0c1b2e;margin:9px 0 13px}
.key-usage-table{border-collapse:collapse;width:100%;min-width:650px;font-size:12px;line-height:1.45;color:#d6e7fb;font-variant-numeric:tabular-nums}
.key-usage-table th,.key-usage-table td{border-bottom:1px solid #2a3f5d;text-align:left;padding:12px 10px;white-space:nowrap}
.key-usage-table th{background:#182e4b;color:#bed8f3;font-weight:600}
.key-usage-table tr:last-child td{border-bottom:0}
.key-usage-table tbody tr:hover{background:#18304d}
.key-usage-table td:first-child{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:900px){
 .key-usage-table-wrap{scrollbar-width:thin}
 .key-usage-table{min-width:625px}
}

.chat-turn-meta{display:block;font-size:11px;line-height:1.6;margin-top:9px;padding-top:8px;border-top:1px solid #36506f;color:#9cc0e6;font-weight:400;overflow-wrap:anywhere}

/* C19 customer developer portal — keep snippets selectable on phones */
.developer-code-example{white-space:pre-wrap;overflow-wrap:anywhere;overflow-x:auto;font-size:12px;line-height:1.6;padding:13px;background:#0a1527;border:1px solid #32465f;border-radius:11px;tab-size:2}
.developer-contract{margin-top:19px;padding:16px;border:1px solid #324965;border-radius:12px;background:#102238}
.developer-contract>strong{display:block;margin-bottom:9px;color:#dcecff}
.developer-contract p{line-height:1.6}
@media(max-width:520px){
 #c18-developer-panel pre{font-size:11px!important;overflow-wrap:anywhere}
 #c18-developer-panel button{min-height:42px}
 .chat-controls select{font-size:16px}
 #prompt{font-size:16px}
}


/* C18E/F: unified AI chat, safe scrolling and compact mobile composer. */
.chat-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:4px 0 12px}
.chat-controls>label:first-child{color:#b8cbe5;font-size:12px;white-space:nowrap}
.chat-controls select{flex:1;min-width:165px;max-width:480px;padding:10px;border-radius:9px;background:#14233a;color:#e8f2ff;border:1px solid #365270}
.chat-stream-label{display:flex;align-items:center;gap:7px;color:#a6c1de;font-size:12px;white-space:nowrap}
.chat-stream-label input{width:16px;height:16px;accent-color:#6daaff}
.chat-workspace-panel #chat-ai-usage{margin:10px 0 0;overflow-wrap:anywhere;line-height:1.5;max-height:100px;overflow:auto}
.chat-workspace-panel .messages{min-height:220px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#365270 transparent}
.chat-workspace-panel .message{max-width:min(90%,750px);overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.6}
.chat-workspace-panel #prompt{resize:vertical;min-height:78px;max-height:32vh}
.chat-workspace-panel .composer{position:relative;z-index:1}
.chat-workspace-panel #send:disabled{cursor:not-allowed;opacity:.48}
@media(max-width:900px){
 .chat-workspace-panel.nav-active{min-height:calc(100dvh - 126px)}
 .chat-workspace-panel .messages{flex:1;min-height:150px;max-height:48dvh}
 .chat-workspace-panel .composer{margin-top:12px}
 .chat-workspace-panel #prompt{min-height:72px}
 .chat-workspace-panel #send{min-height:42px}
 .chat-workspace-panel .chat-controls{align-items:stretch}
 .chat-workspace-panel .chat-controls select{min-width:100%;max-width:100%}
 .chat-workspace-panel .chat-stream-label{min-height:38px}
}
@media(max-width:520px){
 .chat-workspace-panel .message{max-width:96%}
 .chat-workspace-panel #send{width:100%;min-height:44px}
 .chat-workspace-panel .composer-footer{flex-wrap:wrap;gap:8px}
 .chat-workspace-panel #chat-ai-usage{font-size:11px}
 .workspace-inner>.workspace-view.nav-active{min-width:0}
}


/* C18D: far-left workspace navigation, without changing underlying account logic. */
.layout{grid-template-columns:288px minmax(0,1fr)}
.sidebar{height:100dvh;position:sticky;top:0;overflow-y:auto;overscroll-behavior:contain;padding:20px 14px 16px;gap:9px;scrollbar-width:thin;scrollbar-color:#334967 transparent}
.brand{margin:1px 6px 0}
.sidebar>.eyebrow{margin:0 6px}
.account{padding:10px 6px 14px;overflow-wrap:anywhere}
.sidebar #new-chat{margin-top:5px;flex-shrink:0}
.workspace-nav{display:flex;flex-direction:column;gap:3px;margin-top:8px;flex-shrink:0}
.nav-group-heading{font-size:10px;letter-spacing:.14em;color:#7194bd;padding:17px 11px 5px;font-weight:750}
.nav-link{appearance:none;border:1px solid transparent;background:transparent;color:#bbcee7;display:flex;align-items:center;gap:11px;text-align:left;width:100%;min-height:41px;padding:10px 12px;border-radius:10px;transition:background .16s,border-color .16s,color .16s;font-size:13px;line-height:1.3}
.nav-link>span:first-child{display:grid;place-items:center;font-size:17px;color:#85a8d5;width:19px;flex:0 0 19px}
.nav-link:hover{background:#182b46;color:#fff}
.nav-link.active{color:#f2f7ff;background:#1d3b65;border-color:#3b669b;font-weight:650;box-shadow:inset 3px 0 #68a8ff}
.nav-link:focus-visible,.mobile-nav-toggle:focus-visible,.mobile-nav-close:focus-visible,.chat-history summary:focus-visible{outline:2px solid #80b7ff;outline-offset:2px}
.nav-mini{font-size:10px;padding:2px 5px;border:1px solid #436a8a;border-radius:6px;margin-left:auto;color:#9cc6ed}
.chat-history{margin:14px 0 0;border-top:1px solid #283d58;padding-top:11px}
.chat-history summary{cursor:pointer;padding:9px 11px;border-radius:9px;color:#b9cce5;font-size:12px}
.chat-history[open] summary{background:#14243b}
.sidebar #chat-list{min-height:0;max-height:270px;overflow-y:auto;flex:none;padding:3px}
.sidebar #chat-list button{padding:9px 11px;font-size:12px}
.side-footer{margin-top:auto;position:sticky;bottom:-16px;background:#101a2a;padding:13px 4px 12px;z-index:1}
.header-leading{display:flex;align-items:center;gap:11px;min-width:0}
#current-section-name{color:#b8d3f4}
.workspace{height:auto;min-height:calc(100dvh - 76px);overflow:visible}
.workspace-inner{width:min(1130px,100%);min-height:calc(100dvh - 76px);height:auto;padding:26px clamp(16px,3vw,36px) 28px;margin:0 auto;display:block}
.workspace-inner>.workspace-view{margin-top:0}
.workspace-view:not(.nav-active){display:none!important}
.workspace-view.nav-active{animation:workspace-section-appear .18s ease-out}
@keyframes workspace-section-appear{from{opacity:.75;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
.chat-workspace-panel.nav-active{display:flex;flex-direction:column;min-height:calc(100dvh - 158px)}
.chat-workspace-panel .messages{flex:1;min-height:220px;max-height:calc(100dvh - 330px)}
.chat-workspace-panel .composer{flex-shrink:0}
.workspace-inner>.c4-preview.workspace-view{padding:clamp(18px,2vw,28px);border-radius:18px;background:linear-gradient(150deg,#14243a,#0f1c30);box-shadow:0 10px 35px #0002}
.workspace-inner>.c4-preview.workspace-view>strong{display:block;font-size:18px;margin:4px 0 12px}
.workspace-inner>.c4-preview.workspace-view label{margin-top:13px}
.workspace-inner>.c4-preview.workspace-view textarea,.workspace-inner>.c4-preview.workspace-view input:not([type=checkbox]):not([type=radio]),.workspace-inner>.c4-preview.workspace-view select{max-width:100%}
.workspace-inner>.c4-preview.workspace-view pre{overflow:auto;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
.footnote{margin-top:24px}
.mobile-nav-toggle,.mobile-nav-close,.mobile-nav-overlay{display:none}
@media(max-width:900px){
 .layout{grid-template-columns:1fr}
 .sidebar{position:fixed;z-index:31;left:0;top:0;bottom:0;width:min(310px,88vw);height:100dvh;transform:translateX(-105%);transition:transform .22s ease;overflow-y:auto;box-shadow:10px 0 45px #0007;border-right:1px solid #35516f;border-bottom:0;padding:18px 14px}
 .layout.nav-open .sidebar{transform:translateX(0)}
 .sidebar #chat-list{display:flex}
 .sidebar .chat-history,.sidebar .side-footer{display:block}
 .sidebar .side-footer{display:flex}
 .sidebar .workspace-nav{display:flex}
 .sidebar .nav-group-heading{padding-top:13px}
 .mobile-nav-toggle,.mobile-nav-close{display:inline-flex;justify-content:center;align-items:center;border:1px solid #37516e;background:#182b46;color:#e6f1ff;border-radius:10px;min-width:38px;height:38px;font-size:19px}
 .mobile-nav-close{position:absolute;top:14px;right:13px;font-size:14px}
 .mobile-nav-overlay:not([hidden]){display:block;position:fixed;inset:0;background:#030913bd;z-index:30;border:0;padding:0}
 body.nav-mobile-lock{overflow:hidden}
 header{height:65px;padding:12px 16px}
 .workspace{height:auto;min-height:calc(100dvh - 65px)}
 .workspace-inner{min-height:calc(100dvh - 65px);padding:20px 14px}
 .chat-workspace-panel.nav-active{min-height:calc(100dvh - 120px)}
 .chat-workspace-panel .messages{min-height:200px;max-height:45vh}
 .login-screen{min-height:calc(100dvh - 65px)}
}
@media(max-width:520px){
 .pills{gap:5px}.pills .pill{font-size:10px;padding:6px 8px}
 .small-title{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .workspace-inner>.c4-preview.workspace-view{padding:15px}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-head{flex-wrap:wrap}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-controls{flex-wrap:wrap}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-controls>*{min-width:0}
}
@media(prefers-reduced-motion:reduce){
 .workspace-view.nav-active{animation:none}
 .sidebar,.nav-link{transition:none}
}


/* C20 · shared mobile-first layout system: customer pages */
html,body{max-width:100%;min-width:0}
body{overflow-wrap:break-word}
button,input,select,textarea{font-family:inherit}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #8abaff;outline-offset:2px}
.main,.workspace,.workspace-inner,.workspace-view,.c4-preview,.login-screen,.login-box,.composer,.chat-controls,.c4-preview-head,.c4-preview-controls{min-width:0}
.workspace-inner>.workspace-view{max-width:100%}
.workspace-inner>.c4-preview.workspace-view input:not([type=checkbox]):not([type=radio]),
.workspace-inner>.c4-preview.workspace-view select,
.workspace-inner>.c4-preview.workspace-view textarea,
.login-screen input,.login-screen select{display:block;width:100%;min-width:0;box-sizing:border-box;background:#0d192b;color:#edf5ff;border:1px solid #3e5777;border-radius:10px;padding:12px 13px}
.workspace-inner>.c4-preview.workspace-view input:focus,.workspace-inner>.c4-preview.workspace-view select:focus,
.workspace-inner>.c4-preview.workspace-view textarea:focus{border-color:#79adf5}
.workspace-view :is(p,div,label,strong,span){min-width:0}
.workspace-view :is(pre,code){max-width:100%;overflow-wrap:anywhere}
.workspace-inner>.c4-preview.workspace-view>strong{font-size:clamp(19px,2.2vw,24px);letter-spacing:-.015em}
.workspace-inner>.c4-preview.workspace-view>p{line-height:1.7}
.workspace-view .c4-preview-head{gap:16px}
.workspace-view .c4-preview-head>div{min-width:0}
.workspace-view .c4-preview-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.workspace-view .c4-preview-controls .soft{margin-top:0}
.workspace-view .c4-preview-controls button{min-height:42px}
.workspace-view .c4-demo-output,.workspace-view .developer-contract,.workspace-view .key-usage-table-wrap{min-width:0;max-width:100%}
.workspace-view [role="status"]{overflow-wrap:anywhere}
.login-screen .c4-preview-controls{flex-wrap:wrap}
.pills{flex-wrap:wrap;justify-content:flex-end}
.small-title{overflow-wrap:anywhere}
#api-key-panel .key-lead{max-width:70ch;margin:8px 0 12px;font-size:13px}
#api-key-panel .key-status{border:1px solid #34506d;background:#101e32;border-radius:10px;padding:12px 14px;margin:0 0 18px;font-size:13px;line-height:1.55}
#api-key-panel .key-panels{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:16px;align-items:start}
#api-key-panel .key-card{min-width:0;padding:clamp(16px,2vw,24px);border:1px solid #34516e;background:#0d1b2e;border-radius:16px}
#api-key-panel .key-card h2{font-size:16px;line-height:1.4;color:#f1f6ff;margin:0 0 7px}
#api-key-panel .key-card>p{margin:0 0 18px;line-height:1.6}
#api-key-panel .key-card-danger{border-color:#66454b;background:#201c2a}
#api-key-panel .key-form{display:grid;gap:16px;min-width:0}
#api-key-panel .key-field{display:grid;gap:7px;min-width:0}
#api-key-panel .key-field label{display:block;margin:0;font-size:13px;font-weight:600;color:#cbdcf0;line-height:1.5}
#api-key-panel .key-field input,#api-key-panel .key-field select{display:block;width:100%;min-width:0;max-width:100%;min-height:46px;margin:0;background:#0a1525;border:1px solid #456081;border-radius:10px;padding:11px 13px;color:#f3f7ff}
#api-key-panel .key-field input:focus,#api-key-panel .key-field select:focus{border-color:#82b4fd}
#api-key-panel .key-action{display:inline-flex;align-items:center;justify-content:center;min-height:46px;max-width:100%;width:fit-content;margin:6px 0 0;padding:12px 18px;text-align:center;line-height:1.35}
#api-key-panel .key-revoke-button{color:#ffd4d4;background:#51303b;border:1px solid #ae6574;border-radius:10px;font-weight:650;cursor:pointer}
#api-key-panel .key-revoke-button:hover:not(:disabled){background:#673947}
#api-key-panel .key-issued{margin-top:18px;padding:18px;background:#112d2e;border:1px solid #3a7771;border-radius:13px}
#api-key-panel .key-issued>strong{display:block;color:#c8fff0;margin-bottom:6px}
#api-key-panel #api-key-value{display:block;margin:10px 0;padding:13px;border-radius:9px;background:#061a1e;overflow-wrap:anywhere;word-break:break-all;font-size:12px}
#api-key-panel #api-key-feedback{min-height:1.5em;margin-top:15px}
@media(max-width:900px){
 .workspace-inner{width:100%;max-width:100%}
 .workspace-inner>.c4-preview.workspace-view{padding:clamp(16px,3vw,24px)}
 header{gap:10px}
 .small-title{font-size:clamp(12px,2.8vw,15px)}
 .login-box{max-width:460px}
 .chat-workspace-panel .messages{max-height:min(48dvh,520px)}
}
@media(max-width:600px){
 header{padding:10px 12px;min-height:64px;height:auto}
 .header-leading{flex:1;min-width:0}
 .mobile-nav-toggle{min-width:44px;height:44px;flex-shrink:0}
 .pills{flex-shrink:0}
 .pills .pill{max-width:138px;white-space:normal;text-align:center;line-height:1.35}
 .workspace-inner{padding:16px 12px 24px}
 .workspace-inner>.c4-preview.workspace-view{padding:17px 14px;border-radius:15px}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-head{align-items:flex-start}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-controls{width:100%}
 .workspace-inner>.c4-preview.workspace-view .c4-preview-controls button{flex:1 1 150px;margin-top:0}
 .workspace-inner>.c4-preview.workspace-view input:not([type=checkbox]):not([type=radio]),
 .workspace-inner>.c4-preview.workspace-view select,.workspace-inner>.c4-preview.workspace-view textarea,
 .login-screen input,.login-screen select{font-size:16px;min-height:44px}
 .workspace-inner>.c4-preview.workspace-view>strong{font-size:21px}
 .login-screen{padding:14px 12px}
 .login-box{padding:22px 18px}
 .login-box h1{font-size:24px}
 .composer-head,.composer-footer{flex-wrap:wrap;gap:8px}
 .composer{padding:12px}
 .chat-workspace-panel .messages{min-height:180px;max-height:46dvh}
 .workspace-view :is(.soft,.primary){max-width:100%}
 #api-key-panel .key-panels{grid-template-columns:1fr;gap:13px}
 #api-key-panel .key-card{padding:17px 14px}
 #api-key-panel .key-action{width:100%}
 #api-key-panel .key-status{padding:11px 12px}
}
@media(max-width:360px){
 .pills .pill{max-width:96px}
 .workspace-inner{padding-left:9px;padding-right:9px}
 .workspace-inner>.c4-preview.workspace-view{padding:14px 12px}
 .chat-controls>label:first-child{white-space:normal}
}

/* C20B · model catalog discovery and access status */
.chat-controls #chat-model-note{flex:1 1 100%;margin:0;color:#a9c3e2;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.chat-controls #chat-model-refresh{flex:0 0 auto;min-height:42px;max-width:100%;border:1px solid #365270;background:#192f4b;color:#e1efff;border-radius:9px;padding:9px 12px;white-space:nowrap}
.chat-controls #chat-model-refresh:hover{background:#21436a}
.chat-controls #chat-model{min-width:0;max-width:100%}
@media(max-width:600px){
 .chat-workspace-panel .chat-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
 .chat-workspace-panel .chat-controls>label:first-child{grid-column:1 / -1}
 .chat-workspace-panel .chat-controls #chat-model{grid-column:1/-1;width:100%;min-width:0;font-size:16px}
 .chat-workspace-panel .chat-controls #chat-model-refresh{grid-column:1 / -1;width:100%}
 .chat-workspace-panel .chat-controls #chat-model-note{grid-column:1 / -1}
 .chat-workspace-panel .chat-controls .chat-stream-label{grid-column:1 / -1}
}


/* C25 Chat UX pilot: one chat scrollport, compact toolbar and accessible Markdown. */
.layout:has(#chat-workspace-panel.nav-active){height:100dvh;min-height:0;overflow:hidden}
.layout:has(#chat-workspace-panel.nav-active) .main{
  height:100dvh;min-height:0;min-width:0;display:flex;flex-direction:column;overflow:hidden
}
.layout:has(#chat-workspace-panel.nav-active) .main>header{flex:0 0 auto}
.layout:has(#chat-workspace-panel.nav-active) .workspace{
  flex:1 1 0;height:0;min-height:0;overflow:hidden;display:flex
}
.layout:has(#chat-workspace-panel.nav-active) .workspace-inner{
  width:min(1280px,100%);max-width:100%;height:100%;min-height:0;
  padding:12px clamp(12px,2.5vw,32px) 16px;
  display:flex;flex-direction:column;overflow:hidden
}
#chat-workspace-panel.nav-active{
  display:flex;flex:1 1 0;flex-direction:column;height:100%;min-height:0!important;
  gap:0;overflow:hidden;animation:none
}
#chat-workspace-panel .hero{flex:0 0 auto;margin:0;padding:4px 0 6px}
#chat-workspace-panel .hero .eyebrow,#chat-workspace-panel .hero p{display:none}
#chat-workspace-panel .hero h1{font-size:18px;line-height:1.35;margin:0;font-weight:700}
#chat-workspace-panel .chat-controls{
  flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:9px;
  padding:10px 0 13px;border-bottom:1px solid #273b55;margin:0
}
#chat-workspace-panel .chat-controls>label:first-child{display:none}
#chat-workspace-panel .chat-controls select{
  width:min(620px,100%);max-width:100%;min-width:180px;flex:1 1 420px;
  padding:9px 12px;min-height:40px
}
#chat-workspace-panel #chat-model-note{flex:1 1 100%;font-size:12px}
#chat-workspace-panel #chat-model-note[hidden],
#chat-workspace-panel #composer-note[hidden],
#chat-workspace-panel #chat-usage-details[hidden],
#chat-workspace-panel #chat-jump-latest[hidden]{display:none!important}
#chat-workspace-panel #chat-model-refresh{
  min-height:40px;padding:8px 12px;flex:0 0 auto
}
#chat-workspace-panel .chat-stream-label{flex:0 0 auto;margin:0}
#chat-workspace-panel .messages{
  flex:1 1 0;min-height:0!important;max-height:none!important;
  overflow-y:auto;overscroll-behavior:contain;padding:16px 8px 24px;
  scrollbar-gutter:stable;scrollbar-width:thin
}
#chat-workspace-panel .message{
  max-width:min(760px,88%);line-height:1.65;
  box-shadow:none;overflow-wrap:anywhere
}
#chat-workspace-panel .message.assistant{
  white-space:normal;background:transparent;border:0;padding:8px 12px;
  max-width:min(850px,100%);border-radius:12px;color:#e5effc
}
#chat-workspace-panel .message.assistant>:first-child{margin-top:0}
#chat-workspace-panel .message.assistant>:last-child{margin-bottom:0}
#chat-workspace-panel .message.assistant p{margin:0 0 11px;white-space:pre-wrap}
#chat-workspace-panel .message.assistant ul,
#chat-workspace-panel .message.assistant ol{margin:6px 0 12px;padding-left:24px}
#chat-workspace-panel .message.assistant li+li{margin-top:3px}
#chat-workspace-panel .message.assistant h3,
#chat-workspace-panel .message.assistant h4,
#chat-workspace-panel .message.assistant h5{font-size:14px;margin:12px 0 6px;line-height:1.5}
#chat-workspace-panel .message.assistant code{
  padding:2px 5px;border-radius:5px;background:#203451;
  font:0.92em/1.5 ui-monospace,SFMono-Regular,Consolas,monospace
}
#chat-workspace-panel .message.assistant pre{
  max-width:100%;overflow:auto;white-space:pre;
  background:#0b1628;border:1px solid #324a6a;padding:12px;
  border-radius:10px;margin:8px 0 14px
}
#chat-workspace-panel .message.assistant pre code{
  padding:0;background:transparent;white-space:pre;display:block
}
#chat-workspace-panel .chat-turn-details{
  margin:12px 0 0;border-top:1px solid #283c56;padding-top:8px;
  color:#8faed0;font-size:11px
}
#chat-workspace-panel .chat-turn-details summary{cursor:pointer}
#chat-workspace-panel .chat-turn-details small{
  display:block;margin-top:5px;overflow-wrap:anywhere
}
#chat-workspace-panel .chat-jump-latest{
  align-self:center;flex:0 0 auto;border-radius:100px;background:#233e60;
  color:#e4f0ff;border:1px solid #5475a0;padding:7px 15px;font-size:12px;
  margin:-42px 0 8px;z-index:3;box-shadow:0 6px 20px #0005
}
#chat-workspace-panel .composer{
  flex:0 0 auto;min-height:0;padding:9px 13px 10px;margin:5px 0 0;
  border-radius:16px;background:#142238;border-color:#3a5777;box-shadow:0 3px 24px #0002
}
#chat-workspace-panel .composer-head{display:none}
#chat-workspace-panel #prompt{
  resize:none;min-height:52px!important;max-height:min(24dvh,200px);
  padding:9px 3px 10px;line-height:1.5
}
#chat-workspace-panel .composer-footer{display:flex;align-items:center;justify-content:flex-end}
#chat-workspace-panel #send{width:auto;min-width:108px;min-height:39px;padding:9px 16px}
#chat-workspace-panel .chat-usage-details{
  margin-top:7px;padding-top:6px;border-top:1px solid #283d55
}
#chat-workspace-panel .chat-usage-details summary{
  cursor:pointer;color:#a8c8e9;font-size:11px
}
#chat-workspace-panel .chat-usage-details p{max-height:72px;overflow:auto;margin:7px 0 0}
@media(max-width:900px){
  .layout:has(#chat-workspace-panel.nav-active) .workspace-inner{padding:9px 12px 12px}
  #chat-workspace-panel .hero h1{font-size:16px}
}
@media(max-width:600px){
  #chat-workspace-panel .chat-controls{
    display:grid;grid-template-columns:minmax(0,1fr) auto;
    padding:6px 0 9px;gap:6px
  }
  #chat-workspace-panel .chat-controls select{
    grid-column:1/2;width:100%;min-width:0;font-size:14px;min-height:40px
  }
  #chat-workspace-panel #chat-model-refresh{
    grid-column:2/3;grid-row:1/2;min-width:40px;width:40px;overflow:hidden;
    white-space:nowrap;font-size:0
  }
  #chat-workspace-panel #chat-model-refresh::before{content:"↻";font-size:22px;line-height:1}
  #chat-workspace-panel .chat-controls .chat-stream-label{grid-column:1/-1}
  #chat-workspace-panel #chat-model-note{grid-column:1/-1}
  #chat-workspace-panel .message{max-width:94%}
  #chat-workspace-panel .message.assistant{max-width:100%}
  #chat-workspace-panel .messages{padding:10px 3px 18px}
  #chat-workspace-panel .composer{padding:8px 10px}
  #chat-workspace-panel #send{width:auto;min-height:38px}
}
@media(max-height:550px){
  #chat-workspace-panel .hero{display:none}
  #chat-workspace-panel .chat-controls{padding:4px 0 7px}
  #chat-workspace-panel #prompt{min-height:40px!important}
}

#chat-workspace-panel .chat-table-scroll{max-width:100%;overflow-x:auto;margin:8px 0 14px}
#chat-workspace-panel .chat-table-scroll table{width:max-content;min-width:65%;border-collapse:collapse;font-size:13px}
#chat-workspace-panel .chat-table-scroll th,
#chat-workspace-panel .chat-table-scroll td{border:1px solid #37516b;padding:8px 10px;text-align:left;white-space:normal}
#chat-workspace-panel .chat-table-scroll th{background:#1e334f}

/* C25 mobile grid: selector must outrank the legacy model grid span. */
@media(max-width:600px){#chat-workspace-panel .chat-controls #chat-model{grid-column:1/2;grid-row:1/2}}


/* C29: Token Analytics + Wallet — compact, responsive, contrast-safe. */
.insights-panel{max-width:1100px;width:100%;margin-inline:auto}
.insights-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;flex-wrap:wrap;margin-bottom:18px}
.insights-head strong{font-size:19px;letter-spacing:-.02em}
.insights-head .muted{margin-top:6px}
.insights-title{display:grid;gap:6px}
.insights-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.insights-controls button{width:auto;min-width:38px}
.insights-controls input[type=date]{width:155px;max-width:100%;min-width:0;min-height:37px}
.token-key-select{display:inline-block;width:auto;max-width:230px;min-width:120px;min-height:37px;box-sizing:border-box;background:#101a2a;color:#d6e7fb;border:1px solid #34445e;border-radius:10px;padding:7px 10px;font-size:12px}
.token-key-select:focus{border-color:#79adf5}
.token-key-breakdown{margin-top:14px}
.token-key-breakdown .key-usage-table tbody tr{cursor:pointer}
.token-key-breakdown .key-usage-table tbody tr:focus-visible{outline:2px solid #8abaff;outline-offset:-2px}
.insights-segment{display:flex;border:1px solid #34445e;padding:3px;border-radius:10px;gap:3px;background:#101a2a}
.insights-segment button{border:0;border-radius:7px;background:transparent;color:#aabbd0;padding:7px 12px;font-size:12px;min-width:40px}
.insights-segment button.active{color:#f2f6ff;background:#314766}
.insights-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:17px}
.insights-metric{padding:13px 15px;background:#121f30;border:1px solid #2e3b52;border-radius:12px;min-width:0}
.insights-metric .metric-label{color:#9daec7;font-size:12px}
.insights-metric .metric-number{color:#e7effc;font-weight:750;letter-spacing:-.025em;font-size:clamp(17px,2vw,23px);margin-top:6px;overflow-wrap:anywhere}
.insights-chart{background:#111923;border:1px solid #2a3749;border-radius:14px;padding:17px 18px}
.insights-chart .chart-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:7px}
.insights-chart .chart-heading strong{font-size:14px}
.insights-chart .chart-caption{font-size:11px;color:#a1acc0;margin:3px 0 16px}
.token-matrix{min-width:0;display:flex;flex-direction:column;gap:5px}
.token-xaxis,.token-gridrow{display:grid;grid-template-columns:67px minmax(0,1fr);align-items:center;column-gap:8px}
.token-axis-labels,.token-gridcells{display:grid;grid-template-columns:repeat(var(--token-cols),minmax(0,1fr));gap:3px}
.token-axis-label{min-width:0;font-size:10px;text-align:center;color:#a7b6cb;white-space:nowrap}
.token-hour-label{font-size:11px;white-space:nowrap;color:#a6b4c8}
.token-cell{min-width:0;aspect-ratio:1/1;min-height:10px;max-height:23px;padding:0;border:1px solid transparent;border-radius:4px;background:#232c39;cursor:pointer;transition:filter .12s ease,outline .12s ease}
.token-cell[data-level="1"]{background:#485774}
.token-cell[data-level="2"]{background:#647a9c}
.token-cell[data-level="3"]{background:#8197c3}
.token-cell[data-level="4"]{background:#9eafe0}
.token-cell[data-level="5"]{background:#b8caff}
.token-cell:hover{filter:brightness(1.3);border-color:#edf4ff}
.token-cell:focus-visible,.token-cell.selected{outline:2px solid #f0f4ff;outline-offset:1px}
.token-footer{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap;margin-top:17px;font-size:12px;color:#a9b8cc}
.token-legend{display:flex;gap:4px;align-items:center}
.token-legend span{font-size:11px;margin:0 3px}
.token-legend i{display:block;width:13px;height:13px;border-radius:4px;background:#232c39}
.token-legend i:nth-of-type(2){background:#485774}.token-legend i:nth-of-type(3){background:#647a9c}
.token-legend i:nth-of-type(4){background:#8197c3}.token-legend i:nth-of-type(5){background:#9eafe0}
.token-legend i:nth-of-type(6){background:#b8caff}
#token-selection{margin:14px 0 0;font-size:12px;color:#bfcde0;min-height:20px}
.insights-status{font-size:11px;color:#97aac4;margin:10px 0}
.wallet-balance-grid{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:11px;margin:16px 0}
.wallet-primary{background:linear-gradient(135deg,#17344b,#1e293f);border-color:#406584}
.wallet-primary .metric-number{font-size:clamp(21px,2.6vw,29px)}
.wallet-notice{border:1px solid #cc9553;background:#3c2d20;color:#ffddb0;padding:12px 14px;border-radius:10px;font-size:13px;margin:13px 0}
.wallet-section{margin-top:17px;padding:15px;border:1px solid #314057;border-radius:12px;background:#121f30}
.wallet-section strong{font-size:14px}
.wallet-section p{line-height:1.55}
.wallet-transactions{max-height:500px;overflow:auto;margin-top:12px}
.wallet-transaction{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:12px 2px;border-bottom:1px solid #2e3a50}
.wallet-transaction:last-child{border-bottom:0}
.wallet-transaction-main{min-width:0}
.wallet-tx-title{font-size:13px;color:#e8effa}
.wallet-tx-date{font-size:11px;color:#93a4bf;margin-top:4px;overflow-wrap:anywhere}
.wallet-tx-amount{font-size:13px;font-weight:700;white-space:nowrap}
.wallet-tx-amount.is-credit{color:#8eddb8}
.wallet-tx-amount.is-usage{color:#cbd4e6}
.wallet-empty{padding:24px;color:#9badc5;font-size:12px;text-align:center}
@media(max-width:750px){
  .insights-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wallet-balance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wallet-primary{grid-column:1/-1}
  .insights-chart{padding:12px 9px}
  .token-xaxis,.token-gridrow{grid-template-columns:42px minmax(0,1fr);column-gap:5px}
  .token-hour-label,.token-axis-label{font-size:9px}
  .token-gridcells,.token-axis-labels{gap:2px}
  .token-cell{border-radius:3px}
}
@media(max-width:460px){
  .insights-metrics{gap:7px}
  .insights-metric{padding:10px 11px}
  .insights-controls input[type=date]{width:135px}
  .insights-segment button{padding:7px 9px}
  .token-hour-label,.token-axis-label{font-size:8px}
  .token-xaxis,.token-gridrow{grid-template-columns:34px minmax(0,1fr)}
  .token-gridcells,.token-axis-labels{gap:1.5px}
}

.token-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;padding:4px 2px 7px}
.wallet-global-notice{margin:12px clamp(12px,3vw,26px) 0}
@media(max-width:700px){
 .token-matrix[data-view="month"]{min-width:590px}
 .token-matrix[data-view="day"]{min-width:530px}
}


/* Multiple self-managed API keys: accessible table and safe high-contrast controls */
#api-key-panel .key-list{margin:10px 0 18px;min-width:0}
#api-key-panel .key-list-scroll{overflow-x:auto;border:1px solid #34516e;border-radius:12px;background:#0d1b2e}
#api-key-panel .key-table{width:100%;min-width:660px;border-collapse:collapse;color:#e8f0fe;font-size:13px}
#api-key-panel .key-table th{background:#1c3048;text-align:left;color:#dae9fc;font-weight:700}
#api-key-panel .key-table th,#api-key-panel .key-table td{padding:12px 13px;vertical-align:middle;border-bottom:1px solid #344863}
#api-key-panel .key-table tbody tr:last-child td{border-bottom:0}
#api-key-panel .key-table .key-select-revoke{padding:8px 12px;min-height:34px;white-space:nowrap}
#api-key-panel .key-field select option{background-color:#102138;color:#f3f7ff}


/* C31 Pilot Model Administration — dedicated, explicitly authorized navigation. */
#model-admin-panel{color:#e6f0fd;max-width:100%;min-width:0}
#model-admin-panel h2{font-size:22px;margin:3px 0 8px}
#model-admin-panel h3{font-size:16px;margin:0 0 12px}
.model-admin-head{display:flex;gap:14px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
.model-admin-head .muted{margin:5px 0;max-width:680px}
.model-admin-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}
.model-admin-stats>div{background:#10243c;border:1px solid #294667;border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:3px}
.model-admin-stats strong{font-size:25px;font-weight:700;color:#e4f3ff;font-variant-numeric:tabular-nums}
.model-admin-stats span{color:#9db8d7;font-size:12px}
.model-admin-inventory{background:#102037;border:1px solid #2a4565;border-radius:14px;padding:16px}
.model-admin-list{display:grid;gap:9px;margin-top:14px}
.model-admin-row{border:1px solid #2b4968;background:#14273e;border-radius:10px;padding:12px;display:flex;justify-content:space-between;gap:12px;align-items:center}
.model-admin-model{min-width:0;display:flex;flex-direction:column;gap:3px;overflow-wrap:anywhere}
.model-admin-model strong{font-size:14px}
.model-admin-model small{font-size:12px}
.model-admin-flags{display:flex;align-items:flex-end;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.model-admin-flags span{font-size:11px;font-weight:700;border-radius:999px;padding:5px 9px}
.model-admin-flags .ready{color:#9fe5c1;background:#153c32;border:1px solid #286f59}
.model-admin-flags .idle,.model-admin-flags .quiet{color:#b8cce5;background:#203450;border:1px solid #395375}
.model-admin-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}
.model-admin-controls form{min-width:0;background:#101f33;border:1px solid #294462;border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:9px}
.model-admin-controls label{font-size:12px;color:#b4cbe8;display:flex;flex-direction:column;gap:5px}
.model-admin-controls input,.model-admin-controls select{width:100%;min-width:0;border:1px solid #405d7b;border-radius:9px;padding:10px 11px;background:#122b49;color:#eef7ff;color-scheme:dark}
.model-admin-controls select option{background-color:#122b49;color:#eef7ff}
.model-admin-controls input:focus-visible,.model-admin-controls select:focus-visible{outline:2px solid #79afff;outline-offset:1px}
.model-admin-controls button{margin-top:7px;min-height:42px}
.model-admin-controls button:disabled{opacity:.55;cursor:wait}
.model-admin-plan-output{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;max-height:260px;background:#0b192c;color:#c9dff5;border:1px solid #2e4968;border-radius:9px;padding:12px;min-height:50px}
#model-admin-notice{min-height:22px;overflow-wrap:anywhere}
@media(max-width:720px){.model-admin-controls{grid-template-columns:1fr}.model-admin-row{align-items:flex-start;flex-direction:column}.model-admin-flags{justify-content:flex-start}.model-admin-head button{width:100%}}


/* Guided model setup — compact, keyboard-friendly and theme-aware. */
.model-simple-toolbar{display:flex;align-items:end;gap:12px;justify-content:space-between;margin:16px 0}
.model-simple-toolbar label{display:flex;flex:1;max-width:600px;flex-direction:column;gap:6px;font-weight:600;font-size:12px;color:#acc6e3}
.model-simple-toolbar input{width:100%;background:#142b47;border:1px solid #3e5b79;border-radius:10px;color:#eaf4ff;padding:11px 13px}
.model-simple-toolbar button{min-height:44px;white-space:nowrap}
.model-simple-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:10px}
.model-simple-card{text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:4px;border-radius:12px;border:1px solid #344b69;background:#12243a;padding:16px;min-height:120px;color:#eaf2ff;transition:border-color .16s,background .16s}
.model-simple-card:hover{border-color:#78a4e2;background:#1a314e}
.model-simple-card.selected{border-color:#68a8ff;background:#203b5f;box-shadow:inset 3px 0 #83b9ff}
.model-simple-card:focus-visible{outline:2px solid #92c7ff;outline-offset:2px}
.model-simple-card-name{font-size:15px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
.model-simple-card-id{font-size:11px;color:#adc5e1;overflow-wrap:anywhere;flex:1}
.model-simple-tag{font-size:11px;color:#bcd3f1;border:1px solid #466183;padding:4px 9px;border-radius:999px}
.model-simple-tag.ready{color:#9ae9bb;border-color:#36775c;background:#173e32}
.model-simple-tag.downloading{color:#ffcf93;border-color:#987341;background:#453322}
.model-simple-tag.failed{color:#ffc6b8;border-color:#8e4b46;background:#4a292e}
.model-simple-tag.staged{color:#c2dcff;border-color:#476eaa;background:#243b65}
.model-simple-detail{border:1px solid #365b82;border-radius:14px;background:#11253d;padding:clamp(13px,2vw,22px);margin-top:16px}
.model-simple-detail-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.model-simple-detail-head h3{margin:3px 0 0!important;font-size:18px!important;overflow-wrap:anywhere}
.model-simple-detail-head p{margin:5px 0}
.model-simple-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:18px 0 12px}
.model-simple-steps span{min-width:0;padding:9px 6px;border:1px solid #36516c;border-radius:8px;text-align:center;font-size:12px;color:#a6bad5;background:#0d1c2e}
.model-simple-steps span.completed{background:#163729;color:#9ae0b2;border-color:#2c6d4a}
.model-simple-steps span.current{background:#203e65;border-color:#6a9edb;color:#e5f3ff;font-weight:700}
.model-simple-guidance{font-size:13px;color:#bfdbf5;line-height:1.6;overflow-wrap:anywhere;margin:12px 0}
.model-simple-actions{display:flex;gap:10px;flex-wrap:wrap}
.model-simple-actions button{min-height:43px}
.model-simple-progress{margin:12px 0}
.model-simple-progress-track{width:100%;height:9px;border-radius:999px;background:#2b4563;overflow:hidden}
#model-simple-progress-fill{height:100%;width:0;background:#72afe7;border-radius:999px;transition:width .4s}
.model-simple-technical{margin-top:15px;border-radius:12px;border:1px solid #314c69;background:#102035;padding:10px 14px}
.model-simple-technical>summary{cursor:pointer;color:#bad2ef;font-weight:600;padding:8px 1px;outline-offset:4px}
.model-simple-technical[open]>summary{margin-bottom:12px;border-bottom:1px solid #30445f}
.model-simple-technical .model-admin-controls{margin-top:12px}
.model-simple-technical .model-admin-inventory{background:#101f33}
@media(max-width:650px){.model-simple-toolbar{align-items:stretch;flex-direction:column}.model-simple-steps{grid-template-columns:repeat(2,1fr)}.model-simple-actions button{flex:1}.model-simple-card{min-height:104px}}


/* C34 verifiable staged model state. */
.model-simple-tag.verifying{color:#ffd394;border-color:#977443;background:#463722}
.model-simple-tag.verified{color:#a4e5c0;border-color:#327655;background:#143e30}
.model-simple-tag.verify-failed{color:#ffc2c2;border-color:#a04b58;background:#4b2934}
.model-simple-progress-track{background:#233e5b}
#model-simple-progress-fill{background:#7fb4f7}


/* Curated quantization alternatives: show size and provenance, not fake readiness. */
.quant-suggestions{margin:16px 0 20px}
.quant-recommendation-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:10px;margin:12px 0}
.quant-candidate{border:1px solid #3b5878;border-radius:12px;padding:15px;background:#13273d;min-width:0;display:flex;flex-direction:column;gap:8px}
.quant-candidate-head{display:flex;align-items:flex-start;gap:10px;justify-content:space-between}
.quant-candidate-head strong{font-size:14px;overflow-wrap:anywhere}
.quant-candidate-head .model-simple-tag{white-space:nowrap}
.quant-candidate-role{font-weight:600;color:#bfdcff;margin:0;font-size:13px}
.quant-candidate p.muted{margin:0;line-height:1.5}
.quant-candidate-actions{display:flex;align-items:center;gap:14px;margin-top:auto;padding-top:8px}
.quant-candidate-actions button{min-height:39px;font-size:12px}
.quant-candidate-actions a{font-size:12px;color:#9ed3ff;text-decoration:underline;text-underline-offset:3px}
.quant-candidate-actions a:focus-visible{outline:2px solid #9ed3ff;outline-offset:4px}
@media(max-width:600px){.quant-candidate-head{flex-wrap:wrap}.quant-candidate-actions{flex-wrap:wrap}}


/* GENIVE Speech Studio — compact, mobile responsive, dark/light legibility. */
.speech-studio{min-width:0}
.speech-heading{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:flex-start}
.speech-heading h2{font-size:22px;margin:4px 0}
.speech-thai{font-weight:400;font-size:16px;color:#acc6e3}
.speech-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;margin-top:20px}
.speech-workspace form,.speech-result{display:flex;flex-direction:column;gap:12px;border-radius:14px;border:1px solid #2e4967;background:#14283f;padding:16px;min-width:0}
.speech-workspace label{font-size:14px;font-weight:650}
.speech-workspace input[type=file]{padding:12px;border-radius:10px;max-width:100%;border:1px dashed #6485ad;color:#e1efff;background:#0e2034}
.speech-workspace button{min-height:42px}
.speech-workspace button:disabled{opacity:.5;cursor:not-allowed}
.speech-result h3{font-size:16px;margin:0}
.speech-result .row{display:flex;justify-content:space-between;gap:10px}
.speech-result p{font-size:13px;color:#b9d0eb;margin:0}
.speech-output{flex:1;min-height:135px;background:#0d1e31;padding:14px;border-radius:10px;border:1px solid #314968;color:#e1efff;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
@media(max-width:760px){.speech-workspace{grid-template-columns:1fr}}

.ai-services-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:10px;margin:12px 0}
.ai-service-item{display:flex;flex-direction:column;gap:8px;border:1px solid #314e70;border-radius:10px;padding:12px;background:#12243a}
.ai-service-item strong{font-size:13px;color:#e0f0ff}
.ai-service-item small{color:#abc3de;line-height:1.5;overflow-wrap:anywhere}
.ai-service-item .model-simple-tag{align-self:flex-start}

/* C38: compact STT job status and recent-job controls. */
.stt-job-list{display:grid;gap:6px;max-height:190px;overflow-y:auto;min-width:0}
.stt-job-list .stt-job-item{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px;text-align:left;font-size:12px;padding:8px 10px;min-width:0}
.stt-job-item strong{font-weight:650;overflow-wrap:anywhere}
.stt-job-item span{white-space:nowrap;opacity:.84}
@media(max-width:480px){.stt-job-item{flex-wrap:wrap}.stt-job-item span{white-space:normal}}

/* C39 Thai TTS evaluation controls */
.tts-eval-panel{display:flex;flex-direction:column;gap:12px;margin-top:16px;border:1px solid #385676;background:#14283f;padding:16px;border-radius:14px;min-width:0}
.tts-eval-panel .row{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.tts-eval-panel h3{font-size:16px;margin:0}
.tts-eval-panel textarea{width:100%;max-width:100%;background:#0e2034;border:1px solid #6485ad;border-radius:10px;padding:10px;color:#e1efff;min-height:80px}
.tts-eval-panel audio{width:100%;max-width:100%}
.tts-eval-panel button{min-height:40px}

/* C40 image and video private admission studio. */
.media-studio{min-width:0}
.media-studio-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.media-studio-head h2,.media-studio-head h3{margin:5px 0}
.media-studio-stats{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.media-studio-stats span{background:#14283f;border:1px solid #335470;color:#d5e6f8;padding:9px 12px;border-radius:9px;font-size:12px}
.media-plan-form{display:flex;flex-direction:column;gap:10px;max-width:760px;min-width:0;padding:16px;background:#14283f;border:1px solid #335470;border-radius:14px}
.media-plan-form label{font-weight:650;font-size:13px}
.media-plan-form textarea,.media-plan-form select{background:#0d2034!important;color:#edf6ff!important;border:1px solid #567a9b;border-radius:9px;padding:10px;max-width:100%;min-width:0}
.media-plan-form select option{background:#0d2034!important;color:#edf6ff!important}
.media-plan-dimensions,.media-form-actions{display:flex;flex-wrap:wrap;gap:12px}
.media-plan-dimensions label{display:flex;align-items:center;gap:8px}
.media-form-actions button{min-height:40px}
.media-plan-result{display:flex;flex-direction:column;gap:10px;margin:12px 0}
.media-plan-result li{margin-bottom:5px}
.media-drafts-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:8px}
.media-draft-card{display:flex;flex-direction:column;gap:6px;border:1px solid #335470;border-radius:9px;background:#14283f;padding:12px;min-width:0}
.media-draft-card small{color:#bbcee6}

.media-plan-dimensions[hidden],#media-video-options[hidden]{display:none!important}


/* C46 consolidated launch workflow. Keep secondary diagnostics collapsed. */
#model-admin-panel .model-admin-stats{display:none}
.model-launch-flow{margin-top:18px;border-top:1px solid #355674;padding-top:18px}
.model-launch-flow[hidden],.model-launch-approval[hidden],#model-launch-key-wrap[hidden],
.model-launch-test-result[hidden]{display:none!important}
.model-launch-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:13px}
.model-launch-header h3{margin:3px 0 4px!important;font-size:18px!important}
.model-launch-header p{margin:2px 0}
.model-launch-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
.model-launch-stage{background:#102238;border:1px solid #36516e;border-radius:12px;padding:16px;min-width:0;display:flex;flex-direction:column;gap:12px}
.model-launch-stage-top{display:flex;align-items:flex-start;gap:11px;min-height:56px}
.model-launch-stage-top h4{margin:0 0 4px;color:#eaf3ff;font-size:15px;line-height:1.4}
.model-launch-stage-top p{margin:0;font-size:12px;line-height:1.5}
.model-launch-num{flex:0 0 auto;width:28px;height:28px;display:grid;place-items:center;border:1px solid #54749d;border-radius:8px;color:#bcd7fd;font-weight:700;font-size:12px}
.model-launch-stage label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:#bcd2ec}
.model-launch-stage input:not([type=checkbox]),.model-launch-stage select{width:100%;min-width:0;background:#122d4a;border:1px solid #426486;border-radius:9px;padding:11px 10px;color:#eef7ff;color-scheme:dark}
.model-launch-stage select option{background:#122d4a;color:#eef7ff}
.model-launch-stage input:focus-visible,.model-launch-stage select:focus-visible{outline:2px solid #81b4fa;outline-offset:2px}
.model-launch-rate-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.model-launch-stage button{min-height:40px;min-width:0;width:100%;border-radius:9px}
.model-launch-stage button:disabled{opacity:.54;cursor:not-allowed}
.model-launch-approval{margin-top:12px;border-top:1px solid #37506d;padding-top:12px;display:flex;flex-direction:column;gap:9px}
.model-launch-approval strong{overflow-wrap:anywhere}
.model-launch-inline{display:flex!important;flex-direction:row!important;gap:8px!important;align-items:center}
.model-launch-inline input{width:16px;height:16px}
.model-launch-test-result{padding:11px 12px;background:#102f40;border:1px solid #37647a;border-radius:10px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7}
.model-launch-wallet{margin-top:12px;padding:9px 12px;background:#122842;border-radius:10px;border:1px solid #335374}
#model-launch-feedback{min-height:21px;margin-top:14px;overflow-wrap:anywhere}
@media(max-width:1150px){.model-launch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.model-launch-grid>:last-child{grid-column:1/-1}}
@media(max-width:700px){.model-launch-grid{grid-template-columns:1fr}.model-launch-grid>:last-child{grid-column:auto}.model-launch-header{align-items:flex-start}.model-launch-rate-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:370px){.model-launch-rate-row{grid-template-columns:1fr}}

/* C48: focused Model Control Center, advanced workflows stay collapsed. */
#model-admin-panel .model-center-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0 16px}
.model-center-summary>div{padding:16px 18px;border:1px solid #324a65;background:#10243b;border-radius:13px;display:flex;flex-direction:column;gap:4px;min-width:0}
.model-center-summary span{color:#a9c2db;font-size:12px}
.model-center-summary strong{font-size:25px;font-weight:750;font-variant-numeric:tabular-nums;color:#f1f7ff}
.model-center-summary small{font-size:11px;color:#93adc9;overflow-wrap:anywhere}
.model-center-toolbar{display:flex;gap:10px;align-items:center;margin:14px 0}
.model-center-search{flex:1;min-width:0}
.model-center-search input{width:100%;min-width:0;padding:12px 15px;border-radius:10px;border:1px solid #415b79;background:#10233a;color:#f1f7ff;font:inherit}
.model-center-search input:focus-visible,.model-center-filters button:focus-visible,.model-center-action:focus-visible{outline:2px solid #8dbffd;outline-offset:2px}
#model-center-add{white-space:nowrap;min-height:42px}
.model-center-filters{display:flex;gap:5px;overflow-x:auto;margin-bottom:15px;padding-bottom:3px}
.model-center-filters button{background:transparent;color:#9eb7d3;border:1px solid transparent;padding:7px 13px;border-radius:9px;white-space:nowrap;font-size:12px;font-weight:650}
.model-center-filters button[aria-pressed=true]{color:#dcecff;background:#1c3b5e;border-color:#416b9a}
.model-center-list{display:grid;gap:10px}
.model-center-row{display:flex;gap:14px;align-items:center;justify-content:space-between;padding:15px 17px;border:1px solid #2c4766;background:#12263c;border-radius:13px;min-width:0}
.model-center-main{display:flex;gap:11px;align-items:flex-start;min-width:0;flex:1}
.model-center-icon{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:10px;background:#203a56;color:#b9d9fc;font-size:16px;font-weight:bold}
.model-center-details{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}
.model-center-name{font-size:14px;color:#e9f2ff;line-height:1.35;overflow-wrap:anywhere}
.model-center-id{font-size:11px;color:#a0bad6;overflow-wrap:anywhere}
.model-center-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:#9db5d2}
.model-center-progress{width:min(230px,100%);height:5px;background:#2b4460;border-radius:6px;overflow:hidden}
.model-center-progress>div{height:100%;background:#83bafe;transition:width .4s}
.model-center-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;justify-content:flex-end;min-width:180px}
.model-center-action{border:1px solid #45627f;color:#d8ebff;background:#1b354f;border-radius:9px;padding:9px 12px;min-height:36px;font-size:12px;font-weight:650;white-space:nowrap}
.model-center-action:hover:not(:disabled){background:#254663;border-color:#8dbffd}
.model-center-action.primary{background:#244b75;border-color:#4c89cd;color:#fff}
.model-center-action.danger{border-color:#714856;color:#f6babe;background:#352431}
.model-center-action:disabled{opacity:.4;cursor:not-allowed}
.model-center-pill{border:1px solid #4c6685;border-radius:99px;padding:3px 8px;font-size:10px;font-weight:700}
.model-center-pill.live{color:#a3e8bb;border-color:#3c8660;background:#16382d}
.model-center-pill.pending{color:#f5cf8d;border-color:#8a6a34;background:#3c3023}
.model-center-pill.idle{color:#b8cee8;border-color:#415c7e;background:#1a2c45}
.model-center-empty{padding:30px;border:1px dashed #46617a;text-align:center;border-radius:12px;color:#a9bed9}
.model-center-advanced{margin-top:18px}
.model-center-advanced>summary{font-size:12px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:760px){
 #model-admin-panel .model-center-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
 .model-center-summary>div:last-child{grid-column:1/-1}
 .model-center-row{align-items:stretch;flex-direction:column}
 .model-center-actions{min-width:0;justify-content:flex-start}
 .model-center-toolbar{flex-wrap:wrap}
 .model-center-search{flex-basis:100%}
 #model-center-add{width:100%}
}

.model-center-dialog{border:1px solid #486685;background:#11263d;color:#eef5ff;
 border-radius:16px;box-shadow:0 24px 80px rgba(0,0,0,.58);padding:24px;
 width:min(440px,calc(100vw - 30px));max-width:100%;max-height:85vh;overflow:auto}
.model-center-dialog::backdrop{background:rgba(3,10,20,.76)}
.model-center-dialog h3{font-size:19px!important;margin:0 0 10px!important}
.model-center-dialog form{display:flex;flex-direction:column;gap:15px}
.model-center-dialog label{display:flex;flex-direction:column;gap:8px;font-size:12px;font-weight:650;color:#bbd2ec}
.model-center-dialog input,.model-center-dialog select{width:100%;min-height:42px;color:#eff7ff;background:#182e48;
 border:1px solid #446789;border-radius:9px;padding:10px;font:inherit;color-scheme:dark}
.model-center-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.model-center-dialog-actions button{min-height:40px;padding:9px 15px}

.model-center-inline-error{margin:4px 0 0;color:#ffbfc3;background:#422632;border-left:3px solid #df7c87;border-radius:5px;padding:8px 10px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}

/* C50: actionable model manager, no hidden price/worker steps */
.model-center-manager{width:min(570px,calc(100vw - 30px))}
#model-center-manage-content{display:flex;flex-direction:column;gap:9px;padding:12px 0;color:#d6e9ff;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.model-center-manager #model-center-quick-price{display:flex;flex-direction:column;gap:12px}
.model-center-manager #model-center-quick-price[hidden],#model-center-stop-wrap[hidden]{display:none!important}
.model-center-price-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.model-center-price-fields label{display:flex;flex-direction:column;gap:6px;color:#bbd2ec;font-size:12px}
.model-center-confirm-check{display:flex;align-items:center;gap:9px;margin-top:12px;color:#ffce9f;font-size:12px}
.model-center-confirm-check input{width:18px;height:18px}
.model-center-manager .model-center-dialog-actions{border-top:1px solid #344d69;padding-top:14px;margin-top:15px}
@media(max-width:560px){.model-center-price-fields{grid-template-columns:1fr}}

.model-center-activation-running{margin:5px 0 0;color:#b2ddff;background:#173652;padding:7px 9px;border-left:3px solid #70b5f0;border-radius:6px;font-size:12px}

/* C59 private CPU image pilot */
.media-cpu-results { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border, rgba(130,145,170,.27)); border-radius: 1rem; }
.media-cpu-image { width: min(100%, 512px); height: auto; aspect-ratio: 1; object-fit: contain; display: block; margin: .8rem auto; border-radius: .75rem; }
.media-cpu-image[hidden] { display:none; }

/* C61 technical video CPU Pilot output */
.media-cpu-video { width: min(100%, 512px); height: auto; aspect-ratio: 1;
    margin: .8rem auto; border-radius: .75rem; background: #080c16; display:block; }
.media-cpu-video[hidden] { display: none; }

/* C62 restart-safe encrypted Pilot queue controls */
.media-cpu-job-row{display:flex;align-items:center;gap:.5rem;min-width:0;flex-wrap:wrap;margin:.35rem 0}
.media-cpu-job-row>.stt-job-item{flex:1 1 15rem;min-width:0}
.media-cpu-job-row>button.soft{flex:0 0 auto}


/* One-click model lifecycle. Advanced controls stay accessible, but secondary. */
.model-center-more{position:relative;display:inline-flex;flex-direction:column;align-self:center;min-width:110px}
.model-center-more>summary{cursor:pointer;list-style:none;padding:9px 11px;border:1px solid #476484;border-radius:8px;color:#bcd9f7;font-size:12px;text-align:center}
.model-center-more>summary::-webkit-details-marker{display:none}
.model-center-more[open]{background:#14263b;border-radius:8px;z-index:3}
.model-center-more[open]>.model-center-action{margin:3px}
