:root {
  --blue: #0b63c7;
  --blue-dark: #074f9f;
  --ink: #102033;
  --muted: #52657a;
  --line: #dce5ee;
  --bg: #f5f8fb;
  --pale: #eef7ff;
  --ok: #157347;
  --warn: #b25e00;
  --bad: #b3261e;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #85c6ff; outline-offset: 3px; }
button { font: inherit; touch-action: manipulation; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { display: grid; line-height: 1.3; }
.brand b { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.top nav { display: flex; gap: 6px; }
.top nav a { padding: 10px 14px; border-radius: 999px; font-weight: 650; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a:hover { background: var(--pale); text-decoration: none; }

main { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; flex: 1 0 auto; }
.intro { padding: 12px 0 8px; }
.eyebrow { margin: 0; color: var(--blue); font-weight: 700; font-size: 13px; letter-spacing: .08em; }
h1 { margin: 6px 0 10px; font-size: clamp(26px, 4vw, 38px); line-height: 1.3; font-weight: 850; text-wrap: balance; }
.lead { margin: 0; max-width: 46em; color: #344f6c; font-size: 17px; }

.alert { margin: 18px 0 0; padding: 14px 16px; border-radius: 10px; border: 1px solid #f0c98a; background: #fff8ea; color: #6b4200; }
.alert[data-tone="ok"] { border-color: #a9d8bd; background: #eefaf3; color: #0f5a37; }
.alert[data-tone="bad"] { border-color: #f0b4af; background: #fff1f0; color: #8a1c15; }
.alert button { margin-left: 10px; }

.card { margin-top: 18px; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 32, 51, .04), 0 12px 28px -18px rgba(16, 32, 51, .18); }
.card h2 { margin: 0 0 10px; font-size: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quick { display: flex; gap: 4px; }
.link { background: none; border: 0; color: var(--blue); padding: 10px; min-height: 44px; cursor: pointer; font-weight: 650; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; }
.facts div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.facts .ok { color: var(--ok); }
.facts .warn { color: var(--warn); }
.facts .bad { color: var(--bad); }

.groups { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.groups li { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdff; }
.groups li.loading { display: block; color: var(--muted); }
.groups input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--blue); }
.groups .name { font-weight: 750; }
.groups .desc { grid-column: 2; color: var(--muted); font-size: 14px; line-height: 1.5; }
.groups .side { grid-row: 1 / span 2; grid-column: 3; text-align: right; display: grid; gap: 4px; justify-items: end; }
.groups .size { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e2f5ea; color: var(--ok); }
.badge.part { background: #fff1d6; color: var(--warn); }
.badge.stale { background: #fde4e1; color: var(--bad); }
.open { font-size: 13px; font-weight: 700; }

.progress { margin-top: 16px; }
.bar { height: 14px; border-radius: 999px; background: #e6edf5; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #177de8, #0b63c7); transition: width .25s; }
.progress p { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.actions button { min-height: 48px; padding: 0 22px; border-radius: 10px; font-weight: 750; cursor: pointer; border: 1px solid transparent; }
.actions button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: var(--pale); color: var(--blue-dark); border-color: #b7dcff; }
.ghost { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.tips { margin: 6px 0 0; padding-left: 22px; }
.tips li { padding: 4px 0 4px 4px; }
.tips li::marker { color: var(--blue); font-weight: 800; }

footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 28px; color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .groups li { grid-template-columns: auto 1fr; }
  .groups .side { grid-row: auto; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; text-align: left; }
  .groups .side .size { margin-left: auto; }
  .actions button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
