:root{color-scheme:light;--ink:#172239;--muted:#7d879b;--line:#e8ebf2;--canvas:#f5f7fb;--white:#fff;--primary:#5367e8;--primary-dark:#4053ce;--primary-soft:#edf0ff;--green:#21865b;--shadow:0 14px 40px rgba(33,47,87,.08);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;min-width:320px;color:var(--ink);background:var(--canvas);font-size:15px}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}.muted{color:var(--muted)}
/* Login */
.login-view{min-height:100vh;display:grid;place-items:center;padding:28px;position:relative;overflow:hidden;background:radial-gradient(circle at 13% 15%,#e6eaff 0,transparent 31%),radial-gradient(circle at 87% 85%,#dff4ee 0,transparent 28%),#f6f8fc}.login-card{width:min(100%,470px);padding:48px;border:1px solid rgba(255,255,255,.8);border-radius:22px;background:rgba(255,255,255,.94);box-shadow:0 24px 80px rgba(35,50,98,.12);position:relative;z-index:1;backdrop-filter:blur(12px)}.brand-mark{width:54px;height:54px;display:grid;place-items:center;border-radius:17px;color:#fff;background:linear-gradient(140deg,#7383ff,#4a5edb);font-size:27px;font-weight:800;box-shadow:0 8px 20px rgba(83,103,232,.25)}.eyebrow{margin:29px 0 8px;color:var(--primary);font-size:12px;letter-spacing:.12em;font-weight:800}h1{margin:0;font-size:34px;letter-spacing:-.04em}.login-subtitle{margin:9px 0 25px;font-size:16px}.form-stack{display:grid;gap:19px}.form-stack label,.field-label{display:grid;gap:8px;color:#4a556c;font-size:14px;font-weight:700}input,select{width:100%;height:49px;padding:0 15px;color:var(--ink);border:1px solid #dfe3ec;border-radius:10px;outline:none;background:#fff;transition:border-color .15s,box-shadow .15s;font-size:15px}textarea{width:100%;min-height:70px;padding:11px 13px;color:var(--ink);border:1px solid #dfe3ec;border-radius:10px;outline:none;background:#fff;resize:vertical;font-size:14px}input:focus,select:focus,textarea:focus{border-color:#8794f1;box-shadow:0 0 0 3px rgba(83,103,232,.12)}input::placeholder,textarea::placeholder{color:#b1b8c6}.button{min-height:46px;padding:0 18px;border:0;border-radius:10px;font-size:14px;font-weight:750;transition:transform .15s,background .15s,box-shadow .15s}.button:hover{transform:translateY(-1px)}.button:disabled{opacity:.6;cursor:wait;transform:none}.button.primary{color:#fff;background:var(--primary);box-shadow:0 7px 15px rgba(83,103,232,.2)}.button.primary:hover{background:var(--primary-dark)}.button.secondary{color:#4254c9;background:var(--primary-soft)}.button.ghost{color:#4b5873;background:#f1f3f8}.button.danger-ghost{color:#a84c4c;background:#fff0f0}.button.danger-ghost:hover{background:#ffe5e5}.button.full-width{display:flex;align-items:center;justify-content:space-between;width:100%;height:52px;margin-top:2px}.form-error{min-height:16px;margin:-5px 0 -9px;color:#bf4545;font-size:13px}.login-foot{display:flex;align-items:center;gap:8px;margin-top:28px;padding-top:18px;color:#8d96a8;font-size:13px;border-top:1px solid var(--line)}.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#45b884;box-shadow:0 0 0 3px rgba(69,184,132,.12)}.login-decoration{width:260px;height:260px;position:absolute;border:1px solid rgba(83,103,232,.12);border-radius:50%}.decoration-one{left:4%;top:10%}.decoration-two{right:3%;bottom:5%;width:330px;height:330px;border-color:rgba(33,134,91,.13)}
/* App shell */
.nav-item {text-decoration:none}
.nav-count:empty {display:none}
.app-shell{display:flex;min-height:100vh}.sidebar{width:260px;min-width:260px;display:flex;flex-direction:column;padding:24px 17px 17px;background:#fff;border-right:1px solid var(--line)}.brand{display:flex;align-items:center;gap:13px;padding:4px 9px 30px;color:inherit;text-decoration:none}.brand-mark.small{width:43px;height:43px;border-radius:13px;font-size:21px}.brand strong{display:block;font-size:16px;letter-spacing:.02em}.brand small{display:block;margin-top:3px;color:#9aa2b2;font-size:9px;letter-spacing:.06em}.main-nav{display:grid;gap:6px}.nav-section-label{margin:5px 10px 7px;color:#a3aab8;font-size:12px;font-weight:800;letter-spacing:.09em}.platform-label{margin-top:25px}.nav-item{width:100%;min-height:47px;display:flex;align-items:center;gap:13px;padding:0 11px;border:0;border-radius:9px;color:#6d7890;background:transparent;text-align:left;font-size:14px;font-weight:650}.nav-item:hover{color:var(--primary);background:#f7f8ff}.nav-item.active{color:#4559d5;background:var(--primary-soft)}.nav-icon{width:21px;text-align:center;font-size:20px;line-height:1}.nav-count{margin-left:auto;min-width:24px;padding:3px 6px;border-radius:20px;color:#6c7890;background:#f0f2f7;text-align:center;font-size:11px}.sidebar-bottom{margin-top:auto}.sidebar-help{display:flex;align-items:center;gap:10px;padding:13px 10px;background:#f7f8fc;border-radius:11px}.help-icon{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;color:#6977cf;background:#e8ebff;font-size:12px;font-weight:800}.sidebar-help strong{display:block;font-size:12px}.sidebar-help small{display:block;margin-top:4px;color:#9099aa;font-size:10px}.sidebar-version{margin:12px 4px 0;color:#aeb4c0;font-size:10px;text-align:center}.main-area{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between;padding:0 36px;background:#fff;border-bottom:1px solid var(--line)}.breadcrumb{display:flex;align-items:center;gap:12px;color:#a0a8b7;font-size:13px}.breadcrumb strong{color:#33405a;font-size:14px}.crumb-sep{color:#d1d5df}.topbar-right{display:flex;align-items:center;gap:19px}.environment-pill{display:flex;align-items:center;gap:7px;color:#758198;font-size:12px}.user-chip{display:flex;align-items:center;gap:8px;padding-left:17px;border-left:1px solid var(--line)}.avatar{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;color:#fff;background:linear-gradient(135deg,#8c98f6,#6171e1);font-size:14px;font-weight:800;text-transform:uppercase}.user-chip-name{color:#33405a;font-size:13px;font-weight:700}.role-tag{padding:4px 7px;border-radius:6px;color:#596bd3;background:#f0f2ff;font-size:11px}.icon-button{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:8px;color:#7e899c;background:transparent;font-size:21px}.icon-button:hover{color:#cf5353;background:#fff0f0}.mobile-menu{display:none}.content-area{width:min(100%,1240px);flex:1;margin:0 auto;padding:38px 38px 40px}.page-footer{padding:0 38px 20px;color:#aab1bf;font-size:11px}.page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:27px}.page-heading h1{font-size:27px}.page-heading p{margin:7px 0 0;color:var(--muted);font-size:14px}
/* Panels */
.panel,.stat-card{border:1px solid #edf0f5;border-radius:14px;background:#fff;box-shadow:0 4px 16px rgba(35,48,87,.025)}.panel{margin-top:16px;padding:23px}.panel-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.panel h2{margin:0;color:#27344c;font-size:16px}.panel-subtitle{margin:6px 0 0;color:#9aa3b2;font-size:12px}.overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px}.stat-card{min-height:148px;padding:20px 22px;position:relative;overflow:hidden}.stat-label{display:flex;align-items:center;gap:10px;color:#8791a5;font-size:13px;font-weight:650}.stat-icon{width:31px;height:31px;display:grid;place-items:center;border-radius:9px;color:#6172e5;background:#f0f2ff;font-size:16px}.stat-value{margin-top:15px;color:#1c2942;font-size:29px;font-weight:800;letter-spacing:-.03em}.stat-unit{color:#929bb0;font-size:14px;font-weight:650}.stat-value-compact,.stat-value-muted{font-size:24px}.stat-value-muted{color:#a2aaba}.stat-note{margin-top:4px;color:#a1a9b7;font-size:12px}.account-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;margin-top:17px}.detail-item{padding:13px 0;border-top:1px solid #f0f2f6}.detail-label{color:#98a1b1;font-size:12px}.detail-value{margin-top:6px;color:#36435c;font-size:14px;font-weight:650;overflow-wrap:anywhere}.uuid-value{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}.role-pill{display:inline-flex;padding:5px 9px;border-radius:6px;color:#66748b;background:#f1f3f7;font-size:11px}.role-pill.admin{color:#596ad3;background:#eef0ff}.callout{display:flex;align-items:flex-start;gap:12px;margin-top:16px;padding:14px 15px;border:1px solid #e9edff;border-radius:11px;background:#f8f9ff}.callout-icon{width:23px;height:23px;display:grid;place-items:center;border-radius:7px;color:#586bd8;background:#ecefff;font-size:12px;font-weight:800}.callout strong{display:block;color:#4b5ab4;font-size:13px}.callout p{margin:5px 0 0;color:#8590a7;font-size:12px;line-height:1.65}
/* Users, forms, modal */
.settings-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr);gap:16px;align-items:start}.settings-panel{padding:24px}.settings-panel .form-stack{margin-top:20px;gap:14px}.settings-panel .button{justify-self:start;min-width:130px}.setting-hint{margin-top:16px;color:#9ba3b1;font-size:12px;line-height:1.7}.compact-form{margin-top:12px;padding-top:14px;border-top:1px solid #f0f2f6}.compact-form .button{justify-self:start;min-width:120px}.users-toolbar{display:flex;align-items:center;gap:11px}.search-input{width:280px;height:44px;font-size:14px}.table-wrap{width:100%;margin-top:17px;overflow-x:hidden}.data-table{width:100%;border-collapse:collapse;table-layout:fixed;text-align:left}.data-table th{padding:14px 13px;color:#9aa3b3;background:#fafbfe;font-size:12px;font-weight:750}.data-table td{padding:15px 13px;color:#526078;border-bottom:1px solid #f0f2f6;font-size:13px;overflow-wrap:anywhere}.account-cell{display:flex;align-items:center;gap:11px}.table-avatar{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;color:#6171d7;background:#eff1ff;font-size:13px;font-weight:800}.table-account-name{color:#35415a;font-size:14px;font-weight:750}.user-identity{min-width:0;display:grid;gap:4px}.user-identity .uuid-cell{max-width:220px;color:#929bad;font-size:10px!important;overflow-wrap:anywhere;word-break:break-all}.account-subline{color:#7d899d;font-size:11px}.balance-cell{color:#35415a!important;font-weight:750}.uuid-cell{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.user-disabled-row td{color:#9ca4b1;background:#fcfcfd}.row-actions{display:flex;flex-wrap:wrap;gap:7px}.table-action{min-height:36px;padding:0 11px;font-size:12px;white-space:nowrap}.sort-button{display:inline-flex;align-items:center;gap:7px;padding:3px 0;border:0;color:#8792a5;background:transparent;font-size:12px;font-weight:750;white-space:nowrap}.sort-button.sort-active{color:#4f62d2}.sort-indicator{color:#5367e8;font-size:14px}.user-sort-mobile{display:none}.user-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:18px}.pagination-summary{color:#77839a;font-size:12px}.pagination-controls{display:flex;align-items:center;gap:6px}.pagination-button{min-height:36px;padding-inline:11px;font-size:12px}.modal-backdrop{position:fixed;inset:0;z-index:5;display:grid;place-items:center;padding:20px;overflow-y:auto;background:rgba(21,30,53,.37)}.modal{width:min(100%,500px);padding:26px;border-radius:16px;background:#fff;box-shadow:var(--shadow)}.user-edit-modal{width:min(100%,680px)}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.modal-header h2{margin:0;color:#28354d;font-size:19px}.modal-header p{margin:6px 0 0;color:#929cad;font-size:12px}.close-button{width:34px;height:34px;border:0;border-radius:8px;color:#8993a4;background:#f3f5f8;font-size:21px}.modal .form-stack{margin-top:22px;gap:16px}.form-two-col{display:grid;grid-template-columns:1fr 1fr;gap:15px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:7px}.modal-error{min-height:15px;margin:0;color:#bd4141;font-size:12px}.toggle-option{display:inline-flex!important;align-items:center;gap:9px;color:#58647a;font-size:13px!important;cursor:pointer}.toggle-option input[type="checkbox"]{position:absolute;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;opacity:0;overflow:hidden;clip:rect(0,0,0,0)}.toggle-track{width:34px;height:20px;position:relative;flex:0 0 34px;border-radius:20px;background:#d8dce5;transition:background .16s}.toggle-track::after{content:"";width:16px;height:16px;position:absolute;top:2px;left:2px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(25,35,54,.2);transition:transform .16s}.toggle-option input:checked+.toggle-track{background:#6374e4}.toggle-option input:checked+.toggle-track::after{transform:translateX(14px)}.user-modal-meta{display:flex;flex-wrap:wrap;gap:14px 28px;margin:14px 0 0;padding:14px 16px;border-radius:9px;background:#f8f9fc}.user-modal-meta span{display:grid;gap:4px}.user-modal-meta small{color:#96a0b0;font-size:11px}.user-modal-meta strong{color:#4b5870;font-size:12px}
/* Storage */
.storage-overview-panel{position:sticky;top:10px;z-index:2;margin-top:0;padding:22px 24px}.storage-summary-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.storage-summary-head>div,.storage-remaining{display:grid;gap:5px}.storage-label,.storage-remaining>span{color:#8590a4;font-size:12px}.storage-total{color:#26334b;font-size:25px;font-weight:800}.storage-total small{color:#9aa3b2;font-size:14px;font-weight:600}.storage-remaining{text-align:right}.storage-remaining strong{color:#33425c;font-size:17px}.storage-meter{position:relative;display:flex;width:100%;height:18px;margin-top:17px;overflow:visible;border-radius:12px;background:#edf0f5}.storage-segment{height:100%;min-width:0}.memory-segment{background:#7892e8}.persona-segment{background:#50b38a}.storage-meter-tooltip{position:absolute;z-index:5;left:50%;bottom:calc(100% + 10px);display:grid;gap:5px;min-width:190px;padding:10px 12px;border-radius:8px;color:#fff;background:rgba(30,41,62,.94);font-size:11px;opacity:0;pointer-events:none;transform:translate(-50%,4px);transition:opacity .12s,transform .12s}.storage-meter:hover .storage-meter-tooltip{opacity:1;transform:translate(-50%,0)}.storage-legend{display:flex;flex-wrap:wrap;gap:11px 22px;margin-top:15px}.storage-legend-item{display:inline-flex;align-items:center;gap:8px;color:#727f95;font-size:11px}.legend-swatch{width:9px;height:9px;border-radius:3px}.memory-swatch{background:#7892e8}.persona-swatch{background:#50b38a}.free-swatch{background:#dfe4ed}.memory-file-list{display:grid;gap:8px;margin-top:17px}.memory-file-row{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid #edf0f5;border-radius:10px;background:#fcfdff}.memory-file-icon{width:34px;height:34px;display:grid;flex:0 0 auto;place-items:center;border-radius:9px;color:#6577de;background:#eff1ff;font-size:16px}.memory-file-info{min-width:0;display:grid;flex:1;gap:4px}.memory-file-info strong{overflow:hidden;color:#35415b;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.memory-file-info small{color:#99a2b1;font-size:10px}.memory-file-size{color:#66738a;font-size:11px;white-space:nowrap}
.storage-tabs{display:flex;gap:5px;margin:19px 0 0;padding:4px;border-radius:10px;background:#eceff5}.storage-tab{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px;border:0;border-radius:8px;color:#707c91;background:transparent;font-size:13px;font-weight:700}.storage-tab.active{color:#4559d5;background:#fff}.storage-category-panel{margin-top:13px}.storage-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.storage-section-heading h2{margin:0;color:#28354d;font-size:17px}.storage-section-heading p{margin:6px 0 0;color:#8994a7;font-size:12px}.storage-empty{display:grid;justify-items:center;gap:8px;padding:48px 15px;text-align:center}.empty-file-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;color:#7180dc;background:#f0f2ff;font-size:23px}.storage-empty strong{color:#46536a;font-size:14px}.storage-empty p{margin:0;color:#929cad;font-size:12px}.persona-list{display:grid;gap:8px;margin-top:18px}.persona-row{display:grid;grid-template-columns:minmax(0,1fr) 90px auto;align-items:center;gap:16px;padding:13px 14px;border:1px solid #edf0f5;border-radius:10px;background:#fcfdff}.persona-main{min-width:0;display:flex;align-items:center;gap:11px}.persona-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;color:#5d70dd;background:#eef0ff;font-size:17px}.persona-info{min-width:0;display:grid;gap:4px}.persona-info strong{overflow:hidden;color:#34415b;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.persona-info small{color:#99a2b2;font-size:10px}.persona-size{color:#66738a;font-size:12px;text-align:right}.persona-actions{display:flex;gap:7px}.persona-modal{width:min(100%,600px)}.persona-modal textarea{min-height:180px;line-height:1.6}.field-hint{display:inline;margin-left:4px;color:#98a2b2;font-size:10px;font-weight:500}.character-count{justify-self:end;color:#909bad;font-size:10px}

.traffic-adjustment-modal{width:min(100%,600px)}

.package-list{display:grid;gap:14px}.package-card{margin:0;padding:18px 20px}.package-card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.package-title-wrap{display:flex;align-items:flex-start;gap:12px;min-width:0}.package-symbol{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;color:#5a6cde;background:#eef0ff;font-size:18px}.package-name-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px}.package-name-row h2{margin:0;color:#27344c;font-size:17px}.package-description{margin:6px 0 0;color:#8d97a9;font-size:12px}.package-badge{padding:4px 7px;border-radius:6px;font-size:10px;font-weight:700}.default-badge{color:#6758b5;background:#f0edff}.enabled-badge{color:#21805a;background:#eaf7f0}.disabled-badge{color:#848c9b;background:#f0f2f5}.package-actions{display:flex;gap:7px}.package-meta{display:flex;flex-wrap:wrap;gap:18px;margin-top:17px;padding:10px 0;border-top:1px solid #f0f2f6;border-bottom:1px solid #f0f2f6;color:#9099aa;font-size:11px}.package-meta code{color:#56627a;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.price-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:13px 0}.price-cell{display:grid;gap:6px}.price-cell>span{color:#9aa3b2;font-size:11px}.price-cell>strong{color:#35415b;font-size:15px}.price-cell small{color:#929bad;font-size:11px}.package-suppliers{padding-top:10px;border-top:1px solid #f0f2f6}.supplier-summary-list{display:grid;gap:5px}.supplier-summary{display:grid;grid-template-columns:22px minmax(90px,.8fr) minmax(120px,1.6fr) minmax(110px,.8fr);align-items:center;gap:8px;padding:9px 10px;border-radius:7px;background:#fafbfe}.order-chip{width:19px;height:19px;display:grid;place-items:center;border-radius:6px;color:#5366cf;background:#ecefff;font-size:9px;font-weight:800}.summary-vendor-name,.summary-model,.summary-interface{min-width:0;overflow:hidden;text-overflow:ellipsis}.summary-vendor-name{color:#4a566e;font-size:12px;font-weight:700}.summary-model,.summary-interface{color:#7e899b;font-size:11px}
.chat-empty-sessions{padding:28px 10px;color:#a1a9b7;text-align:center;font-size:11px;line-height:1.8}.chat-main{min-width:0;display:flex;flex-direction:column;background:#fff}.chat-header{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:76px;padding:16px 23px;border-bottom:1px solid #edf0f5}.chat-header h1{margin:0;color:#26344d;font-size:18px}.chat-header p{margin:6px 0 0;color:#929cad;font-size:11px}.chat-package-picker{display:grid;min-width:190px;gap:5px;color:#8b96a8;font-size:10px;font-weight:700}.chat-package-picker select{height:38px;padding-inline:10px;font-size:11px}.chat-messages{min-height:0;flex:1;overflow-y:auto;padding:28px clamp(18px,6vw,90px);background:linear-gradient(180deg,#fff,#fbfcff)}.chat-message{display:flex;flex-direction:column;max-width:78%;margin-bottom:19px}.chat-message-user{margin-left:auto;align-items:flex-end}.chat-message-assistant{margin-right:auto;align-items:flex-start}.chat-bubble{padding:12px 15px;border-radius:14px;color:#34415a;font-size:14px;line-height:1.7;overflow-wrap:anywhere}.chat-message-user .chat-bubble{color:#fff;background:#5367e8;border-bottom-right-radius:4px}.chat-message-assistant .chat-bubble{border:1px solid #e8ebf2;background:#fff;border-bottom-left-radius:4px;box-shadow:0 3px 12px rgba(35,48,87,.04)}.chat-message time{margin-top:5px;color:#a4adbb;font-size:9px}.chat-welcome,.chat-empty-main{display:grid;justify-items:center;align-content:center;min-height:100%;color:#8894a8;text-align:center}.chat-welcome-icon,.chat-empty-icon{width:53px;height:53px;display:grid;place-items:center;border-radius:17px;color:#5b6fe1;background:#eef0ff;font-size:27px}.chat-welcome h2,.chat-empty-main h2{margin:17px 0 7px;color:#4a5770;font-size:19px}.chat-welcome p,.chat-empty-main p{margin:0;font-size:12px}.chat-composer{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:15px 23px 19px;border-top:1px solid #edf0f5;background:#fff}.chat-composer textarea{display:block;width:100%;min-height:58px;max-height:170px;flex:1;padding:10px 13px;border:0;border-radius:9px;outline:0;box-shadow:none;font-size:14px;line-height:1.55;resize:vertical}.chat-composer textarea:focus{border:0;box-shadow:none}.chat-composer-toolbar{display:flex;align-items:center;gap:9px;min-height:39px}.chat-composer-toolbar .chat-package-picker{display:flex;align-items:center;gap:8px;min-width:0;color:#838ea2;font-size:10px}.chat-composer-toolbar .chat-package-picker span{flex:0 0 auto}.chat-composer-toolbar .chat-package-picker select{width:auto;min-width:155px;max-width:min(38vw,260px);height:34px;padding-inline:10px;border-color:#e6e9f0;border-radius:18px;font-size:11px}.chat-toolbar-spacer{flex:1}.chat-send-button{width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border:0;border-radius:50%;color:#fff;background:#5367e8;box-shadow:0 7px 15px rgba(83,103,232,.2);cursor:pointer}.chat-send-button:hover{background:#4053ce}.chat-send-button:disabled{opacity:.78;cursor:wait}.send-icon{font-size:23px;line-height:1}.send-spinner{display:none;width:19px;height:19px;border:3px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:chat-spin .75s linear infinite}.chat-send-button.is-loading .send-icon{display:none}.chat-send-button.is-loading .send-spinner{display:block}.chat-error{max-width:78%;margin:4px auto 15px;padding:9px 12px;border-radius:8px;color:#a74b4b;background:#fff4f4;font-size:11px;text-align:center}@keyframes chat-spin{to{transform:rotate(360deg)}}
/* Welcome draft: no persistent session or sidebar until first message */
.chat-page.chat-page-welcome{grid-template-columns:minmax(0,1fr);min-height:calc(100vh - 150px);border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}.chat-page.chat-page-welcome .chat-session-sidebar{display:none}.chat-page.chat-page-welcome .chat-main{min-height:calc(100vh - 190px);align-items:center;justify-content:center;background:transparent}.chat-welcome-screen{width:min(100%,780px);min-height:min(680px,calc(100vh - 200px));display:flex;flex-direction:column;justify-content:center;gap:20px;margin:auto;padding:25px}.chat-welcome-title{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:4px}.chat-welcome-title h1{color:#1b2941;font-size:24px;letter-spacing:-.025em}.chat-welcome-logo{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;color:#5367e8;background:#edf0ff;font-size:19px}.chat-draft-messages{width:100%;max-height:38vh;flex:0 1 auto;overflow-y:auto;padding:8px 10px;background:transparent}.chat-welcome-copy{width:100%;padding:20px;color:#a0a9b8;text-align:center;font-size:13px}.chat-composer-welcome{width:100%;margin:0;padding:17px 18px 13px;border:1px solid #e2e5ec;border-radius:20px;background:#fff;box-shadow:0 12px 38px rgba(35,48,87,.08)}.chat-page:not(.chat-page-welcome) .chat-main{min-height:calc(100vh - 150px)}
/* Modals, toast */
.modal-backdrop{position:fixed;inset:0;z-index:5;display:grid;place-items:center;padding:20px;overflow-y:auto;background:rgba(21,30,53,.37)}.modal{width:min(100%,500px);padding:26px;border-radius:16px;background:#fff;box-shadow:var(--shadow)}.user-edit-modal{width:min(100%,680px)}.persona-modal{width:min(100%,600px)}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.modal-header h2{margin:0;color:#28354d;font-size:19px}.modal-header p{margin:6px 0 0;color:#929cad;font-size:12px}.close-button{width:34px;height:34px;border:0;border-radius:8px;color:#8993a4;background:#f3f5f8;font-size:21px}.modal .form-stack{margin-top:22px;gap:16px}.form-two-col{display:grid;grid-template-columns:1fr 1fr;gap:15px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:7px}.modal-error{min-height:15px;margin:0;color:#bd4141;font-size:12px}.field-hint{display:inline;margin-left:4px;color:#98a2b2;font-size:10px;font-weight:500}.character-count{justify-self:end;color:#909bad;font-size:10px}.persona-modal textarea{min-height:180px;line-height:1.6}.toast-region{position:fixed;z-index:10;right:20px;bottom:20px;display:grid;gap:8px}.toast{max-width:min(380px,calc(100vw - 40px));padding:14px 18px;border:1px solid #dcefe5;border-radius:10px;color:#28714e;background:#f3fbf6;box-shadow:var(--shadow);font-size:13px}.toast.error{color:#aa4646;border-color:#f4dfdf;background:#fff7f7}
/* Injection prompt administration */
.injection-tabs { margin-top: 0; }
.injection-prompt-list { display: grid; gap: 10px; margin-top: 20px; }
.injection-prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid #e8ecf3; border-radius: 11px; background: #fcfdff; }
.injection-prompt-info { min-width: 0; display: grid; gap: 6px; }
.injection-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.injection-name-row strong { color: #35415b; font-size: 15px; overflow-wrap: anywhere; }
.injection-prompt-info small { color: #929cad; font-size: 12px; }
.injection-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; }
.injection-actions .button { min-height: 38px; padding-inline: 12px; font-size: 12px; }
.injection-prompt-modal { width: min(100%, 840px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.injection-prompt-modal textarea { min-height: 220px; max-height: 44dvh; line-height: 1.7; }
.package-injection-modal { width: min(100%, 650px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.package-injection-fields { display: grid; gap: 17px; }
.injection-inherit-note { margin: 0; color: #8b96a8; font-size: 12px; line-height: 1.6; }
.package-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .injection-prompt-row { align-items: stretch; flex-direction: column; gap: 12px; }
  .injection-actions { justify-content: flex-end; }
  .injection-panel .storage-section-heading { align-items: flex-start; }
  .injection-panel .storage-section-heading > div { min-width: 0; }
  .injection-panel .storage-section-heading > .button { flex: 0 0 auto; }
  .package-card-top { flex-wrap: wrap; }
  .package-actions .button { min-height: 38px; padding-inline: 12px; font-size: 12px; }
}

/* User access and robot quotas */
#user-modal { padding: clamp(10px, 3vw, 20px); }
#user-modal .user-edit-modal { max-height: calc(100dvh - clamp(20px, 6vw, 40px)); overflow-y: auto; }
.user-access-section { min-width: 0; margin: 0; padding: 12px; border: 1px solid #e3e8f2; border-radius: 10px; }
.user-access-section legend { padding-inline: 5px; color: var(--ink); font-size: 14px; font-weight: 700; }
.user-access-section p { margin: 0 0 10px; color: #586781; font-size: 12px; line-height: 1.5; }
.user-access-section .button { min-height: 40px; font-size: 13px; }
.user-permission-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.user-bot-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-access-section label, .user-access-section input { min-width: 0; }
@media (max-width: 620px) {
  .user-permission-row { grid-template-columns: minmax(0, 1fr) auto; }
  .user-permission-row label:first-child { grid-column: 1 / -1; }
  .user-access-section .button { min-height: 44px; }
}
@media (max-width: 400px) {
  .user-permission-row, .user-bot-limits { grid-template-columns: minmax(0, 1fr); }
  .user-permission-row .button { justify-self: start; }
}

/* Package editor */
.package-modal{width:min(100%,1000px);max-height:calc(100vh - 36px);overflow-y:auto}.package-modal-header{position:sticky;top:-26px;z-index:2;margin:-26px -26px 0;padding:26px;background:#fff;border-bottom:1px solid #f0f2f6}.package-base-grid{display:grid;grid-template-columns:minmax(0,1fr) 245px;gap:15px}.package-base-grid label,.price-input-grid label,.supplier-fields label{display:grid;align-content:start;gap:8px;color:#4a556c;font-size:13px;font-weight:700}.package-base-grid .description-field{grid-column:1/-1}.package-base-grid input,.price-input-grid input,.supplier-fields input,.supplier-fields select{height:45px;font-size:13px}.section-divider{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:7px;border-top:1px solid #eef0f5}.section-divider h3{margin:11px 0 0;color:#34415b;font-size:14px}.section-divider p{margin:5px 0 0;color:#99a2b1;font-size:12px}.price-input-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.package-toggles{display:flex;flex-wrap:wrap;gap:20px}.supplier-section-heading{padding-top:14px}.supplier-editor-list{display:grid;gap:11px}.supplier-card{padding:17px;border:1px solid #e8ebf2;border-radius:12px;background:#fbfcff;transition:border-color .15s,box-shadow .15s,opacity .15s}.supplier-card.dragging{opacity:.45;border-color:#6777e4;box-shadow:0 8px 24px rgba(65,82,196,.16)}.supplier-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.supplier-drag-title{display:flex;align-items:center;gap:9px}.drag-handle{color:#8490a5;font-size:23px;line-height:1;cursor:grab;user-select:none}.drag-handle:active{cursor:grabbing}.provider-order{color:#35415a;font-size:13px;font-weight:800}.key-status{padding:4px 7px;border-radius:6px;color:#25805b;background:#eaf7f0;font-size:10px}.supplier-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.7fr) minmax(0,1fr);gap:13px}.supplier-url-field{grid-column:span 2}.supplier-fetch-row{display:flex;align-items:center;gap:10px;margin-top:11px}.supplier-fetch-row .button{min-height:39px;padding-inline:13px;font-size:12px}.model-fetch-status{color:#929bad;font-size:12px;line-height:1.5}.package-modal-actions{position:sticky;bottom:-26px;margin:0 -26px -26px;padding:14px 26px 20px;border-top:1px solid #eef0f5;background:#fff}
@media(max-width:760px){.package-base-grid{grid-template-columns:1fr}.package-base-grid .description-field{grid-column:auto}.supplier-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.supplier-url-field{grid-column:span 2}}
@media(max-width:520px){.package-modal{max-height:calc(100vh - 18px)}.package-modal-header{top:-21px;margin:-21px -21px 0;padding:21px}.package-modal-actions{bottom:-21px;margin:0 -21px -21px;padding:12px 21px 15px}.supplier-fields,.price-input-grid{grid-template-columns:1fr}.supplier-url-field{grid-column:auto}.supplier-fetch-row{align-items:flex-start;flex-direction:column}}

.chat-page{min-height:calc(100vh - 150px);display:grid;grid-template-columns:245px minmax(0,1fr);overflow:hidden;border:1px solid #e9ecf3;border-radius:16px;background:#fff;box-shadow:0 5px 20px rgba(35,48,87,.035)}.chat-session-sidebar{display:flex;min-width:0;flex-direction:column;border-right:1px solid #edf0f5;background:#fafbfe}.chat-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:18px 15px;border-bottom:1px solid #edf0f5}.chat-sidebar-head strong{color:#33415b;font-size:15px}.chat-new-button{min-height:34px;padding-inline:10px;font-size:11px}.chat-session-list{min-height:0;flex:1;overflow-y:auto;padding:9px}.chat-session-row{position:relative;display:flex;align-items:center;gap:3px;margin:2px 0;padding-right:4px;border-radius:9px}.chat-session-row:has(.chat-session-item.active){background:#e9edff}.chat-session-row .chat-session-item{min-width:0;flex:1}.chat-session-item{width:100%;display:grid;gap:5px;padding:12px 11px;border:0;border-radius:9px;color:#4a5770;background:transparent;text-align:left}.chat-session-item:hover{background:#f0f2ff}.chat-session-item.active{color:#465bd3}.chat-session-item strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.chat-session-item small{color:#9aa4b5;font-size:10px}.chat-session-actions{display:flex;flex:0 0 auto;gap:2px}.chat-session-action{width:29px;height:29px;display:grid;place-items:center;border:0;border-radius:7px;color:#8994a7;background:transparent;font-size:15px}.chat-session-action:hover{color:#4e62d4;background:#eef0ff}.chat-session-action.delete-chat-session:hover{color:#b14747;background:#fff0f0}.archived-chat-group{margin:4px 0 8px;padding-bottom:8px;border-bottom:1px solid #e8ebf2}.archived-chat-group>summary{display:flex;align-items:center;gap:8px;padding:10px 9px;border-radius:8px;color:#69758b;font-size:12px;font-weight:750;list-style:none;cursor:pointer;user-select:none}.archived-chat-group>summary::-webkit-details-marker{display:none}.archived-chat-group>summary:hover{color:#4d60ce;background:#f0f2ff}.archived-chat-group[open]>summary .archive-folder-icon{transform:rotate(90deg)}.archive-folder-icon{display:inline-block;color:#7380a0;font-size:12px;transition:transform .15s}.archived-count{min-width:20px;margin-left:auto;padding:2px 6px;border-radius:20px;color:#758099;background:#eceff5;text-align:center;font-size:10px}.archived-chat-list{display:grid;gap:2px;padding-top:3px}.archived-chat-label{min-width:0;display:grid;flex:1;gap:4px;padding:9px 7px 9px 12px}.archived-chat-label strong{overflow:hidden;color:#69758a;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.archived-chat-label small{overflow:hidden;color:#a0a8b6;font-size:9px;text-overflow:ellipsis;white-space:nowrap}.archived-chat-row{opacity:.9}.archived-chat-row:hover{background:#f3f5f9}.archived-chat-empty{display:flex;align-items:center;gap:8px;padding:10px 9px;border-bottom:1px solid #e8ebf2;color:#8691a4;font-size:11px}.archived-chat-empty small{margin-left:auto;color:#a7afbb;font-size:9px}.chat-empty-sessions{padding:28px 10px;color:#a1a9b7;text-align:center;font-size:11px;line-height:1.8}
.memory-source-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  color: #52627e;
  font-size: 13px;
}
.memory-source-filter select { width: auto; min-height: 44px; }

.platform-overview-panel { border-color: #dfe5ef; }
.platform-overview-error { color: #902c2c; font-size: 13px; }
.platform-overview-error:empty { display: none; }
.platform-overview-panel h2 { margin-bottom: 14px; }
.platform-overview-panel .panel-subtitle { margin-top: -6px; margin-bottom: 14px; color: #53627b; }
.platform-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.platform-traffic-grid { gap: 14px; }
.platform-resource-grid .stat-card, .platform-traffic-grid .stat-card {
  min-height: auto;
  padding: 16px;
  border-color: #e3e8f2;
  background: #fafbfe;
}
.platform-overview-panel h3 {
  margin: 0 0 8px;
  color: #465674;
  font-size: 14px;
  font-weight: 650;
}
.platform-overview-panel .stat-card strong {
  display: block;
  color: #24324c;
  font-size: clamp(22px, 3vw, 30px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.platform-resource-card meter {
  width: 100%;
  height: 12px;
  margin: 8px 0;
}
.platform-resource-card meter::-webkit-meter-bar { background: #e5ebf7; border: 0; }
.platform-resource-card meter::-webkit-meter-optimum-value { background: #6379d8; }
.platform-resource-card small { color: #53627b; }
.bot-module-note[data-package-description] p { margin: 0 0 5px; white-space: pre-wrap; overflow-wrap: anywhere; }

.speech-voices { margin-top: 16px; border-top: 1px solid #e3e8f2; }
.speech-voices > summary { padding: 12px 0; color: #34415b; font-weight: 700; cursor: pointer; }
.speech-voice-count { margin-left: 6px; color: #53627b; font-size: 13px; font-weight: 500; }
.speech-voice-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.speech-voice-catalog-status, .speech-voice-note { color: #53627b; font-size: 13px; }
.speech-voice-empty { margin: 0 0 6px; color: #53627b; font-size: 13px; }
.speech-voice-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.speech-voice-card {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
}
.speech-voice-card.dragging { opacity: .45; }
.speech-voice-card label { display: grid; gap: 4px; color: #465674; font-size: 13px; }
.speech-voice-card .speech-voice-name { width: 100%; min-width: 0; min-height: 44px; }
.speech-voice-card code { color: #53627b; overflow-wrap: anywhere; }
.speech-voice-card .speech-voice-access { display: flex; align-items: center; gap: 5px; }
.speech-voice-access input { width: 18px; height: 18px; }
.speech-voice-order { display: flex; }
.speech-voice-order button { min-width: 44px; min-height: 44px; padding: 0; }
.speech-voice-settings { grid-column: 1 / -1; min-width: 0; border-top: 1px solid #e3e8f2; }
.speech-voice-settings > summary { padding: 9px 0 4px; color: #34415b; font-weight: 650; cursor: pointer; }
.speech-voice-audio-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.speech-voice-audio-fields :is(input, select) { min-width: 0; height: 44px; padding-inline: 8px; }
.speech-voice-picker {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #e3e8f2;
  color: var(--ink);
}
.speech-voice-picker::backdrop { background: rgba(21, 30, 53, .4); }
.speech-voice-picker .modal-header { margin-bottom: 16px; }
.speech-voice-picker .modal-header p { overflow-wrap: anywhere; }
.speech-voice-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: min(320px, 46dvh);
  overflow-y: auto;
  margin-block: 10px;
}
.speech-voice-results > p { grid-column: 1 / -1; margin: 10px 0; color: #53627b; }
.speech-voice-candidate {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  cursor: pointer;
}
.speech-voice-candidate:has(input:checked) { border-color: #8794f1; background: #f0f2ff; }
.speech-voice-candidate input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.speech-voice-candidate span { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.speech-voice-candidate strong { font-size: 13px; }
.speech-voice-candidate code { color: #53627b; font-size: 11px; }
.speech-voice-pagination, .speech-voice-picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.speech-voice-pagination > div { display: flex; gap: 4px; }
.speech-voice-page-status, .speech-voice-selected { margin-right: auto; color: #53627b; font-size: 13px; }
.speech-voice-picker-actions { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e3e8f2; }
.speech-voice-picker .button { padding-inline: 11px; }
@media (max-width: 720px) {
  html[data-page="packages"] .package-card { min-width: 0; overflow-wrap: anywhere; }
  html[data-page="packages"] .package-card-top { flex-wrap: wrap; }
  html[data-page="packages"] .package-actions { flex-wrap: wrap; }
  html[data-page="packages"] .supplier-summary { grid-template-columns: auto minmax(0, 1fr); }
  html[data-page="packages"] .summary-model,
  html[data-page="packages"] .summary-interface { grid-column: 2; }
  .speech-voice-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .speech-voice-card code { grid-column: 2 / -1; }
  .speech-voice-card .speech-voice-access { grid-column: 2 / -1; }
  .speech-voice-order { grid-column: 3; grid-row: 1; }
  .speech-voice-audio-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .speech-voice-card { grid-template-columns: auto minmax(0, 1fr); }
  .speech-voice-order { grid-column: 2; grid-row: auto; }
  .speech-voice-results { grid-template-columns: 1fr; }
}
@media (max-width: 670px) {
  .platform-resource-grid { grid-template-columns: 1fr; }
  .platform-traffic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.account-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid #d4e0f7;
  border-radius: 10px;
  background: #edf3fe;
  color: #29477c;
  font-size: 13px;
}
.account-context a { margin-inline-start: auto; color: inherit; text-decoration: underline; }

.memory-import-actions{display:flex;align-items:end;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.memory-import-actions .button{white-space:nowrap}
dialog.memory-import-dialog{width:min(580px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--line);border-radius:16px;background:#fff;color:var(--ink);box-shadow:var(--shadow)}
.memory-import-dialog::backdrop{background:rgba(21,30,53,.44)}
.memory-import-dialog .bot-dialog-heading{display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid var(--line)}
.memory-import-dialog h2{margin:0;font-size:20px}
.memory-import-dialog .bot-dialog-body{margin:0;padding:18px 22px;gap:14px}
.memory-import-dialog .bot-dialog-body>p{margin:0;line-height:1.55}
.memory-import-dialog .bot-dialog-body>label[hidden]{display:none}
.memory-import-dialog input[type=file]{height:auto;padding:8px}
.memory-import-dialog :focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.memory-feed-peer{display:block;color:var(--muted);overflow-wrap:anywhere}
.memory-import-preview{padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.memory-import-preview details{padding-top:8px}
.memory-import-preview pre{max-height:170px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.55}
.memory-file-row>[data-delete-import]{min-height:38px;padding-inline:12px}
@media(max-width:540px){.memory-import-actions{justify-content:flex-start}.memory-import-dialog .bot-dialog-body,.memory-import-dialog .bot-dialog-heading{padding-inline:15px}}
