/* HRT Diary — styles. Tokens first; light/dark selected, not flipped. */

:root {
  color-scheme: light;
  --bg: #fbf8fa;
  --surface: #ffffff;
  --surface-2: #f5f0f4;
  --surface-3: #ebe3ea;
  --text: #1d1724;
  --text-2: #4f4659;
  --muted: #6c6276;
  --border: rgba(29, 23, 36, 0.13);
  --border-strong: rgba(29, 23, 36, 0.26);
  /* The trans flag, color-blocked: solid blue, pink and white areas, never blended.
     Text on blue and pink is a dark shade of the same color (7:1 or better). */
  --flag-blue: #5bcefa;
  --flag-pink: #f5a9b8;
  --on-blue: #02263a;
  --on-pink: #2e0716;
  /* "White" blocks: a white fill with a dark outline in light mode; in dark mode
     white becomes the outline and the text, over the page (no bright fill). */
  --white-fill: #ffffff;
  --on-white: #1d1724;
  --line: #1d1724;
  --accent: #b8326b;
  --accent-hover: #a02a5d;
  --accent-soft: #fde3ea;
  --accent-ink: #2e0716;
  --btn-primary: #f5a9b8;
  --btn-primary-hover: #f29aab;
  --btn-primary-ink: #2e0716;
  --focus: #1d1724;
  --ok: #0b7a2b;
  --ok-soft: #e6f4ea;
  --warn: #9a4b00;
  --warn-soft: #fdf0e1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #0a6f9c;
  --info-soft: #e3f5fd;
  --pre: #8a5a00;
  --pre-soft: #fbf1dc;
  --shadow: none;
  --shadow-lg: 0 12px 40px rgba(29, 23, 36, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* charts: the flag first (blue, pink, white with a dark edge so it shows on white),
     then distinct colors for any further series */
  --surface-1: #ffffff;
  --series-1: #1597cf;
  --series-2: #dd6a84;
  --series-3: #ffffff;
  --series-3-edge: #1d1724;
  --series-4: #eda100;
  --series-5: #1baf7a;
  --series-6: #eb6834;
  --series-7: #6250d6;
  --series-8: #e34948;
  /* the calendar's Surgery entries: a teal apart from the chart series */
  --kind-surgery: #0f8a94;
  --grid: #eee6ec;
  --axis: #cfc4cd;
  --band: rgba(27, 175, 122, 0.12);
  --band-edge: rgba(27, 175, 122, 0.45);
  --threshold: #1baf7a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #15121b;
    --surface: #1f1b27;
    --surface-2: #2a2534;
    --surface-3: #352f41;
    --text: #f4eff6;
    --text-2: #d3cbd9;
    --muted: #a59bb0;
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.3);
    --white-fill: transparent;
    --on-white: #f4eff6;
    --line: #f4eff6;
    --accent: #ff9cc0;
    --accent-hover: #ffb7d1;
    --accent-soft: #3d2130;
    --accent-ink: #2e0716;
    --btn-primary-hover: #f8bccb;
    --focus: #f4eff6;
    --ok: #5fd07c;
    --ok-soft: #173421;
    --warn: #f2b264;
    --warn-soft: #3a2a15;
    --danger: #ff8a80;
    --danger-soft: #3d1a18;
    --info: #7fd6fa;
    --info-soft: #12303d;
    --pre: #f0c46b;
    --pre-soft: #362a12;
    --shadow: none;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    --surface-1: #1f1b27;
    --series-1: #5bcefa;
    --series-2: #f5a9b8;
    --series-3: #f4eff6;
    --series-3-edge: initial;
    --series-4: #c98500;
    --series-5: #199e70;
    --series-6: #d95926;
    --series-7: #9085e9;
    --series-8: #e66767;
    --kind-surgery: #3fbfc4;
    --grid: #2b2635;
    --axis: #3f3849;
    --band: rgba(25, 158, 112, 0.18);
    --band-edge: rgba(25, 158, 112, 0.55);
    --threshold: #199e70;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #15121b;
  --surface: #1f1b27;
  --surface-2: #2a2534;
  --surface-3: #352f41;
  --text: #f4eff6;
  --text-2: #d3cbd9;
  --muted: #a59bb0;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.3);
  --white-fill: transparent;
  --on-white: #f4eff6;
  --line: #f4eff6;
  --accent: #ff9cc0;
  --accent-hover: #ffb7d1;
  --accent-soft: #3d2130;
  --accent-ink: #2e0716;
  --btn-primary-hover: #f8bccb;
  --focus: #f4eff6;
  --ok: #5fd07c;
  --ok-soft: #173421;
  --warn: #f2b264;
  --warn-soft: #3a2a15;
  --danger: #ff8a80;
  --danger-soft: #3d1a18;
  --info: #7fd6fa;
  --info-soft: #12303d;
  --pre: #f0c46b;
  --pre-soft: #362a12;
  --shadow: none;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --surface-1: #1f1b27;
  --series-1: #5bcefa;
  --series-2: #f5a9b8;
  --series-3: #f4eff6;
  --series-3-edge: initial;
  --series-4: #c98500;
  --series-5: #199e70;
  --series-6: #d95926;
  --series-7: #9085e9;
  --series-8: #e66767;
  --kind-surgery: #3fbfc4;
  --grid: #2b2635;
  --axis: #3f3849;
  --band: rgba(25, 158, 112, 0.18);
  --band-edge: rgba(25, 158, 112, 0.55);
  --threshold: #199e70;
}

/* Each section owns one flag color, used on its nav button and its page headers.
   The body carries the current section's class, so a page reads the same vars. */
body,
.sec-body {
  --sec-bg: var(--white-fill);
  --sec-ink: var(--on-white);
  --sec-line: var(--line);
}
.sec-home,
.sec-care,
body.sec-home,
body.sec-care {
  --sec-bg: var(--flag-blue);
  --sec-ink: var(--on-blue);
  --sec-line: var(--flag-blue);
}
.sec-labs,
body.sec-labs {
  --sec-bg: var(--flag-pink);
  --sec-ink: var(--on-pink);
  --sec-line: var(--flag-pink);
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep the scroll bar's space even on short pages, so switching pages doesn't shift the layout. */
  scrollbar-gutter: stable;
}
html.modal-open {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.4em;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.75em;
}
a {
  color: var(--accent);
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip-link:focus {
  left: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.strong {
  font-weight: 650;
}
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
[hidden] {
  display: none !important;
}

