html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

#map,
#map-playback,
#playback-map {
  width: 100%;
  height: 100%;
  background: #f6f7f9;
}

.panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  width: 360px;
  max-width: calc(100% - 28px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.panel h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title-wrap {
  min-width: 0;
}

.header-toggles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.subtitle {
  margin: 2px 0 0;
  color: #4d5965;
  font-size: 12px;
}

.app-links {
  display: flex;
  gap: 8px;
  margin: 2px 0 10px;
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d0d9;
  background: white;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #1f2a35;
  text-decoration: none;
}

.app-link:hover {
  background: #f5f7fa;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stat {
  border-radius: 8px;
  background: #f1f4f7;
  padding: 8px;
}

.stat .k {
  display: block;
  font-size: 10px;
  color: #5d6975;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat .v {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1f2a35;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  font-size: 12px;
  color: #2e3a45;
  user-select: none;
}

.toggle-label input {
  margin: 0;
}

.header-toggle {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  margin-top: 0;
}

.actions {
  margin-bottom: 8px;
}

button {
  border: 1px solid #c7d0d9;
  background: white;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #f5f7fa;
}

.hidden {
  display: none !important;
}

.search-section {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(245, 248, 251, 0.7);
}

.id-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #c7d0d9;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.2;
  color: #1f2a35;
  background: #fff;
}

.search-input:focus-visible {
  outline: 2px solid rgba(11, 99, 197, 0.35);
  outline-offset: 1px;
}

.search-btn {
  flex: 0 0 auto;
}

.mode-btn {
  flex: 1 1 0;
}

.mode-btn.active {
  background: #e8f1fb;
  border-color: #9dbfe0;
  color: #0a4f8f;
  font-weight: 600;
}

.search-row-spaced {
  margin-top: 8px;
}

.playback-speed-select {
  flex: 0 0 72px;
}

.playback-icon-btn {
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
}

.playback-icon {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.playback-slider {
  width: 100%;
  margin-top: 8px;
}

.playback-slider-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.playback-slider-track {
  width: 100%;
}

.playback-slider-marks {
  position: relative;
  width: 100%;
  height: 76px;
  margin-top: 4px;
  overflow: hidden;
}

.playback-slider-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.playback-slider-mark-line {
  width: 1px;
  height: 8px;
  background: rgba(56, 65, 74, 0.7);
}

.playback-slider-mark-label {
  font-size: 10px;
  color: #5f6c79;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.id-search-feedback {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #1f2a35;
}

.id-search-feedback.error {
  color: #a52a2a;
}

.playback-status-card {
  margin-top: 2px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
}

.playback-status-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.playback-cell-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  flex: 0 0 10px;
}

.playback-status-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2a35;
}

.playback-status-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.playback-status-grid .k {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5f6c79;
}

.playback-status-grid .v {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2a35;
  overflow-wrap: anywhere;
}

.playback-status-time {
  margin-top: 7px;
  font-size: 11px;
  color: #5f6c79;
}

.accuracy-filter-section {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(245, 248, 251, 0.7);
}

.accuracy-filter-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #2f3b46;
}

#accuracy-filter-input {
  width: 100%;
}

.cell-details-section,
.tower-cells-section {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(245, 248, 251, 0.7);
}

.cell-details-section h2,
.tower-cells-section h2 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6c79;
}

.cell-details-section h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cell-details-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
}

.cell-details-body {
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
}

.cell-detail-line {
  font-size: 12px;
  line-height: 1.45;
  color: #1f2a35;
  margin-top: 4px;
}

.cell-detail-value {
  font-weight: 700;
}

.tower-id-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: #0b63c5;
  text-decoration: underline;
  cursor: pointer;
}

.tower-id-link:hover {
  color: #084d98;
}

.tower-id-link:focus-visible {
  outline: 2px solid rgba(11, 99, 197, 0.35);
  outline-offset: 2px;
  border-radius: 2px;
}

.cell-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.cell-detail-k {
  font-size: 11px;
  color: #5f6c79;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cell-detail-v {
  font-size: 12px;
  font-weight: 700;
  color: #1f2a35;
  text-align: right;
}

.cell-details-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
}

.dbm-legend {
  margin-top: 8px;
  width: 100%;
}

.dbm-legend-bar {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(90deg, #000000 0%, #4a5360 100%);
}

.dbm-legend-ticks {
  position: relative;
  margin-top: 4px;
  height: 18px;
}

.dbm-legend-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
}

.dbm-legend-tick.start {
  transform: translateX(0);
}

.dbm-legend-tick.end {
  transform: translateX(-100%);
}

.dbm-legend-tick-line {
  width: 1px;
  height: 6px;
  background: rgba(56, 65, 74, 0.65);
  margin: 0 auto 1px;
}

.dbm-legend-tick-label {
  display: block;
  font-size: 10px;
  line-height: 1;
  color: #5f6c79;
  white-space: nowrap;
}

.tower-cells-list {
  display: block;
  max-height: 110px;
  overflow: auto;
}

.tower-details-body {
  margin: 0 0 6px;
}

.tower-cells-label {
  font-size: 12px;
  line-height: 1.45;
  color: #1f2a35;
  margin: 4px 0;
}

.tower-cell-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(60, 70, 80, 0.9);
}

.tower-cell-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  margin-left: 2px;
}

.tower-cell-dot.placeholder {
  background: transparent;
}

.tower-cell-text {
  white-space: nowrap;
}

.tower-cell-item.has-events .tower-cell-text {
  font-weight: 700;
}

.tower-cell-item.selectable {
  cursor: pointer;
}

.tower-cell-item.selectable:hover .tower-cell-text {
  text-decoration: underline;
}

.tower-cell-item.selectable:focus-visible {
  outline: 2px solid rgba(11, 99, 197, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.tower-cross {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: rgba(16, 24, 32, 0.75);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease, box-shadow 120ms ease, color 120ms ease, border-color 120ms ease,
    background 120ms ease;
}

.tower-cross-glyph {
  position: relative;
  width: 8px;
  height: 8px;
  display: block;
}

.tower-cross-glyph::before,
.tower-cross-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.8px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.tower-cross-glyph::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.tower-cross-glyph::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.tower-cross.has-events {
  color: rgba(10, 18, 26, 0.86);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.24);
}

.tower-cross.no-events {
  color: rgba(42, 52, 64, 0.42);
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(0, 0, 0, 0.12);
  transform: scale(0.88);
  transform-origin: center center;
}

.tower-cross.no-events .tower-cross-glyph::before,
.tower-cross.no-events .tower-cross-glyph::after {
  width: 1.5px;
  height: 8px;
}

.tower-cross.selected {
  color: rgba(0, 0, 0, 0.96);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.46);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 2px 7px rgba(0, 0, 0, 0.28);
  transform: scale(1.08);
}
