:root {
  --bg: #f4f7f5; --card: #ffffff; --text: #16211c; --muted: #5f6f67; --line: #e2e9e5;
  --ok: #1f8a4c; --ok-bg: #e3f4ea; --warn: #b26a00; --warn-bg: #fff2dc; --bad: #c4322b; --bad-bg: #fde6e4;
  --accent: #1f6b4a; --bar: #dfe8e3;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1714; --card: #18221e; --text: #e8efeb; --muted: #93a39b; --line: #26332d;
    --ok: #4cc583; --ok-bg: #173226; --warn: #f0ad4e; --warn-bg: #33270f; --bad: #ff6b62; --bad-bg: #3a1a18;
    --accent: #5fd39a; --bar: #26332d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", sans-serif; padding-bottom: env(safe-area-inset-bottom); }
main { max-width: 640px; margin: 0 auto; padding: 0 14px 28px; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); max-width: 640px; margin: 0 auto; }
.top h1 { font-size: 20px; margin: 0; }
.title { display: flex; flex-direction: column; }
.muted { color: var(--muted); font-size: 13px; }
.section { font-size: 14px; color: var(--muted); font-weight: 600; margin: 22px 4px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card + .card { margin-top: 10px; }
.center { text-align: center; }
#login { margin-top: 40px; padding: 28px 18px; }
#login h2 { margin: 12px 0 4px; }
#login img { border-radius: 18px; }
button { font: inherit; }
.primary { margin-top: 14px; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 600; width: 100%; max-width: 280px; }
@media (prefers-color-scheme: dark) { .primary { color: #0f1714; } }
.icon-btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; }
.error { color: var(--bad); }
.foot { text-align: center; margin-top: 24px; }

.overall { border-radius: 18px; padding: 16px; margin-top: 6px; border: 1px solid transparent; }
.overall.ok { background: var(--ok-bg); color: var(--ok); }
.overall.warn { background: var(--warn-bg); color: var(--warn); }
.overall.bad { background: var(--bad-bg); color: var(--bad); }
.overall h2 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.overall ul { margin: 8px 0 0; padding-inline-start: 20px; color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.app-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-head h3 { margin: 0; font-size: 17px; }
.app-head a { color: var(--muted); font-size: 13px; text-decoration: none; direction: ltr; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bar); color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.tile .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12.5px; color: var(--muted); }
.tile .h { font-size: 12px; color: var(--muted); }
.tile.alert { border-color: var(--warn); background: var(--warn-bg); }
.series { margin-top: 14px; }
.series .l { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; direction: ltr; }
.bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.85; }
.bars-axis { display: flex; justify-content: space-between; direction: ltr; font-size: 11px; color: var(--muted); margin-top: 3px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row .k { display: flex; align-items: center; gap: 8px; }
.row .val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; text-align: left; }
.meter { margin-top: 2px; }
.meter .row { margin-bottom: 4px; }
.meter .track { height: 8px; background: var(--bar); border-radius: 99px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--ok); border-radius: 99px; }
.meter .fill.warn { background: var(--warn); } .meter .fill.bad { background: var(--bad); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 8px; }
