.nut-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 0;
}
.nut-modes [role="tab"] {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--line);
  border-radius: 5px 5px 0 0;
  text-align: left;
  font-weight: 700;
}
.nut-modes [role="tab"][aria-selected="true"] {
  background: var(--paper);
  border-bottom-color: var(--orange);
}
.nut-modes small,
.nut-custom-note,
.nut-file small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.nut-custom-choices,
.nut-custom-layout,
.nut-custom-grid,
.nut-drawing-form {
  display: grid;
  gap: 12px;
}
.nut-custom-choices {
  grid-template-columns: minmax(170px, .85fr) minmax(220px, 1fr) auto;
  align-items: end;
  margin: 0 0 18px;
}
.nut-custom-layout {
  grid-template-columns: minmax(320px, 1fr) minmax(370px, 1.24fr);
  gap: 20px;
  align-items: start;
}
.nut-custom-fields,
.nut-custom-view,
.nut-drawing-form {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}
.nut-custom-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.nut-custom-heading h3,
.nut-custom-fields h4,
.nut-drawing-form h3 {
  margin: 0;
}
.nut-custom-heading h3 {
  line-height: 1.35;
}
.nut-custom-heading > .secondary {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding-inline: 11px;
  white-space: nowrap;
}
.nut-custom-fields h4 {
  margin-top: 17px;
}
.nut-custom-grid,
.nut-drawing-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.nut-custom label,
.nut-drawing-form label {
  min-width: 0;
  margin: 0;
}
#customNutStartsField,
.nut-material-fields > label + label {
  margin-top: 9px;
}
.nut-custom input[aria-invalid="true"] {
  border-color: #9c381d;
}
.nut-custom output {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  color: #19564f;
  background: #e6f0eb;
  font-size: 16px;
}
.nut-custom-note {
  margin: 6px 0 9px;
  font-size: 13px;
}
.nut-custom-message,
#drawingNutStatus.error {
  color: #993a20;
}
.nut-custom-message:empty,
#customNutGraphicsStatus:empty,
#drawingNutStatus:empty {
  display: none;
}
.nut-custom-view {
  position: sticky;
  top: 105px;
}
.nut-custom-view canvas {
  display: block;
  width: 100%;
  height: clamp(255px, 32vw, 440px);
  margin-bottom: 10px;
  border-radius: 5px;
  background: #f1f4f2;
  touch-action: none;
  cursor: grab;
}
.nut-form-wide,
.nut-drawing-form h3 {
  grid-column: 1 / -1;
}
.nut-drawing-form {
  max-width: 790px;
}
.nut-file {
  border: 1px dashed #a2b3bb;
  border-radius: 4px;
  padding: 12px;
}
.nut-file input[type="file"] {
  max-width: 100%;
  margin: 8px 0;
}
.nut-drawing-form .nut-quote-consent {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nut-quote-consent input[type="checkbox"] {
  margin: 0;
  width: auto;
  min-height: 0;
}
.nut-download-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.nut-download-toolbar label {
  min-width: 185px;
  margin: 0;
}
.nut-download-scroll {
  overflow: auto;
}
.nut-download-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nut-download-table caption {
  padding: 6px 0 9px;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
}
.nut-download-table th,
.nut-download-table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}
.nut-download-table thead th {
  background: var(--paper);
}
.nut-download-table td a {
  display: inline-block;
  margin-right: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nut-download-table td a:last-child {
  margin-right: 0;
}
@media (max-width: 800px) {
  .nut-custom-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .nut-custom-view {
    position: static;
    order: -1;
  }
}
@media (max-width: 590px) {
  .nut-modes {
    gap: 5px;
  }
  .nut-modes [role="tab"] {
    padding: 9px 6px;
    font-size: 13px;
  }
  .nut-modes small {
    font-size: 10px;
  }
  .nut-custom-choices {
    grid-template-columns: 1fr;
  }
  .nut-custom-choices a {
    justify-self: start;
  }
  .nut-custom-fields,
  .nut-custom-view,
  .nut-drawing-form {
    padding: 13px;
  }
}
