/* Calculation tool styles, scoped under .tool-app so they cannot change the rest of the site. */
.tool-app {
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --line: #D9DFE7;
  --line-strong: #8A94A3;
  --track: #E3E8EF;
  --ink: #1B2430;
  --muted: #4A5565;
  --accent: #1F5FA8;
  --blue: #0072B2;
  --orange: #D55E00;
  --warn-bg: #FFF1D6;
  --warn-ink: #5C3B00;
  --note-bg: #E8EDF4;
  --err: #A12B1E;
  color-scheme: light;
}
.tool-app, .tool-app * { box-sizing: border-box; }
.tool-app {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
.tool-app .page { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.tool-app h1 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.25; }
.tool-app h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.tool-app p { margin: 0; }
.tool-app .lede { font-size: 16px; color: var(--muted); margin-top: 8px; }
.tool-app .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.tool-app form { display: flex; flex-direction: column; gap: 16px; }
.tool-app .fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.tool-app .hint { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.tool-app .mode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.tool-app .mode label { font-weight: 600; font-size: 14px; padding: 10px 16px; min-height: 44px; display: flex; align-items: center; cursor: pointer; background: #fff; color: var(--muted); }
.tool-app .mode input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.tool-app .mode input:checked + span { color: #fff; }
.tool-app .mode label:has(input:checked) { background: var(--accent); color: #fff; }
.tool-app .mode label:has(input:focus-visible) { outline: 3px solid #7AA7DB; outline-offset: -3px; }
.tool-app .group { display: contents; }
.tool-app .field { flex: 1 1 150px; display: flex; flex-direction: column; gap: 6px; }
.tool-app label { font-size: 14px; font-weight: 500; }
.tool-app select, .tool-app input {
  font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink);
}
.tool-app select:focus-visible, .tool-app input:focus-visible, .tool-app button:focus-visible, .tool-app summary:focus-visible {
  outline: 3px solid #7AA7DB; outline-offset: 2px;
}
.tool-app button {
  align-self: flex-start; font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 6px; padding: 12px 22px; min-height: 44px; cursor: pointer;
}
.tool-app button:hover { background: #184C87; }
.tool-app .error { color: var(--err); font-size: 14px; }
.tool-app .warning { background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; padding: 10px 14px; border-radius: 6px; }
.tool-app .big { font-size: 24px; font-weight: 600; line-height: 1.3; }
.tool-app .track { position: relative; height: 28px; background: var(--track); border-radius: 6px; margin-top: 18px; overflow: hidden; }
.tool-app .track.thin { height: 14px; margin-top: 8px; border-radius: 4px; }
.tool-app .fill { position: absolute; top: 0; bottom: 0; background: var(--blue); opacity: 0.8; border-radius: inherit; }
.tool-app .fill.open { background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 60%, rgba(0,114,178,0.25) 100%); }
.tool-app .scale { position: relative; height: 38px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.tool-app .scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tool-app .scale span:first-child { transform: none; }
.tool-app .scale span:nth-last-child(2) { transform: translateX(-100%); }
.tool-app .scale span.unit { left: auto; right: 0; top: 18px; transform: none; }
.tool-app .chart-wrap { overflow-x: auto; }
.tool-app .egfr-line { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; }
.tool-app .chart-wrap .chart { min-width: 600px; }
.tool-app .time-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 16px; }
.tool-app .time-row strong { font-weight: 600; }
.tool-app .times { display: flex; flex-direction: column; gap: 18px; }
.tool-app .small { font-size: 14px; color: var(--muted); line-height: 1.5; }
.tool-app .chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.tool-app .chart text { font-family: inherit; }
.tool-app .table-wrap { overflow-x: auto; margin-top: 12px; }
.tool-app table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.tool-app th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px; border-bottom: 1px solid #C5CCD6; }
.tool-app td { padding: 8px; border-bottom: 1px solid var(--track); font-variant-numeric: tabular-nums; }
.tool-app th:first-child, .tool-app td:first-child { padding-left: 0; }
.tool-app .note { background: var(--note-bg); border-radius: 10px; padding: 18px 24px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.tool-app .note h2 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); margin: 0; }
.tool-app .note ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tool-app details { font-size: 14px; }
.tool-app summary { cursor: pointer; color: var(--muted); }
.tool-app pre { margin: 8px 0 0; padding: 12px; background: #F7F9FB; border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.tool-app .empty { color: var(--muted); font-size: 16px; }
.tool-app [hidden] { display: none !important; }
@media (max-width: 520px) {.tool-app h1 { font-size: 22px; }
.tool-app .big { font-size: 20px; }
.tool-app .card { padding: 16px; }

}
.tool-app .callout { background: #EAF2FB; border: 1px solid #9DBBE0; border-radius: 10px; padding: 16px 20px; font-size: 16px; }
.tool-app .callout strong { display: block; margin-bottom: 4px; }
.tool-app .gate p { margin-bottom: 12px; }
.tool-app .gate form { max-width: 420px; }
.tool-app .visually-hidden { position: absolute; left: -9999px; }


.tool-app { min-height: 60vh; font-size: 16px; }
