@font-face { font-family: "Inter"; src: url(/static/fonts/inter-4.1-regular.ttf) format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/static/fonts/inter-4.1-medium.ttf) format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/static/fonts/inter-4.1-semibold.ttf) format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/static/fonts/jetbrains-mono-2.304-regular.ttf) format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

/* Driftmower ui/app/globals.css: semantic surfaces, controls and typography. */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #ffffff; --panel: #ffffff; --border: #c3ccd7; --input: #a6b2c1; --text: #202936; --muted: #4b5563;
  --accent: #1e3a8a; --danger: #e7000b; --warning: #8a6508; --hover: #e1e7ee;
  --secondary: #f1f4f7; --surface-muted: #e8ecf1; --sidebar: #e9edf2; --sidebar-hover: #dce3ec;
  --selected: #eef2ff; --selected-text: #0c1d52; --ring: #64748b; --radius: 10px;
  --shadow: none; --y-key: #8250df; --y-string: #0a7d4f; --y-number: #b35900;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --panel: #171717; --border: #ffffff1a; --input: #ffffff26; --text: #fafafa; --muted: #a1a1a1;
    --accent: #93c5fd; --danger: #ff6467; --warning: #f9c74f; --hover: #262626;
    --secondary: #262626; --surface-muted: #262626; --sidebar: #171717; --sidebar-hover: #262626;
    --selected: #262626; --selected-text: #fafafa; --ring: #737373;
    --y-key: #c4a6ff; --y-string: #7ee2b8; --y-number: #ffb86b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --panel: #171717; --border: #ffffff1a; --input: #ffffff26; --text: #fafafa; --muted: #a1a1a1;
  --accent: #93c5fd; --danger: #ff6467; --warning: #f9c74f; --hover: #262626;
  --secondary: #262626; --surface-muted: #262626; --sidebar: #171717; --sidebar-hover: #262626;
  --selected: #262626; --selected-text: #fafafa; --ring: #737373;
  --y-key: #c4a6ff; --y-string: #7ee2b8; --y-number: #ffb86b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.pad { padding: 16px; }

.bar { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 10px 24px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.brand { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -.02em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 8px; background: #1e3a8a; }
.crumbs { flex: 1; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session { color: var(--muted); display: flex; gap: 10px; align-items: center; }
button, select, input { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--input); border-radius: 4px; min-height: 32px; padding: 4px 10px; }
button { cursor: pointer; font-weight: 500; transition: background-color .15s, border-color .15s; }
button:disabled { opacity: .5; pointer-events: none; }
button:active { transform: translateY(1px); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
button:hover, select:hover { background: var(--hover); }

.page { padding: 24px; max-width: 2400px; margin: 0 auto; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; }
.head h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.head p { margin: 2px 0 0; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-left: auto; }
.controls label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.status { font-size: 12px; color: var(--muted); }
.status.stale { color: var(--warning); }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 20px; box-shadow: var(--shadow); color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--ring); background: var(--secondary); }
.card h2 { font-size: 15px; font-weight: 500; margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 6px; border-radius: 3px; background: var(--secondary); border: 1px solid var(--border); color: var(--muted); margin-left: 6px; vertical-align: 1px; }

.message { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 24px; max-width: 640px; margin: 48px auto; text-align: center; }
.message h2 { margin: 0 0 8px; font-size: 16px; font-weight: 500; }

.navlink { color: var(--muted); font-size: 14px; font-weight: 500; padding: 7px 4px; border-bottom: 2px solid transparent; }
.navlink.on { color: var(--accent); border-bottom-color: var(--accent); }
.navlink:hover { color: var(--text); text-decoration: none; }
.resource-nav { display: flex; flex: none; align-items: center; gap: 12px; }
.source-page .x-yaml a { text-decoration: underline; text-underline-offset: 3px; }

/* explorer */
.x .anafarg-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.x { position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
.x::before { content: ""; position: absolute; top: 0; bottom: 0; left: 296px; width: 1px; background: var(--border); pointer-events: none; }
.x-main { min-width: 0; }
.x-side { position: sticky; top: 60px; max-height: calc(100vh - 76px); display: flex; flex-direction: column; gap: 12px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.x-side nav { overflow-y: auto; border: 0; border-radius: 0; background: transparent; }
.x-side nav a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; color: var(--text); font-size: 13px; border: 0; border-radius: 0; }
.x-side nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-side nav a small { color: var(--muted); }
.x-side nav a:hover { background: var(--sidebar-hover); text-decoration: none; }
.x-side nav a.on { background: var(--sidebar-hover); font-weight: 600; box-shadow: inset 3px 0 var(--accent); }
.x-search { width: 100%; padding: 6px 10px; }
.x-count, .x-prom { font-size: 12px; }
.x-monitor-namespace { padding: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.x-histogram-warning { color: var(--warning); font-size: 13px; cursor: help; }
.x-h { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.x-main > div > p { margin: 2px 0 10px; }
.x-filters, .x-agg { margin: 10px 0 14px; justify-content: flex-start; margin-left: 0; }
.x-by { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; align-items: center; }
.x-by label { display: flex; gap: 4px; align-items: center; }
.x-top { width: 80px; }
.x-list { display: flex; flex-direction: column; border: 0; border-radius: 0; background: transparent; }
.x-list a { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1fr); gap: 4px 12px; padding: 7px 12px; color: var(--text); border-bottom: 1px solid var(--border); align-items: center; }
.x-list a small { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-list a:hover { background: var(--hover); text-decoration: none; }
.x-list b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.x-more { margin: 12px 0; }
.x-more summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.x-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.x-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.x-yaml-box { margin-top: 16px; }
.x-yaml-box .controls { margin: 0 0 6px; justify-content: space-between; }
.x-yaml { margin: 0; font-variant-ligatures: none; overflow-x: auto; font: 12.5px/1.6 var(--font-mono); color: var(--text); background: var(--secondary); border: 1px solid var(--border); border-radius: 4px; padding: 16px; tab-size: 2; }
.x-yaml .y-key { color: var(--y-key); }
.x-yaml .y-string, .x-yaml .y-value { color: var(--y-string); }
.x-yaml .y-number, .x-yaml .y-bool { color: var(--y-number); }
.x-yaml .y-punct { color: var(--muted); }
.x-yaml .y-comment { color: var(--muted); font-style: italic; }
.badge.t-rate { color: #4269d0; border-color: currentColor; }
.badge.t-line { color: #3ca951; border-color: currentColor; }
.badge.t-heatmap { color: #d95f02; border-color: currentColor; }
.badge.t-state { color: #a463f2; border-color: currentColor; }
.badge.t-unsupported { color: var(--muted); }
@media (max-width: 760px) { .x { grid-template-columns: 1fr; } .x-side { position: static; max-height: none; } .x-side nav { max-height: 240px; } }

/* Dashboard controls stay in the sticky navigation, including on narrow screens. */
.bar { flex-wrap: wrap; gap: 8px 16px; }
.nav-controls { flex: 0 1 auto; justify-content: flex-end; }
.nav-time { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; }
.nav-time > div { display: flex; align-items: center; }
.nav-controls[hidden] { display: none; }
.nav-controls select { max-width: 200px; }
.nav-controls .status { white-space: nowrap; }
@media (max-width: 1000px) {
  .nav-controls { order: 5; flex-basis: 100%; justify-content: flex-start; margin: 0; }
  .nav-controls select { max-width: 140px; }
}


.x-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; align-items: center; }
.x-chips > span { flex: 0 0 100%; font-size: 12px; }
.x-chips button { min-height: 24px; padding: 1px 4px; font-size: 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.x-chips button.on { border-bottom-color: var(--accent); color: var(--accent); background: transparent; }
.x-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; }
.x-preview { min-width: 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0 0 20px; }
.x-preview-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.x-preview-head a { overflow-wrap: anywhere; font-weight: 500; }
.x-preview p { margin: 4px 0; font-size: 12px; }
.x-preview-help { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.x-modes { justify-content: flex-start; margin: 8px 0; gap: 6px 10px; }
.x-modes select { max-width: 220px; }
.x-preview .x-modes label { font-size: 12px; }

.x-preview-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.x-preview-head > span:last-child { flex: none; display: flex; align-items: center; gap: 8px; }
.x-unsupported-title { display: block; margin-top: 10px; font-weight: 500; }
.x-source { margin-top: 20px; }
.x-source h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.x-query { margin: 12px 0; }
.x-query > a { display: inline-block; margin-bottom: 6px; font-size: 12px; }
.p-function, .p-keyword { color: var(--y-key); }
.p-identifier { color: var(--text); }
.p-string { color: var(--y-string); }
.p-number { color: var(--y-number); }
.p-operator { color: var(--accent); }
.p-punct, .p-comment { color: var(--muted); }
.x-side { top: calc(var(--navbar-height, 44px) + 16px); max-height: calc(100vh - var(--navbar-height, 44px) - 32px); }

code, pre, kbd, samp { font-family: var(--font-mono); }
@media (max-width: 760px) {
  .page { padding: 16px; }
  .bar { padding-inline: 16px; }
  .x-side { position: static; max-height: none; }
  .x-preview { padding: 0 0 16px; }
  .x::before { display: none; }
  .x-side { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
}

.x-metric-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; font-size: 14px; font-weight: 500; line-height: 1.5; }
h1.x-metric-heading { font-size: 20px; font-weight: 600; }
.x-metric-heading > a:first-child { color: var(--text); overflow-wrap: anywhere; }
.x-metric-heading > a:first-child:hover { color: var(--accent); }
.x-metric-type { flex: none; color: var(--muted); font-size: 12px; font-weight: 400; }
.x-metric-value { margin-left: auto; font-size: 13px; font-weight: 500; }
.x-preview .status:empty { display: none; }

/* Explorer uses the entire viewport; navigation and the time window remain above it. */
.page.explorer-page { max-width: none; width: 100%; height: calc(100dvh - var(--navbar-height, 56px)); overflow: hidden; padding: 16px 24px; }
.explorer-page .x { height: 100%; min-height: 0; }
.explorer-page .x-side { position: static; height: 100%; min-height: 0; max-height: none; overflow: hidden; }
.explorer-page .x-side > :not(nav) { flex-shrink: 0; }
.explorer-page .x-side nav { flex: 1 1 auto; min-height: 0; }
.explorer-page .x-main { height: 100%; min-height: 0; overflow-y: auto; padding-right: 8px; scrollbar-gutter: stable; }
@media (max-width: 760px) {
  .page.explorer-page { height: auto; min-height: calc(100dvh - var(--navbar-height, 56px)); overflow: visible; padding: 16px; }
  .explorer-page .x { height: auto; }
  .explorer-page .x-side { height: auto; overflow: visible; }
  .explorer-page .x-side nav { max-height: 240px; }
  .explorer-page .x-main { height: auto; overflow: visible; padding-right: 0; }
}

.page.chart-detail-page { max-width: none; width: 100%; }
.chart-detail-page h1 { font-size: 20px; font-weight: 500; margin: 12px 0; }
.chart-data-controls { display: flex; gap: 16px; align-items: center; margin: 20px 0 10px; flex-wrap: wrap; }
.chart-data-controls input { min-width: min(300px, 100%); }
.chart-data-scroll { overflow: auto; }
.chart-data { border-collapse: collapse; width: 100%; font-size: 12px; }
.chart-data th, .chart-data td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.chart-data th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.chart-data td:last-child { overflow-wrap: anywhere; min-width: 180px; }
.chart-overview-grouped { height: 0 !important; overflow: hidden; }
.chart-data-scroll[hidden] { display: none; }
.chart-group { margin: 20px 0; }
.chart-group h2 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.chart-prometheus-links { display: inline-flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; }
.crumbs { display: flex; align-items: center; gap: 8px; }
.crumbs > * { flex-shrink: 0; }
.crumbs > :last-child { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb-separator { color: var(--muted); }
.chart-data-controls { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; gap: 12px; }
.chart-data-controls > * { flex-shrink: 0; }
.chart-data-controls input { min-width: 180px; width: 240px; }
.chart-detail-status { white-space: nowrap; font-size: 12px; }
.chart-data-controls .chart-prometheus-links { flex-wrap: nowrap; white-space: nowrap; }
.x-detail-controls { display: flex; align-items: center; gap: 12px; overflow-x: auto; padding-bottom: 4px; margin: 10px 0 14px; }
.x-detail-controls > .controls { display: inline-flex; flex-wrap: nowrap; align-items: center; flex: 0 0 auto; margin: 0; white-space: nowrap; }
.x-detail-controls .x-by { flex-wrap: nowrap; }
