:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1d2630;
  --subtle: #6a7787;
  --accent: #00755e;
  --border: #dde5ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #eef3fa 0%, #f7fafc 50%, #ebf3f5 100%);
}

.page {
  min-height: 100vh;
  padding: 1rem;
}

header {
  margin-bottom: 1rem;
}

h1 {
  margin: 0;
}

header p {
  margin: 0.25rem 0 0;
  color: var(--subtle);
}

.content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
}

#map {
  min-height: 70vh;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #dbe8f4;
}

aside {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(27, 38, 49, 0.08);
}

aside h2 {
  margin-top: 0;
}

.device-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.device-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.device-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.actions button:last-child {
  grid-column: 1 / -1;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  cursor: pointer;
  color: #ffffff;
  background: var(--accent);
}

button.ghost {
  color: var(--text);
  background: #edf2f7;
}

#device-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

#device-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  line-height: 1.35;
}

.hint {
  margin-top: 1rem;
  color: var(--subtle);
  font-size: 0.9rem;
}

.status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.status[data-state="error"] {
  color: #b42318;
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }

  #map {
    min-height: 55vh;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .actions button:last-child {
    grid-column: auto;
  }
}
