/* Deckard: one dark theme, no build step. Base styles shared with robotrail. */
:root {
  --bg: #0e1116; --bg-2: #151a22; --bg-3: #1c2230; --line: #262e3d; --text: #e6e9ef; --muted: #8b95a7;
  --accent: #4f8cff; --accent-2: #3a6fd8; --danger: #e5484d; --ok: #46c27a; --warn: #f5a524;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
code, pre, .mono { font-family: var(--mono); }
code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
pre.code, pre.sample { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; margin-left: auto; }
.plain { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
kbd { background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-family: var(--mono); font-size: 11px; }

/* Layout */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; height: 46px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.brand.big { font-size: 20px; margin-bottom: 18px; }
.brand-mark { color: var(--accent); }
.nav { display: flex; gap: 2px; }
.nav-link { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--bg-3); }
.nav-link.active { color: var(--text); background: var(--bg-3); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 560px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.stat { font-size: 28px; font-weight: 600; }
.callout { background: #1a2333; border: 1px solid #2b3b5c; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.callout-token { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.token { font-size: 13px; user-select: all; }
.tag { font-size: 11px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; color: var(--muted); }
.flash { max-width: 1100px; margin: 12px auto 0; padding: 10px 14px; border-radius: 6px; border: 1px solid; width: calc(100% - 32px); }
.flash-notice { background: #10281c; border-color: #1f5a3a; color: #b8f0cf; }
.flash-alert { background: #2d1416; border-color: #6d2a2e; color: #ffc4c6; }
.auth-body .flash { margin: 0 0 12px; width: auto; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack label { color: var(--muted); font-size: 12px; margin-top: 8px; }
.stack input[type=submit], .stack .btn { margin-top: 14px; align-self: flex-start; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; width: 100%; max-width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,140,255,.25); }
input.num { width: 90px; }
.select-sm { width: auto; padding: 4px 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 14px; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.fieldset legend { padding: 0 6px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.fieldset legend label { margin: 0; color: var(--text); font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #3a465c; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; }
.btn-danger { color: #ffb3b5; border-color: #5a2a2d; background: transparent; }
.btn-danger:hover { background: #2d1416; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-on { color: var(--ok); border-color: #245c3d; }
.grow { flex: 1; min-width: 240px; }
.rename-input { width: 200px; padding: 4px 8px; }
.multi { width: auto; min-width: 220px; }
.multi:disabled { opacity: .45; }
.check { display: inline-flex; align-items: center; gap: 6px; }
.scope { align-items: flex-start; }
.tag-app { color: #8fe3b4; }
.rename .btn { visibility: hidden; }
.rename:focus-within .btn, .rename:hover .btn { visibility: visible; }
button.as-link { background: none; border: 0; color: var(--text); text-align: left; width: 100%; cursor: pointer; font: inherit; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; }
.table form { display: inline; }

/* Menus */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-3); white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; min-width: 220px; padding: 6px; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.menu-item { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.menu-item:hover { background: var(--bg-3); text-decoration: none; }
.menu-item.current { color: var(--muted); }
.help .menu-body { min-width: 420px; padding: 10px 14px; }
.help-body p { margin: 4px 0; }

/* Auth */
.btn-google { width: 100%; justify-content: center; background: #fff; color: #1f1f1f; border-color: #fff; font-weight: 500; }
.btn-google:hover { background: #e8eaed; }
.g-mark { font-weight: 700; color: #4285f4; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-body { align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }

/* Dashboard bars */
.bars { display: flex; gap: 3px; align-items: flex-end; height: 48px; margin-top: 12px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { display: block; width: 100%; height: 2%; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }

/* Log viewer */

/* Traces */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { width: 260px; }
.filters input.num { width: 110px; }
.filters select { width: auto; }
.tag-error { color: #ff9a9d; border-color: #5c2327; background: #2a1517; }
.tag-slow { color: #f7c66b; border-color: #5a4313; background: #2a2110; }
.tag-sample { color: var(--muted); }
.tag-partial { color: #9fb7ff; border-color: #2b3b5c; background: #1a2333; }
.num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.name-col { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.is-error td.name-col a { color: #ff9a9d; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.waterfall { padding: 0; overflow: hidden; }
.span-row { border-bottom: 1px solid var(--line); }
.span-row:last-child { border-bottom: 0; }
.span-row > summary { display: grid; grid-template-columns: minmax(220px, 38%) 86px 1fr; gap: 10px; align-items: center; padding: 5px 12px; cursor: pointer; list-style: none; }
.span-row > summary::-webkit-details-marker { display: none; }
.span-row > summary:hover, .span-row[open] > summary { background: var(--bg-3); }
.span-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.span-row.is-error .span-name { color: #ff9a9d; }
.span-service { color: var(--muted); font-family: var(--sans); margin-left: 6px; }
.bar-svg { display: block; width: 100%; height: 12px; background: var(--bg); border-radius: 2px; }
.span-detail { padding: 10px 14px 14px; background: var(--bg); border-top: 1px solid var(--line); }
.span-detail h3 { font-size: 12px; color: var(--muted); font-weight: 500; margin: 12px 0 4px; }
.kv { width: 100%; border-collapse: collapse; font-size: 12px; }
.kv th { text-align: left; font-weight: 400; color: var(--muted); font-family: var(--mono); width: 260px; vertical-align: top; padding: 2px 10px 2px 0; }
.kv td { font-family: var(--mono); word-break: break-word; padding: 2px 0; }
pre.stack { max-height: 320px; overflow: auto; font-size: 11px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 4px 0 0; white-space: pre; }
.svc-0, .swatch.svc-0 { fill: #4f8cff; background: #4f8cff; }
.svc-1, .swatch.svc-1 { fill: #46c27a; background: #46c27a; }
.svc-2, .swatch.svc-2 { fill: #c084fc; background: #c084fc; }
.svc-3, .swatch.svc-3 { fill: #f5a524; background: #f5a524; }
.svc-4, .swatch.svc-4 { fill: #22d3ee; background: #22d3ee; }
.svc-5, .swatch.svc-5 { fill: #f472b6; background: #f472b6; }
rect.is-error { fill: var(--danger); }
.depth-1 { padding-left: 14px; } .depth-2 { padding-left: 28px; } .depth-3 { padding-left: 42px; } .depth-4 { padding-left: 56px; }
.depth-5 { padding-left: 70px; } .depth-6 { padding-left: 84px; } .depth-7 { padding-left: 98px; } .depth-8 { padding-left: 112px; }
.depth-9 { padding-left: 126px; } .depth-10 { padding-left: 140px; } .depth-11 { padding-left: 154px; } .depth-12 { padding-left: 168px; }

/* Charts. Series colours are a validated set for this surface (blue, orange, aqua); text never
   wears a series colour. Errors use the status red and are always labelled as errors. */
.slot-1 { --slot: #3987e5; } .slot-2 { --slot: #d95926; } .slot-3 { --slot: #199e70; } .slot-critical { --slot: #d03b3b; }
.slot-4 { --slot: #c98500; } .slot-5 { --slot: #d55181; } .slot-6 { --slot: #0ca30c; }
.chart.chart-wide { margin-bottom: 14px; }
.key-box { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--slot); }
.chart-wide .tick { font-size: 11px; } .chart-wide .deploy-label { font-size: 10px; }
.spark { display: block; width: 100%; height: 26px; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }
.spark-cell { width: 96px; padding-right: 0 !important; } .spark-cell .spark { height: 20px; margin: 0; }
.tile-unit { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.layer-bar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; overflow: visible; }
.layer-bar rect { fill: var(--slot); }
.consumed { display: inline-block; min-width: 46px; }
.summary-bar { display: block; width: 100%; height: 10px; }
.summary-bar rect { fill: var(--slot); }
.tag-nplus1 { color: #ffb38a; border-color: #6b3413; background: #2e1a0e; font-weight: 600; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.charts > .card { margin-bottom: 0; }
.charts > .wide { grid-column: span 2; }
@media (max-width: 860px) { .charts { grid-template-columns: minmax(0, 1fr); } .charts > .wide { grid-column: auto; } }
.chart { margin: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 8px; min-width: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chart-legend { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 5px; }
.key-line { display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: var(--slot); }
.chart-plot { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; outline: none; }
.chart svg:focus-visible { box-shadow: 0 0 0 2px rgba(79,140,255,.35); border-radius: 4px; }
.chart .grid { stroke: #222a38; stroke-width: 1; }
.chart .axis { stroke: #343e52; stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--slot); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--slot); opacity: .1; }
.chart .column { fill: var(--slot); }
.chart .dot { fill: var(--slot); stroke: var(--bg-2); stroke-width: 2; }
.chart .deploy-label { fill: var(--muted); font-size: 8px; font-family: var(--mono); }
.chart .deploy { stroke: var(--muted); stroke-width: 1; opacity: .7; }
.chart .crosshair { stroke: var(--text); stroke-width: 1; opacity: .5; pointer-events: none; }
.chart-tip { position: absolute; top: 4px; transform: translateX(10px); background: var(--bg-3); border: 1px solid #3a465c; border-radius: 6px; padding: 6px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.chart-tip.flip { transform: translateX(calc(-100% - 10px)); }
.chart-tip-label { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip-row span { color: var(--muted); }
.chart-empty { margin: 30px 0; text-align: center; }
.chart-table { margin-top: 4px; font-size: 12px; }
.chart-table summary { color: var(--muted); cursor: pointer; width: fit-content; }
.chart-table .table { margin-top: 6px; max-height: 240px; overflow: auto; display: block; }

/* Stat tiles and operation tables */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile-label { color: var(--muted); font-size: 12px; }
.tile-value { font-size: 24px; font-weight: 600; margin-top: 2px; }
.tile-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab { color: var(--muted); padding: 7px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { color: var(--muted); font-size: 11px; margin-left: 4px; }
.table th a { color: var(--muted); } .table th a.sorted { color: var(--text); }
.table td.op-col { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.share { display: inline-block; width: 56px; height: 4px; vertical-align: middle; margin-left: 6px; }
.rate-bad { color: #ff9a9d; }
.tag-new { color: #9fb7ff; border-color: #2b3b5c; background: #1a2333; }
.tag-regressed { color: #f7c66b; border-color: #5a4313; background: #2a2110; }
.tag-resolved { color: #8fe3b4; border-color: #245c3d; background: #10281c; }
.tag-open { color: #ff9a9d; border-color: #5c2327; background: #2a1517; }
.tag-ignored { color: var(--muted); }
.error-title { font-family: var(--mono); font-size: 13px; }
.error-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 620px; }
.frames { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12px; }
.frames li { padding: 3px 8px; border-left: 2px solid transparent; color: var(--muted); }
.frames li.in-app { color: var(--text); border-left-color: var(--accent); background: var(--bg); }
.frames .fn { color: var(--muted); margin-left: 8px; }
.frames li.in-app .fn { color: #9fb7ff; }
.frames details > summary { padding: 3px 8px; color: var(--muted); cursor: pointer; font-family: var(--sans); width: fit-content; }
.frames details ol { list-style: none; margin: 0; padding: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: inline; }
.share-track { fill: #1d2b45; } .share-fill { fill: var(--accent); }
.op-title { font-size: 17px; word-break: break-word; margin: 2px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-label { font-size: 12px; color: var(--muted); font-weight: 500; margin: 14px 0 4px; }
.facts + .section-label { margin-top: 16px; }
pre.code + .facts { margin-top: 12px; }
.tabs-minor { border-bottom: 0; margin-bottom: 8px; }
.tabs-minor .tab { padding: 4px 10px; border: 1px solid transparent; border-radius: 14px; margin-bottom: 0; font-size: 13px; }
.tabs-minor .tab.active { border-color: var(--line); background: var(--bg-3); }
.table td.bar-col { min-width: 240px; font-variant-numeric: tabular-nums; }
.layer-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.summary-cell { width: 22%; min-width: 120px; }
.table tr.is-error td.op-col { color: #ff9a9d; }

/* Issues */
.tag-severity-critical { color: #ff9a9d; border-color: #5c2327; background: #2a1517; font-weight: 600; }
.tag-severity-warning { color: #f7c66b; border-color: #5a4313; background: #2a2110; }
.tag-severity-info { color: #9fb7ff; border-color: #2b3b5c; background: #1a2333; }
.tag-acknowledged { color: #9fb7ff; border-color: #2b3b5c; background: #1a2333; }
.table td.issue-col { max-width: 560px; }
.suggestion { font-size: 15px; line-height: 1.55; margin: 0; max-width: 900px; }
h2.spaced { margin-top: 18px; }
.rule-form { max-width: 520px; }
.issue-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #5c2327; color: #ffc4c6; font-size: 11px; text-align: center; margin-left: 4px; }

/* Agents */
.tag-flag-secret { color: #ff9a9d; border-color: #5c2327; background: #2a1517; font-weight: 600; }
.tag-flag-destructive { color: #ffb38a; border-color: #6b3413; background: #2e1a0e; font-weight: 600; }
.tag-flag-network { color: #f7c66b; border-color: #5a4313; background: #2a2110; }
.table td .sorted { font-weight: 600; }
.share-bar rect { fill: var(--slot); }

/* Loading: a line from the films while a slow page loads. It sits over the page without taking
   the pointer. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loading { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); z-index: 90; pointer-events: none;
           background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px 16px; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); animation: loading-in .25s ease-out; }
.loading figure { margin: 0; }
.loading blockquote { margin: 0; font-size: 15px; line-height: 1.5; }
.loading figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.loading-bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; }
.loading-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 34%; background: var(--accent); animation: loading-sweep 1.5s ease-in-out infinite; }
@keyframes loading-sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@keyframes loading-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (prefers-reduced-motion: reduce) { .loading, .loading-bar::before { animation: none; } .loading-bar::before { width: 100%; } }
