:root, :root[data-theme="light"] {
  --bg: #f7f7f9; --surface: #ffffff; --border: #e2e1e7; --border-strong: #cbc9d2;
  --text: #222125; --muted: #666570; --accent: #4264ff; --accent-bg: #eef1ff;
  --ok: #23875b; --ok-bg: #eaf8f1; --warn: #c75c12; --warn-bg: #fff2e8; --off: #aaa8b1;
  --crit: #c9364d; --crit-bg: #fff0f2;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0e1117; --surface: #171b22; --border: #262c36; --border-strong: #333b48;
  --text: #e6e9ef; --muted: #8b95a5; --accent: #6f8bff; --accent-bg: #1b2440;
  --ok: #51cf66; --ok-bg: #15311c; --warn: #ff922b; --warn-bg: #3a2410; --off: #5b6472;
  --crit: #ff6b6b; --crit-bg: #3a1518;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e1117; --surface: #171b22; --border: #262c36; --border-strong: #333b48;
    --text: #e6e9ef; --muted: #8b95a5; --accent: #6f8bff; --accent-bg: #1b2440;
    --ok: #51cf66; --ok-bg: #15311c; --warn: #ff922b; --warn-bg: #3a2410; --off: #5b6472;
    --crit: #ff6b6b; --crit-bg: #3a1518;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 600; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--text); letter-spacing: -0.2px; white-space: nowrap; }
.brand-company { font-weight: 750; font-size: 16px; letter-spacing: -0.35px; }
.brand-product { color: var(--muted); font-weight: 500; font-size: 15px; }
.live { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.theme-toggle {
  position: relative; width: 52px; height: 28px; border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 0; background: var(--bg); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle-sun, .theme-toggle-moon {
  position: absolute; top: 50%; z-index: 1; transform: translateY(-50%);
  font-size: 11px; line-height: 1; pointer-events: none;
}
.theme-toggle-sun { left: 7px; color: #d28b00; }
.theme-toggle-moon { right: 8px; color: #737c91; font-size: 7px; }
.theme-toggle-thumb {
  position: absolute; top: 3px; left: 3px; z-index: 2; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%); transition: transform 140ms ease;
}
.theme-toggle[data-theme="dark"] .theme-toggle-thumb { transform: translateX(24px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.logout { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.logout span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout button {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 8px; padding: 5px 9px; font-family: inherit; font-size: 12px; cursor: pointer;
}
.logout button:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg); }

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; flex: 1; }
.site-footer { width: 100%; border-top: 1px solid var(--border); color: var(--muted); }
.site-footer-inner {
  display: flex; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  font-size: 12px;
}

.summary { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 22px; min-width: 96px;
}
.stat .num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat .num.ok { color: var(--ok); } .stat .num.warn { color: var(--warn); }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: var(--accent-bg); }
.row-act { text-align: right; white-space: nowrap; }
.name { font-weight: 600; }
.sub { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.endpoint { overflow-wrap: anywhere; }
.row-line { padding: 7px 0; border-bottom: 1px solid var(--border); }
.row-line:last-child { border-bottom: 0; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-ok { color: var(--ok); background: var(--ok-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-soft { color: var(--accent); background: var(--accent-bg); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--off); vertical-align: middle; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-off { background: var(--off); }

.crumbs { color: var(--muted); margin-bottom: 12px; font-size: 13px; }
.crumbs .sep { margin: 0 6px; }
.head { margin-bottom: 20px; }
.head h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.3px; }
.head .meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 13px; }
.head .meta b { color: var(--text); }
.head .meta .mono { overflow-wrap: anywhere; word-break: break-word; }
.warn { color: var(--warn); }
.usage-over { color: var(--crit); font-weight: 700; }
.title-stack { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.title-line h1 { margin: 0; }
.health-menu { position: relative; display: inline-flex; align-items: center; }
.health-menu summary {
  display: inline-flex; align-items: center; list-style: none; cursor: pointer; color: inherit;
}
.health-menu summary::-webkit-details-marker { display: none; }
.health-menu summary:hover .pill { box-shadow: 0 0 0 2px var(--border); }
.health-popover {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: min(680px, calc(100vw - 48px));
  padding: 14px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(16, 24, 40, 0.18);
}
.health-popover .headline { margin-bottom: 10px; }
.health-checks { display: grid; gap: 8px; }
.health-check {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.health-check-ok { border-left: 3px solid var(--ok); }
.health-check-warn { border-left: 3px solid var(--warn); }
.health-check-main { display: flex; gap: 8px; min-width: 0; }
.health-check-main .dot { flex: 0 0 auto; margin-top: 6px; }
.health-check-title { font-weight: 700; }
.health-check-msg { margin-top: 5px; color: var(--warn); font-size: 12px; line-height: 1.45; }
.health-check-state {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; font-weight: 700;
  color: var(--text); white-space: nowrap;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03); }
.card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-head h2 { margin: 0; }
.keeper-scope { display: inline-flex; align-items: center; gap: 8px; }
.keeper-scope .query-nav { width: auto; min-width: 260px; }
.zoo-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px; }
.zoo-crumbs .sep { color: var(--muted); }
.zoo-val { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-pill {
  display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 10.5px;
  font-weight: 700; white-space: nowrap;
}
.metric, .chartcard { transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.metric:hover, .chartcard:hover { border-color: var(--border-strong); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06); }
.card .grid { border: none; } .card table.grid { margin: -4px 0; }
@media (max-width: 720px) { .summary { flex-wrap: wrap; } }

.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 40px; text-align: center; color: var(--muted); }
.banner { margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--warn); border-radius: 8px; background: var(--warn-bg); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 20px; }
.tab { padding: 8px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 16px; }
.monitoring-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 14px 0 18px; }
.monitoring-toolbar h2 { margin: 0 0 3px; font-size: 17px; }
.monitoring-toolbar label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.monitoring-toolbar select { min-width: 210px; }
.monitoring-controls { display: flex; align-items: end; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.monitoring-controls label:first-child select { min-width: 150px; }
.monitoring-refresh { min-height: 34px; }
.log-filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.log-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.log-filters input, .log-filters select { min-width: 180px; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.log-filters select { min-width: 120px; }
.log-filters .checkline { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--text); }
.log-filters .checkline input { min-width: 0; width: 14px; height: 14px; }
.otel-filters { display: flex; align-items: end; gap: 10px; margin: 0 0 16px; }
.otel-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.otel-filter-service { width: 250px; }
.otel-filter-trace { flex: 1; min-width: 360px; }
.search-select { position: relative; min-width: 0; color: var(--text); font-size: 13px; }
.search-select-toggle {
  display: block; width: 100%; min-height: 34px; padding: 7px 32px 7px 10px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.search-select-toggle::after {
  content: ""; position: absolute; top: 13px; right: 12px; width: 6px; height: 6px;
  border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg);
}
.search-select-toggle span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-select-toggle:focus, .search-select-input:focus { outline: none; border-color: var(--accent); }
.search-select-popover {
  position: absolute; z-index: 35; top: calc(100% + 5px); left: 0; width: 100%; min-width: 300px;
  padding: 7px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.22);
}
.search-select-input {
  width: 100%; padding: 8px 9px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit;
}
.search-select-options { display: grid; gap: 2px; max-height: 280px; margin-top: 6px; overflow: auto; }
.search-select-options button {
  display: grid; gap: 1px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.search-select-options button:hover, .search-select-options button:focus,
.search-select-options button[aria-selected="true"] { outline: none; background: var(--accent-bg); }
.search-select-options button .mono {
  display: block; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap;
}
.search-select-empty, .search-select-empty-static { padding: 12px 9px; color: var(--muted); text-align: center; }
.search-select-empty-static { margin-top: 6px; }
@media (max-width: 720px) {
  .otel-filters { align-items: stretch; flex-direction: column; }
  .otel-filter-service, .otel-filter-trace { width: 100%; min-width: 0; }
}
.otel-query-grid { display: grid; gap: 16px; }
.otel-query-card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.otel-query-card .section-head { margin-bottom: 10px; }
.otel-query-body { min-width: 0; }
.otel-query-body .qr-wrap { max-height: 460px; overflow: auto; }
.otel-query-body .empty { padding: 28px; }
.otel-trace-summary .section-head .mono { overflow-wrap: anywhere; color: var(--muted); }
.otel-trace-services .metric-val {
  font-size: 13px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere;
}
.otel-metric-explorer {
  display: grid; gap: 8px; margin: 0 0 14px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.otel-metric-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.otel-metric-toolbar label {
  display: grid; gap: 5px; min-width: min(520px, 60%);
  color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase;
}
.otel-metric-select {
  width: 100%; min-height: 34px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; text-transform: none;
}
.otel-metric-stats { display: flex; align-items: flex-end; justify-content: flex-end; gap: 18px; }
.otel-metric-stats span { display: grid; gap: 2px; text-align: right; }
.otel-metric-stats small { color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.otel-metric-stats b { color: var(--text); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.otel-metric-chart { min-height: 190px; }
.otel-metric-chart svg.chart { height: 190px; margin-top: 0; }
.otel-metric-point { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.otel-metric-axis { margin-top: 0; }
.trace-waterfall {
  display: grid; gap: 10px; margin: 0 0 14px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.trace-waterfall-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.trace-waterfall-overview { color: var(--muted); font-size: 12px; font-weight: 600; }
.trace-waterfall-modes { display: inline-flex; gap: 4px; padding: 3px; border-radius: 8px; background: var(--bg); }
.trace-waterfall-modes .act { min-height: 26px; padding: 4px 9px; border-color: transparent; }
.trace-waterfall-modes .act.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.trace-waterfall-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.trace-waterfall-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trace-waterfall-legend i { width: 8px; height: 8px; border-radius: 50%; }
.trace-waterfall-scroll { overflow-x: auto; padding-bottom: 4px; }
.trace-waterfall-canvas { min-width: 800px; }
.trace-waterfall-scale, .trace-span {
  display: grid; grid-template-columns: minmax(250px, 34%) minmax(480px, 1fr); gap: 12px;
}
.trace-waterfall-scale {
  align-items: end; padding: 0 8px 5px; color: var(--muted);
  border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.trace-waterfall-ticks { display: flex; justify-content: space-between; font-weight: 500; text-transform: none; }
.trace-span {
  position: relative; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--border);
  border-radius: 6px; cursor: pointer;
}
.trace-span:last-child { border-bottom: 0; }
.trace-span:hover, .trace-span:focus { outline: none; background: var(--accent-bg); }
.trace-span-error { background: color-mix(in srgb, var(--crit-bg) 55%, transparent); }
.trace-span-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.trace-span-toggle {
  width: 18px; height: 18px; flex: 0 0 18px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.trace-span-toggle:hover:not(:disabled) { color: var(--text); background: var(--bg); }
.trace-span-toggle:disabled { cursor: default; }
.trace-span-status { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.trace-span-status.error { background: var(--crit); }
.trace-span-copy { display: grid; min-width: 0; line-height: 1.3; }
.trace-span-copy b, .trace-span-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trace-span-copy b { color: var(--text); font-size: 12px; }
.trace-span-copy small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; }
.trace-span-track { position: relative; height: 22px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.trace-span-bar {
  position: absolute; top: 4px; bottom: 4px; min-width: 4px; border-radius: 4px;
  background: var(--trace-span-color, var(--accent)); opacity: .9;
}
.trace-span-bar.error { background: var(--crit); }
.trace-span-timing {
  position: absolute; right: 6px; top: 3px; color: var(--muted);
  font-family: var(--mono); font-size: 10px; pointer-events: none;
}
.trace-span-detail {
  grid-column: 1 / -1; margin: 3px 0 4px 25px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: default;
}
.trace-span-detail dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px 16px; margin: 0;
}
.trace-span-detail dl > div { min-width: 0; }
.trace-span-detail dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.trace-span-detail dd { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.trace-span-message { margin: 10px 0 0; color: var(--crit); font-size: 12px; }
.trace-span-attributes {
  max-height: 130px; margin: 10px 0 0; padding: 9px; overflow: auto;
  border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10.5px; white-space: pre-wrap;
}
@media (max-width: 720px) {
  .otel-metric-toolbar { align-items: stretch; flex-direction: column; }
  .otel-metric-toolbar label { min-width: 0; }
  .otel-metric-stats { justify-content: flex-start; }
  .trace-waterfall-toolbar { align-items: flex-start; flex-direction: column; }
}
.credential-value { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.subtab {
  display: inline-flex; align-items: center; justify-content: center; min-height: 30px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); background: var(--surface); font-size: 12.5px; font-weight: 600;
}
.subtab:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg); text-decoration: none; }
.subtab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.subtab-preview {
  margin-left: 4px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  opacity: .75;
  text-transform: uppercase;
}

.detail-head { margin-bottom: 16px; }
.btn-sm { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.btn-sm:hover { text-decoration: underline; }

.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.btn-primary, .btn-ghost, .nav-cta, .act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1;
  font-family: inherit; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, filter 0.12s ease;
}
.btn-primary { background: var(--accent); color: #fff; padding: 10px 18px; font-size: 13px; }
.btn-primary:hover { filter: brightness(1.07); text-decoration: none; }
.nav-cta { background: var(--accent); color: #fff; padding: 7px 15px; font-size: 13px; margin-left: 4px; }
.nav-cta:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); padding: 10px 16px; font-size: 13px; }
.btn-ghost:hover { background: var(--bg); border-color: var(--muted); text-decoration: none; }
.act { background: var(--surface); color: var(--muted); border-color: var(--border-strong); padding: 5px 12px; font-size: 12px; font-weight: 500; }
.act:hover { background: var(--bg); color: var(--text); border-color: var(--muted); text-decoration: none; }
.act-danger { color: var(--warn); }
.act-danger:hover { background: var(--warn); color: #fff; border-color: var(--warn); }
.act-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.act-primary:hover { filter: brightness(1.08); color: #fff; border-color: var(--accent); }
.act-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.form-card { max-width: 640px; }
.form-err { max-width: 640px; margin: 0 0 14px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn);
  border: 1px solid var(--warn); border-radius: 8px; font-size: 13px; }
.auth-shell { display: flex; justify-content: center; padding-top: 8vh; }
.auth-panel {
  width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
.auth-form .frow > label { width: 86px; }
.auth-form .fhint, .auth-form .fbtns { margin-left: 98px; }
.frow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.frow > label { width: 96px; text-align: right; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.frow input, .frow select { flex: 1; min-width: 240px; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; }
.check-list { flex: 1; min-width: 240px; display: grid; gap: 8px; }
.check-row {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px;
}
.check-row input { flex: 0 0 auto; min-width: 0; width: 14px; height: 14px; padding: 0; }
.frow > label.checkline { width: auto; text-align: left; flex: 1; min-width: 240px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.checkline input { flex: 0 0 auto; min-width: 0; width: 14px; height: 14px; padding: 0; }
.frow input:focus, .frow select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.frow input:disabled, .frow input[readonly] { background: var(--bg); color: var(--muted); }
.fhint { flex-basis: 100%; margin-left: 108px; color: var(--muted); font-size: 11.5px; }
.fsec { margin: 22px 0 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.fbtns { display: flex; gap: 10px; align-items: center; margin-top: 22px; margin-left: 108px; }

details summary { cursor: pointer; color: var(--accent); font-size: 12px; }
pre.sql { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.5; overflow-x: auto; margin: 8px 0; white-space: pre; }
pre.sql.wrap { white-space: pre-wrap; word-break: break-word; }

.yaml-link { float: right; font-size: 12px; font-weight: 500; }
pre.yaml { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow: auto; max-height: 72vh; margin: 0; white-space: pre; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, 0.5); }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: min(920px, 100%); max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-card pre.yaml { border: none; border-radius: 0; max-height: none; flex: 1; margin: 0; }
.modal-body { padding: 16px 18px; overflow: auto; }
.connect-list { display: grid; gap: 10px; }
.connect-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.connect-label { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.eqs-console-note {
  border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn);
  border-radius: 9px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45;
}
.eqs-console-note { margin-bottom: 12px; }

.query-nav { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 12.5px; padding: 7px 9px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; }
.query-nav:focus { outline: none; border-color: var(--accent); }

.query-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.query-sidebar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; max-height: calc(100vh - 140px); overflow: auto; position: sticky; top: 76px;
}
.query-side-head { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin: 0 2px 6px; }
.query-side-head:not(:first-child) { margin-top: 14px; }
.query-tree { margin-top: 4px; }
.query-history-head { display: flex; align-items: center; justify-content: space-between; }
.query-history-head .query-side-head { margin: 0; }
.query-history { display: grid; gap: 4px; margin-top: 5px; }
.query-history-item {
  width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  cursor: pointer; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap;
}
.query-history-item:hover { color: var(--text); background: var(--bg); }
.query-history-note { margin: 6px 8px 0; }
.query-history-menu { position: relative; }
.query-history-menu > summary { list-style: none; cursor: pointer; }
.query-history-menu > summary::-webkit-details-marker { display: none; }
.query-history-popover {
  position: absolute; top: calc(100% + 7px); left: 0; z-index: 20; width: min(380px, calc(100vw - 80px));
  max-height: 320px; overflow: auto; padding: 10px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.qtable {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center;
  padding: 7px 8px; border-radius: 7px;
}
.qtable:hover { background: var(--bg); }
.qtable-name {
  min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 650;
  text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qtable-name:hover { color: var(--accent); }
.qtable-detail { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.qtable-eng { color: var(--off); font-size: 10px; white-space: nowrap; }
.qtable-badge {
  color: #8ea9ff;
  background: rgba(91, 124, 250, .12);
  border: 1px solid rgba(91, 124, 250, .28);
  border-radius: 999px;
  font-size: 10px;
  line-height: 18px;
  padding: 0 7px;
  white-space: nowrap;
}
.qddl {
  font-size: 9.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; background: var(--surface); cursor: pointer; letter-spacing: 0.03em;
}
.qddl:hover { color: var(--accent); border-color: var(--accent); }
.query-main { min-width: 0; margin-bottom: 0; }
.sqlbox { margin: 4px 0 0; }
.query-editor-label {
  display: block; margin: 0 0 6px; color: var(--muted); font-size: 11px;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.sql-input {
  width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--text); resize: vertical;
}
.sql-input:focus { outline: none; border-color: var(--accent); }
.sql-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sql-result { margin-top: 14px; }
.log-query-card .section-head { margin-bottom: 0; }
.log-query-editor { margin-top: 12px; }
.query-outcome { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.qr-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 10px; }
.qr-wrap table.grid { width: max-content; min-width: 100%; border: 0; border-radius: 0; }
.qr-wrap table.grid th { position: sticky; top: 0; background: var(--surface); }
.qr-wrap table.grid th, .qr-wrap table.grid td { white-space: nowrap; }
.qr-type { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--off); font-size: 10px; }
.qr-wrap td.mono { max-width: none; overflow: visible; text-overflow: clip; }
.qr-long-value {
  display: block; width: min(640px, 55vw); min-width: 320px; box-sizing: border-box; resize: both;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text); font: inherit; line-height: 1.45; white-space: pre-wrap;
}
.query-result-actions { display: inline-flex; gap: 8px; align-items: center; }
.query-result-chart {
  margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.result-chart-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.result-chart-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 10.5px; }
.result-chart-controls select {
  min-width: 120px; padding: 6px 28px 6px 8px; border: 1px solid var(--border-strong);
  border-radius: 7px; background: var(--surface); color: var(--text);
}
.result-chart-body { min-height: 250px; color: var(--muted); }
.result-chart-svg { display: block; width: 100%; height: 230px; }
.result-chart-bar { fill: var(--accent); }
.query-cell { max-width: 460px; overflow-wrap: anywhere; }
.query-error { margin-top: 4px; color: var(--warn); font-family: inherit; font-size: 11.5px; }
@media (max-width: 860px) {
  .query-layout { grid-template-columns: 1fr; }
  .query-sidebar { position: static; max-height: none; }
}

.headline { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.metric-val { font-size: 20px; font-weight: 700; line-height: 1.2; }
.metric-sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dashboard-metrics { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 10px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chartcard {
  min-width: 0; min-height: 270px; border: 1px solid var(--border); border-radius: 10px;
  padding: 15px 16px 12px; background: var(--bg);
}
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.chart-last { font-size: 18px; font-weight: 700; }
.chart-stats, .chart-axis { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10.5px; }
.chart-stats { padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.chart-axis { margin-top: 5px; font-family: var(--mono); }
svg.chart { display: block; width: 100%; height: 170px; margin-top: 8px; }
.chart-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-empty { min-height: 184px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.chart-error {
  min-height: 184px; display: grid; place-items: center; padding: 20px; color: var(--warn);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5; text-align: center;
}
.chart-area { fill: var(--accent-bg); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.metric.state-warn, .chartcard.state-warn {
  border-color: color-mix(in srgb, var(--warn) 56%, var(--border));
  background: var(--warn-bg);
}
.metric.state-warn .metric-val, .chartcard.state-warn .chart-last { color: var(--warn); }
.chartcard.state-warn .chart-area { fill: var(--warn-bg); }
.chartcard.state-warn .chart-line { stroke: var(--warn); }
.dashboard-actions, .dashboard-card-actions, .dashboard-editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dashboard-card-actions { justify-content: flex-end; margin: -2px 0 4px; }
.dashboard-card-actions .act { padding: 4px 8px; font-size: 10.5px; }
.dashboard-editor {
  display: grid; gap: 12px; margin: 4px 0 18px; padding: 16px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg);
}
.dashboard-editor[hidden] { display: none; }
.dashboard-editor label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.dashboard-editor input, .dashboard-editor textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.dashboard-editor textarea { resize: vertical; line-height: 1.45; }
@media (max-width: 900px) {
  .monitoring-toolbar { align-items: stretch; flex-direction: column; }
  .monitoring-controls { justify-content: flex-start; }
  .charts { grid-template-columns: 1fr; }
}
.settings-kv {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px;
}
.settings-kv > div {
  display: grid; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg);
}
.settings-kv .mono { overflow-wrap: anywhere; word-break: break-word; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-control {
  display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700;
}
.settings-field, .settings-input {
  min-height: 34px; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 500;
}
.settings-field { display: flex; align-items: center; gap: 8px; }
.settings-input { width: 100%; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.settings-notice { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--ok); border-radius: 8px; background: var(--ok-bg); color: var(--ok); }
.settings-status, .settings-reference { margin-top: 12px; }
.operator-settings-head { margin-bottom: 14px; }
.operator-settings-head h1 { margin-bottom: 4px; }
.operator-config-block { margin-top: 14px; }
.operator-args { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.operator-args code {
  padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 11px;
}
.operator-config-table td:nth-child(2) { overflow-wrap: anywhere; word-break: break-word; }
.operator-secret-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.operator-secret {
  min-width: 0; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.operator-secret-missing { border-color: color-mix(in srgb, var(--warn) 60%, var(--border)); }
.operator-secret .section-head { margin-bottom: 10px; }
.operator-secret-row { display: grid; gap: 3px; margin-top: 8px; }
.operator-refs { display: grid; gap: 3px; overflow-wrap: anywhere; font-size: 11px; }
.operator-settings-note { margin: 14px 0 0; }
.danger-card { border-color: var(--warn); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.danger-title { font-weight: 700; color: var(--warn); margin-bottom: 3px; }
@media (max-width: 760px) {
  .settings-form-grid { grid-template-columns: 1fr; }
  .danger-row { align-items: flex-start; flex-direction: column; }
}

.topnav { margin-right: auto; margin-left: 28px; display: flex; align-items: center; gap: 18px; }
.topnav a:not(.nav-cta) { color: var(--muted); font-size: 13px; font-weight: 500; }
.topnav a:not(.nav-cta):hover { color: var(--text); text-decoration: none; }
.topnav a.active { color: var(--text); font-weight: 700; }
.topnav a.active::after { content: ""; display: block; height: 2px; margin-top: 5px; border-radius: 2px; background: var(--accent); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; padding: 10px 14px; }
  .brand { line-height: 1.8; }
  .live { margin-left: auto; min-height: 28px; }
  .top-actions { order: 2; width: 100%; justify-content: space-between; margin-left: 0; }
  .logout span { max-width: 58vw; }
  .topnav {
    order: 3; width: 100%; margin: 0; gap: 14px; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .nav-cta { margin-left: auto; padding: 7px 12px; }
  main { padding: 18px 14px; }
  .head-row { gap: 10px; }
  .health-popover { left: auto; right: -12px; width: calc(100vw - 28px); overflow-x: auto; }
  .health-check { grid-template-columns: 1fr; }
  .health-check-state { align-items: flex-start; }
  .head-actions { justify-content: flex-start; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

.docs-head { margin-bottom: 18px; }
.docs-head h1 { margin: 0; }
.docs-index { display: grid; gap: 24px; }
.docs-group h2 { margin: 0 0 10px; font-size: 15px; }
.docs-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px;
}
.docs-card {
  display: grid; gap: 5px; min-height: 88px; padding: 15px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text);
}
.docs-card:hover { border-color: var(--accent); text-decoration: none; }
.docs-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.docs-layout {
  position: relative; left: 50%; width: min(1480px, calc(100vw - 40px));
  transform: translateX(-50%);
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 18px; align-items: start;
}
.docs-sidebar {
  position: sticky; top: 78px; display: grid; gap: 16px; max-height: calc(100vh - 100px);
  overflow-y: auto; padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.docs-back { color: var(--text); font-weight: 700; }
.docs-nav-group { display: grid; gap: 2px; }
.docs-nav-title {
  margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.docs-nav-group a {
  padding: 6px 8px; border-radius: 6px; color: var(--muted); font-size: 12px; line-height: 1.35;
}
.docs-nav-group a:hover, .docs-nav-group a.active {
  background: var(--accent-bg); color: var(--text); text-decoration: none;
}
.docs-article {
  min-width: 0; padding: 28px 32px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); line-height: 1.65;
}
.docs-article h1 { margin: 0 0 16px; font-size: 28px; }
.docs-article h2 { margin: 30px 0 10px; font-size: 20px; scroll-margin-top: 72px; }
.docs-article h3 { margin: 24px 0 8px; font-size: 16px; scroll-margin-top: 72px; }
.docs-article p, .docs-article ul, .docs-article ol { max-width: 900px; }
.docs-article li + li { margin-top: 4px; }
.docs-article code {
  padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); font-family: var(--mono); font-size: .9em;
}
.docs-article pre {
  max-width: 100%; overflow-x: auto; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); line-height: 1.5;
}
.docs-article pre code { padding: 0; border: 0; background: transparent; }
.docs-article table { width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 12px; }
.docs-article th, .docs-article td {
  padding: 9px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top;
}
.docs-article th { background: var(--bg); }
.docs-article img { display: block; max-width: 100%; height: auto; margin: 18px auto; }
.docs-article blockquote {
  margin-left: 0; padding-left: 14px; border-left: 3px solid var(--accent); color: var(--muted);
}
.docs-toc {
  position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto;
  padding: 4px 0 4px 14px; border-left: 1px solid var(--border);
}
.docs-toc-title {
  margin-bottom: 7px; color: var(--text); font-size: 12px; font-weight: 700;
}
.docs-toc nav { display: grid; gap: 1px; }
.docs-toc a {
  padding: 4px 7px; border-radius: 5px; color: var(--muted); font-size: 11px; line-height: 1.35;
}
.docs-toc a:hover {
  background: var(--accent-bg); color: var(--text); text-decoration: none;
}
.docs-toc a.level-3 { padding-left: 18px; }
@media (max-width: 1100px) {
  .docs-layout { width: 100%; grid-template-columns: 210px minmax(0, 1fr); transform: none; left: 0; }
  .docs-toc { display: none; }
}
@media (max-width: 820px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; }
  .docs-article { padding: 20px; }
}
