:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: #274690; }
button, input { font: inherit; }
button { border: 0; border-radius: 10px; padding: .7rem 1rem; background: #274690; color: white; cursor: pointer; }
button.secondary { background: #e8edf7; color: #172033; }
button.danger { background: #a93030; }
button:disabled { opacity: .55; cursor: not-allowed; }
input { width: 100%; margin-top: .35rem; border: 1px solid #cbd4e3; border-radius: 10px; padding: .7rem .8rem; background: white; color: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem max(1rem, calc((100vw - 1100px) / 2)); background: white; border-bottom: 1px solid #e3e8f2; }
.brand { font-weight: 750; text-decoration: none; color: #172033; }
nav { display: flex; gap: 1rem; }
nav a { text-decoration: none; }
.page-shell { width: min(1100px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.page-heading, .section-heading, .row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.panel { background: white; border: 1px solid #e3e8f2; border-radius: 16px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 8px 22px rgba(23, 32, 51, .04); }
.narrow { width: min(520px, 100%); margin: 3rem auto; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: .75rem; }
.grow { flex: 1; }
.metric { font-size: 1.6rem; font-weight: 750; margin: .25rem 0; text-transform: capitalize; }
.muted { color: #68748a; }
.warning { border-left: 4px solid #c57b13; padding: .7rem .9rem; background: #fff8e8; }
.permission { border: 1px solid #e3e8f2; border-radius: 12px; padding: 1rem; }
.device, .user-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid #e3e8f2; border-radius: 12px; padding: .9rem 1rem; }
.device-meta { min-width: 0; }
.device-meta strong, .device-meta span { display: block; overflow-wrap: anywhere; }
.status { width: min(1100px, calc(100% - 2rem)); margin: 1rem auto; border-radius: 12px; padding: .85rem 1rem; background: #eef3ff; }
.status.error { background: #fff0f0; color: #7a1f1f; }
.pair-code { font: 700 1.8rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin-top: 0; }
h2 { margin-top: 0; font-size: 1.1rem; }
@media (max-width: 720px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .page-heading, .section-heading, .row, .device, .user-row { align-items: stretch; flex-direction: column; }
  .topbar { align-items: flex-start; }
  nav { flex-wrap: wrap; }
}
