:root {
  --bg: #0f172a;
  --panel-bg: #020617;
  --card-bg: #0b1120;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --border: rgba(148, 163, 184, 0.3);
  --radius: 16px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, #1f2937, var(--bg));
  color: var(--text-light);
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 2500px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.title-block h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.8rem;
}

.title-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.subtitle {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.sensor-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

select {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
}

#status {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.grid {
  display: grid;
  margin-top: 1.5rem;
  gap: 1.5rem;
}

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

.card {
  background: var(--card-bg);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card h2 {
  font-size: 1.1rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.imgwrap {
  background: #0003;
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding: 0.2rem;
}

.imgwrap img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer {
  margin-top: 1.5rem;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}
