/* AVL playback — sits on the Daily AVL admin page */
.weekly-report-page:has(.avl-playback) {
  max-width: 1160px;
}

.avl-playback.card {
  padding: 0;
  overflow: hidden;
}

.avl-playback__body {
  padding: 16px 16px 12px;
}

.avl-playback__head h2 {
  margin: 0 0 4px;
}

.avl-playback__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 70ch;
}

.avl-playback__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  margin-top: 14px;
}

.avl-playback__controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.avl-playback__controls label.avl-playback__frame {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--text);
  padding-bottom: 8px;
}

.avl-playback__frame input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #0a84ff;
}

.avl-playback__controls select,
.avl-playback__controls input[type="date"],
.avl-playback__controls input[type="time"] {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--text);
  background: #1c2230;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 11rem;
}

.avl-playback__scrub {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.avl-playback__scrub input[type="range"] {
  flex: 1;
  accent-color: #0a84ff;
  min-width: 0;
}

.avl-playback__clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  white-space: nowrap;
  color: var(--text);
}

.avl-playback__status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.avl-playback__status.is-error {
  color: #ff6b6b;
}

.avl-playback__stage {
  position: relative;
  border-top: 1px solid var(--card-border);
}

.avl-playback__views {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 20, 28, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.avl-playback__views button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d5dbe6;
  font: 600 13px/1 "Segoe UI", system-ui, sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}

.avl-playback__views button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.avl-playback__views button.is-on {
  background: #0a84ff;
  color: #fff;
}

.avl-playback__views.avl-playback__display {
  top: 52px;
  max-width: calc(100% - 72px);
  flex-wrap: wrap;
  overflow: visible;
}

.avl-playback__heat {
  position: absolute;
  z-index: 5;
  top: 96px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 20, 28, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #d5dbe6;
  font: 600 13px/1 "Segoe UI", system-ui, sans-serif;
}

.avl-playback__heat[hidden],
.avl-playback__signal[hidden] {
  display: none;
}

.avl-playback__heat input[type="range"] {
  width: 128px;
  accent-color: #f08a24;
}

.avl-playback__heat:not([hidden]) + .avl-playback__signal {
  top: 142px;
}

.avl-playback__signal {
  position: absolute;
  z-index: 5;
  top: 96px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 20, 28, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #d5dbe6;
  font: 600 12px/1 "Segoe UI", system-ui, sans-serif;
}

.avl-playback__signal span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.avl-playback__signal i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.avl-playback__signal i[data-swatch="full"] { background: #1f9d55; }
.avl-playback__signal i[data-swatch="good"] { background: #8fbf3f; }
.avl-playback__signal i[data-swatch="fair"] { background: #e6c229; }
.avl-playback__signal i[data-swatch="low"] { background: #f08a24; }
.avl-playback__signal i[data-swatch="one"] { background: #e10600; }
.avl-playback__signal i[data-swatch="none"] { background: #8b1e1e; }
.avl-playback__signal i[data-swatch="missing"] { background: #9aa3b2; }

.avl-playback__map {
  height: min(68vh, 720px);
  min-height: 480px;
  background: #10141c;
}

.avl-playback__map .maplibregl-ctrl-group {
  background: #1c2230;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.avl-playback__map .maplibregl-ctrl-group button {
  filter: invert(1) hue-rotate(180deg);
}

.avl-playback__units {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
}

.avl-playback__unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.avl-playback__unit.is-off {
  opacity: 0.4;
}

.avl-playback__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.avl-playback__unit input {
  margin: 0;
}

.avl-pin {
  position: relative;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.avl-pin__dial {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--avl-color, #5ac8fa);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.avl-pin__tick {
  position: absolute;
  left: 50%;
  top: -1px;
  width: 3px;
  height: 11px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.avl-pin img {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  pointer-events: none;
}

.avl-pin__fallback {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avl-color, #5ac8fa);
}

.avl-pin__label {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(12, 16, 24, 0.88);
  color: #fff;
  font: 600 11px/1.3 "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

a.btn[data-avl-playback-link] {
  box-shadow: inset 0 0 0 1px rgba(90, 200, 250, 0.45);
}
