/* ────────────────────────────────────────────────────────────────────────────
   styles.css — the whole look of the status page.

   Two type families do all the work: IBM Plex Sans for words, IBM Plex Mono for
   anything that is a number or a state. Small uppercase labels above, plain
   black headline, quiet grey underneath. Nothing is decorative — the only
   colour on the page is the blue moving through the lines and the green that
   means "on".
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --ink:        #111318;
  --ink-soft:   #5F6368;
  --ink-faint:  #9AA0A6;
  --line:       #DADCE0;
  --line-soft:  #ECEEF1;
  --paper:      #FFFFFF;
  --ground:     #F6F7F9;
  --flow:       #2563EB;
  --on:         #22C55E;
  --off:        #C7CBD1;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#page {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 26px;
}

/* ── the bar ─────────────────────────────────────────────────────────────── */

#bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex: 0 0 auto;
}
#bar .logo { height: 19px; width: auto; }
#bar .logo-text {
  display: none;
  font-size: 19px; font-weight: 600; letter-spacing: -.01em;
}
#bar .logo-text.show { display: inline; }
#bar .stamp {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

/* ── the stage: boxes by grid, lines by svg on top ───────────────────────── */

#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  /* Rows size to their content and the whole thing is centred, so no box is
     ever stretched into a half-empty rectangle. */
  gap: 34px 52px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(148px, auto);
  align-content: center;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "scheduler avatars   radar   ."
    ".         messaging manager video"
    ".         .         pool    bot";
}

.wires {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.wire {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.wire-faint { stroke: var(--line-soft); stroke-dasharray: 3 4; }
.spark { fill: var(--flow); }
.spark-faint { fill: #B9C6E4; }

/* ── a box ───────────────────────────────────────────────────────────────── */

.block {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.block:hover { border-color: #C2C7CE; box-shadow: 0 2px 14px rgba(17,19,24,.05); }
.block-body { width: 100%; min-width: 0; display: flex; flex-direction: column; }

/* the two boxes the eye should land on first */
.block-accent { border-color: #C6CBD2; }
.block-accent::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 2px; background: var(--flow); border-radius: 0 2px 2px 0;
}
/* the two that are not really ours */
.block-muted { background: #FCFCFD; }
.block-muted .title { color: var(--ink-soft); }

/* ── the text inside a box ───────────────────────────────────────────────── */

.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}
.title {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.012em;
  line-height: 1.2;
}
.title .ic { color: var(--ink-faint); flex: 0 0 auto; }
.block-accent .title .ic { color: var(--flow); }
.rule { height: 1px; background: var(--line-soft); margin: 10px 0 9px; }
.note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-top: auto;
  padding-top: 9px;
}

.stat { display: flex; align-items: baseline; gap: 7px; }
.stat .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 26px; font-weight: 500; letter-spacing: -.02em;
  line-height: 1;
}
.stat .word { font-size: 11px; color: var(--ink-soft); }

.pair {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--ink-soft);
  padding: 2.5px 0;
}
.pair .val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── the account list ────────────────────────────────────────────────────── */

.list-tight { margin-top: 10px; }
.list-tight .row { font-size: 11px; padding: 2.5px 0; }
.list { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 8px;
  padding: 3.5px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}
.row:last-child { border-bottom: none; }
.row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-plat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: .06em;
  color: var(--ink-faint);
  flex: 0 0 auto;
}
.row-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
}
.row-user {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-soft);
  max-width: 45%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 0 0 auto;
}
.row-dim { color: var(--ink-faint); font-size: 10.5px; }
.row-go {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; line-height: 1;
  color: var(--ink-faint); text-decoration: none;
  flex: 0 0 auto; padding: 0 1px;
  transition: color .13s ease;
}
.row-go:hover { color: var(--flow); }
.row-more { color: var(--ink-faint); font-size: 11px; }

.ind { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.ind-on  { background: var(--on); box-shadow: 0 0 0 2.5px rgba(34,197,94,.15); }
.ind-off { background: var(--off); }

.ellipsis { width: 6px; height: 6px; flex: 0 0 auto;
  background: radial-gradient(circle, var(--off) 1px, transparent 1.2px) 0 0/3px 3px; }

/* ── loading ─────────────────────────────────────────────────────────────── */

body.loading #stage { opacity: 0; }
#stage { opacity: 1; transition: opacity .45s ease; }
body.loading::after {
  content: '';
  position: fixed; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid var(--line); border-top-color: var(--ink-faint);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── narrower screens ────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  #stage { gap: 22px 30px; }
  .stat .num { font-size: 22px; }
}

/* On a phone the grid gives up and the boxes stack in story order. The lines
   redraw themselves vertically because they are measured, not hardcoded. */
@media (max-width: 760px) {
  html, body { height: auto; }
  #page { height: auto; padding: 18px 16px 40px; }
  #stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: none;
    gap: 34px;
  }
  .block { grid-area: auto !important; }
  .note { margin-top: 8px; }
}
