.sound-calculator {
  --sound-bg: #050b16;
  --sound-panel: #08172b;
  --sound-line: rgba(62, 133, 224, 0.34);
  --sound-blue: #1f73e8;
  --sound-cyan: #00c9ff;
  --sound-orange: #ff6b2c;
  --sound-text: #f3f7ff;
  --sound-muted: #9eb1ca;
  position: relative;
  margin: 12px 0 76px;
  padding: clamp(22px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid var(--sound-line);
  border-radius: 28px;
  color: var(--sound-text);
  background:
    radial-gradient(circle at 86% 7%, rgba(0, 201, 255, 0.14), transparent 31%),
    linear-gradient(145deg, #071326 0%, var(--sound-bg) 58%, #07101d 100%);
}

.sound-calculator::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image:
    linear-gradient(rgba(70, 142, 231, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 142, 231, .08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.sound-calculator-header,
.sound-calculator-grid,
.sound-supporting-content { position: relative; z-index: 1; }

.sound-calculator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.sound-calculator-header h2 {
  max-width: 800px;
  margin: 12px 0 14px;
  color: var(--sound-text);
  font: 800 clamp(32px, 4.6vw, 54px)/1.03 var(--font-display);
}

.sound-calculator-header p {
  max-width: 760px;
  margin: 0;
  color: var(--sound-muted);
  font-size: 16px;
  line-height: 1.65;
}

.sound-calculator-grid {
  display: grid;
  grid-template-columns: minmax(310px, .68fr) minmax(0, 1.32fr);
  align-items: start;
  gap: 18px;
}

.sound-controls {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--sound-line);
  border-radius: 22px;
  background: rgba(7, 22, 43, .78);
}

.sound-control-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(73, 133, 210, .27);
  border-radius: 16px;
  background: rgba(5, 17, 34, .8);
}

.sound-control-card legend {
  padding: 0 7px;
  color: #eaf3ff;
  font: 700 12px/1.2 var(--font-display);
}

.sound-control-card legend span {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-right: 8px;
  border-radius: 8px;
  color: var(--sound-cyan);
  background: rgba(0, 201, 255, .1);
  font: 700 10px/1 var(--font-mono);
}

.sound-control-card label { display: grid; gap: 8px; min-width: 0; }
.sound-control-card label > span,
.sound-control-card--bands > p {
  margin: 0;
  color: var(--sound-muted);
  font-size: 12px;
  line-height: 1.55;
}
.sound-control-card--bands > p strong { color: #eef6ff; }

.sound-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  border: 1px solid rgba(68, 142, 235, .48);
  border-radius: 12px;
  overflow: hidden;
}

.sound-stepper button,
.sound-stepper input,
.sound-input-unit input,
.sound-input-table input {
  box-sizing: border-box;
  min-width: 0;
  border: 0;
  color: var(--sound-text);
  background: #071327;
  font: 700 13px/1 var(--font-mono);
}

.sound-stepper button {
  min-height: 46px;
  color: #9fdcff;
  cursor: pointer;
  font-size: 20px;
}
.sound-stepper button:hover { background: #0d2a51; }
.sound-stepper button:disabled { opacity: .38; cursor: not-allowed; }
.sound-stepper input { width: 100%; text-align: center; border-inline: 1px solid rgba(68, 142, 235, .34); }

.sound-two-fields { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 12px; }
.sound-input-unit,
.sound-db-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid rgba(68, 142, 235, .38); border-radius: 11px; overflow: hidden; }
.sound-input-unit input { width: 100%; min-height: 45px; padding: 0 12px; }
.sound-input-unit b,
.sound-db-input b { display: grid; place-items: center; padding: 0 11px; color: #7ea1c9; background: #0a1b35; font: 700 9px/1 var(--font-mono); }
.sound-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid rgba(68, 142, 235, .34);
  border-radius: 12px;
  background: #061225;
}

.sound-side-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: #86a2c3;
  background: transparent;
  cursor: pointer;
  font: 700 11px/1 var(--font-display);
}
.sound-side-tabs button.is-active { color: #fff; background: linear-gradient(135deg, #174c98, #0c7ea7); }
.sound-side-tabs button:focus-visible,
.sound-action:focus-visible,
.sound-matrix-scroll:focus-visible { outline: 3px solid rgba(0, 201, 255, .55); outline-offset: 2px; }

.sound-source-panel[hidden] { display: none !important; }
.sound-table-scroll { max-width: 100%; overflow-x: auto; }
.sound-input-table { width: 100%; border-collapse: collapse; }
.sound-input-table th,
.sound-input-table td { padding: 7px 5px; border-bottom: 1px solid rgba(62, 133, 224, .18); }
.sound-input-table th { color: #91a8c6; font: 700 9px/1.2 var(--font-mono); text-align: left; text-transform: uppercase; }
.sound-input-table thead th:last-child { text-align: right; }
.sound-input-table tbody th { color: #cce0f7; }
.sound-input-table input { width: 100%; min-width: 76px; height: 36px; padding: 0 8px; text-align: right; }
.sound-db-input { border-radius: 8px; }
.sound-input-total th,
.sound-input-total td { border-top: 2px solid rgba(255, 107, 44, .48); }
.sound-input-total th { color: #ffb08c !important; }
.sound-input-total .sound-db-input { border-color: rgba(255, 107, 44, .48); }
.sound-input-total input { background: #1a1720; }

.sound-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sound-action {
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(72, 139, 225, .44);
  border-radius: 11px;
  color: #bdd1ea;
  background: #0a1a32;
  cursor: pointer;
  font: 700 11px/1.2 var(--font-display);
}
.sound-action--primary { border-color: #ff7b3c; color: #fff; background: linear-gradient(135deg, #ff6b2c, #d84c14); }
.sound-action:hover { filter: brightness(1.12); }
.sound-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sound-results { display: grid; align-content: start; gap: 18px; min-width: 0; padding: 22px; border: 1px solid var(--sound-line); border-radius: 22px; background: rgba(3, 10, 22, .84); }
.sound-result-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sound-result-cards article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(62, 133, 224, .32);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(12, 38, 73, .9), rgba(5, 17, 34, .9));
}
.sound-result-cards article > span { color: #8ba4c5; font: 700 9px/1.3 var(--font-mono); text-transform: uppercase; }
.sound-result-cards article > span b { color: #8de5ff; }
.sound-result-cards strong { color: #fff; font: 800 clamp(30px, 3.2vw, 44px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.sound-result-cards small { color: #8fb3df; font: 700 9px/1.2 var(--font-mono); }
.sound-result-cards em { margin-top: 6px; color: #9dc2e9; font: normal 600 10px/1.45 var(--font-mono); }
.sound-result-card--pressure { border-color: rgba(255, 107, 44, .44) !important; }
.sound-result-card--pressure strong { color: #ffc09f; }

.sound-matrix-panel,
.sound-method {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(62, 133, 224, .25);
  border-radius: 16px;
  background: rgba(5, 17, 34, .78);
}
.sound-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sound-panel-heading span { color: var(--sound-cyan); font: 700 9px/1.25 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.sound-panel-heading h3 { margin: 5px 0 0; color: #edf5ff; font: 700 20px/1.2 var(--font-display); }
.sound-matrix-panel > p { margin: 0 0 14px; color: #8fa6c4; font-size: 11px; line-height: 1.55; }

.sound-heat-legend { display: flex; align-items: center; gap: 6px; color: #8da5c4; font: 600 8px/1 var(--font-mono); }
.sound-heat-legend i { width: 22px; height: 7px; border-radius: 999px; }
.sound-heat-legend i:nth-of-type(1) { background: linear-gradient(90deg, #0b2d5c, #006d8f); }
.sound-heat-legend i:nth-of-type(2) { background: linear-gradient(90deg, #006d8f, #973a17); }

.sound-matrix-scroll {
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(62, 133, 224, .22);
  border-radius: 12px;
  scrollbar-color: #225b9d #061226;
}
.sound-matrix-table { min-width: max-content; border-collapse: separate; border-spacing: 0; color: #e5f1ff; font: 700 9px/1.15 var(--font-mono); font-variant-numeric: tabular-nums; }
.sound-matrix-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sound-matrix-table th,
.sound-matrix-table td { min-width: 56px; height: 38px; padding: 7px; border-right: 1px solid rgba(111, 163, 228, .12); border-bottom: 1px solid rgba(111, 163, 228, .12); text-align: center; }
.sound-matrix-table thead th { position: sticky; top: 0; z-index: 3; color: #acc5e4; background: #0a203e; }
.sound-matrix-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 82px; color: #cfe3fa; text-align: left; background: #081a32; }
.sound-matrix-table thead th:first-child { z-index: 4; }
.sound-matrix-table tr.is-global th { color: #ffc09f; background: #21182a; }
.sound-matrix-table tr.is-global td { box-shadow: inset 0 2px 0 rgba(255, 107, 44, .5); }
.sound-heat-cell { color: #fff; background: var(--sound-heat); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.sound-matrix-table .is-current { box-shadow: inset 2px 0 0 #ff7b3c, inset -2px 0 0 #ff7b3c; }
.sound-matrix-table thead .is-current { color: #fff; background: #713518; }

.sound-concepts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sound-concepts article { min-width: 0; padding: 17px; border: 1px solid rgba(62, 133, 224, .25); border-radius: 15px; background: rgba(6, 20, 40, .82); }
.sound-concepts article > span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #071226; background: linear-gradient(135deg, #79e7ff, #347be1); font: 800 13px/1 var(--font-mono); }
.sound-concepts h3 { margin: 12px 0 7px; color: #edf5ff; font: 700 16px/1.2 var(--font-display); }
.sound-concepts p { margin: 0; color: #94aac6; font-size: 11px; line-height: 1.58; }

.sound-method ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; color: #9eb1ca; font-size: 12px; line-height: 1.55; }
.sound-method li::marker { color: var(--sound-orange); font-family: var(--font-mono); font-weight: 700; }
.sound-method strong { color: #e2efff; }
.sound-method b { color: #79dfff; font-family: var(--font-mono); }
.sound-notice { padding: 16px 18px; border-left: 3px solid var(--sound-orange); border-radius: 4px 12px 12px 4px; color: #a9bbd1; background: rgba(255, 107, 44, .065); font-size: 12px; line-height: 1.6; }
.sound-notice strong { color: #ffb18f; }
.sound-installation-note { display: grid; gap: 8px; padding: 20px; border: 1px solid rgba(0, 201, 255, .3); border-radius: 16px; color: #a9bbd1; background: linear-gradient(145deg, rgba(11, 43, 79, .72), rgba(5, 17, 34, .9)); font-size: 12px; line-height: 1.65; }
.sound-installation-note > span { color: #66dfff; font: 700 9px/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.sound-installation-note > strong { color: #eef7ff; font: 700 18px/1.25 var(--font-display); }
.sound-installation-note p { margin: 0; }

.sound-supporting-content {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.sound-supporting-content .sound-concepts { grid-column: 1 / -1; }
.sound-supporting-content .sound-method,
.sound-supporting-content .sound-installation-note { height: 100%; }

@media (max-width: 1080px) {
  .sound-calculator-grid { grid-template-columns: 1fr; }
  .sound-supporting-content { grid-template-columns: 1fr; }
  .sound-supporting-content .sound-concepts { grid-column: auto; }
}

@media (max-width: 720px) {
  .sound-calculator { margin-bottom: 56px; padding: 18px; border-radius: 20px; }
  .sound-calculator-header { display: grid; }
  .sound-result-cards,
  .sound-concepts { grid-template-columns: 1fr; }
  .sound-controls,
  .sound-results { padding: 15px; }
  .sound-two-fields { grid-template-columns: 1fr; }
  .sound-panel-heading { display: grid; }
  .sound-heat-legend { justify-content: flex-start; }
}

@media (max-width: 460px) {
  .sound-actions { grid-template-columns: 1fr; }
  .sound-matrix-table th,
  .sound-matrix-table td { min-width: 52px; }
}

@media print {
  .sound-calculator--pdf {
    box-sizing: border-box;
    width: 100%;
    height: calc(100vh - 12mm);
    padding: 4mm;
    overflow: hidden;
    border-radius: 4mm;
  }

  .sound-calculator--pdf .sound-calculator-header {
    gap: 4mm;
    margin-bottom: 3mm;
  }

  .sound-calculator--pdf .sound-calculator-header h2 {
    max-width: none;
    margin: 1.5mm 0 1mm;
    font-size: 21pt;
    line-height: 1;
  }

  .sound-calculator--pdf .sound-calculator-header p {
    max-width: none;
    font-size: 7pt;
    line-height: 1.35;
  }

  .sound-calculator--pdf .tool-brand { transform: scale(.72); transform-origin: top right; }

  .sound-calculator--pdf .sound-calculator-grid {
    display: grid;
    grid-template-columns: 78mm minmax(0, 1fr) !important;
    align-items: start;
    gap: 2mm;
  }

  .sound-calculator--pdf .sound-controls,
  .sound-calculator--pdf .sound-results { padding: 2.5mm; }

  .sound-calculator--pdf .sound-controls { gap: 2mm; }

  .sound-calculator--pdf .sound-control-card {
    gap: 1.6mm;
    padding: 2.2mm;
    border-radius: 2.5mm;
  }

  .sound-calculator--pdf .sound-control-card legend,
  .sound-calculator--pdf .sound-control-card label > span,
  .sound-calculator--pdf .sound-control-card--bands > p { font-size: 6pt; line-height: 1.25; }

  .sound-calculator--pdf .sound-control-card legend span {
    width: 5mm;
    height: 5mm;
    margin-right: 1mm;
    border-radius: 1.5mm;
    font-size: 5.5pt;
  }

  .sound-calculator--pdf .sound-stepper { grid-template-columns: 9mm minmax(0, 1fr) 9mm; }
  .sound-calculator--pdf .sound-stepper button,
  .sound-calculator--pdf .sound-input-unit input { min-height: 8mm; }
  .sound-calculator--pdf .sound-stepper button,
  .sound-calculator--pdf .sound-stepper input,
  .sound-calculator--pdf .sound-input-unit input,
  .sound-calculator--pdf .sound-input-table input { font-size: 6.5pt; }
  .sound-calculator--pdf .sound-side-tabs button { min-height: 7mm; font-size: 6pt; }

  .sound-calculator--pdf .sound-input-table th,
  .sound-calculator--pdf .sound-input-table td { padding: .7mm; font-size: 5.5pt; }
  .sound-calculator--pdf .sound-input-table input { min-width: 0; height: 6mm; padding: 0 1mm; }
  .sound-calculator--pdf .sound-db-input b,
  .sound-calculator--pdf .sound-input-unit b { padding: 0 1.2mm; font-size: 5pt; }

  .sound-calculator--pdf .sound-results { gap: 2mm; }
  .sound-calculator--pdf .sound-result-cards { gap: 2mm; }
  .sound-calculator--pdf .sound-result-cards article { gap: .6mm; padding: 2.2mm; border-radius: 2.5mm; }
  .sound-calculator--pdf .sound-result-cards article > span,
  .sound-calculator--pdf .sound-result-cards small,
  .sound-calculator--pdf .sound-result-cards em { font-size: 5.5pt; line-height: 1.2; }
  .sound-calculator--pdf .sound-result-cards strong { font-size: 19pt; }

  .sound-calculator--pdf .sound-matrix-panel,
  .sound-calculator--pdf .sound-method { padding: 2.2mm; border-radius: 2.5mm; }
  .sound-calculator--pdf .sound-panel-heading { gap: 2mm; margin-bottom: 1mm; }
  .sound-calculator--pdf .sound-panel-heading span { font-size: 5.2pt; }
  .sound-calculator--pdf .sound-panel-heading h3 { margin-top: .7mm; font-size: 9pt; }
  .sound-calculator--pdf .sound-matrix-panel > p { margin: 0 0 1mm; font-size: 5.5pt; line-height: 1.25; }
  .sound-calculator--pdf .sound-heat-legend { gap: 1mm; font-size: 4.8pt; }
  .sound-calculator--pdf .sound-heat-legend i { width: 6mm; height: 1.4mm; }
  .sound-calculator--pdf .sound-matrix-scroll { max-height: none; overflow: hidden; border-radius: 1.5mm; }
  .sound-calculator--pdf .sound-matrix-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 5.2pt; }
  .sound-calculator--pdf .sound-matrix-table th,
  .sound-calculator--pdf .sound-matrix-table td { min-width: 0; height: 4.2mm; padding: .45mm; }
  .sound-calculator--pdf .sound-matrix-table th:first-child { min-width: 0; width: 14mm; }
  .sound-calculator--pdf .sound-matrix-table thead th,
  .sound-calculator--pdf .sound-matrix-table th:first-child { position: static; }

  .sound-calculator--pdf .sound-supporting-content {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 2mm;
    margin-top: 2mm;
  }

  .sound-calculator--pdf .sound-concepts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2mm; }
  .sound-calculator--pdf .sound-concepts article { padding: 2mm; border-radius: 2.5mm; }
  .sound-calculator--pdf .sound-concepts article > span { width: 6mm; height: 6mm; border-radius: 1.5mm; font-size: 6pt; }
  .sound-calculator--pdf .sound-concepts h3 { margin: 1mm 0 .5mm; font-size: 7pt; }
  .sound-calculator--pdf .sound-concepts p,
  .sound-calculator--pdf .sound-method ol,
  .sound-calculator--pdf .sound-installation-note { font-size: 5.5pt; line-height: 1.35; }
  .sound-calculator--pdf .sound-method ol { gap: 1mm; padding-left: 4mm; }
  .sound-calculator--pdf .sound-installation-note { gap: 1mm; padding: 2.2mm; border-radius: 2.5mm; }
  .sound-calculator--pdf .sound-installation-note > span { font-size: 5pt; }
  .sound-calculator--pdf .sound-installation-note > strong { font-size: 8pt; }
}
