:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-soft: #eff4f2;
  --surface-strong: #e4eeeb;
  --ink: #17253b;
  --muted: #5d6d7b;
  --subtle: #758592;
  --line: #dce6e4;
  --accent: #0a8074;
  --accent-strong: #086b62;
  --accent-soft: #ddf2ed;
  --cobalt: #3557cf;
  --cobalt-soft: #e7ecff;
  --warning: #9b660f;
  --warning-soft: #fff2d9;
  --danger: #ae4050;
  --danger-soft: #fce9ed;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 14px 40px rgba(23, 37, 59, .07);
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  /* Chart compatibility aliases. */
  --tx: var(--ink);
  --tx-2: var(--muted);
  --tx-3: var(--subtle);
  --acc: var(--accent);
  --warn: var(--warning);
  --block: var(--danger);
  --bg-2: var(--surface);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--cobalt); }
:focus-visible { outline: 3px solid rgba(53, 87, 207, .72); outline-offset: 3px; }
::selection { background: #cae9e4; color: var(--ink); }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.16; letter-spacing: -.035em; }
h1 { font-size: clamp(2.7rem, 5vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h3 { font-size: clamp(1.18rem, 1.6vw, 1.45rem); }
p { color: var(--muted); }
small { color: var(--subtle); }
code, pre, .mono { font-family: var(--mono); }
code { overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); }

.container { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: white; }
.skip:focus { top: 12px; color: white; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--accent-strong); font-size: .76rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lede { max-width: 68ch; font-size: clamp(1.04rem, 1.4vw, 1.2rem); line-height: 1.65; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(23, 37, 59, .035); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .75rem; font-weight: 700; }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 44px; padding: .7rem 1.15rem; border: 1px solid transparent; border-radius: 11px; background: var(--accent); color: white; font-size: .92rem; font-weight: 700; line-height: 1.2; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.btn:hover { background: var(--accent-strong); color: white; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(10, 128, 116, .16); }
.btn:active { transform: translateY(0); }
.btn--secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--secondary:hover { background: var(--surface-soft); border-color: #b7cbc5; color: var(--ink); box-shadow: none; }
.btn--quiet { background: transparent; color: var(--accent-strong); }
.btn--quiet:hover { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #943543; box-shadow: 0 8px 18px rgba(174, 64, 80, .16); }
.field { display: grid; gap: 7px; }
.field label, label.field-label { color: var(--ink); font-size: .87rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 44px; padding: .65rem .8rem; border: 1px solid #cddad8; border-radius: 10px; outline: none; background: white; color: var(--ink); }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 128, 116, .13); }
input::placeholder, textarea::placeholder { color: #82909b; }
textarea { min-height: 100px; resize: vertical; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 560px) { .container { width: min(calc(100% - 28px), var(--max-width)); } }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d151e;
  --surface: #16232e;
  --surface-soft: #1b3038;
  --surface-strong: #254044;
  --ink: #ecf5f3;
  --muted: #b0c5c7;
  --subtle: #90a9ad;
  --line: #2d454b;
  --accent: #57c7b4;
  --accent-strong: #85e0cd;
  --accent-soft: #193d3b;
  --cobalt: #a6b9ff;
  --cobalt-soft: #243354;
  --warning: #ebbc72;
  --warning-soft: #3d3224;
  --danger: #f19daa;
  --danger-soft: #412b36;
  --shadow: 0 18px 45px rgba(0, 0, 0, .18);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] a { color: var(--accent-strong); }
html[data-theme="dark"] a:hover { color: #c2d0ff; }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { border-color: var(--line); background: var(--surface); color: var(--ink); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8ba4a9; }
html[data-theme="dark"] .btn { color: #0b2529; }
html[data-theme="dark"] .btn--secondary { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .btn--secondary:hover { background: var(--surface-soft); color: var(--ink); }
html[data-theme="dark"] .btn--quiet { background: transparent; color: var(--accent-strong); }
html[data-theme="dark"] .btn--danger { background: #cf6878; color: white; }

.theme-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 43px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); box-shadow: 0 10px 28px rgba(12, 31, 42, .15);
  font-size: .78rem; font-weight: 750; line-height: 1;
}
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle__icon { font-size: 1.1rem; line-height: 1; }
@media (max-width: 560px) {
  .theme-toggle { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 42px; min-height: 42px; padding: 8px; }
  .theme-toggle__label { display: none; }
}

/* The transparent shield uses black artwork on light surfaces. The footer and
   console navigation keep dark surfaces in both site themes. */
.site-brand__mark,
.console-brand img,
.auth-logo img { object-fit: contain; filter: none; }
html[data-theme="dark"] .site-header .site-brand__mark,
html[data-theme="dark"] .auth-logo img { filter: invert(1); }
.site-footer .site-brand__mark,
.console-brand img { filter: invert(1); }

/* Company credits stay readable within each footer's theme. */
.site-footer .site-brand__home,
.site-footer .site-brand__home:hover { color: inherit; }
.site-footer .instantnode-link,
.console-credit .instantnode-link,
.error-credit .instantnode-link,
.auth-footer small .instantnode-link,
html[data-theme="dark"] body .auth-footer small a.instantnode-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer .instantnode-link:hover,
.console-credit .instantnode-link:hover,
.error-credit .instantnode-link:hover,
.auth-footer small .instantnode-link:hover,
html[data-theme="dark"] body .auth-footer small a.instantnode-link:hover {
  color: inherit;
  text-decoration-thickness: 2px;
}
