@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/archivo-700.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/poppins-300.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/work-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/work-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/work-sans-600.woff2") format("woff2");
}

:root {
  --bg: #f1f1f1;
  --ink: #1e1e1f;
  --ink-soft: #1e1e1e;
  --text: #7a7a7a;
  --muted: #7a7a7a;
  --button: #ebebeb;
  --button-text: #707070;
  --button-on: #1e1e1f;
  --button-on-text: #ffffff;
  --track: #ebebeb;
  --track-on-bar: rgba(30, 30, 31, 0.14);
  --glass: rgba(255, 255, 255, 0.48);
  --glass-blur: 28px;
  --panel: var(--glass);
  --accent: #331768;
  --violet: #331768;
  --lavender: #949ad0;
  --ash: #a88f9d;
  --red: #e1523b;
  --radio: #331768;
  --radio-hot: #e1523b;
  --edge: #949ad0;
  --cloud: #a88f9d;
  --cloud-other: #7d7380;
  --user: #1e1e1f;
  --user-stroke: #1e1e1f;
  --drop: #e1523b;
  --handover: #ffffff;
  --offload-pulse: #331768;
  --return-pulse: #949ad0;
  --link-good: #949ad0;
  --link-mid: #a88f9d;
  --link-poor: #e1523b;
  --xr: #949ad0;
  --ai: #331768;
  --voice: #a88f9d;
  --radius-radio: 36;
  --radius-edge: 9;
  --radius-cloud: 42;
  --radius-user: 5;
  --font: "Work Sans", "Segoe UI", sans-serif;
  --font-head: "Poppins", "Segoe UI", sans-serif;
  --mono: "Work Sans", "Segoe UI", sans-serif;
  --page-pad: 32px;
  --topbar-h: 88px;
  --layout-stack: 0;
  --radius-card: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

html:has(body.page-demo),
body.page-demo {
  height: 100%;
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 8;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--page-pad);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 18px;
  text-decoration: none;
  color: inherit;
  pointer-events: auto;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 1em;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 1.22em;
  width: auto;
}

.graph {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.map {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
}

#plane {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: default;
  touch-action: none;
}

#plane.is-hot {
  cursor: pointer;
}

#plane:focus {
  outline: none;
}

.facts {
  position: absolute;
  top: calc(var(--topbar-h) + 16px);
  right: var(--page-pad);
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: min(360px, 100%);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-card);
  padding: 12px 12px 14px 18px;
  overflow: hidden;
  max-height: calc(100% - var(--topbar-h) - 32px);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  cursor: default;
  user-select: none;
  box-shadow: 0 10px 40px rgba(30, 30, 31, 0.06);
  gap: 14px;
  transition:
    padding 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.facts.is-collapsed {
  padding-bottom: 12px;
  gap: 0;
}

@media (max-width: 960px) {
  :root {
    --layout-stack: 1;
    --page-pad: 20px;
  }

  html:has(body.page-demo),
  body.page-demo,
  body.page-demo #app {
    height: 100%;
    height: 100svh;
  }

  body.page-demo .stage {
    display: flex;
    flex-direction: column;
  }

  body.page-demo .topbar {
    position: relative;
    flex: 0 0 var(--topbar-h);
    order: 0;
  }

  body.page-demo .facts {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    order: 1;
    flex: 0 1 auto;
    align-self: stretch;
    width: auto;
    max-width: none;
    min-width: 0;
    min-height: 0;
    margin: 12px var(--page-pad);
    max-height: 42vh;
    z-index: 6;
  }

  body.page-demo .facts:not(.is-expanded) {
    padding-bottom: 12px;
    gap: 0;
  }

  body.page-demo .facts:not(.is-expanded) .facts-body {
    grid-template-rows: 0fr;
    flex: 0 0 auto;
  }

  body.page-demo .facts:not(.is-expanded) .facts-collapse svg {
    transform: rotate(0deg);
  }

  body.page-demo .facts:not(.is-expanded) #facts {
    overflow: hidden;
  }

  body.page-demo .graph {
    order: 2;
    flex: 1 1 0;
    min-height: 0;
    height: auto;
  }
}

.facts button,
.facts select,
.facts input {
  cursor: pointer;
  user-select: auto;
}

.facts-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 26px;
}

.facts-heading {
  display: flex;
  align-items: baseline;
  gap: 0.65em;
  flex: 1 1 auto;
  min-width: 0;
}

.facts-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--ink);
}

.facts-family {
  margin: 0;
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--muted);
}

.facts-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

.facts-body {
  display: grid;
  grid-template-rows: 1fr;
  min-height: 0;
  flex: 1 1 auto;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.facts.is-collapsed .facts-body {
  grid-template-rows: 0fr;
  flex: 0 0 auto;
}

.facts.is-expanded .facts-body {
  grid-template-rows: 1fr;
}

#facts {
  min-height: 0;
  overflow: hidden;
}

.facts:not(.is-collapsed) #facts {
  overflow-y: auto;
}

.facts-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--button);
  border: 0;
  border-radius: 999px;
  color: var(--button-text);
  cursor: pointer;
}

.facts-collapse:hover {
  background: #e2e2e2;
}

.facts-collapse svg {
  display: block;
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.facts.is-collapsed .facts-collapse svg {
  transform: rotate(0deg);
}

.facts.is-expanded .facts-collapse svg {
  transform: rotate(180deg);
}

.fact-rule {
  border: 0;
  height: 0;
  border-top: 1px solid rgba(174, 174, 174, 0.35);
  margin: 12px 0;
}

.fact {
  margin: 0 0 10px;
}

.fact-label,
.spark-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spark-wrap .spark-title {
  margin: 0 0 6px;
}

.queue-pick {
  position: relative;
  display: flex;
  gap: 0;
  margin: 0 0 10px;
  padding: 0;
  background: var(--button);
  border-radius: 999px;
  overflow: hidden;
}

.queue-pick::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% / 3);
  border-radius: 999px;
  background: var(--button-on);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.queue-pick:has(button[data-queue="1"].active)::before {
  transform: translateX(100%);
}

.queue-pick:has(button[data-queue="2"].active)::before {
  transform: translateX(200%);
}

.queue-pick button {
  position: relative;
  z-index: 1;
  flex: 1;
  background: transparent;
  color: var(--button-text);
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  transition: color 0.22s ease, background-color 0.22s ease;
}

.queue-pick button:hover:not(.active) {
  background: rgba(30, 30, 31, 0.08);
}

.queue-pick button.active {
  background: transparent;
  color: var(--button-on-text);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .queue-pick::before,
  .queue-pick button,
  .scene-nav button,
  .dots button,
  .transport button,
  .chrome,
  .chrome-toggle svg,
  .speed-menu,
  .speed-menu::before,
  .speed-menu button,
  .map-legend,
  .explain-tip,
  .card,
  .tooltip {
    transition: none;
  }

  .legend-cycle-radio,
  .legend-cycle-link {
    animation: none;
  }
}

.fact-value {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.num {
  display: inline-block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  box-sizing: content-box;
  color: var(--ink);
}

.num.d0 {
  min-width: 4ch;
}

.num.d1 {
  min-width: 7ch;
}

.num.d2 {
  min-width: 7ch;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.score-cell {
  text-align: center;
}

.score-dial {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 6px auto 2px;
}

.score-dial svg {
  display: block;
  width: 100%;
  height: 100%;
}

.score-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 2.8;
}

.score-arc {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
}

.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 600;
}

.weights {
  display: flex;
  width: 100%;
  gap: 3px;
}

.weights .dot,
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.weights > span {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
}

.weights .num {
  min-width: 4.6ch;
}

.spark-wrap {
  margin: 6px 0 10px;
}

.spark-wrap.is-waiting {
  opacity: 0.45;
}

.spark-stage {
  position: relative;
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  align-items: stretch;
  column-gap: 6px;
}

.spark-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 6px 0 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
}

.spark-plot {
  position: relative;
  min-width: 0;
}

.spark {
  width: 100%;
  height: 80px;
  display: block;
}

.spark-empty {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.spark-wrap.is-waiting .spark-empty {
  display: flex;
}

.spark-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.spark-key::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 1.5px solid var(--spark, var(--ink));
  margin-right: 6px;
  vertical-align: middle;
}

.spark-key.dashed::before {
  border-top-style: dashed;
  border-top-color: var(--spark, var(--ink));
}

.spark-unit {
  margin-left: auto;
}

.legend,
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend i,
.map-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.legend i.is-light,
.map-legend i.is-light {
  box-shadow: inset 0 0 0 1px rgba(30, 30, 31, 0.22);
  outline: 1px solid rgba(30, 30, 31, 0.16);
}

.legend-cycle-radio,
.legend-cycle-link {
  animation-duration: 3.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.legend-cycle-radio {
  background: var(--radio);
  animation-name: legend-radio;
}

.legend-cycle-link {
  background: var(--link-poor);
  animation-name: legend-link;
}

@keyframes legend-radio {
  0%,
  100% {
    background-color: var(--radio);
  }
  50% {
    background-color: var(--radio-hot);
  }
}

@keyframes legend-link {
  0%,
  100% {
    background-color: var(--link-poor);
  }
  50% {
    background-color: var(--link-good);
  }
}

.legend-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  height: 26px;
  gap: 3px;
  background: var(--button);
  border: 0;
  border-radius: 999px;
  padding: 0 7px;
  cursor: pointer;
}

.legend-btn i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-btn:hover,
.legend-btn.is-open {
  background: #e2e2e2;
}

.map-legend {
  position: fixed;
  z-index: 22;
  flex-direction: column;
  flex-wrap: nowrap;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  font-size: 0.72rem;
  line-height: 1.35;
  gap: 5px;
  max-width: 280px;
  min-width: 220px;
  box-shadow: 0 10px 32px rgba(30, 30, 31, 0.08);
  user-select: none;
  color: var(--text);
  transform-origin: 100% 0;
  transform: translateY(-8px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.2s ease;
}

.map-legend.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.map-legend.is-pinned {
  cursor: default;
}

.map-legend h3 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.map-legend.is-pinned h3 {
  margin-right: 48px;
}

.map-legend:not(.is-pinned) .card-tools {
  display: none;
}

.cards {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.card,
.tooltip {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: var(--text);
  border-radius: var(--radius-card);
  padding: 12px 14px 14px;
  width: 300px;
  max-height: calc(100vh - 16px);
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 10px 32px rgba(30, 30, 31, 0.08);
  transform-origin: 0 0;
  transform: translateY(-8px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.2s ease;
}

.card.is-open,
.tooltip.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.card {
  pointer-events: none;
  position: absolute;
  cursor: default;
  user-select: none;
}

.card.is-open {
  pointer-events: auto;
}

.card.session-end {
  border: 1px solid var(--violet);
}

.card h3,
.tooltip h3 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.card h3 {
  margin-right: 48px;
}

.card-tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 0;
}

.card .body,
.tooltip .body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-tools .close,
.card-tools .reattach {
  position: static;
  background: transparent;
  color: var(--muted);
  border: 0;
  cursor: pointer;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-tools .close svg,
.card-tools .reattach svg {
  width: 14px;
  height: 14px;
  display: block;
}

.card-tools .reattach:hover,
.card-tools .close:hover {
  color: var(--ink);
}

.card-tools .reattach[hidden] {
  display: none;
}

.chrome-dock {
  position: absolute;
  left: 50%;
  bottom: var(--page-pad);
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 2 * var(--page-pad));
}

.chrome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.chrome-dock.is-visible .chrome {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.chrome-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--button);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(30, 30, 31, 0.18);
  cursor: pointer;
}

.chrome-toggle:hover {
  background: #e2e2e2;
}

.chrome-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chrome-dock.is-open .chrome-toggle svg {
  transform: none;
}

@media (max-width: 960px), (hover: none) and (pointer: coarse) {
  .chrome-dock {
    position: absolute;
    left: 50%;
    bottom: calc(var(--page-pad) + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 5;
    width: max-content;
    max-width: calc(100% - 2 * var(--page-pad));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    pointer-events: none;
  }

  .chrome-toggle {
    display: inline-flex;
    pointer-events: auto;
  }

  .chrome,
  .chrome-dock.is-visible .chrome {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.92);
    transform-origin: 50% 100%;
    pointer-events: none;
  }

  .chrome-dock.is-open .chrome {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
}

.scene-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 6px;
  background: var(--button);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(30, 30, 31, 0.18);
}

.scene-nav button {
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 28px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.scene-nav button:hover {
  background: rgba(30, 30, 31, 0.06);
}

.scene-nav button:active {
  background: rgba(30, 30, 31, 0.12);
  transform: scale(0.9);
}

.dots {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dot-group {
  display: flex;
  gap: 8px;
}

.dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #cfcfcf;
  cursor: pointer;
  transition:
    background-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.15s ease;
}

.dots button:hover {
  background: #8f8f8f;
}

.dots button.active {
  background: var(--ink);
}

.dots button.active:hover {
  background: #000;
}

.dots button.is-jepa {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #cfcfcf;
}

.dots button.is-jepa:hover {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #8f8f8f;
}

.dots button.is-jepa.active {
  background: var(--ink);
  box-shadow: none;
}

.dots button.is-jepa.active:hover {
  background: #000;
}

.dots button:active {
  transform: scale(0.82);
}

.transport {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 6px;
  background: var(--button);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(30, 30, 31, 0.18);
}

.transport button {
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.transport button:hover {
  background: rgba(30, 30, 31, 0.06);
}

.transport button:active {
  background: rgba(30, 30, 31, 0.12);
  transform: scale(0.9);
}

.transport .icon-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: none;
}

.icon-btn .icon-play {
  display: block;
}

.icon-btn.is-playing .icon-play {
  display: none;
}

.icon-btn.is-playing .icon-pause {
  display: block;
}

.speed {
  position: relative;
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 32px;
  min-width: 36px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.speed::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: 52px;
  height: 8px;
}

.transport .speed-btn {
  display: block;
  width: 36px;
  height: 32px;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.speed-menu {
  --speed-pad: 3px;
  --speed-btn-h: 26px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: var(--speed-pad);
  min-width: 52px;
  padding: var(--speed-pad);
  background: var(--button);
  border-radius: calc(var(--speed-btn-h) / 2 + var(--speed-pad));
  box-shadow: 0 8px 28px rgba(30, 30, 31, 0.18);
  transform-origin: 50% 100%;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 6;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.2s ease;
}

.speed:hover .speed-menu,
.speed:focus-within .speed-menu,
.speed-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.speed:hover .speed-menu::after,
.speed:focus-within .speed-menu::after,
.speed-menu.is-open::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

.speed-menu::before {
  content: "";
  position: absolute;
  top: var(--speed-pad);
  left: var(--speed-pad);
  right: var(--speed-pad);
  height: var(--speed-btn-h);
  border-radius: calc(var(--speed-btn-h) / 2);
  background: var(--button-on);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.speed-menu:has([data-speed="1"].active)::before {
  transform: translateY(calc(100% + var(--speed-pad)));
}

.speed-menu:has([data-speed="4"].active)::before {
  transform: translateY(calc(200% + 2 * var(--speed-pad)));
}

.speed-menu:has([data-speed="16"].active)::before {
  transform: translateY(calc(300% + 3 * var(--speed-pad)));
}

.speed-menu button {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  height: var(--speed-btn-h);
  border: 0;
  background: transparent;
  border-radius: calc(var(--speed-btn-h) / 2);
  padding: 0 8px;
  font: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--button-text);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.22s ease,
    background-color 0.22s ease,
    transform 0.15s ease;
}

.transport .speed-menu button:hover {
  background: transparent;
}

.speed-menu button:hover:not(.active) {
  background: rgba(30, 30, 31, 0.08);
}

.speed-menu button.active {
  color: var(--button-on-text);
}

.speed-menu button:active {
  transform: scale(0.94);
}

.timeline-wrap {
  position: relative;
  flex: 1 1 80px;
  width: auto;
  min-width: 0;
  max-width: 240px;
  height: 22px;
  display: flex;
  align-items: center;
}

.timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 4px;
  background: var(--track-on-bar);
  pointer-events: none;
}

.forecast-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(148, 154, 208, 0.45);
  border-radius: 4px;
}

#timeline {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  accent-color: var(--ink-soft);
}

#timeline::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
  border: 0;
}

#timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--ink-soft);
  cursor: pointer;
  box-shadow: none;
}

#timeline::-moz-range-track {
  height: 8px;
  background: transparent;
  border: 0;
}

#timeline::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--ink-soft);
  cursor: pointer;
}

.forecast-tip,
.explain-tip {
  position: fixed;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-card);
  font-size: 0.88rem;
  line-height: 1.4;
  pointer-events: none;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(30, 30, 31, 0.08);
}

.forecast-tip {
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 6px));
}

.explain-tip {
  max-width: 300px;
  white-space: normal;
  color: var(--ink);
  transform-origin: 50% 100%;
  transform: translateY(8px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.2s ease;
}

.explain-tip.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.explain-tip.is-below {
  transform-origin: 50% 0;
  transform: translateY(-8px) scale(0.92);
}

.explain-tip.is-below.is-open {
  transform: translateY(0) scale(1);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 2px 0 6px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bar-stack {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  row-gap: 3px;
}

.bar-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  text-align: left;
  color: var(--ink);
}

.bar-track {
  height: 8px;
  background: #d0d0d0;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
}

.bar-fill.slice-0,
.ratio-seg.slice-0 {
  background: var(--xr);
}

.bar-fill.slice-1,
.ratio-seg.slice-1 {
  background: var(--ai);
}

.bar-fill.slice-2,
.ratio-seg.slice-2 {
  background: var(--voice);
}

.ratio-bar {
  display: flex;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  background: #d0d0d0;
}

.ratio-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
}

.ratio-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.offload-track {
  position: relative;
  height: 12px;
  background: #d0d0d0;
  border-radius: 999px;
  overflow: hidden;
}

.offload-eff {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--violet);
  opacity: 0.85;
  border-radius: 999px;
}

.offload-pend {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  max-width: calc(100% - 4px);
  border-radius: 999px;
  background: #e6e6e6;
}

.pair-caption {
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.pair-side {
  flex: 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3em;
  min-width: 0;
}

.pair-side .num {
  min-width: 0;
}

.pair-dot {
  flex: 0 0 auto;
  width: 0.28em;
  height: 0.28em;
  margin: 0 0.15em;
  border-radius: 50%;
  background: currentColor;
}

.card .fact-value,
.tooltip .fact-value {
  padding-left: 3ch;
}

.card .bar-num,
.tooltip .bar-num {
  min-width: 0;
}

.card .fact-value .num,
.tooltip .fact-value .num {
  min-width: 0;
  text-align: left;
}

.clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  position: relative;
  width: auto;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.78rem;
}

.clock-sizer {
  visibility: hidden;
  pointer-events: none;
}

.clock-value {
  position: absolute;
  inset: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 15;
}
