/* DeviceCare - one small stylesheet. All colours come from variables. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eaeef4;
  --text: #111827;
  --muted: #5b6675;
  --line: #dde3ea;
  --primary: #1c5fd0;
  --primary-ink: #ffffff;
  --ok: #0d6b45;
  --ok-bg: #e3f4ea;
  --warn: #8a5600;
  --warn-bg: #fdf0d5;
  --bad: #a01f2b;
  --bad-bg: #fce9ea;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 10px 24px rgba(17, 24, 39, 0.05);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131c;
    --surface: #161e2a;
    --surface-2: #1f2937;
    --text: #e8edf4;
    --muted: #9aa7b8;
    --line: #26313f;
    --primary: #5b9cf8;
    --primary-ink: #08111f;
    --ok: #6ee7b0;
    --ok-bg: #12321f;
    --warn: #f3c675;
    --warn-bg: #33280f;
    --bad: #f79ca3;
    --bad-bg: #38181c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0.35rem 0 0.75rem; }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--text); }
.mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.brandtext { display: flex; flex-direction: column; font-weight: 650; }
.brandsub { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.whoami { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.signout { margin: 0; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.navlink {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
}
.navlink:hover { background: var(--line); }
.navlink.is-active { background: var(--primary); color: var(--primary-ink); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.card.login { max-width: 26rem; margin: 12vh auto 0; }

.score .bignum { font-size: 3rem; font-weight: 700; margin: 0.1rem 0 0.4rem; letter-spacing: -0.02em; }
.score .of { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.mut { color: var(--muted); }
.bignum { font-variant-numeric: tabular-nums; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.stats li { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.stats li:last-child { border-bottom: 0; }
.stats strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

.pill.state {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill.state.ok { background: var(--ok-bg); color: var(--ok); }
.pill.state.warn { background: var(--warn-bg); color: var(--warn); }
.pill.state.bad { background: var(--bad-bg); color: var(--bad); }

.btn {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

form.stack { display: grid; gap: 0.4rem; max-width: 28rem; }
form.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
label { font-size: 0.85rem; color: var(--muted); }
input, select, textarea {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.inline-form input { min-width: 12rem; }

.notice {
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.notice.bad { background: var(--bad-bg); color: var(--bad); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.5rem; margin: 0.5rem 0 1.2rem; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0; }

.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.answer { font-size: 1.05rem; }

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  font-size: 0.82rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .whoami { display: none; }
  .score .bignum { font-size: 2.4rem; }
  .nav { gap: 0.3rem; }
  .navlink { font-size: 0.8rem; padding: 0.3rem 0.65rem; }
}
