/* Reusable visual components */
.btn-sm {
  background: var(--blue-700);
  border: 1px solid var(--blue-300);
  border-radius: 4px;
  color: #f2f7ff;
  cursor: pointer;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
}

.btn-sm:hover {
  background: var(--blue-600);
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--blue-150);
  border-radius: 3px;
  color: var(--blue-500);
  cursor: pointer;
  font-size: 10px;
  margin-left: 5px;
  padding: 1px 5px;
  vertical-align: middle;
}

.btn-reset:hover {
  background: var(--blue-40);
  border-color: var(--blue-300);
}

.eng-table {
  --row-label: minmax(240px, 280px);
  --row-field: minmax(150px, 180px);
  --row-unit: minmax(80px, 95px);
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px;
  width: calc(100% - 24px);
}

.workflow-col .eng-table {
  --row-label: minmax(240px, 280px);
  --row-field: minmax(150px, 180px);
  --row-unit: minmax(80px, 95px);
}

.side-col .eng-table {
  --row-label: minmax(200px, 240px);
  --row-field: minmax(150px, 170px);
  --row-unit: minmax(80px, 95px);
}

.form-row,
.eng-table tr {
  align-items: center;
  border-bottom: 1px solid var(--blue-40);
  column-gap: 10px;
  display: grid;
  grid-template-columns: var(--row-label) var(--row-field) var(--row-unit);
  justify-content: start;
  min-height: 36px;
}

.eng-table tr:last-child {
  border-bottom: none;
}

.eng-table td {
  padding: 4px 0;
  vertical-align: middle;
}

.eng-table td[colspan="3"] {
  grid-column: 1 / -1;
  padding: 5px 10px;
}

.eng-table td[colspan="2"] {
  grid-column: 2 / -1;
}

td.lbl {
  color: var(--lbl);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  padding-left: 2px;
}

td.unit {
  color: var(--blue-700);
  font-size: 12px;
  padding-left: 1px;
  text-align: left;
  white-space: nowrap;
}

input[type="number"],
input[type="text"],
select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--blue-900);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 13px;
  height: 36px;
  line-height: 1.2;
  padding: 0 10px;
  width: 100%;
}

input[type="number"] {
  text-align: right;
}

input[type="text"],
select {
  text-align: left;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  background: #fcfeff;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 2px rgba(12, 94, 214, 0.15);
  outline: none;
}

input[type="checkbox"] {
  height: 16px;
  margin-left: 2px;
  width: 16px;
}

input.calc-field,
input[readonly],
td.calc-field {
  background: #eef3f9;
  border-color: var(--blue-100);
  color: var(--calc-text);
  font-weight: 600;
}

td.calc-field {
  align-items: center;
  border: 1px solid var(--blue-100);
  border-radius: 5px;
  display: flex;
  min-height: 36px;
  padding: 0 10px !important;
}

.subhead-row td {
  background: var(--blue-60);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  text-transform: uppercase;
}

.highlight-row {
  background: var(--blue-40);
}

.highlight-row td.lbl {
  color: var(--blue-700);
  font-weight: 700;
}

.info-note {
  background: var(--blue-20);
  border-top: 1px dashed var(--blue-150);
  color: var(--blue-700);
  font-size: 12px;
  padding: 6px 10px;
}

.status-tag {
  background: var(--blue-40);
  border: 1px solid var(--blue-150);
  border-radius: 4px;
  color: var(--blue-700);
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
}

.status-two-phase {
  background: #e7f0ff;
  border-color: #9ec4f6;
  color: #00307f;
}

.status-single-liquid {
  background: #edf4ff;
  border-color: #bfd9f8;
  color: #0042a3;
}

.status-single-vapor {
  background: #f6f9ff;
  border-color: #d9e9fb;
  color: #0c5ed6;
}

.resistance-block {
  border-top: 1px solid var(--blue-100);
}

.resistance-block-title {
  background: var(--blue-20);
  border-bottom: 1px solid var(--blue-100);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  text-transform: uppercase;
}

#resistance-chart {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
}

.r-bar-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.r-lbl {
  color: var(--blue-700);
  font-size: 12px;
  min-width: 56px;
  text-align: right;
}

.r-bar-bg {
  background: var(--blue-40);
  border: 1px solid var(--blue-100);
  border-radius: 3px;
  flex: 1;
  height: 12px;
  overflow: hidden;
}

.r-bar {
  background: var(--blue-500);
  height: 100%;
  transition: width 0.25s ease;
  width: 0;
}

.r-bar-wall { background: var(--blue-300); }
.r-bar-contact { background: var(--blue-200); }
.r-bar-Ro { background: var(--blue-400); }

.r-pct {
  color: var(--blue-700);
  font-size: 11px;
  width: 38px;
}

#warnings-panel {
  max-height: 230px;
  overflow-y: auto;
  padding: 8px;
}

.warn-item {
  border-left: 3px solid;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  margin: 4px 0;
  padding: 6px 8px;
}

.warn-warning { background: #f3f8ff; border-color: #6aa6f0; color: #00307f; }
.warn-error { background: #eef4ff; border-color: #0042a3; color: #001133; }
.warn-info { background: #f7faff; border-color: #9ec4f6; color: #00307f; }
.warn-ok { background: #f8fbff; border-color: #bfd9f8; color: #0042a3; }

#adequacy-box {
  border: 2px solid;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 8px;
  padding: 12px;
  text-align: center;
}

.adequacy-pass { background: #e8f3ff; border-color: #6aa6f0; color: #00307f; }
.adequacy-fail { background: #edf3ff; border-color: #0042a3; color: #001133; }
.adequacy-unknown { background: #f7faff; border-color: #bfd9f8; color: #004f99; }

.adequacy-detail {
  color: var(--blue-700);
  font-size: 13px;
  padding: 4px 10px 10px;
  text-align: center;
}

.ga-placeholder {
  margin: 10px;
}

.ga-placeholder-tab {
  margin: 12px;
}

.ga-diagram-box {
  align-items: center;
  background: #f7f9fc;
  border: 1px dashed #8fb3e8;
  border-radius: 6px;
  color: var(--blue-800);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  padding: 16px;
  text-align: center;
}

.ga-diagram-box-xl {
  min-height: 500px;
}

.ga-diagram-title {
  color: var(--blue-700);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.ga-diagram-text {
  color: var(--blue-700);
  font-size: 13px;
  max-width: 420px;
}

.ga-note {
  color: var(--blue-700);
  font-size: 13px;
  margin-top: 9px;
}

.info-btn {
  align-items: center;
  background: var(--blue-60);
  border: 1px solid var(--blue-300);
  border-radius: 50%;
  color: var(--blue-700);
  cursor: pointer;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 15px;
  justify-content: center;
  line-height: 1;
  margin-left: 4px;
  width: 15px;
}

.info-btn:hover,
.info-btn:focus-visible {
  background: var(--blue-100);
  border-color: var(--blue-500);
  outline: none;
}

.field-tooltip {
  background: #0f2f67;
  border: 1px solid #305fa7;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 32, 92, 0.28);
  color: #f5f9ff;
  font-size: 12px;
  max-width: 320px;
  opacity: 0;
  padding: 9px 11px;
  pointer-events: none;
  position: fixed;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 9998;
}

.field-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.field-invalid {
  background: #eef5ff !important;
  border-color: var(--blue-600) !important;
  box-shadow: 0 0 0 2px rgba(0, 66, 163, 0.15) !important;
}

@media (max-width: 1360px) {
  .workflow-col .eng-table {
    --row-label: minmax(220px, 260px);
    --row-field: minmax(145px, 170px);
    --row-unit: minmax(75px, 90px);
  }

  .side-col .eng-table {
    --row-label: minmax(185px, 220px);
    --row-field: minmax(145px, 165px);
    --row-unit: minmax(75px, 90px);
  }
}

.ga-diagram-schematic {
  background: #f7f9fc;
  border: 1px solid #8fb3e8;
  border-radius: 8px;
  min-height: 420px;
  padding: 12px;
}

.ga-svg {
  display: block;
  height: auto;
  width: 100%;
}

.ga-front-face,
.ga-side-face {
  fill: #ffffff;
  stroke: #2b5b9a;
  stroke-width: 2;
}

.ga-dim-line {
  stroke: #3d6ea9;
  stroke-width: 2;
}

.ga-arrow-head {
  fill: #3d6ea9;
}

.ga-dim-label {
  fill: #17457f;
  font-size: 18px;
  font-weight: 700;
}

.ga-dim-value {
  fill: #3567a8;
  font-size: 16px;
  font-weight: 600;
}

.ga-face-label {
  fill: #17457f;
  font-size: 22px;
  font-weight: 700;
}

.ga-face-value {
  fill: #3567a8;
  font-size: 18px;
  font-weight: 600;
}

.ga-tube-circle {
  fill: #dce9fb;
  stroke: #2b5b9a;
  stroke-width: 2;
}

.ga-rows-label {
  fill: #0c5ed6;
  font-size: 20px;
  font-weight: 700;
}

/* tubes_per_row and N_face_v: always white editable fields - no special styling */
