/* P21 Reports. One stylesheet, system fonts, no external assets. Checked at 390 px and 1024 px. */
:root {
  color-scheme: light;
  --bg: #f4f5f7; --card: #ffffff; --ink: #0f1b2d; --sub: #55617a; --line: #dfe3ea; --soft: #eef1f6;
  --accent: #0b5cad; --accent-ink: #ffffff; --ok: #0f7a4b; --ok-bg: #e3f5ec; --wait: #8a5a00; --wait-bg: #fff3d6; --bad: #b3261e; --bad-bg: #fde8e6;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 6px 20px rgba(15, 27, 45, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1, h2, p { margin: 0; }
.sub { color: var(--sub); }
.muted { color: var(--sub); }

/* header */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.01em; min-height: 40px; white-space: nowrap; }
.brand svg { width: 24px; height: 24px; fill: #6cb4ff; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.ok { background: #123f2c; color: #7ee2b0; }
.pill.wait { background: #4a3600; color: #ffd166; }
.pill.bad { background: #5a1410; color: #ffb4ab; }

main.wrap { padding-top: 24px; padding-bottom: 32px; }
.pagehead { margin-bottom: 20px; }
.pagehead h1 { font-size: clamp(26px, 4.2vw, 38px); line-height: 1.15; letter-spacing: -.02em; }
.pagehead .sub { margin-top: 6px; font-size: 17px; max-width: 70ch; }
.pagehead .lead { font-size: clamp(17px, 2.2vw, 20px); color: #33405a; }
.crumb { margin-bottom: 10px; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* home */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.report { display: flex; flex-direction: column; padding: 20px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.report:hover, .report:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.report h2 { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; }
.report .desc { color: var(--sub); margin-top: 6px; flex: 1; }
.big { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 12px; }
.big b { font-size: 52px; line-height: 1; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--accent); }
.big b.none { color: #b3bccb; }
.big span { color: var(--sub); font-size: 16px; }
.report dl { margin: 0; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; font-size: 14px; }
.report dl div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.report dt { color: var(--sub); }
.report dd { margin: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: 1px; margin-left: 4px; }
.tag.on { background: var(--ok-bg); color: var(--ok); }
.tag.off { background: var(--soft); color: var(--sub); }
.warnText { color: var(--bad); }

/* report page */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.tile b { display: block; font-size: clamp(34px, 6vw, 48px); line-height: 1.05; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile b.small { font-size: clamp(18px, 2.4vw, 24px); line-height: 1.3; letter-spacing: -.01em; padding: 6px 0; }
.tile span { color: var(--sub); font-size: 15px; }
.tile.wide { grid-column: 1 / -1; }
@media (min-width: 760px) { .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); } .tile.wide { grid-column: auto; } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1px solid #c5ccd8; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #094c8f; }
.btn:focus-visible, input:focus-visible, .scroll:focus-visible, th button:focus-visible { outline: 3px solid #6cb4ff; outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: default; }

.sendbox { padding: 16px 18px; margin-bottom: 16px; }
.sendbox label, .login label { display: block; font-weight: 600; margin-bottom: 6px; }
.sendbox .row { display: flex; flex-wrap: wrap; gap: 10px; }
input[type=password] { min-height: 48px; padding: 0 14px; border: 1px solid #c5ccd8; border-radius: 10px; font: inherit; flex: 1 1 200px; min-width: 0; width: 100%; background: #fff; color: var(--ink); }
.sendbox .sub { margin-top: 8px; font-size: 14px; }
.note { margin-top: 8px; font-weight: 600; min-height: 1.5em; }
.note.ok { color: var(--ok); }
.note.bad { color: var(--bad); }

/* the table scrolls sideways inside its card; the page never does */
.tablecard { overflow: hidden; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 72vh; overflow-y: auto; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.data th, .data td { text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data td { padding: 11px 14px; }
.data thead th { position: sticky; top: 0; background: #f8f9fb; z-index: 1; padding: 0; border-bottom: 2px solid #c5ccd8; }
.data thead button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 48px; padding: 0 14px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #33405a; cursor: pointer; }
.data thead th.num button { justify-content: flex-end; }
.data .num { text-align: right; }
.arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: 0; }
th[aria-sort=ascending] .arrow { border-bottom: 6px solid var(--accent); opacity: 1; }
th[aria-sort=descending] .arrow { border-top: 6px solid var(--accent); opacity: 1; }
.data tbody tr:nth-child(even) td { background: #fafbfc; }
.data tbody tr:hover td { background: #eef5fd; }
.data tr.group th { background: var(--soft); padding: 10px 14px; font-size: 16px; border-bottom: 1px solid #c5ccd8; position: static; }
.data tr.group th span { font-weight: 700; }
.data tr.group th em { font-style: normal; font-weight: 500; color: var(--sub); margin-left: 10px; font-size: 14px; }
.data tbody:last-child tr:last-child td { border-bottom: 0; }

.panel { border-radius: var(--radius); padding: 20px; margin-bottom: 16px; border: 1px solid; }
.panel h2 { font-size: 22px; margin-bottom: 6px; }
.panel p + p { margin-top: 6px; }
.panel.wait { background: var(--wait-bg); border-color: #f0d38a; }
.panel.wait h2 { color: var(--wait); }
.panel.bad { background: var(--bad-bg); border-color: #f3b9b4; }
.panel.bad h2 { color: var(--bad); }
.panel.ok { background: var(--ok-bg); border-color: #b5e2cb; }
.panel.ok h2 { color: var(--ok); }
.panel .btn { margin-top: 10px; }

.about { margin-top: 18px; display: grid; gap: 4px; }
.meta { color: var(--sub); font-size: 14px; overflow-wrap: anywhere; }
.meta b { color: #33405a; margin-right: 6px; }

.login { max-width: 420px; margin: 8vh auto 0; padding: 28px 24px; }
.login h1 { font-size: 28px; letter-spacing: -.02em; }
.login .sub { margin: 6px 0 18px; }
.login .btn { width: 100%; margin-top: 16px; }

.foot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 16px; padding-bottom: 28px; color: var(--sub); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  .brand { font-size: 18px; }
  .pill { font-size: 13px; padding: 5px 10px; }
  .big b { font-size: 46px; }
  .actions .btn { flex: 1 1 100%; }
  .data td { padding: 10px 12px; }
}
@media print { .top, .actions, .sendbox, .crumb { display: none; } .scroll { max-height: none; overflow: visible; } body { background: #fff; } }
