:root {
  --bg: #f4f6f9; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e8ebf0;
  --brand: #2563eb; --ok: #16a34a; --ok-bg: #e9f8ef; --warn: #d97706; --warn-bg: #fff4e0; --bad: #dc2626; --bad-bg: #fdecec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #8b949e; --line: #262c36;
    --brand: #4f8cff; --ok: #3fb950; --ok-bg: rgba(63, 185, 80, .13); --warn: #f0a92e; --warn-bg: rgba(240, 169, 46, .13); --bad: #f85149; --bad-bg: rgba(248, 81, 73, .14);
    --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; text-align: center; }

/* buttons */
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer; background: var(--line); transition: opacity .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.plain { background: transparent; color: var(--brand); padding: 10px 12px; }
.btn.wide { width: 100%; }
.icon { border: 0; background: var(--card); box-shadow: var(--shadow); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.icon.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign in */
.login { max-width: 380px; margin: 0 auto; padding: max(14vh, 60px) 20px 40px; text-align: center; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.login h1 { margin: 16px 0 6px; font-size: 26px; letter-spacing: -.01em; }
.login > p { margin: 0 0 28px; }
.login form { display: grid; gap: 10px; }
.code { width: 100%; text-align: center; font-size: 28px; letter-spacing: .4em; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); outline: none; }
.code:focus { border-color: var(--brand); }

/* app */
#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 28px); }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }

.hero { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 12px; }
.hero h2 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.hero p { margin: 2px 0 0; }
.hero-dot { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--line); display: grid; place-items: center; }
.hero-dot::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); }
.hero.ok .hero-dot { background: var(--ok-bg); } .hero.ok .hero-dot::after { background: var(--ok); }
.hero.warn .hero-dot { background: var(--warn-bg); } .hero.warn .hero-dot::after { background: var(--warn); }
.hero.bad .hero-dot { background: var(--bad-bg); animation: pulse 1.6s ease-in-out infinite; } .hero.bad .hero-dot::after { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--bad-bg); } }

.problem { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; font-weight: 500; }
.problem.bad { background: var(--bad-bg); color: var(--bad); }
.problem.warn { background: var(--warn-bg); color: var(--warn); }
.problem small { display: block; font-weight: 400; opacity: .85; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.nudge { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 12px 0; }
.nudge p { margin: 2px 0 0; }
.label { margin: 22px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.list { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.row + .row { border-top: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .val { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.empty { padding: 16px; color: var(--muted); text-align: center; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 24px; text-align: center; }
.foot p { width: 100%; margin: 6px 0 0; }
