.drywall-measurement-panel,
.drywall-openings-panel,
.drywall-ordering-panel {
  max-width: none;
}

.drywall-mode-field {
  max-width: 34rem;
}

.drywall-dynamic-fields {
  margin-top: 18px;
}

.drywall-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.drywall-panel-heading h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.drywall-panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.drywall-dimension-grid,
.drywall-order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.drywall-order-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.drywall-order-grid input[type="number"],
.drywall-order-grid select,
.drywall-custom-sheet input[type="number"] {
  width: 100%;
  max-width: none;
}

.drywall-dimension-control {
  min-width: 0;
  padding: 0;
  border: 0;
}

.drywall-dimension-control legend {
  margin-bottom: 6px;
  font-weight: 720;
}

.drywall-dimension-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drywall-dimension-pair label {
  font-size: .82rem;
  font-weight: 650;
  color: var(--muted);
}

.drywall-dimension-pair input,
.drywall-metric-dimension input {
  width: 100%;
  max-width: none;
}

.drywall-room-options {
  display: grid;
  grid-template-columns: minmax(200px, 260px);
  margin-top: 16px;
}

.drywall-repeat-groups {
  display: grid;
  gap: 12px;
}

.drywall-repeat-group {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d6e0e6;
  border-radius: var(--radius-md);
  background: #fff;
}

.drywall-repeat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.drywall-repeat-header h4 {
  margin: 0;
  font-size: 1rem;
}

.drywall-remove {
  min-height: 38px;
  padding: 7px 10px;
  color: #79231f;
  border-color: #cfaaa7;
}

.drywall-builder-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
}

.drywall-builder-actions small {
  color: var(--muted);
}

.drywall-group-grid {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) repeat(2, minmax(190px, 1fr)) minmax(120px, .55fr);
  gap: 14px;
  align-items: start;
}

.drywall-group-grid .drywall-dimension-control {
  align-self: start;
}

.drywall-custom-sheet {
  grid-template-columns: repeat(2, minmax(190px, 260px));
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drywall-custom-sheet:not(.hidden) {
  display: grid;
}

.drywall-scope-note {
  max-width: 880px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #8ca2b2;
  border-radius: 0 8px 8px 0;
  background: #f5f8fa;
  color: #40525e;
}

.drywall-confirmed-summary {
  margin: 0 0 12px;
  color: var(--navy-deep);
  font-size: 1.05rem;
  font-weight: 800;
}

.drywall-layout-note {
  margin: 0;
  color: #4a5d68;
}

.drywall-comparison-result {
  margin-top: 18px;
}

.drywall-comparison-result > p {
  color: var(--muted);
}

.drywall-supporting-content {
  max-width: 880px;
  margin-top: 22px;
}

.drywall-supporting-content > section {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.drywall-supporting-content h2 {
  margin: 0 0 8px;
}

.drywall-supporting-content h3 {
  margin: 18px 0 6px;
}

.drywall-supporting-content p,
.drywall-supporting-content li {
  line-height: 1.65;
}

.drywall-supporting-content code {
  border: 1px solid #e0e6ea;
  border-radius: 5px;
  padding: 2px 5px;
  background: var(--surface-soft);
  color: var(--navy-deep);
  white-space: normal;
}

.drywall-source-list {
  padding-left: 1.25rem;
}

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

.drywall-supporting-content .table-wrap,
.drywall-comparison-result .table-wrap {
  max-width: 100%;
  overscroll-behavior-inline: contain;
}

.drywall-supporting-content table,
.drywall-comparison-result table {
  min-width: 680px;
}

.drywall-supporting-content th,
.drywall-supporting-content td {
  vertical-align: top;
}

.drywall-supporting-content caption,
.drywall-comparison-result caption {
  padding: 10px 12px;
  color: var(--navy-deep);
  background: #fff;
  text-align: left;
  font-weight: 750;
}

.drywall-supporting-content th:not(:first-child),
.drywall-supporting-content td:not(:first-child) {
  text-align: right;
}

@media (max-width: 900px) {
  .drywall-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .drywall-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .drywall-dimension-grid,
  .drywall-order-grid,
  .drywall-group-grid,
  .drywall-custom-sheet:not(.hidden) {
    grid-template-columns: 1fr;
  }

  .drywall-order-grid input[type="number"],
  .drywall-custom-sheet input[type="number"] {
    width: 100%;
  }

  .drywall-repeat-header {
    align-items: flex-start;
  }

  .drywall-supporting-content > section {
    padding: 16px;
  }
}

@media (max-width: 430px) {
  .drywall-dimension-pair {
    grid-template-columns: 1fr 1fr;
  }

  .drywall-repeat-group {
    padding: 12px;
  }
}

@media print {
  .drywall-supporting-content {
    display: none !important;
  }
}
