:root {
  color-scheme: light;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: #142f42;
  background: #eef4f8;
  font-size: 16px;
  font-synthesis: none;
  --navy: #0d2b41;
  --muted: #506779;
  --line: #dce6ed;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
p, h1, h2 { margin: 0; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); line-height: 1.13; letter-spacing: -.032em; }
h2 { font-size: 1.17rem; line-height: 1.3; letter-spacing: -.015em; }
p { line-height: 1.55; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #e29534;
  outline-offset: 3px;
}

.header {
  padding: env(safe-area-inset-top) max(1.125rem, env(safe-area-inset-right)) 0 max(1.125rem, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(100%, 67rem);
  min-height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  flex: 0 0 auto;
  color: var(--navy);
  text-decoration: none;
  font-size: 1.16rem;
  font-weight: 750;
  letter-spacing: -.03em;
}
.brand img { display: block; border-radius: 50%; object-fit: cover; }
.account { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.account span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page {
  width: min(100%, 69.25rem);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.5rem) max(1.125rem, env(safe-area-inset-right))
    max(2.75rem, env(safe-area-inset-bottom)) max(1.125rem, env(safe-area-inset-left));
}
.loading, .empty { color: var(--muted); }
.card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: clamp(1rem, 2.5vw, 1.65rem);
  box-shadow: 0 4px 14px rgb(13 43 65 / 4%);
}
.sign-in {
  max-width: 27.5rem;
  margin: clamp(1.1rem, 8vh, 5.25rem) auto 0;
  padding: clamp(1.35rem, 5vw, 2rem);
}
.sign-in h1 { font-size: clamp(1.5rem, 5vw, 1.85rem); }
.sign-in > p { margin: .65rem 0 1.5rem; color: var(--muted); }
.sign-in form { display: grid; }
.sign-in label { margin-bottom: .38rem; font-weight: 700; }
.sign-in input {
  width: 100%;
  min-height: 2.92rem;
  margin-bottom: 1.02rem;
  border: 1px solid #c3d0da;
  border-radius: .55rem;
  padding: .55rem .7rem;
  color: #132e42;
  background: #f8fafc;
}

.button {
  min-height: 2.72rem;
  padding: .58rem .9rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  font-size: .91rem;
  font-weight: 700;
  line-height: 1.2;
}
.button-header, .button-secondary { color: #134e71; background: #edf5fc; border-color: #cddfea; }
.button-header:hover, .button-secondary:hover { background: #dfedf7; }
.button-primary { color: #fff; background: #07658c; border-color: #07658c; }
.button-primary:hover { background: #085474; }
.button-text {
  display: block;
  padding-inline: .15rem;
  color: #134e71;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .15em;
}
.button-text:hover { color: #092d43; }
.account button { flex: 0 0 auto; }

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
  padding: clamp(1.05rem, 5vw, 2rem);
  border: 1px solid #0c3851;
  border-radius: 1.1rem;
  box-shadow: 0 5px 17px rgb(13 43 65 / 13%);
  background: linear-gradient(115deg, #0d2b41 12%, #13486a 100%);
  color: #fff;
}
.summary-title { display: flex; flex-wrap: wrap; gap: .55rem .9rem; align-items: center; }
.summary p { margin-top: .48rem; color: #cfe1ec; }
.summary .button-refresh { background: #eaf3fa; border-color: #eaf3fa; white-space: nowrap; }
.summary .button-refresh:hover { background: #fff; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .46rem;
  padding: .28rem .6rem;
  border-radius: 99rem;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.3;
  color: #455d6d;
  background: #edf2f6;
  white-space: nowrap;
}
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status[data-status="healthy"], .status[data-status="recovered"] { color: #185b3a; background: #e3f6e9; }
.status[data-status="slow"] { color: #7b4806; background: #fff1d9; }
.status[data-status="issue"] { color: #992b33; background: #fdebed; }

.service-card, .dashboard-columns, .summary + .feedback { margin-top: 1.12rem; }
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16.5rem, 1fr);
  grid-template-areas: "alerts phone";
  gap: 1.12rem;
  align-items: start;
}
.alerts { grid-area: alerts; }
.phone { grid-area: phone; }
.records { list-style: none; padding: 0; margin: .64rem 0 0; }
.records:empty { margin: 0; }
.records li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem 1rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: .84rem 0;
}
.records li:last-child { padding-bottom: 0; }
.record-name { display: block; font-size: .96rem; font-weight: 700; overflow-wrap: anywhere; }
.record-detail, .empty { font-size: .89rem; color: var(--muted); }
.record-detail { display: block; overflow-wrap: anywhere; }
.empty, .phone p { margin-top: .5rem; }
.phone p { color: var(--muted); font-size: .91rem; }
.phone > .button, .device-actions { margin-top: .68rem; }
.feedback {
  border-radius: .55rem;
  background: #e8f4fa;
  color: #124e6b;
  padding: .58rem .72rem;
  font-size: .9rem;
}
.phone p.feedback { color: #124e6b; }
.feedback.error, .phone p.feedback.error { background: #fdebed; color: #8d2832; }
.sign-in .feedback { margin-bottom: .75rem; }

@media (max-width: 43rem) {
  .dashboard-columns {
    grid-template-columns: 1fr;
    grid-template-areas: "phone" "alerts";
  }
}

@media (max-width: 30rem) {
  .account span { display: none; }
  .summary { align-items: start; flex-direction: column; }
  .summary .button-refresh { width: 100%; }
}
