:root {
  --bg:oklch(98.2% .005 95); --surface:oklch(99% .004 95); --soft:oklch(94.8% .011 95); --text:oklch(18.5% .003 100);
  --muted:oklch(50% .01 95); --border:oklch(92% .013 95); --accent:oklch(62% .14 39); --accent-soft:color-mix(in srgb,var(--accent) 12%,var(--bg));
  --field-border:oklch(90% .014 95); --placeholder:oklch(60% .01 95); --text-body:14px; --text-caption:12px; --radius:10px;
  --success:#26774e; --danger:#b94f46; --nav-width:240px; --skeleton:#ebe9e2;
  color-scheme:light; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
  font-synthesis:none; background:var(--bg); color:var(--text);
}
:root[data-theme=dark] {
  --bg:oklch(21.5% .002 90); --surface:oklch(24% .002 90); --soft:oklch(30% .003 90); --text:oklch(97.5% .005 95); --muted:oklch(72% .008 95);
  --border:oklch(100% 0 0 / .1); --accent:oklch(67% .13 40); --accent-soft:color-mix(in srgb,var(--accent) 16%,var(--bg)); --success:#78c79b;
  --field-border:oklch(100% 0 0 / .15); --placeholder:oklch(70.8% 0 0);
  --danger:#ef9a8e; --skeleton:#373730; color-scheme:dark;
}
* { box-sizing:border-box; }
body { margin:0; font-size:var(--text-body); line-height:1.5; background:var(--bg); color:var(--text); }
button,input,textarea,select { font:inherit; }
a { color:inherit; text-decoration:none; }
button,a { cursor:pointer; -webkit-tap-highlight-color:transparent; }
button { background:none; border:0; color:inherit; touch-action:manipulation; }
button:disabled { opacity:.5; cursor:not-allowed; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:24px; line-height:1.4; letter-spacing:-.6px; font-weight:700; }
h2 { font-size:var(--text-body); font-weight:550; line-height:1.5; }
h3 { font-size:var(--text-body); font-weight:550; }
small { font-size:var(--text-caption); }
code,pre { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.muted { color:var(--muted); font-size:var(--text-body); line-height:1.7; }
input,textarea,select { border:1px solid var(--field-border); background:var(--surface); color:var(--text); border-radius:8px; padding:7px 11px; outline:none; min-height:36px; }
input,textarea { width:100%; }
input::placeholder,textarea::placeholder { color:var(--placeholder); }
input:focus,textarea:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent); }
textarea { resize:vertical; line-height:1.7; font-size:var(--text-body); }
select { max-width:100%; font-size:var(--text-body); }
label:not(.search) { display:block; font-size:var(--text-body); margin:19px 0 7px; font-weight:500; }
.primary,.secondary,.danger { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:34px; padding:6px 12px; border-radius:6px; font-size:var(--text-body); font-weight:500; border:1px solid transparent; white-space:nowrap; }
.primary { background:var(--accent); color:#fff; }
.primary:hover { filter:brightness(.96); }
.secondary { background:var(--soft); color:var(--text); }
.secondary:hover { border-color:var(--border); }
.danger { background:var(--danger); color:#fff; }
.full { width:100%; justify-content:space-between; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; min-width:32px; min-height:32px; padding:4px 8px; border-radius:6px; font-size:17px; color:var(--muted); }
.icon-btn:hover { background:var(--soft); }
.text-btn { font-size:var(--text-caption); color:var(--accent); padding:3px 0; }
.dot { display:inline-block; width:6px; height:6px; background:var(--success); border-radius:50%; flex-shrink:0; }
.brand { display:flex; color:var(--accent); font-size:0; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:-.8px; }
.brand>span { font-size:24px; font-weight:500; }
.brand small,.nav-label { display:none; }
.app-layout { display:flex; min-height:100dvh; }
.sidebar { position:fixed; inset:0 auto 0 0; width:var(--nav-width); padding:17px 12px; border-right:1px solid var(--border); background:var(--bg); display:flex; flex-direction:column; z-index:40; overflow-y:auto; }
.sidebar .brand { margin:0 8px 25px; line-height:1.25; }
nav { display:grid; gap:1px; }
nav button { position:relative; display:flex; align-items:center; gap:11px; text-align:left; min-height:32px; padding:5px 10px; border-radius:6px; font-size:var(--text-body); white-space:nowrap; }
nav button>span { display:grid; place-items:center; color:var(--muted); width:16px; flex-shrink:0; }
nav button>span svg { width:16px; height:16px; }
nav button:hover { background:var(--soft); }
nav button.active,nav button.active:hover { background:var(--accent-soft); color:var(--accent); font-weight:550; }
nav button.active>span { color:var(--accent); }
nav b { margin-left:auto; background:var(--soft); color:var(--muted); font-size:var(--text-caption); padding:0 5px; border-radius:3px; font-weight:400; }
nav [data-page=models],nav [data-page=accounts] { margin-top:29px; }
nav [data-page=models]::before,nav [data-page=accounts]::before { content:''; position:absolute; top:-15px; left:12px; right:12px; border-top:1px solid var(--border); }
.sidebar-bottom { margin-top:auto; padding:30px 8px 0; color:var(--muted); font-size:var(--text-caption); }
.private-label { display:flex; align-items:center; gap:8px; padding:9px; border:1px solid var(--border); border-radius:6px; font-size:var(--text-caption); }
.sidebar-bottom button { display:flex; justify-content:space-between; width:100%; font-size:var(--text-caption); color:var(--muted); margin:17px 0 12px; }
.sidebar-bottom small { font-size:var(--text-caption); }
main { margin-left:var(--nav-width); min-width:0; flex:1; }
header { height:64px; padding:0 28px; display:flex; align-items:center; gap:12px; }
.breadcrumb { margin-right:auto; color:var(--muted); font-size:var(--text-caption); }
.breadcrumb span { color:var(--border); margin:0 12px; }
.breadcrumb strong { color:var(--text); font-weight:500; }
.header-right { display:flex; align-items:center; gap:13px; }
.header-docs { color:var(--muted); }
.connection { display:flex; align-items:center; gap:7px; font-size:var(--text-caption); color:var(--muted); min-width:104px; }
.avatar { display:grid; place-items:center; width:31px; height:31px; border-radius:50%; background:var(--soft); border:1px solid var(--border); font-size:var(--text-caption); }
.content { width:100%; max-width:1280px; margin:0 auto; padding:32px 40px 24px; }
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:35px; min-height:38px; }
.page-heading .eyebrow,.page-heading #page-subtitle { display:none; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:15px; }
.section-heading>div { min-width:0; }
.section-heading select { width:180px; flex:0 0 auto; }
.section-heading .muted { font-size:var(--text-caption); margin-top:5px; }
.panel { min-width:0; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:14px; }
.panel-head .muted { font-size:var(--text-caption); margin-top:5px; }
.recent { margin-top:30px; }
.data-surface,.balance-card,.endpoint-card,.endpoint-panel,.account-card,.filter-surface { background:var(--surface); border:1px solid var(--border); border-radius:9px; }
.data-surface { overflow:hidden; }
.overview-top { display:grid; grid-template-columns:1fr 1fr; gap:30px; margin-bottom:32px; }
.balance-card,.endpoint-card { height:190px; overflow:hidden; display:flex; flex-direction:column; }
.balance-main { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:23px 20px; flex:1; }
.balance-value { display:flex; align-items:baseline; gap:9px; line-height:1.2; }
.balance-value strong { font-size:32px; font-weight:600; letter-spacing:-.8px; }
.balance-value>span { font-size:var(--text-caption); color:var(--muted); }
.balance-main p { font-size:var(--text-caption); margin-top:8px; }
.metric-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid var(--border); margin:0; }
.metric-strip>div { padding:14px 20px; border-right:1px solid var(--border); min-width:0; }
.metric-strip>div:last-child { border-right:0; }
.metric-strip dt { font-size:var(--text-caption); color:var(--muted); margin-bottom:4px; }
.metric-strip dd { margin:0; font-size:var(--text-body); font-weight:500; }
.metric-strip small { display:none; }
.endpoint-card>p { padding:17px 20px 9px; font-size:var(--text-caption); }
.endpoint-copy { display:flex; align-items:center; gap:10px; margin:0 20px 17px; }
.endpoint-copy code { display:block; flex:1; font-size:var(--text-caption); border:1px solid var(--border); border-radius:6px; padding:7px 10px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.endpoint-copy .icon-btn { background:var(--soft); color:var(--text); }
.endpoint-card .metric-strip { margin-top:auto; }
.stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--border); border-radius:9px; overflow:hidden; background:var(--surface); margin-bottom:30px; }
.stat { padding:19px 20px; border-right:1px solid var(--border); min-width:0; }
.stat:last-child { border-right:0; }
.stat>div { color:var(--muted); font-size:var(--text-caption); }
.stat strong { display:block; font-size:26px; font-weight:600; letter-spacing:-.5px; margin:7px 0 4px; line-height:1.3; }
.stat small { font-size:var(--text-caption); color:var(--muted); }
.account-row { display:flex; align-items:center; gap:13px; padding:19px 20px; border-bottom:1px solid var(--border); }
.account-row:last-child { border-bottom:0; }
.account-avatar { display:grid; place-items:center; flex-shrink:0; width:34px; height:34px; border-radius:7px; background:var(--soft); color:var(--accent); font-size:var(--text-body); }
.identity { min-width:0; flex:1; }
.identity strong { display:block; font-size:var(--text-body); font-weight:550; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.identity small { display:block; font-size:var(--text-caption); color:var(--muted); margin-top:3px; }
.quota-inline { min-width:110px; text-align:right; font-size:var(--text-body); }
.quota-inline small { display:block; color:var(--muted); font-size:var(--text-caption); margin-top:2px; }
.badge { display:inline-flex; align-items:center; gap:5px; padding:2px 7px; border-radius:4px; color:var(--success); background:color-mix(in srgb,var(--success) 8%,var(--surface)); font-size:var(--text-caption); white-space:nowrap; }
.badge::before { content:''; width:4px; height:4px; border-radius:50%; background:currentColor; }
.badge.off { background:var(--soft); color:var(--muted); }
.badge.bad { background:color-mix(in srgb,var(--danger) 7%,var(--surface)); color:var(--danger); }
.tag { display:inline-flex; align-items:center; font-size:var(--text-caption); color:var(--muted); background:var(--soft); padding:3px 8px; border-radius:4px; }
.table-wrap { overflow-x:auto; max-width:100%; border:1px solid var(--border); border-radius:9px; background:var(--surface); overscroll-behavior-x:contain; }
.data-surface>.table-wrap { border:0; border-radius:0; }
table { width:100%; text-align:left; border-collapse:collapse; white-space:nowrap; font-size:var(--text-body); }
th { color:var(--muted); background:color-mix(in srgb,var(--soft) 65%,var(--surface)); font-size:var(--text-caption); font-weight:400; padding:11px 16px; border-bottom:1px solid var(--border); }
td { padding:15px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:0; }
td strong { font-size:var(--text-body); font-weight:500; }
td code { font-size:var(--text-caption); }
td small { font-size:var(--text-caption); color:var(--muted); }
tbody tr:hover { background:color-mix(in srgb,var(--soft) 36%,transparent); }
td details { color:var(--muted); font-size:var(--text-caption); margin-top:4px; white-space:normal; min-width:180px; }
summary { cursor:pointer; }
td summary { color:var(--accent); }
.row-actions { white-space:normal; min-width:190px; line-height:2; }
.row-actions button { min-height:28px; }
.pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; background:var(--surface); padding:14px 16px; border:1px solid var(--border); border-top:0; color:var(--muted); font-size:var(--text-caption); }
.pagination>div { display:flex; gap:8px; }
#activity-list>.table-wrap { border-radius:9px 9px 0 0; }
.table-note { padding:0 16px 15px; background:var(--surface); border:1px solid var(--border); border-top:0; border-radius:0 0 9px 9px; color:var(--muted); font-size:var(--text-caption); }
.toolbar,.filter-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:17px; }
.toolbar { justify-content:space-between; }
.toolbar>.muted { font-size:var(--text-caption); }
.search { display:flex; align-items:center; gap:4px; min-width:0; border:1px solid var(--border); border-radius:7px; padding-left:10px; background:var(--surface); color:var(--muted); }
.search input { border:0; box-shadow:none; background:transparent; font-size:var(--text-body); min-width:0; width:260px; }
.filter-bar select { width:auto; max-width:270px; }
.filter-bar>.muted { margin-left:auto; font-size:var(--text-caption); }
.segmented { display:flex; gap:2px; padding:3px; border-radius:6px; background:var(--soft); margin-left:auto; }
.segmented button { color:var(--muted); padding:2px 9px; border-radius:4px; min-height:27px; }
.segmented button.active { color:var(--text); background:var(--surface); box-shadow:0 1px 3px #0001; }
.endpoint-panel { display:flex; align-items:center; justify-content:space-between; padding:18px 16px; gap:15px; margin-bottom:28px; }
.endpoint-panel h2 { font-size:var(--text-caption); color:var(--muted); margin-bottom:7px; }
.endpoint-panel code { font-size:var(--text-body); overflow-wrap:anywhere; }
.models-layout { display:grid; grid-template-columns:185px minmax(0,1fr); gap:18px; }
.model-filter-panel>.section-heading { height:36px; margin-bottom:12px; }
.filter-surface { overflow:hidden; padding:15px 10px; }
.filter-surface h3 { margin:0 7px 9px; color:var(--muted); font-size:var(--text-caption); font-weight:400; }
#model-account-buttons { display:grid; gap:2px; }
#model-account-buttons button { display:flex; justify-content:space-between; align-items:center; text-align:left; padding:6px 8px; border-radius:5px; font-size:var(--text-body); }
#model-account-buttons button>span { color:var(--muted); font-size:var(--text-caption); margin-left:5px; }
#model-account-buttons button.active { background:var(--accent-soft); color:var(--accent); font-weight:550; }
.filter-surface label { margin:23px 7px 9px; padding-top:14px; border-top:1px solid var(--border); font-size:var(--text-caption); color:var(--muted); }
.filter-surface select { width:100%; font-size:var(--text-caption); }
#model-account-filter,.mobile-filter-label { display:none!important; }
.model-results>.filter-bar { margin-bottom:18px; }
.model-results .search { flex:1; }
.model-results .search input { width:100%; }
.model-results .panel-head { padding:12px 15px; margin:0; border:1px solid var(--border); border-bottom:0; border-radius:9px 9px 0 0; background:var(--surface); }
.model-results .panel-head h2 { display:none; }
.model-results .panel-head .muted { margin-top:0; font-size:var(--text-caption); }
.model-results .panel-head .primary { font-size:var(--text-caption); min-height:30px; padding:4px 8px; }
.model-note { margin:0; padding:9px 15px; background:var(--surface); border:1px solid var(--border); border-bottom:0; border-radius:0!important; color:var(--muted); font-size:var(--text-caption); }
.model-note p { margin-top:9px; font-size:var(--text-caption); }
#model-errors:empty { display:none; }
#model-errors:not(:empty) { border-bottom:1px solid var(--border); }
#model-list>.table-wrap { border-radius:0 0 9px 9px; }
.model-id { display:flex; align-items:center; gap:4px; color:var(--muted); }
.model-id code { font-size:var(--text-caption); }
.model-id .icon-btn { font-size:var(--text-body); min-width:26px; min-height:26px; }
.model-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding-top:14px; }
.model-card { border:1px solid var(--border); border-radius:8px; background:var(--surface); padding:17px; min-width:0; }
.model-card-head>strong { font-size:var(--text-body); font-weight:550; }
.model-card>.muted { font-size:var(--text-caption); margin:10px 0 17px; }
.model-card dl { font-size:var(--text-caption); grid-template-columns:74px minmax(0,1fr); gap:9px; }
.model-controls { margin-top:15px; padding-top:11px; border-top:1px solid var(--border); color:var(--accent); font-size:var(--text-caption); }
.inline-status { display:inline-flex; align-items:center; gap:6px; font-size:var(--text-caption); color:var(--muted); }
.inline-status:empty { display:none; }
.inline-status.is-updating::before { content:''; display:block; width:9px; height:9px; border:1px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.account-card { padding:20px; min-width:0; }
.account-card-head { display:flex; align-items:center; gap:11px; }
.account-card .quota { font-size:29px; font-weight:550; margin-top:24px; line-height:1.4; letter-spacing:-.6px; }
.account-card .quota small { margin-left:6px; font-size:var(--text-caption); color:var(--muted); font-weight:400; letter-spacing:0; }
progress.progress { width:100%; display:block; height:4px; margin:12px 0; border:0; appearance:none; background:var(--soft); border-radius:4px; overflow:hidden; }
progress.progress::-webkit-progress-bar { background:var(--soft); border-radius:4px; }
progress.progress::-webkit-progress-value { background:var(--accent); border-radius:4px; }
progress.progress::-moz-progress-bar { background:var(--accent); border-radius:4px; }
.meta { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:var(--text-caption); }
.account-facts { display:grid; grid-template-columns:1fr; gap:10px; margin:23px 0 18px; font-size:var(--text-caption); }
.account-facts>div { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.account-facts dt { color:var(--muted); }
.account-facts dd { margin:0; }
.account-facts code { font-size:var(--text-caption); }
.model-details { border-top:1px solid var(--border); padding-top:12px; font-size:var(--text-caption); color:var(--muted); margin-top:12px; }
.model-details summary { display:flex; justify-content:space-between; align-items:center; }
.model-details summary>span { background:var(--soft); padding:0 5px; border-radius:3px; font-size:var(--text-caption); }
.model-details .muted { font-size:var(--text-caption); margin-top:12px; }
.model-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:13px; }
.model-chips code { padding:4px 6px; background:var(--soft); border-radius:4px; color:var(--text); font-size:var(--text-caption); }
.account-actions { display:flex; align-items:center; gap:20px; border-top:1px solid var(--border); margin-top:16px; padding-top:10px; }
.account-actions button,.account-actions summary { color:var(--accent); font-size:var(--text-caption); padding:5px 0; min-height:30px; }
.account-menu { position:relative; margin-left:auto; }
.account-menu>summary { color:var(--muted); list-style:none; }
.account-menu-popover { position:absolute; top:35px; right:0; z-index:15; min-width:175px; padding:6px; background:var(--surface); border:1px solid var(--border); border-radius:7px; box-shadow:0 7px 24px #0001; }
.account-menu-popover button { width:100%; display:block; text-align:left; color:var(--text); padding:7px 9px; border-radius:4px; }
.account-menu-popover button:hover { background:var(--soft); }
.account-menu-popover [data-action=remove-account] { color:var(--danger); }
.account-error,.console-alert { padding:10px 13px; border:1px solid color-mix(in srgb,var(--danger) 22%,var(--border)); border-radius:6px; color:var(--danger); background:color-mix(in srgb,var(--danger) 5%,var(--surface)); font-size:var(--text-caption); margin-top:15px; }
.console-alert { margin:0 0 24px; background:var(--accent-soft); border-color:var(--border); color:var(--accent); }
.import-guide { padding:14px 16px; border:1px solid var(--border); background:var(--surface); border-radius:8px; margin-bottom:22px; }
.import-guide summary { color:var(--muted); font-size:var(--text-body); }
.import-guide ol { color:var(--muted); font-size:var(--text-caption); line-height:1.9; padding-left:20px; }
#page-accounts>.panel[aria-label] { display:flex; align-items:center; gap:20px; padding:13px 16px; background:var(--surface); border:1px solid var(--border); border-radius:8px; margin-bottom:20px; }
#page-accounts>.panel[aria-label] .dialog-head { margin:0; flex:0 0 auto; gap:16px; }
#page-accounts>.panel[aria-label] h3 { font-size:var(--text-body); }
#maintenance-run { color:var(--accent); font-size:var(--text-caption); }
#maintenance-status { background:none; border:0; padding:0; margin:0; font-size:var(--text-caption); }
.note { color:var(--muted); background:var(--soft); border:1px solid var(--border); border-radius:7px; padding:12px 14px; font-size:var(--text-caption); line-height:1.8; margin-top:18px; }
.error-text { color:var(--danger); font-size:var(--text-caption); line-height:1.7; margin-top:10px; }
.error-text:empty { display:none; }
.subscription-card h2 { margin:15px 0 0; }
.subscription-card .section-heading { margin-bottom:0; }
.subscription-card dl { margin:22px 0; }
dl:not(.metric-strip):not(.account-facts) { display:grid; grid-template-columns:88px minmax(0,1fr); gap:12px; font-size:var(--text-caption); }
dt { color:var(--muted); }
dd { margin:0; overflow-wrap:anywhere; }
.chart { position:relative; min-height:260px; padding:15px 20px; border:1px solid var(--border); border-radius:9px; background:var(--surface); }
.chart svg { width:100%; display:block; max-height:290px; }
.chart text { fill:var(--muted); font-size:var(--text-caption); }
.chart-grid { stroke:var(--border); stroke-dasharray:3 4; }
.chart-success { fill:var(--success); }
.chart-failure { fill:var(--accent); }
.chart g:hover rect { opacity:.7; }
.chart-empty { text-align:center; font-size:var(--text-caption); }
.legend { display:flex; align-items:center; gap:6px; font-size:var(--text-caption); color:var(--muted); }
.legend i { width:6px; height:6px; border-radius:2px; background:var(--success); }
.legend .failed { background:var(--accent); margin-left:9px; }
.status-banner { display:flex; align-items:center; gap:15px; padding:22px; border:1px solid var(--border); border-radius:9px; background:var(--surface); margin-bottom:28px; }
.status-banner h2 { font-size:17px; font-weight:550; }
.status-banner p { font-size:var(--text-caption); color:var(--muted); margin-top:4px; }
.status-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; color:var(--success); background:color-mix(in srgb,var(--success) 9%,var(--surface)); font-size:21px; flex-shrink:0; }
.status-banner.warning .status-mark { color:var(--accent); background:var(--accent-soft); }
#service-accounts { background:var(--surface); border:1px solid var(--border); border-radius:9px; overflow:hidden; }
.service-row,.setting-row { display:flex; align-items:center; justify-content:space-between; gap:22px; padding:19px 20px; border-bottom:1px solid var(--border); background:var(--surface); }
.service-row:last-child { border-bottom:0; }
.service-row strong { font-size:var(--text-body); font-weight:500; }
.service-row p,.setting-row p { color:var(--muted); font-size:var(--text-caption); margin-top:5px; }
.service-row>div:last-child { text-align:right; }
.setting-row { border-left:1px solid var(--border); border-right:1px solid var(--border); }
.panel-head+.setting-row { border-top:1px solid var(--border); border-radius:9px 9px 0 0; }
.setting-row:last-child { border-radius:0 0 9px 9px; }
.setting-row select { width:140px; flex-shrink:0; }
.setting-row code { font-size:var(--text-caption); }
.inline-input { display:flex!important; align-items:center; gap:8px; margin:0!important; white-space:nowrap; color:var(--muted); font-size:var(--text-caption)!important; }
.inline-input input { width:78px; }
.switch { display:flex!important; align-items:center; gap:7px; margin:0!important; font-size:var(--text-caption)!important; white-space:nowrap; }
.switch input { width:17px; min-height:17px; accent-color:var(--accent); }
.guide-grid { display:grid; grid-template-columns:1fr 1.2fr; gap:22px; margin-bottom:25px; }
.guide { padding:23px; background:var(--surface); border:1px solid var(--border); border-radius:9px; }
.guide h2 { margin-bottom:12px; font-size:16px; }
.guide>.muted { margin-bottom:20px; font-size:var(--text-body); }
.step { display:inline-flex; font-size:var(--text-caption); background:var(--soft); padding:4px 7px; border-radius:4px; margin-bottom:16px; color:var(--muted); }
pre,.secret-value { background:var(--soft); color:var(--text); border:1px solid var(--border); border-radius:7px; padding:16px; overflow:auto; font-size:var(--text-caption); line-height:1.8; white-space:pre; }
.secret-value { user-select:text; -webkit-user-select:text; white-space:pre-wrap; overflow-wrap:anywhere; cursor:text; }
.chat-messages { min-height:300px; max-height:56vh; overflow:auto; padding:20px 5px; scrollbar-gutter:stable; }
.chat-empty { text-align:center; padding:65px 20px; }
.chat-empty>span { display:block; font-size:42px; color:var(--accent); margin-bottom:18px; }
.chat-empty h2 { font-size:21px; margin-bottom:10px; }
.chat-message { max-width:88%; margin-bottom:22px; }
.chat-message>small { display:block; color:var(--muted); font-size:var(--text-caption); margin-bottom:5px; }
.chat-message>div { white-space:pre-wrap; overflow-wrap:anywhere; font-size:var(--text-body); line-height:1.9; }
.chat-message.user { margin-left:auto; background:var(--soft); border:1px solid var(--border); border-radius:10px; padding:11px 15px; max-width:75%; width:fit-content; }
.chat-message.assistant { padding:0 13px; }
.chat-composer { position:sticky; bottom:15px; border:1px solid var(--border); border-radius:10px; padding:12px; background:var(--surface); }
.chat-composer textarea { border:0; background:none; padding:3px; box-shadow:none; min-height:75px; }
.chat-composer>div { display:flex; align-items:center; justify-content:flex-end; gap:9px; }
.chat-composer .muted { margin-right:auto; font-size:var(--text-caption); }
#page-chat>.note { margin-top:0; }
#chat-key,#chat-model { max-width:300px; }
.empty { padding:43px 20px; text-align:center; color:var(--muted); font-size:var(--text-body); line-height:1.9; }
.empty-icon { display:block; font-size:28px; margin-bottom:10px; opacity:.4; }
.empty button { margin-top:13px; }
footer { display:flex; justify-content:space-between; gap:15px; padding-top:19px; margin-top:37px; border-top:1px solid var(--border); color:var(--muted); font-size:var(--text-caption); }
dialog { width:min(570px,calc(100vw - 30px)); max-height:90dvh; overflow:auto; padding:25px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--text); box-shadow:0 16px 70px #0003; }
dialog::backdrop { background:#17171466; backdrop-filter:blur(2px); }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:13px; }
.dialog-head h2 { font-size:19px; font-weight:550; }
dialog .muted { font-size:var(--text-body); }
dialog select { width:100%; }
dialog form>.primary { margin-top:17px; }
fieldset { border:1px solid var(--border); border-radius:7px; margin:18px 0; padding:13px; }
legend { padding:0 6px; font-size:var(--text-body); }
fieldset .note { margin-top:0; font-size:var(--text-caption); }
.file-label { display:flex!important; align-items:center; justify-content:space-between; gap:8px; border:1px dashed var(--border); color:var(--accent); padding:12px; border-radius:7px; font-size:var(--text-caption)!important; cursor:pointer; }
#account-file,.file-input { position:absolute; width:1px; height:1px; padding:0; border:0; opacity:0; }
.button-row { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin-top:18px; }
.button-row.end { justify-content:flex-end; }
#toast { position:fixed; bottom:max(24px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); padding:11px 20px; max-width:90vw; background:var(--text); color:var(--bg); border-radius:7px; font-size:var(--text-caption); z-index:200; box-shadow:0 6px 20px #0002; }
.login-layout { display:grid; grid-template-columns:1fr 1fr; min-height:100dvh; padding:12px; }
.login-art { display:flex; flex-direction:column; justify-content:space-between; position:relative; isolation:isolate; overflow:hidden; padding:35px 45px; min-height:calc(100dvh - 24px); border-radius:9px; color:#26251f; }
.login-art>.brand { margin-bottom:auto; }
.login-art .brand>span { color:#a66d50; }
.login-art>div:not(.landscape) { margin-top:auto; margin-bottom:0; padding-bottom:20px; }
.login-art h1 { color:#292620; font-size:26px; line-height:1.5; margin-bottom:12px; }
.login-art .intro { color:#7d7165; font-size:var(--text-body); line-height:1.9; }
.login-art .eyebrow,.login-badge,.login-art>small { display:none; }
.landscape { position:absolute; inset:0; z-index:-1; overflow:hidden; background:linear-gradient(#f0ede6 15%,#ead8c9 70%,#dfb89a); }
.landscape i { position:absolute; width:150%; height:70%; left:-20%; top:30%; border-radius:48% 52% 0 0; transform:rotate(-15deg); background:linear-gradient(155deg,#e9d5c4,#d49c7d 80%); filter:blur(2px); }
.landscape i:nth-child(2) { top:45%; left:-35%; transform:rotate(13deg); background:linear-gradient(155deg,#e9cbb5,#b96e4e 85%); }
.landscape i:nth-child(3) { top:67%; left:-5%; transform:rotate(-25deg); background:linear-gradient(160deg,#d6a283,#f0dfd0 80%); }
.login-panel { display:flex; align-items:center; justify-content:center; padding:40px; }
.login-panel form { width:min(100%,385px); }
.login-panel h2 { font-size:24px; font-weight:600; margin-bottom:8px; }
.login-panel>.muted,.login-panel form>.muted { font-size:var(--text-body); margin-bottom:32px; }
.login-panel .primary { margin-top:20px; }
.login-panel label { font-size:var(--text-body); margin-top:19px; }
.login-panel .note { font-size:var(--text-caption); margin-top:28px; }
.small-icon { display:none; }
.password-field { position:relative; }
.password-field input { padding-right:42px; }
.password-field .icon-btn { position:absolute; top:50%; right:4px; transform:translateY(-50%); font-size:var(--text-body); }
/* Async states: loading, retained refresh, empty, error and retry. */
.spinner { display:inline-block; width:13px; height:13px; border:1.5px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .7s linear infinite; flex-shrink:0; }
@keyframes spin { to { transform:rotate(360deg); } }
#network-bar { display:none; position:fixed; top:0; left:0; right:0; height:2px; z-index:500; overflow:hidden; background:color-mix(in srgb,var(--accent) 13%,transparent); }
#network-bar::after { content:''; position:absolute; inset:0; width:35%; background:var(--accent); animation:network 1.25s ease-in-out infinite; }
.network-active #network-bar { display:block; }
.network-active .connection .dot { background:var(--accent); animation:pulse 1s ease-in-out infinite; }
@keyframes network { from { transform:translateX(-100%); } to { transform:translateX(390%); } }
@keyframes pulse { 50% { opacity:.35; } }
.skeleton { display:block; position:relative; overflow:hidden; background:var(--skeleton); border-radius:4px; }
.skeleton::after { content:''; position:absolute; inset:0; background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--surface) 65%,transparent) 48%,transparent 76%); transform:translateX(-100%); animation:shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { to { transform:translateX(100%); } }
.sk-line { height:11px; width:70%; margin:10px 0; }
.sk-value { height:28px; width:45%; margin:15px 0; }
.skeleton-table { border:1px solid var(--border); border-radius:9px; background:var(--surface); padding:5px 0; }
.skeleton-row { display:grid; grid-template-columns:1.2fr 1.8fr 1fr .7fr; gap:22px; padding:15px 18px; border-bottom:1px solid var(--border); }
.skeleton-row:last-child { border-bottom:0; }
.skeleton-row .sk-line { margin:5px 0; width:100%; }
.skeleton-row:nth-child(even) .sk-line:nth-child(2) { width:65%; }
.skeleton-card { min-height:190px; }
.skeleton-chart { min-height:220px; display:flex; align-items:flex-end; gap:17px; padding:25px 20px; }
.skeleton-chart>.skeleton { flex:1; height:95px; border-radius:4px 4px 0 0; }
.skeleton-chart>.skeleton:nth-child(2n) { height:160px; }
.skeleton-chart>.skeleton:nth-child(3n) { height:70px; }
.panel-loading { position:relative; }
.panel-loading[data-ready=true] { opacity:.7; }
.load-error { display:flex; align-items:center; gap:13px; border:1px solid var(--border); border-radius:8px; background:var(--surface); padding:17px 18px; margin-bottom:18px; }
.load-error>div { flex:1; min-width:0; }
.load-error strong { font-size:var(--text-body); font-weight:550; }
.load-error p { font-size:var(--text-caption); color:var(--muted); margin-top:3px; overflow-wrap:anywhere; }
.load-error-icon { display:grid; place-items:center; width:25px; height:25px; border:1px solid var(--accent); color:var(--accent); border-radius:50%; font-size:var(--text-body); flex-shrink:0; }
.boot-layout { min-height:100dvh; }
.boot-sidebar { position:fixed; inset:0 auto 0 0; width:240px; padding:19px 20px; border-right:1px solid var(--border); }
.boot-nav { display:grid; gap:19px; margin-top:35px; }
.boot-nav .skeleton { height:13px; width:75%; }
.boot-nav .skeleton:nth-child(even) { width:60%; }
.boot-content { margin-left:240px; max-width:1280px; padding:98px 40px 30px; margin-right:auto; }
.boot-title { height:25px; width:100px; margin-bottom:55px; }
.boot-cards { display:grid; grid-template-columns:1fr 1fr; gap:30px; }
.boot-cards>.skeleton { height:190px; border-radius:9px; }
.boot-table { height:200px; margin-top:35px; border-radius:9px; }
.boot-message { margin-top:25px; display:flex; align-items:center; gap:9px; color:var(--muted); font-size:var(--text-caption); }
.boot-failed .boot-message { display:none; }
.boot-failed .boot-table { display:none; }
.boot-failed .load-error { margin-top:30px; }
.nav-scrim { display:none; }
.sidebar-collapsed { --nav-width:76px; }
.sidebar-collapsed .sidebar { padding:20px 10px; }
.sidebar-collapsed .sidebar .brand { justify-content:center; margin:0 0 25px; }
.sidebar-collapsed .sidebar .brand>span { font-size:0; }
.sidebar-collapsed .sidebar .brand::before { content:'k'; font-size:29px; }
.sidebar-collapsed nav button { font-size:0; justify-content:center; padding:8px; }
.sidebar-collapsed nav b,.sidebar-collapsed .sidebar-bottom { display:none; }
[hidden] { display:none!important; }
@media(max-width:1150px) {
  :root { --nav-width:210px; }
  .content { padding:28px; }
  .overview-top { gap:20px; }
  .metric-strip>div { padding:13px 15px; }
  .balance-main { padding:22px 16px; }
  .balance-value strong { font-size:29px; }
  .models-layout { grid-template-columns:165px minmax(0,1fr); gap:14px; }
  .stat { padding:17px 16px; }
}
@media(min-width:721px) and (max-width:900px) {
  :root { --nav-width:185px; }
  .sidebar .brand>span { font-size:22px; }
  .content { padding:25px 23px; }
  nav button { font-size:var(--text-caption); gap:9px; padding:6px 8px; }
  .overview-top,.account-grid,.guide-grid { grid-template-columns:1fr; }
  .overview-top { gap:24px; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stat:nth-child(2) { border-right:0; }
  .stat:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .models-layout { grid-template-columns:1fr; }
  .model-filter-panel>.section-heading { height:auto; margin-bottom:8px; }
  .filter-surface { display:flex; align-items:center; gap:12px; padding:10px; }
  .filter-surface h3 { margin:0; }
  #model-account-buttons { display:flex; gap:5px; }
  .filter-surface label { margin:0 0 0 auto; padding:0; border:0; }
  .filter-surface select { width:auto; }
  .model-card-grid { grid-template-columns:1fr; }
  .connection { display:none; }
}
@media(max-width:720px) {
  :root,.sidebar-collapsed { --nav-width:0px; }
  header { position:sticky; top:0; z-index:25; height:57px; padding:0 13px; background:var(--bg); border-bottom:1px solid var(--border); gap:8px; }
  .header-right { gap:4px; }
  .connection,.header-docs { display:none; }
  .breadcrumb { font-size:var(--text-caption); }
  .breadcrumb span { margin:0 7px; }
  .avatar { width:28px; height:28px; }
  .sidebar,.sidebar-collapsed .sidebar { width:250px; padding:20px 12px; transform:translateX(-100%); transition:transform .18s ease; box-shadow:12px 0 35px #0001; }
  body:not(.nav-open) .sidebar { visibility:hidden; pointer-events:none; }
  .nav-open .sidebar { transform:translateX(0); }
  .nav-open .nav-scrim { display:block; position:fixed; inset:0; background:#0005; z-index:35; }
  .nav-open { overflow:hidden; }
  .sidebar .brand,.sidebar-collapsed .sidebar .brand { margin:0 8px 28px; justify-content:flex-start; }
  .sidebar .brand>span,.sidebar-collapsed .sidebar .brand>span { font-size:24px; }
  .sidebar-collapsed .sidebar .brand::before { display:none; }
  .sidebar nav button,.sidebar-collapsed nav button { font-size:var(--text-body); min-height:40px; justify-content:flex-start; padding:8px 11px; gap:12px; }
  .sidebar nav b,.sidebar-collapsed nav b { display:block; }
  .sidebar-bottom,.sidebar-collapsed .sidebar-bottom { display:block; padding-top:25px; }
  main { margin-left:0; width:100%; }
  .content { padding:24px 16px; }
  .page-heading { margin-bottom:25px; gap:10px; }
  h1,.page-heading h1 { font-size:22px; }
  .page-heading>.primary { font-size:var(--text-caption); padding:6px 10px; }
  .overview-top { grid-template-columns:1fr; gap:25px; margin-bottom:27px; }
  .section-heading { margin-bottom:12px; }
  .balance-card,.endpoint-card { height:179px; }
  .balance-main { padding:19px 16px; }
  .balance-value strong { font-size:31px; }
  .balance-main .primary { font-size:var(--text-caption); }
  .metric-strip>div { padding:12px 15px; }
  .metric-strip dt { font-size:var(--text-caption); }
  .metric-strip dd { font-size:var(--text-body); }
  .endpoint-card>p { font-size:var(--text-caption); padding:15px 16px 8px; }
  .endpoint-copy { margin:0 16px 14px; }
  .endpoint-copy code { font-size:var(--text-caption); }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:25px; }
  .stat { padding:16px; }
  .stat:nth-child(2) { border-right:0; }
  .stat:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .stat strong { font-size:25px; }
  .stat small { font-size:var(--text-caption); }
  .recent { margin-top:27px; }
  .panel-head { gap:12px; flex-wrap:wrap; }
  .panel-head .muted { font-size:var(--text-caption); }
  .account-row { flex-wrap:wrap; gap:10px; padding:16px; }
  .account-row .identity { min-width:115px; }
  .account-row .quota-inline { width:100%; text-align:left; margin-left:44px; margin-top:-5px; display:flex; align-items:baseline; gap:7px; }
  .account-row .quota-inline small { display:inline; }
  .account-grid,.guide-grid { grid-template-columns:1fr; gap:17px; }
  .account-card { padding:18px; }
  .account-card .quota { font-size:28px; margin-top:22px; }
  .account-actions { gap:17px; }
  .account-actions button,.account-actions summary { min-height:37px; }
  .account-facts { margin-top:20px; }
  .account-menu-popover { top:39px; }
  #page-accounts>.panel[aria-label] { display:block; padding:13px 15px; }
  #page-accounts>.panel[aria-label] .dialog-head { justify-content:space-between; margin-bottom:6px; }
  .toolbar>.muted { display:none; }
  .toolbar .search { width:100%; }
  .search input { width:100%; }
  .filter-bar { gap:9px; }
  .filter-bar .search { flex:1 0 100%; }
  .filter-bar select { width:0; min-width:0; max-width:none; flex:1 1 120px; font-size:var(--text-caption); }
  .filter-bar>.muted { margin-left:0; font-size:var(--text-caption); }
  .filter-bar .secondary { font-size:var(--text-caption); }
  .endpoint-panel { padding:16px; }
  .endpoint-panel code { font-size:var(--text-caption); }
  .endpoint-panel .secondary { flex-shrink:0; }
  .models-layout { grid-template-columns:1fr; gap:14px; }
  .model-filter-panel>.section-heading { display:none; }
  .filter-surface { display:flex; align-items:center; gap:9px; background:none; border:0; padding:0; }
  .filter-surface>h3,.filter-surface>label,#model-account-buttons { display:none; }
  #model-account-filter { display:block!important; }
  .filter-surface select { min-width:0; flex:1; width:0; font-size:var(--text-caption); }
  .model-results>.filter-bar { flex-wrap:nowrap; gap:8px; }
  .model-results .search { flex:1; }
  .model-results .segmented { flex-shrink:0; }
  .model-results .panel-head { padding:11px 13px; gap:8px; }
  .model-results .panel-head .muted { font-size:var(--text-caption); }
  .model-results .panel-head .primary { font-size:var(--text-caption); padding:4px 7px; }
  .model-card-grid { grid-template-columns:1fr; gap:12px; padding-top:12px; }
  .model-card { padding:17px; }
  .model-note { padding:10px 13px; font-size:var(--text-caption); }
  .inline-status { font-size:var(--text-caption); }
  .key-table,.key-table tbody,.requests-table,.requests-table tbody { display:block; white-space:normal; }
  .key-table thead,.requests-table thead { display:none; }
  .key-table tr,.requests-table tr { display:block; padding:13px 16px; border-bottom:1px solid var(--border); }
  .key-table tr:last-child,.requests-table tr:last-child { border-bottom:0; }
  .key-table td { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:12px; padding:6px 0; border:0; text-align:right; font-size:var(--text-caption); }
  .key-table td::before { content:attr(data-label); margin-right:auto; color:var(--muted); font-size:var(--text-caption); min-width:50px; text-align:left; }
  .key-table td:first-child { display:block; text-align:left; margin-bottom:5px; }
  .key-table td:first-child::before { display:none; }
  .key-table td:first-child code { color:var(--muted); font-size:var(--text-caption); }
  .key-table .row-actions { display:block; text-align:left; padding-top:10px; min-width:0; }
  .key-table .row-actions::before { display:none; }
  .key-table .row-actions button { min-height:35px; }
  .requests-table td { display:block; position:relative; padding:5px 0 5px 79px; min-height:27px; border:0; font-size:var(--text-caption); overflow-wrap:anywhere; }
  .requests-table td::before { content:attr(data-label); position:absolute; top:6px; left:0; color:var(--muted); font-size:var(--text-caption); }
  .requests-table td strong { font-size:var(--text-caption); }
  .requests-table td code { font-size:var(--text-caption); white-space:normal; }
  .requests-table td details { min-width:0; margin-top:8px; }
  .requests-table td details small { line-height:1.8; }
  th,td { padding:12px 13px; font-size:var(--text-caption); }
  .pagination { padding:13px; font-size:var(--text-caption); flex-wrap:wrap; }
  .pagination .secondary { font-size:var(--text-caption); min-height:35px; }
  .table-note { font-size:var(--text-caption); padding:0 13px 13px; }
  .section-heading>select { width:140px; }
  .chart { padding:8px; min-height:195px; }
  .chart svg { min-height:185px; }
  .chart text { font-size:var(--text-body); }
  .legend { font-size:var(--text-caption); gap:5px; }
  .status-banner { padding:18px; gap:12px; }
  .status-banner h2 { font-size:16px; }
  .status-banner p { font-size:var(--text-caption); }
  .status-mark { width:34px; height:34px; }
  .service-row,.setting-row { padding:17px 15px; gap:13px; }
  .service-row>div,.setting-row>div { min-width:0; }
  .service-row p,.setting-row p { font-size:var(--text-caption); overflow-wrap:anywhere; }
  .setting-row select { width:107px; font-size:var(--text-caption); }
  .setting-row code { font-size:var(--text-caption); overflow-wrap:anywhere; }
  .setting-row .badge { font-size:var(--text-caption); }
  .inline-input { font-size:var(--text-caption)!important; gap:5px; }
  .inline-input input { width:62px; }
  .guide { padding:20px; }
  pre { font-size:var(--text-caption); padding:13px; }
  .note { font-size:var(--text-caption); padding:11px 13px; }
  .chat-messages { max-height:52dvh; min-height:230px; padding:14px 0; }
  .chat-message { max-width:96%; }
  .chat-message.user { max-width:90%; }
  .chat-message.assistant { padding:0 4px; }
  .chat-message>div { font-size:var(--text-body); }
  .chat-composer { bottom:max(8px,env(safe-area-inset-bottom)); padding:10px; }
  .chat-composer textarea { font-size:16px; }
  .chat-empty { padding:45px 15px; }
  .chat-empty h2 { font-size:19px; }
  #chat-key,#chat-model { max-width:100%; }
  .load-error { padding:14px; gap:9px; flex-wrap:wrap; }
  .load-error p { font-size:var(--text-caption); }
  .load-error>.secondary { margin-left:34px; }
  .skeleton-row { grid-template-columns:1.4fr 2fr; padding:16px; }
  .skeleton-row .sk-line:nth-child(n+3) { display:none; }
  .skeleton-chart { min-height:165px; gap:10px; padding:15px; }
  .skeleton-chart>.skeleton { height:65px; }
  .skeleton-chart>.skeleton:nth-child(2n) { height:115px; }
  .boot-sidebar { display:none; }
  .boot-content { margin:0; padding:85px 16px 25px; }
  .boot-title { margin-bottom:35px; }
  .boot-cards { grid-template-columns:1fr; gap:20px; }
  .boot-cards>.skeleton { height:179px; }
  .boot-table { height:140px; margin-top:25px; }
  dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 34px); padding:20px; }
  dialog input,dialog textarea,dialog select { font-size:16px; }
  .dialog-head h2 { font-size:17px; }
  .button-row>* { min-height:38px; }
  .login-layout { display:flex; flex-direction:column; padding:10px; }
  .login-art { min-height:195px; height:195px; flex-shrink:0; padding:22px; }
  .login-art>.brand { margin-bottom:0; }
  .login-art>div:not(.landscape) { margin:20px 0 0; padding:0; }
  .login-art h1 { font-size:23px; margin:0; }
  .login-art .intro { display:none; }
  .login-panel { padding:33px 16px; }
  .login-panel form { width:100%; max-width:410px; }
  .login-panel h2 { font-size:23px; }
  .login-panel input { font-size:16px; }
  footer { display:block; line-height:2; padding-bottom:env(safe-area-inset-bottom); }
  footer span { display:block; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.account-grid>.skeleton-table { grid-column:1/-1; }
.model-details summary::after { content:"＋"; margin-left:auto; color:var(--muted); }
.model-details[open] summary::after { content:"−"; }
.auth-history .note { margin:9px 0; }
.stat-grid>.load-error { grid-column:1/-1; margin:0; min-height:118px; border:0; }
.note.model-note { margin:0; background:var(--surface); padding:9px 15px; }
@media(min-width:721px) {
 .boot-content { width:calc(100% - 240px); margin-left:calc(240px + max(0px,(100vw - 240px - 1280px)/2)); }
}

.exit-details summary { cursor:pointer; }
.exit-details p { color:var(--muted); font-size:var(--text-caption); margin-top:5px; }
/* Reference prices and immutable request cost snapshots. */
.pricing-settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; }
.pricing-settings-grid .panel { min-width:0; }
.pricing-source,.pricing-settings { padding:18px 20px; min-height:157px; }
.pricing-source { display:flex; align-content:start; flex-wrap:wrap; gap:10px; }
.pricing-source strong { font-size:var(--text-body); }
.pricing-source a { font-size:var(--text-caption); margin-left:auto; }
.pricing-source code { display:block; width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:6px; background:var(--soft); font-size:var(--text-caption); overflow-wrap:anywhere; }
.pricing-source p { font-size:var(--text-caption); }
.pricing-settings label { margin-top:0; font-size:var(--text-caption); }
.pricing-save-row { display:flex; align-items:center; gap:10px; }
.pricing-save-row input { width:120px; }
.check-row { display:flex; align-items:center; gap:8px; font-size:var(--text-body); cursor:pointer; }
.check-row input[type=checkbox] { width:16px; height:16px; margin:0; flex-shrink:0; }
.pricing-settings .check-row { margin-top:15px; margin-bottom:0; }
.billing-explanation { margin:0 0 24px; }
.cost-value,.cost-label { display:block; }
.cost-value { font-size:var(--text-caption); font-variant-numeric:tabular-nums; white-space:nowrap; }
.cost-label { font-size:var(--text-caption); margin-top:4px; color:var(--muted); }
.cost-details p { font-size:var(--text-caption); line-height:1.8; margin-top:8px; }
.key-cost { font-size:var(--text-caption); text-align:left; padding:0; }
.billing-total { display:block; font-size:28px; font-weight:550; margin-top:23px; }
.billing-summary { display:flex; flex-wrap:wrap; gap:12px; padding:12px 15px; margin-top:-15px; margin-bottom:30px; font-size:var(--text-caption); color:var(--muted); background:var(--surface); border:1px solid var(--border); border-radius:7px; }
.price-tiers { font-size:var(--text-caption); white-space:normal; min-width:240px; max-width:380px; }
.price-tiers summary { line-height:1.8; }
.price-tiers pre,.price-preview { white-space:pre-wrap; font-size:var(--text-caption); line-height:1.8; background:var(--soft); border:1px solid var(--border); border-radius:6px; padding:10px; margin:9px 0; overflow-wrap:anywhere; }
.price-input-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.price-input-grid label { margin-top:0; }
.model-price { font-size:var(--text-caption); white-space:nowrap; }
.model-price-line { padding-top:12px; border-top:1px solid var(--border); }
.pricing-table code { font-size:var(--text-caption); }
@media(max-width:900px) { .pricing-settings-grid { grid-template-columns:1fr; gap:0; } }
@media(max-width:720px) {
 .pricing-source,.pricing-settings { padding:15px; min-height:0; }
 .pricing-settings-grid .panel-head { flex-wrap:nowrap; }
 .pricing-settings-grid .panel-head .secondary { font-size:var(--text-caption); }
 .pricing-table,.pricing-table tbody { display:block; }
 .pricing-table thead { display:none; }
 .pricing-table tr { display:block; padding:14px 16px; border-bottom:1px solid var(--border); }
 .pricing-table tr:last-child { border:0; }
 .pricing-table td { display:block; text-align:left; padding:7px 0; border:0; white-space:normal; }
 .pricing-table td::before { content:attr(data-label); display:block; color:var(--muted); font-size:var(--text-caption); margin-bottom:3px; }
 .price-tiers { min-width:0; max-width:none; }
 .billing-summary { font-size:var(--text-caption); line-height:1.8; }
 .cost-value { font-size:var(--text-caption); }
 .price-input-grid { gap:10px; }
 #page-activity .filter-bar select { flex-basis:40%; }
}
label.check-row { display:flex; align-items:center; }
.check-row input[type=checkbox] { min-height:16px; padding:0; }
.pricing-settings-grid { margin-bottom:24px; }
.pricing-settings-grid .panel { margin-bottom:0; }
.pricing-settings-grid .panel-head { min-height:36px; }
.pricing-source code { white-space:nowrap; overflow-x:auto; }
@media(max-width:720px) {
 .pricing-table tr { display:grid; grid-template-columns:1fr 1fr; column-gap:12px; }
 .pricing-table td:nth-child(1),.pricing-table td:nth-child(2),.pricing-table td:last-child { grid-column:1/-1; }
 .pricing-table td:last-child { text-align:right; padding-top:5px; }
 .pricing-table td:last-child::before { display:none; }
 .pricing-table td:last-child button { min-height:32px; }
}

/* Shared control, surface and text rules for every console page. */
body { min-width:320px; }
input,select,textarea { font-size:var(--text-body); }
.primary { min-height:36px; padding:6px 12px; border-radius:8px; line-height:22px; }
.secondary { min-height:32px; padding:4px 12px; border-radius:8px; line-height:22px; }
.icon-btn { width:32px; height:32px; }
.search { border-color:var(--field-border); border-radius:8px; gap:7px; min-height:34px; }
.search svg { width:16px; height:16px; flex-shrink:0; stroke-width:1.5; }
.search input { min-height:32px; padding:5px 9px 5px 0; line-height:22px; }
.page-heading { margin-bottom:36px; }
.page-heading h1 { font-size:24px; line-height:32px; }
.page-heading>.primary { margin-left:auto; }
h2,h3 { font-weight:500; }
.table-wrap,.data-surface,.account-card,.balance-card,.endpoint-card,.chart,.stat-grid { border-radius:var(--radius); }
th { font-size:var(--text-caption); padding:10px 16px; }
td { font-size:var(--text-body); }
td strong { font-size:var(--text-body); }
.badge { background:transparent; padding:2px 0; font-size:var(--text-body); gap:6px; }
.badge::before { width:6px; height:6px; }
.badge.off,.badge.bad { background:transparent; }
.stat { padding:20px; }
.stat strong { font-size:24px; line-height:32px; margin:4px 0 0; }
.stat small { display:block; font-size:var(--text-caption); line-height:18px; margin-top:4px; }
.metric-strip>div { padding:18px 20px; }
.metric-strip dd { font-size:var(--text-body); }
.balance-card,.endpoint-card { min-height:186px; height:auto; }
.balance-main { min-height:93px; padding:20px; }
.balance-value strong { font-weight:600; }
.endpoint-card>p { font-size:var(--text-body); }
.private-label { border:0; padding:4px 0; font-size:var(--text-caption); }
.sidebar-bottom small { font-size:var(--text-caption); }
.dashboard-filters { flex-wrap:nowrap; gap:8px; margin-bottom:24px; }
.dashboard-filters select { width:195px; }
#analytics-range { margin-left:auto; }
.dashboard-filters .inline-status { font-size:var(--text-caption); color:var(--muted); }
#analytics-metrics { margin-bottom:24px; }
.billing-summary { margin-top:0; background:var(--soft); border:0; padding:12px 16px; }
.setting-row { min-height:78px; padding:18px 20px; }
.setting-row h3 { font-size:var(--text-body); font-weight:400; }
.setting-row p { font-size:var(--text-caption); margin-top:3px; }
.switch input { appearance:none; width:36px; height:20px; min-height:20px; padding:0; margin:0; border:0; border-radius:999px; background:var(--soft); position:relative; cursor:pointer; }
.switch input::before { content:''; position:absolute; width:16px; height:16px; top:2px; left:2px; border-radius:50%; background:var(--surface); box-shadow:0 1px 3px #0002; transition:transform .15s; }
.switch input:checked { background:var(--accent); }
.switch input:checked::before { transform:translateX(16px); background:white; }
.switch span { display:none; }
dialog { padding:24px; border-radius:12px; }
.dialog-head { margin-bottom:20px; }
.dialog-head h2 { font-size:18px; font-weight:600; }
dialog label:not(.search) { font-size:var(--text-body); font-weight:400; }
.dialog-head .icon-btn { font-size:20px; }
.note { line-height:1.75; }
.chat-messages { min-height:340px; }
.chat-empty h2 { font-size:24px; font-weight:600; }
.chat-composer { border-radius:16px; padding:16px; }
.chat-composer textarea { min-height:84px; font-size:var(--text-body); }
@media(min-width:721px) {
 .breadcrumb { opacity:.85; }
 .header-right { margin-left:auto; }
 .settings-panel .panel-head { margin-bottom:16px; }
}
@media(max-width:720px) {
 .page-heading { align-items:center; gap:12px; margin-bottom:28px; }
 .page-heading h1 { font-size:22px; line-height:30px; }
 .page-heading>.primary { font-size:var(--text-caption); padding:5px 10px; min-height:36px; }
 .primary,.secondary { min-height:38px; }
 .content { padding-top:28px; }
 .badge { font-size:var(--text-caption); }
 .dashboard-filters { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
 .dashboard-filters select { width:100%; max-width:none; min-width:0; }
 #analytics-range { margin:0; grid-column:2; grid-row:2; }
 .dashboard-filters .inline-status { grid-column:1; grid-row:2; font-size:var(--text-caption); }
 .stat { padding:16px; }
 .stat strong { font-size:24px; }
 .metric-strip>div { padding:14px 12px; }
 .setting-row { padding:16px; gap:12px; }
 dialog { padding:20px; }
 .dialog-head { margin-bottom:18px; }
 .chat-composer { bottom:10px; padding:12px; }
 .chat-empty h2 { font-size:22px; }
}
.balance-card,.endpoint-card { height:190px; }
@media(max-width:720px) { .balance-card,.endpoint-card { height:auto; min-height:190px; } }
