.cm-heading {
  margin: 24px 0;
}
.cm-heading h1 {
  margin: 0 0 8px;
}
.cm-heading p,
.cm-muted {
  color: #737780;
}
.cm-toolbar,
.cm-filters,
.cm-order {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.cm-toolbar {
  margin: 20px 0;
}
.cm-toolbar .cm-button:hover,
.cm-link:hover {
  background: #f5f6f8;
}
.cm-primary:hover {
  background: #303236;
}
.cm-primary {
  margin-left: auto;
}
.cm-button,
.cm-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #e1e3e7;
  border-radius: 14px;
  background: #fff;
  color: #161719;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.cm-button:hover,
.cm-link:hover {
  background: #f5f6f8;
}
.cm-primary:hover {
  background: #303236;
}
.cm-primary {
  background: #151618;
  color: #fff;
  border-color: #151618;
}
.cm-button:disabled {
  opacity: 0.4;
  cursor: default;
}
.cm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.cm-card {
  min-width: 0;
  border: 1px solid #e2e4e8;
  border-radius: 22px;
  background: white;
  padding: 20px;
}
.cm-card[draggable="true"] {
  cursor: grab;
}
.cm-card-link {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}
.cm-card h2 {
  font-size: 20px;
  margin: 4px 0;
}
.cm-card p {
  margin: 0;
}
.cm-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  background: #f7f8fa;
  color: #8a8f97;
  font-size: 12px;
  overflow: hidden;
}
.cm-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cm-state {
  font-size: 13px;
  color: #656b73;
}
.cm-badge {
  background: #fff0e3;
  color: #914306;
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 9px;
}
.cm-order {
  margin-top: 16px;
}
.cm-order button {
  flex: 1;
  font-size: 13px;
}
.cm-form {
  max-width: 1040px;
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 24px;
  padding: 28px;
  margin: 20px 0 32px;
}
.cm-form h2 {
  font-size: 21px;
  margin: 30px 0 16px;
}
.cm-form label,
.cm-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #555c64;
  min-width: 0;
}
.cm-form input,
.cm-form textarea,
.cm-form select,
.cm-filters input,
.cm-filters select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dadee5;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: #17181a;
  background: #fff;
  min-width: 0;
}
.cm-form textarea {
  min-height: 100px;
  resize: vertical;
}
.cm-form > label {
  margin: 16px 0;
}
.cm-form input:focus,
.cm-form select:focus,
.cm-form textarea:focus {
  outline: 2px solid #fca769;
  outline-offset: 2px;
}
.cm-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cm-models {
  border: 1px solid #e1e4e8;
  border-radius: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 20px;
}
.cm-models label {
  flex-direction: row;
  align-items: center;
}
.cm-models input {
  width: 18px;
  height: 18px;
}
.cm-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.cm-photo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7e8ec;
  border-radius: 16px;
  padding: 12px;
  min-width: 0;
}
.cm-photo-item .cm-photo {
  width: 100%;
}
.cm-photo-item button {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 12px;
  width: 100%;
}
.cm-spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.cm-spec-row button {
  margin-bottom: 2px;
}
.cm-parcel {
  margin-top: 28px;
  border-top: 1px solid #eceef1;
  padding-top: 20px;
}
.cm-parcel summary {
  cursor: pointer;
  margin-bottom: 18px;
}
.cm-savebar {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  padding: 18px 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #eee;
  margin-top: 28px;
}
.cm-status {
  font-size: 14px;
  margin: 8px 0;
  white-space: normal;
}
.cm-parts-shortcut {
  margin-bottom: 20px;
}
.cm-parts-panel {
  scroll-margin-top: 24px;
  margin: 32px 0;
}
.cm-parts-panel h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}
.cm-parts-panel .cm-filters > label {
  width: 100%;
  max-width: 480px;
}
.cm-parts-panel .cm-toolbar {
  justify-content: space-between;
}
.cm-segments {
  display: flex;
  padding: 4px;
  border-radius: 16px;
  background: #e9ebee;
  gap: 4px;
}
.cm-segments .cm-button {
  border: 0;
  background: transparent;
  font-size: 14px;
  border-radius: 12px;
}
.cm-segments .cm-button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px #0000000c;
}
.cm-parts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.cm-part-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #e1e4e8;
  border-radius: 20px;
  background: #fff;
  gap: 14px;
}
.cm-part-card > .cm-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 8px;
}
.cm-part-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}
.cm-part-copy h3 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}
.cm-part-copy p {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}
.cm-part-state,
.cm-part-hidden {
  font-size: 12px;
  color: #686e76;
}
.cm-part-state.is-linked {
  color: #2f6650;
  background: #eef7f1;
  border-radius: 7px;
  padding: 4px 7px;
}
.cm-part-card > button {
  width: 100%;
  min-height: 44px;
}
.cm-parts-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  color: #686e76;
}
.cm-parts-empty strong {
  color: #222;
}
.cm-parts-empty p {
  font-size: 14px;
}
.cm-model-picker {
  display: block;
}
.cm-model-picker > label {
  flex-direction: column;
  align-items: stretch;
  margin: 0 0 16px;
}
.cm-model-picker > label input {
  width: 100%;
  height: auto;
}
.cm-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cm-models .cm-model-option {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e1e4e8;
  border-radius: 16px;
  cursor: pointer;
  min-height: 88px;
  background: #fff;
}
.cm-model-option:has(input:checked) {
  border-color: #45494f;
  background: #f5f6f8;
}
.cm-model-option:has(input:focus-visible) {
  outline: 2px solid #25292e;
  outline-offset: 3px;
}
.cm-model-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #17191c;
}
.cm-model-option .cm-photo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.cm-option-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}
.cm-option-text strong {
  color: #25292e;
  font-size: 15px;
}
.cm-option-text small {
  font-size: 12px;
  color: #686e76;
}
.cm-link-confirm {
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #f3f5f7;
}
.cm-link-confirm p {
  margin: 0 0 12px;
}
.cm-link-confirm .cm-primary {
  margin-left: 0;
}
.cm-parts-panel [hidden],
.cm-model-picker [hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .cm-parts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .cm-parts-panel h2 {
    font-size: 22px;
  }
  .cm-parts-panel .cm-toolbar {
    align-items: stretch;
    gap: 14px;
  }
  .cm-parts-panel .cm-toolbar > * {
    width: 100%;
  }
  .cm-segments .cm-button {
    flex: 1;
    padding: 9px 10px;
  }
  .cm-parts-grid {
    gap: 10px;
  }
  .cm-part-card {
    padding: 12px;
    gap: 12px;
    border-radius: 16px;
  }
  .cm-part-copy h3 {
    font-size: 15px;
  }
  .cm-part-card > button {
    padding: 9px 6px;
  }
  .cm-model-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cm-model-picker {
    padding: 14px;
  }
}
.cm-form [hidden],
.cm-grid [hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .cm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cm-photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .cm-form {
    padding: 18px;
  }
  .cm-grid {
    gap: 10px;
  }
  .cm-card {
    padding: 14px;
  }
  .cm-card h2 {
    font-size: 17px;
  }
  .cm-toolbar {
    gap: 8px;
  }
  .cm-toolbar .cm-button:hover,
  .cm-link:hover {
    background: #f5f6f8;
  }
  .cm-primary:hover {
    background: #303236;
  }
  .cm-primary {
    margin-left: 0;
  }
  .cm-fields {
    gap: 12px;
  }
  .cm-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cm-spec-row {
    grid-template-columns: 1fr 1fr;
  }
  .cm-spec-row button {
    grid-column: 1/-1;
    justify-self: end;
  }
  .cm-savebar {
    flex-wrap: wrap;
  }
  .cm-savebar > .cm-button:hover,
  .cm-link:hover {
    background: #f5f6f8;
  }
  .cm-primary:hover {
    background: #303236;
  }
  .cm-primary {
    width: 100%;
  }
  .cm-order {
    gap: 5px;
  }
  .cm-order button {
    padding: 6px;
    min-width: 0;
  }
  .cm-filters > label {
    width: 100%;
  }
}
