:root {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #171c26;
  --surface-2: #1f2633;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f6fc;
  --muted: #94a3b8;
  --brand: #f59e0b;
  --ok: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, rgba(245, 158, 11, 0.12) 0, transparent 40%), var(--bg);
  color: var(--text);
}
.shell { max-width: 880px; margin: 0 auto; padding: 28px 16px 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
h1 { margin: 0 0 6px; font-size: 26px; }
h2 { margin: 0 0 6px; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.auth-card { max-width: 440px; }
form { display: grid; gap: 14px; margin-top: 12px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #cbd5e1; }
input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d1017;
  color: var(--text);
  font: inherit;
  outline: none;
}
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16); }
.button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.button:disabled { opacity: 0.55; cursor: wait; }
.primary { background: linear-gradient(135deg, #fbbf24, #d97706); color: #161006; }
.secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-danger { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; min-height: 34px; padding: 0 12px; font-size: 12px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.days-box {
  text-align: center;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.days-box strong { display: block; font-size: 28px; color: var(--brand); line-height: 1.1; }
.days-box span { font-size: 11px; color: #fde68a; }
.progress-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); margin: 16px 0; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); border-radius: 999px; transition: width 250ms ease-out; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.meta-grid strong { display: block; margin-top: 4px; }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.pill-active { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
.pill-muted { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid var(--line); }
.devices-list { display: grid; gap: 10px; }
.device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: #10141d;
  border: 1px solid var(--line);
}
.device-card code { color: #38bdf8; font-size: 12px; word-break: break-all; }
.status { min-height: 18px; margin: 12px 0 0; color: #fca5a5; font-size: 13px; }
.status.ok { color: #86efac; }
@media (max-width: 640px) {
  .meta-grid, .form-grid { grid-template-columns: 1fr; }
}
