/* The color tokens of every page (public/static/theme.js sets <html data-theme>). Dark is the original hologram look;
   light is for people who prefer a bright screen. Order: data-theme="light" / "dark" (the stored choice) first; with no
   choice (自動) the OS setting decides through prefers-color-scheme. The two light blocks hold the same values
   (test/theme.test.ts T-THM-003). Text tokens meet WCAG AA (4.5:1) on --bg and --surface in both themes. */
:root {
  color-scheme: dark;
  --bg: #02050a;
  --bg-glow: #062033;
  --text: rgba(190,238,255,0.9);
  --heading: #dff8ff;
  --text-strong: #eafcff;
  --muted: rgba(160,225,255,0.75);
  --faint: rgba(150,215,245,0.62);
  --link: rgba(140,230,255,0.9);
  --accent: #7fe6ff;
  --on-accent: #02050a;
  --surface: rgba(0,30,55,0.6);
  --surface-2: rgba(10,40,64,0.35);
  --surface-rec: rgba(10,60,90,0.45);
  --scroll-bg: rgba(2,10,20,0.55);
  --panel-top: rgba(0,30,55,0.92);
  --panel-bottom: rgba(0,12,28,0.92);
  --border: rgba(110,220,255,0.3);
  --border-faint: rgba(110,220,255,0.15);
  --border-strong: rgba(120,230,255,0.6);
  --focus: rgba(140,240,255,0.9);
  --input-bg: rgba(10,50,80,0.45);
  --input-border: rgba(110,220,255,0.4);
  --btn-bg: rgba(20,100,150,0.55);
  --btn-bg-hover: rgba(40,140,200,0.6);
  --btn-text: #eafcff;
  --btn-primary-bg: rgba(40,150,210,0.7);
  --glow: rgba(80,200,255,0.8);
  --glow-soft: rgba(60,190,255,0.3);
  --danger: rgba(255,170,150,0.95);
  --danger-border: rgba(255,160,150,0.8);
  --danger-bg: rgba(80,20,20,0.45);
  --danger-text: #ffd6d0;
  --prod-alert: rgb(255,120,120);
  --warn: rgba(255,215,160,0.95);
  --warn-border: rgba(255,190,120,0.7);
  --warn-bg: rgba(255,210,120,0.06);
  --ok: rgba(150,255,200,0.9);
  --ok-border: rgba(120,230,190,0.6);
  --ok-bg: rgba(0,40,40,0.5);
  --report: #d9c8ff;
  --report-border: rgba(200,170,255,0.7);
  --report-bg: rgba(10,20,45,0.7);
  --report-btn-bg: rgba(60,30,110,0.45);
  --chart-filter: none;
  --solid: #04131f;
  --solid-head: #061a2a;
  --solid-sec: #0a3049;
  --solid-rec: #0a2c44;
  --tint-sec: rgba(20,100,150,0.3);
  --tint-rec: rgba(60,180,255,0.08);
  --dim: rgba(140,190,220,0.45);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e4edf3;
  --bg-glow: #ffffff;
  --text: #15303d;
  --heading: #062433;
  --text-strong: #0a2433;
  --muted: #3b5b6b;
  --faint: #4a6878;
  --link: #0a5f86;
  --accent: #0a6f9c;
  --on-accent: #ffffff;
  --surface: rgba(255,255,255,0.82);
  --surface-2: rgba(255,255,255,0.7);
  --surface-rec: #eef8fd;
  --scroll-bg: rgba(255,255,255,0.7);
  --panel-top: #ffffff;
  --panel-bottom: #f3f8fb;
  --border: rgba(20,90,130,0.28);
  --border-faint: rgba(20,90,130,0.14);
  --border-strong: rgba(15,105,150,0.6);
  --focus: #0a6f9c;
  --input-bg: #ffffff;
  --input-border: rgba(20,90,130,0.45);
  --btn-bg: #d5eaf4;
  --btn-bg-hover: #bcdcec;
  --btn-text: #062f44;
  --btn-primary-bg: #a9d4ea;
  --glow: transparent;
  --glow-soft: rgba(20,90,130,0.14);
  --danger: #a8241c;
  --danger-border: rgba(180,45,35,0.6);
  --danger-bg: #fdecea;
  --danger-text: #8a1c15;
  --prod-alert: #c0170d;
  --warn: #7a4600;
  --warn-border: rgba(180,110,10,0.7);
  --warn-bg: #fff6e5;
  --ok: #136137;
  --ok-border: rgba(25,130,80,0.55);
  --ok-bg: #e7f6ee;
  --report: #4b2f8f;
  --report-border: rgba(110,70,190,0.55);
  --report-bg: #f3effc;
  --report-btn-bg: #e6dcfa;
  --chart-filter: brightness(0.55) saturate(1.8);
  --solid: #ffffff;
  --solid-head: #edf4f8;
  --solid-sec: #d8e9f3;
  --solid-rec: #dcedf7;
  --tint-sec: #e3f0f7;
  --tint-rec: rgba(10,111,156,0.06);
  --dim: #6d8796;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #e4edf3;
  --bg-glow: #ffffff;
  --text: #15303d;
  --heading: #062433;
  --text-strong: #0a2433;
  --muted: #3b5b6b;
  --faint: #4a6878;
  --link: #0a5f86;
  --accent: #0a6f9c;
  --on-accent: #ffffff;
  --surface: rgba(255,255,255,0.82);
  --surface-2: rgba(255,255,255,0.7);
  --surface-rec: #eef8fd;
  --scroll-bg: rgba(255,255,255,0.7);
  --panel-top: #ffffff;
  --panel-bottom: #f3f8fb;
  --border: rgba(20,90,130,0.28);
  --border-faint: rgba(20,90,130,0.14);
  --border-strong: rgba(15,105,150,0.6);
  --focus: #0a6f9c;
  --input-bg: #ffffff;
  --input-border: rgba(20,90,130,0.45);
  --btn-bg: #d5eaf4;
  --btn-bg-hover: #bcdcec;
  --btn-text: #062f44;
  --btn-primary-bg: #a9d4ea;
  --glow: transparent;
  --glow-soft: rgba(20,90,130,0.14);
  --danger: #a8241c;
  --danger-border: rgba(180,45,35,0.6);
  --danger-bg: #fdecea;
  --danger-text: #8a1c15;
  --prod-alert: #c0170d;
  --warn: #7a4600;
  --warn-border: rgba(180,110,10,0.7);
  --warn-bg: #fff6e5;
  --ok: #136137;
  --ok-border: rgba(25,130,80,0.55);
  --ok-bg: #e7f6ee;
  --report: #4b2f8f;
  --report-border: rgba(110,70,190,0.55);
  --report-bg: #f3effc;
  --report-btn-bg: #e6dcfa;
  --chart-filter: brightness(0.55) saturate(1.8);
  --solid: #ffffff;
  --solid-head: #edf4f8;
  --solid-sec: #d8e9f3;
  --solid-rec: #dcedf7;
  --tint-sec: #e3f0f7;
  --tint-rec: rgba(10,111,156,0.06);
  --dim: #6d8796;
  }
}

/* The 表示 control (theme.js puts it into each page's <span data-theme-switch>). */
.theme-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.theme-switch select { font: inherit; font-size: 13px; color: var(--text-strong); background: var(--input-bg);
  border: 1px solid var(--input-border); border-radius: 4px; padding: 4px 6px; min-height: 32px; cursor: pointer; }
.theme-switch select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
footer [data-theme-switch] { display: block; margin-top: 8px; }
/* the public pages' top header (LP, pricing, contact, legal): on a phone the control gets its own row under the links */
@media (max-width: 720px) {
  body > header nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
  body > header nav [data-theme-switch] { order: 1; flex-basis: 100%; display: flex; justify-content: flex-end; }
}
