@font-face { font-family: "Minecraft Ten"; src: url("../assets/fonts/minecraft-ten.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: Minecraft; src: url("../assets/fonts/minecraft.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: Minecraft; src: url("../assets/fonts/minecraft-bold.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face {
  font-family: Minecraft; src: url("../assets/fonts/mc-smallcaps.woff2") format("woff2"); font-weight: 400; font-display: block;
  unicode-range: U+0262, U+026A, U+0274, U+0280, U+028F, U+0299, U+029C, U+029F, U+1D00, U+1D04, U+1D05, U+1D07, U+1D0A, U+1D0B, U+1D0D, U+1D0F, U+1D18, U+1D1B, U+1D1C, U+1D20, U+1D21, U+1D22, U+A730, U+A731, U+A7AF;
}
@font-face {
  font-family: Minecraft; src: url("../assets/fonts/mc-smallcaps-bold.woff2") format("woff2"); font-weight: 700; font-display: block;
  unicode-range: U+0262, U+026A, U+0274, U+0280, U+028F, U+0299, U+029C, U+029F, U+1D00, U+1D04, U+1D05, U+1D07, U+1D0A, U+1D0B, U+1D0D, U+1D0F, U+1D18, U+1D1B, U+1D1C, U+1D20, U+1D21, U+1D22, U+A730, U+A731, U+A7AF;
}

*, *::before, *::after { box-sizing: border-box; }

:root, html[data-theme="light"], html[data-theme="dark"] {
  --bg: #160a13;
  --bg-soft: #160a13;
  --card: #2c1424;
  --card-hi: #3d1d33;
  --line: #3d1d33;
  --line-hi: #5a2a49;
  --tx: #ffffff;
  --tx-2: #aaaaaa;
  --tx-3: #8a8a8a;
  --accent: #ef5bfd;
  --accent-ink: #160a13;
  --lilac: #f7a9ff;
  --yellow: #ffff55;
  --ok: #7dfc4c;
  --bad: #ff5555;
  --warn: #ffcc00;
  --grid: #3d1d33;
  --sans: Minecraft, monospace;
  --mono: Minecraft, monospace;
  --bevel: 0 0 0 2px #000, inset 2px 2px 0 0 #5a2a49, inset -2px -2px 0 0 #160a13;
  --sunk: 0 0 0 2px #000, inset 2px 2px 0 0 #0a0408, inset -2px -2px 0 0 #5a2a49;
  --fs: 18px;
  --fs-md: 27px;
  --fs-lg: 36px;
  color-scheme: dark;
}

html { background: var(--bg); -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--tx-2);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.3333;
  font-kerning: none;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../assets/ui/bg.png") 0 0 repeat;
  image-rendering: pixelated;
  pointer-events: none;
}

body * { text-shadow: calc(1em / 9) calc(1em / 9) 0 color-mix(in srgb, currentColor 53%, #000); }
svg *, canvas { text-shadow: none; }

.glow { display: none; }

button, input, select, a { font: inherit; color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
img { image-rendering: pixelated; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--tx); }
.muted { color: var(--tx-3); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

.t-white { color: #fff; }
.t-pink { color: var(--accent); }
.t-lilac { color: var(--lilac); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1380px) / 2));
  background: #120c1a;
  box-shadow: 0 2px 0 0 #3d1d33;
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { display: flex; align-items: flex-end; gap: 4px; height: 28px; }
.brand-mark i { display: block; width: 6px; background: var(--accent); box-shadow: 2px 2px 0 #7f3086; animation: bar 2.6s steps(4, end) infinite; transform-origin: bottom; }
.brand-mark i:nth-child(1) { height: 12px; }
.brand-mark i:nth-child(2) { height: 24px; animation-delay: .3s; }
.brand-mark i:nth-child(3) { height: 18px; animation-delay: .6s; }
@keyframes bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.5); } }
@media (prefers-reduced-motion: reduce) { .brand-mark i { animation: none; } }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: var(--fs-md); font-weight: 700; color: #fff; }
.brand-text small { font-size: var(--fs); color: var(--tx-3); }

.views { display: flex; align-items: center; gap: 24px; margin-right: auto; margin-left: 16px; }
.views a { padding: 4px 0; border-bottom: 2px solid transparent; color: var(--tx-2); }
.views a:hover, .views a:focus-visible { color: #fff; border-bottom-color: var(--accent); }
.views a.on { color: #fff; border-bottom-color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.livepill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  background: var(--card);
  box-shadow: var(--sunk);
  color: var(--tx-2);
}
.livepill .dot { width: 8px; height: 8px; background: var(--tx-3); }
.livepill[data-state="live"] .dot { background: var(--ok); animation: blink 1.2s steps(2, end) infinite; }
.livepill[data-state="down"] .dot { background: var(--bad); }
.livepill-age { color: var(--tx-3); }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .livepill .dot, .tr-dot { animation: none !important; } }

.iconbtn, .sheet-close, .tl-step, .tl-now, .ghostbtn, .primarybtn, .dangerbtn, .segment button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 4px 16px;
  font-size: var(--fs);
  color: #fff;
  background: none;
  border-style: solid;
  border-width: 6px;
  border-image-source: url("../assets/ui/btn.png");
  border-image-slice: 3 fill;
  border-image-width: 6px;
  border-image-repeat: repeat;
  border-radius: 0;
  image-rendering: pixelated;
}
.iconbtn:hover, .sheet-close:hover, .tl-step:hover:not(:disabled), .tl-now:hover:not(:disabled), .ghostbtn:hover, .segment button:hover, .dangerbtn:hover,
.iconbtn:focus-visible, .ghostbtn:focus-visible, .segment button:focus-visible {
  border-image-source: url("../assets/ui/btn-hover.png");
  color: var(--yellow);
}
.iconbtn:active, .ghostbtn:active, .segment button:active, .primarybtn:active, .tl-step:active, .tl-now:active { transform: translateY(2px); }
.segment button.on, .primarybtn { border-image-source: url("../assets/ui/btn-primary.png"); color: #fff; }
.segment button.on:hover, .primarybtn:hover { border-image-source: url("../assets/ui/btn-primary-hover.png"); color: #fff; }
.dangerbtn { color: var(--bad); }

.iconbtn { width: 44px; height: 44px; min-height: 44px; padding: 0; }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn[hidden] { display: none; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.panel {
  border-style: solid;
  border-width: 6px;
  border-image-source: url("../assets/ui/panel.png");
  border-image-slice: 3;
  border-image-width: 6px;
  border-image-repeat: repeat;
  background: url("../assets/ui/panel-face.png") 0 3px repeat padding-box;
  image-rendering: pixelated;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  position: relative;
  overflow: hidden;
  padding: 14px 16px 16px;
  background: var(--card);
  box-shadow: var(--sunk);
}
.tile-label { display: block; color: var(--tx-3); margin-bottom: 6px; text-transform: lowercase; }
.tile-value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-lg); line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.tile-value small { font-size: var(--fs); color: var(--tx-3); }
.tile-sub { position: relative; z-index: 1; margin-top: 4px; color: var(--tx-3); text-transform: lowercase; }
.tile-spark { position: absolute; right: 0; bottom: 0; width: 62%; height: 44px; opacity: .45; pointer-events: none; }
.tile.accent .tile-value { color: var(--accent); }

.delta { font-size: var(--fs); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--tx-3); }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  padding: 16px 16px 18px;
  border-bottom: 2px solid #1d0c18;
}
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl.grow { flex: 1 1 220px; min-width: 200px; }
.ctl-label { color: var(--tx-3); text-transform: lowercase; }

.segment { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.segment button { padding: 4px 12px; text-transform: lowercase; }
.segment.small button { padding: 4px 12px; }

.slider { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; background: #160a13; box-shadow: var(--sunk); }
.slider input { width: 96px; accent-color: var(--accent); }
.slider output { color: var(--tx-3); min-width: 36px; }

.searchbox, .selwrap select, .field input, .field select {
  border-style: solid;
  border-width: 2px;
  border-image-source: url("../assets/ui/field.png");
  border-image-slice: 1 fill;
  border-image-width: 2px;
  border-image-repeat: repeat;
  border-radius: 0;
  background: #160a13;
}
.searchbox { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; color: var(--tx-3); }
.searchbox:focus-within, .field input:focus, .selwrap select:focus { border-image-source: url("../assets/ui/field-focus.png"); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: #fff; }
.searchbox input::placeholder { color: var(--tx-3); }
.searchbox input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }
.searchbox kbd { font-family: var(--mono); padding: 0 6px; color: var(--tx-3); box-shadow: var(--sunk); }
.searchbox:focus-within kbd { opacity: 0; }

.btnrow { display: flex; gap: 4px; }
.ghostbtn { text-transform: lowercase; }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 16px;
  border-bottom: 2px solid #1d0c18;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 10px;
  border: 0;
  background: var(--card);
  box-shadow: var(--bevel);
  color: var(--tx-2);
}
.chip .sw { width: 10px; height: 10px; background: var(--c); box-shadow: 2px 2px 0 color-mix(in srgb, var(--c) 45%, #000); flex: none; }
.chip .v { color: var(--tx-3); }
.chip:hover { background: var(--card-hi); color: #fff; }
.chip.on { color: #fff; box-shadow: 0 0 0 2px #000, inset 2px 2px 0 0 var(--c), inset -2px -2px 0 0 color-mix(in srgb, var(--c) 35%, #000); }
.chip.on .v { color: var(--c); }
.chip.off { opacity: .4; }
.chip.off .sw { background: var(--tx-3); box-shadow: none; }

.chartwrap { position: relative; padding: 14px 10px 8px; }
#chart { width: 100%; }
.chart-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tx-3); background: color-mix(in srgb, #2c1424 85%, transparent); }
.chart-state[hidden] { display: none; }

.timeline { position: relative; display: flex; align-items: center; gap: 8px; padding: 2px 16px 12px; }
.timeline.static .tl-track { opacity: .45; cursor: default; }
.tl-track { position: relative; flex: 1; height: 40px; min-width: 0; background: #160a13; box-shadow: var(--sunk); overflow: hidden; cursor: pointer; outline: none; }
.tl-track:focus-visible { outline: 2px solid var(--lilac); }
.tl-spark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tl-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  cursor: grab;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.tl-thumb:hover { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.tl-thumb.dragging { cursor: grabbing; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.tl-grip { width: 2px; height: 12px; background: var(--accent); }
.timeline[data-state="past"] .tl-thumb { background: color-mix(in srgb, var(--warn) 22%, transparent); box-shadow: inset 0 0 0 2px var(--warn); }
.timeline[data-state="past"] .tl-grip { background: var(--warn); }
.tl-bubble {
  position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%);
  padding: 2px 8px; white-space: nowrap; pointer-events: none;
  color: #fff; background: #120c1a; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #5a2a49;
  opacity: 0; z-index: 3;
}
.timeline:hover .tl-bubble, .timeline.panning .tl-bubble, .timeline[data-state="past"] .tl-bubble { opacity: 1; }
.tl-step { width: 44px; padding: 0; }
.tl-now { padding: 4px 14px; text-transform: lowercase; }
.tl-step:disabled, .tl-now:disabled { opacity: .35; cursor: default; }
.timeline[data-state="past"] .tl-now { color: var(--warn); }
.timeline[data-state="off"] { display: none; }

@media (max-width: 560px) {
  .timeline { padding: 2px 10px 10px; }
  .tl-step { display: none; }
}

.chart-note { margin: 0; padding: 0 16px 14px; color: var(--tx-3); }

.uplot, .u-wrap { font-family: var(--sans) !important; }
.u-axis { color: var(--tx-3); }
.u-select { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.u-cursor-x, .u-cursor-y { border-color: #5a2a49 !important; }
.u-cursor-pt { display: none; }

.tooltip {
  position: absolute;
  z-index: 20;
  min-width: 200px;
  max-width: 320px;
  padding: 8px 10px;
  background: #120c1a;
  box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #5a2a49;
  pointer-events: none;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-head { color: var(--tx-3); padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid #3d1d33; display: flex; justify-content: space-between; gap: 10px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.tooltip .tt-row .sw { width: 10px; height: 10px; flex: none; }
.tooltip .tt-row .nm { flex: 1; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tooltip .tt-row .vl { color: #fff; }
.tooltip .tt-row.dim { opacity: .45; }
.tooltip .tt-row.est .vl { color: var(--tx-2); }
.tooltip .tt-outage { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; margin-bottom: 4px; border-bottom: 2px solid #3d1d33; color: var(--bad); }
.tooltip .tt-outage .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-warn {
  flex: none; width: 14px; height: 14px; display: grid; place-items: center;
  font-size: 9px; line-height: 1; color: #160a13; text-shadow: none;
  background: var(--bad); clip-path: polygon(50% 4%, 100% 100%, 0 100%);
  padding-top: 4px;
}
.tooltip .tt-foot { margin-top: 6px; padding-top: 6px; border-top: 2px solid #3d1d33; color: var(--tx-3); }
.tooltip .tt-total { margin-top: 6px; padding-top: 6px; border-top: 2px solid #3d1d33; display: flex; justify-content: space-between; color: var(--tx-2); }
.tooltip .tt-total b { font-weight: 400; color: #fff; }

.listhead, .sec-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 40px 0 16px;
}
.listhead h2, .sec-head h2 {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
  font-family: "Minecraft Ten", Minecraft, monospace;
  font-size: var(--fs-lg);
  line-height: 1.25;
  text-shadow: calc(1em / 12) calc(1em / 12) 0 #878787;
}
.listhead h2::before, .sec-head h2::before { content: "»"; font-family: Minecraft, monospace; color: var(--accent); text-shadow: calc(1em / 9) calc(1em / 9) 0 #7f3086; }
.listhead h2::after, .sec-head h2::after { content: ""; flex: 1; min-width: 24px; height: 4px; margin-left: 4px; background: url("../assets/ui/separator.png") 0 0 / 64px 4px repeat-x; image-rendering: pixelated; }
.listhead h2 .muted { font-family: Minecraft, monospace; font-size: var(--fs); text-shadow: none; color: var(--tx-3); }
.listctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selwrap { display: flex; align-items: center; gap: 8px; color: var(--tx-3); text-transform: lowercase; }
.selwrap select {
  height: 40px; padding: 0 30px 0 10px;
  background: #160a13 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h10v2H8v2H6v2H4V4H2V2H0z' fill='%23aaaaaa'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 6px;
  color: #fff; appearance: none; outline: none;
}
.selwrap select option { background: #2c1424; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px 14px 20px;
  background: var(--card);
  box-shadow: var(--bevel);
  cursor: pointer;
  overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; width: 4px; background: var(--c); }
.card:hover { background: var(--card-hi); }
.card.hidden-series { opacity: .5; }
.card.offline::before { background: var(--bad); }

.card-top { display: flex; align-items: center; gap: 12px; }
.card-fav { width: 40px; height: 40px; flex: none; background: #160a13; box-shadow: var(--sunk); image-rendering: pixelated; object-fit: cover; }
.card-id { min-width: 0; flex: 1; }
.card-name { color: #fff; display: flex; align-items: center; gap: 8px; }
.card-host { font-family: var(--mono); color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { width: 8px; height: 8px; flex: none; background: var(--ok); }
.status.off { background: var(--bad); }

.card-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.card-count { display: flex; align-items: baseline; gap: 8px; }
.card-count b { font-weight: 400; font-size: var(--fs-lg); line-height: 1; color: #fff; }
.card-count span { color: var(--tx-3); }
.card-spark { width: 120px; height: 36px; flex: none; }

.card-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pill { padding: 0 8px; background: #160a13; box-shadow: var(--sunk); color: var(--tx-3); white-space: nowrap; }
.pill b { color: var(--tx-2); font-weight: 400; }

.motd {
  font-family: var(--mono);
  line-height: 1.3333;
  padding: 6px 10px;
  background: #160a13;
  box-shadow: var(--sunk);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60px;
  overflow: hidden;
}
.motd .ob { opacity: .8; }
.card-err { color: var(--bad); }

.grid.table { display: block; overflow-x: auto; background: var(--card); box-shadow: var(--bevel); padding: 2px; }
.grid.table table { width: 100%; border-collapse: collapse; min-width: 860px; }
.grid.table th { text-align: right; padding: 10px 14px; color: var(--tx-3); font-weight: 400; text-transform: lowercase; border-bottom: 2px solid #160a13; white-space: nowrap; position: sticky; top: 0; background: var(--card); }
.grid.table th:first-child, .grid.table td:first-child { text-align: left; }
.grid.table td { padding: 8px 14px; text-align: right; border-bottom: 2px solid #3d1d33; white-space: nowrap; }
.grid.table tr:last-child td { border-bottom: 0; }
.grid.table tbody tr { cursor: pointer; }
.grid.table tbody tr:hover { background: var(--card-hi); }
.grid.table .tname { display: flex; align-items: center; gap: 10px; color: #fff; }
.grid.table .tname .sw { width: 10px; height: 10px; background: var(--c); flex: none; }
.grid.table .tname img { width: 24px; height: 24px; image-rendering: pixelated; }

.sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 4, 8, .75); animation: fade .15s steps(3, end); }
@keyframes fade { from { opacity: 0; } }
.sheet-body {
  position: relative;
  width: min(980px, 100%);
  max-height: min(88vh, 940px);
  overflow: auto;
  padding: 24px;
  border-style: solid;
  border-width: 6px;
  border-image-source: url("../assets/ui/panel.png");
  border-image-slice: 3;
  border-image-width: 6px;
  border-image-repeat: repeat;
  background: url("../assets/ui/panel-face.png") 0 3px repeat padding-box;
  image-rendering: pixelated;
  animation: rise .2s steps(4, end);
}
.sheet-body.narrow { width: min(680px, 100%); }
.sheet-body h2 { font-size: var(--fs-md); margin-bottom: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; padding: 0; }

.dt-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; padding-right: 56px; }
.dt-head img { width: 56px; height: 56px; image-rendering: pixelated; box-shadow: var(--sunk); }
.dt-head h2 { font-size: var(--fs-md); margin: 0; }
.dt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.dt-stat { padding: 10px 12px; background: #2c1424; box-shadow: var(--sunk); }
.dt-stat span { display: block; color: var(--tx-3); text-transform: lowercase; }
.dt-stat b { display: block; font-weight: 400; font-size: var(--fs-md); line-height: 1.25; color: #fff; }
.dt-stat em { display: block; font-style: normal; color: var(--tx-3); }

.dt-sec { margin-top: 24px; }
.dt-sec h3 { color: var(--tx-2); margin-bottom: 10px; text-transform: lowercase; }

.heat { display: grid; grid-template-columns: 44px repeat(24, 1fr); gap: 2px; align-items: center; }
.heat .hl { color: var(--tx-3); text-align: right; padding-right: 6px; font-size: var(--fs); }
.heat .hc { aspect-ratio: 1; background: #160a13; min-height: 14px; }
.heat .hx { font-size: 9px; color: var(--tx-3); text-align: center; text-shadow: 1px 1px 0 #000; }
.heat-scale { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--tx-3); }
.heat-scale .bar { flex: 0 0 120px; height: 8px; background: linear-gradient(90deg, #160a13, var(--c)); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.bars .b { flex: 1; background: var(--c); min-height: 2px; opacity: .85; position: relative; }
.bars .b:hover { opacity: 1; }
.barx { display: flex; gap: 2px; margin-top: 6px; }
.barx span { flex: 1; text-align: center; font-size: 9px; color: var(--tx-3); overflow: hidden; text-shadow: 1px 1px 0 #000; }

.outages { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto; }
.outage { display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px; background: color-mix(in srgb, var(--bad) 10%, #2c1424); box-shadow: var(--sunk); }
.outage b { color: var(--bad); font-weight: 400; }

.adm-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 2px solid #3d1d33; flex-wrap: wrap; }
.adm-row:last-of-type { border-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { color: var(--tx-3); text-transform: lowercase; }
.field input, .field select { height: 40px; padding: 0 10px; color: #fff; outline: none; }
.field input[type="color"] { padding: 2px; width: 52px; }
.adm-note { color: var(--tx-3); margin: 12px 0 0; }
.adm-err { color: var(--bad); margin-top: 8px; }

.foot {
  margin-top: 48px; padding-top: 18px;
  border-top: 2px solid #3d1d33;
  display: flex; flex-wrap: wrap; gap: 8px;
  color: var(--tx-3);
}
.foot b { font-weight: 400; color: var(--tx-2); }
.foot-dot { opacity: .5; }

.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.tr-note { color: var(--tx-3); margin: 0; }
.tr-site { margin-top: 24px; padding: 20px; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tr-name { font-size: var(--fs-md); color: #fff; }
.tr-name:hover { color: var(--yellow); }
.tr-now { display: flex; align-items: center; gap: 10px; padding: 4px 14px; background: #160a13; box-shadow: var(--sunk); color: var(--tx-2); }
.tr-now b { font-weight: 400; font-size: var(--fs-md); color: var(--ok); }
.tr-dot { width: 10px; height: 10px; background: var(--ok); animation: blink 1.2s steps(2, end) infinite; }
.tr-now.zero b { color: var(--tx-3); }
.tr-now.zero .tr-dot { background: var(--tx-3); animation: none; }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tr-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.tr-site.has-pages .tr-body { grid-template-columns: minmax(0, 1fr) 340px; }
.tr-chart { position: relative; padding: 14px 12px 8px; background: #160a13; box-shadow: var(--sunk); min-width: 0; }
.tr-legend { display: flex; gap: 18px; margin-bottom: 10px; color: var(--tx-3); }
.tr-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; }
.tr-bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; }
.tr-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 1px; }
.tr-bar .v { position: absolute; left: 0; right: 0; bottom: 0; background: #5a2a49; }
.tr-bar .u { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); box-shadow: inset 0 2px 0 #f7a9ff; }
.tr-bar:hover .v { background: #7a3a63; }
.tr-bar:hover .u { background: var(--lilac); }
.tr-x { display: flex; justify-content: space-between; margin-top: 8px; color: var(--tx-3); }
.tr-tip {
  position: absolute; z-index: 5; pointer-events: none; white-space: nowrap;
  padding: 4px 10px; color: #fff; background: #120c1a; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #5a2a49;
  transform: translate(-50%, -100%);
}
.tr-tip[hidden] { display: none; }
.tr-tip span { color: var(--tx-3); }
.tr-pages { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tr-pages h3 { color: var(--tx-2); margin-bottom: 6px; text-transform: lowercase; }
.tr-page { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 4px 12px; background: var(--card); box-shadow: var(--bevel); overflow: hidden; }
.tr-page .fill { position: absolute; left: 2px; top: 2px; bottom: 2px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.tr-page span, .tr-page b { position: relative; }
.tr-page span { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-page b { font-weight: 400; color: var(--tx-2); }
.tr-empty { color: var(--tx-3); padding: 12px 0; }

@media (max-width: 980px) {
  .tr-site.has-pages .tr-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .wrap { padding: 20px 16px 48px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px 16px; }
  .views { order: 3; width: 100%; margin: 0; }
  .brand-text small { display: none; }
  .tile-value { font-size: var(--fs-md); }
  .controls { padding: 12px; gap: 10px 12px; }
  .ctl.grow { flex-basis: 100%; }
  .listhead { flex-direction: column; align-items: stretch; }
  .listhead h2, .sec-head h2 { font-size: var(--fs-md); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 0; align-items: flex-end; }
  .sheet-body { max-height: 92vh; padding: 18px 16px; }
  .heat { grid-template-columns: 36px repeat(24, 1fr); gap: 1px; }
  .stats, .tr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px 12px; }
  .tr-site { padding: 14px; }
  .tr-bars { height: 140px; }
  .livepill-age { display: none; }
}

.busy-days { margin-bottom: 10px; }
.busy-sum { margin: 0 0 4px; color: #fff; }
.busy-read { min-height: 24px; margin-bottom: 8px; color: var(--tx-3); }
.busy-chart { padding: 28px 12px 10px; background: #160a13; box-shadow: var(--sunk); }
.busy-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.busy-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: pointer; }
.busy-bar .f { width: 100%; background: color-mix(in srgb, var(--c) 55%, #2c1424); }
.busy-bar:hover .f, .busy-bar.top .f { background: var(--c); }
.busy-bar .tag { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px); color: #fff; white-space: nowrap; pointer-events: none; }
.busy-bar.top .tag { bottom: auto; top: -26px; }
.busy-x { display: flex; gap: 3px; margin-top: 8px; }
.busy-x span { flex: 1; overflow: visible; white-space: nowrap; color: var(--tx-3); }
@media (max-width: 720px) {
  .busy-bars { gap: 1px; height: 130px; }
  .busy-x { gap: 1px; }
  .busy-x span:nth-child(6n+4) { visibility: hidden; }
}
