/* Shared palette and control. Include after a page's base styles.
   Future pages can reuse the variables and a [data-theme-toggle] button. */
:root {
  color-scheme: light;
  --navy: #17324A;
  --teal: #087F87;
  --deep-teal: #076C72;
  --paper: #FFFFFF;
  --muted: #516879;
  --line: #DDE9EA;
  --action-text: #FFFFFF;
  --action-hover: #05575D;
  --control-border: #718794;
  --control-hover: #EDF6F6;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #EAF3F8;
  --teal: #5DD5D1;
  --deep-teal: #5DD5D1;
  --paper: #102638;
  --muted: #B3C7D5;
  --line: #3D576B;
  --action-text: #102638;
  --action-hover: #8BE6E1;
  --control-border: #7895A9;
  --control-hover: #203E53;
}

.cta { color: var(--action-text); }
.cta:hover { background: var(--action-hover); }

/* Both SVGs have transparent canvases and identical geometry. Light ink in
   the dark variant replaces the white badge without losing logo contrast. */
.brand .brand-logo-dark { display: none; }
[data-theme="dark"] .brand .brand-logo-light { display: none; }
[data-theme="dark"] .brand .brand-logo-dark { display: block; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--control-hover); }
.theme-toggle:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}
.theme-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; }
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }

@media (max-width: 600px) {
  /* Keep the logo, Tools link and 44px control on one row at phone widths. */
  header { gap: 12px; }
  nav { gap: 12px; }
  .theme-toggle { padding: 10px; }
  .theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
