:root {
  --bg: #0f1318;
  --panel: #1a232d;
  --panel-2: #202c38;
  --line: #3b4b5e;
  --text: #e6eef6;
  --muted: #a3b2c2;
  --accent: #4cc9f0;
  --danger: #ff6b6b;
  --warn: #ffbf69;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#app {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100vh;
}

#controls {
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-right: 1px solid var(--line);
  padding: 12px;
}

#map {
  position: relative;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: rgba(10, 14, 19, 0.2);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.checkbox {
  justify-content: space-between;
  flex-wrap: wrap;
}

label {
  font-size: 0.82rem;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
select,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1821;
  color: var(--text);
  padding: 6px 8px;
  font-size: 0.83rem;
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
}

input[type="range"] {
  width: 100%;
}

button {
  cursor: pointer;
  transition: border-color 0.2s ease;
}

button:hover {
  border-color: var(--accent);
}

.meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

#time-label {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.82rem;
}

.scrubber {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}

.timeline {
  position: relative;
  width: 100%;
  border-radius: 6px;
  background: #0c131b;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}

.timeline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.timeline-overview {
  height: 16px;
}

.timeline-fine {
  height: 20px;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #245981, #4cc9f0);
  opacity: 0.55;
  pointer-events: none;
}

.timeline-window {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 0%;
  border-left: 1px solid #b6d6ef;
  border-right: 1px solid #b6d6ef;
  background: rgba(182, 214, 239, 0.14);
  pointer-events: none;
}

.timeline-head {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  left: 0%;
  background: #f4fbff;
  pointer-events: none;
}

.timeline-help {
  font-size: 0.72rem;
  color: var(--muted);
}

.event-log {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 0.76rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.event-log button.event-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.event-item.ca {
  border-color: var(--danger);
}

.event-item.mci {
  border-color: var(--warn);
}

.event-item.ident {
  border-color: #79d7a1;
}

@media (max-width: 1080px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 52vh 48vh;
  }

  #controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
