@charset "UTF-8";

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #eef2f5;
  color: #1f2328;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SCROLLBAR — blauwtint matching the engineering theme
   ============================================================ */
html { scrollbar-color: #9ec5fe #eef2f5; scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track {
  background: #eef2f5;
  border-left: 1px solid #e1e4e8;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #9ec5fe 0%, #54aeff 100%);
  border: 2px solid #eef2f5;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #54aeff 0%, #0969da 100%);
}
::-webkit-scrollbar-corner { background: #eef2f5; }

/* ============================================================
   APP SHELL (boxed)
   ============================================================ */
.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06),
              0 12px 36px rgba(15,30,60,0.06);
  overflow: hidden;
  border: 1px solid #e1e4e8;
}

/* ============================================================
   ICONS (Lucide)
   ============================================================ */
.icon, .icon-sm, .icon-md {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 1.6;
}
.icon-sm { width: 13px; height: 13px; margin-right: 6px; }
.icon-md { width: 16px; height: 16px; margin-right: 8px; }
.icon    { width: 18px; height: 18px; margin-right: 8px; stroke-width: 1.5; }
[data-lucide] { display: inline-block; }
button .icon-sm { margin-right: 5px; }
.mono {
  font-family: "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PAGE HEADER (sticky)
   ============================================================ */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 4px 12px -8px rgba(0,0,0,0.05);
}
.page-header-text { min-width: 0; }
.page-header h1 {
  display: flex;
  align-items: center;
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1f2328;
}
.page-header h1 .icon { color: #0969da; }
.page-header .subtitle {
  margin: 0 0 0 26px;
  font-size: 12px;
  color: #57606a;
  letter-spacing: 0.02em;
}
.page-header .badge {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 7px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  font-size: 10px;
  color: #57606a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* Header stats — KPI pills right-aligned */
.header-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  font-size: 11px;
  color: #57606a;
  white-space: nowrap;
}
.stat-pill .stat-icon {
  color: #0969da;
  flex-shrink: 0;
}
.stat-pill .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e7781;
}
.stat-pill .stat-value {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  color: #1f2328;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-pill .stat-uom {
  color: #57606a;
  font-weight: 400;
  font-size: 11px;
  margin-left: 1px;
}
.stat-pill.ok { background: #dafbe1; border-color: #56d364; }
.stat-pill.ok .stat-icon, .stat-pill.ok .stat-value { color: #1a7f37; }
.stat-pill.ko { background: #ffebe9; border-color: #ff8182; }
.stat-pill.ko .stat-icon, .stat-pill.ko .stat-value { color: #cf222e; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
}
.config-panel {
  background: #fff;
  border-right: 1px solid #e1e4e8;
  padding: 18px 20px 24px;
}
.results-panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============================================================
   CONFIG GROUPS
   ============================================================ */
.group { margin-bottom: 18px; }
.group-header {
  display: flex;
  align-items: center;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #57606a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.group-header .icon-sm {
  color: #0969da;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.field-row label {
  font-size: 12px;
  color: #1f2328;
}
.field-row .unit {
  font-size: 11px;
  color: #57606a;
  margin-left: 4px;
}
.field-row input[type="number"] {
  width: 78px;
  padding: 5px 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  background: #fff;
  color: #1f2328;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color 150ms cubic-bezier(.2,.8,.2,1),
              box-shadow 150ms cubic-bezier(.2,.8,.2,1);
}
.field-row input[type="number"]:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}
.field-row input[readonly] {
  background: #f6f8fa;
  color: #57606a;
  cursor: not-allowed;
  border-color: #e1e4e8;
}

/* Pill segmented control (used by material switch) */
.pill-group {
  display: inline-flex;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.pill-group label {
  padding: 4px 10px;
  font-size: 11px;
  color: #57606a;
  cursor: pointer;
  transition: background 150ms cubic-bezier(.2,.8,.2,1),
              color 150ms cubic-bezier(.2,.8,.2,1);
  user-select: none;
}
.pill-group label + label { border-left: 1px solid #d0d7de; }
.pill-group label.active {
  background: #0969da;
  color: #fff;
  animation: micro-bounce 200ms cubic-bezier(.2,.8,.2,1);
}
@keyframes micro-bounce {
  0%   { transform: scale(0.95); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Pill toggle — outline style with fixture icon */
.pill-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  font-size: 11px;
  border: 1.5px solid #d0d7de;
  border-radius: 14px;
  background: transparent;
  color: #57606a;
  cursor: pointer;
  user-select: none;
  transition: background 150ms cubic-bezier(.2,.8,.2,1),
              color 150ms cubic-bezier(.2,.8,.2,1),
              border-color 150ms cubic-bezier(.2,.8,.2,1),
              opacity 150ms cubic-bezier(.2,.8,.2,1);
}
.pill-toggle:hover { border-color: #54aeff; color: #1f2328; }
.pill-toggle.on {
  background: rgba(9, 105, 218, 0.08);
  color: #0550ae;
  border-color: #0969da;
  animation: micro-bounce 200ms cubic-bezier(.2,.8,.2,1);
}
.pill-toggle.disabled {
  opacity: 0.4;
  filter: grayscale(0.6);
}
.pill-toggle.disabled:hover {
  opacity: 0.65;
  border-color: #0969da;
}
.pill-toggle .pill-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
}

/* Range slider */
.slider-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}
.slider-row label {
  color: #1f2328;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slider-row .unit {
  font-size: 11px;
  color: #57606a;
  margin-left: 4px;
}
.slider-control {
  display: grid;
  grid-template-columns: 1fr 60px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.slider-control input[type="range"] {
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(to right, #0969da var(--fill, 30%), #d0d7de var(--fill, 30%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #0969da;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 150ms cubic-bezier(.2,.8,.2,1);
}
.slider-control input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
.slider-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #0969da;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.slider-value {
  text-align: right;
  font-size: 11.5px;
  color: #1f2328;
  white-space: nowrap;
  overflow: visible;
  font-weight: 400;
}
.slider-value .num { font-weight: 600; }
.slider-value .uom { color: #57606a; font-weight: 400; margin-left: 2px; }

/* Summary line */
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 2px;
  border-top: 1px solid #e1e4e8;
  margin-top: 10px;
  font-size: 12px;
  color: #57606a;
}
.summary-line .accent {
  color: #0969da;
  font-weight: 600;
  font-size: 13px;
}

/* Visuele scheiding wijzigbaar vs vast */
.config-block {
  background: #fff;
}
.readonly-block {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 14px 16px 6px;
  margin-top: 18px;
  position: relative;
}
.readonly-banner {
  font-size: 9.5px;
  text-transform: uppercase;
  color: #6e7781;
  letter-spacing: 0.10em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #d0d7de;
  font-weight: 600;
}
.readonly-block .group { margin-bottom: 12px; }
.readonly-block .group:last-child { margin-bottom: 0; }
.readonly-block .group-header {
  font-size: 10px;
  color: #6e7781;
}
.readonly-block .coeff-table,
.readonly-block .const-table {
  font-size: 10.5px;
}

/* Readonly tables */
.coeff-table, .const-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.coeff-table td, .const-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #f1f3f5;
}
.coeff-table td:first-child, .const-table td:first-child { color: #1f2328; }
.coeff-table td:last-child, .const-table td:last-child {
  text-align: right;
  color: #57606a;
  font-family: "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.coeff-table tr:hover td, .const-table tr:hover td { background: #fafbfc; }
.const-table .symbol {
  font-style: italic;
  color: #0969da;
  font-weight: 500;
}
.formula-line {
  margin: 6px 0 0;
  padding: 6px 8px;
  background: #f6f8fa;
  border-radius: 4px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11.5px;
  color: #1f2328;
  cursor: help;
}

/* Preset row */
.preset-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.preset-row button {
  flex: 1;
  padding: 6px 8px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 11px;
  color: #1f2328;
  cursor: pointer;
  transition: background 120ms cubic-bezier(.2,.8,.2,1),
              border-color 120ms cubic-bezier(.2,.8,.2,1),
              color 120ms cubic-bezier(.2,.8,.2,1);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.preset-row button:hover { background: #eaeef2; border-color: #afb8c1; }
.preset-row button.flash { background: #0969da; color: #fff; border-color: #0969da; }

/* ============================================================
   PANELS / TABLE
   ============================================================ */
.panel {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid #e1e4e8;
  background: #f6f8fa;
}
.panel-title {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #1f2328;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.panel-title .icon-sm { color: #0969da; }
.math-section h2, .practice-viz h2 { display: flex; align-items: center; }
.math-section h2 .icon-md, .practice-viz h2 .icon-md { color: #0969da; }
.readonly-banner { display: flex; align-items: center; }
.readonly-banner .icon-sm { color: #6e7781; }
.panel-meta { font-size: 11px; color: #57606a; }

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.results thead th {
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
  font-weight: 600;
  color: #57606a;
  text-align: right;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
table.results thead th:first-child { text-align: left; }
table.results tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f3f5;
  text-align: right;
  font-family: "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  transition: background 120ms cubic-bezier(.2,.8,.2,1);
}
table.results tbody td:first-child {
  text-align: left;
  font-family: inherit;
  color: #1f2328;
  font-weight: 500;
}
table.results tbody tr:last-child td { border-bottom: none; }
table.results tbody tr:hover td { background: #f6f8fa; cursor: default; }
table.results tbody tr.row-active td { background: #ddf4ff !important; }
table.results tbody td.flash { animation: cell-flash 600ms cubic-bezier(.2,.8,.2,1); }
@keyframes cell-flash {
  0%   { background-color: #ddf4ff; }
  100% { background-color: transparent; }
}
.seg-label { display: inline-flex; align-items: center; gap: 6px; }
.seg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #0969da; }
.cell-overmax { color: #cf222e; font-weight: 500; }

/* ============================================================
   MAIN SVG (building + riser)
   ============================================================ */
.svg-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #e1e4e8;
  background: #fff;
  font-size: 11px;
}
.svg-toolbar .label { color: #57606a; }
.main-svg-wrap {
  padding: 16px;
  background: #fff;
  position: relative;
}
.main-svg-wrap svg { width: 100%; height: auto; display: block; }
.pressure-watermark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-size: 10.5px;
  color: #8c959f;
  font-family: "SF Mono", Consolas, monospace;
}

/* ============================================================
   MATH SECTION — 3 columns of accordion-style segment blocks
   ============================================================ */
.math-section {
  padding: 16px 24px 22px;
  background: #fff;
  border-top: 1px solid #e1e4e8;
}
.math-section h2,
.practice-viz h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.math-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) {
  .math-grid { grid-template-columns: 1fr; }
}

/* Each math-block is a <details> container styled as a card */
.math-accordion details,
.math-grid > details {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
}
.math-grid > details summary,
.math-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0969da;
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
  transition: background 120ms cubic-bezier(.2,.8,.2,1);
  user-select: none;
}
.math-grid > details:not([open]) summary,
.math-accordion details:not([open]) summary {
  border-bottom-color: transparent;
}
.math-grid > details summary::-webkit-details-marker,
.math-accordion summary::-webkit-details-marker { display: none; }
.math-grid > details summary::before,
.math-accordion summary::before {
  content: "\25B8";
  display: inline-block;
  width: 10px;
  font-size: 10px;
  color: #57606a;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1);
}
.math-grid > details[open] summary::before,
.math-accordion details[open] summary::before { transform: rotate(90deg); }
.math-grid > details summary:hover,
.math-accordion summary:hover { background: #eaeef2; }
.math-grid > details[open] summary,
.math-accordion details[open] summary { background: #ddf4ff; }
.math-grid > details .summary-meta,
.math-accordion .summary-meta {
  margin-left: auto;
  font-size: 10.5px;
  color: #57606a;
  font-weight: 400;
  font-family: "SF Mono", Consolas, monospace;
}
.math-grid > details .acc-body,
.math-accordion .acc-body {
  padding: 14px 60px 18px 18px;
  background: #fafbfc;
  position: relative;
}
/* Timeline rail on the right of the accordion body */
.math-grid > details .acc-body::before,
.math-accordion .acc-body::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  right: 32px;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(84, 174, 255, 0) 0%,
    #54aeff 6%,
    #54aeff 94%,
    rgba(84, 174, 255, 0) 100%);
  z-index: 0;
}
.math-block {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  transition: background 200ms cubic-bezier(.2,.8,.2,1);
}
.math-block.active > summary { background: #54aeff !important; color: #fff; }
.math-block.active > summary::before { color: #fff; }
.math-block.active > summary .summary-meta { color: rgba(255,255,255,0.85); }
.math-step {
  margin: 14px 0;
  padding-left: 14px;
  border-left: 2px solid #f1f3f5;
}
.math-step .step-title {
  font-size: 11px;
  color: #57606a;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.math-step .step-comment {
  font-size: 11.5px;
  color: #57606a;
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
  cursor: help;
  border-bottom: 1px dotted transparent;
}
.math-step .step-comment:hover { border-bottom-color: #afb8c1; }
.math-step {
  position: relative;
  /* Right padding kept small — the timeline rail lives in .acc-body's right padding */
}
.math-step + .math-step { margin-top: 22px; }
.math-step .step-counter {
  position: absolute;
  top: 4px;
  right: -42px;   /* center on the timeline rail at acc-body right:32px */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #54aeff;
  color: #0550ae;
  font-size: 13px;
  font-weight: 700;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 4px #fafbfc; /* match acc-body bg, hide rail behind node */
  z-index: 2;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1),
              border-color 200ms cubic-bezier(.2,.8,.2,1),
              background 200ms cubic-bezier(.2,.8,.2,1);
}
.math-step:hover .step-counter {
  background: #0969da;
  color: #fff;
  border-color: #0969da;
  transform: scale(1.08);
}
.math-step .step-formula {
  font-family: "Cambria Math", "STIX Two Math", Cambria, "Charter", "Iowan Old Style", Georgia, serif;
  font-size: 15px;
  color: #1f2328;
  background: linear-gradient(180deg, #fafbfc 0%, #f6f8fa 100%);
  border: 1px solid #e1e4e8;
  border-left: 3px solid #54aeff;
  padding: 16px 18px;
  border-radius: 6px;
  white-space: pre-wrap;
  line-height: 1.8;
  letter-spacing: 0.01em;
}
/* KaTeX inside formula blocks — consistent larger size */
.math-step .step-formula .katex { font-size: 1.30em; }
.math-step .step-formula .katex-display {
  margin: 0.4em 0;
  text-align: left;
}
.math-step .step-formula .katex-display > .katex { text-align: left; }
.math-step .step-formula .formula-line + .formula-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e1e4e8;
}
.ok { color: #1a7f37; font-weight: 600; }
.ko { color: #cf222e; font-weight: 600; }

/* ============================================================
   PRACTICE VISUALISATIONS
   ============================================================ */
.practice-viz {
  padding: 16px 24px 20px;
  background: #fafbfc;
  border-top: 1px solid #e1e4e8;
}
.practice-viz h2 { margin: 0 0 10px; }
.viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 1100px) {
  .viz-grid { grid-template-columns: 1fr; }
}
.viz-panel {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.viz-panel .panel-header {
  padding: 6px 12px;
}
.viz-panel .panel-body {
  padding: 6px 10px 4px;
  flex: 1;
}
.viz-panel .panel-body > svg {
  width: 100%;
  height: auto;
  display: block;
}
.viz-caption {
  padding: 4px 12px 8px;
  font-size: 10.5px;
  color: #6e7781;
  font-style: italic;
  line-height: 1.4;
  border-top: 1px dashed #f1f3f5;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip {
  position: fixed;
  z-index: 1000;
  background: #1f2328;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.4;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms cubic-bezier(.2,.8,.2,1);
  max-width: 280px;
  white-space: normal;
}
.tooltip.visible { opacity: 1; }
.tooltip strong { color: #79c0ff; font-weight: 600; }
.tooltip .small { color: #afb8c1; font-size: 10.5px; }

/* ============================================================
   SCROLL FADE-IN
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 250ms cubic-bezier(.2,.8,.2,1),
              transform 250ms cubic-bezier(.2,.8,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   SVG STYLE FOR PIPES + ANIMATIONS
   ============================================================ */
.pipe {
  stroke: #0969da;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width 300ms cubic-bezier(.2,.8,.2,1),
              stroke 200ms cubic-bezier(.2,.8,.2,1),
              filter 200ms cubic-bezier(.2,.8,.2,1);
}
.pipe-bg { stroke: #cce4f7; fill: none; }
.pipe-segment { cursor: pointer; }
.pipe-segment.hl {
  stroke: #0550ae;
  filter: drop-shadow(0 0 3px rgba(9,105,218,0.45));
}
.floor-block { stroke: #d0d7de; stroke-width: 1; fill: #fafbfc; }
.apt-rect { stroke: #afb8c1; stroke-width: 0.7; fill: #fff; }
.axis { stroke: #afb8c1; stroke-width: 0.5; fill: none; }
.grid-line { stroke: #f1f3f5; stroke-width: 0.5; }
.label-text {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 10px;
  fill: #57606a;
}
.label-text.dark { fill: #1f2328; }
.label-text.accent { fill: #0969da; font-weight: 600; }
.axis-label {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 10px;
  fill: #57606a;
}

/* Stromend water — animated dashes overlay on pipes (seamless loop: offset = -2*pattern) */
.water-flow {
  stroke: #79c0ff;
  stroke-opacity: 0.9;
  stroke-dasharray: 8 12;
  fill: none;
  stroke-linecap: round;
  animation-name: water-flow;
  animation-duration: var(--flow-speed, 1.4s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
}
@keyframes water-flow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -40; } }

/* Fixture icons */
.fixture-icon { cursor: help; transition: transform 150ms cubic-bezier(.2,.8,.2,1); transform-origin: center; transform-box: fill-box; }
.fixture-icon:hover { transform: scale(1.15) translateZ(0); }

/* Floor tabs (verdiepingsplan switcher) */
.floor-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 10px 0;
  flex-wrap: wrap;
}
.floor-tab {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #d0d7de;
  border-bottom-color: transparent;
  border-radius: 5px 5px 0 0;
  background: #f6f8fa;
  color: #57606a;
  cursor: pointer;
  user-select: none;
  transition: background 120ms cubic-bezier(.2,.8,.2,1), color 120ms cubic-bezier(.2,.8,.2,1);
}
.floor-tab:hover { background: #eaeef2; color: #1f2328; }
.floor-tab.active {
  background: #fff;
  color: #0969da;
  font-weight: 600;
  border-color: #e1e4e8;
  border-bottom-color: #fff;
  position: relative;
  z-index: 1;
}

/* SVG enter/update animations */
.svg-fade-in { animation: svg-enter 280ms cubic-bezier(.2,.8,.2,1); transform-origin: center center; }
@keyframes svg-enter {
  from { opacity: 0; transform: translateY(4px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Marker (circle) hover scale */
.viz-marker {
  transition: r 200ms cubic-bezier(.2,.8,.2,1),
              fill 200ms cubic-bezier(.2,.8,.2,1),
              stroke-width 200ms cubic-bezier(.2,.8,.2,1);
  transform-box: fill-box;
  transform-origin: center;
  cursor: pointer;
}
.viz-marker:hover { stroke-width: 3; }

/* LU bar segment hover */
.lu-bar-seg {
  transition: filter 180ms cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}
.lu-bar-seg:hover { filter: brightness(1.10); }

/* Nomogram point + tracé lines */
.nomogram-pt circle {
  transition: r 200ms cubic-bezier(.2,.8,.2,1),
              stroke-width 200ms cubic-bezier(.2,.8,.2,1);
}
.nomogram-trace {
  stroke: #0969da;
  stroke-dasharray: 3 3;
  stroke-width: 1;
  fill: none;
  opacity: 0;
  transition: opacity 180ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.nomogram-pt:hover ~ .nomogram-trace,
.nomogram-trace.active { opacity: 0.7; }

/* Pressure curve gradient fill (defined as SVG <defs>; see pressure.fill) */
.pressure-fill { fill: url(#pressureGradient); opacity: 0.18; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body { background: #fff; }
  .config-panel, .copy-btn, .preset-row, .svg-toolbar { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .math-grid, .viz-grid { gap: 8px; }
  .math-block, .viz-panel { break-inside: avoid; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Water-flow conveys data (Q-evenredige snelheid). Houden we draaiende, maar trager. */
  .water-flow {
    animation-duration: var(--flow-speed, 2.5s) !important;
    animation-iteration-count: infinite !important;
  }
}
