:root {
  --ink: #111412;
  --ink-2: #1a1e1b;
  --ink-3: #252b27;
  --paper: #eeece5;
  --paper-2: #f6f4ee;
  --paper-3: #e4e3dc;
  --line: #d5d4cc;
  --line-dark: #343a35;
  --muted: #777c75;
  --muted-dark: #aeb3aa;
  --accent: #c8f169;
  --accent-2: #a7d74e;
  --red: #d9795f;
  --blue: #88b7b0;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --sans: "Avenir Next", "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-panel: 16px;
  --radius-control: 10px;
  --shadow-panel: 0 10px 30px rgba(17, 20, 18, .055);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .9em; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 26px 18px 20px; background: var(--ink); color: var(--paper); }
.sidebar-scrim { display: none; }
.brand-lockup, .mobile-brand { display: flex; align-items: center; gap: 11px; }
.brand-mark, .login-mark { display: grid; grid-template-columns: repeat(3, 5px); align-items: end; gap: 3px; width: 21px; height: 22px; }
.brand-mark span, .login-mark span { display: block; width: 5px; height: 100%; background: var(--accent); }
.brand-mark span:nth-child(2), .login-mark span:nth-child(2) { height: 72%; }
.brand-mark span:nth-child(3), .login-mark span:nth-child(3) { height: 46%; }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.brand-name span { color: var(--accent); }
.brand-subtitle { margin-top: 2px; color: var(--muted-dark); font-family: var(--mono); font-size: 9px; letter-spacing: .17em; }
.sidebar-rule { height: 1px; margin: 28px 3px 24px; background: var(--line-dark); }
.nav-label, .panel-kicker, .eyebrow { color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.sidebar .nav-label { margin: 0 11px 10px; color: #8d948a; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #bbc0b9; text-align: left; transition: background 180ms ease, color 180ms ease, border-color 180ms ease; }
.nav-item:hover { background: #1c211e; color: var(--paper); }
.nav-item.is-active { border-color: #3c443d; background: #242a25; color: var(--paper); }
.nav-icon { color: #8e978d; font-size: 17px; line-height: 1; }
.nav-item.is-active .nav-icon { color: var(--accent); }
.nav-key { color: #687067; font-family: var(--mono); font-size: 10px; }
.sidebar-spacer { flex: 1; }
.sidebar-foot { display: grid; gap: 13px; }
.connection-chip { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #313831; border-radius: 8px; color: #aeb5ab; font-family: var(--mono); font-size: 10px; }
.status-dot, .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #70776e; }
.status-dot.is-online, .live-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(200,241,105,.12); }
.status-dot.is-error { background: var(--red); }
.quiet-button { display: flex; align-items: center; gap: 9px; padding: 4px 10px; border: 0; background: transparent; color: #818980; font-size: 12px; text-align: left; }
.quiet-button:hover { color: var(--paper); }

.main-column { min-width: 0; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 38px; border-bottom: 1px solid var(--line); }
.mobile-brand { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.breadcrumb-slash { color: #afb1aa; font-family: var(--mono); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.last-sync { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); color: var(--ink); font-size: 17px; line-height: 1; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.icon-button:hover { border-color: #a8aaa1; background: #fff; }
.icon-button:active { transform: translateY(1px); }
.profile-chip { display: flex; align-items: center; gap: 8px; padding: 3px 0 3px 4px; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.profile-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--accent); font-family: var(--mono); font-size: 11px; }
.chevron { color: var(--muted); font-size: 14px; }
.content-scroll { max-width: 1600px; margin: 0 auto; padding: 36px 38px 64px; }
.view { display: none; animation: view-in 180ms ease both; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-intro h1 { margin: 6px 0 6px; font-size: clamp(27px, 3vw, 38px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.page-intro p { max-width: 560px; margin: 0; color: var(--muted); font-size: 13px; }
.intro-actions { display: flex; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 12px; font-weight: 700; white-space: nowrap; transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .62; }
.button-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { background: #283029; }
.button-accent { background: var(--accent); color: var(--ink); }
.button-accent:hover { background: var(--accent-2); }
.button-outline { border-color: var(--line); background: transparent; color: var(--ink); }
.button-outline:hover { border-color: #92978f; background: var(--paper-2); }
.button-danger { background: var(--red); color: var(--ink); }
.button-danger:hover { background: #c86950; }
.full-button { width: 100%; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--ink); }
.read-only-badge, .cost-note, .live-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; }
.live-badge { border-color: #b5ce7d; color: #5e751f; }
.cost-note { color: #9a644f; border-color: #dfc0b2; }
.global-alert { margin: 0 0 20px; padding: 11px 14px; border: 1px solid #dfb8a9; border-radius: 9px; background: #f6e5df; color: #824d3d; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 124px; padding: 18px 19px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper-2); box-shadow: var(--shadow-panel); }
.metric-card .metric-label { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.metric-card .metric-value { margin-top: 11px; overflow: hidden; font-size: 32px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.metric-card .metric-value.is-wide { font-size: 25px; letter-spacing: 0; }
.metric-card .metric-meta { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.metric-card .metric-meta .status-dot { flex: 0 0 7px; margin-top: 4px; }
.metric-card .metric-meta > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.metric-card .metric-meta .accent { color: #607a22; }
.metric-card .metric-meta .danger { color: #a4523c; }
.skeleton-card { position: relative; overflow: hidden; background: #e8e7df; }
.skeleton-card::after, .table-placeholder::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.workspace-grid { display: grid; gap: 16px; }
.overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); margin-bottom: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper-2); box-shadow: var(--shadow-panel); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 21px 22px 16px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; font-weight: 700; }
.fleet-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 22px 15px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.fleet-summary-item { padding: 10px 12px; background: var(--paper-2); }
.fleet-summary-item strong { display: block; font-size: 17px; line-height: 1; }
.fleet-summary-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.fleet-summary-item.is-good strong { color: #607a22; }
.fleet-summary-item.is-warn strong { color: #9a644f; }
.fleet-summary-item.is-muted strong { color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
.compact-table-wrap { border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.compact-table { min-width: 560px; }
.data-table th { padding: 11px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 22px; border-bottom: 1px solid #dfded7; vertical-align: middle; font-size: 12px; }
.align-right { text-align: right !important; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 160ms ease; }
.data-table tbody tr:hover { background: #efeee8; }
.account-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.account-avatar { display: inline-grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; background: #d7e4ad; color: #526b1c; font-family: var(--mono); font-size: 10px; font-weight: 500; }
.account-name { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.account-uid { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.mono-cell { font-family: var(--mono); font-size: 11px; }
.status-label { display: inline-flex; align-items: center; gap: 6px; color: #607a22; white-space: nowrap; }
.status-label::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-label.is-cooling { color: #a56b50; }
.status-label.is-disabled { color: #a4523c; }
.status-label.is-unknown { color: var(--muted); }
.token-label { display: inline-flex; align-items: center; gap: 6px; color: #607a22; font-family: var(--mono); font-size: 10px; }
.token-label.is-expiring { color: #a56b50; }
.token-label.is-expired { color: #a4523c; }
.token-label.is-unknown { color: var(--muted); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action { width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 14px; }
.row-action:hover { border-color: #92978f; background: var(--paper); color: var(--ink); }
.row-action.danger:hover { border-color: #dfb8a9; background: #f6e5df; color: #a4523c; }
.table-placeholder { position: relative; height: 64px; overflow: hidden; color: var(--muted); text-align: center; }
.table-placeholder td { position: relative; border-bottom: 0; }
.empty-state { display: grid; justify-items: center; gap: 9px; padding: 54px 24px 58px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 18px; }
.empty-state p { max-width: 430px; margin: 0 0 7px; }
.empty-glyph { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: #71883a; font-size: 20px; }
.empty-glyph.large { width: 56px; height: 56px; font-size: 29px; }
.small-empty { padding: 24px 20px 28px; }
.small-empty strong { color: var(--ink); }
.small-empty span { font-size: 12px; }
.small-empty .button { margin-top: 3px; }

.probe-panel { overflow: hidden; }
.probe-lead { display: flex; align-items: center; gap: 17px; min-height: 84px; margin: 0 22px 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.probe-lead strong { display: block; font-size: 13px; }
.probe-lead p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.probe-orbit { position: relative; flex: 0 0 48px; width: 48px; height: 48px; }
.orbit-core { position: absolute; inset: 17px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(200,241,105,.18); }
.orbit-ring { position: absolute; inset: 4px; border: 1px solid #9ebd5a; border-radius: 50%; }
.ring-a { transform: rotate(58deg) scaleX(.55); }
.ring-b { transform: rotate(-58deg) scaleX(.55); }
.probe-form { display: grid; gap: 8px; padding: 0 22px 20px; }
.probe-form label { margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.probe-form input, .probe-form textarea, .select-wrap select, .search-field input, .secret-input input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper); color: var(--ink); }
.probe-form input, .select-wrap select, .search-field input { height: 38px; padding: 0 11px; }
.probe-form textarea { min-height: 90px; padding: 10px 11px; resize: vertical; }
.probe-form input::placeholder, .search-field input::placeholder, .probe-form textarea::placeholder { color: #a1a39d; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 31px; }
.select-arrow { position: absolute; top: 50%; right: 12px; pointer-events: none; color: var(--muted); transform: translateY(-50%); }
.compact-probe-form { grid-template-columns: 1fr; }
.probe-result { margin: 0 22px 20px; padding: 13px 14px; border: 1px solid #b8cf83; border-radius: 10px; background: #edf5d9; color: #51651f; font-size: 11px; }
.probe-result.is-error { border-color: #e2b8aa; background: #f8e8e2; color: #874d3c; }
.probe-result strong { display: block; margin-bottom: 4px; color: inherit; font-size: 12px; }
.probe-result .result-meta { display: flex; flex-wrap: wrap; gap: 11px; color: inherit; font-family: var(--mono); font-size: 10px; }
.result-preview { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(81,101,31,.18); color: inherit; font-family: var(--mono); font-size: 10px; white-space: pre-wrap; }
.events-panel { overflow: hidden; }
.event-list { border-top: 1px solid var(--line); }
.event-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 53px; padding: 8px 22px; border-bottom: 1px solid #dfded7; }
.event-row:last-child { border-bottom: 0; }
.event-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.event-dot.warning { background: #c58b62; }
.event-dot.error { background: var(--red); }
.event-copy { min-width: 0; }
.event-message { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.event-kind { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.event-time { color: var(--muted); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.event-placeholder { padding: 24px 22px; color: var(--muted); font-size: 12px; }
.reason-cell { max-width: 180px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.notice-bar { display: flex; align-items: center; gap: 10px; margin: -9px 0 19px; padding: 10px 12px; border: 1px solid #d3dfac; border-radius: 9px; background: #edf3dd; color: #657b32; font-size: 11px; }
.notice-icon { display: inline-grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; font-family: var(--mono); font-size: 10px; }
.notice-close { margin-left: auto; padding: 0 3px; border: 0; background: transparent; color: inherit; font-size: 17px; line-height: 1; }
.accounts-panel, .models-panel { overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.toolbar-title { display: flex; align-items: center; gap: 9px; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--paper-3); color: var(--muted); font-family: var(--mono); font-size: 10px; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; width: 190px; }
.search-field > span { position: absolute; top: 50%; left: 10px; color: var(--muted); font-size: 16px; transform: translateY(-53%); }
.search-field input { padding-left: 29px; }
.model-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .64fr); gap: 16px; align-items: start; }
.models-table { min-width: 750px; }
.model-id { font-family: var(--mono); font-size: 11px; }
.model-owned { color: var(--muted); font-size: 11px; }
.model-context { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.test-panel { position: sticky; top: 20px; }
.test-visual { padding: 11px 22px 18px; }
.test-line { display: flex; align-items: center; padding: 0 15px; }
.line-node { flex: 0 0 11px; width: 11px; height: 11px; border: 2px solid #afb5aa; border-radius: 50%; background: var(--paper-2); }
.line-node.active { border-color: var(--accent-2); background: var(--accent); }
.line-segment { flex: 1; height: 1px; background: #c5c8bf; }
.test-labels { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.test-footnote { margin: 0 22px 20px; color: var(--muted); font-size: 10px; }
.test-panel .probe-result { margin-top: 0; }
.model-test-state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; }
.model-test-state.ok { color: #607a22; }
.model-test-state.fail { color: #a4523c; }
.model-test-state.pending { color: var(--muted); }

.provider-boundary { display: flex; align-items: flex-start; gap: 9px; margin: -3px 0 16px; padding: 12px 14px; border: 1px solid #d3dfac; border-radius: 9px; background: #edf3dd; color: #657b32; font-size: 11px; line-height: 1.55; }
.provider-boundary strong { color: #52651f; }
.provider-boundary code { color: #526b1c; font-family: var(--mono); font-size: 10px; }
.workbuddy-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); gap: 16px; align-items: start; }
.workbuddy-status-panel, .workbuddy-usage-panel, .workbuddy-models-panel { overflow: hidden; }
.workbuddy-status-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.workbuddy-status-item { display: grid; gap: 5px; padding: 14px 20px; border-bottom: 1px solid #dfded7; }
.workbuddy-status-item:nth-child(odd) { border-right: 1px solid #dfded7; }
.workbuddy-status-item span { color: var(--muted); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.workbuddy-status-item strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workbuddy-auth-card { margin: 16px 20px 20px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.auth-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.auth-card-heading strong { display: block; margin-top: 5px; font-size: 13px; }
.workbuddy-auth-card p { margin: 11px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.workbuddy-auth-actions { display: flex; align-items: center; gap: 10px; }
.workbuddy-auth-status { min-width: 0; overflow: hidden; color: var(--muted); font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workbuddy-login-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.workbuddy-login-link a { min-width: 0; overflow: hidden; color: #526b1c; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workbuddy-login-link span { color: #9a644f; font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.workbuddy-usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 19px 20px 18px; }
.workbuddy-usage-grid > div { padding: 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.workbuddy-usage-grid strong { display: block; font-family: var(--mono); font-size: 20px; }
.workbuddy-usage-grid span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.workbuddy-endpoint { display: grid; gap: 7px; margin: 0 20px 20px; padding: 14px; border-top: 1px solid var(--line); }
.workbuddy-endpoint code { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.workbuddy-endpoint small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.workbuddy-model-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .64fr); gap: 16px; align-items: start; margin-top: 16px; }
.workbuddy-models-table { min-width: 690px; }
.workbuddy-test-panel { position: sticky; top: 20px; }
.workbuddy-model-multiplier { color: #657b32; font-family: var(--mono); font-size: 10px; }
.workbuddy-model-multiplier.is-unknown { color: var(--muted); }
.live-badge.is-error { color: #a4523c; }

.keys-panel, .logs-panel { overflow: hidden; }
.key-reveal-panel { margin-top: 16px; }
.key-reveal-help { margin: -4px 22px 13px; color: var(--muted); font-size: 11px; }
.secret-reveal-row { display: flex; align-items: center; gap: 10px; margin: 0 22px 22px; padding: 10px; border: 1px solid #d3dfac; border-radius: 9px; background: #edf3dd; }
.secret-reveal-row code { min-width: 0; flex: 1; overflow: auto; color: #526b1c; font-size: 11px; white-space: nowrap; }
.keys-table { min-width: 860px; }
.key-name { display: block; font-weight: 700; }
.key-id { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.key-prefix { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.key-state { display: inline-flex; align-items: center; gap: 6px; color: #607a22; font-family: var(--mono); font-size: 10px; }
.key-state::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.key-state.is-revoked, .key-state.is-expired { color: #a4523c; }
.key-state.is-disabled { color: var(--muted); }
.logs-panel { margin-bottom: 20px; }
.log-toolbar { align-items: center; }
.log-filters { display: flex; align-items: center; gap: 8px; }
.log-filters input, .log-filters select { height: 36px; min-width: 110px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 11px; }
.log-filters input:first-child { width: 150px; }
.log-filters input:last-child { width: 145px; }
.logs-table { min-width: 1240px; }
.log-time { color: var(--muted); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.log-model { display: block; max-width: 210px; overflow: hidden; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.log-account { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.log-caller { display: block; max-width: 150px; overflow: hidden; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.log-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.log-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.log-status.success { color: #607a22; }
.log-status.error { color: #a4523c; }
.log-status.queued { color: #9a644f; }
.log-number { color: var(--ink); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.log-subnumber { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.log-preview { max-width: 270px; }
.log-preview details { font-size: 10px; }
.log-preview summary { overflow: hidden; color: var(--muted); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.log-preview pre { max-width: 390px; max-height: 190px; margin: 7px 0 0; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 9px; white-space: pre-wrap; word-break: break-word; }
.log-preview + .log-preview { margin-top: 5px; }
.log-summary { display: block; color: var(--muted); font-family: var(--mono); font-size: 9px; }

.config-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.config-panel { min-height: 380px; }
.config-list { border-top: 1px solid var(--line); }
.config-row { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(150px, 1fr); gap: 14px; padding: 16px 22px; border-bottom: 1px solid #dfded7; }
.config-row:last-child { border-bottom: 0; }
.config-key { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.config-value { font-family: var(--mono); font-size: 11px; text-align: right; word-break: break-word; }
.schedule-visual { margin: 16px 22px 25px; }
.schedule-track { position: relative; height: 3px; background: #d1d2ca; }
.schedule-track::before { position: absolute; inset: 0; width: 100%; background: var(--accent-2); content: ""; opacity: .18; }
.schedule-point { position: absolute; top: 50%; left: var(--point); width: 9px; height: 9px; border: 2px solid #aeb4a8; border-radius: 50%; background: var(--paper-2); transform: translate(-50%, -50%); }
.schedule-point.accent { border-color: var(--accent-2); background: var(--accent); }
.schedule-times { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.schedule-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 0 22px 24px; }
.schedule-card { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.schedule-card strong { display: block; font-family: var(--mono); font-size: 11px; }
.schedule-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.config-note { display: flex; gap: 9px; margin: 0 22px 22px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; }
.config-note .notice-icon { flex-basis: 15px; width: 15px; height: 15px; }

.login-layer { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 22px; background: var(--ink); }
.login-layer.is-hidden { display: none; }
.login-card { width: min(100%, 410px); padding: 38px 36px 29px; border: 1px solid #3c443d; border-radius: 18px; background: #1a1e1b; color: var(--paper); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.login-mark { margin-bottom: 30px; }
.login-card .eyebrow { color: #99a295; }
.login-card h1 { margin: 10px 0 9px; font-size: 30px; letter-spacing: -.04em; }
.login-card p { margin: 0 0 26px; color: #aeb5aa; font-size: 12px; }
.login-card label { display: block; margin-bottom: 7px; color: #b9c0b4; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.secret-input { display: flex; gap: 0; margin-bottom: 14px; }
.secret-input input { min-width: 0; height: 42px; padding: 0 12px; border-color: #465047; border-radius: 9px 0 0 9px; background: #111412; color: var(--paper); }
.secret-input button { width: 53px; border: 1px solid #465047; border-left: 0; border-radius: 0 9px 9px 0; background: #111412; color: #aeb5aa; font-size: 11px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; margin: 0 0 20px !important; color: #8f988d !important; font-family: var(--sans) !important; font-size: 11px !important; letter-spacing: 0 !important; text-transform: none !important; }
.checkbox-label input { accent-color: var(--accent-2); }
.login-error { margin-top: 12px; padding: 9px 10px; border: 1px solid #9f5c49; border-radius: 8px; background: #422a23; color: #efb09f; font-size: 11px; }
.login-foot { margin-top: 28px; color: #687168; font-family: var(--mono); font-size: 9px; text-align: center; }
.login-foot span { padding: 0 4px; color: #465047; }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17,20,18,.58); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(100%, 620px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2); box-shadow: 0 24px 80px rgba(17,20,18,.25); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-header h2, .confirm-card h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.03em; }
.modal-close { border-color: transparent; background: transparent; font-size: 22px; }
.modal-help { margin: 16px 0 17px; color: var(--muted); font-size: 12px; }
.import-provider-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; }
.import-provider-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-3); cursor: pointer; text-align: left; transition: border-color 160ms ease, background 160ms ease; }
.import-provider-option small { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.import-provider-option.is-active { border-color: #526b1c; background: #f4f7ea; }
.import-provider-option .provider-tag { align-self: flex-start; }
.modal-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0 0 19px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-3); }
.modal-tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.modal-tab:hover { color: var(--ink); }
.modal-tab.is-active { border-color: var(--line); background: var(--paper-2); color: var(--ink); box-shadow: 0 2px 7px rgba(17,20,18,.05); }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.modal-tab.is-active .tab-dot { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(167,215,78,.16); }
.import-panel { min-width: 0; }
.oauth-intro { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #d3dfac; border-radius: 10px; background: #edf3dd; color: #657b32; }
.oauth-shield { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; border-radius: 8px; background: var(--accent); color: var(--ink); font-family: var(--mono); font-size: 14px; }
.oauth-intro strong { display: block; color: #52651f; font-size: 12px; }
.oauth-intro p { margin: 3px 0 0; color: #718449; font-size: 10px; }
.oauth-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 17px; }
.oauth-step { min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.oauth-step span { display: block; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.oauth-step strong { display: block; margin-top: 5px; font-size: 10px; }
.oauth-step small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.oauth-actions-row { display: flex; align-items: center; gap: 11px; }
.oauth-status { min-width: 0; overflow: hidden; color: var(--muted); font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.oauth-status.is-ready { color: #607a22; }
.oauth-status.is-error { color: #a4523c; }
.oauth-link-card { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.oauth-link-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oauth-expiry { color: #9a644f; font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.oauth-link-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.oauth-link-row a { min-width: 0; overflow: hidden; color: #526b1c; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.oauth-link-row .file-button { flex: 0 0 auto; }
.oauth-session-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.oauth-callout { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; }
.oauth-callout .notice-icon { flex-basis: 15px; width: 15px; height: 15px; margin-top: 1px; font-size: 9px; }
.oauth-callback-input { min-height: 78px !important; margin-bottom: 1px; }
.oauth-callback-input:disabled { cursor: not-allowed; opacity: .62; }
.oauth-modal-actions { margin-top: 15px; }
.modal-card label { display: block; margin: 15px 0 7px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.modal-text-input { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.modal-text-input:hover { border-color: #a8aaa1; }
.key-create-modal { width: min(100%, 430px); }
.modal-textarea { min-height: 74px !important; line-height: 1.6; }
.group-picker.scrollable { max-height: 168px; overflow-y: auto; padding-right: 4px; }
.keys-table .row-actions { display: inline-flex; gap: 6px; }
.modal-card textarea { width: 100%; min-height: 200px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 11px; resize: vertical; }
.file-drop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1px dashed #b8bbb1; border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 11px; }
.file-drop.is-dragging { border-color: var(--accent-2); background: #edf3dd; }
.file-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); color: var(--ink); font-size: 11px; font-weight: 700; }
.file-drop small { flex-basis: 100%; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.modal-feedback { margin-top: 13px; padding: 9px 10px; border: 1px solid #b8cf83; border-radius: 8px; background: #edf5d9; color: #51651f; font-size: 11px; }
.modal-feedback.is-error { border-color: #e2b8aa; background: #f8e8e2; color: #874d3c; }
.confirm-card { width: min(100%, 390px); text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%; background: #f4d7cd; color: #a4523c; font-family: var(--mono); font-weight: 500; }
.confirm-card p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.confirm-card .modal-actions { justify-content: center; }
.toast-stack { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { padding: 12px 14px; border: 1px solid #b8cf83; border-radius: 9px; background: #edf5d9; color: #51651f; box-shadow: 0 10px 30px rgba(17,20,18,.13); font-size: 12px; animation: toast-in 180ms ease both; }
.toast.is-error { border-color: #e2b8aa; background: #f8e8e2; color: #874d3c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .topbar, .content-scroll { padding-left: 26px; padding-right: 26px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .model-layout, .config-grid { grid-template-columns: 1fr; }
  .workbuddy-grid, .workbuddy-model-layout { grid-template-columns: 1fr; }
  .test-panel { position: static; }
  .workbuddy-test-panel { position: static; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 244px; transform: translateX(-100%); transition: transform 200ms ease; box-shadow: 20px 0 45px rgba(17,20,18,.18); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 29; inset: 0; display: block; border: 0; background: rgba(17,20,18,.28); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .sidebar.is-open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .main-column { min-height: 100vh; }
  .topbar { min-height: 62px; padding: 0 16px; }
  .mobile-brand { display: flex; gap: 9px; }
  .mobile-menu { width: 31px; height: 31px; margin-right: 1px; font-size: 15px; }
  .breadcrumb { display: none; }
  .topbar-actions { gap: 8px; }
  .last-sync, .profile-chip > span:not(.profile-avatar), .profile-chip .chevron { display: none; }
  .profile-chip { padding: 0; }
  .content-scroll { padding: 26px 16px 44px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-intro h1 { font-size: 30px; }
  .intro-actions { width: 100%; flex-wrap: wrap; }
  .intro-actions .button { flex: 1 1 180px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-card .metric-value { font-size: 27px; }
  .metric-card .metric-value.is-wide { font-size: 22px; }
  .panel-heading, .toolbar { padding-left: 16px; padding-right: 16px; }
  .fleet-summary { margin-left: 16px; margin-right: 16px; }
  .data-table th { padding-left: 16px; padding-right: 16px; }
  .data-table td { padding-left: 16px; padding-right: 16px; }
  .probe-lead { margin-left: 16px; margin-right: 16px; }
  .probe-form { padding-left: 16px; padding-right: 16px; }
  .probe-result { margin-left: 16px; margin-right: 16px; }
  .event-row { grid-template-columns: 10px minmax(0,1fr); padding-left: 16px; padding-right: 16px; }
  .event-time { grid-column: 2; }
  .notice-bar { align-items: flex-start; margin-top: -3px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1; }
  .search-field { flex: 1; width: auto; }
  .config-row { grid-template-columns: 1fr; gap: 5px; padding-left: 16px; padding-right: 16px; }
  .config-value { text-align: left; }
  .schedule-cards { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; }
  .schedule-visual, .config-note { margin-left: 16px; margin-right: 16px; }
  .modal-card { padding: 20px; }
  .log-toolbar { align-items: flex-start; }
  .log-filters { width: 100%; flex-wrap: wrap; }
  .log-filters input, .log-filters select, .log-filters input:first-child, .log-filters input:last-child { flex: 1 1 130px; width: auto; }
  .oauth-steps { grid-template-columns: repeat(2, 1fr); }
  .oauth-actions-row { align-items: flex-start; flex-direction: column; }
  .oauth-actions-row .button { width: 100%; }
  .oauth-status { width: 100%; }
  .oauth-link-row { align-items: stretch; flex-direction: column; }
  .oauth-link-row a { display: block; padding: 4px 0; white-space: normal; word-break: break-all; }
  .oauth-link-row .file-button { width: 100%; }
  .workbuddy-status-list { grid-template-columns: 1fr; }
  .workbuddy-status-item:nth-child(odd) { border-right: 0; }
  .workbuddy-auth-card { margin-left: 16px; margin-right: 16px; }
  .workbuddy-usage-grid { padding-left: 16px; padding-right: 16px; }
  .workbuddy-endpoint { margin-left: 16px; margin-right: 16px; }
  .workbuddy-auth-actions { align-items: flex-start; flex-direction: column; }
  .workbuddy-auth-actions .button { width: 100%; }
  .workbuddy-auth-status { width: 100%; }
}
@media (max-width: 400px) {
  .metric-card .metric-value { font-size: 24px; }
  .metric-card .metric-meta { font-size: 10px; }
  .login-card { padding: 30px 23px 24px; }
}

/* ===== new-api style: StatCard (Overview) ===== */
.napi-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.napi-stat-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}
.napi-stat-card:hover { border-color: #c5c8be; box-shadow: 0 4px 16px rgba(17,20,18,.06); }
.napi-stat-header { display: flex; align-items: center; gap: 8px; }
.napi-icon-badge {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 8px; font-size: 13px;
}
.napi-icon-badge.tone-1 { background: #e8f0fe; color: #3b6fd4; }
.napi-icon-badge.tone-2 { background: #fef3e2; color: #c47a1e; }
.napi-icon-badge.tone-3 { background: #e9f5e4; color: #4a8c3f; }
.napi-icon-badge.tone-4 { background: #f3e8fe; color: #7c4fc4; }
.napi-icon-badge.tone-5 { background: #fee8e8; color: #c44a4a; }
.napi-icon-badge.tone-6 { background: #e2f5f3; color: #2a8c7f; }
.napi-stat-title { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.3; }
.napi-stat-value { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; word-break: break-all; }
.napi-stat-value.is-wide { font-size: 19px; }
.napi-stat-desc { color: var(--muted); font-size: 10px; line-height: 1.45; opacity: .85; }
.napi-stat-desc .napi-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.napi-stat-desc .napi-dot.ok { background: #4a8c3f; }
.napi-stat-desc .napi-dot.warn { background: #c47a1e; }
.napi-stat-desc .napi-dot.err { background: #c44a4a; }

/* new-api style: summary panel with gradient sidebar */
.napi-summary-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--paper-2); overflow: hidden; margin-bottom: 18px;
}
.napi-summary-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.napi-summary-heading h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.napi-summary-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.napi-summary-side {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  padding: 20px 18px;
  border-left: 1px solid var(--line);
  background: linear-gradient(135deg, #f0f4e8 0%, #e8f0e4 48%, #f4f0e8 100%);
}
.napi-summary-side-label { display: flex; align-items: center; justify-content: space-between; }
.napi-summary-side-label span { color: var(--muted); font-size: 11px; font-weight: 500; }
.napi-health-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.napi-health-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.napi-health-dot.healthy::before { background: #4a8c3f; }
.napi-health-dot.caution::before { background: #c47a1e; }
.napi-health-dot.critical::before { background: #c44a4a; }
.napi-summary-side-value { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.napi-summary-side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.napi-summary-side-item { padding: 10px; border-radius: 9px; background: rgba(255,255,255,.65); }
.napi-summary-side-item span { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
.napi-summary-side-item strong { display: block; margin-top: 4px; font-family: var(--mono); font-size: 12px; font-weight: 600; }

/* ===== new-api style: StatusBadge (Keys & Logs) ===== */
.napi-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}
.napi-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.napi-badge.success { background: #e9f5e4; color: #3d7a34; }
.napi-badge.error { background: #fee8e8; color: #b84040; }
.napi-badge.warning { background: #fef3e2; color: #a86a14; }
.napi-badge.neutral { background: #f0f0ee; color: #6b6b68; }
.napi-badge.info { background: #e8f0fe; color: #3b6fd4; }

/* ===== new-api style: StatBadge (Logs toolbar) ===== */
.napi-log-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.napi-log-stat {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-2); font-size: 11px;
  box-shadow: 0 1px 3px rgba(17,20,18,.04);
}
.napi-log-stat-bar { width: 3px; height: 14px; border-radius: 2px; }
.napi-log-stat-bar.sky { background: rgba(56,132,214,.7); }
.napi-log-stat-bar.rose { background: rgba(214,86,86,.65); }
.napi-log-stat-bar.slate { background: rgba(120,130,140,.7); }
.napi-log-stat-bar.green { background: rgba(74,140,63,.7); }
.napi-log-stat-bar.amber { background: rgba(196,122,30,.7); }
.napi-log-stat-label { color: var(--muted); font-weight: 500; }
.napi-log-stat-value { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* ===== new-api style: table enhancements ===== */
.napi-key-name { font-weight: 600; font-size: 12px; color: var(--ink); }
.napi-key-id { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.napi-key-prefix {
  display: inline-block; padding: 3px 8px;
  border-radius: 6px; background: #f0f0ee;
  color: var(--muted); font-family: var(--mono); font-size: 10px;
}
.napi-log-model { display: block; max-width: 210px; overflow: hidden; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.napi-log-sub { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.napi-log-number { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink); }
.napi-log-subnumber { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; }

/* responsive for new-api components */
@media (max-width: 1180px) {
  .napi-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .napi-summary-panel { grid-template-columns: 1fr; }
  .napi-summary-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .napi-stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .napi-stat-card { padding: 14px 12px 12px; }
  .napi-stat-value { font-size: 20px; }
  .napi-summary-panel { margin-left: 0; margin-right: 0; }
  .napi-log-stats { width: 100%; }
}

/* ===== provider 统一分组组件（TRAE / WorkBuddy 合并） ===== */
.provider-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.provider-tab {
  padding: 5px 12px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  transition: background 140ms ease, color 140ms ease;
}
.provider-tab:hover { color: var(--ink); }
.provider-tab.is-active { background: var(--ink); color: var(--paper); }
.overview-provider-tabs { margin-bottom: 14px; }

/* ===== new-api 风格：日志筛选栏（日期范围 + 查询/重置） ===== */
.napi-log-filterbar { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 4px; }
.napi-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.napi-filter-row input, .napi-filter-row select { height: 34px; min-width: 120px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 11px; }
.napi-filter-row input { flex: 1 1 130px; max-width: 200px; }
.napi-filter-actions { display: flex; align-items: center; gap: 8px; }
.napi-filter-actions .button { height: 32px; padding: 0 16px; font-size: 11px; }

/* 日期范围选择器 */
.napi-date-picker { position: relative; flex: 1 1 280px; max-width: 380px; min-width: 240px; }
.napi-date-trigger { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 10px; text-align: left; }
.napi-date-trigger:hover { border-color: #c5c8be; }
.napi-date-trigger.is-empty .napi-date-label { color: var(--muted); }
.napi-date-icon { color: var(--muted); font-size: 12px; }
.napi-date-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.napi-date-caret { color: var(--muted); }
.napi-date-popover { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column; gap: 10px; width: min(520px, calc(100vw - 60px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); box-shadow: var(--shadow-panel); }
.napi-date-inputs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.napi-date-field { display: flex; flex-direction: column; gap: 5px; }
.napi-date-field span { color: var(--muted); font-size: 10px; }
.napi-date-field input { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 10px; }
.napi-date-sep { padding-bottom: 8px; color: var(--muted); font-size: 11px; }
.napi-date-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.napi-date-presets button { flex: 1 1 auto; height: 28px; min-width: 60px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 10px; font-weight: 600; }
.napi-date-presets button:hover { border-color: var(--ink); }
.napi-date-actions { display: flex; justify-content: flex-end; gap: 8px; }
.napi-date-actions .button { height: 30px; padding: 0 14px; font-size: 11px; }

/* 分页 */
.napi-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.napi-page-info { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.napi-page-controls { display: flex; align-items: center; gap: 6px; }
.napi-page-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 12px; }
.napi-page-btn:hover:not(:disabled) { border-color: var(--ink); }
.napi-page-btn:disabled { opacity: .35; cursor: not-allowed; }
.napi-page-current { min-width: 56px; color: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 600; text-align: center; }

/* 总览用量趋势图 */
.napi-chart-panel { margin-bottom: 16px; }
.napi-chart-body { padding: 8px 14px 14px; }
.napi-chart-svg { width: 100%; height: 260px; }
.napi-chart-svg svg { width: 100%; height: 100%; }
.napi-chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.napi-chart-axis { fill: var(--muted); font-family: var(--mono); font-size: 9px; }
.napi-chart-line { fill: none; stroke: #a7d74e; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.napi-chart-line.line-requests { stroke: #88b7b0; stroke-width: 1.5; stroke-dasharray: 4 4; }
.napi-chart-dot { fill: #a7d74e; stroke: var(--paper-2); stroke-width: 1.5; }
.napi-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.napi-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.napi-legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* 日志详情弹窗 */
.log-detail-card { max-width: 760px; }
.log-detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.log-detail-row { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.log-detail-row > span { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.log-detail-row > div { color: var(--ink); font-family: var(--mono); font-size: 11px; word-break: break-all; }
.log-detail-previews { display: grid; grid-template-columns: 1fr; gap: 10px; }
.log-detail-preview { display: flex; flex-direction: column; gap: 6px; }
.log-detail-preview pre { max-height: 240px; margin: 0; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 10px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 760px) {
  .napi-date-picker { max-width: none; }
  .napi-date-inputs { grid-template-columns: 1fr; }
  .napi-date-sep { display: none; }
}

.provider-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
}
.provider-tag.tag-trae { background: #e8f0fe; color: #3b6fd4; }
.provider-tag.tag-traeai { background: #e6f7f1; color: #1f9d6b; }
.provider-tag.tag-workbuddy { background: #f3e8fe; color: #7c4fc4; }
.provider-tag.tag-all { background: #e9f5e4; color: #3d7a34; }
.provider-tag.tag-model { background: #fef3e0; color: #b0742a; margin-left: 6px; vertical-align: middle; }
.group-picker.scrollable.tall-scroll { max-height: 320px; }
.modal-model-actions { display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; }
.modal-model-actions .count-pill { margin-left: auto; }

/* WorkBuddy 精简卡片（账号池页内） */
.provider-mini-panel { margin-bottom: 16px; }
.provider-mini-actions { display: flex; align-items: center; gap: 10px; }
.provider-mini-body {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px; padding: 16px 18px 6px;
}
.provider-mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; align-content: start; }
.provider-mini-stats .workbuddy-status-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-2);
}
.provider-mini-stats .workbuddy-status-item span { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.provider-mini-stats .workbuddy-status-item strong { font-family: var(--mono); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-mini-auth { display: flex; flex-direction: column; gap: 9px; border-left: 1px solid var(--line); padding-left: 18px; }
.provider-mini-auth-head { display: flex; align-items: center; gap: 9px; }
.provider-mini-auth-head strong { font-size: 13px; }
.provider-mini-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.provider-mini-auth-actions { display: flex; align-items: center; gap: 10px; }
.provider-mini-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-top: 1px solid var(--line);
  background: var(--paper);
}
.provider-mini-foot code { padding: 3px 8px; border-radius: 6px; background: #f0f0ee; font-family: var(--mono); font-size: 10px; }
.provider-mini-foot small { color: var(--muted); font-size: 10px; }

/* API 密钥分组选择器 */
.group-picker { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.group-picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-2); cursor: pointer;
  transition: border-color 140ms ease;
}
.group-picker-item:hover { border-color: #c5c8be; }
.group-picker-item input { accent-color: var(--ink); width: 15px; height: 15px; }
.group-picker-item small { color: var(--muted); font-size: 10px; margin-left: auto; }
.group-picker-hint { color: var(--muted); font-size: 10px; }
@media (max-width: 760px) {
  .provider-mini-body { grid-template-columns: 1fr; }
  .provider-mini-auth { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .provider-mini-stats { grid-template-columns: 1fr 1fr; }
}
