/* Arena365 services monitoring — no framework, no build step. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --sunken: #f1f3f6;
  --line: #e3e6eb;
  --line-soft: #eef0f3;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #8a93a0;
  --accent: #2563eb;
  --accent-soft: #eef3fe;
  --accent-line: #c7d7fb;
  --ok: #16a34a;
  --warn: #d99a06;
  --crit: #dc2626;
  --info: #2563eb;
  --ok-bg: #f0faf3; --ok-line: #cdebd6; --ok-text: #15803d;
  --warn-bg: #fefaf0; --warn-line: #f3e2b3; --warn-text: #92620a;
  --crit-bg: #fef4f4; --crit-line: #f5cccc; --crit-text: #b91c1c;
  --term-bg: #0f1217;
  --term-head: #161a21;
  --term-line: #252a33;
  --term-text: #c9d0da;
  --term-dim: #6b7380;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b0e13;
  --surface: #12161d;
  --surface-2: #161b23;
  --sunken: #0f1319;
  --line: #242a34;
  --line-soft: #1c222b;
  --text: #e6e9ee;
  --text-2: #a4acb8;
  --muted: #6f7885;
  --accent: #5b9cf5;
  --accent-soft: #14233a;
  --accent-line: #24406b;
  --ok: #3cc46b; --warn: #e5b440; --crit: #f06464; --info: #5b9cf5;
  --ok-bg: #11241a; --ok-line: #1f4a2e; --ok-text: #5fd48a;
  --warn-bg: #261f10; --warn-line: #54431a; --warn-text: #e8bd55;
  --crit-bg: #2a1618; --crit-line: #5a2a2d; --crit-text: #f59393;
  --term-bg: #090b0f; --term-head: #10141a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.term-head:empty { display: none; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.45 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
.icon { width: 14px; height: 14px; flex: none; display: block; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */
header {
  height: 54px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #1f2937, #111827); color: #fff;
}
[data-theme="dark"] .brand-mark { background: linear-gradient(135deg, #2a3342, #1a202b); }
.brand-mark svg { width: 15px; height: 15px; }
.brand .live-word { color: var(--crit); }
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -1px; }
.hsep { width: 1px; height: 22px; background: var(--line); flex: none; }

.tabs { display: flex; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 9px; padding: 2px; gap: 2px; }
.tabs button {
  font-size: 12px; font-weight: 550; color: var(--text-2);
  padding: 5px 12px; border-radius: 7px; white-space: nowrap; transition: color .12s, background .12s;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px var(--line); }
[data-theme="dark"] .tabs button[aria-selected="true"] { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.tabs button:hover:not([aria-selected="true"]) { color: var(--text); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 4px 11px; border: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
.pill.live { color: var(--ok-text); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.stale { color: var(--warn-text); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.down { color: var(--crit-text); background: var(--crit-bg); border-color: var(--crit-line); }
.pill.idle { color: var(--text-2); background: var(--sunken); border-color: var(--line); }
.dotpulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.live .dotpulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); } 50% { opacity: .6; box-shadow: 0 0 0 4px transparent; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; color: var(--text-2);
}
.chip.crit { border-color: var(--crit-line); color: var(--crit-text); background: var(--crit-bg); }
.chip.warn { border-color: var(--warn-line); color: var(--warn-text); background: var(--warn-bg); }
.chip.ok   { border-color: var(--ok-line);   color: var(--ok-text);   background: var(--ok-bg); }
.chips { display: flex; gap: 7px; align-items: center; }

.spacer { margin-left: auto; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 550;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 5px 10px; white-space: nowrap; min-height: 29px;
  transition: color .12s, border-color .12s, background .12s;
}
.ctl:hover { color: var(--text); border-color: color-mix(in srgb, var(--muted) 60%, var(--line)); background: var(--surface-2); }
.ctl.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.ctl.icon-only { padding: 5px 7px; }
.ctl:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- layout */
main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.view { flex: 1; overflow: hidden; display: none; flex-direction: column; }
.view.active { display: flex; animation: view-in .14s ease-out; }
@keyframes view-in { from { opacity: .4; } to { opacity: 1; } }
.scroll { overflow-y: auto; overflow-x: hidden; }

.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; padding: 12px 16px 0; flex: none;
}
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px 8px; min-width: 0; box-shadow: var(--shadow); text-align: left;
}
.kpi::before { content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; border-radius: 0 0 2px 2px; background: transparent; }
.kpi.ok::before { background: var(--ok); } .kpi.warn::before { background: var(--warn); }
.kpi.crit::before { background: var(--crit); } .kpi.info::before { background: var(--line); }
.kpi.warn { background: linear-gradient(var(--warn-bg), var(--surface) 70%); }
.kpi.crit { background: linear-gradient(var(--crit-bg), var(--surface) 70%); }
.kpi .l { font-size: 11px; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: clamp(19px, 1.45vw, 25px); font-weight: 700; line-height: 1.2; margin: 2px 0 1px; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.kpi.warn .v { color: var(--warn-text); } .kpi.crit .v { color: var(--crit-text); }
.kpi .n { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi svg { display: block; margin-top: 5px; width: 100%; height: 18px; }

.grid { display: grid; gap: 12px; padding: 12px 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card > h3 {
  font-size: 12.5px; font-weight: 650; color: var(--text); letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex: none;
}
.card > h3 .r { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.pad0 { padding: 0; }

i.d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
i.d.ok { background: var(--ok); } i.d.warn { background: var(--warn); }
i.d.crit { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 18%, transparent); }
i.d.info { background: var(--info); }

/* ---------------------------------------------------------------- services */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 10px; }
.svc {
  position: relative; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 9px 11px 8px; min-width: 0; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s;
  display: flex; flex-direction: column;
}
.svc:hover { border-color: var(--accent-line); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.svc.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.svc.crit { border-color: var(--crit-line); background: var(--crit-bg); }
.svc .t { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; letter-spacing: -.1px; min-width: 0; }
.svc .t .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc .t em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc .m { display: flex; gap: 10px; margin: 8px 0 4px; font-size: 10.5px; color: var(--muted); }
.svc .m > div { min-width: 0; }
.svc .m b { color: var(--text); font-size: 12.5px; font-weight: 650; display: block; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin-top: 4px; }
[data-theme="dark"] .bar { background: var(--line); }
.bar i { display: block; height: 100%; border-radius: 2px; transition: width .3s; }
.errline { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; min-height: 20px; }
.errline .n { font-size: 11px; color: var(--muted); white-space: nowrap; }
.errline .n b { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.errline .n b.hot { color: var(--crit); }
.errline svg { flex: 1; height: 18px; min-width: 0; }
.errline .none { font-size: 10.5px; color: var(--muted); }
.svc .why {
  display: flex; align-items: center; gap: 5px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed currentColor;
  font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.svc .why .icon { width: 12px; height: 12px; }
.svc .why span { overflow: hidden; text-overflow: ellipsis; }
.svc.warn .why { color: var(--warn-text); border-top-color: var(--warn-line); }
.svc.crit .why { color: var(--crit-text); border-top-color: var(--crit-line); }

/* ---------------------------------------------------------------- alerts */
.alert {
  display: flex; gap: 9px; align-items: flex-start; text-align: left;
  border-radius: 8px; padding: 8px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s;
}
.alert:last-child { border-bottom: 0; }
.alert:hover { background: var(--surface-2); }
.alert.cleared { opacity: .45; }
.alert i.d { margin-top: 5px; }
.alert .tx { font-size: 12px; line-height: 1.4; min-width: 0; flex: 1; }
.alert .tx b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.alert .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert .side { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: 4px; }
.alert .tm { font: 10.5px/1.5 var(--mono); color: var(--muted); }
.alert .go { color: var(--muted); transition: transform .12s, color .12s; }
.alert:hover .go { color: var(--accent); transform: translateX(2px); }

/* ---------------------------------------------------------------- tables */
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th {
  font-size: 10.5px; color: var(--muted); font-weight: 600;
  text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface);
}
td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.card table { table-layout: auto; }
.card table th:first-child, .card table td:first-child { width: 16px; padding-right: 0; text-align: center; }
.card table th:nth-child(2), .card table td:nth-child(2) { width: 100%; }
.card table th:not(:nth-child(2)):not(:first-child),
.card table td:not(:nth-child(2)):not(:first-child) { white-space: nowrap; text-align: right; }
.card table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.mono { font-family: var(--mono); font-size: 11px; }
.num { text-align: right; }
.muted { color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.clickable td:nth-child(2) { color: var(--accent); }

/* ---------------------------------------------------------------- charts */
.chartbox { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 10px 6px; min-width: 0; }
.chead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; min-width: 0; }
.ylab { font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur { font-size: 13px; font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.lg { font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 8px; height: 3px; border-radius: 2px; }
.plot { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; }
.yax { display: flex; flex-direction: column; justify-content: space-between; font-size: 9.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; padding: 0 0 1px; }
.plot-area { position: relative; min-width: 0; }
.chartbox svg { display: block; width: 100%; overflow: visible; }
.xax { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.crosshair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .5; pointer-events: none; }
.ctip {
  position: fixed; z-index: 400; pointer-events: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px 9px; font-size: 11.5px; min-width: 120px;
}
.ctip[hidden] { display: none; }
.ctip .tt { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.ctip .tr { display: flex; align-items: center; gap: 6px; }
.ctip .tr i { width: 8px; height: 3px; border-radius: 2px; flex: none; }
.ctip .tr b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- console */
.term {
  background: var(--term-bg); border: 1px solid var(--term-line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; min-height: 0; min-width: 0; box-shadow: var(--shadow);
}
.term-head {
  height: 38px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 11px;
  background: var(--term-head); border-bottom: 1px solid var(--term-line); overflow-x: auto; scrollbar-width: none;
}
.term-head::-webkit-scrollbar { display: none; }
.term-title { font-size: 12px; font-weight: 650; color: #e8ebef; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.fchip {
  font-size: 11px; font-weight: 550; color: #aab1bb; background: #1d222a; border: 1px solid #2f3540;
  border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.fchip:hover { color: #e8ebef; border-color: #4a515c; }
.fchip.on { background: #1b3354; border-color: #2d5a92; color: #b3d1f7; }
.fchip i.sw { width: 6px; height: 6px; border-radius: 50%; }
.fchip .icon { width: 12px; height: 12px; }
.term-search {
  background: #0b0d11; border: 1px solid #2f3540; border-radius: 7px; color: #d5dae1;
  font: 11.5px var(--mono); padding: 5px 10px; min-width: 200px; flex: 1; max-width: 420px; outline: none; min-height: 29px;
}
.term-search::placeholder { color: #5e6570; }
.term-search:focus { border-color: #2d5a92; }
.term-search.bad { border-color: var(--crit); }
.term-search.light { background: var(--surface); border-color: var(--line); color: var(--text); max-width: 460px; }
.term-search.light::placeholder { color: var(--muted); }
.term-search.light:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.term-meta { margin-left: auto; font-size: 11px; color: var(--term-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

.logs { flex: 1; overflow-y: auto; overflow-x: hidden; font: 11.5px/1.62 var(--mono); position: relative; contain: strict; }
.logs-inner { position: relative; width: 100%; }
.ln {
  display: flex; gap: 10px; padding: 0 12px; white-space: pre; position: absolute; left: 0; right: 0;
  height: 19px; align-items: center; cursor: pointer;
}
.ln:hover { background: rgba(255,255,255,.04); }
.ln.e { background: rgba(220,38,38,.12); box-shadow: inset 2px 0 0 var(--crit); }
.ln.w { background: rgba(217,154,6,.09); box-shadow: inset 2px 0 0 var(--warn); }
.ln.sel { background: rgba(37,99,235,.2); box-shadow: inset 2px 0 0 var(--accent); }
.ln .t { color: #5b6370; flex: none; }
.ln .s { font-weight: 600; flex: none; width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ln .lv { flex: none; width: 42px; font-weight: 700; font-size: 10px; letter-spacing: .3px; }
.ln .lv.l2 { color: #f47c7c; } .ln .lv.l1 { color: #e6be72; } .ln .lv.l0 { color: #59616d; }
.ln .m { color: var(--term-text); overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ln.e .m { color: #f5d0d0; }
.ln .m mark { background: #d4a02c; color: #111; border-radius: 2px; padding: 0 1px; font-weight: 700; }
.logs.wrap .ln { position: static; height: auto; white-space: pre-wrap; align-items: flex-start; padding-top: 1px; padding-bottom: 1px; }
.logs.wrap .ln .m { white-space: pre-wrap; word-break: break-word; }
.logs.wrap .logs-inner { height: auto !important; }

.detail {
  margin: 0 12px 8px; background: #0b0d11; border: 1px solid #2d5a92; border-radius: 8px;
  padding: 9px 11px; font: 11px/1.6 var(--mono); color: #b3d1f7; white-space: pre-wrap; word-break: break-word;
}
.detail .k { color: var(--term-dim); }
.detail .acts { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }

/* Indeterminate progress: the window is fetched from CloudWatch, which takes
   a second or two, and silence there looks like a failure. */
.progress { flex: none; height: 2px; background: #161a21; overflow: hidden; position: relative; }
.progress[hidden] { display: none; }
.progress::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 34%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progress-slide 1.05s ease-in-out infinite;
}
@keyframes progress-slide { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #2f3540; border-top-color: #5b9cf5;
  animation: spin .8s linear infinite; margin: 0 auto 11px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { padding: 34px; text-align: center; color: #8b929c; font-size: 12px; }
.loading-state .sub { font-size: 11px; color: #5e6570; margin-top: 5px; }
.skeleton { padding: 6px 12px 0; }
.skeleton i {
  display: block; height: 9px; margin-bottom: 8px; border-radius: 3px;
  background: linear-gradient(90deg, #171b22 25%, #20252d 37%, #171b22 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel {
  border-radius: 6px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--sunken) 37%, var(--line-soft) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
.kpi.loading, .svc.loading { pointer-events: none; }
.kpi.loading .skel { height: 11px; margin: 3px 0 7px; }
.kpi.loading .skel.big { height: 20px; width: 55%; }
.svc.loading .skel { height: 10px; margin: 5px 0; }

.loadmore {
  text-align: center; font-size: 11px; color: #b3d1f7; background: #14233a;
  padding: 3px 0; border-bottom: 1px solid #2d5a92; z-index: 2;
}
.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12px; }
.empty .icon { width: 22px; height: 22px; margin: 0 auto 8px; opacity: .7; }
.term .empty { color: var(--term-dim); }

/* ---------------------------------------------------------------- misc */
.sig { padding: 8px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 7px; }
.sig:last-child { border-bottom: 0; }
.sig:hover { background: var(--surface-2); }
.sig .top { display: flex; gap: 7px; align-items: center; }
.sig .top b { font-size: 13px; font-variant-numeric: tabular-nums; }
.sig .top .meta { font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig .top .ago { margin-left: auto; font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sig .txt { font: 11px/1.45 var(--mono); color: var(--text-2); margin-top: 3px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.hist-card { padding: 9px 12px 7px; }
.hist-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.hist-head .muted { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; }
.hist { display: flex; align-items: flex-end; gap: 1px; height: 46px; }
.hist i {
  flex: 1; background: var(--crit); opacity: .26; border-radius: 2px 2px 0 0; min-height: 1px; cursor: pointer;
  transition: opacity .1s;
}
.hist i.zero { background: var(--line); opacity: 1; }
.hist i.hot { opacity: .9; }
.hist i:hover { opacity: 1; background: var(--accent); }
.hist-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

.gauge-wrap { display: flex; align-items: center; gap: 11px; }
.gauge-v b { display: block; font-size: 19px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.gauge-v span { font-size: 11px; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 4px 14px; }
.stat { font-size: 11px; color: var(--muted); white-space: nowrap; }
.stat b { color: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #f3f4f6; font-size: 12px; padding: 9px 15px;
  border-radius: 9px; z-index: 500; box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: min(620px, 90vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

footer {
  flex: none; height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--surface); border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
footer b { color: var(--text-2); font-weight: 600; }
footer .spacer { margin-left: auto; }
footer .warnish { color: var(--warn-text); }

.back { display: inline-flex; align-items: center; gap: 6px; }
.subbar {
  height: 46px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.subbar::-webkit-scrollbar { display: none; }
.subbar h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; letter-spacing: -.2px; }
.subbar .muted { font-size: 11.5px; white-space: nowrap; }

@media (min-width: 1900px) {
  body { font-size: 14px; }
  .sgrid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
  .logs { font-size: 12.5px; }
  .ln { height: 21px; }
}
@media (max-width: 1100px) {
  .grid.two, .grid.three { grid-template-columns: 1fr !important; }
}
@media (max-height: 820px) {
  .kpi svg { display: none; }
  .kpi .v { font-size: 19px; }
  header { height: 48px; }
  footer { height: 26px; }
}

/* Alert popover on the header chips */
.haspop { position: relative; }
.pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; cursor: default;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-pop); padding: 8px 10px; min-width: 340px; max-width: 460px; color: var(--text);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s, transform .12s, visibility .12s;
}
.haspop:hover .pop, .haspop:focus-within .pop { opacity: 1; visibility: visible; transform: translateY(0); }
.pop::before {
  content: ''; position: absolute; top: -5px; left: 16px; width: 9px; height: 9px;
  background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.pop h4 { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.pop .row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 5px; margin: 0 -5px; border-bottom: 1px solid var(--line-soft); border-radius: 6px; }
.pop .row:last-of-type { border-bottom: 0; }
.pop .row.clickable { cursor: pointer; }
.pop .row.clickable:hover { background: var(--surface-2); }
.pop .row i.d { margin-top: 4px; }
.pop .row .tx { font-size: 12px; line-height: 1.35; min-width: 0; font-weight: 500; }
.pop .row .tx b { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.pop .row .tm { margin-left: auto; font: 10.5px var(--mono); color: var(--muted); flex: none; }
.pop .foot { font-size: 11px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line-soft); margin-top: 2px; font-weight: 400; }

.ln.target {
  background: rgba(37,99,235,.26);
  box-shadow: inset 3px 0 0 var(--accent);
  outline: 1px solid rgba(91,156,245,.45);
  outline-offset: -1px;
}
.context-bar {
  flex: none; display: flex; align-items: center; gap: 9px; padding: 7px 12px; flex-wrap: wrap;
  background: #14233a; border-bottom: 1px solid #2d5a92; color: #b3d1f7; font-size: 12px;
}
.context-bar b { color: #d7e6fa; }
.context-bar[hidden] { display: none; }
.context-bar .ctl { background: #1b3354; border-color: #2d5a92; color: #b3d1f7; }
.context-bar .ctl:hover { color: #fff; border-color: #4b82c7; }
.context-bar .ctl.on { background: #24477a; color: #fff; }

/* Fullscreen log viewer */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(6,8,12,.55); backdrop-filter: blur(3px); display: flex; padding: 2vh 2vw; }
.modal[hidden] { display: none; }
.modal-inner {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--term-bg); border: 1px solid var(--term-line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.modal-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: var(--term-head); border-bottom: 1px solid var(--term-line); flex-wrap: wrap;
}
.modal-title { font-size: 13px; font-weight: 650; color: #e8ebef; white-space: nowrap; }
.modal-head .ctl { background: #1d222a; border-color: #2f3540; color: #aab1bb; }
.modal-head .ctl:hover { color: #e8ebef; border-color: #4a515c; }
.modal-head .ctl.on { background: #1b3354; border-color: #2d5a92; color: #b3d1f7; }
.modal-head .muted { color: var(--term-dim); }
.modal .term-search { flex: 1; min-width: 180px; }

.dd-light .dd-menu { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-pop); right: 0; left: auto; }
.dd-light .dd-item { color: var(--text-2); }
.dd-light .dd-item:hover { background: var(--surface-2); color: var(--text); }
.dd-light .dd-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.dd-light .dd-sep { background: var(--line); }
.dd-light .dd-note { font-size: 10.5px; color: var(--muted); margin-left: 6px; }

#refreshDD { display: inline-flex; align-items: stretch; }
.refresh-btn, .refresh-caret {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; min-height: 29px;
  font-size: 12px; font-weight: 550; transition: color .12s, border-color .12s, background .12s;
}
.refresh-btn { border-radius: 7px 0 0 7px; padding: 5px 8px; border-right: 0; }
.refresh-caret { border-radius: 0 7px 7px 0; padding: 5px 8px 5px 6px; }
.refresh-btn:hover, .refresh-caret:hover { color: var(--text); background: var(--surface-2); }
.refresh-caret[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.refresh-btn .ico { width: 14px; height: 14px; display: block; }
.refresh-btn.spin .ico { animation: spin .7s linear infinite; }
.refresh-caret .dd-caret { width: 9px; height: 6px; opacity: .55; transition: transform .15s; }
.refresh-caret[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
#refreshLabel { min-width: 22px; text-align: right; }
#refreshDD.off .refresh-btn, #refreshDD.off .refresh-caret { color: var(--muted); }

/* Custom dropdown. A native select cannot be styled consistently, and on a
   dark toolbar the platform default looks out of place. */
.dd { position: relative; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 8px; min-width: 170px; max-width: 250px; min-height: 29px;
  font-size: 12px; font-weight: 550; color: #cfd6de;
  background: #0b0d11; border: 1px solid #2f3540; border-radius: 7px;
  padding: 5px 10px; cursor: pointer; transition: border-color .12s, color .12s;
}
.dd-btn:hover { border-color: #4a515c; color: #e8ebef; }
.dd-btn[aria-expanded="true"] { border-color: #2d5a92; color: #e8ebef; background: #10141a; }
.dd-value { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { width: 9px; height: 6px; flex: none; opacity: .6; transition: transform .15s; }
.dd-btn[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 300;
  min-width: 210px; max-height: 340px; overflow-y: auto; padding: 4px;
  background: #12161c; border: 1px solid #2f3540; border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.45); animation: pop-in .1s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.dd-menu[hidden] { display: none; }
.dd-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font-size: 12px; color: #aab1bb; padding: 6px 9px; border-radius: 6px; cursor: pointer;
  white-space: nowrap;
}
.dd-item:hover { background: #1b2028; color: #e8ebef; }
.dd-item[aria-selected="true"] { background: #1b3354; color: #cfe2fb; }
.dd-item i.sw { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.dd-item .tick { margin-left: auto; opacity: 0; font-size: 11px; }
.dd-item[aria-selected="true"] .tick { opacity: 1; }
.dd-sep { height: 1px; background: #252a33; margin: 4px 2px; }
.dd-trigger .dd-caret { width: 9px; height: 6px; opacity: .55; transition: transform .15s; }
.dd-trigger[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.dd-trigger[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }

.term-head .expand { margin-left: 6px; }

.clickable { cursor: pointer; transition: border-color .12s, background .12s, transform .12s, box-shadow .12s; }
.clickable:hover { border-color: var(--accent-line); }
.kpi.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.section-lab { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; padding-top: 11px; border-top: 1px solid var(--line-soft); }

.tabs.dark { background: #0b0d11; border: 1px solid #2f3540; }
.tabs.dark button { color: #8b929c; padding: 3px 10px; font-size: 11.5px; }
.tabs.dark button[aria-selected="true"] { background: #1b3354; color: #cfe2fb; box-shadow: none; }
.tabs.dark button:hover:not([aria-selected="true"]) { color: #e8ebef; }

.tile {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 8px 10px; min-width: 0; text-align: left;
}
.tile .l { font-size: 11px; color: var(--text-2); font-weight: 600; }
.tile .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.tile .v.warn { color: var(--warn-text); } .tile .v.crit { color: var(--crit-text); }
.tile .n { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.dbbox {
  display: flex; gap: 12px; align-items: center; background: var(--surface-2); width: 100%;
  border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; min-width: 0; text-align: left;
}
.dbbox.warn { border-color: var(--warn-line); } .dbbox.crit { border-color: var(--crit-line); }
.dbbox .name { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.dbrow { display: flex; gap: 10px; flex-wrap: wrap; }
.dbrow .dbbox { flex: 1; min-width: 320px; width: auto; }
.mini-db { margin-bottom: 8px; padding: 9px 10px; }

.fitem { display: flex; align-items: center; gap: 7px; width: calc(100% + 10px); padding: 4px 5px; margin: 0 -5px; font-size: 12px; border-radius: 6px; text-align: left; color: var(--text-2); }
.fitem:hover { background: var(--surface-2); color: var(--text); }
.fitem.on { font-weight: 650; background: var(--accent-soft); color: var(--text); }
.fitem i.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem b { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.fitem b.hot { color: var(--crit); }

.drawer-scrim { position: fixed; inset: 0; z-index: 140; background: rgba(10,12,15,.22); animation: fade-in .15s ease-out; }
.drawer-scrim[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150; width: min(540px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(0,0,0,.16);
  display: flex; flex-direction: column; animation: drawer-in .18s ease-out;
}
.drawer[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.drawer-source { font-size: 12.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-pos { font-size: 11px; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.drawer-body h2 { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.3px; }
.drawer-body .meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.drawer-body .meta b { color: var(--text-2); font-weight: 600; }
.drawer-body .banner {
  margin-top: 12px; padding: 8px 11px; border-radius: 8px; font-size: 12px;
  background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text);
}
.dsec { margin-top: 18px; }
.dsec > .ylab { display: block; margin-bottom: 7px; color: var(--muted); }
.dsec p { font-size: 12.5px; line-height: 1.6; color: var(--text); }
.dsec.hint p { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 9px 12px; }
.acts-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; border-color: var(--accent); background: var(--accent); filter: brightness(1.08); }
.links { display: flex; flex-direction: column; gap: 6px; }
.links a { font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.links a .icon { width: 12px; height: 12px; }
.links a:hover { text-decoration: underline; }

.meter { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; }
.meter .row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meter .big { font-size: 24px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.meter .big.warn { color: var(--warn-text); } .meter .big.crit { color: var(--crit-text); } .meter .big.info { color: var(--accent); }
.meter .th { font-size: 11.5px; color: var(--muted); }
.meter .peak { margin-left: auto; font-size: 11.5px; color: var(--text-2); }
.meter .track { position: relative; height: 6px; background: var(--line); border-radius: 3px; margin: 9px 0 2px; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.meter .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-2); border-radius: 1px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; }
.kv span { color: var(--muted); white-space: nowrap; }
.kv b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ev-table { overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px; }
.ev-table th { background: var(--surface-2); }
.ev-table table th:first-child, .ev-table table td:first-child { text-align: left; }
.ev-table td { font-variant-numeric: tabular-nums; }
.ev-table td:first-child { font-family: var(--mono); font-size: 11px; }
.ev-table td:not(:first-child), .ev-table th:not(:first-child) { text-align: right; }
.ev-lines { font: 11px/1.55 var(--mono); background: var(--term-bg); color: var(--term-text); border-radius: 9px; padding: 9px 11px; white-space: pre-wrap; word-break: break-word; }
.ev-sigs { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 0 12px; }

.health { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 11.5px; color: var(--text-2); }
.health b { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.health b.warn { color: var(--warn-text); } .health b.crit { color: var(--crit-text); } .health b.ok { color: var(--ok-text); }
.health .note { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

.row-grid { display: grid; gap: 12px; }

#view-service.active { overflow-y: auto; }
#view-service > .subbar { position: sticky; top: 0; z-index: 5; }
.term-wrap { padding: 12px 16px; flex: 1 0 400px; display: flex; min-height: 400px; }
.cur small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
tr.ended td { color: var(--muted); }
#detailPods { max-height: 260px; overflow-y: auto; }

.env-trigger { font-weight: 650; color: var(--text); min-width: 124px; justify-content: flex-start; }
.env-trigger .dd-caret { margin-left: auto; }
.env-trigger[data-tone="crit"] { border-color: var(--crit-line); background: var(--crit-bg); color: var(--crit-text); }
.env-trigger[data-tone="warn"] { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.env-sw { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); display: inline-block; }
.env-sw.crit { background: var(--crit); } .env-sw.warn { background: var(--warn); } .env-sw.info { background: var(--info); }
.env-menu { left: 0; right: auto; min-width: 220px; }
.dd-light.env-dd .dd-menu, #envDD .dd-menu { left: 0; right: auto; }

@media (max-width: 1280px) {
  header { gap: 8px; padding: 0 12px; }
  .brand > span:last-child { display: none; }
  .tabs button { padding: 5px 9px; }
  #liveText { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
}

.haspop:hover::after { content: ''; position: absolute; left: -6px; right: -6px; top: 100%; height: 12px; }
.haspop.suppress .pop { opacity: 0; visibility: hidden; pointer-events: none; }
.detail .acts .fchip { cursor: pointer; }

