.airflow-tool {
  position: relative;
  margin: 0 0 clamp(56px, 7vw, 88px);
  padding: clamp(20px, 3vw, 36px);
  overflow: hidden;
  border: 1px solid var(--resource-line-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 4%, rgba(0, 200, 240, 0.12), transparent 25rem),
    linear-gradient(145deg, rgba(12, 31, 62, 0.98), rgba(7, 17, 34, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28), 0 0 48px rgba(30, 83, 216, 0.08);
}

.airflow-tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.airflow-tool-heading h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.airflow-tool-heading p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

.airflow-reset {
  min-width: 122px;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid var(--resource-line-strong);
  border-radius: 12px;
  color: #d9e8ff;
  background: rgba(30, 83, 216, 0.1);
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.airflow-reset:hover {
  border-color: rgba(0, 200, 240, 0.72);
  color: #fff;
  background: rgba(0, 200, 240, 0.12);
}

.airflow-form {
  display: grid;
  gap: 18px;
}

.airflow-toolbar,
.airflow-input-grid,
.airflow-operation-grid,
.airflow-results {
  display: grid;
  gap: 14px;
}

.airflow-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  padding: 14px;
  border: 1px solid var(--resource-line);
  border-radius: 16px;
  background: rgba(4, 12, 25, 0.48);
}

.airflow-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.airflow-fieldset legend,
.airflow-label {
  display: block;
  margin-bottom: 8px;
  color: #b9cbe6;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.airflow-fieldset--inline legend {
  margin: 0 0 8px 2px;
}

.airflow-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--resource-line);
  border-radius: 12px;
  background: rgba(2, 9, 20, 0.72);
}

.airflow-segmented label,
.airflow-choice-list label {
  position: relative;
  cursor: pointer;
}

.airflow-segmented input,
.airflow-choice-list input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.airflow-segmented span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #9db1ce;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.airflow-segmented input:checked + span {
  border-color: rgba(55, 133, 255, 0.72);
  color: #fff;
  background: rgba(30, 83, 216, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 240, 0.08);
}

.airflow-segmented input:focus-visible + span,
.airflow-choice-list input:focus-visible + span,
.airflow-reset:focus-visible,
.airflow-tool input:focus-visible,
.airflow-tool select:focus-visible {
  outline: 3px solid rgba(0, 200, 240, 0.48);
  outline-offset: 2px;
}

.airflow-input-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.airflow-panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--resource-line);
  border-radius: 18px;
  background: rgba(5, 15, 30, 0.72);
}

.airflow-panel h3 {
  margin: 0 0 20px;
  padding-right: 48px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 850;
  line-height: 1.15;
}

.airflow-step {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(0, 200, 240, 0.32);
  border-radius: 9px;
  color: var(--cyan);
  background: rgba(0, 200, 240, 0.06);
  font: 800 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.airflow-tool select,
.airflow-tool input[type="number"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(92, 145, 224, 0.34);
  border-radius: 11px;
  color: #f4f8ff;
  background: #071426;
  font: 700 16px/1.2 var(--font-body);
}

.airflow-tool select {
  margin-bottom: 16px;
  padding: 0 42px 0 13px;
  cursor: pointer;
}

.airflow-tool input[type="number"] {
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
}

.airflow-tool input[readonly] {
  color: #b9d8ff;
  background: rgba(30, 83, 216, 0.1);
  cursor: default;
}

.airflow-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.airflow-input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.airflow-input-with-unit input {
  border-radius: 11px 0 0 11px !important;
}

.airflow-input-with-unit > .resource-number-stepper {
  border-radius: 11px 0 0 11px;
}

.airflow-input-with-unit > span {
  display: flex;
  min-width: 70px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(92, 145, 224, 0.34);
  border-left: 0;
  border-radius: 0 11px 11px 0;
  color: #b9cbe6;
  background: rgba(30, 83, 216, 0.12);
  font: 700 12px/1 var(--font-mono);
  white-space: nowrap;
}

.airflow-helper {
  margin: 11px 0 0;
  color: #8fa5c3;
  font-size: 12px;
  line-height: 1.55;
}

.airflow-choice-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.airflow-choice-list span {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--resource-line);
  border-radius: 11px;
  color: #aebfda;
  background: rgba(2, 9, 20, 0.42);
  font-size: 13px;
  font-weight: 700;
}

.airflow-choice-list span::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
  border: 2px solid #6680a5;
  border-radius: 50%;
}

.airflow-choice-list input:checked + span {
  border-color: rgba(55, 133, 255, 0.62);
  color: #fff;
  background: rgba(30, 83, 216, 0.18);
}

.airflow-choice-list input:checked + span::before {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 3px #071426;
  background: var(--cyan);
}

.airflow-density-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  color: #aebfda;
  background: rgba(0, 200, 240, 0.07);
  font-size: 13px;
}

.airflow-density-readout strong {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.airflow-reference-density {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(92, 145, 224, 0.28);
  border-radius: 8px;
  color: #9fb1cb;
  background: rgba(30, 83, 216, 0.08);
  font-size: 12px;
}

.airflow-reference-density strong {
  color: #dcecff;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.airflow-panel--operation {
  padding-top: 24px;
}

.airflow-operation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.airflow-operation-helper {
  margin-top: 14px;
}

.airflow-error {
  padding: 13px 15px;
  border: 1px solid rgba(255, 96, 96, 0.58);
  border-radius: 12px;
  color: #ffd5d5;
  background: rgba(128, 24, 32, 0.32);
  font-size: 14px;
  line-height: 1.5;
}

.airflow-results {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.airflow-results--single-fan,
.airflow-results--factor-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.airflow-results--single-fan.airflow-results--factor-mode {
  grid-template-columns: 1fr;
}

.airflow-result-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--resource-line);
  border-radius: 16px;
  background: rgba(5, 15, 30, 0.82);
}

.airflow-result-card--primary {
  border-color: rgba(0, 200, 240, 0.42);
  background: linear-gradient(145deg, rgba(30, 83, 216, 0.22), rgba(0, 200, 240, 0.08));
}

.airflow-result-card span,
.airflow-result-card small {
  display: block;
  color: #9fb1cb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.airflow-result-card strong {
  display: block;
  margin: 11px 0 6px;
  overflow-wrap: anywhere;
  color: #fff;
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.airflow-result-card--primary strong {
  color: var(--cyan);
}

.airflow-notice {
  padding: 15px 17px;
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  color: #bdcbe0;
  background: rgba(255, 104, 31, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.airflow-notice strong {
  color: #fff;
}

.airflow-formula-guide {
  margin: 0 0 clamp(48px, 6vw, 72px);
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--resource-line-strong);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 8%, rgba(0, 200, 240, 0.1), transparent 24rem),
    rgba(5, 15, 30, 0.82);
}

.airflow-formula-guide h2 {
  margin: 4px 0 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.12;
}

.airflow-formula-guide > p {
  max-width: 920px;
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}

.airflow-formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.airflow-formula-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--resource-line);
  border-radius: 14px;
  background: rgba(2, 9, 20, 0.56);
}

.airflow-formula-card span,
.airflow-formula-card small {
  display: block;
  color: #9fb1cb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.airflow-formula-card strong {
  display: block;
  margin: 10px 0 8px;
  overflow-wrap: anywhere;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.4;
}

.airflow-symbols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.airflow-symbols div {
  padding: 12px;
  border-left: 2px solid rgba(0, 200, 240, 0.6);
  background: rgba(0, 200, 240, 0.05);
}

.airflow-symbols dt {
  color: #fff;
  font: 800 14px/1.2 var(--font-mono);
}

.airflow-symbols dd {
  margin: 5px 0 0;
  color: #9fb1cb;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .airflow-toolbar,
  .airflow-input-grid {
    grid-template-columns: 1fr;
  }

  .airflow-operation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .airflow-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .airflow-symbols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .airflow-tool {
    margin-inline: -4px;
    padding: 16px;
    border-radius: 18px;
  }

  .airflow-tool-heading {
    display: grid;
    gap: 16px;
  }

  .airflow-reset {
    width: 100%;
  }

  .airflow-panel {
    padding: 18px 14px;
  }

  .airflow-two-columns,
  .airflow-operation-grid,
  .airflow-results {
    grid-template-columns: 1fr;
  }

  .airflow-segmented span {
    padding-inline: 8px;
    font-size: 12px;
  }

  .airflow-density-readout {
    align-items: flex-start;
    flex-direction: column;
  }

  .airflow-reference-density {
    align-items: flex-start;
    flex-direction: column;
  }

  .airflow-reference-density strong {
    text-align: left;
  }

  .airflow-formula-grid,
  .airflow-symbols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .airflow-reset,
  .airflow-segmented span {
    transition: none;
  }
}
