/* Generated by tools/flow_diagram (py -3.14 -m flowdiag.build --site). Do not edit; edit the tool and rebuild. */
/* =====================================================================
   X-Gen R2 flow player
   Every rule is scoped to #app, so the same stylesheet works on its own
   (the Artifact preview) and inside a vrftools.com page without touching
   the site's header, footer or components. Light only, like the site; the
   piping diagram is drawn on white "paper".
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */

#app {
  --fd-bg: #e9edf1;
  --fd-panel: #ffffff;
  --fd-ink: #17202a;
  --fd-muted: #5b6672;
  --fd-line: #cdd5dd;
  --fd-accent: #1f5fa8;
  --fd-accent-ink: #ffffff;
  --fd-paper: #ffffff;
  --fd-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

/* ---------------------------------------------------------------- layout */

#app,
#app * { box-sizing: border-box; }

#app [hidden] { display: none !important; }

/* Two columns: mode buttons, chart and legend on the left; the diagram takes
   everything else, full height, with the controls floating over its lower-left
   corner (the drawings leave empty paper there). On its own the player fills
   the window; on the site it fills the window under the sticky header. */
#app {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  color: var(--fd-ink);
  background: var(--fd-bg);
  font: 15px/1.4 var(--font-sans, "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif);
}

/* On the site the player fills the window under the header, and grows taller
   than that when the window is too short for the whole drawing plus the
   button strip (the page then scrolls a little). */
.fd-page #app {
  height: auto;
  min-height: max(560px, calc(100vh - var(--header-h, 56px)));
  min-height: max(560px, calc(100dvh - var(--header-h, 56px)));
}

/* The side column takes the row's height and scrolls; it never sets it. */
.fd-page #app .fd-side { contain: size; }

/* The stage is tall enough for the overview drawing at full width plus the
   button strip. --fd-ratio (height / width of the drawing) is set by the
   script from its viewBox; the column is the window less the side column,
   gaps and padding (and maybe a scrollbar, which only adds a little paper). */
.fd-page #app .fd-main {
  min-height: calc((100vw - 390px) * var(--fd-ratio, 0.51) + var(--fd-bar, 76px) + 2px);
}

/* Fullscreen (the button in the controls): the player alone, edge to edge. */
#app:fullscreen,
.fd-page #app:fullscreen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.fd-page #app:fullscreen .fd-main { min-height: 0; }

#app::backdrop { background: #e9edf1; }

#app .fd-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: auto;
}

#app .fd-main {
  position: relative;
  min-width: 0;
  min-height: 0;
}

#app h1 {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

#app h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fd-muted);
}

#app .sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--fd-muted);
}

#app .fd-card {
  padding: 10px 12px;
  background: var(--fd-panel);
  border: 1px solid var(--fd-line);
  border-radius: 10px;
}

#app button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------------------------------------------------------------- mode buttons */

#app #modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#app #modes button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 52px;
  padding: 7px 12px;
  text-align: left;
  color: var(--fd-ink);
  background: var(--fd-panel);
  border: 1px solid var(--fd-line);
  border-radius: 9px;
}

#app #modes button b { font-size: 16px; }
#app #modes button span { font-size: 12.5px; color: var(--fd-muted); }

#app #modes button.on {
  color: var(--fd-accent-ink);
  background: var(--fd-accent);
  border-color: var(--fd-accent);
}

#app #modes button.on span {
  color: var(--fd-accent-ink);
  opacity: 0.85;
}

/* ---------------------------------------------------------------- pressure-enthalpy chart */

#app #chart {
  display: block;
  width: 100%;
  height: auto;
}

#app #chart .ax { fill: none; stroke: var(--fd-ink); stroke-width: 1.4; }
#app #chart .dome { fill: none; stroke: var(--fd-ink); stroke-width: 1.6; }
#app #chart .iso { stroke: var(--fd-line); stroke-width: 1; stroke-dasharray: 3 4; }
#app #chart text { font-size: 9.5px; fill: var(--fd-muted); }

/* the faint whole cycle, the line drawn so far, and the stripes on two-phase pieces */
#app #chart .ghost path { fill: none; stroke-width: 2; opacity: 0.5; }
#app #chart .trail path { fill: none; stroke-width: 4.6; stroke-linecap: round; }
#app #chart path.cs { stroke-dasharray: 4 4; stroke-linecap: butt; }

/* ---------------------------------------------------------------- legend */

#app #legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  font-size: 13.5px;
}

#app #legend div {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

#app #legend i {
  flex: none;
  width: 30px;
  height: 7px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- stage and controls */

/* The bottom of the stage is a strip kept for the buttons (--fd-bar), so the
   drawing never sits under them. */
#app {
  --fd-bar: 76px;
}

#app #stage {
  height: 100%;
  padding-bottom: var(--fd-bar);
  overflow: hidden;
  background: var(--fd-paper);
  border: 1px solid var(--fd-line);
  border-radius: 10px;
}

#app #dg,
#app #dd {
  display: block;
  width: 100%;
  height: 100%;
}

#app #dd { display: none; }
#app.focus #dd { display: block; }
#app.focus #dg { display: none; }

/* Along the bottom of the stage, over empty paper. Fullscreen (and "Whole
   system" in a zoom) sit at the left; the playback buttons are centred, where
   a presenter standing at the middle of a large touchscreen can reach them.
   The bar lets clicks through to the diagram except on its buttons. */
#app #controls {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  pointer-events: none;
}

#app .fd-ctl-left,
#app .fd-ctl-center {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

#app .fd-ctl-left { justify-self: start; }

#app .fd-ctl-center {
  grid-column: 2;
  align-self: stretch;
}

#app #controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: var(--fd-shadow);
}

#app #controls button:active { transform: translateY(1px); }

#app #play {
  min-width: 124px;
  font-size: 18px;
  color: var(--fd-accent-ink);
  background: var(--fd-accent);
  border: 1px solid var(--fd-accent);
}

#app #controls svg {
  width: 20px;
  height: 20px;
}

#app #play .icon-pause { display: none; }
#app #play.playing .icon-pause { display: block; }
#app #play.playing .icon-play { display: none; }

#app #unfocus,
#app #fullscreen {
  font-size: 16px;
  color: var(--fd-accent);
  background: var(--fd-panel);
  border: 1px solid var(--fd-accent);
}

#app #fullscreen svg { width: 18px; height: 18px; }

/* The small buttons either side of Play: back to the last state change, and speed. */
#app #controls .fd-small {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 15px;
  color: var(--fd-accent);
  background: var(--fd-panel);
  border: 1px solid var(--fd-accent);
}

#app #rewind svg { width: 22px; height: 22px; }
#app #speed { min-width: 56px; font-variant-numeric: tabular-nums; }

/* The speed choices open to the right of the speed button, so nothing moves. */
#app .fd-speed { position: relative; }

#app #speed-menu {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 50%;
  transform: translateY(50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--fd-panel);
  border: 1px solid var(--fd-line);
  border-radius: 10px;
  box-shadow: var(--fd-shadow);
}

#app #speed-menu[hidden] { display: none; }

#app #controls #speed-menu button {
  min-height: 40px;
  min-width: 52px;
  padding: 0 8px;
  font-size: 15px;
  color: var(--fd-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

#app #controls #speed-menu button.on {
  color: var(--fd-accent-ink);
  background: var(--fd-accent);
}
#app #fullscreen .icon-shrink { display: none; }
#app:fullscreen #fullscreen .icon-shrink { display: block; }
#app:fullscreen #fullscreen .icon-grow { display: none; }

/* Narrow screens: stack the columns and let the page scroll. */
@media (max-width: 900px) {
  #app,
  .fd-page #app {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  #app #stage,
  #app #dg,
  #app #dd { height: auto; }

  #app #stage { padding-bottom: 0; }

  .fd-page #app .fd-side { contain: none; }
  .fd-page #app .fd-main { min-height: 0; }

  #app #chart {
    max-width: 460px;
    margin-inline: auto;
  }

  #app #controls {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
  }

  /* No room beside the buttons: the speed choices open above them, centred. */
  #app .fd-speed { position: static; }
  #app .fd-ctl-center { position: relative; }

  #app #speed-menu {
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
  }
}

/* =====================================================================
   The diagram (both drawings). Classes come from the build's SVG markup.
   ===================================================================== */

#app .paper { fill: var(--fd-paper); }

/* ---------------------------------------------------------------- pipes */

#app .pipe {
  fill: none;
  stroke: #b3bac2;            /* no pressure: grey; the player sets the stroke when painted */
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#app .pipe.on { stroke-width: 7; }

/* pressure but no flow (or only a trickle): a thinner line */
#app .pipe.on.still,
#app .stripe.still { stroke-width: 3.6; }

#app .pipe-static,
#app .fc { fill: none; stroke: #222; stroke-width: 3; }

#app .capstub { fill: none; stroke: #8a929b; stroke-width: 3; }

/* annulus (pipe-in-pipe) runs are drawn wide */
#app .pipe.ann,
#app .pipe.ann.on { stroke-width: 18; stroke-linecap: square; }
#app .pipe.ann:not(.on) { stroke: #dde2e7; }
#app .stripe.ann { stroke-width: 18; }
#app .casing { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: butt; }

/* ---------------------------------------------------------------- overlays the player adds on painted pipes */

/* two-phase: gas-coloured dashes over the liquid colour; the dash share is the gas fraction */
#app .stripe {
  fill: none;
  stroke-width: 7;
  stroke-dasharray: 11 11;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

/* single-phase flow: white marching dashes */
#app .mv {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.7;
  stroke-width: 2.6;
  stroke-dasharray: 9 21;
  stroke-linecap: round;
  animation: fd-march 0.5s linear infinite;
}

#app .mv.ann {
  stroke-width: 18;
  stroke-linecap: butt;
  stroke-opacity: 0.45;
  stroke-dasharray: 6 24;
}

#app .stripe.flow { animation: fd-stripe-march 0.36s linear infinite; }

#app .stripe.flow.rev,
#app .mv.rev { animation-direction: reverse; }

#app .stripe.flow.mid { animation-duration: 0.9s; }
#app .mv.mid { animation-duration: 1.25s; }
#app .stripe.flow.slow { animation-duration: 5s; }
#app .mv.slow { animation-duration: 7s; stroke-width: 1.8; }

@keyframes fd-stripe-march { to { stroke-dashoffset: -22; } }
@keyframes fd-march { to { stroke-dashoffset: -30; } }

/* Pause freezes the pipes too. */
#app.paused .stripe,
#app.paused .mv { animation-play-state: paused; }

/* ---------------------------------------------------------------- components and labels */

#app .body { fill: #fff; stroke: #222; stroke-width: 2; }
#app .thin { fill: none; stroke: #222; stroke-width: 1.5; }
#app .thick { stroke: #222; stroke-width: 3; }
#app .arc { fill: none; stroke: #222; stroke-width: 2.4; }
#app .dot { fill: #222; }
#app .sensor { fill: #222; }

#app .arrow,
#app .pos,
#app .xmark,
#app .hicbar { display: none; }

#app .lbl {
  font: 18px "Segoe UI", Arial, Helvetica, sans-serif;
  fill: #222;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

#app .lbl.sm { font-size: 16px; }
#app .lbl.b { font-size: 20px; font-weight: 700; }

#app #dd .lbl { font-size: 15px; }
#app #dd .lbl.sm { font-size: 13px; }
#app #dd .idumode { font-size: 14px; }

#app .t-offpage .lbl { font-weight: 700; fill: #1f5fa8; }
#app .t-offpage .dot { fill: #1f5fa8; }

#app .bcbox { fill: none; stroke: #59626c; stroke-width: 1.5; stroke-dasharray: 14 6 3 6; }
#app .hicshell { fill: #e9edf1; stroke: #2b3138; stroke-width: 2.5; }

/* strainers are left out of the simplified overview */
#app #dg .t-strainer { display: none; }

/* ---------------------------------------------------------------- component state set per mode */

/* solenoid coil: green open, red closed */
#app .t-solenoid .coil {
  fill: #2fa84f;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(1.7);
}
#app .t-solenoid.sv-closed .coil { fill: #e0262b; }

/* 4-way valve spool turns when energized */
#app .spool { transition: transform 0.4s; }
#app .energized .spool { transform: rotate(90deg); }

/* a shut LEV is filled dark */
#app .t-lev.shut .body { fill: #4a525b; }
#app .t-lev.shut .thin { stroke: #fff; }

/* indoor units: coil tint and mode label */
#app .idu.cool .body { fill: #e3f1fd; }
#app .idu.heat .body { fill: #fde7e3; }
#app .idu.off .body { fill: #eef0f2; }

#app .idumode { font: 700 17px "Segoe UI", Arial, sans-serif; fill: #8a929b; }
#app .idumode.cool { fill: #1b3f9e; }
#app .idumode.heat { fill: #d92525; }

/* ---------------------------------------------------------------- orbs */

#app .orb .halo { opacity: 0.75; }
#app .orb .core { fill: #fff; stroke-width: 4; }
#app .orb .ring { fill: none; stroke-width: 4; stroke-dasharray: 5.76 5.76; }

/* ---------------------------------------------------------------- tap-to-zoom areas in the overview */

#app .zone {
  fill: transparent;
  stroke: transparent;
  stroke-width: 4;
  stroke-dasharray: 16 9;
  cursor: zoom-in;
}

#app .zone:hover { fill: rgba(31, 95, 168, 0.05); stroke: #1f5fa8; }

#app .hint { font: 15px "Segoe UI", Arial, sans-serif; fill: #1f5fa8; }
