.material-compression-shell {
  display: grid;
  gap: 18px;
}

.material-compression-header,
.material-editor-head,
.material-table-heading,
.material-compression-actions,
.material-history-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.material-compression-header h3,
.material-editor-head h4,
.material-table-heading h4,
.material-history-block h4 {
  margin: 3px 0;
  color: #16324f;
}

.material-compression-header p,
.material-table-heading p,
.material-history-block p {
  margin: 0;
  color: #61748a;
  font-size: 13px;
}

.material-compression-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid #cbd9e7;
  border-radius: 12px;
  background: #f5f8fb;
}

.material-compression-tabs button {
  border: 0;
  border-radius: 9px;
  padding: 9px 18px;
  color: #456078;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.material-compression-tabs button.is-active {
  color: #fff;
  background: #0b5cab;
  box-shadow: 0 4px 12px rgba(11, 92, 171, 0.2);
}

.material-compression-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.material-sample-panel,
.material-compression-form {
  border: 1px solid #d6e1ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 55, 90, 0.06);
}

.material-sample-panel {
  padding: 14px;
  position: sticky;
  top: 16px;
}

.material-search-field {
  display: grid;
  gap: 6px;
  color: #52677c;
  font-size: 12px;
  font-weight: 700;
}

.material-search-field input,
.material-form-grid input,
.material-form-grid select {
  width: 100%;
  border: 1px solid #cbd9e7;
  border-radius: 8px;
  padding: 9px 10px;
  color: #1c344c;
  background: #fff;
}

.material-sample-list {
  display: grid;
  gap: 8px;
  max-height: 640px;
  margin-top: 12px;
  overflow: auto;
}

.material-sample-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  color: #52677c;
  text-align: left;
  background: #fbfdff;
  cursor: pointer;
}

.material-sample-item strong {
  color: #173a5e;
}

.material-sample-item.is-active {
  border-color: #0b5cab;
  background: #edf5fc;
  box-shadow: inset 3px 0 0 #0b5cab;
}

.material-compression-form {
  min-height: 360px;
  padding: 18px;
  container-type: inline-size;
}

.material-compression-empty {
  padding: 90px 24px;
}

.material-editor-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e8f0;
}

.material-editor-head > div:first-child span {
  color: #6d8092;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.material-version-state {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
  color: #476079;
  font-size: 12px;
}

.material-origin-badge {
  padding: 5px 9px;
  border: 1px solid #f1b665;
  border-radius: 999px;
  color: #a65400;
  background: #fff7ed;
  font-size: 11px;
  font-weight: 800;
}

.material-validation {
  margin: 12px 0;
}

.material-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.material-form-grid label {
  display: grid;
  gap: 6px;
  color: #52677c;
  font-size: 12px;
  font-weight: 700;
}

.material-form-grid input[readonly] {
  background: #f3f6f9;
}

.material-result-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin: 18px 0;
  border: 1px solid #d4e0eb;
  border-radius: 12px;
  overflow: hidden;
  background: #d4e0eb;
}

.material-result-strip > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: #f8fbfe;
}

.material-result-strip small,
.material-result-strip span {
  color: #6c7e90;
  font-size: 10px;
}

.material-result-strip strong {
  color: #0b3f70;
  font-size: 17px;
}

.material-data-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(300px, 0.9fr);
  gap: 14px;
  align-items: stretch;
}

.material-stage-table {
  min-width: 0;
  table-layout: fixed;
}

.material-stage-table th:nth-child(1) {
  width: 24%;
}

.material-stage-table th:nth-child(2) {
  width: 42%;
}

.material-stage-table th:nth-child(3) {
  width: 25%;
}

.material-stage-table th:nth-child(4) {
  width: 9%;
}

.material-stage-table input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.material-stage-table td:last-child {
  width: 40px;
}

.material-remove-stage {
  border: 0;
  color: #a53c35;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.material-compression-chart {
  min-height: 310px;
  border: 1px solid #d8e3ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  overflow: hidden;
}

.material-compression-chart svg {
  display: block;
  width: 100%;
  height: 310px;
}

.material-history-block {
  align-items: flex-start;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #f8fbfe;
}

.material-history-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.material-history-item {
  padding: 6px 9px;
  border: 1px solid #cbd9e7;
  border-radius: 8px;
  color: #496078;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.material-history-item.is-current {
  border-color: #0b5cab;
  color: #0b5cab;
  font-weight: 800;
}

.material-compression-actions {
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dce6ef;
}

.material-actions-spacer {
  flex: 1 1 auto;
}

@container (max-width: 800px) {
  .material-data-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1500px) {
  .material-data-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .material-compression-layout,
  .material-data-layout {
    grid-template-columns: 1fr;
  }

  .material-sample-panel {
    position: static;
  }

  .material-sample-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 280px;
  }
}

@media (max-width: 760px) {
  .material-compression-header,
  .material-editor-head,
  .material-table-heading,
  .material-history-block {
    align-items: stretch;
    flex-direction: column;
  }

  .material-form-grid,
  .material-result-strip,
  .material-sample-list {
    grid-template-columns: 1fr;
  }

  .material-version-state {
    align-items: flex-start;
  }
}
