/* ==========================================================================
   Cardox India — interactive tools
   Loaded only by capacity-calculator.html and vessel-diagnostic.html.
   Reuses the variables declared in style.css. Nothing here affects other pages.
   ========================================================================== */

/* --- shared shell ------------------------------------------------------- */

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (max-width: 820px) {
  .tool { grid-template-columns: 1fr; gap: 24px; }
}

.tool-panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}
.tool-panel h2 {
  margin-top: 0;
  font-size: var(--step-1);
}

.tool-out {
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 28px;
  position: sticky;
  top: 24px;
}
@media (max-width: 820px) {
  .tool-out { position: static; }
}
.tool-out h2 { margin-top: 0; color: #fff; font-size: var(--step-1); }
.tool-out a { color: #9FD3FF; }

/* --- fields ------------------------------------------------------------- */

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 400;
}

.field input[type="number"],
.field select {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.field input[type="number"]:focus,
.field select:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}

/* range + number together, so the slider is a convenience not a requirement */
.field .pair {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
  align-items: center;
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}
@media (max-width: 420px) {
  .field .pair { grid-template-columns: 1fr; }
}

/* --- results ------------------------------------------------------------ */

.headline-figure {
  font-size: clamp(3rem, 2rem + 5vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  margin: 4px 0 2px;
}
.headline-label {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #9FB6D4;
  margin: 0 0 22px;
}

.result-rows { list-style: none; margin: 0 0 22px; padding: 0; }
.result-rows li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.result-rows li:last-child { border-bottom: 0; }
.result-rows .k { color: #C4D3E5; }
.result-rows .v {
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tool-out .btn { width: 100%; text-align: center; }

.tool-note {
  font-size: var(--step--1);
  color: #9FB6D4;
  margin: 18px 0 0;
  line-height: 1.5;
}

/* --- the silo drawing, redrawn live by JS ------------------------------- */

.silo-viz {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 20px;
}
.silo-viz .shell  { fill: #0A3A7A; stroke: #6E9BD1; stroke-width: 1.5; }
.silo-viz .buildup{ fill: #F5A623; }
.silo-viz .clear  { fill: #06203F; }
.silo-viz .dim    { stroke: #9FB6D4; stroke-width: 1; }
.silo-viz text    { fill: #C4D3E5; font-size: 8px; font-family: var(--sans); }

/* --- diagnostic --------------------------------------------------------- */

.choices { display: grid; gap: 10px; }
.choice {
  display: block;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.choice:hover { border-color: var(--green); }
.choice input { position: absolute; opacity: 0; }
.choice input:focus-visible ~ .choice-t { outline: 2px solid var(--green); outline-offset: 3px; }
.choice input:checked ~ .choice-t { color: var(--green); }
.choice:has(input:checked) {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  background: #F2FBF7;
}
.choice-t { display: block; font-weight: 600; color: var(--ink); }
.choice-d { display: block; font-size: var(--step--1); color: var(--muted); margin-top: 2px; }

.diag-figure {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  width: 132px;
  margin: 0 auto 18px;
}
.diag-figure img { display: block; width: 100%; height: auto; }

fieldset.step { border: 0; padding: 0; margin: 0 0 26px; }
fieldset.step legend {
  padding: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: var(--step-1);
  margin-bottom: 4px;
}
fieldset.step .hint {
  font-size: var(--step--1);
  color: var(--muted);
  margin: 0 0 12px;
}
.step-num {
  display: inline-block;
  width: 24px; height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: .78rem;
  margin-right: 8px;
  vertical-align: 1px;
}

