:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pace-navy: #00274c;
  --pace-blue: #003a70;
  --pace-cyan: #00b4e5;
  --pace-gold: #ffcb05;
  --pace-deep: #030c1e;
  --pace-panel: rgba(5, 18, 42, .82);
  --pace-panel-strong: rgba(3, 12, 30, .88);
  --pace-border: rgba(0, 180, 229, .3);
  --pace-text: #f8fafc;
  --pace-muted: #cad5e2;
  --pace-subtle: #90a1b9;
  background: var(--pace-deep);
  color: var(--pace-text);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(0, 180, 229, .24), transparent 38%),
    radial-gradient(circle at bottom left, rgba(255, 203, 5, .12), transparent 34%),
    linear-gradient(135deg, var(--pace-deep), var(--pace-navy) 58%, #030a1a);
}
header { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 12px 0 24px; }
main, footer { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 3.15rem; letter-spacing: 0; line-height: .98; margin-left: clamp(0px, 2vw, 26px); max-width: 850px; }
.title-section { display: grid; gap: 18px; }
.title-bar {
  align-items: center;
  background:
    linear-gradient(115deg, rgba(3, 12, 30, .82), rgba(0, 39, 76, .42) 56%, rgba(3, 12, 30, .64)),
    linear-gradient(90deg, rgba(0, 180, 229, .07), transparent 42%);
  border: 1px solid rgba(0, 180, 229, .3);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 50px rgba(0, 0, 0, .18);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 104px;
  overflow: hidden;
  padding: 24px 28px;
  position: relative;
}
.title-bar::after {
  background:
    radial-gradient(circle at 14% 34%, rgba(0, 180, 229, .5) 0 3px, transparent 4px),
    radial-gradient(circle at 33% 53%, rgba(0, 180, 229, .38) 0 3px, transparent 4px),
    radial-gradient(circle at 49% 25%, rgba(0, 180, 229, .4) 0 3px, transparent 4px),
    radial-gradient(circle at 69% 49%, rgba(0, 180, 229, .24) 0 3px, transparent 4px),
    linear-gradient(0deg, transparent 26%, rgba(0, 180, 229, .32) 27% 29%, transparent 30%),
    linear-gradient(0deg, transparent 49%, rgba(0, 180, 229, .22) 50% 52%, transparent 53%),
    linear-gradient(0deg, transparent 72%, rgba(0, 180, 229, .22) 73% 75%, transparent 76%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 36% 100%, 18% 64%, 0 64%);
  content: "";
  height: 90px;
  opacity: .48;
  pointer-events: none;
  position: absolute;
  right: 160px;
  top: 7px;
  width: min(430px, 40vw);
}
.brand-lockup { align-items: center; display: flex; gap: 28px; min-width: 0; position: relative; z-index: 1; }
.brand-mark {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: inline-grid;
  min-height: 54px;
  padding: 0 8px 0 0;
  place-items: center;
  position: relative;
}
.brand-mark::after {
  background: linear-gradient(rgba(0, 180, 229, .1), rgba(0, 180, 229, .78), rgba(0, 180, 229, .1));
  content: "";
  height: 58px;
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
}
.brand-mark img { display: block; filter: brightness(0) invert(1); height: auto; opacity: .93; width: 176px; }
.brand-copy { display: grid; gap: 3px; min-width: 0; }
.brand-name { color: white; font-size: 1rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.brand-tagline { color: #d7e5f3; font-size: .9rem; font-weight: 650; }
.title-meta {
  align-items: center;
  border-bottom: 1px solid rgba(202, 213, 226, .12);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 clamp(0px, 2vw, 26px);
  padding-bottom: 18px;
}
.eyebrow { align-items: center; color: var(--pace-cyan); display: inline-flex; font-weight: 800; gap: 14px; letter-spacing: .14em; text-transform: uppercase; font-size: .82rem; }
.eyebrow::before {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 28 22' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2300b4e5' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M3 8c6-5 16-5 22 0'/%3E%3Cpath d='M7 12c4-3 10-3 14 0'/%3E%3Cpath d='M11 16c2-1.5 4-1.5 6 0'/%3E%3C/g%3E%3Ccircle cx='14' cy='19' r='1.8' fill='%2300b4e5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  height: 18px;
  width: 24px;
}
.halow-radio {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--pace-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .88rem;
  gap: 0;
  letter-spacing: .04em;
  padding: 0;
}
.halow-radio span {
  border-left: 1px solid rgba(202, 213, 226, .22);
  padding: 0 22px;
}
.halow-radio strong { color: white; font-weight: 850; }
.status {
  align-items: center;
  background: rgba(0, 39, 76, .68);
  border: 1px solid rgba(0, 180, 229, .5);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .95rem;
  gap: 10px;
  padding: 13px 18px;
  position: relative;
  z-index: 1;
}
.status::before {
  background: #16a34a;
  border-radius: 50%;
  content: "";
  height: 12px;
  width: 12px;
}
.status.live { background: rgba(0, 180, 229, .14); border-color: var(--pace-cyan); color: white; box-shadow: 0 0 0 3px rgba(0, 180, 229, .08); }
.status.live::before { background: #10b981; box-shadow: 0 0 0 5px rgba(16, 185, 129, .16), 0 0 18px rgba(16, 185, 129, .86); }
.empty, .device-card { border: 1px solid var(--pace-border); background: var(--pace-panel); box-shadow: 0 24px 80px rgba(0,0,0,.24); border-radius: 24px; }
.empty { text-align: center; padding: 70px 20px; color: var(--pace-muted); }
.empty h2 { color: white; margin-bottom: 8px; }
.board-controls {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 0 0 14px;
}
.board-controls label,
.board-count {
  color: var(--pace-subtle);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.board-controls select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--pace-cyan) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--pace-cyan) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    rgba(3, 12, 30, .86);
  border: 1px solid var(--pace-border);
  border-radius: 12px;
  color: white;
  font: inherit;
  font-size: .95rem;
  font-weight: 800;
  min-height: 42px;
  min-width: min(320px, 100%);
  padding: 9px 38px 9px 13px;
}
.board-controls select:disabled {
  color: var(--pace-muted);
  opacity: .86;
}
.devices { display: grid; gap: 20px; padding-bottom: 40px; }
.device-card { padding: clamp(18px, 4vw, 30px); }
.device-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.device-status { display: grid; justify-items: end; gap: 8px; text-align: right; }
.last-seen { color: var(--pace-subtle); font-size: .8rem; }
.sample-state { border: 1px solid var(--pace-border); border-radius: 999px; padding: 6px 10px; color: var(--pace-muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.sample-state.live { background: rgba(0, 180, 229, .18); border-color: var(--pace-cyan); color: white; }
.sample-state.simulated { background: rgba(255, 203, 5, .14); border-color: rgba(255, 203, 5, .6); color: #fff3a8; }
.sample-state.stale, .sample-state.old { background: rgba(202, 213, 226, .08); color: var(--pace-muted); }
.sample-old, .sample-stale { opacity: .78; }
.alerts {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  height: 34px;
  margin: -10px 0 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.alert { border: 1px solid var(--pace-border); border-radius: 999px; padding: 6px 10px; color: var(--pace-muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.alert-warning { background: rgba(255, 203, 5, .16); border-color: rgba(255, 203, 5, .58); color: #fff3a8; }
.alert-info { background: rgba(0, 180, 229, .18); border-color: rgba(0, 180, 229, .65); color: #dff8ff; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric, .accelerometer, .gate-panel { background: var(--pace-panel-strong); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 18px; }
.metric { min-height: 148px; position: relative; }
.metric span, .metric small { display: block; color: var(--pace-subtle); }
.part-number {
  background: rgba(0, 180, 229, .12);
  border: 1px solid rgba(0, 180, 229, .28);
  border-radius: 999px;
  color: var(--pace-cyan);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 4px 7px;
  text-transform: uppercase;
}
.metric .part-number {
  min-height: 1.4rem;
  position: absolute;
  right: 14px;
  top: 14px;
}
.metric strong { display: block; font-size: clamp(1.7rem, 5vw, 2.7rem); margin: 14px 0 1px; }
.metric.light strong { color: var(--pace-gold); }
.accelerometer, .gate-panel { margin-top: 12px; }
.accelerometer-heading, .gate-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.accelerometer-heading h3, .gate-heading h3 { font-size: 1rem; }
.accelerometer-heading .part-number { min-height: 1.4rem; }
.axes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; color: var(--pace-subtle); }
.axes span { background: rgba(0, 39, 76, .55); border-radius: 12px; padding: 12px; }
.axes strong { color: white; }
.gate-readout {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.35fr 1fr 1fr;
}
.gate-readout strong,
.gate-readout span {
  background: rgba(0, 39, 76, .55);
  border-radius: 12px;
  min-height: 48px;
  padding: 12px;
}
.gate-readout strong {
  align-items: center;
  color: white;
  display: flex;
  font-size: 1.4rem;
  text-transform: capitalize;
}
.gate-readout span { color: var(--pace-subtle); }
.gate-readout b { color: white; font-size: 1.15rem; }
.firmware-revision, .revision { color: var(--pace-subtle); font-size: .78rem; }
.firmware-revision { margin-top: 14px; min-height: 1rem; }
.firmware-revision.is-hidden { visibility: hidden; }
.revision { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 0 28px; }
.revision strong { color: var(--pace-muted); }
code { color: var(--pace-cyan); }

@media (max-width: 900px) {
  .title-bar::after { opacity: .28; right: 120px; width: 330px; }
  .brand-mark img { width: 150px; }
  .brand-name { font-size: .92rem; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  h1 { font-size: 2.45rem; line-height: 1.04; }
  .title-bar {
    align-items: flex-start;
    display: grid;
    justify-items: start;
    min-height: 0;
    padding: 18px;
  }
  .title-bar::after { display: none; }
  .brand-lockup { align-items: flex-start; }
  .brand-mark { min-height: 48px; }
  .brand-mark img { width: 132px; }
  .status { font-size: .84rem; padding: 9px 13px; }
  .title-meta { gap: 12px 16px; margin: 0; padding-bottom: 14px; }
  .halow-radio span { padding: 0 14px; }
  .device-heading { display: grid; }
  .device-status { justify-items: start; text-align: left; }
  .board-controls { align-items: stretch; display: grid; justify-content: stretch; }
  .board-controls select { min-width: 0; width: 100%; }
  .axes, .gate-readout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  header, main, footer { width: min(100% - 20px, 1100px); }
  h1 { font-size: 2.05rem; }
  .brand-lockup { display: grid; gap: 10px; }
  .brand-mark::after { display: none; }
  .brand-mark { justify-self: start; }
  .brand-tagline { font-size: .82rem; }
  .title-section { gap: 14px; }
  .title-meta { display: grid; }
  .eyebrow { gap: 10px; }
  .halow-radio { gap: 8px 12px; }
  .halow-radio span { border-left: 0; padding: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metric, .accelerometer, .gate-panel { padding: 16px; }
  .revision { display: grid; }
}
