:root {
  color-scheme: light;
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-subtle: #eef6fc;
  --text: #10202e;
  --body: #233a4d;
  --link: #0070b4;
  --accent-dark: #004670;
  --muted: #4a5b6a;
  --line: rgba(16, 32, 46, 0.1);
  --accent: #0084d4;
  --accent-soft: rgba(0, 132, 212, 0.12);
  /* Tables on every surface (guides, Help, landing page): cells sit on the card surface, headers one step darker. */
  --table-head-bg: #e5eff8;
  --table-cell-bg: var(--surface);
  --ink: var(--text);
  --primary: var(--accent);
  --primary-dark: var(--accent-dark);
  --hero-bg: var(--surface-subtle);
  --soft-bg: var(--bg);
  --site-width: 1200px;
  --reading-width: 720px;
  --gutter: 16px;
  --weight-bold: 700;
  --weight-normal: 400;
  --lh-heading: 1.3;
  --lh-body: 1.5;
  --fs-50: 50px;
  --fs-42: 42px;
  --fs-34: 34px;
  --fs-22: 22px;
  --fs-18: 18px;
  --fs-16: 16px;
  --fs-14: 14px;
  --sp-8: 8px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-md: 12px;
}

@media (prefers-color-scheme: dark) {
  :root.theme-aware:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f1720;
    --surface: #16212b;
    --surface-subtle: #16212b;
    --text: #e6edf3;
    --body: #e6edf3;
    --muted: #9fb0bf;
    --line: rgba(230, 237, 243, 0.12);
    --accent: #4db0f0;
    --accent-dark: #6cbcf5;
    --link: #6cbcf5;
    --accent-soft: rgba(77, 176, 240, 0.12);
    --table-head-bg: #213244;
  }
}

:root.theme-aware[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1720;
  --surface: #16212b;
  --surface-subtle: #16212b;
  --text: #e6edf3;
  --body: #e6edf3;
  --muted: #9fb0bf;
  --line: rgba(230, 237, 243, 0.12);
  --accent: #4db0f0;
  --accent-dark: #6cbcf5;
  --link: #6cbcf5;
  --accent-soft: rgba(77, 176, 240, 0.12);
  --table-head-bg: #213244;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: var(--lh-body);
}

a {
  color: var(--link);
}

a:hover {
  color: var(--primary-dark);
}

.visually-hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shell {
  width: min(100% - 2 * var(--gutter), var(--site-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hero-bg);
  box-shadow: 0 1px 0 var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  padding-block: var(--sp-16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-size: 20px;
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

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

.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px var(--sp-24);
}

.site-footer .brand {
  font-size: var(--fs-18);
}

.site-footer .brand img {
  border-radius: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  flex-grow: 1;
  gap: 4px var(--sp-24);
  font-size: var(--fs-14);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  color: var(--muted);
  font-size: var(--fs-14);
}

.language-picker select {
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-14);
}

.copyright {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.card {
  padding: 28px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}
.footer-menus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.language-picker img {
  width: 18px;
  height: 18px;
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.list-row,
.action-row {
  border-radius: 12px;
}
@media (max-width: 899px) {
  .header-row {
    padding-block: 12px;
  }
  .header-nav {
    gap: 12px;
  }
  .card {
    padding: 20px;
  }
  /* Phones: brand, then links in a wrapping row, then the menus, each on its own line. */
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-8);
  }

  .footer-links {
    gap: 0 20px;
  }
}

/* Shared chrome groups; reading containers remain owned by each surface. */
.site-header .header-row {
  flex-wrap: wrap;
}
.site-header .header-nav {
  flex-wrap: wrap;
}
.site-header [aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 6px;
}
.site-footer .footer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  margin-top: 16px;
}
.site-footer .footer-group h2 {
  margin: 0 0 8px;
  font-size: var(--fs-14);
}
.site-footer .footer-group .footer-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.site-footer .footer-menus {
  align-items: flex-start;
  flex-direction: column;
}
.site-footer select {
  max-width: 100%;
}
@media (max-width: 720px) {
  .site-footer .footer-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
