/* Layout: one column of cards, wide charts in a 2-up grid when there is room. */
:root {
  --bg: #f4f6f8; --panel: #ffffff; --fg: #18212f; --muted: #5a6577; --line: #dde3ea;
  --accent: #1f4e79; --accent-2: #9fb3c8; --accent-3: #d5dde6; --bad: #b3261e; --good: #1d7a4d;
  --grid: #e8edf2; --axis: #c3ccd6;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --r: 8px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f141b; --panel: #161d27; --fg: #e6ebf2; --muted: #98a3b3; --line: #273142;
    --accent: #7fb0e0; --accent-2: #4b6787; --accent-3: #2e3b4d; --bad: #f2867e; --good: #6fcf97;
    --grid: #1f2835; --axis: #364256; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); }
.ps-wrap { max-width: 1180px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 22px; }
.ps-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }
.ps-brand { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ps-user { font-size: 13px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.ps-user a { color: var(--accent); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.2; margin: 0; text-wrap: balance; }
.ps-lede { margin: 6px 0 0; max-width: 70ch; }
.ps-lede b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ps-fresh { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.ps-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.ps-tile, .ps-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.ps-tile { padding: 14px 18px; display: grid; gap: 2px; }
.ps-tile .l { font-size: 13px; color: var(--muted); }
.ps-tile .n { font-family: var(--serif); font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ps-tile .s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.good { color: var(--good) !important; } .bad { color: var(--bad) !important; }
.ps-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.ps-card { padding: 18px 20px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.ps-card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.ps-card p.n { margin: 0; font-size: 13px; color: var(--muted); }
.ps-chart { position: relative; min-height: 220px; }
.ps-chart svg { display: block; width: 100%; height: auto; }
.ps-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.ps-legend span { display: inline-flex; gap: 6px; align-items: center; }
.ps-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.k1 { background: var(--accent); } .k2 { background: var(--accent-2); } .k3 { background: var(--accent-3); }
.ps-tip { position: absolute; pointer-events: none; z-index: 3; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgb(0 0 0 / .12); padding: 6px 10px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-tip .h { color: var(--muted); margin-bottom: 2px; }
.ps-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.ps-search { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: min(100%, 280px); }
.ps-tablebox { max-height: 560px; overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 0; }
th button { all: unset; cursor: pointer; display: block; padding: 7px 10px; width: 100%; box-sizing: border-box; }
th button:focus-visible, .ps-search:focus-visible, .ps-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.r { text-align: right; }
.pill { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
.yes { color: var(--good); } .no { color: var(--muted); }
@media (max-width: 640px) { .hn { display: none; } h1 { font-size: 26px; } }
.ps-state { color: var(--muted); font-size: 14px; }
/* sign-in */
.ps-login { max-width: 420px; margin: 12vh auto 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.ps-login form { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.ps-login label { font-size: 13px; color: var(--muted); }
.ps-login input { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.ps-btn { font: inherit; font-weight: 600; padding: 10px 14px; border: 0; border-radius: 6px; background: var(--accent); color: var(--bg); cursor: pointer; }
.ps-note { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
