:root { font-family: Inter, system-ui, sans-serif; color-scheme: dark; }
body { margin: 0; background:#0f1115; color:#e9edf2; }
main { max-width: 1400px; margin:auto; padding:28px; }
header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
h1 { margin:0 0 6px; font-size:24px; }
h2 { font-size:16px; margin-top:0; }
#status { color:#69d58a; font-size:13px; }
button { background:#202631; color:#fff; border:1px solid #394150; padding:9px 14px; border-radius:8px; cursor:pointer; }
.cards { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:14px; }
.card,.panel { background:#171a21; border:1px solid #292e38; border-radius:12px; padding:18px; }
.card small { color:#8d96a5; display:block; margin-bottom:8px; }
.card strong { font-size:24px; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.overview-operations { margin-bottom:14px; }
.overview-status-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:12px; }
.overview-status-grid > div,.overview-status-grid > a { display:flex; min-width:0; flex-direction:column; gap:7px; padding:12px; border:1px solid #292e38; border-radius:8px; background:#111418; }
.overview-status-grid > a { color:inherit; text-decoration:none; }
.overview-status-grid > a:hover { border-color:#7aa2f7; }
.overview-status-grid small { color:#8d96a5; font-size:12px; }
.overview-status-grid strong { overflow-wrap:anywhere; font-size:16px; }
.metric { margin:14px 0; }
.metric > div:first-child { display:flex; justify-content:space-between; margin-bottom:6px; }
.metric span { color:#8d96a5; font-size:13px; }
.bar { height:7px; background:#272c35; border-radius:99px; overflow:hidden; }
.bar i { display:block; height:100%; background:#7aa2f7; border-radius:99px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { text-align:left; padding:10px 8px; border-bottom:1px solid #272c35; white-space:nowrap; }
th { color:#8d96a5; font-weight:500; }
@media(max-width:900px){ .cards{grid-template-columns:repeat(2,1fr)} .grid{grid-template-columns:1fr} }

/* Budget dashboard styles */
.budget-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px; }
.budget-metric { background:#111418; border:1px solid #292e38; border-radius:8px; padding:16px; }
.budget-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.budget-header small { color:#8d96a5; }
.budget-header strong { font-size:14px; }
.status-normal { color:#69d58a; }
.status-warning { color:#e0af68; }
.status-critical { color:#f7768e; }
.status-blocked { color:#f7768e; }
.blocked-badge { font-size:10px; background:#f7768e; color:#000; padding:2px 6px; border-radius:4px; margin-left:8px; }
.budget-bar-wrap { margin-top:8px; }
.budget-bar { height:8px; background:#272c35; border-radius:99px; overflow:hidden; margin-bottom:4px; }
.budget-bar i { display:block; height:100%; background:#7aa2f7; border-radius:99px; transition:width 0.3s; }
.budget-bar-labels { display:flex; justify-content:space-between; font-size:11px; color:#8d96a5; margin-bottom:8px; }
.budget-details { display:grid; grid-template-columns:1fr 1fr; gap:8px; font-size:12px; }
.budget-details div { display:flex; justify-content:space-between; }
.budget-control { background:#111418; border:1px solid #292e38; border-radius:8px; padding:16px; }
.runtime-card { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:16px; align-items:center; background:#111418; border:1px solid #292e38; border-radius:8px; padding:16px; }
.runtime-card > div { display:flex; flex-direction:column; gap:6px; }
.runtime-card small { color:#8d96a5; }
.provider-admin-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin:16px 0; }
.provider-admin-grid form { display:flex; flex-direction:column; gap:8px; background:#111418; border:1px solid #292e38; border-radius:8px; padding:14px; }
.provider-admin-grid input, .provider-admin-grid select { background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.provider-definition-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:9px; margin:14px 0; }
.provider-definition-form input,.provider-definition-form select,.provider-definition-form textarea,.provider-admin-grid textarea,.admin-model-settings { box-sizing:border-box; width:100%; background:#0d0f17; color:#e9edf2; border:1px solid #394150; border-radius:7px; padding:8px; }
.provider-definition-form textarea { grid-column:span 2; }
.provider-connections-grid { display:grid; gap:12px; }
.provider-assignment-picker { min-width:0; border:1px solid #292e38; border-radius:8px; padding:10px 12px; margin:4px 0; }
.provider-assignment-picker legend { color:#c8ced8; font-size:13px; padding:0 5px; }
.provider-assignment-options { display:grid; gap:8px; max-height:360px; overflow:auto; }
.provider-assignment-option { display:grid; grid-template-columns:18px minmax(0,1fr); align-items:start; gap:10px; padding:10px 12px; border:1px solid #292e38; border-radius:7px; cursor:pointer; }
.provider-assignment-option:hover { border-color:#6551a8; background:#171722; }
.provider-assignment-option input { margin:3px 0 0; width:16px; height:16px; }
.provider-assignment-details { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.provider-assignment-details strong { display:block; line-height:1.35; overflow-wrap:anywhere; }
.provider-assignment-option code { display:block; max-width:100%; white-space:normal; overflow-wrap:anywhere; line-height:1.4; }
.provider-assignment-option small { display:block; color:#8d96a5; line-height:1.4; }
.provider-assignment-option.is-unavailable { opacity:.65; cursor:not-allowed; }
.provider-assignment-option.is-unavailable:hover { border-color:#292e38; background:transparent; }
.provider-assignment-assigned { display:flex; flex-direction:column; gap:4px; padding:8px 10px; background:#171a21; border-left:3px solid #6551a8; border-radius:4px; color:#aeb6c4; font-size:12px; }
.provider-assignment-assigned strong { color:#c8ced8; }
#provider-assignment-status { min-height:1em; }
.provider-preview-controls { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:10px 0; }
.admin-limits { border:1px solid #292e38; border-radius:8px; padding:16px; margin:16px 0; background:#111418; }
.admin-limits-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:12px; margin:12px 0; }
.admin-limits-grid label { display:flex; flex-direction:column; gap:6px; color:#8d96a5; font-size:12px; }
.admin-limits-grid input { background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:8px; }
.provider-preview-controls input[type="text"], .provider-preview-controls input:not([type]) { background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.provider-model-search { position:relative; }
.provider-model-suggestions { position:absolute; z-index:30; inset:calc(100% + 4px) 0 auto; max-height:320px; overflow:auto; border:1px solid #394150; border-radius:8px; background:#171a20; box-shadow:0 10px 24px #0008; }
.provider-model-suggestions[hidden] { display:none; }
.provider-model-suggestion { display:block; width:100%; padding:9px 11px; border:0; border-bottom:1px solid #2a2f38; border-radius:0; background:transparent; color:#e9edf2; text-align:left; cursor:pointer; }
.provider-model-suggestion:last-child { border-bottom:0; }
.provider-model-suggestion:hover, .provider-model-suggestion:focus { background:#282231; outline:2px solid #7944dc; outline-offset:-2px; }
.provider-model-suggestion small { display:block; margin-top:3px; color:#aab4c3; }
.api-key-form { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.api-key-form input:not([type="checkbox"]) { background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.budget-toggle { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.budget-toggle strong { font-size:14px; }
.budget-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.btn-danger { background:#3d1a1a; border-color:#7a2a2a; color:#f7768e; }
.btn-success { background:#1a3d1a; border-color:#2a7a2a; color:#69d58a; }
.btn-warning { background:#3d3d1a; border-color:#7a7a2a; color:#e0af68; }
.btn-danger:hover { background:#5a2a2a; }
.btn-success:hover { background:#2a5a2a; }
.btn-warning:hover { background:#5a5a2a; }
.cost-actual { color:#69d58a; }
.cost-over-max { color:#f7768e; font-weight:700; }
.cost-estimated { color:#e0af68; }
.cost-unknown { color:#8d96a5; }
.status-unknown { color:#8d96a5; }
.last-request div { margin:4px 0; }
.error { color:#f7768e; padding:16px; text-align:center; }
.muted { color:#8d96a5; font-size:13px; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.request-cost-progress { display:block; width:100%; height:8px; margin:8px 0; accent-color:#7c3aed; }
.attempt-route-snapshot { margin:8px 0; padding:8px 10px; border-left:2px solid #586174; background:#171b24; font-size:12px; }
.attempt-route-snapshot ul { margin:5px 0 0; padding-left:20px; }
.section-heading h3 { margin:0; }
.section-heading label, .settings-grid label { color:#8d96a5; font-size:12px; display:flex; flex-direction:column; gap:6px; }
.section-heading select, .settings-grid select, .settings-grid input { background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:8px; }
.streaming-summary { color:#8d96a5; font-size:13px; margin:14px 0; }
.streaming-settings { border-top:1px solid #292e38; margin-top:18px; padding-top:18px; }
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:12px; margin:14px 0; }
.streaming-note { color:#c8ced8; font-size:13px; line-height:1.5; max-width:900px; }
.success-message { color:#69d58a; padding:10px 0; }
.warning { color:#e6b566; }
.success { color:#69d58e; }
.admin-grid { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(280px, .8fr); gap:18px; margin-top:18px; }
.admin-grid h3, .admin-audit h3 { margin:0 0 10px; }
.admin-create-model { display:flex; gap:8px; margin-bottom:12px; }
.admin-create-model input { flex:1; min-width:0; background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.admin-grid input:not([type="checkbox"]) { width:100%; box-sizing:border-box; background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.admin-route-row { display:grid; grid-template-columns:100px minmax(0,1fr); gap:8px; align-items:center; margin-bottom:9px; color:#c8ced8; font-size:13px; }
.admin-route-controls { display:flex; align-items:center; gap:7px; min-width:0; }
.admin-route-controls input { flex:1; min-width:0; }
.admin-route-controls select { flex:0 1 170px; min-width:120px; background:#111418; color:#e9edf2; border:1px solid #394150; border-radius:6px; padding:7px; }
.admin-route-controls button { flex:none; white-space:nowrap; }
.admin-route-recommendation-dialog { width:min(680px, calc(100vw - 28px)); max-height:min(82vh,760px); }
.admin-route-recommendation-dialog .modal-close { border:0; background:transparent; padding:0 4px; }
.route-recommendation-list { display:grid; gap:10px; margin:12px 0 0; padding-left:28px; }
.route-recommendation-card { padding:13px 15px; border:1px solid var(--line); border-radius:9px; background:rgb(255 255 255 / 2%); }
.route-recommendation-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:7px; }
.route-recommendation-score { color:var(--violet-soft); font-size:12px; white-space:nowrap; }
.route-recommendation-card .muted { overflow-wrap:anywhere; font-size:12px; }
.route-recommendation-card ul { margin:8px 0 10px; padding-left:20px; color:#c8ced8; font-size:12px; }
.route-recommendation-card code { overflow-wrap:anywhere; }
.route-recommendation-instructions { padding:12px 14px; border-left:3px solid var(--violet); border-radius:4px; background:rgb(124 77 255 / 9%); }
.route-recommendation-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.route-recommendation-footer .muted { font-size:12px; }
.admin-audit { border-top:1px solid #292e38; margin-top:18px; padding-top:16px; }
.audit-entry { padding:7px 0; border-bottom:1px solid #272c35; font-size:12px; }
.audit-entry span { float:right; color:#8d96a5; }
code { color:#7aa2f7; }
@media(max-width:900px){ .admin-grid{grid-template-columns:1fr} }
@media(max-width:600px){ .admin-route-row { grid-template-columns:1fr; gap:4px; } .admin-route-controls { align-items:stretch; } .admin-route-controls button { white-space:normal; } .route-recommendation-footer { align-items:stretch; flex-direction:column; } }

/* Modal styles */
.modal { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; z-index:1000; }
.modal-content { background:#171a21; border:1px solid #292e38; border-radius:12px; padding:24px; max-width:900px; width:90%; max-height:80vh; overflow:auto; }
.modal-close { float:right; font-size:24px; cursor:pointer; color:#8d96a5; }
.modal-close:hover { color:#fff; }
.modal h3 { margin-top:0; }

/* Attempt chain table */
.chain-table { width:100%; border-collapse:collapse; font-size:13px; }
.chain-table th, .chain-table td { text-align:left; padding:8px; border-bottom:1px solid #272c35; }
.chain-table th { color:#8d96a5; font-weight:500; }
.chain-table .success { color:#69d58e; }
.chain-table .failure { color:#f7768e; }
.chain-table .skipped { color:#e0af68; }
.chain-table .cancelled { color:#8d96a5; }

/* Model health table colors */
.health-healthy { color:#69d58e; }
.health-degraded { color:#e0af68; }
.health-open { color:#f7768e; }
.health-half-open { color:#7aa2f7; }
.heading-with-help { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; min-width:0; }
.heading-with-help h2, .heading-with-help h3 { margin-top:0; }
.section-help-button { flex:0 0 28px; width:28px; height:28px; padding:0; border-radius:50%; font-weight:700; line-height:1; color:#c8d7ff; border-color:#53678f; }
.section-help-button:hover, .section-help-button:focus-visible { background:#2a3852; outline:2px solid #7aa2f7; outline-offset:2px; }
  .table-column-settings-button { flex:0 0 28px; width:28px; height:28px; padding:0; border-radius:7px; color:#c8d7ff; border-color:#53678f; }
  .table-column-settings-button:hover, .table-column-settings-button:focus-visible { background:#2a3852; outline:2px solid #7aa2f7; outline-offset:2px; }
  .table-column-settings-dialog h3 { margin:14px 0 6px; }
  .table-column-option { display:flex; align-items:center; gap:8px; padding:5px 0; color:#c8ced8; }
  .table-column-option input { accent-color:#7c3aed; }
.section-help-dialog { width:min(560px, calc(100vw - 32px)); border:1px solid #53678f; border-radius:12px; padding:24px; background:#171a21; color:#e9edf2; box-shadow:0 18px 60px #0009; }
.section-help-dialog::backdrop { background:#000a; }
.section-help-dialog h2 { margin-top:0; padding-right:30px; }
.section-help-dialog p { color:#c8ced8; line-height:1.6; }
.admin-routes-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:12px; }
.admin-routes-actions .muted { flex:1 1 100%; }
.admin-model-actions { min-width:220px; white-space:normal !important; }
.admin-model-observed-price { display:block; margin-top:4px; color:#aeb9cf; font-size:11px; line-height:1.35; white-space:nowrap; }
.admin-model-observed-price span { color:#7f8aa1; }
.admin-model-buttons { white-space:nowrap; }
.admin-model-delete-feedback { max-width:360px; margin-top:6px; color:#fda4af; font-size:12px; line-height:1.45; white-space:normal; }
.admin-model-delete-feedback:empty { display:none; }
[hidden] { display:none !important; }
@media(max-width:600px){ .section-heading { flex-direction:column; } .section-heading label { width:100%; } .section-heading select { width:100%; } }

/* v2.7 admin workspace: compact dark shell inspired by the approved dashboard prototype. */
:root { --app-bg:#0a0b10; --sidebar-bg:#10121a; --surface:#12141d; --line:rgb(255 255 255 / 8%); --violet:#8b5cf6; --violet-soft:#c4b5fd; }
html { scroll-behavior:smooth; scroll-padding-top:96px; }
body { background:var(--app-bg); color:#eef2ff; font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif; }
.dashboard-shell { min-height:100vh; }
.dashboard-sidebar { position:fixed; inset:0 auto 0 0; z-index:40; display:flex; width:250px; flex-direction:column; overflow-y:auto; border-right:1px solid var(--line); background:var(--sidebar-bg); padding:18px 14px 14px; }
.brand { display:flex; align-items:center; gap:11px; min-height:54px; padding:2px 8px 14px; color:#f8fafc; text-decoration:none; }
.brand-mark { display:grid; width:38px; height:38px; flex:none; place-items:center; border-radius:12px; background:var(--violet); color:white; font-size:23px; box-shadow:0 0 24px rgb(139 92 246 / 28%); }
.brand strong { display:block; font-size:15px; line-height:1.05; letter-spacing:-.02em; }
.brand em { color:#c4b5fd; font-style:normal; }
.brand small,.workspace-switcher small,.sidebar-footer small { display:block; margin-top:4px; color:#737b91; font-size:10px; font-weight:400; }
.workspace-switcher { display:flex; align-items:center; gap:10px; margin:9px 0 16px; padding:10px; border:1px solid var(--line); border-radius:9px; background:rgb(255 255 255 / 2%); }
.workspace-switcher strong { display:block; color:#d8deea; font-size:11px; font-weight:550; }
.workspace-icon { display:grid; width:27px; height:27px; flex:none; place-items:center; border-radius:8px; background:#8b5cf626; color:#c4b5fd; font-size:12px; font-weight:700; }
.workspace-chevron { margin-left:auto; color:#737b91; }
.dashboard-nav { flex:1; }
.dashboard-nav p { margin:17px 10px 6px; color:#667086; font-size:9px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.dashboard-nav .nav-item { display:flex; width:100%; align-items:center; gap:11px; margin:2px 0; padding:9px 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:#929aae; text-align:left; font-size:12px; transition:background .15s,color .15s,border-color .15s; }
.dashboard-nav .nav-item > span { display:grid; width:17px; place-items:center; color:#778198; font-size:15px; }
.dashboard-nav .nav-item:hover { background:rgb(255 255 255 / 4%); color:#e2e8f0; }
.dashboard-nav .nav-item.is-active { border-color:rgb(167 139 250 / 10%); background:rgb(139 92 246 / 14%); color:#ddd6fe; }
.dashboard-nav .nav-item.is-active > span { color:#c4b5fd; }
.sidebar-footer { display:flex; align-items:center; gap:10px; border-top:1px solid var(--line); padding:14px 8px 2px; }
.sidebar-footer strong { color:#cbd5e1; font-size:11px; font-weight:550; }
.system-dot { width:8px; height:8px; flex:none; border-radius:50%; background:#64748b; box-shadow:0 0 0 4px rgb(100 116 139 / 12%); }
.sidebar-footer.is-online .system-dot { background:#34d399; box-shadow:0 0 0 4px rgb(52 211 153 / 12%); }
.sidebar-footer.is-error .system-dot { background:#fb7185; box-shadow:0 0 0 4px rgb(251 113 133 / 12%); }
.dashboard-workspace { min-width:0; margin-left:250px; }
.dashboard-workspace > .topbar { position:sticky; top:0; z-index:20; display:flex; min-height:76px; align-items:center; justify-content:space-between; gap:18px; margin:0; border-bottom:1px solid var(--line); background:rgb(10 11 16 / 90%); padding:12px 32px; backdrop-filter:blur(18px); }
.topbar-title,.topbar-actions { display:flex; align-items:center; gap:12px; }
.topbar-title small { color:#7e879a; font-size:10px; }
.topbar-title small span { padding:0 5px; color:#454d5e; }
.topbar-title small b { color:#c4b5fd; font-weight:500; }
.dashboard-workspace .topbar h1 { margin:4px 0 0; color:#eef2ff; font-size:15px; font-weight:650; }
.topbar-actions { flex-wrap:wrap; justify-content:flex-end; }
.system-status { display:inline-flex; align-items:center; border:1px solid rgb(52 211 153 / 15%); border-radius:99px; background:rgb(52 211 153 / 6%); padding:6px 10px; color:#a7f3d0; font-size:10px; white-space:nowrap; }
.dashboard-workspace .refresh-button { display:flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:8px; background:rgb(255 255 255 / 3%); padding:8px 11px; color:#cbd5e1; font-size:11px; }
.refresh-button span { color:#c4b5fd; font-size:16px; }
.sidebar-toggle { display:none; border:1px solid var(--line); border-radius:8px; padding:7px 9px; font-size:16px; }
.dashboard-workspace main { box-sizing:border-box; width:100%; max-width:1500px; margin:0 auto; padding:24px 32px 56px; }
.dashboard-workspace main > .grid,.dashboard-workspace main > section { min-width:0; }
.dashboard-workspace main > section { scroll-margin-top:96px; }
.cards { grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.card,.panel { border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:18px; box-shadow:0 8px 24px rgb(0 0 0 / 8%); }
.card small { color:#81899e; font-size:10px; }
.card strong { color:#f1f5f9; font-size:22px; letter-spacing:-.03em; }
.panel h2 { color:#e8ebf4; font-size:14px; font-weight:650; letter-spacing:-.01em; }
.panel h3 { color:#d7dbea; font-size:12px; font-weight:600; }
.grid { gap:14px; margin-bottom:14px; }
.smart-route-settings-grid { display:grid; grid-template-columns:minmax(0,2.4fr) minmax(280px,1fr); gap:24px; align-items:start; margin:14px 0 24px; }
.smart-route-editor,.smart-route-experiment { min-width:0; }
.smart-route-field { display:flex; flex-direction:column; gap:7px; min-width:0; margin-bottom:14px; }
.smart-route-field input,.smart-route-field select,.smart-route-field textarea { width:100%; min-width:0; box-sizing:border-box; }
.smart-route-field textarea { min-height:150px; resize:vertical; }
.smart-route-mode-help,.smart-route-experiment .muted { line-height:1.5; }
.smart-route-checkbox { display:flex; align-items:center; gap:8px; margin:12px 0 16px; }
.smart-route-feedback { margin:10px 0; color:#69d58a; }
.smart-route-editor .button-row { display:flex; gap:8px; }
.smart-route-response-button { margin-top:6px; padding:5px 9px; font-size:12px; }
.smart-route-agent-response-dialog { width:min(900px, calc(100vw - 28px)); max-height:min(85vh,900px); }
.smart-route-agent-response-dialog .modal-close { border:0; background:transparent; padding:0 4px; }
.smart-route-agent-response-content { max-height:65vh; overflow:auto; margin:12px 0 0; padding:14px; border:1px solid #292e38; border-radius:8px; background:#0d0f15; color:#e2e8f0; white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; }
@media(max-width:800px){ .smart-route-settings-grid { grid-template-columns:minmax(0,1fr); gap:16px; } }
.model-health-heading { align-items:center; margin-bottom:14px; }
.model-health-heading h2 { margin:0; }
.model-health-heading label { flex-direction:row; align-items:center; gap:10px; white-space:nowrap; }
@media(max-width:600px){ .model-health-heading label { justify-content:space-between; white-space:normal; } }
.dashboard-workspace .panel { margin-bottom:14px; }
.dashboard-workspace .cards .card { margin:0; }
.dashboard-workspace main > .grid { margin-bottom:14px; }
.table-wrap,.budget-control,.budget-metric,.admin-limits,.provider-admin-grid form { border-color:var(--line); border-radius:10px; }
button { transition:filter .15s,background .15s,border-color .15s; }
button:hover:not(:disabled) { filter:brightness(1.12); }
.btn-success { border-color:rgb(139 92 246 / 40%); background:#713de0; color:white; }
.btn-warning { border-color:rgb(245 158 11 / 28%); background:rgb(245 158 11 / 10%); color:#fcd34d; }
.btn-danger { border-color:rgb(251 113 133 / 28%); background:rgb(251 113 133 / 10%); color:#fda4af; }
.muted { color:#8992a7; }
.dashboard-workspace input:not([type="checkbox"]),.dashboard-workspace select { border-color:rgb(255 255 255 / 11%); border-radius:7px; background:#0d0f17; color:#e2e8f0; }
.dashboard-workspace table { color:#cbd5e1; }
.dashboard-workspace th { color:#778198; font-size:10px; letter-spacing:.04em; }
.dashboard-workspace td { border-color:rgb(255 255 255 / 6%); }
.section-help-button { background:#181827; }
.sidebar-backdrop { display:none; }
@media(max-width:1100px){ .cards { grid-template-columns:repeat(3,minmax(0,1fr)); } .dashboard-workspace main { padding-right:22px; padding-left:22px; } }
@media(max-width:800px){
  .dashboard-sidebar { transform:translateX(-100%); transition:transform .2s ease; }
  .dashboard-sidebar.is-open { transform:translateX(0); }
  .dashboard-workspace { margin-left:0; }
  .sidebar-toggle { display:inline-flex; }
  .sidebar-backdrop:not([hidden]) { position:fixed; inset:0; z-index:30; display:block; border:0; border-radius:0; background:rgb(0 0 0 / 62%); }
  .dashboard-workspace > .topbar { min-height:68px; padding:10px 16px; }
  .dashboard-workspace main { padding:18px 16px 42px; }
}
@media(max-width:600px){
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .card,.panel { padding:14px; }
  .card strong { font-size:19px; }
  .topbar-actions { gap:6px; }
  .system-status { max-width:145px; overflow:hidden; text-overflow:ellipsis; }
  .dashboard-workspace .refresh-button { padding:7px 9px; font-size:0; }
  .dashboard-workspace .refresh-button span { font-size:18px; }
  .dashboard-workspace main { padding-right:12px; padding-left:12px; }
}

.page-description { margin:5px 0 0; font-size:11px; }

.admin-model-chains-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:22px 0 10px; padding-top:16px; border-top:1px solid var(--line); }
.admin-model-chains-heading h4 { margin:0 0 4px; color:#d7dbea; font-size:13px; }
.admin-model-chains-heading p { margin:0; }
.admin-model-chain-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:stretch; margin:8px 0; }
.admin-model-chain-edit { display:flex; min-width:0; align-items:center; gap:12px; border-color:var(--line); background:rgb(255 255 255 / 2%); text-align:left; }
.admin-model-chain-edit strong { flex:0 0 120px; overflow-wrap:anywhere; color:#ddd6fe; }
.admin-model-chain-summary { display:flex; min-width:0; align-items:center; gap:8px; flex-wrap:wrap; }
.admin-model-chain-summary code { overflow-wrap:anywhere; }
.admin-chain-arrow { color:#778198; }
.admin-model-chain-delete { align-self:center; min-width:78px; padding:6px 9px; font-size:11px; }
.admin-model-chain-dialog { max-width:680px; max-height:min(82vh,760px); }
.provider-model-ping-dialog, #provider-model-ping-dialog, #provider-model-delete-dialog { width:min(900px, calc(100vw - 28px)); max-height:min(88vh,900px); border:1px solid #53678f; border-radius:12px; padding:24px; background:#171a21; color:#e9edf2; box-shadow:0 18px 60px #0009; }
#provider-model-ping-dialog::backdrop, #provider-model-delete-dialog::backdrop { background:#000a; }
.provider-ping-response { white-space:pre-wrap; overflow:auto; max-height:55vh; overflow-wrap:anywhere; background:#10131a; padding:12px; border-radius:8px; }
.provider-delete-usage ul { margin-top:4px; }
.provider-dialog-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.admin-model-chain-dialog .modal-close { border:0; background:transparent; padding:0 4px; }
.admin-model-chain-name { display:grid; gap:6px; color:#aab3c5; font-size:12px; }
.admin-model-chain-name input { box-sizing:border-box; width:100%; padding:10px; }
.admin-model-chain-options { display:grid; gap:5px; max-height:42vh; overflow:auto; margin:12px 0; padding:6px; border:1px solid var(--line); border-radius:9px; }
.admin-chain-model-option { display:grid; grid-template-columns:28px 18px minmax(120px,.7fr) minmax(0,1fr); align-items:center; gap:9px; padding:9px; border:1px solid transparent; border-radius:7px; background:rgb(255 255 255 / 2%); }
.admin-chain-model-option.is-dragging { opacity:.45; }
.admin-chain-model-option small { overflow-wrap:anywhere; color:#8992a7; }
.admin-chain-drag-handle { color:#aab3c5; font-size:20px; line-height:1; cursor:grab; text-align:center; }
.admin-chain-option-alias { overflow-wrap:anywhere; color:#e2e8f0; font-weight:600; }
.admin-model-chain-dialog-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; padding-top:10px; border-top:1px solid var(--line); }
.admin-model-chain-dialog-actions .error { flex:1; padding:0; text-align:left; }
@media(max-width:600px){
  .admin-model-chains-heading { align-items:flex-start; flex-direction:column; }
  .admin-model-chain-edit { align-items:flex-start; flex-direction:column; gap:5px; }
  .admin-model-chain-edit strong { flex:0 1 auto; }
  .admin-chain-model-option { grid-template-columns:24px 18px minmax(0,1fr); }
  .admin-chain-model-option small { grid-column:3; }
}

/* Usability refinements: gate the workspace until login and give editing forms room. */
.dashboard-shell:not(.is-authenticated) #dashboard-main > :not(#dashboard-login-panel) { display:none !important; }
.dashboard-shell:not(.is-authenticated) .dashboard-nav,
.dashboard-shell:not(.is-authenticated) .workspace-switcher,
.dashboard-shell:not(.is-authenticated) .sidebar-footer { visibility:hidden; }
.dashboard-shell:not(.is-authenticated) #dashboard-login-panel { max-width:680px; margin:clamp(28px,10vh,100px) auto; }
#dashboard-login-panel .api-key-form { align-items:flex-start; }
#dashboard-login-panel input { min-width:min(340px,100%); min-height:42px; }
.refresh-draft-status { color:#fcd34d; font-size:11px; }
.admin-grid { grid-template-columns:minmax(0,1fr); }
.admin-limits-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.provider-admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; }
.provider-admin-grid form { min-width:0; }
.provider-admin-grid input,.provider-admin-grid select { width:100%; min-height:40px; box-sizing:border-box; }
.provider-admin-grid h3 { margin:0 0 4px; }
#provider-model-form { display:grid; gap:12px; max-width:980px; margin:8px 0 24px; padding:16px; border:1px solid var(--line); border-radius:10px; background:rgb(255 255 255 / 2%); }
#provider-model-form > select { max-width:520px; }
#provider-model-form .provider-assignment-picker { width:100%; box-sizing:border-box; }
#provider-assignment-submit { justify-self:start; min-height:42px; }
.provider-definition-form { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; }
.provider-definition-form > label { display:flex; min-width:0; flex-direction:column; gap:6px; color:#aab2c3; font-size:12px; }
.provider-definition-form .provider-headers-field { grid-column:1 / -1; }
.provider-definition-form textarea { min-height:76px; resize:vertical; }
#provider-catalog-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; }
#provider-catalog-form > * { min-width:0; }
#provider-catalog-form > label { display:flex; flex-direction:column; gap:6px; color:#aab2c3; font-size:12px; }
#provider-catalog-form > label:has(input[type="checkbox"]) { flex-direction:row; align-items:center; min-height:40px; }
#provider-catalog-form > button { min-height:40px; }
#provider-catalog-search-status { grid-column:1 / -1; }
.key-create-form { display:grid; grid-template-columns:minmax(220px, .7fr) minmax(0,1.3fr); align-items:start; }
.key-create-form > .key-name-field { display:flex; flex-direction:column; gap:7px; color:#aab2c3; font-size:12px; }
.key-policy-picker { grid-column:1 / -1; min-width:0; border:1px solid var(--line); border-radius:9px; padding:12px 14px; }
.key-policy-picker legend { padding:0 5px; color:#e8ebf4; font-weight:600; }
.key-policy-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; align-items:end; }
.key-policy-grid label { display:flex; min-width:0; flex-direction:column; gap:7px; color:#aab2c3; font-size:12px; }
.key-policy-grid label > span { min-height:42px; display:flex; align-items:center; gap:7px; }
.key-policy-grid select,.key-policy-grid input:not([type="checkbox"]),.key-name-field input { box-sizing:border-box; width:100%; min-height:42px; }
.key-admin-warning { grid-column:1 / -1; margin:0; padding:10px 12px; border:1px solid rgb(245 158 11 / 22%); border-radius:8px; background:rgb(245 158 11 / 7%); }
.key-policy-grid label > span input { width:17px; height:17px; }
.key-create-submit { justify-self:start; min-height:42px; }
.provider-advanced-section { margin-top:22px; padding-top:14px; border-top:1px solid var(--line); }
.provider-advanced-section > summary { margin-bottom:14px; color:#c4b5fd; cursor:pointer; font-size:13px; font-weight:600; }
.dashboard-workspace .panel { min-width:0; }
.dashboard-workspace input:not([type="checkbox"]),.dashboard-workspace select,.dashboard-workspace textarea { min-height:40px; box-sizing:border-box; }
.table-wrap { max-width:100%; border:1px solid var(--line); border-radius:8px; }
.table-column-resizable th { position:relative; }
.table-column-resize-handle { position:absolute; z-index:3; inset-block:0; inset-inline-end:-8px; width:16px; padding:0; border:0; border-radius:0; background:transparent; color:#9aa6ba; cursor:col-resize; touch-action:none; }
.table-column-resize-handle::after { position:absolute; inset-block:5px; inset-inline-start:7px; width:2px; border-radius:2px; background:#758198; content:""; box-shadow:0 0 0 1px #111418; }
.table-column-resize-handle::before { position:absolute; inset-block-start:50%; inset-inline-start:3px; transform:translateY(-50%); content:"⋮"; color:#d1d8e6; font-size:14px; font-weight:700; line-height:1; text-shadow:0 1px 3px #0f1115; }
.table-column-resize-handle:hover::after,.table-column-resize-handle:focus-visible::after,.table-column-resizable.is-resizing .table-column-resize-handle.is-active::after { background:#a78bfa; }
.table-column-resize-handle:hover::before,.table-column-resize-handle:focus-visible::before,.table-column-resizable.is-resizing .table-column-resize-handle.is-active::before { color:#c4b5fd; }
.table-column-resizable.is-resizing,.table-column-resizable.is-resizing * { cursor:col-resize !important; user-select:none !important; }
.provider-connections-table { width:100%; table-layout:fixed; font-size:12px; }
.provider-connections-table th,.provider-connections-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; line-height:1.4; }
.provider-connections-table th:nth-child(1) { width:12%; }
.provider-connections-table th:nth-child(2) { width:9%; }
.provider-connections-table th:nth-child(3) { width:6%; }
.provider-connections-table th:nth-child(4) { width:9%; }
.provider-connections-table th:nth-child(5) { width:12%; }
.provider-connections-table th:nth-child(6) { width:26%; }
.provider-connections-table th:nth-child(7) { width:10%; }
.provider-connections-table th:nth-child(8) { width:16%; }
.provider-connection-error { display:block; max-height:7rem; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; margin-top:4px; color:#fbbf24; font-size:10px; line-height:1.3; }
.provider-connections-table td:last-child button { max-width:100%; margin:0 4px 5px 0; white-space:normal; }
.requests-table-wrap { overflow-x:auto; }
.compact-requests-table { width:100%; min-width:1420px; table-layout:fixed; font-size:11px; }
.compact-requests-table th,.compact-requests-table td { padding:6px 7px; }
.compact-requests-table th { white-space:normal; line-height:1.25; vertical-align:bottom; }
.compact-requests-table td { white-space:nowrap; }
.compact-requests-table .link-button { background:none; border:0; color:#7aa2f7; cursor:pointer; font:inherit; padding:0; text-decoration:underline; }
.compact-requests-table th:nth-child(1) { width:112px; }
.compact-requests-table th:nth-child(4) { width:180px; }
.compact-requests-table th:nth-child(5) { width:220px; }
.compact-requests-table td:nth-child(1),.compact-requests-table td:nth-child(4),.compact-requests-table td:nth-child(5) { white-space:normal; overflow-wrap:anywhere; }
.request-date-time { display:inline-block; line-height:1.35; white-space:nowrap; font-variant-numeric:tabular-nums; }
.request-model-text { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.35; overflow-wrap:anywhere; }
.request-source-text { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; overflow:hidden; white-space:normal; line-height:1.35; overflow-wrap:anywhere; }
.rotation-keys-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
#user-secret-key-section textarea { box-sizing:border-box; width:100%; max-width:720px; margin:8px 0; background:#0d0f17; color:#e9edf2; border:1px solid #394150; border-radius:7px; padding:10px; overflow-wrap:anywhere; }
#user-secret-key-section label { display:block; margin:10px 0; }
.recommendations-table { table-layout:fixed; font-size:12px; }
.recommendations-table th,.recommendations-table td { padding:7px 6px; white-space:normal; overflow-wrap:anywhere; vertical-align:top; line-height:1.4; }
.recommendations-table th:nth-child(1) { width:9%; }
.recommendations-table th:nth-child(2) { width:19%; }
.recommendations-table th:nth-child(3) { width:13%; }
.recommendations-table th:nth-child(4) { width:12%; }
.recommendations-table th:nth-child(5) { width:12%; }
.recommendations-table th:nth-child(6) { width:25%; }
.recommendations-table th:nth-child(7) { width:10%; }
.recommendations-table code { white-space:normal; overflow-wrap:anywhere; }
.recommendations-table .btn-sm { min-width:0; max-width:100%; padding:6px 8px; white-space:normal; }
.error { text-align:left; line-height:1.5; }
@media(max-width:1100px) {
  .provider-admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-limits-grid,.key-policy-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.table-column-resizable td .table-cell-text-flow { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; max-width:100%; overflow:hidden; white-space:normal; overflow-wrap:anywhere; line-height:1.35; }
@media(max-width:800px) {
  .provider-admin-grid { grid-template-columns:minmax(0,1fr); }
  .key-create-form { grid-template-columns:minmax(0,1fr); }
  .key-policy-picker { grid-column:1; }
  #provider-catalog-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  .admin-limits-grid,.key-policy-grid,#provider-catalog-form,.provider-definition-form { grid-template-columns:minmax(0,1fr); }
  .provider-definition-form .provider-headers-field,#provider-catalog-search-status { grid-column:1; }
  .refresh-draft-status { display:none; }
  .dashboard-shell:not(.is-authenticated) #dashboard-login-panel { margin:14px 0; }
}
.provider-response-excerpt { max-height: 320px; overflow: auto; margin: 8px 0 16px; padding: 10px; border: 1px solid #303744; border-radius: 6px; background: #101318; color: #d7deea; white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-refresh-feedback { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:8px 0 12px; }
.request-incident-index { margin:14px 0; padding:12px; border:1px solid var(--border-color,#2b303b); border-radius:10px; }
.request-incident-index .section-heading { margin-bottom:4px; }
.request-incident-index h3 { margin:0; font-size:14px; }
.request-incident-index table { min-width:680px; }
.requests-table-wrap { max-height:70vh; overflow:auto; contain:layout paint; }
#latest-requests-table thead th { position:sticky; top:0; z-index:2; background:var(--surface); }
.request-model-name { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.smart-comparison-card { min-width:0; }
.smart-comparison-card h4 { font-size:17px; margin:0 0 8px; }
.smart-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:16px 0; }
.smart-metrics > div { min-width:0; padding-bottom:9px; border-bottom:1px solid var(--line); }
.smart-metrics dt { color:var(--muted,#929aae); font-size:12px; margin-bottom:5px; }
.smart-metrics dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.smart-evaluation-errors { color:#ffc36b; white-space:normal; overflow-wrap:anywhere; margin-top:8px; }
.smart-evaluation-errors li { margin:8px 0; }
.smart-model-distribution { font-size:13px; overflow-wrap:anywhere; }
@media(max-width:650px) { .smart-metrics { grid-template-columns:1fr; } }
