:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-alt: #f8faf9;
  --text: #17211c;
  --muted: #68736d;
  --border: #dce2de;
  --border-strong: #b9c4bd;
  --accent: #137548;
  --accent-hover: #0e603a;
  --danger: #a72d2d;
  --warning: #9a6410;
  --sidebar: #202722;
  --shadow: 0 8px 28px rgba(27, 41, 33, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #edf1ee; }
.login-panel { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 34px; box-shadow: var(--shadow); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 6px; font-weight: 800; }
.brand-mark.small { width: 32px; height: 32px; font-size: 12px; }
.login-panel h1 { margin: 18px 0 6px; font-size: 24px; }
.login-panel p { margin: 0 0 24px; color: var(--muted); }
label { display: grid; gap: 7px; margin-bottom: 15px; font-size: 13px; font-weight: 650; color: #3e4943; }
input, select, textarea { width: 100%; border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: 5px; padding: 9px 10px; outline: 0; }
input, select { min-height: 38px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(19,117,72,.12); }
.form-error { min-height: 20px; margin-top: 12px; color: var(--danger); font-size: 13px; }
.form-note { color: var(--muted); font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; display: flex; flex-direction: column; background: var(--sidebar); color: #edf3ef; z-index: 10; }
.sidebar-brand { height: 68px; display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand strong { font-size: 14px; white-space: nowrap; }
.sidebar nav { display: grid; gap: 3px; padding: 14px 10px; }
.sidebar nav button { height: 40px; border: 0; border-radius: 5px; padding: 0 12px; background: transparent; color: #bdc7c1; text-align: left; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sidebar nav svg { width: 17px; height: 17px; flex: none; }
.sidebar nav button:hover, .sidebar nav button.active { background: #303a34; color: #fff; }
.sidebar-footer { margin-top: auto; min-height: 56px; border-top: 1px solid rgba(255,255,255,.08); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; color: #aeb9b2; font-size: 13px; }
.text-button { border: 0; background: transparent; color: #d3ddd7; padding: 5px; }
.workspace { grid-column: 2; min-width: 0; }
.workspace-header { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.workspace-header h1 { margin: 0; font-size: 19px; }
.workspace-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.workspace-header .status-pill { margin-left: auto; }
#menuButton { display: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.page-feedback { position: sticky; top: 68px; z-index: 4; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 28px; border-bottom: 1px solid #edc9c9; background: #fff2f2; color: var(--danger); font-size: 13px; }
.status-pill, .badge { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill.healthy, .badge.success { color: #0f6a3d; background: #e5f3eb; }
.badge.warning { color: #80530c; background: #fff2d8; }
.badge.danger { color: #922a2a; background: #f9e5e5; }
.badge.neutral { color: #5f6a64; background: #edf0ee; }

.page { display: none; padding: 26px 28px 48px; max-width: 1540px; margin: 0 auto; }
.page.active-page { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric { min-height: 94px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; display: grid; align-content: space-between; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 26px 0 12px; }
.section-heading.compact { margin-top: 20px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar p { color: var(--muted); font-size: 13px; margin: 0; }
.toolbar-actions, .inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { justify-content: flex-start; }
.filters input { max-width: 260px; }
.filters select { width: auto; min-width: 150px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 5px; overflow: hidden; background: #fff; }
.segmented button { min-height: 36px; border: 0; border-right: 1px solid var(--border); background: #fff; color: var(--muted); padding: 0 12px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: #e8f1ec; color: var(--accent); font-weight: 700; }

.button, .icon-button, .small-button { border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: 5px; min-height: 36px; padding: 0 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.button svg, .small-button svg { width: 15px; height: 15px; }
.button:hover, .icon-button:hover, .small-button:hover { border-color: #84928a; background: #f7f9f8; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.danger, .small-button.danger { color: var(--danger); }
.button.full { width: 100%; }
.button:disabled, .small-button:disabled { opacity: .58; cursor: wait; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-button { width: 36px; padding: 0; font-size: 20px; }
.small-button { min-height: 30px; padding: 0 8px; font-size: 12px; margin-left: 5px; }
.file-button input { display: none; }
.file-selection { min-height: 24px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.file-selection.ready { color: var(--accent); font-weight: 650; }
.backup-warning { max-width: 760px; margin: 0 0 14px; padding: 10px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #ead5a8; border-radius: 5px; background: #fff9eb; color: #6f5115; font-size: 12px; line-height: 1.55; }
.backup-warning svg { width: 16px; height: 16px; margin-top: 1px; flex: none; }

.table-wrap { overflow: auto; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; height: 42px; padding: 0 12px; background: var(--surface-alt); color: var(--muted); font-size: 11px; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { min-height: 50px; padding: 11px 12px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); max-width: 310px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-cell { text-align: right; white-space: nowrap; }
.empty-cell { height: 110px; text-align: center; color: var(--muted); }
.error-text { color: var(--danger); }
.mono-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.badge { gap: 5px; }
.badge svg { width: 13px; height: 13px; }
.request-error-summary { color: var(--danger); font-weight: 600; max-width: 260px; }
.request-row.running td { background: #fffcf5; }
.requests-table { min-width: 880px; table-layout: fixed; }
.requests-table th:nth-child(1) { width: 150px; }
.requests-table th:nth-child(2) { width: 125px; }
.requests-table th:nth-child(3) { width: 210px; }
.requests-table th:nth-child(4) { width: 250px; }
.requests-table th:nth-child(5) { width: 85px; }
.requests-table th:nth-child(6) { width: 90px; }
.requests-table th:nth-child(7) { width: 70px; }
.refresh-status { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.refreshing svg { animation: spin .8s linear infinite; }
.pagination { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 6px; }
.pagination-actions label { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 11px; }
.pagination-actions select { width: 70px; min-height: 32px; padding: 4px 7px; }
.pagination-actions .icon-button { width: 32px; min-height: 32px; }
.pagination-actions .icon-button:disabled { cursor: default; }

.skeleton-row td { height: 54px; }
.skeleton-row span, .skeleton-block { display: block; min-height: 15px; border-radius: 4px; background: linear-gradient(90deg, #edf0ee 25%, #f8faf9 45%, #edf0ee 65%); background-size: 220% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton-row span { width: 92%; }
@keyframes shimmer { to { background-position: -120% 0; } }

.policy-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.policy-form { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px; display: grid; grid-template-columns: minmax(140px, 1fr) repeat(4, minmax(100px, .6fr)) auto; align-items: end; gap: 10px; }
.policy-form > div { align-self: center; }
.policy-form span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.policy-form label { margin: 0; font-size: 11px; }

.usage-metrics { grid-template-columns: repeat(6, minmax(130px, 1fr)); margin-bottom: 12px; }
.dashboard-usage-heading { margin-top: 38px; }
.usage-chart { position: relative; min-height: 310px; padding: 10px 12px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.usage-chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.chart-axis text { fill: var(--muted); font-size: 10px; }
.chart-grid { stroke: #e8ece9; stroke-width: 1; }
.chart-area { fill: #e8f3ed; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: #fff; stroke: var(--accent); stroke-width: 2.5; cursor: crosshair; }
.chart-point:hover { fill: var(--accent); }
.chart-tooltip { position: absolute; pointer-events: none; z-index: 2; padding: 6px 8px; background: #202722; color: #fff; border-radius: 4px; box-shadow: var(--shadow); font-size: 11px; white-space: nowrap; }
.usage-insights { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(250px, .8fr) minmax(340px, 1.4fr); gap: 12px; margin-top: 12px; }
.insight-panel { min-height: 280px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.insight-panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.insight-panel h2 { margin: 0; font-size: 14px; }
.insight-panel header > span { color: var(--muted); font-size: 11px; }
.donut-visual { min-height: 210px; display: flex; align-items: center; justify-content: space-around; gap: 20px; }
.donut { width: 142px; aspect-ratio: 1; flex: none; display: grid; place-items: center; border-radius: 50%; }
.donut > div { width: 88px; aspect-ratio: 1; display: grid; place-content: center; text-align: center; background: var(--surface); border-radius: 50%; }
.donut strong, .outcome-total strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.donut span, .outcome-total span { color: var(--muted); font-size: 10px; }
.chart-legend { min-width: 0; margin: 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; }
.chart-legend strong, .chart-legend small { display: block; }
.chart-legend strong { font-size: 12px; }
.chart-legend small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.outcome-visual { min-height: 210px; display: grid; align-content: center; gap: 16px; }
.outcome-total { text-align: center; }
.stacked-bar { width: 100%; height: 14px; display: flex; overflow: hidden; border-radius: 3px; background: #edf0ee; }
.stacked-bar span { display: block; min-width: 2px; height: 100%; }
.compact-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
.model-bars { display: grid; gap: 14px; max-height: 225px; padding-right: 4px; overflow-y: auto; }
.model-bar-row { display: grid; gap: 6px; }
.model-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.model-bar-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.model-bar-row span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.bar-track { width: 100%; height: 7px; overflow: hidden; border-radius: 2px; background: #edf0ee; }
.bar-track span { display: block; height: 100%; background: var(--accent); }

.docs-page { max-width: 1180px; }
.docs-hero { min-height: 145px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 10px 0 24px; border-bottom: 1px solid var(--border); }
.docs-kicker { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.docs-hero h2 { margin: 6px 0; font-size: 25px; }
.docs-hero p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.docs-hero > code { max-width: 46%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-alt); overflow-wrap: anywhere; }
.docs-toolbar { margin: 18px 0; }
.docs-content { display: grid; gap: 12px; }
.docs-callout { display: flex; gap: 12px; padding: 14px; border-left: 3px solid var(--accent); background: #edf6f1; }
.docs-callout svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.docs-callout p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.docs-card { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.docs-card > header { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px 7px 14px; border-bottom: 1px solid var(--border); }
.docs-card h3 { margin: 0; font-size: 13px; }
.docs-card pre { max-height: none; border: 0; border-radius: 0; padding: 16px; white-space: pre; overflow-x: auto; line-height: 1.6; }
.reference-card { padding: 16px; }
.reference-card h3 { margin-bottom: 9px; }
.reference-card p { margin: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.endpoint-list { display: grid; gap: 1px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--border); }
.endpoint-list article { display: grid; grid-template-columns: 56px minmax(180px, .7fr) minmax(260px, 1.3fr); align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; background: var(--surface); }
.endpoint-list article p { margin: 0; color: var(--muted); font-size: 12px; }
.method { font-size: 11px; font-weight: 800; }
.method.get { color: #2877a7; }
.method.post { color: var(--accent); }
.model-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.model-chips code { padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-alt); }
.status-reference { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.status-reference span { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.status-reference strong { color: var(--text); font-size: 16px; }
.markdown-preview { max-height: calc(100vh - 230px); min-height: 460px; padding: 20px; white-space: pre-wrap; line-height: 1.6; }

.playground-page.active-page { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; height: calc(100vh - 68px); padding-bottom: 20px; }
.playground-controls, .chat-surface { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.playground-controls { padding: 16px; }
.chat-surface { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.chat-messages { overflow-y: auto; padding: 22px; }
.empty-state { width: 100%; min-height: 100px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.chat-message { max-width: 820px; margin: 0 auto 20px; display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; line-height: 1.65; }
.chat-message strong { color: var(--muted); font-size: 12px; }
.chat-message div { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.assistant { border-left: 2px solid #dce9e1; padding-left: 12px; }
.typing { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-error { margin: 0 12px 10px; padding: 10px 12px; border: 1px solid #efcaca; border-radius: 5px; background: #fff3f3; color: var(--danger); font-size: 13px; }
.composer { border-top: 1px solid var(--border); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }

.settings-layout.active-page { display: grid; gap: 14px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 18px; }
.settings-section > label:not(.toggle-row) { max-width: 360px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; max-width: 650px; }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row small { color: var(--muted); font-weight: 400; }
.toggle-row input, .checkbox-line input { width: 18px; min-height: 18px; }
.setup-box { margin-top: 12px; padding: 12px; background: #f2f5f3; border: 1px solid var(--border); border-radius: 5px; overflow-wrap: anywhere; }

dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100vh - 40px); border: 1px solid var(--border); border-radius: 8px; padding: 0; box-shadow: var(--shadow); color: var(--text); }
dialog::backdrop { background: rgba(21, 29, 24, .52); }
dialog form, .dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 42px); }
dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
dialog h2 { margin: 0; font-size: 18px; }
dialog h3 { font-size: 12px; color: var(--muted); margin: 18px 0 6px; }
.dialog-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; }
fieldset { border: 1px solid var(--border); border-radius: 5px; margin: 0 0 15px; padding: 12px; }
legend { padding: 0 5px; color: var(--muted); font-size: 12px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.checkbox-grid label { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.checkbox-grid input { width: 15px; min-height: 15px; }
pre { margin: 0; max-height: 260px; overflow: auto; padding: 12px; background: #f4f6f5; border: 1px solid var(--border); border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.detail-dialog { width: min(820px, calc(100% - 28px)); }
.detail-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.detail-stat { min-height: 72px; padding: 10px; border: 1px solid var(--border); border-radius: 5px; display: grid; align-content: space-between; gap: 7px; }
.detail-stat > span { color: var(--muted); font-size: 11px; }
.detail-stat > strong { font-size: 13px; overflow-wrap: anywhere; }
.error-panel { margin-top: 14px; padding: 12px; border-left: 3px solid var(--danger); background: #fff3f3; color: #712424; }
.error-panel strong { display: block; font-size: 14px; }
.error-panel code { display: inline-block; margin-top: 5px; color: var(--danger); }
.error-panel p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.attempt-timeline { display: grid; }
.attempt-item { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; min-height: 76px; }
.attempt-item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 17px; bottom: -2px; width: 1px; background: var(--border-strong); }
.attempt-marker { width: 13px; height: 13px; margin-top: 3px; border: 3px solid #fff; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 1px var(--border-strong); z-index: 1; }
.attempt-item.succeeded .attempt-marker { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.attempt-item.failed .attempt-marker, .attempt-item.interrupted .attempt-marker { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.attempt-item.running .attempt-marker { background: #d99a2b; box-shadow: 0 0 0 1px #d99a2b; }
.attempt-item header { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.attempt-item p { margin: 4px 0 7px; color: var(--muted); font-size: 11px; }
.attempt-error { display: grid; gap: 3px; padding: 8px 10px; border-radius: 4px; background: #fff3f3; color: #762727; font-size: 11px; overflow-wrap: anywhere; }
.timeline-skeleton { height: 120px; }
details { margin-top: 10px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
details summary { padding: 10px 12px; cursor: pointer; background: var(--surface-alt); color: #3e4943; font-size: 12px; font-weight: 700; }
details pre { border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.inline-json { max-width: 480px; max-height: 60px; padding: 0; border: 0; background: transparent; }
.secret-display { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.secret-display code { padding: 12px; background: #edf2ef; border: 1px solid var(--border); border-radius: 5px; overflow-wrap: anywhere; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(380px, calc(100% - 36px)); }
.toast { padding: 11px 13px; border-radius: 5px; background: #28312c; color: #fff; box-shadow: var(--shadow); font-size: 13px; }
.toast.success { background: #17663f; }
.toast.error { background: #8e2929; }

@media (max-width: 1150px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .policy-grid { grid-template-columns: 1fr; }
  .policy-form { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
  .policy-form > div { grid-column: 1 / -1; }
  .usage-metrics { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .usage-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .workspace { grid-column: 1; }
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .sidebar.mobile-open { transform: translateX(0); }
  #menuButton { display: inline-flex; }
  .workspace-header { padding: 9px 12px; }
  .page-feedback { top: 68px; padding: 8px 12px; }
  .workspace-header .status-pill { display: none; }
  .page { padding: 16px 10px 36px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 82px; padding: 12px; }
  .metric strong { font-size: 19px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions, .segmented { width: 100%; }
  .segmented button, .toolbar-actions .button { flex: 1; }
  .filters input, .filters select { max-width: none; width: 100%; }
  .playground-page.active-page { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px, 1fr); height: auto; }
  .playground-controls textarea, .playground-controls label:nth-child(2) { display: none; }
  .form-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .policy-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-panel { padding: 24px; }
  .usage-chart { min-height: 260px; padding-left: 0; }
  .usage-chart svg { width: 760px; height: 260px; }
  .usage-chart { overflow-x: auto; }
  .detail-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer { grid-template-columns: minmax(0, 1fr) auto; }
  .composer textarea { grid-row: span 2; }
  .pagination { align-items: flex-start; flex-direction: column; padding: 9px 2px 14px; }
  .pagination-actions { width: 100%; justify-content: flex-end; }
  .usage-metrics, .usage-insights { grid-template-columns: 1fr; }
  .model-panel { grid-column: auto; }
  .donut-visual { justify-content: center; }
  .docs-hero { align-items: flex-start; flex-direction: column; gap: 15px; }
  .docs-hero > code { max-width: 100%; }
  .docs-toolbar .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .docs-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .endpoint-list article { grid-template-columns: 48px minmax(0, 1fr); }
  .endpoint-list article p { grid-column: 1 / -1; }
  .status-reference { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
