.screw-config {
  margin-top: 18px;
}
.screw-config > .layout {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(360px, 1.35fr);
  gap: 18px;
  align-items: start;
}
.screw-config .panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.screw-config h2 {
  margin: 0 0 9px;
  font-size: 20px;
}
.screw-config h3 {
  margin: 14px 0 6px;
}
.screw-config .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}
.screw-config label {
  display: block;
}
.screw-config select,
.screw-config input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-width: 0;
}
.screw-config input[type="checkbox"] {
  width: auto;
  min-height: 0;
}
.screw-config .tools,
.screw-config .row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0;
}
.screw-config button:not(.primary):not(.secondary) {
  border: 1px solid #a9bcb9;
  border-radius: 5px;
  background: #fff;
  color: inherit;
  padding: 6px 11px;
  font: inherit;
  cursor: pointer;
}
.screw-config button[aria-pressed="true"] {
  background: #215b60 !important;
  color: #fff !important;
}
.screw-config .view {
  position: sticky;
  top: 105px;
}
.screw-config #screwViewer {
  height: clamp(260px, 33vw, 450px);
  background: #edf3f1;
  border-radius: 6px;
  overflow: hidden;
}
.screw-config canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.screw-config .base {
  display: block;
  margin: 8px 0;
  color: #85501f;
}
.screw-config #startsField {
  margin-top: 9px;
}
.screw-config #lead {
  display: block;
  margin-top: 3px;
  padding: 6px 9px;
  color: #16585b;
  background: #e8f2ef;
  border-radius: 4px;
  font-weight: 700;
}
.screw-config #err,
.screw-config #lockHint {
  color: #963913;
}
.screw-config #err:empty {
  display: none;
}
.screw-config fieldset {
  margin: 12px 0;
  min-width: 0;
}
.screw-config fieldset button {
  margin-top: 7px;
}
.screw-config hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
.screw-config .bearings {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.screw-config .bearings summary {
  cursor: pointer;
  font-weight: 700;
}
.screw-config .bearing-scroll {
  overflow-x: auto;
}
.screw-config .bearings table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.screw-config .bearings th,
.screw-config .bearings td {
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.screw-config .bearings th {
  background: #e8f2ef;
}
#previewHandField {
  display: block;
  max-width: 180px;
  margin: 12px 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .screw-config > .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .screw-config .view {
    position: static;
    order: -1;
  }
  .screw-config #screwViewer {
    height: 220px;
  }
}
