:root {
  font-family: system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
body {
  margin: 0;
  background: #f2f3f5;
  color: #1a1a1a;
  display: flex;
  justify-content: center;
}
main {
  width: 100%;
  max-width: 420px;
  padding: 1rem 1rem 2rem;
  box-sizing: border-box;
}
h1 {
  font-size: 1.3rem;
  text-align: center;
  color: #1a1a1a;
  margin: 0.5rem 0 1rem;
}
h2 {
  color: #1a1a1a;
}
.hint {
  font-size: 0.85rem;
  color: #555;
}
.banner {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #1a1a1a;
}
.banner.connected { background: #d4f8d4; }
.banner.disconnected { background: #f8d4d4; }
.card {
  background: #fff;
  color: #1a1a1a;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.row label {
  flex: 1;
  font-size: 0.95rem;
  color: #1a1a1a;
}
input[type="text"], input[type="number"], input[type="password"] {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  font-size: 1rem;
}
button {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #eee;
  color: #1a1a1a;
  cursor: pointer;
  font-size: 0.95rem;
}
button.secondary {
  width: 100%;
  margin-top: 0.5rem;
}
form button[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  background: #2d8cff;
  color: #fff;
  border-color: #2d8cff;
}
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #2d8cff;
  text-decoration: none;
  font-size: 0.9rem;
}
.admin-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  color: #999;
  font-size: 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Remote body --- */
.remote {
  background: linear-gradient(180deg, #3a3d42, #232529);
  border-radius: 28px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.screen {
  background: #0c0d0f;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6);
  font-family: 'Courier New', monospace;
}
.screen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.screen-row-main {
  margin-bottom: 0.6rem;
}
.screen-power {
  color: #66e0a3;
  font-size: 1rem;
  letter-spacing: 0.05em;
}
.screen-speed {
  color: #66e0a3;
  font-size: 2.4rem;
  font-weight: bold;
  line-height: 1;
}
.screen-icons {
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.screen-icon {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
  color: #4a4e54;
  border: 1px solid #2a2d31;
  border-radius: 4px;
  padding: 0.25rem 0;
  letter-spacing: 0.04em;
}
.screen-icon.on {
  color: #66e0a3;
  border-color: #66e0a3;
}
.screen-aq {
  font-size: 0.7rem;
  color: #7a8087;
}
.screen-aq strong {
  color: #c7cbd1;
}

/* --- Button grid --- */
.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.remote-btn {
  background: #4a4d52;
  color: #e8e9eb;
  border: 1px solid #5a5d62;
  border-radius: 12px;
  padding: 0.9rem 0.5rem;
  font-size: 0.85rem;
  min-height: 3rem;
}
.remote-btn.power {
  grid-column: span 1;
  background: #c0392b;
  border-color: #c0392b;
}
.remote-btn.power.on {
  background: #66e0a3;
  border-color: #66e0a3;
  color: #0c0d0f;
}
.remote-btn.on {
  background: #2d8cff;
  border-color: #2d8cff;
  color: #fff;
}
.remote-btn.round {
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.4rem;
  padding: 0;
  justify-self: center;
}
.speed-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8e9eb;
  font-size: 1.3rem;
  font-weight: bold;
}
.sleep-row {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #34373c;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
}
.sleep-row label {
  color: #c7cbd1;
  font-size: 0.8rem;
  flex: 1;
}
.sleep-row input {
  width: 4rem;
  flex: none;
}
.remote-btn.small {
  padding: 0.5rem 0.7rem;
  min-height: auto;
}
.remote .secondary {
  width: 100%;
  background: #2a2d31;
  color: #c7cbd1;
  border-color: #3a3d42;
}

@media (max-width: 380px) {
  .button-grid {
    gap: 0.5rem;
  }
  .remote-btn {
    font-size: 0.78rem;
    padding: 0.75rem 0.4rem;
  }
}
