/* Freshness Badge: sits on someone else's dashboard, so it defaults to a quiet light look; theme=dark flips it. */
:root {
  --bg: #ffffff; --card: #ffffff; --line: #e3e2dc; --text: #1b1d22; --text2: #565b66; --text3: #8a8f99;
  --fresh: #2f8f7f; --late: #b98a00; --failing: #e2731b; --unknown: #9aa0a9;
  --tint-fresh: rgba(47,143,127,.09); --tint-late: rgba(185,138,0,.1); --tint-failing: rgba(226,115,27,.1); --tint-unknown: rgba(154,160,169,.12);
  --wall: #f4f3ef; --ink: #0d0f13; --signal: #ff9a2e;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dark {
  --bg: #0d0f13; --card: #13161c; --line: #262b34; --text: #f2f1ec; --text2: #a7abb3; --text3: #7f8590;
  --fresh: #52b3a2; --late: #e8c547; --failing: #ff9a2e; --wall: #0d0f13;
  --tint-fresh: rgba(82,179,162,.12); --tint-late: rgba(232,197,71,.12); --tint-failing: rgba(255,154,46,.13);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font: 400 13px/1.4 var(--sans); }
html.walled, html.walled body { background: var(--wall); }
html.walled body { overflow-y: auto; }

/* ---- the badge ---- */
.badge { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  background: var(--tint); border: 1px solid transparent; cursor: pointer; user-select: none; }
.badge.fresh { --c: var(--fresh); --tint: var(--tint-fresh); }
.badge.late { --c: var(--late); --tint: var(--tint-late); }
.badge.failing { --c: var(--failing); --tint: var(--tint-failing); }
.badge.unknown { --c: var(--unknown); --tint: var(--tint-unknown); }
.badge:hover { border-color: var(--c); }
.dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.badge.failing .dot::after, .badge.late .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.txt { min-width: 0; flex: 1; line-height: 1.3; }
.state { font: 700 12.5px/1.2 var(--mono); color: var(--c); letter-spacing: -0.01em; }
.line { color: var(--text2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line b { color: var(--text); font-weight: 500; }
.chev { flex: none; color: var(--text3); font: 500 12px/1 var(--mono); }
.gear { flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text3); font-size: 14px; cursor: pointer; }
.gear:hover { background: var(--tint-unknown); color: var(--text); }

.detail { display: none; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.open .detail { display: block; }
.detail .row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: baseline; padding: 4px 0; }
.detail .row + .row { border-top: 1px solid var(--line); }
.detail .row i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); align-self: center; }
.detail .row.fresh { --c: var(--fresh); } .detail .row.late { --c: var(--late); } .detail .row.failing { --c: var(--failing); } .detail .row.unknown { --c: var(--unknown); }
.detail .n { font: 600 12px/1.3 var(--mono); overflow-wrap: anywhere; }
.detail .s { font-size: 11.5px; color: var(--text2); }
.detail .r { font: 500 11px/1 var(--mono); color: var(--c); white-space: nowrap; }
.detail .by { margin-top: 8px; font: 500 10.5px/1.3 var(--mono); color: var(--text3); }

.single { padding: 6px; }
.pick { margin-top: 6px; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text2); }
.pick[hidden] { display: none; }
.pick select { flex: 1; min-width: 0; font: 500 12px/1 var(--sans); padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }

/* ---- the demo wall ---- */
.wall { max-width: 1240px; margin: 0 auto; padding: 24px 28px 30px; }
.whead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand { font: 700 14px/1 var(--mono); color: var(--text); text-decoration: none; }
.brand b { color: var(--failing); }
.brand span { color: var(--text3); font-weight: 500; margin-left: 6px; }
.wall h1 { margin-top: 14px; font: 700 30px/1.12 var(--mono); letter-spacing: -0.045em; max-width: 780px; }
.wall h1 em { font-style: normal; color: var(--failing); }
.wall .lede { margin-top: 10px; font-size: 15px; color: var(--text2); max-width: 760px; }
.tally { display: flex; gap: 20px; }
.tally div { text-align: right; }
.tally .v { font: 700 26px/1 var(--mono); letter-spacing: -0.04em; }
.tally .k { margin-top: 4px; font: 500 10.5px/1 var(--mono); color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }
.tally { align-items: flex-end; }
.btn { align-self: center; font: 700 12.5px/1 var(--mono); color: #1a1206; background: #ff9a2e; padding: 10px 14px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.tile .tp .sv-n { color: var(--failing); font-weight: 600; }
.detail .sv { margin-top: 8px; font-size: 12px; color: var(--text2); }
.detail .sv b { color: var(--failing); font-weight: 600; }
.tally .fresh .v { color: var(--fresh); } .tally .late .v { color: var(--late); } .tally .failing .v { color: var(--failing); }

.grid { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tile .th { display: flex; justify-content: space-between; gap: 10px; margin: 2px 2px 10px; }
.tile .tn { font: 600 14px/1.25 var(--sans); }
.tile .tp { font: 500 11px/1.4 var(--mono); color: var(--text3); white-space: nowrap; }
.tile .ghost { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; margin-top: 10px; opacity: .55; }
.tile .ghost i { height: 34px; border-radius: 6px; background: linear-gradient(180deg, var(--wall), transparent); border: 1px dashed var(--line); }

.how { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.how div { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--text2); }
.how b { display: block; margin-bottom: 4px; font: 700 11px/1.2 var(--mono); color: var(--text); text-transform: uppercase; letter-spacing: 0.08em; }
.wfoot { margin-top: 20px; font: 500 11px/1.5 var(--mono); color: var(--text3); }
.wfoot .url { color: var(--failing); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }

.error { margin: 12px; padding: 12px; border: 1px solid var(--failing); border-radius: 10px; font: 500 12px/1.4 var(--mono); color: var(--text2); }

@media (max-width: 760px) {
  .wall { padding: 16px; }
  .whead { grid-template-columns: 1fr; }
  .tally div { text-align: left; }
  .how { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
