/* Wspolny naglowek i tokeny MJKM sa osadzane przez PHP; tutaj pozostaja style kalkulatora. */
:root {
  --chart-control-x-min-left: calc(10% + 54px);
  --chart-control-x-min-bottom: 24px;
  --chart-control-x-max-left: calc(80% - 14px);
  --chart-control-x-max-bottom: 24px;
  --chart-control-y-min-left: 36px;
  --chart-control-y-min-top: calc(88.5% - 20px);
  --chart-control-y-max-left: 36px;
  --chart-control-y-max-top: calc(11.2% + 12px);
  --chart-control-auto-left: 40px;
  --chart-control-auto-bottom: 38px;
  --detail-chart-picker-width: auto;
}

/* MAS-MRD: schemat nie tworzy drugiego, ciemniejszego pola wewnątrz karty. */
body[data-calculator-id="mas-mrd"] .scheme-visual,
body[data-calculator-id="mas-mrd"] .preview-scheme-crop,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-preview {
  box-sizing: border-box;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: transparent !important;
}

body[data-calculator-id="mas-mrd"] .scheme-visual img,
body[data-calculator-id="mas-mrd"] .preview-scheme-crop img,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-preview img {
  padding: 0 !important;
  background: transparent !important;
  object-fit: contain;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-y: scroll;
  background-color: var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
}

sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.45em;
}

button,
input,
select,
table {
  font: inherit;
}

input,
select,
.number-stepper,
.preview-result,
.preview-metrics-table,
.result-metrics,
.family-cards,
.results-table,
.detail-calculations,
.line-chart-svg,
.chart-range-control,
.math-symbol,
.unit,
.result-number {
  font-variant-numeric: tabular-nums;
}

code {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--brand-dark);
  font-size: var(--fs-base);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.layout {
  display: grid;
  gap: var(--space-grid);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.94fr) minmax(0, 1.06fr);
  gap: var(--space-grid);
}

.panel-config .panel-grid {
  grid-template-columns: minmax(0, 1fr) 600px;
  column-gap: var(--space-grid);
  justify-content: stretch;
  align-items: stretch;
}

.panel-config .config-choice-stack {
  grid-column: 1;
  min-width: 0;
}

.panel-config .card-general {
  grid-column: 2;
  min-width: 0;
}

.config-choice-stack {
  display: grid;
  gap: var(--space-grid);
  align-content: start;
}

.panel-grid-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-grid);
  margin-bottom: var(--space-grid);
  align-items: start;
}

.results-overview-grid {
  display: block;
  margin-bottom: var(--space-grid);
}

.results-summary-card {
  width: 100%;
  max-width: 100%;
  --summary-metrics-table-width: 260px;
  --summary-family-card-width: 320px;
  --summary-result-card-min-height: 370px;
}

.results-summary-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 1fr);
  justify-content: stretch;
  gap: var(--space-grid);
  align-items: stretch;
}

.results-summary-part {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.results-table-sections {
  display: grid;
  gap: var(--space-grid);
}

.results-table-section {
  display: grid;
  gap: var(--space-row);
  padding-top: var(--space-grid);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.results-table-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.results-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 10px 20px;
}

.results-section-head h3 {
  margin: 0;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.2;
}

.results-section-head .section-label {
  margin-bottom: 6px;
}

.results-table-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.55;
  max-width: 70ch;
}

.results-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  justify-content: center;
  gap: var(--space-grid);
  align-items: stretch;
  min-width: 756px;
}

.detail-top-stack {
  display: grid;
  gap: var(--space-grid);
  margin-bottom: var(--space-grid);
}

.theory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-grid);
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-grid);
}

.how-card-head-wide {
  max-width: none;
}

.how-intro-copy {
  max-width: none;
  font-size: var(--fs-small);
  line-height: 1.62;
  text-wrap: pretty;
}

.how-summary-copy {
  max-width: none;
  font-size: var(--fs-small);
  line-height: 1.62;
  text-wrap: pretty;
}

.how-nowrap-line {
  white-space: nowrap;
}

.theory-card-wide {
  grid-column: auto;
}

.card-general {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  align-self: stretch;
  width: max-content;
  max-width: 100%;
  height: auto;
  gap: var(--space-grid);
  padding-right: 22px;
  padding-left: 22px;
}

.section-label {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-head p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.7;
  text-align: left;
}

.card-general > .card-head p {
  text-align: justify;
}

.card-general > .card-head {
  width: 100%;
  max-width: none;
}

.input-warning {
  margin: 0;
  padding: 0;
  border-top: 0;
  color: var(--danger);
  text-align: justify;
}

.input-warning strong {
  color: var(--danger);
}

.class-four-warning {
  color: var(--danger);
  font-weight: 700;
}

.class-four-warning strong {
  color: var(--danger);
}

.model-warning {
  margin: 0;
  padding: 0;
  border-top: 0;
  color: var(--danger);
  line-height: 1.7;
  text-align: justify;
}

.model-warning strong {
  color: var(--danger);
}

.summary-warning {
  display: block;
  width: calc(100% + 50px);
  max-width: calc(100% + 50px);
  margin: 34px 0 0;
  color: var(--danger);
  font-size: var(--fs-small);
  line-height: 1.55;
  text-align: justify;
}

.summary-warning strong {
  color: var(--danger);
}

.theory-limitation-warning,
.upe-limitation-warning {
  color: var(--danger);
  font-size: var(--fs-base);
  line-height: 1.7;
  text-align: justify;
}

.theory-limitation-warning strong,
.upe-limitation-warning strong {
  color: var(--danger);
}

.upe-limitation-warning {
  margin: 12px 0 0;
}

.theory-card {
  padding: var(--space-card-y) var(--space-card-x);
}

.theory-card-head-wide {
  max-width: 118ch;
}

.theory-nowrap-line {
  white-space: nowrap;
}

.theory-formula {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.theory-formula-mcr .formula-figure {
  max-width: min(100%, 600px);
  padding: 10px 12px;
}

.theory-formula-compact {
  margin-bottom: 0;
}

.formula-gallery {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.equation-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-grid);
  margin-top: var(--space-row);
}

.equation-note {
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.equation-note h3 {
  margin: 0 0 6px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
}

.equation-note p {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.65;
}

.formula-caption {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.formula-figure {
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  height: auto;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-plain);
  box-sizing: border-box;
  overflow: hidden;
}

.formula-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.formula-figure-small {
  max-height: 70px;
  padding: 8px 10px;
}

.formula-gallery .theory-formula:nth-child(1) .formula-figure-small,
.formula-gallery .theory-formula:nth-child(3) .formula-figure-small {
  max-height: 92px;
}

.formula-gallery .theory-formula:nth-child(2) .formula-figure-small {
  max-height: 67px;
}

.theory-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: var(--fs-base);
}

.panel-how .theory-list {
  padding-top: 13px;
}

.theory-list li + li {
  margin-top: 8px;
}

.bibliography-list {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.7;
}

.bibliography-list p {
  margin: 0;
}

.theory-flow {
  display: grid;
  gap: 0;
}

.theory-section {
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}

.theory-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.theory-section h3 {
  margin: 0 0 6px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
}

.theory-section p,
.theory-section .theory-list {
  margin-bottom: 0;
  line-height: 1.7;
}

.how-flow {
  display: grid;
  gap: var(--space-row);
}

.how-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--space-row);
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line-ghost);
}

.how-step:first-child {
  border-top: 0;
  padding-top: 2px;
}

.how-step-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-accent);
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: var(--fs-base);
}

.how-step h3 {
  margin: 0 0 6px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
}

.how-step p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.how-summary dt {
  min-width: 110px;
}

.how-note {
  margin: 16px 0 0;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.7;
}

.how-notation-list {
  margin-top: 2px;
}

.equation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
  border-top: 0;
}

.equation-card {
  padding: 0;
  border-bottom: 0;
  background: transparent;
  border-radius: 0;
}

.theory-ec3-card {
  margin-top: 16px;
}

.equation-line {
  margin: 0 0 8px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.45;
}

.equation-title {
  margin: 0 0 12px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.3;
}

.equation-text {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.65;
  max-width: 72ch;
}

.equation-name {
  margin-top: 14px;
  margin-bottom: 2px;
  font-weight: 400;
}

.mathml-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 10px;
}

.mathml-equation {
  display: block;
  width: var(--detail-chart-picker-width, max-content);
  max-width: min(100%, calc(100vw - 64px));
  color: var(--text);
  font-family: var(--font-math);
  font-size: var(--fs-heading);
  line-height: 1.6;
}

.theory-mcr-formula-equation {
  font-size: calc(var(--fs-heading) * 0.75);
}

.theory-ec3-card .mathml-equation {
  font-size: calc(var(--fs-heading) * 0.75);
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-stack {
  display: grid;
  gap: 28px;
  margin-top: 20px;
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-item {
  display: grid;
  justify-items: start;
  gap: 4px;
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-item .equation-name {
  margin: 0;
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-item .mathml-wrap {
  padding: 0;
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-item .mathml-equation {
  font-size: calc(var(--fs-base) * 1.15);
  line-height: 1.45;
}

body[data-calculator-id="mas-mrd"] .theory-masonry-formula-item .mathml-equation + .mathml-equation {
  margin-top: 6px;
}

.detail-mathml-wrap {
  display: block;
  width: 100%;
  padding-bottom: 8px;
  text-align: left;
}

.detail-mathml-stack {
  display: grid;
  justify-content: start;
  justify-items: start;
  gap: 0.55em;
}

.detail-mathml-row {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0;
  text-align: left;
}

.detail-mathml-equation {
  display: inline-block;
  width: auto;
  max-width: 100%;
  font-size: var(--fs-base);
  line-height: 1.6;
  margin: 0 auto 0 0 !important;
  text-align: left;
  vertical-align: top;
}

.detail-mathml-result-strong,
.detail-mathml-result-strong mtext {
  font-weight: 700;
}

.formula-card .mathml-wrap,
.detail-calculation-line .mathml-wrap {
  padding-bottom: 6px;
}

.formula-card .mathml-equation,
.detail-calculation-line .mathml-equation,
.detail-calculation-result .mathml-equation {
  font-size: var(--fs-base);
}

.detail-calculation-line .mathml-wrap + .mathml-wrap {
  margin-top: 8px;
}

.theory-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-plain);
}

.theory-card-schemes .card-head {
  align-items: flex-start;
}

.theory-inline-copy {
  white-space: nowrap;
  font-size: var(--fs-small);
}

.theory-table-wrap-fit {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.theory-table-wrap-reference {
  display: block;
  margin-top: 8px;
}

.theory-table-wrap-reference-narrow {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-right: auto;
  min-width: 0;
  overflow: auto;
}

.theory-table.theory-table-fit {
  width: auto;
  min-width: 860px;
}

.theory-reference-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

.theory-table-wrap-imperfection {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-left: auto;
}

.theory-reference-stack {
  display: inline-grid;
  gap: 12px;
  justify-items: start;
  width: auto;
}

.ltb-reference-tables {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.theory-imperfection-table {
  width: auto;
  min-width: 0;
}

.theory-imperfection-table th,
.theory-imperfection-table td {
  text-align: center;
  width: auto;
  vertical-align: middle;
}

.theory-imperfection-table th:first-child,
.theory-imperfection-table td:first-child {
  text-align: center;
}

.theory-reference-table th,
.theory-reference-table td {
  padding: 14px 16px;
  font-size: var(--fs-base);
  line-height: 1.55;
  vertical-align: middle;
  text-align: center;
}

.theory-reference-table th {
  font-size: var(--fs-base);
}

.theory-reference-table th:nth-child(1),
.theory-reference-table td:nth-child(1) {
  width: auto;
}

.theory-reference-table th:nth-child(2),
.theory-reference-table td:nth-child(2) {
  width: auto;
  text-align: center;
}

.theory-reference-table th:nth-child(3),
.theory-reference-table td:nth-child(3) {
  width: auto;
  text-align: center;
}

.theory-cantilever-table-wrap {
  margin-top: 14px;
}

.theory-cantilever-c-section {
  border-top: 0;
  padding-top: 0;
}

.theory-cantilever-equation-card h3 {
  font-weight: 700;
}

.theory-cantilever-equation-card .text-justify-long {
  margin: 0;
  line-height: 1.65;
}

.theory-cantilever-equation-card .theory-cantilever-formula-stack {
  padding-top: 0;
}

.theory-cantilever-equation-card .theory-formula-item {
  display: block;
}

.theory-cantilever-equation-card .theory-formula-item + .theory-formula-item {
  margin-top: 10px;
}

.theory-cantilever-equation-card .theory-formula-label {
  margin: 14px 0 2px;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.65;
}

.theory-cantilever-equation-card .theory-mcr-formula-equation {
  line-height: 1.6;
}

.theory-cantilever-c-table {
  min-width: 0;
  table-layout: fixed;
}

.theory-cantilever-c-table th,
.theory-cantilever-c-table td {
  text-align: center;
  vertical-align: middle;
  font-weight: 400;
}

.theory-cantilever-c-table thead th {
  font-weight: 400;
}

.theory-cantilever-c-table .theory-cantilever-c-head-row th:first-child {
  width: 16%;
}

.theory-cantilever-c-table thead tr:last-child th,
.theory-cantilever-c-table .theory-cantilever-c-head-row th {
  line-height: 1.3;
}

.theory-cantilever-c-table tbody td:first-child {
  font-weight: 400;
}

.ltb-reference-tables .theory-table {
  width: auto;
}

.ltb-reference-tables .equation-text {
  max-width: none;
  padding: 12px 16px 8px;
  text-align: center;
}

.ltb-reference-tables .theory-table th,
.ltb-reference-tables .theory-table td {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.theory-table {
  width: 100%;
  border-collapse: collapse;
}

.theory-table th,
.theory-table td {
  padding: var(--space-cell-y) var(--space-cell-x);
  border-bottom: 1px solid var(--line-faint);
  font-size: var(--fs-base);
  text-align: left;
  vertical-align: top;
}

.theory-table thead th {
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-wrap {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow: visible;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table {
  width: max-content;
  max-width: 100%;
  min-width: 0;
  table-layout: auto;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-strength-material-column {
  width: 25ch;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-strength-fxk1-column,
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-strength-fxk2-column {
  width: 34ch;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th,
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table td {
  padding: 14px 20px;
  font-size: var(--fs-small);
  line-height: 1.45;
  vertical-align: middle;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th:first-child,
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table td:first-child {
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th:not(:first-child),
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table td:not(:first-child) {
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th:nth-child(2),
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table td:nth-child(2),
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th:nth-child(3),
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table td:nth-child(3) {
  border-left: 1px solid var(--line);
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table thead th {
  color: var(--heading);
  font-weight: 700;
  overflow: visible;
  position: relative;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table tbody th:first-child {
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] .flexural-strength-formula-cell {
  height: auto;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-head {
  display: grid;
  align-content: center;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-trigger {
  position: relative;
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  cursor: help;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-trigger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-preview {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 0;
  width: min(420px, 72vw);
  height: 420px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-plain);
  box-shadow: var(--shadow);
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table th:nth-child(3) .flexural-plane-preview {
  right: 0;
  left: auto;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-trigger:hover .flexural-plane-preview,
body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-trigger:focus .flexural-plane-preview {
  display: block;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: contain;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-preview .flexural-plane-graphic--light {
  display: none;
}

html[data-theme="light"] body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-preview .flexural-plane-graphic--dark {
  display: none;
}

html[data-theme="light"] body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-plane-preview .flexural-plane-graphic--light {
  display: block;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .formula-stack {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 8px;
  min-height: 0;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .flexural-strength-equation {
  width: auto;
  max-width: 100%;
  margin: 0;
  color: var(--heading);
  font-size: 1em;
  line-height: 1.35;
}

body[data-calculator-id="mas-mrd"] .masonry-flexural-strength-table .formula-note {
  color: var(--text);
  font-size: 0.92em;
  line-height: 1.35;
}

.revisions-table {
  width: auto;
  min-width: 0;
}

.revisions-table th:nth-child(1),
.revisions-table td:nth-child(1),
.revisions-table th:nth-child(2),
.revisions-table td:nth-child(2) {
  text-align: center;
  width: 1%;
  white-space: nowrap;
}

.revisions-table th:nth-child(3),
.revisions-table td:nth-child(3) {
  text-align: left;
  width: 1%;
  white-space: nowrap;
}

.theory-card-schemes .theory-table th,
.theory-card-schemes .theory-table td {
  text-align: center;
  vertical-align: middle;
}

.theory-card-schemes .theory-table th:first-child,
.theory-card-schemes .theory-table td:first-child {
  width: 1%;
  white-space: nowrap;
}

.theory-card-schemes .theory-table th:nth-child(2),
.theory-card-schemes .theory-table td:nth-child(2) {
  text-align: left;
}

.theory-card-schemes .theory-scheme-cell {
  grid-template-columns: minmax(180px, 1fr) 176px;
  justify-items: start;
}

.theory-card-schemes .theory-scheme-copy {
  text-align: left;
}

.theory-card-schemes .theory-scheme-graphic {
  justify-self: end;
}

.theory-scheme-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 14px;
  align-items: center;
}

.theory-scheme-copy strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.35;
}

.theory-scheme-copy .theory-scheme-label {
  display: block;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.35;
}

.theory-load-cell {
  display: grid;
  gap: 4px;
  justify-items: center;
  line-height: 1.35;
}

.theory-load-note {
  display: block;
  color: var(--text);
  font-size: inherit;
}

.theory-coefficients-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
  line-height: 1.35;
  text-align: left;
}

.theory-moment-equation {
  max-width: 100%;
  font-size: 0.95em;
}

.theory-scheme-graphic {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.theory-scheme-graphic svg,
.theory-scheme-graphic img {
  display: block;
  width: 100%;
  height: auto;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-graphic .preview-scheme-diagram {
  width: auto;
  margin: 0;
}

.notation-list {
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  border-top: 0;
}

.notation-group + .notation-group {
  margin-top: 24px;
}

.notation-group h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-choice);
  line-height: 1.35;
}

.notation-list div {
  display: table-row;
  background: transparent;
}

.notation-list dt {
  display: table-cell;
  padding: var(--space-cell-y) 30px var(--space-cell-y) 0;
  border-bottom: 0;
  color: var(--brand-dark);
  font-weight: 700;
  white-space: nowrap;
  vertical-align: top;
}

.panel-theory .notation-list dt {
  text-align: center;
}

.notation-list dd {
  display: table-cell;
  width: 100%;
  padding: var(--space-cell-y) 0;
  border-bottom: 0;
  margin: 0;
  color: var(--text);
  vertical-align: top;
}

.notation-list.how-notation-list dd {
  vertical-align: middle;
  white-space: nowrap;
}

.notation-list div:not(:last-child) dt,
.notation-list div:not(:last-child) dd {
  border-bottom: 1px solid var(--line-soft);
}

.bibliography-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.bibliography-list li + li {
  margin-top: 12px;
}

.bibliography-item {
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1.7;
}

.bibliography-item + .bibliography-item {
  margin-top: 12px;
}

.scheme-list {
  display: grid;
  gap: var(--space-row);
}

.scheme-list-theory {
  margin-bottom: var(--space-row);
}

.scheme-card {
  border: 1px solid var(--line);
  background: var(--surface-plain);
  border-radius: 14px;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  display: grid;
  grid-template-columns: 18px 240px 210px;
  gap: var(--space-row);
  align-items: center;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  min-height: 118px;
}

.scheme-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.scheme-card.is-selected {
  border-color: var(--brand);
  background: var(--surface-selected);
  box-shadow: var(--shadow);
}

.scheme-card.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.scheme-card input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  align-self: center;
  justify-self: center;
}

.scheme-indicator {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  background: var(--surface-plain);
}

.scheme-card-static {
  cursor: default;
}

.scheme-card-static:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.scheme-copy strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: var(--fs-choice);
  line-height: 1.35;
  white-space: nowrap;
}

.scheme-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--brand);
  font-size: var(--fs-small);
  font-weight: 700;
}

.scheme-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-accent);
  border: 1px solid var(--line);
}

.scheme-visual {
  width: 210px;
  min-height: 66px;
  margin-left: 12px;
  padding: 4px 5px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  justify-self: start;
}

.scheme-visual svg,
.scheme-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.scheme-image,
.theory-scheme-image {
  object-fit: contain;
}

@media (max-width: 560px) {
}

@media (max-width: 900px) {
}

.input-grid {
  display: grid;
  gap: var(--space-row);
}

.general-layout {
  display: grid;
  grid-template-columns: max-content 330px;
  justify-content: start;
  gap: 20px;
  align-items: start;
}

.general-form-column {
  --general-label-width: 160px;
  --general-control-width: 108px;
  display: grid;
  align-content: start;
  gap: var(--space-row);
  padding: var(--space-subcard-y) var(--space-subcard-x);
  padding-right: 16px;
  padding-left: 16px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  min-width: 0;
  width: max-content;
  max-width: none;
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
  justify-items: center;
  text-align: center;
}

.input-grid-general {
  grid-template-columns: 1fr;
  row-gap: var(--space-row);
  max-width: var(--general-label-width);
  justify-items: center;
}

.card-general .field {
  gap: 3px;
  width: var(--general-label-width);
  max-width: 100%;
  justify-items: center;
  text-align: center;
}

.card-general .field > span {
  white-space: nowrap;
  text-align: center;
}

.card-general .field > input,
.card-general .field > select,
.card-general .number-stepper {
  width: min(100%, var(--general-control-width));
  justify-self: center;
}

.card-general .field-note {
  max-width: var(--general-label-width);
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.35;
  text-align: center;
}

.general-form-head {
  width: 100%;
  text-align: center;
}

.general-form-head h2 {
  margin-bottom: 0;
}

.field-centered-control select {
  text-align: center;
  text-align-last: center;
}

#profile-family-field-wrap select {
  width: min(100%, var(--general-control-width));
}

.inertia-axis-field,
.bending-axis-field {
  position: relative;
  z-index: 20;
}

.inertia-axis-picker {
  position: relative;
  width: min(100%, var(--general-control-width));
  justify-self: center;
}

.inertia-axis-picker-toggle {
  position: relative;
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 24px 0 8px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.inertia-axis-picker-toggle > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: center;
}

.inertia-axis-picker-toggle:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.inertia-axis-picker-toggle sub,
.inertia-axis-picker-option sub {
  font-size: 75%;
  line-height: 0;
}

.inertia-axis-picker-chevron {
  position: absolute;
  right: 10px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.inertia-axis-picker.is-open .inertia-axis-picker-chevron {
  transform: rotate(225deg) translateY(-1px);
}

.inertia-axis-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inertia-axis-picker-option {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  text-align: center;
  cursor: pointer;
}

.inertia-axis-picker-option:hover,
.inertia-axis-picker-option:focus,
.inertia-axis-picker-option.is-selected {
  outline: none;
  background: var(--surface-selected);
}

.profile-nested-field {
  position: relative;
  z-index: 30;
}

.profile-picker {
  position: relative;
  width: var(--general-label-width);
  display: grid;
  justify-items: center;
}

.profile-picker-toggle {
  width: min(100%, var(--general-control-width));
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.profile-picker-toggle:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.profile-picker-chevron,
.profile-picker-family-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.profile-picker.is-open .profile-picker-chevron,
.profile-picker-family.is-expanded .profile-picker-family-chevron {
  transform: rotate(225deg) translateY(-1px);
}

.profile-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 80;
  width: 260px;
  min-width: 260px;
  max-height: min(620px, calc(100vh - 80px));
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.profile-picker-group + .profile-picker-group {
  margin-top: 4px;
}

.profile-picker-family,
.profile-picker-profile {
  width: 100%;
  border: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.profile-picker-family {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-plain);
  display: grid;
  grid-template-columns: 14px 1fr 14px;
  align-items: center;
  font-size: var(--fs-small);
  font-weight: 700;
  text-align: center;
}

.profile-picker-family > span:first-child {
  grid-column: 2;
  justify-self: center;
}

.profile-picker-family .profile-picker-family-chevron {
  grid-column: 3;
  justify-self: center;
}

.profile-picker-family:hover,
.profile-picker-profile:hover {
  background: var(--surface-selected);
}

.profile-picker-profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 2px 2px;
}

.profile-picker-profile-column {
  display: grid;
  gap: 4px;
  align-content: start;
}

.profile-picker-profile {
  min-height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  background: transparent;
  font-size: var(--fs-small);
  text-align: center;
}

.profile-picker-profile.is-selected {
  background: var(--surface-selected);
  color: var(--brand-dark);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"].has-profile-picker-modal {
  overflow: hidden;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu.profile-picker-menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  align-items: center;
  justify-items: center;
  width: auto;
  min-width: 0;
  max-height: none;
  overflow: auto;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: var(--overlay);
  box-shadow: none;
  transform: none;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu.profile-picker-menu[hidden] {
  display: none;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  width: fit-content;
  min-width: min(1180px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
  box-shadow: var(--shadow);
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-dialog-head h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: calc(var(--fs-heading) * 0.7);
  text-align: left;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-close-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 700;
  cursor: pointer;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-close-button:hover,
body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-close-button:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-search {
  display: grid;
  gap: 6px;
  max-width: 360px;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-base);
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu {
  --masonry-material-profile-font-size: var(--fs-base);
  --masonry-material-family-font-size: var(--masonry-material-profile-font-size);
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu .profile-picker-group + .profile-picker-group {
  margin-top: 0;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu .profile-picker-family {
  min-height: 48px;
  padding-block: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: var(--masonry-material-family-font-size);
  line-height: 1.35;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu .profile-picker-family > span:first-child {
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu .profile-picker-profile-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  min-width: 0;
  gap: 8px;
  padding: 10px 8px 8px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-modal-menu .profile-picker-profile {
  min-height: 40px;
  padding: 6px 10px;
  font-size: var(--masonry-material-profile-font-size);
  line-height: 1.35;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-class-rows {
  display: grid;
  gap: 16px;
  padding: 18px 8px 8px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-class-section {
  display: grid;
  gap: 14px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-class-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(560px, max-content));
  grid-template-rows: repeat(var(--masonry-material-row-count, 1), auto);
  gap: 8px 16px;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-type-separator {
  width: 100%;
  height: 1px;
  background: var(--line-strong);
  opacity: 0.85;
}

body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .profile-picker-empty {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1380px) {
  body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-class-grid {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
}

@media (max-width: 640px) {
  body[data-calculator-id="mas-mrd"] #masonry-material-picker-menu .masonry-material-class-grid {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
}

.field span {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.field select:disabled,
.field option:disabled {
  color: var(--line-strong);
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.45;
  text-align: left;
}

.formula-card {
  margin: 0;
  border: 0;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line-ghost);
  border-bottom: 1px solid var(--line-ghost);
  background: transparent;
}

.formula-value-box {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.formula-value-box span {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
}

.formula-expression {
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.55;
}

.formula-value-box-full {
  justify-self: start;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card-general .actions {
  margin-top: 2px;
  padding-top: 0;
}

.preview-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  padding-right: 14px;
  padding-left: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
  box-shadow: none;
  min-width: 0;
  width: 300px;
  max-width: none;
  justify-self: start;
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
}

.preview-card .card-head h2,
.result-hero .card-head h2,
.result-families .card-head h2,
.table-card .card-head h2 {
  font-size: var(--fs-heading);
}

.preview-card .card-head {
  text-align: center;
}

.preview-card .card-head p {
  text-align: center;
}

.preview-card .card-head p#preview-description {
  display: block;
}

.preview-card .card-head,
.table-card .card-head {
  max-width: none;
}

.preview-card .card-head p,
.table-card .card-head p {
  font-size: var(--fs-base);
}

.preview-result {
  display: grid;
  justify-items: center;
  align-self: start;
  align-content: start;
  gap: var(--space-row);
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  text-align: center;
}

.preview-name {
  margin: 0;
  color: var(--good);
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}

.preview-result .preview-head {
  display: grid;
  justify-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.preview-result .hero-card-head,
.preview-card .hero-card-head {
  display: grid;
  justify-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.preview-card .hero-card-inner {
  width: 100%;
  justify-items: center;
}

.preview-result .preview-name {
  width: 100%;
  text-align: center;
}

.preview-name-stack {
  display: block;
  white-space: nowrap;
}

.preview-result .status-pill {
  justify-self: center;
}

.preview-result .status-pill.is-fail {
  border-color: var(--danger-line);
  background: var(--status-danger-bg);
  color: var(--danger);
}

.preview-result .preview-head:has(.status-pill.is-fail) .preview-name {
  color: var(--danger);
}

.preview-result .hero-card-head:has(.status-pill.is-fail) .preview-name {
  color: var(--danger);
}

.preview-result:has(.status-pill.is-pass) .result-metrics div:nth-child(4) dt,
.preview-result:has(.status-pill.is-pass) .result-metrics div:nth-child(4) dd {
  color: var(--good);
}

.preview-result:has(.status-pill.is-fail) .result-metrics div:nth-child(4) dt,
.preview-result:has(.status-pill.is-fail) .result-metrics div:nth-child(4) dd {
  color: var(--danger);
}

.preview-metrics-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.35;
}

.preview-metrics-table th:first-child,
.preview-metrics-table td:first-child {
  width: 42%;
}

.preview-metrics-table th:last-child,
.preview-metrics-table td:last-child {
  width: 58%;
}

.preview-metrics-table th,
.preview-metrics-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  vertical-align: middle;
}

.preview-metrics-table thead th {
  border-top: 1px solid var(--line-soft);
}

.preview-metrics-table th {
  color: var(--text);
  font-weight: 700;
}

.preview-metrics-table .preview-material-row th {
  width: 100%;
  padding: 14px 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.preview-metrics-table .preview-material-row sub {
  font-size: 0.72em;
}

.preview-metrics-table td {
  color: var(--text);
  font-weight: 700;
}

.preview-metrics-table tbody tr:last-child th,
.preview-metrics-table tbody tr:last-child td {
  border-bottom: 1px solid var(--line-soft);
}

.preview-result:has(.status-pill.is-pass) .preview-utilization-row th,
.preview-result:has(.status-pill.is-pass) .preview-utilization-row td,
.preview-utilization-row.is-pass th,
.preview-utilization-row.is-pass td {
  color: var(--good);
}

.preview-result:has(.status-pill.is-fail) .preview-utilization-row th,
.preview-result:has(.status-pill.is-fail) .preview-utilization-row td,
.preview-utilization-row.is-fail th,
.preview-utilization-row.is-fail td {
  color: var(--danger);
}

.preview-mass-ratio-row.is-reference td {
  color: var(--good);
}

.preview-mass-ratio-row.is-heavy td {
  color: var(--danger);
  font-weight: inherit;
}

.preview-mass-ratio-row th,
.preview-mass-ratio-row td {
  white-space: nowrap;
}

.preview-axis-note-row td {
  color: var(--brand-dark);
}

.preview-metrics,
.result-metrics,
.family-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}

.preview-metrics div,
.result-metrics div,
.family-metrics div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  justify-items: center;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  border-radius: 0;
  text-align: center;
}

.preview-metrics div {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  text-align: center;
}

.preview-metrics div:last-child,
.result-metrics div:last-child,
.family-metrics div:last-child {
  border-bottom: 0;
}

.preview-metrics dt,
.result-metrics dt,
.family-metrics dt {
  color: var(--muted);
  font-size: var(--fs-small);
  margin: 0;
}

.preview-metrics dd,
.result-metrics dd,
.family-metrics dd {
  margin: 0;
  color: var(--brand-dark);
  font-size: var(--fs-base);
  font-weight: 700;
  text-align: center;
}

.preview-metrics dt,
.preview-metrics dd {
  text-align: center;
}

.preview-result .result-metrics {
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.preview-result .result-metrics div {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  justify-items: stretch;
  column-gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}

.preview-result .result-metrics div:last-child {
  border-bottom: 0;
}

.preview-result .result-metrics dt {
  color: var(--text);
  text-align: left;
}

.preview-result .result-metrics dd {
  color: var(--text);
  text-align: right;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-plain);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button-primary {
  background: var(--brand-action);
  border-color: var(--brand-action);
  color: var(--text-inverse);
}

.hero-card {
  min-height: 0;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border-radius: 12px;
  background: var(--surface-plain);
  border: 1px solid var(--line);
  box-shadow: none;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
}

.empty-state-action-card {
  padding: var(--space-card-y) var(--space-card-x);
}

.empty-state-action {
  display: grid;
  justify-items: center;
  gap: var(--space-row);
  width: 100%;
}

.empty-state-action p {
  margin: 0;
  max-width: 30ch;
}

.best-profile-name {
  margin: 0 0 8px;
  color: var(--good);
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
}

#best-profile-description,
.result-hero .card-head p,
.result-families .card-head p {
  font-size: var(--fs-base);
  line-height: 1.65;
  text-align: left;
  white-space: normal;
  max-width: none;
}

.family-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-row);
}

.family-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  background: var(--surface-plain);
  box-shadow: none;
}

.family-card-profile {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.family-card-placeholder {
  grid-column: 1 / -1;
  min-height: 220px;
  align-content: center;
}

.family-profile-name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  color: var(--text);
}

.family-profile-name-empty {
  color: var(--muted);
}

.family-empty-message {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.7;
  text-align: center;
  white-space: normal;
}

.family-empty-message .family-empty-family,
.family-empty-message .family-empty-text {
  display: block;
}

.family-empty-message .family-empty-family {
  font-weight: 700;
}

.family-card-empty {
  justify-items: center;
}

.family-card-empty .family-result-head,
.family-card-empty .section-label {
  width: 100%;
  text-align: center;
}

.family-result-card .section-label {
  margin-bottom: 0;
  color: var(--text);
}

.family-result-card .profile-name-action {
  font-size: var(--fs-heading);
}

.family-result-card .profile-name-action.preview-name {
  font-size: var(--fs-display);
}

.result-families .family-result-card .profile-name-action.preview-name,
.result-families .family-result-card .preview-name {
  color: var(--good);
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
}

.family-result-mcr {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.family-result-mcr strong {
  color: var(--good);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  line-height: 1.25;
}

.family-result-card .preview-metrics-table {
  width: min(100%, 260px);
  margin-inline: auto;
  table-layout: auto;
}

.results-summary-card .preview-metrics-table {
  width: min(100%, var(--summary-metrics-table-width));
  max-width: 100%;
  margin-inline: auto;
}

.summary-input-data {
  width: min(270px, 100%);
  margin: 10px 0 0;
  padding-top: 0;
  border-top: 0;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.55;
  text-align: left;
}

.summary-input-data strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 700;
}

.summary-input-data .summary-warning strong {
  display: inline;
  margin-bottom: 0;
  color: var(--danger);
}

.summary-input-data p {
  margin: 0;
}

.result-hero,
.result-families,
.detail-metrics-card,
.chart-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.result-hero .hero-card,
.result-families .family-cards {
  flex: 1;
}

.table-card {
  margin-top: 0;
  padding: var(--space-card-y) var(--space-card-x);
  display: flex;
  flex-direction: column;
  gap: var(--space-row);
  width: 100%;
  max-width: none;
  justify-self: stretch;
  height: 100%;
}

.table-wrap {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-plain);
}

.results-table {
  width: max-content;
  min-width: 0;
  max-width: none;
  border-collapse: collapse;
  table-layout: auto;
}

.results-table th,
.results-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-faint);
  text-align: center;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  width: auto;
}

.results-table th:not(:first-child),
.results-table td:not(:first-child) {
  width: auto;
}

.results-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-table-head);
  color: var(--brand-dark);
  font-weight: 700;
  vertical-align: middle;
  z-index: 1;
}

.table-head-stack {
  display: inline-grid;
  gap: 2px;
  align-items: center;
  justify-items: center;
  line-height: 1.15;
  vertical-align: middle;
}

.results-table tbody tr:nth-child(even) {
  background: var(--surface-table-even);
}

.results-table tbody tr:hover {
  background: var(--surface-table-hover);
}

.theory-schemes-table tbody tr:hover {
  background: transparent;
}

.theory-schemes-table tbody tr:nth-child(even):hover {
  background: var(--surface-table-even);
}

body[data-calculator-id="mas-mrd"] .theory-card-wide .table-wrap:has(.theory-schemes-table) {
  width: fit-content;
  max-width: 100%;
  margin-left: 0;
  margin-right: auto;
  overflow-x: auto;
}

body[data-calculator-id="mas-mrd"] .theory-card-wide .theory-schemes-table {
  width: max-content;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-column {
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-column + .theory-scheme-column {
  margin-left: 0;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-column-head {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface-subtle);
}

body[data-calculator-id="mas-mrd"] .theory-scheme-column-head h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.3;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-table-caption {
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: transparent;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-column-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-lane {
  display: grid;
  align-self: start;
  align-content: start;
  grid-auto-rows: minmax(360px, auto);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 0 8px;
  background: var(--surface-plain);
}

body[data-calculator-id="mas-mrd"] .theory-scheme-lane + .theory-scheme-lane {
  border-left: 1px solid var(--line);
  border-radius: 0 0 8px 0;
  margin-left: -1px;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  justify-items: start;
  min-width: 0;
  min-height: 360px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item:first-child {
  border-top: 0;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item .theory-scheme-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item .theory-scheme-copy strong {
  color: var(--text);
  font-size: calc(var(--fs-small) * 1.5);
  font-weight: 700;
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item .scheme-edge-description,
body[data-calculator-id="mas-mrd"] .theory-scheme-item .scheme-edge-description p,
body[data-calculator-id="mas-mrd"] .theory-scheme-item .scheme-edge-row {
  font-size: var(--fs-small);
  line-height: 1.35;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-item .theory-scheme-graphic {
  justify-self: end;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

@media (max-width: 760px) {
  body[data-calculator-id="mas-mrd"] .theory-scheme-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-column + .theory-scheme-column {
    margin-left: 0;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-column-grid {
    grid-template-columns: 1fr;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-lane + .theory-scheme-lane {
    border-left: 0;
    border-top: 1px solid var(--line);
    margin-left: 0;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-lane + .theory-scheme-lane .theory-scheme-item:first-child {
    border-top: 0;
  }
}

@media (max-width: 520px) {
  body[data-calculator-id="mas-mrd"] .theory-scheme-item {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-item .theory-scheme-copy {
    justify-self: stretch;
  }

  body[data-calculator-id="mas-mrd"] .theory-scheme-item .theory-scheme-graphic {
    justify-self: center;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.results-table tbody td[colspan] {
  padding: 20px 14px;
  color: var(--muted);
  text-align: center;
}

.detail-summary {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: var(--space-row);
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-plain);
}

.detail-summary.detail-result-layout {
  width: 100%;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
  justify-items: start;
  box-sizing: border-box;
}

.detail-result-content {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr);
  gap: var(--space-grid);
  align-items: stretch;
  width: 100%;
  --detail-panel-fixed-height: 620px;
  --detail-chart-fixed-height: 520px;
}

@media (min-width: 1221px) {
}

/* MAS-MRD: stały wewnętrzny margines dla całego natywnego schematu SVG. */
body[data-calculator-id="mas-mrd"] .scheme-visual img,
body[data-calculator-id="mas-mrd"] .preview-scheme-crop img,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-preview img {
  transform: scale(0.9);
  transform-origin: center;
}

.detail-result-content .detail-summary {
  width: 100%;
  height: var(--detail-panel-fixed-height);
  min-height: var(--detail-panel-fixed-height);
  align-self: stretch;
}

.detail-result-head {
  display: grid;
  gap: var(--space-row);
}

.detail-result-head h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.2;
}

.detail-result-head p {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.7;
}

.detail-result-head strong {
  color: var(--text);
  font-weight: 700;
}

.detail-result-preview {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
}

.detail-inline-chart-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-row);
  min-width: 0;
  min-height: var(--detail-panel-fixed-height);
  height: var(--detail-panel-fixed-height);
  align-self: stretch;
  overflow: hidden;
  box-sizing: border-box;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
}

@media (max-width: 860px) {
  .detail-result-content {
    grid-template-columns: 1fr;
  }

  .detail-result-content .detail-summary,
  .detail-result-content .detail-summary.detail-result-layout {
    height: auto;
    min-height: 0;
  }

  .detail-inline-chart-panel {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
  }
}

.detail-result-content .detail-summary.detail-result-layout,
.detail-result-content .detail-inline-chart-panel {
  height: var(--detail-panel-fixed-height);
  min-height: var(--detail-panel-fixed-height);
  align-self: stretch;
}

@media (min-width: 861px) {
  .panel-details .detail-result-content > #checked-profile-card.detail-summary.detail-result-layout,
  .panel-details .detail-result-content > #detail-chart-panel.detail-inline-chart-panel {
    height: var(--detail-panel-fixed-height, 620px);
    min-height: var(--detail-panel-fixed-height, 620px);
  }
}

.detail-chart-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto max-content;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.detail-chart-toolbar label {
  color: var(--text);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.2;
}

.detail-chart-toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  justify-self: end;
  width: auto;
  max-width: none;
}

.detail-chart-static-title {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.detail-chart-picker {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  min-width: 0;
}

.detail-chart-picker-sizer {
  grid-area: 1 / 1;
  visibility: hidden;
  min-height: 30px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 32px 0 8px;
  font: inherit;
  font-size: var(--fs-small);
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.detail-chart-picker-toggle {
  grid-area: 1 / 1;
  width: 100%;
  max-width: none;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.detail-chart-picker-toggle > span:first-child {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.detail-chart-picker-toggle:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.detail-chart-picker-toggle sub,
.detail-chart-picker-option sub {
  font-size: 75%;
  line-height: 0;
}

.detail-chart-picker-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.detail-chart-picker-toggle[aria-expanded="true"] .detail-chart-picker-chevron {
  transform: rotate(225deg) translateY(-1px);
}

.detail-chart-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-chart-picker-option {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  text-align: left;
  white-space: normal;
  overflow-wrap: normal;
  cursor: pointer;
}

.detail-chart-picker-option:hover,
.detail-chart-picker-option:focus,
.detail-chart-picker-option.is-selected {
  outline: none;
  background: var(--surface-selected);
}

/* Jeden wymiar selektora zapobiega zmianie szerokości i lomaniu nazw wykresow. */
body[data-calculator-id="mas-mrd"] .detail-chart-picker-option {
  white-space: nowrap;
}

.detail-chart-range {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  z-index: 5;
  align-self: stretch;
  width: 100%;
  height: var(--detail-chart-fixed-height, 520px);
  min-height: var(--detail-chart-fixed-height, 520px);
  pointer-events: none;
}

.detail-chart-range:empty {
  display: none;
}

.detail-chart-axis-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.detail-chart-axis-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: var(--fs-chart-control);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
}

.detail-chart-axis-pill-x-min {
  left: var(--chart-control-x-min-left);
  bottom: var(--chart-control-x-min-bottom);
  transform: translateX(-50%);
}

.detail-chart-axis-pill-x-max {
  left: var(--chart-control-x-max-left);
  bottom: var(--chart-control-x-max-bottom);
  transform: translateX(-50%);
}

.detail-chart-axis-pill-y-min {
  left: var(--chart-control-y-min-left);
  top: var(--chart-control-y-min-top);
  transform: translateY(-50%);
}

.detail-chart-axis-pill-y-max {
  left: var(--chart-control-y-max-left);
  top: var(--chart-control-y-max-top);
  transform: translateY(-50%);
}

.detail-chart-range-reset {
  position: absolute;
  right: auto;
  bottom: var(--chart-control-auto-bottom);
  left: var(--chart-control-auto-left);
  top: auto;
  min-height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 2px 8px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-chart-control);
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.detail-chart-range-reset:hover,
.detail-chart-range-reset:focus {
  outline: none;
  background: var(--surface-selected);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--focus-ring);
}

.detail-chart-range-input {
  display: block;
  flex: 0 0 34px;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 3px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-chart-control);
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
  cursor: text;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.detail-chart-range-input:hover {
  border-color: var(--brand);
  background: var(--surface-selected);
}

.detail-chart-range-input:focus {
  position: relative;
  z-index: 1;
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chart.detail-inline-chart {
  grid-column: 1;
  grid-row: 2;
  height: var(--detail-chart-fixed-height, 520px);
  min-height: var(--detail-chart-fixed-height, 520px);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.chart.detail-inline-chart.is-panning {
  cursor: grabbing;
}

.chart.detail-inline-chart .mcr-chart-not-applicable {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.chart.detail-inline-chart .mcr-chart-not-applicable > span {
  white-space: nowrap;
}

.detail-result-warning {
  margin-top: var(--space-row);
}

.detail-result-warning:empty {
  display: none;
}

.detail-result-preview .preview-metrics-table,
.detail-summary.preview-result .preview-metrics-table {
  width: min(100%, 320px);
  max-width: 100%;
  margin-inline: auto;
  table-layout: fixed;
}

#checked-profile-card .preview-metric-label-col {
  width: 46%;
}

#checked-profile-card .preview-metric-value-col {
  width: 54%;
}

.detail-result-layout .model-warning {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  margin-top: var(--space-row);
}

.detail-summary-note {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.65;
}

.detail-metrics {
  display: block;
}

.detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: var(--space-row);
}

.metric-row {
  display: grid;
  align-content: center;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-plain);
  text-align: center;
}

.metric-row span {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.3;
}

.metric-row strong {
  margin-top: 6px;
  color: var(--brand-dark);
  font-size: var(--fs-heading);
  line-height: 1.15;
}

.metric-row small {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
}

.metric-row.is-primary {
  border-color: var(--line-strong);
  background: var(--surface-selected);
}

.metric-row.is-pass strong,
.metric-row.is-reference strong {
  color: var(--good);
}

.metric-row.is-fail strong,
.metric-row.is-heavy strong {
  color: var(--danger);
}

.detail-empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-plain);
  color: var(--text);
  text-align: center;
}

.detail-metrics-table-wrap {
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-plain);
}

.detail-metrics-table {
  width: auto;
  min-width: 0;
  border-collapse: collapse;
}

.detail-metrics-table th,
.detail-metrics-table td {
  padding: var(--space-cell-y) var(--space-cell-x);
  border-bottom: 1px solid var(--line-ghost);
  font-size: var(--fs-base);
  line-height: 1.55;
  vertical-align: middle;
}

.detail-metrics-table thead th {
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-weight: 700;
  text-align: left;
}

.detail-metrics-table thead th:first-child,
.detail-metrics-table thead th:last-child {
  text-align: center;
}

.detail-metrics-table tbody tr.is-primary {
  background: var(--surface-selected);
}

.detail-metrics-table td:first-child {
  width: 130px;
  color: var(--brand-dark);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.detail-metrics-table td:nth-child(2) {
  width: auto;
  color: var(--text);
}

.detail-metrics-table td:last-child {
  width: 160px;
  color: var(--brand-dark);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.detail-metrics-table tbody tr:last-child > * {
  border-bottom: 1px solid var(--line-ghost);
}

.detail-preview-metrics-table {
  width: 360px;
  max-width: 100%;
}

.detail-preview-metrics-table th:first-child,
.detail-preview-metrics-table td:first-child {
  width: 58%;
}

.detail-preview-metrics-table th:last-child,
.detail-preview-metrics-table td:last-child {
  width: 42%;
}

.detail-preview-metrics-table tbody tr.is-primary {
  background: var(--surface-selected);
}

.detail-calculation-line > span,
.detail-calculation-result > span {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-calculation-line > div,
.detail-calculation-result > div {
  display: grid;
  align-content: start;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  text-align: left;
  word-break: break-word;
}

.detail-calculation-line .mathml-wrap,
.detail-calculation-result .mathml-wrap {
  display: block;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

.detail-calculation-line .detail-mathml-display-wrap,
.detail-calculation-result .detail-mathml-display-wrap {
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
}

.detail-calculation-line .detail-mathml-stack,
.detail-calculation-result .detail-mathml-stack {
  display: grid;
  gap: 12px;
  justify-content: start;
  justify-items: start;
}

.detail-calculation-line .mathml-equation,
.detail-calculation-result .mathml-equation {
  margin-left: 0 !important;
  margin-right: auto !important;
}

.detail-calculation-line .mathml-equation.is-display,
.detail-calculation-result .mathml-equation.is-display {
  display: block;
  margin: 0 !important;
  math-style: normal;
  font-size: 1.05em;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-line,
body[data-calculator-id="mas-mrd"] .detail-calculation-result {
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: start;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-result {
  margin-top: 18px;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-line + .detail-calculation-line {
  margin-top: 18px;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-line > span,
body[data-calculator-id="mas-mrd"] .detail-calculation-result > span {
  align-self: start;
  padding-top: 2px;
}

body[data-calculator-id="mas-mrd"] .interpolation-stage {
  margin: 24px 0 0;
  padding: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-stage + .interpolation-stage {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-context {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

body[data-calculator-id="mas-mrd"] .interpolation-context.interpolation-boundaries {
  margin-top: 24px;
}

body[data-calculator-id="mas-mrd"] .interpolation-table-wrap {
  margin-top: 26px;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-line .interpolation-scheme-label {
  margin: 20px 0 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-scheme-label + .detail-scheme-context {
  margin-top: 12px;
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context {
  display: grid;
  grid-template-columns: max-content auto;
  align-items: center;
  justify-items: start;
  gap: clamp(18px, 3vw, 34px);
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin: 12px 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-plain);
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context .scheme-edge-description {
  margin: 0;
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context .scheme-edge-description > p {
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context .scheme-edge-table {
  width: min(100%, 280px);
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context .theory-scheme-graphic {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Zamrożony rozmiar grafiki w obliczeniach szczegółowych. */
body[data-calculator-id="mas-mrd"] .detail-scheme-context .theory-scheme-graphic .preview-scheme-crop {
  width: 314px;
  height: 301px;
}

body[data-calculator-id="mas-mrd"] .detail-scheme-context + .interpolation-table-wrap {
  margin-top: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-scheme-label + .interpolation-table-wrap {
  margin-top: 0;
}

@media (max-width: 760px) {
  body[data-calculator-id="mas-mrd"] .detail-scheme-context {
    grid-template-columns: 1fr;
    width: 100%;
  }

  body[data-calculator-id="mas-mrd"] .detail-scheme-context .theory-scheme-graphic {
    justify-self: start;
  }
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table {
  width: auto;
  min-width: 260px;
  margin-top: 12px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-small);
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table th,
body[data-calculator-id="mas-mrd"] .interpolation-mini-table td {
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table th {
  background: var(--surface-plain);
  font-weight: 600;
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table td {
  background: var(--panel);
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table .interpolation-selected-cross {
  background: var(--surface-accent);
  color: var(--text);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table tr > :last-child {
  border-right: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-mini-table tbody tr:last-child > * {
  border-bottom: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-direct-read {
  margin-top: 22px;
}

body[data-calculator-id="mas-mrd"] .interpolation-context .calculation-formula-note {
  margin: 0;
}

body[data-calculator-id="mas-mrd"] .interpolation-stage .calculation-formula-note {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.6;
}

body[data-calculator-id="mas-mrd"] .interpolation-stage .detail-mathml-stack {
  gap: 10px;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-line .mathml-equation mfrac,
body[data-calculator-id="mas-mrd"] .detail-calculation-result .mathml-equation mfrac,
body[data-calculator-id="mas-mrd"] .detail-calculation-line .mathml-equation mfrac > *,
body[data-calculator-id="mas-mrd"] .detail-calculation-result .mathml-equation mfrac > * {
  math-style: normal;
  font-size: 1em;
}

.calculation-formula-note {
  display: inline-block;
  margin: 4px 0 0 36px;
  color: var(--text);
  white-space: nowrap;
}

.detail-calculation-line .calculation-formula-note {
  display: block;
  margin: 10px 0 0;
  white-space: normal;
}

.detail-calculation-line .calculation-formula-note + .mathml-wrap {
  margin-top: 10px;
}

.detail-calculation-result .calculation-formula-note {
  display: block;
  margin: 10px 0 0;
}

.chart-card-combined {
  grid-column: 1 / -1;
}

.detail-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-grid);
  align-items: start;
}

.detail-chart-section {
  display: grid;
  gap: var(--space-row);
  min-width: 0;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
}

.detail-chart-section .card-head {
  max-width: none;
}

.detail-chart-section .card-head h2 {
  font-size: var(--fs-base);
  line-height: 1.25;
}

.detail-chart-section .card-head p {
  font-size: var(--fs-small);
  line-height: 1.45;
}

.chart {
  min-height: 350px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 10px 12px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-title {
  fill: var(--text);
  font-family: var(--font-heading);
  font-size: var(--fs-chart-title);
  font-weight: 700;
}

.chart-grid line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-axis {
  stroke: var(--chart-axis);
  stroke-width: 1.2;
}

.chart-label {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-chart-axis-value);
  font-weight: 400;
}

.chart-axis-title {
  font-size: var(--fs-chart-axis-title);
}

.chart-series {
  fill: none;
  stroke-width: 2.1;
}

.chart-point {
  stroke-width: 1.2;
}

.chart-reference {
  stroke: var(--warn);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.chart-reference-capacity {
  stroke: var(--brand);
}

body[data-calculator-id="mas-mrd"] .chart-reference.chart-reference-mrd1 {
  stroke: var(--chart-series-primary);
}

body[data-calculator-id="mas-mrd"] .chart-reference.chart-reference-mrd2 {
  stroke: var(--chart-series-secondary);
}

body[data-calculator-id="mas-mrd"] .chart-reference.chart-reference-med1 {
  stroke: var(--chart-reference-med);
}

body[data-calculator-id="mas-mrd"] .chart-reference.chart-reference-med2 {
  stroke: var(--chart-series-accent);
}

body[data-calculator-id="mas-mrd"] .chart-reference.chart-reference-alpha1 {
  stroke: var(--chart-series-primary);
}

body[data-calculator-id="mas-mrd"] .detail-chart-text-heading,
body[data-calculator-id="mas-mrd"] .detail-chart-text-heading h3 {
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .detail-chart-text-heading p {
  color: var(--chart-series-primary);
}

body[data-calculator-id="mas-mrd"] .chart-title,
body[data-calculator-id="mas-mrd"] .chart-label,
body[data-calculator-id="mas-mrd"] .chart-axis-title,
body[data-calculator-id="mas-mrd"] .chart-reference-label,
body[data-calculator-id="mas-mrd"] .chart-reference-alpha1-label,
body[data-calculator-id="mas-mrd"] .chart-legend-title,
body[data-calculator-id="mas-mrd"] .chart-legend-label,
body[data-calculator-id="mas-mrd"] .chart-utilization-label {
  fill: var(--text);
}

.chart-reference-x {
  stroke: var(--brand-dark);
  stroke-width: 1.25;
  stroke-dasharray: 5 5;
}

body[data-calculator-id="mas-mrd"] .chart-reference-x.chart-reference-table-limit {
  stroke: var(--text);
  stroke-width: 1.3;
  stroke-dasharray: 6 6;
  opacity: 0.9;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-bands,
body[data-calculator-id="mas-mrd"] .chart-utilization-labels {
  pointer-events: none;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-fill {
  opacity: 0.11;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-stripes {
  opacity: 0.55;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-bracket {
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: 0.9;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-pass .chart-utilization-fill {
  fill: var(--status-good-base);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-fail .chart-utilization-fill {
  fill: var(--status-danger-base);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-pass .chart-utilization-stripes {
  fill: url(#chart-utilization-pass-pattern);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-pass .chart-utilization-bracket {
  stroke: var(--good);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-fail .chart-utilization-stripes {
  fill: url(#chart-utilization-fail-pattern);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-band.is-fail .chart-utilization-bracket {
  stroke: var(--danger);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-pattern-line {
  stroke-width: 2;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-pattern-line.is-pass {
  stroke: var(--good);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-pattern-line.is-fail {
  stroke: var(--danger);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label {
  font-family: var(--font-body);
  font-size: var(--fs-chart-reference);
  font-weight: 700;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label.is-pass {
  fill: var(--good);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label.is-fail {
  fill: var(--danger);
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label-bg {
  fill: var(--surface-plain);
  stroke: transparent;
  stroke-width: 0;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label-frame.is-pass .chart-utilization-label-bg {
  stroke: transparent;
}

body[data-calculator-id="mas-mrd"] .chart-utilization-label-frame.is-fail .chart-utilization-label-bg {
  stroke: transparent;
}

.chart-reference-label {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-chart-reference);
  font-weight: 400;
}

.chart-legend-line {
  stroke-width: 2.4;
}

.chart-legend-title {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-chart-legend);
  font-weight: 400;
}

.chart-legend-label {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-chart-legend);
  font-weight: 400;
}

.app-footer {
  margin-top: 28px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-size: var(--fs-small);
  line-height:  1.5;
  font-weight: 400;
  text-align: center;
}

.app-footer-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: inherit;
}

.results-table-note-centered {
  max-width: 112ch;
  margin: 0 auto;
  text-align: center;
}

.results-table-section:first-child .results-section-head {
  justify-content: flex-start;
  align-items: start;
}

.results-table-section:nth-child(n + 2) .results-section-head {
  justify-content: flex-start;
}

.result-hero {
  width: 100%;
  max-width: none;
  justify-self: stretch;
}

.result-families {
  width: 100%;
  min-width: 0;
}

.result-families .family-cards {
  gap: 12px;
}

.result-families .family-card {
  min-width: 0;
}

.results-summary-card .result-hero {
  width: 100%;
}

.results-summary-card .result-hero .hero-card {
  flex: 0 0 auto;
  width: min(100%, 300px);
  margin-inline: auto;
  min-height: var(--summary-result-card-min-height);
}

.results-summary-card .result-hero .hero-card.empty-state {
  white-space: nowrap;
}

.results-summary-card .result-families {
  width: 100%;
}

.results-summary-card .result-families .family-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  align-items: start;
  gap: 12px;
}

.results-summary-card .result-families .family-card {
  min-height: var(--summary-result-card-min-height);
  padding: 14px 10px;
}

@media (min-width: 900px) {
  body[data-calculator-id="mas-mrd"] .results-summary-card .result-hero #main-result-card {
    margin-top: 30px;
  }
}

.contact-copy {
  max-width: none;
}

.panel-contact .how-grid,
.panel-revisions .theory-grid {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
}

.panel-contact .theory-card-wide,
.panel-revisions .theory-card-wide {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  box-sizing: border-box;
}

.panel-contact .card-head,
.panel-revisions .card-head,
.panel-revisions .theory-table-wrap {
  width: max-content;
  max-width: 100%;
}

.contact-intro-line {
  display: inline-block;
}

.contact-link {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

.contact-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.panel-results .results-table-section {
  overflow: visible;
}

.panel-results .results-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--space-grid);
  min-width: 0;
}

.panel-results .results-table-grid > .table-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  align-items: stretch;
}

.panel-results .results-table-grid > .table-card .card-head {
  width: 100%;
  text-align: center;
}

.panel-results .results-table-grid > .table-card .card-head h2 {
  text-align: center;
  margin-bottom: 0;
}

.panel-results .results-table-grid .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  align-self: stretch;
  justify-self: stretch;
}

.panel-results .results-table-grid .results-table {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.panel-results .results-table-grid .results-table-note {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center;
}

body[data-calculator-id="mas-mrd"] .panel-results .results-table-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-calculator-id="mas-mrd"] .panel-results .results-table-grid .results-table-note {
  color: var(--text);
  font-size: calc(var(--fs-small) * 1.25);
  font-weight: 400;
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .panel-results .results-table-grid .results-table {
  width: max-content;
  min-width: 0;
  margin-inline: auto;
}

body[data-calculator-id="mas-mrd"] .panel-results .results-table-grid > .table-card {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}

body[data-calculator-id="mas-mrd"] .panel-results .geometry-results-table th,
body[data-calculator-id="mas-mrd"] .panel-results .geometry-results-table td {
  padding: 9px 12px;
  font-size: calc(var(--fs-small) * 1.25);
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .panel-results .geometry-results-table-wrap {
  width: 820px;
  max-width: 100%;
  margin-inline: auto;
}

body[data-calculator-id="mas-mrd"] .panel-results .geometry-results-table-wrap .geometry-results-table {
  width: 100%;
}

body[data-calculator-id="mas-mrd"] .panel-results .geometry-results-table .table-head-stack {
  gap: 2px;
  line-height: 1.05;
}

body[data-calculator-id="mas-mrd"] .panel-results .results-delta-note {
  display: inline-block;
  margin-top: 4px;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  display: grid;
  margin: 0 auto;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-panel {
  width: max-content;
  max-width: 100%;
  display: grid;
  gap: 10px;
  margin-inline: auto;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-subtle);
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter[hidden] {
  display: none;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-head p {
  margin: 0;
  color: var(--brand-dark);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.2;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-actions button,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-option {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-plain);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-actions button {
  padding: 0 12px;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-plain);
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-group h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-group-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, max-content));
  gap: 7px;
  justify-content: start;
}

body[data-calculator-id="mas-mrd"] .results-variant-filter-options {
  grid-template-columns: repeat(3, minmax(128px, max-content));
}

body[data-calculator-id="mas-mrd"] .results-variant-filter-option {
  padding: 0 14px;
  white-space: nowrap;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-option {
  position: relative;
  padding: 0 10px;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 12;
  width: 332px;
  height: 319px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-plain);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-preview img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-option:hover .results-scheme-filter-preview,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-option:focus-visible .results-scheme-filter-preview {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-actions button:hover,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-actions button:focus-visible,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-option:hover,
body[data-calculator-id="mas-mrd"] .results-scheme-filter-option:focus-visible {
  border-color: var(--brand);
  outline: none;
}

body[data-calculator-id="mas-mrd"] .results-scheme-filter-option.is-selected {
  border-color: var(--brand);
  background: var(--surface-selected);
  box-shadow: var(--focus-ring);
}

@media (max-width: 1180px) {
  .panel-results .results-table-grid {
    grid-template-columns: 1fr;
  }
}

/* Wspólny styl zakładek kalkulatora. */
.panel-grid,
.panel-grid-results,
.results-overview-grid,
.results-table-sections,
.results-table-grid,
.detail-top-stack,
.theory-grid,
.how-grid,
.config-choice-stack,
.scheme-list,
.input-grid {
  gap: var(--space-grid);
}

.card,
.theory-card,
.table-card,
.empty-state-action-card {
  padding: var(--space-card-y) var(--space-card-x);
}

.card-head,
.preview-card .card-head,
.table-card .card-head {
  max-width: none;
}

.card-head h2,
.results-section-head h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.2;
}

.card-head p,
.how-step p,
.theory-section p,
.contact-copy,
.detail-summary-note,
#best-profile-description,
.result-families .card-head p {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.7;
}

/* Szablon justowania: krótkie teksty zostają do lewej, długie bloki dostają klasę poniżej. */
.text-justify-long,
.card-head .input-warning,
.input-warning,
.model-warning {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

.card-head .input-warning,
.input-warning,
.model-warning {
  padding: 0;
  border-top: 0;
  color: var(--danger);
}

.card-head .input-warning strong,
.input-warning strong,
.model-warning strong {
  color: var(--danger);
}

.scheme-card,
.scheme-visual,
.general-form-column,
.preview-card,
.hero-card,
.family-card,
.detail-summary,
.detail-empty-state,
.detail-metrics-table-wrap,
.detail-calculation-step,
.chart,
.table-wrap,
.theory-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.general-form-column,
.hero-card,
.chart,
.detail-calculation-step {
  background: var(--surface-plain);
}

.field input,
.field select,
.button {
  min-height: 42px;
  border-radius: 8px;
  font-size: var(--fs-base);
}

.card-general .field input,
.card-general .field select {
  min-height: 30px;
  padding: 0 8px;
  font-size: var(--fs-small);
}

.theory-table th,
.theory-table td,
.results-table th,
.results-table td,
.detail-metrics-table th,
.detail-metrics-table td {
  padding: var(--space-cell-y) var(--space-cell-x);
  font-size: var(--fs-base);
  line-height: 1.55;
}

.results-table th,
.results-table td {
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
}

.theory-table thead th,
.results-table thead th,
.detail-metrics-table thead th {
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 700;
}

.theory-list,
.notation-list dd,
.formula-expression,
.equation-text,
.field-note,
.empty-state {
  font-size: var(--fs-base);
  line-height: 1.7;
}

.section-label,
.field span,
.scheme-meta,
.formula-value-box span,
.preview-metrics dt,
.result-metrics dt,
.family-metrics dt,
.detail-calculation-step-symbol,
.detail-calculation-line > span,
.detail-calculation-result > span,
.detail-calculation-note,
.results-table-note {
  font-size: var(--fs-small);
  line-height: 1.55;
}

.section-label,
.field span,
.scheme-meta,
.formula-value-box span,
.results-table-note,
.detail-calculation-step-symbol,
.detail-calculation-line > span,
.detail-calculation-result > span,
.detail-calculation-note {
  color: var(--text);
}

@media (max-width: 1220px) {
  .panel-grid,
  .results-overview-grid,
  .results-summary-grid,
  .general-layout,
  .panel-grid-results,
  .detail-charts-grid {
    grid-template-columns: 1fr;
  }

  .detail-metric-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .panel-config .panel-grid {
    grid-template-columns: 1fr;
  }

  .results-summary-card {
    width: 100%;
  }

  .results-summary-card .result-hero,
  .results-summary-card .result-families {
    width: 100%;
  }

  .panel-config .config-choice-stack,
  .panel-config .card-general {
    grid-column: auto;
  }

  .mode-copy p {
    white-space: normal;
  }

}

@media (max-width: 1080px) {

  .card,
  .theory-card {
    padding: 22px;
  }

  .scheme-card {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .scheme-visual {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

}

@media (max-width: 860px) {
  .detail-result-content {
    grid-template-columns: 1fr;
  }

  .detail-result-content .detail-summary,
  .detail-result-content .detail-summary.detail-result-layout {
    height: auto;
    min-height: 0;
  }

  .detail-inline-chart-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .detail-chart-range {
    grid-column: 1;
    grid-row: 2;
    min-height: 350px;
  }

  .chart.detail-inline-chart {
    grid-column: 1;
    grid-row: 2;
    height: 350px;
    min-height: 350px;
  }

  .detail-chart-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .detail-chart-toolbar-controls {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .detail-chart-picker {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .detail-chart-axis-pill {
    gap: 4px;
    padding: 3px 4px 3px 6px;
  }

  .detail-chart-axis-pill span {
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-chart-range-input {
    flex-basis: 34px;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
  }

  .text-justify-long,
  .card-head .input-warning,
  .input-warning,
  .model-warning {
    text-align: left;
    hyphens: manual;
  }

  .theory-nowrap-line {
    white-space: normal;
  }

  .how-nowrap-line {
    white-space: normal;
  }

  .results-section-head {
    align-items: start;
  }

  .results-section-head .results-table-note {
    max-width: none;
  }

  .how-step {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .equation-notes,
  .family-cards {
    grid-template-columns: 1fr;
  }

  .notation-list {
    display: grid;
    width: 100%;
  }

  .notation-list div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notation-list dt {
    display: block;
    padding-bottom: 0;
    padding-right: 0;
    border-bottom: 0;
    white-space: normal;
  }

  .notation-list dd {
    display: block;
    width: auto;
    padding-top: 4px;
    border-bottom: 0;
  }

  .notation-list.how-notation-list dd {
    white-space: normal;
  }

  .notation-list div:not(:last-child) dt {
    border-bottom: 0;
  }

  .notation-list div:not(:last-child) dd {
    border-bottom: 1px solid var(--line-soft);
  }

  .theory-scheme-cell {
    grid-template-columns: 1fr;
  }

  .theory-inline-copy {
    white-space: normal;
  }

  .theory-table.theory-table-fit {
    width: 100%;
    min-width: 860px;
  }
}

@media (max-width: 760px) {
  .results-summary-card .result-hero,
  .results-summary-card .result-families,
  .summary-input-data {
    width: 100%;
  }

  .results-summary-card .result-families .family-cards {
    grid-template-columns: 1fr;
  }

  .panel-results .results-table-grid {
    grid-template-columns: 1fr;
  }

  body {
    font-size: var(--fs-base);
  }

  .input-grid-general {
    max-width: none;
  }

  .detail-metric-grid {
    grid-template-columns: 1fr;
  }
}

.mode-list {
  display: grid;
  gap: var(--space-row);
  margin-bottom: 0;
}

.mode-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space-row);
  align-items: start;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mode-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.mode-card-static,
.mode-list .mode-card:not(:has(input)) {
  grid-template-columns: minmax(0, 1fr);
  cursor: default;
}

.mode-card-static:hover,
.mode-list .mode-card:not(:has(input)):hover {
  transform: none;
}

.mode-card.is-selected {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  background: var(--surface-selected);
}

.mode-card input {
  margin-top: 3px;
}

.mode-copy {
  min-width: 0;
}

.mode-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: var(--fs-choice);
  line-height: 1.4;
}

.mode-copy p,
.mode-copy > span {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
  overflow-wrap: break-word;
  white-space: normal;
}

.field.is-hidden {
  display: none;
}

.formula-card-stack {
  padding: 0;
  border: 0;
  background: transparent;
}

.formula-grid {
  display: grid;
  gap: 12px;
}

.formula-result {
  color: var(--brand-dark);
  font-size: var(--fs-heading);
  line-height: 1.2;
}

.formula-value-box-soft {
  background: var(--surface-table-head);
}

.preview-head,
.hero-card-head,
.detail-summary-head,
.family-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-row);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.is-pass {
  border-color: var(--status-good-line);
  background: var(--status-good-bg);
  color: var(--good);
}

.status-pill.is-fail {
  border-color: var(--danger-line);
  background: var(--status-danger-bg);
  color: var(--danger);
}

.hero-card-inner {
  display: grid;
  gap: var(--space-row);
}

.family-card-head .section-label {
  margin-bottom: 0;
}

.profile-name-action {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--good);
  font: inherit;
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
}

.profile-name-action:hover,
.profile-name-action:focus {
  color: var(--good);
  text-decoration: none;
}

.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link:hover,
.table-link:focus {
  color: var(--link-hover);
  text-decoration: none;
}

.detail-summary-note {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.65;
}

.scheme-card p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
}

.preview-result.empty-state,
.hero-card.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--text);
  text-align: center;
}

.preview-result.empty-state.empty-sgu-state,
.hero-card.empty-state.empty-sgu-state,
.empty-state.empty-sgu-state,
.detail-empty-state.empty-sgu-state,
.family-empty-message.empty-sgu-state {
  color: var(--danger);
}

.panel-results .results-table tbody td,
.panel-results .results-table .table-link {
  color: var(--text);
}

.panel-results .results-table th,
.panel-results .results-table td {
  padding: 7px 8px;
  font-size: var(--fs-small);
  line-height: 1.3;
}

.panel-results .results-table .table-head-stack {
  gap: 1px;
  line-height: 1.1;
}

.panel-results .results-table tbody td.results-utilization-cell.is-pass {
  color: var(--good);
}

.panel-results .results-table tbody td.results-utilization-cell.is-fail {
  color: var(--danger);
}

.panel-results .results-table tbody td.results-delta-cell.is-pass {
  color: var(--good);
}

.panel-results .results-table tbody td.results-delta-cell.is-fail {
  color: var(--danger);
}

.panel-results .results-table tbody td.results-mass-ratio-cell.is-reference {
  color: var(--good);
  background: transparent;
  font-weight: inherit;
}

.panel-results .results-table tbody td.results-mass-ratio-cell.is-heavy {
  color: var(--danger);
  background: transparent;
  font-weight: inherit;
}

.panel-results .results-table tbody td.empty-sgu-table-cell {
  color: var(--danger);
}

/* Doprecyzowanie wspólnego stylu dla elementów z końca arkusza. */
.mode-card,
.scheme-card,
.scheme-visual,
.general-form-column,
.preview-card,
.hero-card,
.family-card,
.detail-summary,
.detail-empty-state,
.detail-metrics-table-wrap,
.detail-calculation-step,
.chart,
.table-wrap,
.theory-table-wrap {
  border-radius: var(--radius);
}

.mode-card,
.scheme-card,
.scheme-visual,
.general-form-column,
.hero-card,
.detail-calculation-step {
  background: var(--surface-plain);
}

.mode-card.is-selected,
.scheme-card.is-selected {
  background: var(--surface-selected);
}

.mode-copy p,
.scheme-card p,
.detail-summary-note {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.7;
}

.formula-grid,
.hero-card-inner {
  gap: var(--space-row);
}

.card.card-general {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 22px;
  padding-left: 22px;
}

.card-general .input-warning {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  overflow-wrap: normal;
}

@media (min-width: 1221px) {
}

.access-card {
  width: min(100%, 1360px);
  max-width: 1360px;
  margin: 0 auto;
}

.access-card-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 36px;
  align-items: start;
}

.access-panel {
  min-width: 0;
}





.access-form {
  display: grid;
  gap: 18px;
  max-width: 520px;
  margin-top: 26px;
}

.access-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
}











.access-submit {
  width: fit-content;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--brand-action);
  border-radius: 12px;
  background: var(--brand-action);
  color: var(--text-inverse);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}



.access-notice,
.access-response,
.access-dev-link {
  margin-top: 18px;
  color: var(--text);
}

.access-response {
  white-space: pre-line;
}

.access-dev-link a {
  color: var(--link);
  font-weight: 700;
}

.access-dev-link a:hover,
.access-dev-link a:focus-visible {
  color: var(--link-hover);
}

@media (max-width: 1220px) {
  .access-card-split {
    grid-template-columns: 1fr;
  }

  .card.card-general {
    width: 100%;
  }

  .card-general .input-warning {
    max-width: none;
  }

  .preview-card {
    width: 100%;
  }

  .mode-copy p {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .detail-calculation-step-head,
  .detail-calculation-line,
  .detail-calculation-result {
    grid-template-columns: 1fr;
  }

  .detail-calculation-step-head {
    display: grid;
  }

  .detail-calculation-step-symbol {
    white-space: normal;
  }
}

@media (max-width: 1220px) {
}

/* Pakiet kalkulatorow: tabela schematow dopasowana do zawartosci. */
.panel-theory .theory-card-schemes .theory-table-wrap.theory-table-wrap-fit {
  width: max-content;
  max-width: 100%;
  justify-self: start;
  overflow-x: auto;
}

.panel-theory .theory-card-schemes .theory-table.theory-table-fit {
  width: max-content;
  min-width: 0;
  max-width: none;
  table-layout: auto;
}

.panel-theory .theory-card-schemes .theory-table.theory-table-fit th,
.panel-theory .theory-card-schemes .theory-table.theory-table-fit td {
  width: auto;
  overflow-wrap: normal;
  vertical-align: middle;
}

.panel-theory .theory-card-schemes .theory-table.theory-table-fit th:first-child,
.panel-theory .theory-card-schemes .theory-table.theory-table-fit td:first-child {
  width: 1%;
  min-width: 54px;
  white-space: nowrap;
  text-align: center;
}

/* Pakiet kalkulatorow: karta schematu rowna wysokosci danych ogolnych. */
@media (min-width: 1221px) {
}

.detail-result-content {
  --detail-summary-fixed-height: 720px;
}

.detail-summary-bottom-warning {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  align-self: stretch;
}

.detail-summary-bottom-warning:empty {
  display: none;
}

.detail-summary-bottom-warning .input-warning {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.result-families .card-head {
  order: 1;
}

.result-families .family-cards {
  order: 2;
}

.result-families > .detail-result-warning {
  order: 3;
  align-self: stretch;
}

@media (min-width: 861px) {
  body[data-calculator-id="mas-mrd"] .panel-details .detail-result-content > #checked-profile-card.detail-summary.detail-result-layout {
    height: auto;
    min-height: var(--detail-summary-fixed-height, 720px);
  }

  body[data-calculator-id="mas-mrd"] .panel-details .detail-result-content > #detail-chart-panel.detail-inline-chart-panel {
    height: var(--detail-chart-panel-height, var(--detail-summary-fixed-height, 720px));
    min-height: var(--detail-chart-panel-height, var(--detail-summary-fixed-height, 720px));
  }
}




/* MJKM-CALC-MAS-MRD-0: układ schematów EC6 i formularza ściany murowanej. */
body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker {
  width: 100%;
  max-width: none;
  justify-self: center;
  margin-inline: auto;
}

body[data-calculator-id="mas-mrd"] .scheme-picker {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

body[data-calculator-id="mas-mrd"] .scheme-select {
  position: relative;
  display: grid;
  min-width: 0;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select {
  width: 100%;
  justify-self: stretch;
}

body[data-calculator-id="mas-mrd"] .scheme-select-toggle,
body[data-calculator-id="mas-mrd"] .scheme-select-option {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

body[data-calculator-id="mas-mrd"] .scheme-select-toggle {
  position: relative;
  padding-right: 30px;
}

body[data-calculator-id="mas-mrd"] .scheme-select-chevron {
  position: absolute;
  top: 13px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
  pointer-events: none;
}

body[data-calculator-id="mas-mrd"] .scheme-select.is-open .scheme-select-chevron {
  transform: rotate(225deg);
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  gap: 7px;
  min-height: 0;
  padding: 8px;
  text-align: center;
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card .scheme-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  order: 2;
  min-width: 0;
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card .scheme-copy strong {
  white-space: normal;
  font-size: var(--fs-small);
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card .scheme-copy > p {
  display: none;
}

body[data-calculator-id="mas-mrd"] .scheme-edge-description {
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin-top: 2px;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .scheme-edge-description p {
  display: block;
  margin: 0;
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .scheme-edge-table {
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 100%;
}

body[data-calculator-id="mas-mrd"] .scheme-edge-row {
  display: grid;
  grid-template-columns: 72px minmax(128px, 1fr);
  column-gap: 8px;
  align-items: baseline;
}

body[data-calculator-id="mas-mrd"] .scheme-edge-name {
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .scheme-edge-value {
  align-self: baseline;
  justify-self: start;
  text-align: left;
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card .scheme-visual {
  order: 1;
  justify-self: stretch;
  width: 100%;
  min-height: 46px;
  margin-left: 0;
  padding: 3px;
  border-radius: 8px;
}

body[data-calculator-id="mas-mrd"] .calculator-scheme-card .scheme-visual img {
  width: auto;
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
}

body[data-calculator-id="mas-mrd"] .scheme-select-menu {
  position: fixed;
  z-index: 160;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: 16px 24px 32px;
  background: var(--overlay);
}

body[data-calculator-id="mas-mrd"] .scheme-select-menu[hidden] {
  display: none;
}

body[data-calculator-id="mas-mrd"] .scheme-select-menu-panel {
  display: grid;
  gap: 14px;
  width: fit-content;
  max-width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: var(--space-subcard-y) var(--space-subcard-x);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-plain);
  box-shadow: var(--shadow);
}

body[data-calculator-id="mas-mrd"] .scheme-select-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: var(--fs-heading);
}

body[data-calculator-id="mas-mrd"] .scheme-select-menu-head button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-plain);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-heading);
  line-height: 1;
  cursor: pointer;
}

body[data-calculator-id="mas-mrd"] .scheme-select-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body[data-calculator-id="mas-mrd"] .scheme-select-filter-option {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

body[data-calculator-id="mas-mrd"] .scheme-select-filter-option:hover,
body[data-calculator-id="mas-mrd"] .scheme-select-filter-option:focus-visible {
  border-color: var(--accent);
}

body[data-calculator-id="mas-mrd"] .scheme-select-filter-option.is-active {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

body[data-calculator-id="mas-mrd"] .scheme-select-option-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

body[data-calculator-id="mas-mrd"] .scheme-select-group {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

body[data-calculator-id="mas-mrd"] .scheme-select-group h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.3;
}

body[data-calculator-id="mas-mrd"] .scheme-select-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  min-width: 0;
}

body[data-calculator-id="mas-mrd"] .scheme-select-group-column {
  display: grid;
  align-self: start;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card {
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 10px;
  align-items: center;
  justify-items: start;
  min-height: 358px;
  padding: 14px 12px;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-copy strong {
  font-size: var(--fs-base);
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-copy p {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.45;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-edge-description,
body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-edge-description p,
body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-edge-row {
  font-size: calc(var(--fs-small) * 0.95);
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-copy {
  order: 1;
  justify-items: start;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-visual {
  order: 2;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-edge-row {
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 7px;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card {
  min-height: 380px;
  padding: 13px 44px 13px 13px;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-copy strong {
  font-size: var(--fs-base);
  line-height: 1.25;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-copy p {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.35;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-edge-description,
body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-edge-description p,
body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-edge-row {
  font-size: var(--fs-small);
  line-height: 1.35;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-visual,
body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-visual {
  position: relative;
  justify-self: center;
  width: 145px;
  min-height: 139px;
  height: 139px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-visual {
  width: 338px;
  min-height: 325px;
  height: 325px;
  padding: 12px !important;
}

body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-visual {
  width: min(100%, 470px);
  min-height: 452px;
  height: 452px;
  padding: 12px !important;
}

body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-visual img,
body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-visual img {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .theory-figure {
  margin: 0;
}

body[data-calculator-id="mas-mrd"] .theory-main-image {
  display: block;
  width: min(100%, 980px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .panel-theory,
body[data-calculator-id="mas-mrd"] .panel-theory h2,
body[data-calculator-id="mas-mrd"] .panel-theory h3,
body[data-calculator-id="mas-mrd"] .panel-theory p,
body[data-calculator-id="mas-mrd"] .panel-theory li,
body[data-calculator-id="mas-mrd"] .panel-theory th,
body[data-calculator-id="mas-mrd"] .panel-theory td,
body[data-calculator-id="mas-mrd"] .panel-theory strong,
body[data-calculator-id="mas-mrd"] .panel-theory dt,
body[data-calculator-id="mas-mrd"] .panel-theory dd,
body[data-calculator-id="mas-mrd"] .panel-theory .theory-scheme-copy strong,
body[data-calculator-id="mas-mrd"] .panel-theory .theory-scheme-label,
body[data-calculator-id="mas-mrd"] .panel-theory .scheme-edge-description,
body[data-calculator-id="mas-mrd"] .panel-theory .scheme-edge-description p,
body[data-calculator-id="mas-mrd"] .panel-theory .scheme-edge-name,
body[data-calculator-id="mas-mrd"] .panel-theory .scheme-edge-value {
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .scheme-edge-description,
body[data-calculator-id="mas-mrd"] .scheme-edge-description p,
body[data-calculator-id="mas-mrd"] .scheme-edge-name,
body[data-calculator-id="mas-mrd"] .scheme-edge-value {
  color: var(--text) !important;
}

body[data-calculator-id="mas-mrd"] .theory-scheme-image {
  max-width: 460px;
  max-height: 240px;
  object-fit: contain;
}

body[data-calculator-id="mas-mrd"] .general-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  gap: 22px;
  justify-content: stretch;
}

body[data-calculator-id="mas-mrd"] .general-form-column {
  --general-label-width: 160px;
  --general-control-width: 112px;
  --masonry-material-picker-width: 560px;
  width: 100%;
  justify-self: stretch;
}

body[data-calculator-id="mas-mrd"] .input-grid-general {
  width: 100%;
  max-width: min(100%, var(--masonry-material-picker-width));
}

body[data-calculator-id="mas-mrd"] .preview-card {
  min-width: 0;
  width: 100%;
  min-height: 0;
  justify-self: stretch;
  grid-template-rows: auto 1fr auto;
}

body[data-calculator-id="mas-mrd"] .preview-card .preview-result {
  min-height: 0;
}

body[data-calculator-id="mas-mrd"] .preview-scheme-diagram {
  display: grid;
  place-items: center;
  width: 100%;
  margin: 14px 0 0;
  padding-top: 0;
}

body[data-calculator-id="mas-mrd"] .preview-scheme-caption {
  margin: 0 0 8px;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

body[data-calculator-id="mas-mrd"] .preview-material-label {
  width: min(100%, 360px);
  margin: 18px auto 8px;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

body[data-calculator-id="mas-mrd"] .preview-material-label sub {
  font-size: 0.72em;
}

body[data-calculator-id="mas-mrd"] .preview-scheme-crop {
  position: relative;
  width: min(100%, 267px);
  height: 256px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .preview-scheme-crop img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
  background: var(--mjkm-light-0);
}

body[data-calculator-id="mas-mrd"] .theory-card-schemes .theory-scheme-graphic {
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-calculator-id="mas-mrd"] .theory-card-schemes .theory-scheme-graphic .preview-scheme-crop {
  width: 314px;
  height: 301px;
}

body[data-calculator-id="mas-mrd"] .theory-card-schemes .theory-scheme-graphic .preview-scheme-crop img {
  padding: 5px;
}

body[data-calculator-id="mas-mrd"] .preview-card .input-warning {
  width: min(100%, 380px);
  margin: 18px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  line-height: 1.45;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .panel-config .general-form-column {
  --general-label-width: 160px;
  --general-control-width: 112px;
  justify-items: center;
  text-align: center;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .field {
  gap: 6px;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .field > input,
body[data-calculator-id="mas-mrd"] .panel-config .card-general .field > select,
body[data-calculator-id="mas-mrd"] .panel-config .card-general .number-stepper {
  width: min(100%, var(--general-control-width));
  min-height: 30px;
}

body[data-calculator-id="mas-mrd"] .panel-config .masonry-material-picker-field {
  --profile-picker-dynamic-width: min(100%, var(--masonry-material-picker-width, 450px));
  justify-self: center;
  max-width: 100%;
  width: min(100%, var(--masonry-material-picker-width, 450px));
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field .masonry-material-picker {
  width: 100%;
  max-width: 100%;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field .masonry-material-picker-toggle {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  column-gap: 4px;
  width: 100%;
  min-height: var(--masonry-material-picker-min-height, 48px);
  height: auto;
  padding: 10px 10px 10px 16px;
  text-align: left;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field #masonry-material-picker-value {
  font-weight: 400;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field #masonry-material-picker-value.is-custom-material {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field #masonry-material-picker-value sub {
  font-size: 0.72em;
  line-height: 0;
}

body[data-calculator-id="mas-mrd"] .panel-config .card-general .masonry-material-picker-field .profile-picker-chevron {
  justify-self: center;
  flex: 0 0 auto;
}

body[data-calculator-id="mas-mrd"] .panel-config .number-stepper.is-readonly {
  opacity: 0.78;
}

body[data-calculator-id="mas-mrd"] .panel-config .number-stepper input[readonly] {
  cursor: default;
}

body[data-calculator-id="mas-mrd"] .panel-config .number-stepper .number-stepper-button {
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  padding: 0;
  background: var(--surface-plain);
  color: var(--text);
}

body[data-calculator-id="mas-mrd"] .panel-config .number-stepper .number-stepper-button:hover {
  background: var(--surface-accent);
}

body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content span {
  color: var(--danger);
}

body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content.is-empty,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content.is-empty p,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content.is-empty span {
  color: var(--text);
}

/* Informacja o grubości muru nie jest błędem obliczeń. */
body[data-calculator-id="mas-mrd"] .warning-line.warning-information,
body[data-calculator-id="mas-mrd"] .input-warning.warning-information,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content .warning-information,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p.warning-information,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p.warning-information strong,
body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p.warning-information sub {
  color: var(--text) !important;
}

body[data-calculator-id="mas-mrd"] [data-core-access-gate] [data-access-message][data-state="error"],
body[data-calculator-id="mas-mrd"] [data-core-access-gate] [data-code-message][data-state="error"] {
  color: var(--danger);
}

body[data-calculator-id="mas-mrd"] [data-core-access-gate] [data-access-message][data-state="ok"],
body[data-calculator-id="mas-mrd"] [data-core-access-gate] [data-code-message][data-state="ok"] {
  color: var(--good);
}

body[data-calculator-id="mas-mrd"] .panel-results .results-table .table-link:hover,
body[data-calculator-id="mas-mrd"] .panel-results .results-table .table-link:focus-visible {
  color: var(--link-hover);
}

body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p {
  margin: 0;
}

body[data-calculator-id="mas-mrd"] .detail-calculation-warning-content p + p {
  margin-top: 8px;
}

body[data-calculator-id="mas-mrd"] .detail-chart-toolbar,
body[data-calculator-id="mas-mrd"] .detail-chart-toolbar-controls {
  min-height: 30px;
  align-items: center;
}

body[data-calculator-id="mas-mrd"] .detail-inline-chart-panel.has-bottom-chart-legend {
  --detail-chart-fixed-height: var(--detail-chart-bottom-legend-fixed-height, 600px);
  --detail-chart-mobile-height: var(--detail-chart-bottom-legend-mobile-height, 420px);
  --chart-control-x-min-bottom: 72px;
  --chart-control-x-max-bottom: 72px;
  --chart-control-y-min-left: 48px;
  --chart-control-y-min-top: calc(76.7% - 16px);
  --chart-control-y-max-left: 48px;
  --chart-control-y-max-top: calc(9.7% + 16px);
  --chart-control-auto-left: 48px;
  --chart-control-auto-bottom: 58px;
}

body[data-calculator-id="mas-mrd"] .detail-inline-chart-panel.has-bottom-chart-legend .detail-chart-axis-pill {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
}

body[data-calculator-id="mas-mrd"] .detail-inline-chart-panel.has-bottom-chart-legend .detail-chart-range-input {
  flex: 0 0 30px;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  min-height: 18px;
  padding-right: 2px;
  padding-left: 2px;
}

body[data-calculator-id="mas-mrd"] .detail-inline-chart-panel.has-bottom-chart-legend .detail-chart-range-reset {
  min-height: 24px;
  padding: 1px 8px;
}

@media (max-width: 900px) {
  body[data-calculator-id="mas-mrd"] .general-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body[data-calculator-id="mas-mrd"] .scheme-select-option-grid {
    grid-template-columns: 1fr;
  }

  body[data-calculator-id="mas-mrd"] .scheme-select-group-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-copy {
    justify-self: start;
  }

  body[data-calculator-id="mas-mrd"] .scheme-select-option.calculator-scheme-card .scheme-visual {
    width: min(100%, 338px);
    min-height: 0;
    height: auto;
    aspect-ratio: 338 / 325;
  }

  body[data-calculator-id="mas-mrd"] .calculator-config-scheme-picker .scheme-select-toggle.calculator-scheme-card .scheme-visual {
    min-height: 0;
    height: auto;
    aspect-ratio: 470 / 452;
  }
}

@media (max-width: 860px) {
  body[data-calculator-id="mas-mrd"] .detail-inline-chart-panel.has-bottom-chart-legend {
    --chart-control-x-min-bottom: 72px;
    --chart-control-x-max-bottom: 72px;
    --chart-control-auto-bottom: 86px;
  }

  body[data-calculator-id="mas-mrd"] .detail-chart-range-reset {
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 1221px) {
  body[data-calculator-id="mas-mrd"] .panel-config .panel-grid {
    align-items: stretch;
    grid-template-rows: auto;
  }

  body[data-calculator-id="mas-mrd"] .panel-config .config-choice-stack {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: auto 1fr;
    align-self: stretch;
    height: 100%;
  }

  body[data-calculator-id="mas-mrd"] .panel-config .config-choice-stack > .card:nth-child(1) {
    grid-row: 1;
  }

  body[data-calculator-id="mas-mrd"] .panel-config .config-choice-stack > .card:nth-child(2) {
    grid-row: 2;
    height: 100%;
    min-height: 0;
  }

  body[data-calculator-id="mas-mrd"] .panel-config .card-general {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    height: 100%;
  }
}

body[data-calculator-id="mas-mrd"] #detail-chart.chart.detail-inline-chart,
body[data-calculator-id="mas-mrd"] #detail-chart.chart.detail-inline-chart.is-panning {
  cursor: default;
}
/* MAS-MRD: migracja wyłącznie układu do wspólnego wzorca MJKM. */
body[data-layout="results-below-input"] .app-shell.mjkm-layout-frame { margin-top: 0; }
.mas-mrd-layout-ribbon-main, .mas-mrd-layout-ribbon-actions { display: flex; align-items: center; gap: 20px; min-width: 0; }
.mas-mrd-layout-ribbon-actions { gap: 12px; }
.mas-mrd-layout-brand, .mas-mrd-layout-hub {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px;
  color: var(--text); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.mas-mrd-layout-hub { color: var(--muted); font-weight: 600; }
.mas-mrd-layout-brand:hover, .mas-mrd-layout-hub:hover, .mas-mrd-layout-brand:focus-visible, .mas-mrd-layout-hub:focus-visible {
  border-color: var(--line); background: var(--panel-soft); color: var(--text); text-decoration: none;
}
.mas-mrd-layout-brand:focus-visible, .mas-mrd-layout-hub:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mas-mrd-layout-brand-mark, .mas-mrd-layout-brand-mark img { display: block; width: 28px; height: 28px; flex: 0 0 28px; }
.mas-mrd-layout-brand-name { display: inline-flex; align-items: baseline; gap: 4px; }
.mas-mrd-layout-brand-name strong { font-weight: 800; }
.mas-mrd-layout-brand-name > span { color: var(--muted); font-weight: 400; }
.mas-mrd-layout-cube-dark, html[data-theme="dark"] .mas-mrd-layout-cube-light { display: none !important; }
html[data-theme="dark"] .mas-mrd-layout-cube-dark { display: block !important; }
.mas-mrd-layout-contact {
  min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.mas-mrd-layout-contact:hover, .mas-mrd-layout-contact:focus-visible { border-color: var(--line); background: var(--panel-soft); color: var(--text); }
.mas-mrd-layout-contact:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mas-mrd-layout-theme .str-theme-toggle { box-sizing: border-box; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 4px; }
.mas-mrd-layout-theme svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mas-mrd-layout-theme-moon, html[data-theme="light"] .mas-mrd-layout-theme-sun { display: none; }
html[data-theme="light"] .mas-mrd-layout-theme-moon { display: block; }
.mas-mrd-layout-header-body {
  margin-bottom: 16px; padding: 0 24px 14px; border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-plain);
}
.mas-mrd-layout-titlebar.topbar { display: block; margin: 0; padding: 24px 0 16px; border: 0; }
.mas-mrd-layout-titlebar .brand-block > h1 { margin: 0; padding: 0; font-size: 24px; white-space: normal; }
.mas-mrd-layout-info-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.mas-mrd-layout-info-content > :is(.panel-how, .panel-theory) > :is(.how-grid, .theory-grid) > .card {
  width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.mas-mrd-layout-info-content > :is(.panel-how, .panel-theory) > :is(.how-grid, .theory-grid) > .card + .card {
  margin-top: var(--space-grid); padding-top: var(--space-grid); border-top: 1px solid var(--line);
}
.mas-mrd-layout-info-content .panel-theory .theory-grid > .card:first-child > .card-head,
.mas-mrd-layout-info-content .panel-revisions .card-head,
.mas-mrd-layout-info-content .panel-contact .card-head h2 { display: none; }
.mas-mrd-layout-info-content .panel-how .how-step { border-top: 0; }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .panel-config > .panel-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr); grid-template-rows: auto; align-items: start;
}
.mas-mrd-layout-input-group { display: grid; gap: var(--space-grid); min-width: 0; }
.mas-mrd-layout-input-group > .card-head { margin-bottom: 0; }
.mas-mrd-layout-input-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-grid); align-items: start; min-width: 0; }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .panel-config .mas-mrd-layout-input-columns > .config-choice-stack { display: grid; grid-column: auto; width: 100%; }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .panel-config .mas-mrd-layout-input-columns > .card-general { grid-column: auto; grid-row: auto; width: 100%; height: auto; }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .card-general .general-layout { grid-template-columns: minmax(0, 1fr); }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .card-general .general-form-column { width: 100%; max-width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .panel-config > .panel-grid > .preview-card {
  width: 100%; max-width: 100%; height: auto; min-height: 0; grid-template-rows: auto auto auto; align-content: start; align-self: start;
}
.mas-mrd-layout-result-controls { margin-top: var(--space-grid); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.mas-mrd-layout-result-intro { margin: 0; padding: var(--space-row) var(--space-grid); color: var(--muted); line-height: 1.4; }
body[data-layout="results-below-input"] .panel-results .results-summary-grid { grid-template-columns: minmax(0, 1fr); }
body[data-layout="results-below-input"] .mas-mrd-layout-results-card,
body[data-layout="results-below-input"] .mas-mrd-layout-details-card { width: 100%; min-width: 0; }
.mas-mrd-layout-section-head { margin-bottom: var(--space-grid); padding-bottom: 18px; border-bottom: 1px solid var(--line); }
body[data-layout="results-below-input"] .results-overview-grid { margin-bottom: 0; }
body[data-layout="results-below-input"] .panel-results .results-family-card,
body[data-layout="results-below-input"] .panel-results .results-table-grid > .table-card { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body[data-layout="results-below-input"] .panel-results .results-table-sections { margin-top: var(--space-grid); padding-top: var(--space-grid); border-top: 1px solid var(--line); }
body[data-layout="results-below-input"] .panel-results .results-table-grid { grid-template-columns: minmax(0, 1fr); min-width: 0; }
body[data-layout="results-below-input"] .panel-results .results-scheme-filter + .results-table-grid { margin-top: var(--space-grid); padding-top: var(--space-grid); border-top: 1px solid var(--line); }
body[data-layout="results-below-input"] .panel-results .results-table-grid > .table-card + .table-card { margin-top: var(--space-grid); padding-top: var(--space-grid); border-top: 1px solid var(--line); }
body[data-layout="results-below-input"] .panel-details .detail-result-content { display: block; }
body[data-layout="results-below-input"] .panel-details #checked-profile-card { height: auto; min-height: 0; }
body[data-layout="results-below-input"] .panel-details .detail-top-stack { margin-bottom: 0; }
body[data-layout="results-below-input"] .panel-chart > #detail-chart-panel { width: 100%; height: auto; min-height: 620px; grid-template-rows: auto auto auto; }
body[data-layout="results-below-input"] .panel-chart #detail-chart-heading,
body[data-layout="results-below-input"] .panel-chart #detail-chart-range,
body[data-layout="results-below-input"] .panel-chart #detail-chart { width: min(100%, 1100px); justify-self: center; }
body[data-layout="results-below-input"] .layout { overflow-anchor: none; }
@media (max-width: 1220px) {
  body[data-calculator-id="mas-mrd"][data-layout="results-below-input"] .panel-config > .panel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .mas-mrd-layout-input-columns { grid-template-columns: minmax(0, 1fr); }
  .mas-mrd-layout-header-body { padding-inline: 14px; }
  .mas-mrd-layout-ribbon-main, .mas-mrd-layout-ribbon-actions { flex-wrap: wrap; gap: 8px 12px; }
}



/* BATCH 20261004_MJKM_RESULT_CARDS_TABLES_INPUTS_01 */
body[data-calculator-id="mas-mrd"] .panel-results :is(.results-table, .selection-results-table, .result-parameter-table) tbody :is(th, td, strong) {
  font-weight: 400 !important;
}
body[data-calculator-id="mas-mrd"] .panel-config .card-general .general-form-head {
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
}
body[data-calculator-id="mas-mrd"] .panel-config .card-general .general-form-column,
body[data-calculator-id="mas-mrd"] .panel-config .card-general .field {
  justify-items: center;
  text-align: center;
}
body[data-calculator-id="mas-mrd"] .panel-config .card-general .field > :is(input, select, textarea, .number-stepper, .profile-picker) {
  margin-inline: auto;
}
