@font-face { font-family: "Go"; src: url(/static/fonts/go-regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Go"; src: url(/static/fonts/go-medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --bg: #f4f5f7; --panel: #ffffff; --border: #e3e5e8; --text: #1d2330; --muted: #6b7280;
  --accent: #4269d0; --danger: #d4373c; --warning: #b7791f; --hover: #eef1f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --y-key: #8250df; --y-string: #0a7d4f; --y-number: #b35900;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --panel: #171a21; --border: #262a33; --text: #e6e8ec; --muted: #9aa1ad;
    --accent: #7fa1f0; --danger: #ff6b6b; --warning: #f2b84b; --hover: #1e222b;
    --shadow: none; color-scheme: dark;
    --y-key: #c4a6ff; --y-string: #7ee2b8; --y-number: #ffb86b;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #171a21; --border: #262a33; --text: #e6e8ec; --muted: #9aa1ad;
  --accent: #7fa1f0; --danger: #ff6b6b; --warning: #f2b84b; --hover: #1e222b;
  --shadow: none; color-scheme: dark;
  --y-key: #c4a6ff; --y-string: #7ee2b8; --y-number: #ffb86b;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 Go, system-ui, sans-serif; }
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; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 500; color: var(--text); letter-spacing: .02em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; background: linear-gradient(135deg, #4269d0, #6cc5b0); }
.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(--border); border-radius: 6px; padding: 4px 8px; }
button { cursor: pointer; }
button:hover, select:hover { background: var(--hover); }

.page { padding: 16px; 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: 20px; font-weight: 500; 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: 12px; }
.card { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--accent); }
.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: 11px; padding: 0 6px; border-radius: 9px; 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: 8px; 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: 13px; }
.navlink:hover { color: var(--text); text-decoration: none; }

/* explorer */
.x .anafarg-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.x { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.x-side { position: sticky; top: 60px; max-height: calc(100vh - 76px); display: flex; flex-direction: column; gap: 8px; }
.x-side nav { overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.x-side nav a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; color: var(--text); font-size: 13px; border-bottom: 1px solid var(--border); }
.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(--hover); text-decoration: none; }
.x-side nav a.on { background: var(--hover); font-weight: 500; box-shadow: inset 3px 0 var(--accent); }
.x-search { width: 100%; padding: 6px 10px; }
.x-count, .x-prom { font-size: 12px; }
.x-h { font-size: 18px; font-weight: 500; 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: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.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; overflow-x: auto; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; 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; } }
