:root {
  --bg:#090b10; --sidebar:#0d1016; --panel:#11151d; --panel-2:#151a24; --panel-3:#1a202b;
  --text:#f2f4f8; --muted:#858e9f; --line:#232a36; --line-soft:#1b222d; --accent:#35d5ae; --accent-rgb:53,213,174;
  --purple:#8b7cf6; --green:#43d69e; --red:#fa727e; --amber:#eeb65c; --blue:#61a8fa; --shadow:0 18px 50px rgba(0,0,0,.22);
  --radius:16px; color-scheme:dark;
}
html[data-theme="light"] { --bg:#f4f6fa; --sidebar:#fff; --panel:#fff; --panel-2:#f8f9fc; --panel-3:#eef1f6; --text:#17202e; --muted:#717c8e; --line:#e0e5ed; --line-soft:#ebeff4; --shadow:0 18px 45px rgba(30,45,70,.08); color-scheme:light; }
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; }
body { background:var(--bg); color:var(--text); font:14px/1.55 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; -webkit-font-smoothing:antialiased; }
body.grok { --accent:#a58aff; --accent-rgb:165,138,255; }
button,input,textarea,select { font:inherit; }
button { color:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:not-allowed; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:2px solid rgba(var(--accent-rgb),.65); outline-offset:2px; }
svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.svg-defs { position:absolute; width:0; height:0; overflow:hidden; }
.hidden { display:none!important; }
.muted { color:var(--muted); }
.eyebrow { display:block; color:var(--muted); font-size:10px; font-weight:750; letter-spacing:1.7px; line-height:1.4; }
.eyebrow.accent { color:var(--accent); }
h1,h2,h3,p { margin-top:0; }
h1 { margin-bottom:8px; font-size:29px; line-height:1.25; letter-spacing:-.8px; }
h2 { margin-bottom:5px; font-size:17px; letter-spacing:-.25px; }
code { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:38px; padding:8px 14px; border:1px solid transparent; border-radius:10px; font-size:12px; font-weight:650; transition:.18s ease; white-space:nowrap; }
.button.primary { color:#071611; background:var(--accent); border-color:var(--accent); box-shadow:0 5px 18px rgba(var(--accent-rgb),.12); }
body.grok .button.primary { color:#140e22; }
.button.primary:hover { filter:brightness(1.08); transform:translateY(-1px); box-shadow:0 7px 22px rgba(var(--accent-rgb),.22); }
.button.secondary { color:var(--text); background:var(--panel-2); border-color:var(--line); }
.button.secondary:hover { background:var(--panel-3); border-color:#394353; }
.button.danger { color:#fff; background:#d94e5b; border-color:#d94e5b; }
.button.wide,.wide { width:100%; }
.icon-btn { display:inline-grid; place-items:center; width:34px; height:34px; padding:0; border:1px solid transparent; border-radius:9px; color:var(--muted); background:transparent; transition:.18s; }
.icon-btn:hover { color:var(--text); background:var(--panel-3); border-color:var(--line); }
.text-btn { display:inline-flex; align-items:center; gap:5px; padding:4px 0; border:0; color:var(--accent); background:none; font-size:12px; font-weight:650; }
.text-btn svg { width:14px; height:14px; }
.text-btn:hover { filter:brightness(1.2); }
.danger-text { color:var(--red)!important; }
input,textarea,select { border:1px solid var(--line); border-radius:10px; color:var(--text); background:var(--panel-2); outline:none; transition:border-color .18s,box-shadow .18s; }
input,select { height:38px; padding:0 12px; }
select { padding-right:30px; cursor:pointer; }
textarea { width:100%; min-height:135px; padding:12px; resize:vertical; font:12px/1.6 "SFMono-Regular",Consolas,monospace; }
input::placeholder,textarea::placeholder { color:#687386; }
input:focus,textarea:focus,select:focus { border-color:rgba(var(--accent-rgb),.65); box-shadow:0 0 0 3px rgba(var(--accent-rgb),.08); }
.field-label { display:block; margin:18px 0 7px; color:var(--muted); font-size:12px; font-weight:600; }
.field-help { display:block; margin-top:6px; color:var(--muted); font-size:11px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-group { margin-bottom:14px; }
.form-group label { display:block; margin-bottom:6px; color:var(--muted); font-size:12px; }
.form-group input,.form-group select { width:100%; }
.pill { display:inline-flex; align-items:center; gap:5px; width:max-content; padding:3px 8px; border:1px solid; border-radius:999px; font-size:10px; font-weight:650; white-space:nowrap; }
.pill.ok,.pill.live { color:var(--green); background:rgba(67,214,158,.07); border-color:rgba(67,214,158,.23); }
.pill.bad { color:var(--red); background:rgba(250,114,126,.07); border-color:rgba(250,114,126,.23); }
.pill.warn { color:var(--amber); background:rgba(238,182,92,.07); border-color:rgba(238,182,92,.23); }
.pill.neutral,.pill.catalog { color:var(--muted); background:var(--panel-2); border-color:var(--line); }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--amber); box-shadow:0 0 0 4px rgba(238,182,92,.08); }
.status-dot.ok { background:var(--green); box-shadow:0 0 0 4px rgba(67,214,158,.08); }
.status-dot.bad { background:var(--red); box-shadow:0 0 0 4px rgba(250,114,126,.08); }
/* Login */
.login { min-height:100vh; display:grid; grid-template-columns:minmax(440px,1.15fr) minmax(400px,.85fr); background:#090b10; }
.login-visual { position:relative; overflow:hidden; display:flex; flex-direction:column; padding:42px 6vw; color:#f2f4f8; background:radial-gradient(circle at 75% 45%,rgba(67,214,174,.13),transparent 30%),radial-gradient(circle at 15% 90%,rgba(139,124,246,.16),transparent 40%),#0d1118; border-right:1px solid #202734; }
.login-visual:before { content:""; position:absolute; inset:0; opacity:.25; background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size:42px 42px; mask-image:linear-gradient(to bottom,black,transparent 85%); }
.login-brand { position:relative; display:flex; align-items:center; gap:12px; font-size:15px; font-weight:800; letter-spacing:3px; }
.brand-mark { display:grid; place-items:center; width:37px; height:37px; border-radius:11px; color:#071611; background:linear-gradient(145deg,#5de4c0,#25b994); font-size:19px; font-weight:900; box-shadow:0 7px 24px rgba(53,213,174,.16); }
.login-copy { position:relative; z-index:1; margin:auto 0; max-width:570px; }
.login-copy .eyebrow { color:#56dcb8; }
.login-copy h1 { margin:18px 0 20px; font-size:clamp(38px,4.2vw,62px); line-height:1.15; letter-spacing:-2.5px; }
.login-copy h1 em { color:#56dcb8; font-style:normal; }
.login-copy p { max-width:420px; color:#939daf; font-size:15px; }
.login-foot { position:relative; margin:0; color:#5f6b7c; font-size:9px; letter-spacing:2px; }
.login-orbit { position:absolute; right:-80px; top:50%; width:330px; height:330px; transform:translateY(-50%); opacity:.6; }
.login-orbit span { position:absolute; inset:0; border:1px solid rgba(83,220,184,.15); border-radius:50%; }
.login-orbit span:nth-child(2) { inset:45px; border-color:rgba(139,124,246,.2); }
.login-orbit span:nth-child(3) { inset:90px; }
.login-orbit b { position:absolute; inset:130px; display:grid; place-items:center; border-radius:50%; color:#55d9b7; background:#111a20; font-size:20px; }
.login-form-wrap { display:grid; place-items:center; padding:30px; }
.login-card { width:min(360px,100%); }
.login-card h2 { margin:12px 0 6px; font-size:28px; }
.login-card>.muted { margin-bottom:28px; }
.password-field { position:relative; }
.password-field input { width:100%; height:46px; padding-right:44px; background:#11151d; border-color:#29313f; color:#f2f4f8; }
.password-field .icon-btn { position:absolute; right:6px; top:6px; }
.login-submit { min-height:45px; margin-top:18px; justify-content:space-between; padding-left:18px; background:#43d6ae; border-color:#43d6ae; color:#071611; }
.error { min-height:20px; margin-top:9px; color:#fa727e; font-size:12px; }
.security-note { display:flex; gap:7px; margin-top:20px; color:#647084; font-size:10px; }
.security-note svg { width:14px; height:14px; color:#43d69e; }
.mobile-login-logo { display:none; }
/* Application shell */
.app-shell { min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; z-index:40; display:flex; flex-direction:column; width:236px; padding:23px 14px 16px; background:var(--sidebar); border-right:1px solid var(--line-soft); }
.brand { display:flex; align-items:center; gap:11px; padding:0 10px; }
.brand strong { display:block; font-size:14px; letter-spacing:2.5px; }
.brand small { display:block; margin-top:-1px; color:var(--muted); font-size:8px; letter-spacing:2px; }
.provider-switch { display:flex; flex-direction:column; gap:5px; margin:28px 0 25px; }
.provider-tab { position:relative; display:flex; align-items:center; gap:10px; width:100%; padding:10px; text-align:left; border:1px solid transparent; border-radius:11px; background:transparent; transition:.18s; }
.provider-tab:hover { background:var(--panel-2); }
.provider-tab.active { background:rgba(var(--accent-rgb),.07); border-color:rgba(var(--accent-rgb),.18); }
.provider-symbol { display:grid; place-items:center; width:31px; height:31px; border-radius:9px; font-size:12px; font-weight:800; }
.provider-symbol.gpt { color:#53d9b6; background:rgba(53,213,174,.1); }
.provider-symbol.grok { color:#ae98ff; background:rgba(165,138,255,.11); }
.provider-tab strong { display:block; font-size:12px; font-weight:650; }
.provider-tab small { display:block; color:var(--muted); font-size:9px; }
.provider-tab i { position:absolute; right:11px; width:5px; height:5px; border-radius:50%; background:transparent; }
.provider-tab.active i { background:var(--accent); box-shadow:0 0 8px var(--accent); }
.nav-label { display:block; padding:0 12px 8px; color:#5f697a; font-size:9px; font-weight:700; letter-spacing:1.4px; }
.side-nav { display:flex; flex-direction:column; gap:4px; }
.nav-item { display:flex; align-items:center; gap:11px; width:100%; min-height:42px; padding:9px 12px; border:1px solid transparent; border-radius:10px; color:var(--muted); background:transparent; text-align:left; font-size:12px; transition:.18s; }
.nav-item:hover { color:var(--text); background:var(--panel-2); }
.nav-item.active { color:var(--text); background:var(--panel-3); border-color:var(--line); }
.nav-item.active svg { color:var(--accent); }
.nav-item b { margin-left:auto; min-width:20px; padding:1px 5px; border-radius:6px; color:var(--muted); background:var(--panel); font-size:9px; text-align:center; }
.sidebar-bottom { margin-top:auto; padding-top:15px; border-top:1px solid var(--line-soft); }
.sidebar-status { display:flex; align-items:center; gap:11px; padding:8px 11px 15px; }
.sidebar-status strong { display:block; font-size:11px; font-weight:600; }
.sidebar-status small { display:block; color:var(--muted); font-size:9px; }
.side-action { display:flex; align-items:center; gap:11px; width:100%; padding:8px 11px; border:0; border-radius:8px; color:var(--muted); background:none; font-size:11px; text-align:left; }
.side-action:hover { color:var(--text); background:var(--panel-2); }
.side-action svg { width:16px; height:16px; }
.workspace { min-height:100vh; margin-left:236px; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; z-index:30; display:flex; align-items:center; min-height:65px; padding:0 32px; background:color-mix(in srgb,var(--bg) 87%,transparent); backdrop-filter:blur(18px); border-bottom:1px solid var(--line-soft); }
.breadcrumb { display:flex; align-items:center; gap:8px; font-size:11px; }
.breadcrumb>span { color:var(--muted); }
.breadcrumb svg { width:12px; height:12px; color:#4e596a; }
.breadcrumb strong { font-weight:600; }
.top-actions { display:flex; align-items:center; gap:11px; margin-left:auto; }
.refresh-select { display:flex; align-items:center; gap:7px; }
.refresh-select select { width:112px; height:32px; padding:0 5px; border:0; color:var(--muted); background:transparent; font-size:10px; }
.top-avatar { display:grid; place-items:center; width:31px; height:31px; margin-left:3px; border:1px solid var(--line); border-radius:9px; color:var(--accent); background:var(--panel-2); font-size:11px; font-weight:700; }
.mobile-menu { display:none; }
main { width:100%; max-width:1440px; margin:0 auto; padding:30px 32px 45px; flex:1; }
.footer { display:flex; justify-content:space-between; padding:15px 32px; border-top:1px solid var(--line-soft); color:#586375; font-size:9px; letter-spacing:1px; }
.page-head,.hero { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:25px; }
.page-head h1,.hero h1 { margin-top:7px; }
.page-head p,.hero p { margin-bottom:0; font-size:12px; }
.head-actions { display:flex; gap:8px; }
.spinning svg { animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
/* Dashboard */
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-bottom:16px; }
.stat { display:flex; align-items:center; gap:14px; min-width:0; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:linear-gradient(145deg,var(--panel),color-mix(in srgb,var(--panel) 93%,var(--bg))); box-shadow:0 1px 0 rgba(255,255,255,.015); }
.stat-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; flex:none; }
.stat-icon.violet { color:var(--purple); background:rgba(139,124,246,.1); }
.stat-icon.green { color:var(--green); background:rgba(67,214,158,.09); }
.stat-icon.blue { color:var(--blue); background:rgba(97,168,250,.09); }
.stat-icon.amber { color:var(--amber); background:rgba(238,182,92,.09); }
.stat small { display:block; color:var(--muted); font-size:10px; }
.stat strong { display:inline-block; margin-right:8px; font-size:26px; line-height:1.3; letter-spacing:-.8px; }
.stat div>span { display:block; color:#626e80; font-size:9px; }
.card { border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); box-shadow:0 1px 0 rgba(255,255,255,.015); }
.overview-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr); gap:16px; margin-bottom:16px; }
.overview-grid>.card,.recent-card { padding:20px; }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.card-head h2 { margin-top:5px; }
.card-head p { margin:3px 0 0; font-size:11px; }
.quickstart-card>.muted { margin-bottom:16px; font-size:11px; }
.endpoint-box { display:flex; align-items:center; gap:12px; min-height:48px; padding:7px 8px 7px 13px; border:1px solid var(--line); border-radius:11px; background:var(--bg); }
.endpoint-method { padding:3px 6px; border-radius:5px; color:var(--accent); background:rgba(var(--accent-rgb),.08); font-size:8px; font-weight:800; letter-spacing:.7px; white-space:nowrap; }
.endpoint-box code { min-width:0; flex:1; overflow:hidden; color:var(--text); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.quick-links { display:flex; gap:20px; margin-top:13px; }
.quick-links button { display:flex; align-items:center; gap:6px; padding:0; border:0; color:var(--muted); background:none; font-size:10px; }
.quick-links button:hover { color:var(--text); }
.quick-links svg { width:14px; height:14px; }
.health-ring-wrap { display:flex; align-items:center; justify-content:space-around; gap:20px; padding-top:5px; }
.health-ring { --rate:0deg; position:relative; display:grid; place-content:center; width:115px; height:115px; flex:none; border-radius:50%; background:conic-gradient(var(--accent) var(--rate),var(--panel-3) 0); text-align:center; }
.health-ring:after { content:""; position:absolute; inset:8px; border-radius:50%; background:var(--panel); }
.health-ring strong,.health-ring small { position:relative; z-index:1; }
.health-ring strong { font-size:23px; letter-spacing:-1px; }
.health-ring small { color:var(--muted); font-size:8px; }
.health-legend { display:flex; flex-direction:column; gap:12px; min-width:125px; }
.health-legend span { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:10px; }
.health-legend i { width:6px; height:6px; border-radius:50%; }
.health-legend i.green { background:var(--green); }.health-legend i.gray { background:#596577; }.health-legend i.red { background:var(--red); }
.health-legend b { margin-left:auto; color:var(--text); font-weight:650; }
.preview-list { display:flex; flex-direction:column; }
.preview-row { display:flex; align-items:center; gap:11px; padding:11px 0; border-top:1px solid var(--line-soft); }
.preview-row:first-child { border-top:0; }
.preview-row .account-avatar { width:30px; height:30px; font-size:10px; }
.preview-name { min-width:0; flex:1; }
.preview-name strong { display:block; overflow:hidden; font-size:11px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.preview-name small { color:var(--muted); font-size:9px; }
.preview-empty { padding:18px 0 4px; color:var(--muted); font-size:11px; text-align:center; }
/* Toolbars and accounts */
.toolbar { display:flex; align-items:center; gap:9px; padding:16px 18px; border-bottom:1px solid var(--line-soft); }
.search-box { position:relative; display:flex; align-items:center; min-width:220px; flex:1; }
.search-box svg { position:absolute; left:11px; width:15px; height:15px; color:var(--muted); pointer-events:none; }
.search-box input { width:100%; padding-left:35px; background:var(--panel-2); font-size:11px; }
.toolbar select { width:auto; min-width:120px; color:var(--muted); background:var(--panel-2); font-size:11px; }
.toolbar-count { color:var(--muted); font-size:11px; white-space:nowrap; }
.bulk-bar { display:flex; align-items:center; gap:12px; min-height:43px; padding:7px 19px; border-bottom:1px solid var(--line-soft); font-size:10px; }
.check-label { display:flex; align-items:center; gap:7px; color:var(--muted); cursor:pointer; }
input[type="checkbox"] { width:14px; height:14px; padding:0; accent-color:var(--accent); cursor:pointer; }
.bulk-actions { display:flex; align-items:center; gap:5px; margin-left:auto; }
.bulk-actions b { margin-right:6px; color:var(--accent); font-size:10px; }
.bulk-actions button { padding:4px 8px; border:0; border-radius:6px; color:var(--muted); background:var(--panel-2); font-size:10px; }
.bulk-actions button:hover { color:var(--text); }
.account-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(275px,1fr)); gap:12px; padding:16px; }
.account-card { position:relative; min-width:0; padding:16px; border:1px solid var(--line); border-radius:13px; background:var(--panel-2); transition:border-color .18s,transform .18s,box-shadow .18s; }
.account-card:hover { transform:translateY(-1px); border-color:#364152; box-shadow:var(--shadow); }
.account-card.selected { border-color:rgba(var(--accent-rgb),.55); box-shadow:0 0 0 2px rgba(var(--accent-rgb),.06); }
.account-card.disabled { opacity:.62; }
.account-check { position:absolute; top:14px; right:13px; }
.account-head { display:flex; align-items:center; gap:10px; padding-right:20px; }
.account-avatar { display:grid; place-items:center; width:36px; height:36px; flex:none; border:1px solid rgba(var(--accent-rgb),.15); border-radius:10px; color:var(--accent); background:rgba(var(--accent-rgb),.07); font-size:12px; font-weight:750; text-transform:uppercase; }
.account-title { min-width:0; }
.account-title strong { display:block; overflow:hidden; font-size:12px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.account-title small { display:block; margin-top:1px; color:var(--muted); font-size:9px; }
.account-tags { display:flex; flex-wrap:wrap; gap:5px; margin:13px 0; }
.account-details { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px 0; border-top:1px solid var(--line-soft); }
.account-details span { min-width:0; color:var(--muted); font-size:9px; }
.account-details b { display:block; overflow:hidden; margin-top:2px; color:var(--text); font-size:10px; font-weight:550; text-overflow:ellipsis; white-space:nowrap; }
.quota-wrap { margin:2px 0 11px; }
.quota-label { display:flex; justify-content:space-between; margin-bottom:5px; color:var(--muted); font-size:9px; }
.quota-track { height:4px; overflow:hidden; border-radius:5px; background:var(--panel-3); }
.quota-track i { display:block; height:100%; border-radius:5px; background:var(--accent); }
.account-error { overflow:hidden; margin:0 0 10px; padding:7px 9px; border-radius:7px; color:var(--red); background:rgba(250,114,126,.06); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.account-actions { display:flex; gap:6px; padding-top:10px; border-top:1px solid var(--line-soft); }
.account-actions button { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:29px; padding:5px 9px; border:1px solid var(--line); border-radius:7px; color:var(--muted); background:transparent; font-size:9px; }
.account-actions button:hover { color:var(--text); background:var(--panel-3); }
.account-actions .delete-account { margin-left:auto; color:var(--red); }
.account-actions svg { width:12px; height:12px; }
.empty-state { grid-column:1/-1; display:grid; place-items:center; min-height:230px; padding:35px; color:var(--muted); text-align:center; }
.empty-state svg { width:32px; height:32px; margin-bottom:12px; color:#4d596b; }
.empty-state strong { display:block; margin-bottom:5px; color:var(--text); font-size:13px; }
.empty-state p { margin:0; font-size:11px; }
.empty-state .button { margin-top:15px; }
/* Models */
.notice { display:flex; align-items:flex-start; gap:9px; margin-bottom:14px; padding:11px 13px; border:1px solid rgba(97,168,250,.18); border-radius:11px; color:var(--muted); background:rgba(97,168,250,.05); font-size:11px; }
.notice svg { width:15px; height:15px; color:var(--blue); }
.notice.warning { border-color:rgba(238,182,92,.2); background:rgba(238,182,92,.05); }
.notice.warning svg { color:var(--amber); }
.model-toolbar { flex-wrap:wrap; }
.filter-chips { display:flex; gap:4px; padding:3px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.filter-chips button { padding:5px 10px; border:0; border-radius:7px; color:var(--muted); background:transparent; font-size:10px; }
.filter-chips button.active { color:var(--text); background:var(--panel-3); box-shadow:0 1px 4px rgba(0,0,0,.12); }
.list-caption { display:flex; justify-content:space-between; align-items:center; padding:12px 19px; color:var(--muted); font-size:10px; }
.legend { display:flex; align-items:center; gap:5px; font-size:9px; }
.legend i { width:5px; height:5px; margin-left:8px; border-radius:50%; }
.live-dot { background:var(--green); }.catalog-dot { background:#667285; }
.model-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(285px,1fr)); gap:12px; padding:0 16px 16px; }
.model-card { position:relative; display:flex; flex-direction:column; min-width:0; min-height:215px; padding:16px; border:1px solid var(--line); border-radius:13px; background:var(--panel-2); transition:.18s; }
.model-card:hover { border-color:#384354; transform:translateY(-1px); }
.model-head { display:flex; align-items:flex-start; gap:10px; }
.model-icon { display:grid; place-items:center; width:35px; height:35px; flex:none; border-radius:10px; color:var(--purple); background:rgba(139,124,246,.09); }
.model-icon.image,.model-icon.image-edit { color:var(--amber); background:rgba(238,182,92,.09); }
.model-icon.video { color:var(--blue); background:rgba(97,168,250,.09); }
.model-title { min-width:0; flex:1; }
.model-title h3 { overflow:hidden; margin:0 0 3px; font-size:12px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.model-title code { display:block; overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.favorite-btn { width:27px; height:27px; }
.favorite-btn.active { color:var(--amber); }
.favorite-btn.active svg { fill:currentColor; }
.model-description { display:-webkit-box; overflow:hidden; min-height:34px; margin:13px 0 10px; color:var(--muted); font-size:10px; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.model-tags { display:flex; flex-wrap:wrap; gap:5px; }
.model-tag { padding:2px 6px; border-radius:5px; color:var(--muted); background:var(--panel-3); font-size:8px; }
.model-footer { display:flex; align-items:center; gap:5px; margin-top:auto; padding-top:13px; }
.model-footer .pill { margin-right:auto; }
.model-footer button { display:inline-flex; align-items:center; gap:4px; padding:5px 7px; border:0; border-radius:6px; color:var(--muted); background:transparent; font-size:9px; }
.model-footer button:hover { color:var(--text); background:var(--panel-3); }
.model-footer svg { width:12px; height:12px; }
/* Keys and integration */
.integration-card { display:grid; grid-template-columns:minmax(210px,.7fr) minmax(300px,1.3fr); align-items:center; gap:14px 24px; margin-bottom:16px; padding:19px; }
.integration-card h2 { margin-top:5px; }
.integration-card p { margin:0; font-size:10px; }
.integration-card>.text-btn { grid-column:2; justify-self:start; }
.key-table-head,.key-row { display:grid; grid-template-columns:minmax(250px,1.5fr) minmax(80px,.4fr) minmax(120px,.55fr) 150px; align-items:center; gap:12px; }
.key-table-head { padding:0 20px 9px; color:var(--muted); font-size:9px; }
.key-list { padding:0 12px 12px; }
.key-row { padding:12px 8px; border-top:1px solid var(--line-soft); }
.key-identity { display:flex; align-items:center; gap:10px; min-width:0; }
.key-icon { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:9px; color:var(--amber); background:rgba(238,182,92,.08); }
.key-icon svg { width:15px; height:15px; }
.key-identity>div { min-width:0; }
.key-identity strong { display:block; overflow:hidden; margin-bottom:2px; font-size:11px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.key-identity code { display:block; overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.key-date { color:var(--muted); font-size:10px; }
.key-actions { display:flex; justify-content:flex-end; gap:2px; }
.key-actions .delete-key { color:var(--red); }
/* Logs */
.log-list { min-height:260px; padding:5px 16px 14px; }
.log-row { display:grid; grid-template-columns:135px 70px 65px minmax(160px,1fr) minmax(100px,.7fr); align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid var(--line-soft); font-size:10px; }
.log-row:last-child { border:0; }
.log-time,.log-error { overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
.log-method { color:var(--blue); font-family:monospace; font-weight:700; }
.log-path { overflow:hidden; font-family:monospace; text-overflow:ellipsis; white-space:nowrap; }
.log-status { width:max-content; padding:2px 7px; border-radius:5px; font-size:9px; }
.log-status.success { color:var(--green); background:rgba(67,214,158,.08); }.log-status.error { color:var(--red); background:rgba(250,114,126,.08); }
/* Modal and toast */
.modal { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px; background:rgba(2,4,8,.74); backdrop-filter:blur(7px); animation:fadeIn .15s ease; }
.modal-card { width:min(560px,100%); max-height:90vh; overflow:auto; padding:22px; border:1px solid #303a49; border-radius:18px; background:var(--panel); box-shadow:0 35px 100px rgba(0,0,0,.55); animation:slideUp .2s ease; }
.modal-card.modal-wide { width:min(720px,100%); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; margin-bottom:19px; }
.modal-head h2 { margin:5px 0 0; font-size:19px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.modal-card .hint { margin-bottom:14px; padding:12px 13px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:var(--panel-2); font-size:11px; }
.hint strong { color:var(--text); }.hint ol { margin:7px 0 0; padding-left:18px; }.hint li { margin:3px 0; }.hint a { color:var(--accent); }
.modal-divider { display:flex; align-items:center; gap:10px; margin:15px 0; color:var(--muted); font-size:10px; }
.modal-divider:before,.modal-divider:after { content:""; height:1px; flex:1; background:var(--line); }
.import-textarea { margin:5px 0 10px; }
.file-button { position:relative; overflow:hidden; }
.file-button input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.confirm-card { width:min(390px,100%); text-align:center; }
.confirm-icon { display:grid; place-items:center; width:45px; height:45px; margin:0 auto 14px; border-radius:13px; color:var(--red); background:rgba(250,114,126,.09); }
.confirm-card h2 { font-size:18px; }.confirm-card p { margin-bottom:22px; font-size:12px; white-space:pre-line; }
.confirm-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.toast-stack { position:fixed; right:20px; bottom:20px; z-index:150; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.toast { display:flex; align-items:center; gap:9px; width:min(360px,calc(100vw - 40px)); padding:11px 14px; border:1px solid #354052; border-radius:11px; color:var(--text); background:var(--panel-3); box-shadow:0 15px 45px rgba(0,0,0,.35); font-size:11px; animation:slideUp .2s ease; }
.toast svg { width:15px; height:15px; color:var(--green); }.toast.bad { border-color:rgba(250,114,126,.35); }.toast.bad svg { color:var(--red); }
.code-block { position:relative; margin:10px 0; padding:14px; overflow:auto; border:1px solid var(--line); border-radius:10px; color:#b9c7d8; background:#090c12; font:10px/1.65 "SFMono-Regular",Consolas,monospace; white-space:pre-wrap; word-break:break-all; }
.code-tabs { display:flex; gap:5px; margin-bottom:5px; }
.code-tabs button { padding:5px 10px; border:1px solid var(--line); border-radius:7px; color:var(--muted); background:var(--panel-2); font-size:10px; }
.code-tabs button.active { color:var(--accent); border-color:rgba(var(--accent-rgb),.3); }
.secret-reveal { padding:14px; border:1px solid rgba(var(--accent-rgb),.25); border-radius:11px; background:rgba(var(--accent-rgb),.05); }
.secret-reveal code { display:block; overflow-wrap:anywhere; margin:8px 0 12px; color:var(--accent); font-size:12px; }
@keyframes fadeIn { from { opacity:0; } }
@keyframes slideUp { from { opacity:0; transform:translateY(8px); } }
/* Responsive */
.sidebar-mask { display:none; }
@media (min-width:1500px) { main { padding-left:42px; padding-right:42px; }.account-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1050px) { .stats { grid-template-columns:repeat(2,1fr); }.overview-grid { grid-template-columns:1fr; }.key-table-head,.key-row { grid-template-columns:minmax(220px,1fr) 80px 130px; }.key-table-head span:nth-child(3),.key-date { display:none; }.log-row { grid-template-columns:115px 60px 55px 1fr; }.log-error { display:none; } }
@media (max-width:800px) {
  .login { grid-template-columns:1fr; }.login-visual { display:none; }.login-form-wrap { min-height:100vh; background:radial-gradient(circle at 50% 10%,rgba(53,213,174,.09),transparent 40%),#090b10; }.mobile-login-logo { display:grid; margin-bottom:24px; }
  .sidebar { transform:translateX(-100%); transition:transform .22s ease; box-shadow:20px 0 60px rgba(0,0,0,.35); }.app-shell.menu-open .sidebar { transform:translateX(0); }.sidebar-mask { position:fixed; inset:0; z-index:35; background:rgba(0,0,0,.55); }.app-shell.menu-open .sidebar-mask { display:block; }
  .workspace { margin-left:0; }.mobile-menu { display:grid; margin-left:-8px; margin-right:8px; }.topbar { padding:0 20px; }.refresh-select { display:none; }main { padding:24px 20px 40px; }.footer { padding:15px 20px; }
  .integration-card { grid-template-columns:1fr; }.integration-card>.text-btn { grid-column:1; }.key-table-head { display:none; }.key-row { grid-template-columns:minmax(180px,1fr) 70px 125px; }.log-row { grid-template-columns:100px 55px 1fr; }.log-method { display:none; }
}
@media (max-width:560px) {
  h1 { font-size:24px; }.topbar { min-height:58px; padding:0 13px; }.top-actions { gap:5px; }.top-actions .button { width:34px; min-height:34px; padding:0; }.top-actions .button span { display:none; }.top-avatar { display:none; }.breadcrumb { font-size:10px; }main { padding:20px 12px 35px; }
  .page-head,.hero { align-items:flex-start; margin-bottom:20px; }.page-head { flex-direction:column; }.page-head>.button,.page-head>.head-actions { width:100%; }.head-actions .button { flex:1; }.hero .button { padding:8px 10px; font-size:10px; }.hero p { max-width:250px; }
  .stats { gap:9px; }.stat { gap:10px; padding:13px; }.stat-icon { width:34px; height:34px; border-radius:10px; }.stat-icon svg { width:16px; height:16px; }.stat strong { font-size:22px; }.stat div>span { display:none; }
  .overview-grid>.card,.recent-card { padding:15px; }.health-ring-wrap { justify-content:space-between; }.health-ring { width:100px; height:100px; }.endpoint-box { gap:7px; }.endpoint-method { display:none; }.quick-links { gap:13px; }
  .toolbar { flex-wrap:wrap; padding:12px; }.search-box { min-width:100%; }.toolbar select { flex:1; min-width:0; }.toolbar>.button { flex:none; }.bulk-bar { flex-wrap:wrap; padding:8px 13px; }.bulk-actions { width:100%; margin-left:0; overflow-x:auto; }.account-grid,.model-grid { grid-template-columns:1fr; padding:12px; }.account-card { padding:14px; }
  .model-toolbar .search-box { min-width:100%; }.filter-chips { width:100%; overflow-x:auto; }.filter-chips button { flex:1; white-space:nowrap; }.list-caption { align-items:flex-start; gap:8px; }.legend { flex-wrap:wrap; justify-content:flex-end; }
  .integration-card { padding:15px; }.key-row { position:relative; grid-template-columns:1fr auto; padding:13px 5px; }.key-row>.pill { display:none; }.key-actions { grid-column:2; grid-row:1; }.key-identity { padding-right:4px; }.key-actions .icon-btn { width:29px; height:29px; }
  .log-list { padding:4px 10px 12px; }.log-row { grid-template-columns:78px 48px 1fr; gap:6px; }.log-time { font-size:8px; }.log-path { font-size:9px; }.form-grid { grid-template-columns:1fr; gap:0; }.modal { padding:12px; }.modal-card { padding:18px; border-radius:15px; }.footer { font-size:8px; }.footer span:last-child { display:none; }
}
@media (prefers-reduced-motion:reduce) { *,*:before,*:after { scroll-behavior:auto!important; animation:none!important; transition:none!important; } }
