body.airhumide-page {
  max-width: 1320px;
  margin: 26px auto;
}

.airhumide-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 12px;
}

.back-link::before {
  content: "←";
  font-size: 1rem;
}

.tool-header {
  text-align: center;
  margin-bottom: 18px;
}

.tool-header h1 {
  margin-bottom: 6px;
}

.tool-header p,
.panel-head p,
.chart-head p,
.methods-panel p {
  color: var(--muted);
  margin: 0;
}

.air-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-areas:
    "input chart"
    "results chart"
    "methods chart";
  gap: 16px;
  align-items: start;
}

.input-panel {
  grid-area: input;
}

.results-panel {
  grid-area: results;
}

.methods-panel {
  grid-area: methods;
}

.chart-panel {
  grid-area: chart;
}

.airhumide-page .card {
  border-radius: 8px;
}

.panel-head,
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.chart-head h2,
.methods-panel h2 {
  font-size: 1rem;
  margin: 0 0 3px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  min-width: 0;
}

.field.wide {
  grid-column: 1 / -1;
}

.unit-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.unit-field span {
  min-width: 42px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.airhumide-page label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.airhumide-page input,
.airhumide-page select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
  color: var(--field-text);
  padding: 9px 10px;
  font: inherit;
}

.airhumide-page input:focus,
.airhumide-page select:focus,
.airhumide-page button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
  outline-offset: 2px;
}

.button-row,
.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row {
  margin-top: 14px;
}

.airhumide-page button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 38px;
  padding: 9px 12px;
}

.airhumide-page button.secondary {
  background: var(--secondary);
  color: var(--secondary-text);
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.status-line,
.validation-line {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-line.error {
  color: var(--danger);
  font-weight: 700;
}

.result-focus {
  display: grid;
  gap: 4px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.result-focus span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.result-focus strong {
  font-size: 2rem;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.properties-list {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
}

.property-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.property-row dt,
.property-row dd {
  margin: 0;
}

.property-row dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.property-row dd {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.methods-panel {
  font-size: 0.9rem;
}

.chart-head {
  align-items: center;
}

.chart-actions {
  justify-content: flex-end;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--field);
  touch-action: none;
}

#psychroCanvas {
  display: block;
  width: 100%;
  height: 620px;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(260px, calc(100% - 24px));
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 3px;
}

@media (max-width: 980px) {
  body.airhumide-page {
    margin: 20px auto;
  }

  .air-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "input"
      "results"
      "chart"
      "methods";
  }

  .chart-wrap {
    min-height: 520px;
  }

  #psychroCanvas {
    height: 520px;
  }
}

@media (max-width: 560px) {
  body.airhumide-page {
    padding: 0 10px;
  }

  .tool-header {
    text-align: left;
  }

  .tool-header h1 {
    text-align: left;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .chart-head {
    display: grid;
  }

  .chart-actions {
    justify-content: stretch;
  }

  .chart-actions button {
    flex: 1 1 auto;
  }

  .property-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .property-row dd {
    text-align: left;
  }

  .chart-wrap {
    min-height: 430px;
  }

  #psychroCanvas {
    height: 430px;
  }
}
