* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  background: #0b1220;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #0f1b34;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar__left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { font-weight: 700; color: #e2e8f0; letter-spacing: 0.3px; }

.device { display: flex; align-items: center; gap: 8px; }
.device__label { font-size: 12px; color: rgba(226,232,240,0.8); }
.device__input {
  width: 320px;
  max-width: 72vw;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(2,6,23,0.35);
  color: #e2e8f0;
}

.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(2,6,23,0.35);
  color: #e2e8f0;
  cursor: pointer;
}
.btn:hover { background: rgba(2,6,23,0.55); }
.btn--primary {
  border-color: rgba(99,102,241,0.7);
  background: rgba(99,102,241,0.18);
}

.main { padding: 14px; }

.online {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.online__title { font-weight: 700; color: #e2e8f0; }
.online__list { color: rgba(226,232,240,0.85); }

.timeline {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: auto;
}

.timeline__header {
  display: grid;
  grid-template-columns: 240px minmax(900px, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.timeline__col--scale {
  color: rgba(226,232,240,0.75);
  font-size: 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.timeline__col--scale > div { text-align: center; }

.timeline__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

.row {
  display: grid;
  grid-template-columns: 240px minmax(900px, 1fr);
  gap: 10px;
  align-items: center;
}

.namecell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reorder {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(2,6,23,0.35);
  color: rgba(226,232,240,0.9);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.avatarname {
  font-size: 12px;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.avatarname:hover { text-decoration: underline; }

.track {
  position: relative;
  height: 16px;
  background: rgba(148,163,184,0.35);
  border-radius: 10px;
  overflow: hidden;
}
.track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(255,255,255,0.08) 0,
      rgba(255,255,255,0.08) 1px,
      transparent 1px,
      transparent calc(100% / 56)
    ),
    repeating-linear-gradient(
      to right,
      rgba(255,255,255,0.14) 0,
      rgba(255,255,255,0.14) 2px,
      transparent 2px,
      transparent calc(100% / 7)
    );
  pointer-events: none;
}
.track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(203,213,225,0.55);
}

.segment {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  border-radius: 999px;
  opacity: 0.95;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
}
.modal[aria-hidden="false"] { display: block; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,0.72);
}
.modal__panel {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  background: #0f1b34;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: auto;
  color: #e2e8f0;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal__title { font-weight: 700; }
.modal__close {
  border: 0;
  background: transparent;
  color: rgba(226,232,240,0.9);
  font-size: 20px;
  cursor: pointer;
}
.modal__body { padding: 12px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: 12px; color: rgba(226,232,240,0.8); }
.list { margin: 0; padding-left: 18px; }
.error { color: #fecaca; }
