:root {
  color-scheme: dark;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f131a;
  color: #e4e7eb;
}

body {
  margin: 0;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #16202f 0%, #111924 100%);
  border-bottom: 1px solid #1f2a38;
}

.toolbar h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: #2f80ed;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #2568c4;
}

button:disabled {
  background-color: #3a465a;
  cursor: not-allowed;
}

.baud-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #9ba8c2;
}

.baud-label input {
  width: 6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #253044;
  background-color: #111924;
  color: inherit;
}

.status {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: #253044;
  color: #9ba8c2;
}

.status-connected {
  background-color: #214932;
  color: #8febaf;
}

.status-error {
  background-color: #4b1f1f;
  color: #ff8e8e;
}

.display {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
}

#radar-canvas {
  flex: 0 0 500px;
  max-width: 100%;
  border-radius: 12px;
  background: radial-gradient(circle at bottom, #0f1c2d 0%, #070b12 75%);
  border: 1px solid #1f2a38;
  box-shadow: 0 12px 40px rgba(6, 11, 18, 0.6);
}

.telemetry {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #121a25;
  border-radius: 12px;
  border: 1px solid #1f2a38;
  padding: 1rem 1.25rem;
}

.telemetry h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.telemetry dl {
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.telemetry dl > div {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.telemetry dt {
  color: #8a96ab;
}

.telemetry dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.log h3 {
  margin: 0;
  font-size: 1rem;
}

#log-output {
  flex: 1;
  margin: 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: #0a0f16;
  border: 1px solid #1f2a38;
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-y: auto;
  max-height: 160px;
}

.footer {
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7a95;
  border-top: 1px solid #1f2a38;
}

.footer code {
  background: #101722;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
}

body.radar-fullscreen {
  overflow: hidden;
  background-color: #05070b;
}

body.radar-fullscreen .toolbar,
body.radar-fullscreen .telemetry,
body.radar-fullscreen .footer {
  display: none;
}

body.radar-fullscreen .display {
  padding: 0;
}

body.radar-fullscreen #radar-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

@media (max-width: 1024px) {
  .display {
    flex-direction: column;
    align-items: center;
  }

  .telemetry {
    max-width: none;
    width: 100%;
  }
}
