/* Design tokens (Apple HIG system colors) */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --sep: rgba(60, 60, 67, 0.2);
  --fill: rgba(118, 118, 128, 0.12);
  --thumb: #ffffff;
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --grey: #8e8e93;
  --backdrop: rgba(0, 0, 0, 0.4);
  --bar: rgba(249, 249, 249, 0.94);
  --user-bg: rgba(0, 122, 255, 0.10);
  --code-bg: #ffffff;
  --diff-add-bg: rgba(52, 199, 89, 0.18);
  --diff-del-bg: rgba(255, 59, 48, 0.16);
  --diff-add: #248a3d;
  --diff-del: #d70015;
  --err-bg: rgba(255, 59, 48, 0.10);

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --radius: 10px;
  --hit: 44px;
  --col: 430px;
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Liquid Glass material */
  --mat: rgba(255, 255, 255, 0.92);          /* fallback without backdrop-filter */
  --mat-line: rgba(60, 60, 67, 0.14);
  --mat-hi: rgba(255, 255, 255, 0.7);
  --mat-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.06);
  --glass: saturate(200%) blur(30px);

  /* Chart series */
  --c-mem: #007aff;
  --c-cpu: #1ba8c4;
  --c-net: #af52de;
  --c-disk: #5856d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --sep: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --thumb: #636366;
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --grey: #636366;
    --backdrop: rgba(0, 0, 0, 0.6);
    --bar: rgba(30, 30, 30, 0.94);
    --user-bg: rgba(10, 132, 255, 0.20);
    --code-bg: #1c1c1e;
    --diff-add-bg: rgba(48, 209, 88, 0.22);
    --diff-del-bg: rgba(255, 69, 58, 0.22);
    --diff-add: #30d158;
    --diff-del: #ff453a;
    --err-bg: rgba(255, 69, 58, 0.18);

    --mat: rgba(44, 44, 46, 0.92);
    --mat-line: rgba(255, 255, 255, 0.1);
    --mat-hi: rgba(255, 255, 255, 0.22);
    --mat-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);

    --c-mem: #0a84ff;
    --c-cpu: #40c8e0;
    --c-net: #bf5af2;
    --c-disk: #7d7aff;
  }
}

/* Translucent tint only where the blur exists; otherwise the 92 % fill above stays legible. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root { --mat: rgba(255, 255, 255, 0.55); }
  @media (prefers-color-scheme: dark) { :root { --mat: rgba(58, 58, 60, 0.5); } }
}
