@font-face {
  font-family: "Inter";
  src: url("/console/assets/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Shared visual tokens: neutral surfaces, readable type, one action accent. */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ink: #18181b;
  --sub: #52525b;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-soft: #f0f0f2;
  --bg: #fafafa;
  --surface: #ffffff;
  --hover: #f4f4f5;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #15803d;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 3%);
  --sidebar-width: 244px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 400 14px/1.6 var(--font); background: var(--bg); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 13px; font-weight: 500; line-height: 1.5; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover { background: var(--hover); border-color: #d4d4d8; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }
input, select, textarea { max-width: 100%; min-width: 0; padding: 9px 11px; background: var(--surface); border: 1px solid #d4d4d8; border-radius: 7px; font-size: 13px; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #a1a1aa; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; margin: 0; }
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.75; }
i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
svg { flex-shrink: 0; }
.primary { background: var(--ink); border-color: var(--ink); color: white; font-weight: 550; box-shadow: var(--shadow); }
.primary:hover { background: #303036; border-color: #303036; }
.secondary { background: var(--surface); color: #3f3f46; box-shadow: var(--shadow); }
.icon-btn { min-width: 36px; padding: 8px; border-color: transparent; background: transparent; color: var(--sub); }
.icon-btn:hover { border-color: transparent; background: var(--hover); }
.small { min-height: 32px; font-size: 12px; padding: 5px 10px; }
.dot { display: inline-block; width: 6px; height: 6px; background: var(--success); border-radius: 50%; flex-shrink: 0; }
.dot.muted { background: #a1a1aa; }
.label, .eyebrow { font: 550 11px/1.5 var(--font); letter-spacing: 1.5px; color: var(--muted); }
.brand-symbol { display: flex; align-items: baseline; width: 33px; font-size: 32px; font-weight: 750; line-height: 1; letter-spacing: -3px; flex-shrink: 0; }
.brand-symbol > span { color: var(--accent); font-size: 25px; }
.brand { display: flex; align-items: center; gap: 5px; font-size: 23px; letter-spacing: -1px; }
.brand b, .login-brand b { font-weight: 650; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 29px 16px 0; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand { margin: 0 12px 30px; }
.workspace-card { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; background: #f4f4f5; color: #3f3f46; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-weight: 600; }
.workspace-card > div { min-width: 0; }
.workspace-card b { display: block; font-size: 12px; font-weight: 600; }
.workspace-card small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.workspace-card > .dot { margin-left: auto; }
.nav-caption { display: block; margin: 0 12px 10px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .4px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav .nav-caption { margin-top: 27px; margin-bottom: 8px; }
nav > a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 10px 12px; color: var(--sub); border-radius: 7px; font-size: 13px; font-weight: 450; }
nav > a i { color: var(--muted); }
nav > a:hover { background: var(--hover); color: var(--ink); }
nav > a.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
nav > a.active i { color: var(--accent); }
nav > a.active::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
nav > a .nav-tag { margin-left: auto; padding: 1px 5px; border: 1px solid #ddd6fe; border-radius: 4px; background: #f5f3ff; color: #6d28d9; font-size: 10px; font-weight: 500; }
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom > a { display: flex; align-items: center; gap: 10px; margin: 19px 12px; font-size: 12px; color: var(--sub); }
.sidebar-bottom > a:hover { color: var(--ink); }
.sidebar-bottom > a > span { margin-left: auto; color: var(--muted); }
.account { display: flex; align-items: center; gap: 9px; min-height: 82px; padding: 18px 4px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--hover); color: var(--sub); font-size: 12px; font-weight: 550; flex-shrink: 0; }
.account > div { min-width: 0; flex: 1; }
.account b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.account small { display: block; color: var(--muted); font-size: 11px; }
.account button { flex-shrink: 0; min-width: 30px; width: 30px; padding: 5px; }
.shell { margin-left: var(--sidebar-width); min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.breadcrumb { color: var(--muted); }
.breadcrumb > span { margin: 0 12px; color: #d4d4d8; }
.breadcrumb > b { color: var(--ink); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 18px; color: var(--sub); font-size: 12px; }
.top-right a:hover { color: var(--accent); }
.env { display: flex; align-items: center; gap: 7px; color: var(--sub); }
.divider { height: 14px; border-left: 1px solid var(--line); }
main { max-width: 1720px; margin: auto; padding: 34px 36px 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 8px; color: var(--ink); font-size: 28px; font-weight: 650; line-height: 1.4; letter-spacing: -.7px; }
.page-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.heading-action .primary { min-height: 40px; padding: 9px 14px; font-size: 13px; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; min-height: 62px; margin-bottom: 20px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filterbar #product { max-width: 225px; color: var(--ink); }
.product-usage { margin-bottom: 20px; }
.product-usage table { min-width: 800px; }
.product-usage .product-count { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.segmented { display: flex; padding: 3px; background: #f4f4f5; border: 1px solid #ededf0; border-radius: 7px; flex-shrink: 0; }
.segmented > button { min-height: 28px; padding: 4px 11px; border-color: transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.segmented > button.selected { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 6%); }
.filterbar select { min-height: 36px; padding: 7px 25px 7px 10px; font-size: 12px; border-color: var(--line); }
.filter-spacer { flex: 1; }
.auto-refresh { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.filterbar #export { min-height: 36px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { min-width: 0; padding: 19px 21px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sub); }
.kpi-top > i { color: #a1a1aa; }
.kpi-value { margin: 10px 0 7px; font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.kpi-value .unit { margin-left: 5px; font-size: 16px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.kpi-foot { font-size: 11px; color: var(--muted); }
.good { color: var(--success) !important; }
.bad { color: var(--danger) !important; }
.panel { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; }
.panel-title { font-size: 14px; font-weight: 600; line-height: 1.6; }
.panel-sub { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--muted); }
.panel-header .link { min-height: auto; padding: 0; background: none; border: 0; font-size: 12px; color: var(--accent); cursor: pointer; }
.panel-header .link:hover { text-decoration: underline; }
.count-badge { display: inline-flex; align-items: center; min-height: 22px; margin-left: 8px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: #fafafa; color: var(--sub); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; vertical-align: middle; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(270px, 1fr); gap: 20px; margin-bottom: 20px; }
.chart-tabs { display: flex; gap: 12px; }
.chart-tabs button { min-height: 26px; padding: 2px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 12px; }
.chart-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.chart-content { position: relative; padding: 4px 20px 17px; }
.chart-content svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-content svg text { font-family: var(--font); font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 5px 5px 0; font-size: 11px; color: var(--muted); }
.chart-legend > span { display: flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 14px; height: 2px; background: var(--accent); }
.legend-line.error { background: #dc2626; }
.chart-tooltip { position: absolute; top: 30px; z-index: 2; padding: 8px 11px; border-radius: 6px; background: var(--ink); color: white; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgb(0 0 0 / 12%); }
.latency-content { padding: 4px 20px 20px; }
.latency-line { margin-bottom: 18px; }
.latency-line > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.latency-line b { color: var(--ink); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; }
.bar { height: 5px; margin-top: 9px; border-radius: 5px; background: var(--hover); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 5px; background: #3b82f6; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 17px; }
.mini-stats span { display: block; color: var(--muted); font-size: 11px; }
.mini-stats b { display: block; margin-top: 5px; color: var(--ink); font-size: 17px; font-weight: 550; font-variant-numeric: tabular-nums; }
.mini-stats small { font-size: 11px; font-weight: 400; color: var(--muted); }
.bottom-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 20px; }
.quiet-note { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 20px; padding: 13px 15px; background: #f4f4f5; border: 1px solid var(--line); border-radius: 8px; color: var(--sub); font-size: 12px; line-height: 1.8; }
.quiet-note i { margin-top: 3px; flex-shrink: 0; color: var(--muted); }
.quiet-note a { color: var(--accent); }
.quiet-note .link { flex-shrink: 0; margin-left: auto; }
.table-scroll { width: 100%; overflow: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { padding: 12px 18px; background: #fafafa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--sub); font-size: 11px; font-weight: 550; }
td { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); color: #3f3f46; }
td small { font-size: 11px; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-request], tbody tr[data-session] { cursor: pointer; }
tbody tr:hover { background: #fafafa; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: -.15px; }
.trace-id { color: var(--accent-hover); font-family: var(--mono); font-size: 11px; letter-spacing: -.15px; }
.muted { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #dcfce7; border-radius: 5px; background: #f0fdf4; color: #166534; font-size: 11px; font-weight: 500; line-height: 1.5; }
.status.error { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.status.cancelled { background: #fffbeb; color: #92400e; border-color: #fef3c7; }
.status .dot { width: 4px; height: 4px; background: currentColor; }
.tag { display: inline-flex; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fafafa; color: var(--sub); font-size: 10px; font-weight: 450; white-space: nowrap; }
.tag.lab { background: #f5f3ff; border-color: #ede9fe; color: #6d28d9; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.table-footer div { display: flex; align-items: center; gap: 8px; }
.table-footer button { min-height: 30px; padding: 4px 9px; font-size: 11px; }
.request-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.request-panel .panel-header { padding-bottom: 14px; }
.request-panel .request-tools { margin: 0; padding: 0 20px 20px; }
.searchbox { flex: 1; min-width: 200px; }
.request-tools input, .request-tools select { min-height: 38px; font-size: 12px; padding: 8px 10px; border-color: var(--line); }
.request-tools button { min-height: 38px; }
.summary-strip { display: flex; gap: 18px; margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty i { display: block; margin-bottom: 10px; color: #a1a1aa; }
.empty i svg { width: 28px; height: 28px; }
.empty b { display: block; margin-bottom: 6px; color: var(--sub); font-size: 14px; font-weight: 500; }
.empty p { margin: 0; font-size: 12px; }
.empty-chart { position: absolute; inset: 20px 0 35px; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--sub); }
.list-row strong { font-size: 12px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.list-row small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.list-row > span:last-child { margin-left: auto; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.alert-list { padding: 0 20px 20px; }
.alert { margin: 6px 0; padding: 12px; background: #fffbeb; border: 1px solid #fef3c7; border-radius: 7px; color: #92400e; font-size: 11px; }
.alert.error { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.alert b { display: block; margin-bottom: 3px; font-size: 12px; font-weight: 550; }
.healthy-state { display: flex; align-items: center; gap: 11px; margin: 0 20px 20px; padding: 15px; background: #fafafa; border: 1px solid var(--line); border-radius: 7px; color: var(--success); font-size: 12px; }
.healthy-state strong { display: block; font-size: 13px; font-weight: 550; color: var(--ink); }
.healthy-state small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 24px; padding: 18px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.page-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.page-footer .dot { width: 4px; height: 4px; }
.detail-dialog { position: fixed; left: auto; right: 0; top: 0; width: 700px; max-width: 95vw; height: 100dvh; max-height: none; margin: 0; padding: 0; background: var(--surface); color: var(--ink); border: 0; border-left: 1px solid var(--line); box-shadow: -12px 0 48px rgb(0 0 0 / 8%); }
.detail-dialog::backdrop { background: rgb(24 24 27 / 25%); }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 25px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-header h2 { margin: 5px 0 0; font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
#detail-body { padding: 24px 28px; }
.detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.detail-meta .mono { min-width: 0; overflow-wrap: anywhere; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.detail-metrics > div { padding: 13px; background: #fafafa; border: 1px solid var(--line); border-radius: 7px; }
.detail-metrics span { display: block; font-size: 11px; color: var(--muted); }
.detail-metrics b { display: block; margin-top: 6px; font-size: 16px; font-weight: 550; font-variant-numeric: tabular-nums; }
.detail-tabs { display: flex; gap: 22px; margin: 23px 0 18px; border-bottom: 1px solid var(--line); }
.detail-tabs button { min-height: 36px; padding: 7px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 13px; }
.detail-tabs button.active { color: var(--accent); border-color: var(--accent); }
.message { margin: 12px 0; padding: 16px; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; }
.message.user { background: var(--surface); }
.message.assistant { background: #f8fafc; border-color: #e2e8f0; }
.message summary { cursor: pointer; font-size: 12px; font-weight: 500; color: var(--sub); }
.message summary + .message-text { margin-top: 12px; }
.role { margin-bottom: 8px; color: var(--muted); font: 550 10px/1.5 var(--font); letter-spacing: 1px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; color: #27272a; font-size: 14px; line-height: 1.85; }
.json { max-height: 65vh; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; color: #3f3f46; font: 12px/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-label { margin: 18px 0 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; line-height: 1.8; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr); gap: 20px; }
.settings-form { padding: 24px; }
.settings-form h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.settings-form p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 12px; font-weight: 500; color: #3f3f46; }
.field small { font-size: 11px; line-height: 1.7; color: var(--muted); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.toggle-row b { font-size: 13px; font-weight: 500; }
.toggle-row small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.settings-divider { margin: 26px 0; border-top: 1px solid var(--line); }
.definition-list { margin-top: 0; padding: 0 20px 20px; }
.definition-list dt { margin-top: 16px; font-size: 12px; font-weight: 550; color: #3f3f46; }
.definition-list dd { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.playground { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; min-height: 620px; }
.playground-config { padding: 20px; }
.playground-config .field { margin-bottom: 16px; }
.playground-config textarea { height: 180px; font-size: 13px; }
.playground-config .field-row { gap: 10px; margin: 0; }
.lab-stream { display: flex !important; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.chat-heading .dot { margin-right: 4px; }
.chat-window { flex: 1; min-height: 300px; max-height: 510px; overflow: auto; padding: 20px 24px; }
.chat-welcome { display: grid; place-content: center; min-height: 320px; text-align: center; color: var(--muted); }
.chat-welcome .mark { font-size: 36px; color: var(--accent); line-height: 1; }
.chat-welcome h3 { margin: 16px 0 8px; color: var(--ink); font-size: 18px; font-weight: 550; }
.chat-welcome p { max-width: 285px; margin: 0 auto; color: var(--muted); font-size: 13px; }
.chat-bubble { margin: 8px 0 18px; }
.chat-bubble .role { margin-bottom: 6px; }
.chat-bubble p { margin: 0; color: #27272a; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; }
.chat-bubble.user { margin-left: 35px; padding: 14px; background: #f4f4f5; border: 1px solid var(--line-soft); border-radius: 9px; }
.chat-bubble.assistant { margin-right: 25px; padding: 10px 0 10px 3px; }
.chat-composer { padding: 16px; border-top: 1px solid var(--line); }
.chat-composer textarea { display: block; width: 100%; height: 82px; padding: 12px; border-color: var(--line); background: #fafafa; font-size: 14px; resize: vertical; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.composer-bottom small { font-size: 11px; color: var(--muted); }
.composer-actions { display: flex; gap: 8px; }
.test-result { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.test-result a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
#global-error, .error-text { color: var(--danger); font-size: 13px; }
#global-error { margin-bottom: 18px; padding: 12px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; }
.skeleton { height: 180px; background: linear-gradient(90deg, #f4f4f5, #eaeaed, #f4f4f5); background-size: 200% 100%; border-radius: var(--radius); animation: loading 1.5s infinite; }
#toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 8px; background: #18181b; color: white; font-size: 13px; box-shadow: 0 4px 18px rgb(0 0 0 / 14%); opacity: 0; pointer-events: none; }
#toast.visible { opacity: 1; }
.mobile-only { display: none; }
#boot { padding: 50px; color: var(--muted); font-size: 14px; }
#login { display: flex; flex-direction: column; max-width: 1240px; min-height: 100vh; margin: auto; padding: 38px 60px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 25px; letter-spacing: -.8px; }
.login-brand .label { margin-left: 16px; padding-left: 20px; border-left: 1px solid var(--line); font-size: 11px; }
.login-layout { display: grid; grid-template-columns: 1fr 400px; align-items: center; gap: 100px; margin: auto 0; padding: 80px 0; }
.login-intro h1 { margin: 18px 0 22px; font-size: 44px; font-weight: 600; line-height: 1.45; letter-spacing: -1.5px; }
.login-intro p { color: var(--sub); font-size: 15px; line-height: 1.9; }
.login-features { display: flex; gap: 32px; margin: 34px 0 42px; }
.login-features span { color: var(--accent); font-size: 11px; font-weight: 500; }
.login-features b { display: block; margin-top: 8px; color: var(--sub); font-size: 12px; font-weight: 500; }
.login-network { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 11px; }
.login-network > span:last-child { color: var(--muted); }
.login-card { padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / 4%), 0 1px 3px rgb(0 0 0 / 3%); }
.tiny-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; color: var(--sub); }
.login-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.login-card > p { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin-bottom: 8px; color: var(--sub); font-size: 12px; font-weight: 500; }
.login-card input { display: block; width: 100%; padding: 11px; font-size: 14px; }
.login-card .field-hint { margin: 8px 0 20px; color: var(--muted); font-size: 11px; }
.login-card .primary { justify-content: space-between; width: 100%; min-height: 44px; padding: 11px 14px; font-size: 13px; }
.login-note { margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.85; }
.login-card .error-text { margin-top: 12px; font-size: 12px; }
.login-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
@keyframes loading { to { background-position: -200% 0; } }

@media (min-width: 1600px) {
  main { padding: 40px 48px 0; }
  .topbar { padding: 0 48px; }
  .kpi { padding: 23px 25px; }
  .kpi-value { font-size: 36px; }
  .chart-content svg { height: 250px; }
  .mono, .trace-id { font-size: 12px; }
  td { padding: 16px 20px; }
}
@media (max-width: 1200px) {
  :root { --sidebar-width: 224px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  main { padding: 28px 24px 0; }
  .topbar { padding: 0 24px; }
  .kpis { gap: 12px; }
  .kpi { padding: 17px 16px; }
  .kpi-value { font-size: 28px; }
  .chart-grid { grid-template-columns: minmax(0, 1.7fr) 245px; gap: 16px; }
  .bottom-grid { gap: 16px; }
  .filterbar .auto-refresh { display: none; }
  .filterbar { gap: 8px; }
  .playground { grid-template-columns: 265px minmax(0, 1fr); gap: 16px; }
  .playground-config { padding: 17px; }
  .login-layout { gap: 50px; }
}
@media (max-width: 1000px) {
  .chart-grid, .bottom-grid, .settings-grid { grid-template-columns: 1fr; }
  .latency-content { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .mini-stats { grid-column: 1 / -1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .filterbar { flex-wrap: wrap; }
  .filter-spacer { display: none; }
  .filterbar #refresh { margin-left: auto; }
  .playground { grid-template-columns: 1fr; }
  .playground-config { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .playground-config .field { margin: 0; }
  .playground-config .system-field { grid-column: 1 / -1; }
  .playground-config textarea { height: 130px; }
  .playground-config .field-row { align-self: end; }
  .login-layout { grid-template-columns: 1fr 360px; gap: 35px; }
  .login-intro h1 { font-size: 35px; }
  #login { padding: 30px; }
  .login-card { padding: 27px; }
}
@media (max-width: 700px) {
  .sidebar { width: 244px; transform: translateX(-100%); transition: transform .15s; box-shadow: 10px 0 40px rgb(0 0 0 / 8%); }
  .sidebar.open { transform: translateX(0); }
  .shell { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .topbar { height: 58px; gap: 10px; padding: 0 16px; }
  .breadcrumb { flex: 1; font-size: 11px; }
  .breadcrumb > span { margin: 0 7px; }
  .top-right .divider, .top-right > a { display: none; }
  .env { font-size: 11px; }
  .icon-btn { min-height: 38px; }
  main { padding: 26px 16px 0; }
  .page-heading { align-items: flex-start; gap: 14px; margin-bottom: 22px; }
  .page-heading h1 { margin-top: 7px; font-size: 25px; }
  .page-heading p { max-width: 245px; font-size: 12px; line-height: 1.75; }
  .eyebrow { font-size: 10px; letter-spacing: 1.2px; }
  .heading-action { padding-top: 3px; flex-shrink: 0; }
  .heading-action .primary { min-height: 36px; padding: 8px 10px; font-size: 12px; }
  .heading-action svg { width: 14px; }
  .filterbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 8px; padding: 10px; }
  #period { grid-column: 1 / 3; grid-row: 1; }
  .segmented > button { flex: 1; font-size: 11px; padding: 5px 7px; }
  #refresh { grid-column: 3; grid-row: 1; justify-self: end; }
  #source { grid-column: 1; grid-row: 2; }
  #kind { grid-column: 2; grid-row: 2; }
  #export { grid-column: 3; grid-row: 2; }
  .filterbar #product { grid-column: 1 / -1; grid-row: 3; max-width: none; }
  .filterbar select { width: 100%; padding: 8px 5px; font-size: 11px; }
  .filterbar #export { padding: 6px 9px; font-size: 11px; }
  .filterbar #export svg { width: 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 16px 14px; }
  .kpi-top { font-size: 11px; }
  .kpi-value { font-size: 26px; }
  .kpi-foot { font-size: 10px; line-height: 1.75; }
  .panel-header { padding: 17px 16px 14px; }
  .panel-title { font-size: 13px; }
  .panel-header .link, .panel-sub { font-size: 11px; }
  .chart-content { padding: 0 12px 16px; }
  .chart-content svg { height: 195px; }
  .chart-tabs { gap: 9px; }
  .chart-tabs button { font-size: 11px; }
  .chart-legend { font-size: 10px; gap: 10px; }
  .latency-content { grid-template-columns: 1fr 1fr; padding: 4px 16px 18px; }
  .table-scroll table { min-width: 650px; }
  .request-panel .table-scroll table { min-width: 1000px; }
  th, td { padding: 12px 14px; }
  .table-footer { padding: 12px 14px; gap: 8px; }
  .table-footer button { padding: 5px 7px; }
  .request-panel .request-tools { padding: 0 16px 16px; gap: 8px; }
  .request-tools .searchbox { flex-basis: 100%; min-width: 0; }
  .request-tools select { flex: 1; min-width: 0; }
  .request-tools input { font-size: 14px; }
  .quiet-note { font-size: 11px; padding: 12px; }
  .page-footer { font-size: 10px; gap: 8px; line-height: 1.8; }
  .page-footer > span:last-child { text-align: right; }
  .detail-dialog { width: 100vw; max-width: 100vw; }
  .drawer-header { padding: 20px; }
  .drawer-header h2 { font-size: 19px; }
  #detail-body { padding: 20px; }
  .detail-metrics { gap: 8px; }
  .detail-metrics > div { padding: 10px; }
  .detail-metrics b { font-size: 14px; }
  .detail-metrics span { font-size: 10px; }
  .detail-meta .mono { max-width: 100%; }
  .settings-form { padding: 20px; }
  .field-row { gap: 12px; }
  .playground-config { gap: 12px; }
  .playground-config .field-row { gap: 8px; }
  .field input, .field select, .field textarea, .chat-composer textarea, .login-card input { font-size: 16px; }
  .field label { font-size: 11px; }
  .field small { font-size: 10px; }
  .chat-window { max-height: 450px; padding: 16px; }
  .chat-bubble.user { margin-left: 20px; }
  .chat-composer { padding: 12px; }
  .composer-bottom small { max-width: 160px; font-size: 10px; }
  .composer-actions { gap: 5px; }
  .composer-actions button { padding: 8px; font-size: 12px; }
  .test-result { gap: 10px; font-size: 10px; }
  .login-intro { display: none; }
  .login-layout { display: block; margin: auto 0; padding: 36px 0; }
  .login-card { padding: 28px 24px; }
  #login { padding: 28px 22px; }
  .login-brand { font-size: 24px; }
  .login-brand .label { font-size: 10px; }
  .login-footer { font-size: 10px; }
  .login-footer span { max-width: 110px; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
