:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #1d1c1a;
  --muted: #6b675f;
  --faint: #8d8980;
  --rule: #d9d5cb;
  --track: #e6e2d8;
  --blue: #2c5f8f;
  --amber: #b86e12;
  --red: #b0382b;
  --green: #3f7d4e;
  --violet: #7b5ea7;
  --gold: #c08a2b;
  --teal: #3b8f8c;
  --stone: #9a968b;
  --pad: 16px;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

/* ---------- PIN screen ---------- */
.gate {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px var(--pad);
  text-align: center;
}
.gate h1 { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; margin: 0 0 4px; }
.gate .sub { color: var(--muted); margin: 0 0 28px; min-height: 22px; }
.gate .sub.bad { color: var(--red); }
.dots { display: flex; gap: 18px; margin-bottom: 34px; height: 18px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); display: block; transition: background .12s; }
.dots i.on { background: var(--ink); }
.dots.shake { animation: shake .36s; }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; }
.pad button {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent;
  font-size: 26px; font-weight: 300; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pad button:active { background: var(--track); }
.pad button.quiet { border-color: transparent; font-size: 14px; color: var(--muted); }
.pad button:disabled { opacity: .35; cursor: default; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad) 64px; }
header.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 22px 0 14px; flex-wrap: wrap; }
header.top h1 { margin: 0; font-size: 15px; font-weight: 600; }
header.top .meta { color: var(--muted); font-size: 13px; }
header.top .meta button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }

.banner { border-top: 1px solid var(--red); border-bottom: 1px solid var(--red); color: var(--red); padding: 10px 0; margin: 0 0 8px; }
.banner.warn { border-color: var(--amber); color: var(--amber); }

.verdict { padding: 6px 0 22px; }
.verdict p { margin: 0 0 6px; font-size: 17px; line-height: 1.4; max-width: 70ch; }
.verdict b { font-weight: 650; }
.verdict .bad { color: var(--red); }
.verdict .warn { color: var(--amber); }
.verdict .ok { color: var(--green); }

section { border-top: 1px solid var(--rule); padding: 22px 0 26px; }
section > .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
section h2 { margin: 0; font-size: 15px; font-weight: 650; }
.taken { color: var(--faint); font-size: 12.5px; }
.cols { display: grid; gap: 28px 56px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cols { grid-template-columns: 1.15fr 1fr; } :root { --pad: 32px; } }
h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sub-block + .sub-block { margin-top: 26px; }

/* ---------- Big figures and bars ---------- */
.big { font-size: 40px; font-weight: 300; letter-spacing: -0.01em; line-height: 1.1; }
.big small { font-size: 16px; color: var(--muted); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.bar { position: relative; height: 26px; background: var(--track); border-radius: 3px; overflow: hidden; margin: 12px 0 6px; display: flex; }
.bar > span { display: block; height: 100%; }
.bar.thin { height: 12px; margin: 6px 0; }
.bar.slim { height: 8px; margin: 4px 0; }
.barlabels { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; gap: 12px; }
.note { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; max-width: 72ch; }
.note.bad { color: var(--red); }
.note.warn { color: var(--amber); }

.legend { display: grid; grid-template-columns: 1fr; gap: 3px 24px; margin: 10px 0 0; font-size: 13.5px; }
@media (min-width: 560px) { .legend { grid-template-columns: 1fr 1fr; } }
.legend div { display: flex; align-items: baseline; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; flex: none; transform: translateY(1px); }
.legend .v { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { padding: 7px 0; border-top: 1px solid var(--track); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.rank li:first-child { border-top: 0; }
.rank .l { overflow-wrap: anywhere; }
.rank .v { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .v em { color: var(--muted); font-style: normal; margin-left: 8px; }
.rank .b { grid-column: 1 / -1; height: 6px; background: var(--track); border-radius: 2px; overflow: hidden; display: flex; }
.rank .b span { display: block; height: 100%; }
.rank .path { color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; overflow-wrap: anywhere; }

.lines { list-style: none; margin: 0; padding: 0; }
.lines li { padding: 8px 0; border-top: 1px solid var(--track); display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; }
.lines li:first-child { border-top: 0; }
.lines .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .d { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.group { margin-top: 18px; }
.group:first-child { margin-top: 0; }
.group .gh { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 13.5px; padding-bottom: 4px; }
.group .gh .v { font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 24px; margin: 4px 0 16px; }
.facts .f .n { font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.15; }
.facts .f .k { color: var(--muted); font-size: 12.5px; }

/* ---------- Apps table ---------- */
.apps { list-style: none; margin: 0; padding: 0; }
.apps .row { display: grid; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--track); grid-template-columns: minmax(0, 1fr) auto; }
.apps .row:first-child { border-top: 0; }
.apps .name { font-weight: 600; }
.apps .st { text-align: right; font-size: 13.5px; }
.apps .st.ok { color: var(--green); }
.apps .st.bad { color: var(--red); font-weight: 600; }
.apps .st.mute { color: var(--faint); }
.apps .nums { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 0 18px; }
.apps .nums span b { color: var(--ink); font-weight: 500; }
.apps .stack { grid-column: 1 / -1; }
.apps .sub { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
@media (min-width: 900px) {
  .apps .row { grid-template-columns: 170px 90px 74px 1fr 100px 100px 90px; align-items: center; }
  .apps .row.hd { color: var(--muted); font-size: 12.5px; padding: 0 0 6px; border-top: 0; }
  .apps .st { text-align: left; }
  .apps .nums { display: contents; }
  .apps .nums span { font-size: 14px; color: var(--ink); }
  .apps .nums span.k { display: none; }
  .apps .stack { grid-column: auto; grid-row: auto; }
  .apps .num { text-align: right; font-variant-numeric: tabular-nums; }
}
.apps .hd { display: none; }
@media (min-width: 900px) { .apps .hd { display: grid; } }

/* ---------- Charts ---------- */
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11.5px system-ui, -apple-system, "Segoe UI", sans-serif; fill: #6b675f; }
.chart .tip { position: absolute; top: 0; pointer-events: none; background: var(--bg); border: 1px solid var(--rule); padding: 3px 7px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); border-radius: 3px; }
.chart .wait { color: var(--muted); font-size: 13px; padding: 26px 0; }
.ctitle { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 18px; }

/* ---------- Loading and errors ---------- */
.skel { padding-top: 24px; }
.skel div { height: 14px; background: linear-gradient(90deg, var(--track), #efece4, var(--track)); background-size: 220% 100%; border-radius: 3px; margin: 0 0 14px; animation: sh 1.4s infinite linear; }
@keyframes sh { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.fail { padding: 18vh 0 0; max-width: 46ch; }
.fail h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.fail p { color: var(--muted); margin: 0 0 14px; }
.fail button { background: none; border: 1px solid var(--ink); border-radius: 3px; padding: 8px 16px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .skel div, .dots.shake { animation: none; } }

/* app cells: small label above the value on phones, hidden beside the header row on wide screens */
.apps .num .k { display: block; font-size: 11.5px; color: var(--faint); }
.apps .num { font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .apps .num .k { display: none; } }
@media (max-width: 899px) {
  .apps .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apps .name { grid-column: 1; }
  .apps .st { grid-column: 2; }
  .apps .row > .num { grid-column: auto; }
}
@media (max-width: 899px) { .apps .stack { order: 10; margin-top: 4px; } .apps .sub { order: 11; } }
