/* Bioreactor / Perfusion — 37degrees. Scoped to .br-root. Dark default + .br-theme-light. */
.br-root {
  --br-navy-900: #082540; --br-navy-950: #04141f; --br-navy-700: #133b56; --br-navy-400: #5d83a1;
  --br-text: #dde4ed; --br-muted: #8ba5bd; --br-accent: #ff7bac; --br-accent-2: #ec1f6a; --br-green: #34d399; --br-grid: rgba(141,165,189,0.3);
  --br-surface: rgba(4,20,31,0.55); --br-radius: 14px; --br-radius-sm: 10px;
  --br-mono: "JetBrains Mono","SFMono-Regular",ui-monospace,Menlo,Consolas,monospace;
  --br-font: "Nunito Sans Variable","Nunito Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  position: relative; font-family: var(--br-font); color: var(--br-text);
  background: linear-gradient(180deg,var(--br-navy-900) 0%,var(--br-navy-950) 100%);
  border: 1px solid var(--br-navy-700); border-radius: var(--br-radius); padding: 24px;
  display: grid; grid-template-columns: minmax(0,0.85fr) minmax(0,1.15fr);
  grid-template-areas: "header header" "rail result" "footer footer"; gap: 18px;
  box-shadow: 0 10px 40px rgba(4,20,31,0.35); box-sizing: border-box; max-width: 100%;
}
.br-root *, .br-root *::before, .br-root *::after { box-sizing: border-box; }
@media (max-width: 820px) { .br-root { grid-template-columns: 1fr; grid-template-areas: "header" "rail" "result" "footer"; } }
.br-root.br-theme-light {
  --br-text: #082540; --br-muted: #5d83a1; --br-navy-700: #dde4ed; --br-grid: rgba(8,37,64,0.25); --br-surface: #f7f9fc;
  background: linear-gradient(180deg,#ffffff 0%,#f1f4f8 100%); border-color: #dde4ed; box-shadow: 0 6px 24px rgba(8,37,64,0.08);
}
.br-root.br-theme-light .br-card, .br-root.br-theme-light .br-result, .br-root.br-theme-light .br-stat, .br-root.br-theme-light .br-viz { background: #fff; border-color: #dde4ed; color: var(--br-text); }

.br-header { grid-area: header; display: flex; flex-direction: column; gap: 4px; }
.br-eyebrow { font-size: 11px; letter-spacing: 3px; font-weight: 800; color: var(--br-accent); }
.br-title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.br-subtitle { font-size: 14px; color: var(--br-muted); line-height: 1.45; }

.br-rail { grid-area: rail; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.br-card { background: rgba(8,37,64,0.4); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.br-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.br-label { font-size: 11px; letter-spacing: 1.5px; font-weight: 800; color: var(--br-muted); text-transform: uppercase; }
.br-inline { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.br-num { flex: 1 1 80px; min-width: 0; font-family: var(--br-mono); font-size: 15px; font-weight: 700; color: var(--br-text); background: var(--br-surface); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius-sm); padding: 9px 11px; outline: none; }
.br-num:focus { border-color: var(--br-accent); box-shadow: 0 0 0 3px rgba(255,123,172,0.18); }
.br-unit { flex: 0 0 auto; font-family: var(--br-font); font-size: 13px; font-weight: 700; color: var(--br-text); background: var(--br-surface); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius-sm); padding: 9px 8px; outline: none; cursor: pointer; }
.br-suffix { flex: 0 0 auto; font-size: 12px; color: var(--br-muted); font-weight: 700; white-space: nowrap; }

.br-result { grid-area: result; background: rgba(8,37,64,0.4); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.br-result-title { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: var(--br-accent); text-transform: uppercase; }
.br-big { font-family: var(--br-mono); font-size: 30px; font-weight: 800; color: var(--br-text); line-height: 1.1; }
.br-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 8px; }
.br-stat { background: var(--br-surface); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius-sm); padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.br-stat-label { font-size: 9.5px; letter-spacing: 1px; font-weight: 800; color: var(--br-muted); text-transform: uppercase; }
.br-stat-value { font-family: var(--br-mono); font-size: 16px; font-weight: 800; color: var(--br-text); }
.br-viz { background: var(--br-surface); border: 1px solid var(--br-navy-700); border-radius: var(--br-radius-sm); padding: 8px; display: flex; justify-content: center; }
.br-vessel { width: 100%; max-width: 280px; height: auto; display: block; }
.br-glass { stroke: var(--br-muted); stroke-width: 3; opacity: 0.7; }
.br-liquid { fill: rgba(52,211,153,0.18); stroke: var(--br-green); stroke-width: 1.5; }
.br-shaft { stroke: var(--br-muted); stroke-width: 2; opacity: 0.6; }
.br-impeller { fill: none; stroke: var(--br-muted); stroke-width: 2.5; opacity: 0.7; }
.br-flow { stroke: var(--br-accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 7 8; }
.br-vlabel { fill: var(--br-muted); font-family: var(--br-font); font-size: 11px; font-weight: 700; }
@keyframes br-dash { to { stroke-dashoffset: -30; } }

.br-footer { grid-area: footer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--br-muted); }
.br-footer a { color: var(--br-text); text-decoration: none; font-weight: 700; }
.br-footer-brand { color: #ff7bac !important; font-weight: 700; } .br-footer-brand:hover { color: #ec1f6a !important; text-decoration: underline; } .br-footer-sep { opacity: 0.5; }
.br-fatal { padding: 16px; border-radius: 10px; background: rgba(236,31,106,0.12); border: 1px solid #ec1f6a; color: #fff; }

.br-expand-icon { position: absolute; top: 14px; right: 14px; z-index: 50; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: rgba(255,123,172,0.10); color: #ec1f6a; border: 1px solid rgba(255,123,172,0.30); border-radius: 10px; cursor: pointer; padding: 0; font-family: inherit; transition: background .12s, transform .12s; }
.br-expand-icon:hover { background: rgba(255,123,172,0.22); transform: scale(1.05); }
.br-expand-icon-label { display: none; }
.br-brand-mark { display: none; }
html.br-html-locked, body.br-body-locked { overflow: hidden !important; height: 100vh !important; }
.br-root.br-is-expanded { position: fixed; inset: 0; z-index: 99990; margin: 0; border: none; border-radius: 0; box-shadow: none; background: #fff; color: #082540; --br-text: #082540; --br-muted: #5d83a1; --br-navy-700: #dde4ed; --br-grid: rgba(8,37,64,0.25); --br-surface: #f7f9fc; grid-template-columns: 360px minmax(0,1fr); grid-template-areas: "brand result" "rail result" "footer footer"; grid-template-rows: auto minmax(0,1fr) auto; gap: 0; padding: 0; height: 100vh; overflow: hidden; }
.br-root.br-is-expanded .br-header { display: none; }
.br-root.br-is-expanded .br-rail { grid-area: rail; overflow-y: auto; padding: 18px; border-right: 1px solid #dde4ed; background: #f1f4f8; min-height: 0; }
.br-root.br-is-expanded .br-result { grid-area: result; overflow-y: auto; min-height: 0; background: #fff; padding: 24px; }
.br-root.br-is-expanded .br-card, .br-root.br-is-expanded .br-stat, .br-root.br-is-expanded .br-viz { background: #fff; border-color: #dde4ed; color: #082540; }
.br-root.br-is-expanded .br-expand-icon { position: fixed; top: 18px; right: 22px; z-index: 99991; }
.br-root.br-is-expanded .br-rail .br-expand-icon { position: static; top: auto; right: auto; width: 100%; height: 40px; margin-bottom: 4px; gap: 8px; justify-content: center; font-weight: 800; font-size: 13px; }
.br-root.br-is-expanded .br-expand-icon-label { display: inline-block; }
.br-root.br-is-expanded .br-brand-mark { grid-area: brand; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; background: #082540; font-family: var(--br-font); font-weight: 800; font-size: 15px; line-height: 1; padding: 14px 20px; }
.br-root.br-is-expanded .br-brand-mark svg { height: 28px; width: 28px; display: block; }
.br-root.br-is-expanded .br-brand-mark .br-brand-sep { color: #ff7bac; margin: 0 2px; } .br-root.br-is-expanded .br-brand-mark .br-tool-name { color: #ff7bac; }
.br-root.br-is-expanded .br-footer { grid-area: footer; background: #082540; padding: 12px 24px; justify-content: center; margin: 0; }
.br-root.br-is-expanded .br-footer, .br-root.br-is-expanded .br-footer span { color: #fff; } .br-root.br-is-expanded .br-footer a { color: #ff7bac; }
@media (max-width: 960px) { .br-root.br-is-expanded { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0,1fr) auto; grid-template-areas: "brand" "rail" "result" "footer"; } .br-root.br-is-expanded .br-rail { border-right: none; border-bottom: 1px solid #e4ecf2; max-height: 40vh; } .br-root.br-is-expanded .br-brand-mark .br-brand-sep, .br-root.br-is-expanded .br-brand-mark .br-tool-name { display: none; } }
@media (max-width: 640px) { .br-root { padding: 18px; } .br-title { font-size: 19px; } }
