/* Hareketli açıklayıcılar (js/commissioning-viz.js). Renkler style.css token'larından. */
.cviz {
  --c-water: #38BDF8;
  --c-air: #E2E8F0;
  --c-ok: #34D399;
  --c-bad: #F87171;
  --c-line: rgba(240, 230, 255, 0.14);
  margin: 30px 0;
  padding: 20px;
  background: var(--card-solid);
  border: 1px solid var(--card-border-hover);
  border-radius: var(--radius-sm);
}
.cviz:not(.is-ready):not(.is-js):not(:has(.cviz-still)) { display: none; }
/* Durağan kare: JS yokken / kurulum öncesi görünür; görsel kurulunca gizlenir (js/viz/core.js) */
.cviz-still { display: block; width: 100%; height: auto; border-radius: 8px; }
.cviz.is-ready .cviz-still { display: none; }
/* Durağan karede etkileşim öğeleri yok */
.cviz-stage.is-still .cviz-slider, .cviz-stage.is-still .cviz-readout, .cviz-stage.is-still .cviz-chips { display: none; }
.cviz figcaption { text-align: left; font-style: normal; margin-top: 14px; font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary); }
.cviz figcaption strong { color: var(--text); }
.cviz .dim { color: var(--text-muted); }
.cviz .ok { color: var(--c-ok); font-weight: 600; }
.cviz .bad { color: var(--c-bad); font-weight: 600; }

.cviz-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; margin-top: 12px;
  color: #fff; background: var(--accent-fire); border: 1px solid var(--accent-fire);
  transition: transform var(--transition), opacity var(--transition);
}
.cviz-btn:hover { transform: translateY(-1px); }
.cviz-btn.ghost { background: transparent; color: var(--text-secondary); border-color: var(--c-line); }
.cviz button:focus-visible, .cviz input:focus-visible { outline: 2px solid var(--accent-fire); outline-offset: 2px; }

.cviz-readout { margin: 12px 0 0; font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cviz-readout b, .cviz-readout strong { color: var(--text); }

.cviz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cviz-chips button {
  font: inherit; font-size: 0.85rem; cursor: pointer; padding: 6px 12px; border-radius: 999px;
  color: var(--text-secondary); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--c-line);
  transition: all var(--transition);
}
.cviz-chips button span { color: var(--text-muted); }
.cviz-chips button.on { color: #fff; background: rgba(249, 115, 22, 0.18); border-color: var(--accent-fire); }

/* Kaydırıcılar */
.cviz-inputs { display: grid; gap: 12px; }
.cviz-slider { display: grid; gap: 6px; font-size: 0.86rem; color: var(--text-secondary); }
.cviz-slider[hidden], .cviz-check[hidden] { display: none; }
.cviz-slider .t { display: flex; justify-content: space-between; gap: 10px; }
.cviz-slider output { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cviz-slider input[type=range] { width: 100%; accent-color: var(--accent-fire); }
.cviz-check { font-size: 0.86rem; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; cursor: pointer; }
.cviz-check input { accent-color: var(--accent-fire); width: 16px; height: 16px; }

/* Gösterge */
.cviz-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.cviz-gauge { text-align: center; }
.cviz-gauge svg { width: 100%; max-width: 220px; display: block; margin: 0 auto; overflow: visible; }
.cviz-gauge .g-track, .cviz-gauge .g-fill { fill: none; stroke-width: 8; stroke-linecap: round; }
.cviz-gauge .g-track { stroke: rgba(255, 255, 255, 0.07); }
.cviz-gauge .g-fill { stroke: var(--accent-fire); stroke-dasharray: 0 100; }
.cviz-gauge .g-ticks line { stroke: var(--text-muted); stroke-width: 1; }
.cviz-gauge .g-needle { transform-origin: 60px 62px; transform: rotate(-90deg); }
.cviz-gauge .g-needle line { stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
.cviz-gauge .g-needle circle { fill: var(--text); }
.cviz-gauge .g-val { font-size: 1.15rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cviz-gauge .g-val span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.cviz-gauge .g-label { font-size: 0.78rem; color: var(--text-muted); }

/* İlerleme / saat çubukları */
.cviz-clock, .cviz-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 14px; font-size: 0.85rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cviz-clock .track, .cviz-progress .track, .cviz-lane .track, .cviz-bar .track {
  position: relative; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden;
}
.cviz-clock .fill, .cviz-progress .fill, .cviz-bar .fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--accent-fire);
}
.cviz-progress .fill { transition: width var(--transition); background: var(--c-ok); }
.cviz-progress .cviz-btn { margin: 0; padding: 4px 10px; font-size: 0.78rem; }

/* 1) Sıra + kolon şeması */
.cviz-seq { display: grid; gap: 16px; }
.cviz-riser { width: 100%; max-width: 600px; display: block; margin: 0 auto; }
.cviz-riser .ground { stroke: var(--text-muted); stroke-dasharray: 3 4; }
.cviz-riser .pipe { fill: none; stroke: rgba(240, 230, 255, 0.32); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--transition); }
.cviz-riser .pipe.thin { stroke-width: 4; }
.cviz-riser path:not(.pipe):not(.flow):not(.head):not(.comp) { stroke: rgba(240, 230, 255, 0.32); stroke-width: 3; }
.cviz-riser .head { fill: rgba(240, 230, 255, 0.5); }
.cviz-riser .comp { fill: #1b1433; stroke: rgba(240, 230, 255, 0.45); stroke-width: 1.5; transition: all var(--transition); }
.cviz-riser .lbl { font-size: 11.5px; fill: var(--text-secondary); font-family: var(--font); }
.cviz-riser .lbl.dim { fill: var(--text-muted); }
.cviz-riser g.on .pipe { stroke: rgba(249, 115, 22, 0.75); }
.cviz-riser g.on .comp { stroke: var(--accent-fire); fill: rgba(249, 115, 22, 0.22); filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.6)); }
.cviz-riser g.on .lbl { fill: #fff; font-weight: 600; }
.cviz-riser g.on .head { fill: var(--accent-fire); }
.cviz-riser .flow { fill: none; stroke: var(--c-water); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 5 9; animation: cviz-flow 0.9s linear infinite; }
.cviz-riser .flow.air { stroke: var(--c-air); stroke-dasharray: 2 7; animation-duration: 2.4s; }
.cviz-riser .flow.still { stroke-dasharray: none; stroke-width: 3; opacity: 0.55; animation: cviz-pulse 1.6s ease-in-out infinite; }
@keyframes cviz-flow { to { stroke-dashoffset: -28; } }
@keyframes cviz-pulse { 50% { opacity: 0.95; } }

.cviz-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.cviz-steps button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.86rem; padding: 6px 8px; border-radius: 10px;
  color: var(--text-secondary); background: transparent; border: 1px solid transparent; transition: all var(--transition);
}
.cviz-steps .n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted); border: 1px solid var(--c-line);
}
.cviz-steps button.done .n { color: var(--c-ok); border-color: rgba(52, 211, 153, 0.5); }
.cviz-steps button.on { color: #fff; background: rgba(249, 115, 22, 0.12); border-color: rgba(249, 115, 22, 0.45); }
.cviz-steps button.on .n { color: #fff; background: var(--accent-fire); border-color: var(--accent-fire); }
.cviz-detail { margin: 12px 0 0; min-height: 5.5em; padding: 12px 14px; border-left: 3px solid var(--accent-fire); border-radius: 8px; background: rgba(255, 255, 255, 0.03); font-size: 0.88rem; line-height: 1.6; color: var(--text); }

/* 2) Yıkama */
.cviz-pipe { position: relative; margin: 18px 0 4px; padding: 0 4px; }
.cviz-pipe__bore {
  position: relative; overflow: hidden; border-radius: 6px; transition: height 0.5s ease;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.10), rgba(56, 189, 248, 0.28), rgba(56, 189, 248, 0.10));
  border-top: 3px solid rgba(240, 230, 255, 0.35); border-bottom: 3px solid rgba(240, 230, 255, 0.35);
}
.cviz-pipe__bore i {
  position: absolute; left: -6%; width: 6px; height: 4px; border-radius: 2px; background: #C8A27A;
  animation: cviz-debris 1.5s linear infinite;
}
.cviz-pipe__bore i:nth-child(3n) { background: #9CA3AF; width: 4px; }
@keyframes cviz-debris { to { left: 104%; } }
.cviz-pipe__speed { position: absolute; right: 10px; top: -22px; font-size: 0.78rem; font-weight: 600; color: var(--c-water); }
.cviz-bars { display: grid; gap: 6px; margin-top: 14px; }
.cviz-bar { display: grid; grid-template-columns: 56px 1fr 92px; gap: 10px; align-items: center; font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cviz-bar .fill { background: rgba(56, 189, 248, 0.45); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cviz-bar .v { text-align: right; }
.cviz-bar.on { color: var(--text); }
.cviz-bar.on .fill { background: var(--c-water); box-shadow: 0 0 10px rgba(56, 189, 248, 0.6); }

/* 4) Hava testi grafiği */
.cviz-chart svg { width: 100%; display: block; margin-top: 12px; }
.cviz-chart .gl { stroke: rgba(255, 255, 255, 0.05); }
.cviz-chart .ax { font-size: 9px; fill: var(--text-muted); font-family: var(--font); }
.cviz-chart .limit { stroke: var(--c-bad); stroke-width: 1.2; stroke-dasharray: 5 4; }
.cviz-chart .limit-t { font-size: 9px; fill: var(--c-bad); font-family: var(--font); }
.cviz-chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.cviz-chart .line.pass { stroke: var(--c-ok); }
.cviz-chart .line.fail { stroke: var(--c-bad); }
.cviz-chart .dot { fill: #fff; }

/* 5) Ana tahliye */
.cviz-drain__stage { position: relative; max-width: 240px; margin: 16px auto 0; }
.cviz-spray { position: absolute; right: -18px; bottom: 6px; width: 40px; height: 40px; pointer-events: none; }
.cviz-spray i { position: absolute; left: 0; bottom: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--c-water); opacity: 0; }
.cviz-drain.flowing .cviz-spray i { animation: cviz-drop 0.8s ease-in infinite; }
.cviz-drain.flowing .cviz-spray i:nth-child(2) { animation-delay: 0.16s; }
.cviz-drain.flowing .cviz-spray i:nth-child(3) { animation-delay: 0.32s; }
.cviz-drain.flowing .cviz-spray i:nth-child(4) { animation-delay: 0.48s; }
.cviz-drain.flowing .cviz-spray i:nth-child(5) { animation-delay: 0.64s; }
@keyframes cviz-drop { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(30px, 26px); } }
.cviz-drain .cviz-btn, .cviz-trip .cviz-btn { display: block; margin-left: auto; margin-right: auto; }

/* 6) Kuru vana su ulaşma şeridi */
.cviz-lane { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 14px; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cviz-lane .track { height: 12px; background: repeating-linear-gradient(90deg, rgba(226, 232, 240, 0.08) 0 6px, transparent 6px 12px); }
.cviz-lane .water { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), var(--c-water)); border-radius: 99px; }
.cviz-lane .v1 { min-width: 64px; text-align: right; color: var(--text); }

/* 7) Yedek sprinkler dolabı */
.cviz-cabinet {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-top: 14px; padding: 14px;
  border: 2px solid rgba(240, 230, 255, 0.2); border-radius: 10px; background: rgba(0, 0, 0, 0.18);
}
.cviz-cabinet .sp { width: 22px; animation: cviz-pop 0.35s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
.cviz-cabinet .sp svg { width: 100%; display: block; }
.cviz-cabinet .sp path { fill: rgba(240, 230, 255, 0.55); stroke: rgba(240, 230, 255, 0.55); stroke-width: 1; }
.cviz-cabinet .sp .bulb { fill: #EF4444; }
.cviz-cabinet .wrench { flex-basis: 100%; font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
@keyframes cviz-pop { from { opacity: 0; transform: translateY(8px) scale(0.6); } }

/* 8) Kontrol listesi */
ul.cviz-checklist { list-style: none; padding-left: 0; }
ul.cviz-checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
ul.cviz-checklist input { margin-top: 0.35em; width: 17px; height: 17px; accent-color: var(--c-ok); flex-shrink: 0; }
ul.cviz-checklist input:checked + span { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(52, 211, 153, 0.6); }

@media (max-width: 640px) {
  .cviz { padding: 14px; }
  .cviz-steps { grid-template-columns: 1fr; }
  .cviz-seq__steps { display: flex; flex-direction: column; }
  .cviz-seq__steps .cviz-detail { order: -1; margin: 0 0 12px; min-height: 8em; }
  .cviz-seq__steps .cviz-btn { align-self: flex-start; }
  .cviz-gauges { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cviz-bar { grid-template-columns: 50px 1fr 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .cviz *, .cviz *::before, .cviz *::after { animation: none !important; transition: none !important; }
}

/* Sıcaklık sınıfı cam tüp skalası (js/viz/thermal.js) */
.tbz { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.tbz .tb { font: inherit; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 10px; color: inherit; transition: opacity var(--transition), background var(--transition); }
.tbz .tb svg { width: 100%; max-width: 40px; height: auto; display: block; }
.tbz .tb.on { background: rgba(249, 115, 22, 0.10); border-color: var(--accent-fire); }
.tbz .tb:focus-visible { outline: 2px solid var(--accent-fire); outline-offset: 2px; }
.tbz .tb.off { opacity: 0.28; }
.tbz .tb-glass { fill: rgba(255, 255, 255, 0.06); stroke: rgba(226, 232, 240, 0.65); stroke-width: 1.5; }
.tbz .tb-liq { stroke: rgba(226, 232, 240, 0.35); stroke-width: 0.8; }
.tbz .tb-cap { fill: #64748B; }
.tbz .tb-air { fill: rgba(255, 255, 255, 0.75); }
.tbz .tb.on .tb-air { animation: tbz-rise 1.6s ease-in-out infinite; }
.tbz .tb-t { color: var(--text); font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbz .tb-s { color: var(--text-muted); font-size: 0.7rem; line-height: 1; }
.tbz .tb-n { color: var(--text-secondary); font-size: 0.7rem; line-height: 1.2; margin-top: 2px; }
@keyframes tbz-rise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (max-width: 640px) { .tbz { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .tbz .tb.on .tb-air { animation: none; } }
.cviz-stage.is-still .tbz .tb.on { background: transparent; border-color: transparent; }
