:root {
  color-scheme: dark;
  --bg: #090b0c;
  --panel: #13171a;
  --panel-soft: #191f22;
  --text: #f4f6f2;
  --muted: #9da7a1;
  --line: #2a3237;
  --green: #b8f36b;
  --green-dark: #172410;
  --danger: #ff8c82;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 12% 6%, rgba(184,243,107,.11), transparent 30rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: .8rem; }

.shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.card { border: 1px solid var(--line); border-radius: 24px; background: rgba(19,23,26,.96); box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.compact { width: min(100%, 520px); padding: clamp(28px, 6vw, 52px); }
.brand { font-size: 1.05rem; font-weight: 850; letter-spacing: -.03em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.signal { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(184,243,107,.09); }
h1 { margin: 22px 0 14px; font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin: 7px 0 12px; font-size: 1.35rem; letter-spacing: -.025em; }
.intro { margin: 0 0 32px; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

.form-stack { display: grid; gap: 17px; }
label > span { display: block; margin-bottom: 7px; color: #cbd2ce; font-size: .82rem; font-weight: 700; }
input { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #0d1012; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(184,243,107,.11); }
small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.4; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 12px; color: #0a0d0b; background: var(--green); cursor: pointer; font-weight: 850; transition: transform .14s ease, filter .14s ease; }
.primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.04); }
.primary:focus-visible, .ghost:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.primary:disabled { cursor: not-allowed; filter: saturate(.1); opacity: .4; }
.form-error { margin: 0; color: var(--danger); font-size: .88rem; line-height: 1.45; }

.dashboard { width: min(100%, 1060px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 0 4px; }
.account-actions { display: flex; align-items: center; gap: 14px; }
.account-email { color: var(--muted); font-size: .85rem; }
.ghost { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: clamp(28px, 5vw, 50px); }
.hero h1 { max-width: 650px; }
.hero .intro { margin-bottom: 0; }
.entitlement { min-width: 165px; padding: 18px; border: 1px solid rgba(184,243,107,.25); border-radius: 15px; color: var(--green); background: var(--green-dark); }
.entitlement strong, .entitlement > span:last-child { display: block; }
.entitlement strong { margin: 4px 0; font-size: 1.2rem; }
.entitlement > span:last-child { font-size: .8rem; opacity: .8; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 25px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.label, .status-label { display: block; color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.badge { padding: 7px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.badge.online { color: var(--green); background: var(--green-dark); }
.badge.offline, .badge.checking { color: #c9d0cc; background: #252c30; }
.facts { margin: 22px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 720; text-transform: capitalize; }
.command-card { display: flex; flex-direction: column; }
.command-button { width: 100%; margin-top: auto; }
.status-panel { min-height: 94px; margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.status-panel strong, .status-panel > span:last-child { display: block; }
.status-panel strong { margin-top: 4px; }
.status-panel > span:last-child { margin-top: 6px; color: var(--muted); font-size: .88rem; line-height: 1.45; }

@media (max-width: 760px) {
  .hero { align-items: stretch; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .topbar, .account-actions { align-items: flex-start; }
  .account-actions { flex-direction: column; gap: 7px; }
}

.pairing-form { display: grid; gap: 13px; margin-top: 22px; }
.pairing-form input {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.device-online-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(184,243,107,.22);
  border-radius: 13px;
  background: var(--green-dark);
}
.device-online-row strong { display: block; margin-top: 5px; }
.device-list { display: grid; gap: 10px; margin-top: 22px; }
.device-online-row { margin-top: 0; }
.device-actions { display: flex; align-items: center; gap: 8px; }
.device-select, .danger { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #101416; cursor: pointer; }
.device-select.active { border-color: var(--green); color: var(--green); }
.danger { color: var(--danger); }
.activity-card { margin-top: 18px; }
.activity-list { display: grid; gap: 0; margin-top: 10px; }
.activity-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-row strong { text-transform: capitalize; }
.activity-row time, .activity-row span { color: var(--muted); font-size: .82rem; }
.activity-row time { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
