:root {
  color-scheme: light;
  --green: #07563f;
  --green-dark: #043f2e;
  --green-soft: #edf4f1;
  --ink: #171a18;
  --muted: #626964;
  --canvas: #eef0ee;
  --surface: #ffffff;
  --surface-subtle: #f6f7f6;
  --line: #cdd2ce;
  --line-strong: #a9b0ab;
  --danger: #8a2929;
  --warning: #69531b;
  --font-ui: Arial, Helvetica, sans-serif;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: var(--line-strong);
}

*::-webkit-scrollbar-thumb:hover {
  background: #7f8881;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--canvas);
  font-family: var(--font-ui);
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: var(--font-ui);
}

.shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -12px 4px;
  border-bottom: 2px solid #fed700;
  padding: 4px 14px 9px;
}

.brand-logo {
  display: block;
  width: min(calc(100% - 42px), 260px);
  height: auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.35;
}

.label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 24, 19, 0.05);
}

.form-card {
  padding: 15px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #252925;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input {
  padding: 0 10px;
}

select {
  padding: 0 8px;
}

input::placeholder {
  color: #858b87;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(7, 86, 63, 0.13);
}

input:disabled,
select:disabled {
  color: #747b76;
  background: #eceeec;
}

#part-number {
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.lookup-row .button {
  min-width: 76px;
}

.product-preview {
  display: grid;
  grid-template-columns: minmax(96px, 38%) 1fr;
  gap: 12px;
  margin: 14px 0 17px;
  border: 1px solid #b9c9c1;
  border-radius: 3px;
  padding: 11px;
  background: var(--green-soft);
}

.product-visual {
  display: grid;
  min-height: 118px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d4dbd7;
  border-radius: 3px;
  background: #fff;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.preview-image-empty {
  display: grid;
  gap: 7px;
  color: #89908b;
  font-size: 11px;
  line-height: 1.35;
  place-items: center;
  text-align: center;
}

.preview-image-loader {
  width: 16px;
  height: 16px;
  border: 2px solid #cdd6d1;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: preview-image-spin 700ms linear infinite;
}

.preview-image-empty:not(.is-loading) .preview-image-loader {
  display: none;
}

@keyframes preview-image-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-image-loader {
    animation: none;
  }
}

.preview-copy {
  min-width: 0;
}

.preview-name-display {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 5px;
}

.preview-name-display h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.preview-name-trigger {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  line-height: inherit;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: text;
}

.preview-name-trigger:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 2px;
}

.preview-name-trigger:disabled {
  opacity: 1;
  cursor: default;
}

.preview-name-edit,
.preview-name-save {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.preview-name-edit {
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.preview-name-edit:hover,
.preview-name-save:hover {
  border-color: #b6c7bf;
  color: var(--green-dark);
  background: #fff;
}

.preview-name-edit:focus-visible,
.preview-name-save:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.preview-name-edit svg,
.preview-name-save svg {
  fill: currentColor;
}

.preview-name-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 5px;
}

.preview-name-editor textarea {
  width: 100%;
  min-height: 22px;
  min-width: 0;
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-bottom: 1px solid #9db5aa;
  border-radius: 0;
  outline: 0;
  padding: 0 0 1px;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  resize: none;
}

.preview-name-editor textarea:focus {
  border-bottom-color: var(--green);
}

.preview-name-editor textarea[aria-invalid="true"] {
  border-bottom-color: var(--danger);
}

.preview-name-save {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--green-dark);
  background: transparent;
}

.preview-name-error {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.3;
}

.preview-description {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 8px;
  color: #4d544f;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.product-details {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 7px;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.product-details dt {
  color: var(--muted);
}

.product-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.preview-color-detail {
  display: flex;
  min-height: 18px;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  overflow: visible;
}

.preview-color-swatch {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 26, 24, 0.32);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.preview-color-value {
  font-size: 10px;
  letter-spacing: 0.025em;
}

.preview-color-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-color-picker {
  position: relative;
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 1px 3px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.preview-color-picker:hover,
.preview-color-picker:focus-within {
  border-color: #b6c7bf;
  color: var(--green-dark);
  background: #fff;
}

.preview-color-picker:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.preview-color-picker-label {
  font-size: 10px;
  font-weight: 700;
}

.preview-color-picker svg {
  flex: 0 0 auto;
  fill: currentColor;
}

input.preview-color-input {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-folder-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.settings-folder-heading {
  margin-top: 12px;
}

.settings-folder-heading label {
  margin-bottom: 6px;
}

#refresh-folders {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.folder-refresh-spinner {
  display: none;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(7, 86, 63, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: preview-image-spin 700ms linear infinite;
}

#refresh-folders.is-loading .folder-refresh-spinner {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .folder-refresh-spinner {
    animation: none;
  }
}

.destination-summary {
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 15px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.destination-summary:hover:not(:disabled) #destination-name {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.destination-summary:focus-visible {
  border-radius: 2px;
  outline: 2px solid rgba(7, 86, 63, 0.2);
  outline-offset: 3px;
}

.destination-summary:disabled {
  cursor: default;
}

.destination-summary strong,
.onshape-assignments h2 {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
}

.onshape-assignments {
  margin-top: 9px;
  border-top: 1px solid #c7cec9;
  padding-top: 9px;
}

.onshape-assignments h2 {
  margin: 0 0 7px;
}

.onshape-assignment-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 3px 8px;
  margin-top: 6px;
}

.onshape-assignment-field label,
.onshape-assignment-label {
  color: var(--muted);
  font-size: 11px;
}

.material-combobox {
  position: relative;
  min-width: 0;
}

.material-trigger {
  appearance: none;
  display: grid;
  width: 100%;
  height: 31px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 4px 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.material-trigger:hover:not(:disabled),
.material-trigger[aria-expanded="true"] {
  border-color: var(--green);
}

.material-trigger:focus-visible {
  outline: 2px solid rgba(7, 86, 63, 0.2);
  outline-offset: 1px;
}

.material-trigger:disabled {
  color: #747b76;
  background: #eceeec;
  cursor: not-allowed;
}

.material-trigger-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 6px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(20, 31, 24, 0.16);
}

.material-search-wrap {
  position: relative;
}

.material-search-wrap svg {
  position: absolute;
  top: 50%;
  left: 8px;
  fill: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

#onshape-material-search {
  height: 30px;
  padding-left: 27px;
  font-size: 11px;
}

.material-options {
  max-height: 190px;
  margin-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.material-option {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid #eceeec;
  border-radius: 0;
  padding: 7px 6px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.material-option:last-child {
  border-bottom: 0;
}

.material-option:hover,
.material-option:focus-visible {
  outline: 0;
  background: var(--green-soft);
}

.material-option[aria-selected="true"] {
  color: var(--green-dark);
  font-weight: 700;
}

.material-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.material-option-score {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  white-space: nowrap;
}

.material-option-check {
  color: var(--green);
  font-size: 13px;
  text-align: center;
}

.material-empty {
  margin: 8px 5px 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.onshape-color-control {
  min-width: 0;
}

.onshape-weight-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.onshape-weight-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 4px 7px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 11px;
}

.onshape-weight-unit-display {
  flex: 0 0 auto;
  min-width: 17px;
  color: #8b928e;
  font-size: 11px;
  line-height: 1;
  text-align: left;
}

.onshape-weight-input:hover:not(:disabled),
.onshape-weight-input:focus {
  border-color: var(--green);
}

.onshape-weight-input:focus {
  outline: 2px solid rgba(7, 86, 63, 0.2);
  outline-offset: 1px;
}

.onshape-weight-input:disabled {
  color: #747b76;
  background: #eceeec;
  cursor: not-allowed;
}

.onshape-weight-input[aria-invalid="true"] {
  border-color: #ad4545;
}

.onshape-weight-error {
  grid-column: 2;
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.3;
}

.duplicate-warning {
  margin-top: 7px;
  border: 1px solid #d9cda9;
  border-radius: 3px;
  padding: 6px 7px;
  color: var(--warning);
  background: #fbf8ee;
  font-size: 11px;
  line-height: 1.4;
}

#destination-name {
  overflow-wrap: anywhere;
}

.category-path-warning {
  margin: 6px 0 0;
  color: var(--warning);
  font-size: 10px;
  line-height: 1.4;
}

.destination-combobox {
  position: relative;
}

.destination-trigger {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.destination-trigger:hover,
.destination-trigger[aria-expanded="true"] {
  border-color: var(--green);
}

.destination-trigger:focus-visible {
  outline: 2px solid rgba(7, 86, 63, 0.2);
  outline-offset: 1px;
}

.destination-trigger:disabled {
  cursor: not-allowed;
  color: #747b76;
  background: #eceeec;
}

.organization-trigger {
  appearance: none;
  min-height: 38px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.destination-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-symbol {
  position: relative;
  display: block;
  width: 16px;
  height: 11px;
  margin-top: 2px;
  border: 1px solid var(--green);
  border-radius: 1px;
  background: var(--green-soft);
}

.folder-symbol::before {
  position: absolute;
  top: -4px;
  left: -1px;
  width: 7px;
  height: 4px;
  border: 1px solid var(--green);
  border-bottom: 0;
  border-radius: 1px 1px 0 0;
  background: var(--green-soft);
  content: "";
}

.chevron {
  color: var(--muted);
  font-size: 16px;
}

.destination-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 7px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(20, 31, 24, 0.16);
}

.destination-search-wrap {
  position: relative;
}

.folder-browser-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  border-bottom: 1px solid #e4e7e5;
  padding: 0 2px 7px;
}

.folder-browser-back {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 7px;
  color: var(--green-dark);
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.folder-browser-back span {
  margin-right: 2px;
  font-size: 16px;
  line-height: 0;
  vertical-align: -1px;
}

.folder-browser-back:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green-soft);
}

.folder-browser-back:disabled {
  cursor: default;
  color: #8a908c;
  background: #eceeec;
}

.folder-browser-back:focus-visible,
.folder-browser-path:focus-visible {
  outline: 2px solid rgba(7, 86, 63, 0.24);
  outline-offset: 1px;
}

.folder-browser-path {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.destination-search-wrap svg {
  position: absolute;
  top: 50%;
  left: 9px;
  fill: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

#destination-search,
#settings-company-search,
#settings-root-search {
  height: 34px;
  padding-left: 30px;
  font-size: 12px;
}

.organization-menu {
  z-index: 25;
}

.organization-options {
  max-height: 190px;
  margin-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.organization-option {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid #eceeec;
  border-radius: 0;
  padding: 8px 7px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.organization-option:last-child {
  border-bottom: 0;
}

.organization-option:hover,
.organization-option:focus-visible {
  outline: 0;
  background: var(--green-soft);
}

.organization-option[aria-selected="true"] {
  color: var(--green-dark);
  font-weight: 700;
}

.organization-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.organization-option-check {
  color: var(--green);
  font-size: 13px;
  text-align: center;
}

.destination-options {
  max-height: 220px;
  overflow-y: auto;
}

.folder-option {
  display: grid;
  width: 100%;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid #eceeec;
  border-radius: 0;
  padding: 9px 7px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.folder-option:hover,
.folder-option:focus-visible {
  outline: 0;
  background: var(--green-soft);
}

.folder-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-option.is-search-result .folder-option-name {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.folder-option-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.folder-option-current {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.folder-option-arrow {
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.button.folder-browser-select {
  width: 100%;
  margin-top: 7px;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.button.folder-browser-select:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.destination-empty {
  padding: 15px 7px 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hint,
.muted,
.settings-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hint {
  margin-top: 6px;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.document-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  color: #7b827d;
  border-color: #d5d8d6;
  background: #e8eae8;
}

.primary {
  width: 100%;
  margin-top: 16px;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.primary:not(:disabled):hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.danger-button {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.danger-button:hover {
  border-color: #6f2020;
  background: #6f2020;
}

.secondary {
  color: var(--ink);
  border-color: #9db5aa;
  background: var(--green-soft);
}

.secondary:not(:disabled):hover {
  border-color: var(--green);
  background: #dfece6;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #b6c7bf;
  background: var(--green-soft);
}

.icon-button svg {
  fill: currentColor;
}

.progress {
  padding: 13px;
}

.progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-heading .label {
  color: var(--green-dark);
}

.progress-percent {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 1px solid #b9c9c1;
  border-radius: 1px;
  background: #dfe7e3;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.progress .muted {
  margin-top: 8px;
}

.result {
  position: relative;
  padding: 10px 11px;
  border-color: var(--line);
  background: var(--surface);
}

.result-content {
  min-width: 0;
}

.result-product-name {
  padding-right: 68px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.result.is-existing .result-product-name {
  padding-right: 108px;
}

.result-status {
  position: absolute;
  top: 10px;
  right: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.success-icon {
  display: grid;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 1px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: #f3f4f3;
  font-size: 8px;
  font-weight: 800;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.result-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding-inline: 10px;
}

#result-insert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: #b7c8be;
  color: var(--ink);
  background: #f3f8f5;
}

#result-insert:hover {
  border-color: #9fb8aa;
  background: #eaf3ee;
}

.result-insert-check {
  color: var(--green);
  font-weight: 800;
}

.document-link {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.document-link:hover {
  border-color: #858d87;
  background: #f7f8f7;
}

.document-link.is-disabled {
  color: #7b827d;
  border-color: #d5d8d6;
  background: #e8eae8;
  pointer-events: none;
}

.result-action-status {
  margin-top: 7px;
  color: var(--green-dark);
  font-size: 11px;
  line-height: 1.35;
}

.result-action-status.is-error {
  color: var(--danger);
}

.warnings {
  margin: 9px 0 0;
  padding-left: 17px;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
}

.error {
  padding: 9px 10px;
  border: 1px solid #dfbcbc;
  color: var(--ink);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.35;
}

.error .label {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
}

.settings-panel {
  position: fixed;
  z-index: 41;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 460px);
  overflow-y: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: -4px 0 14px rgba(16, 27, 20, 0.14);
}

.settings-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
  background: var(--surface);
}

.settings-header h1 {
  margin: 0;
  color: #336633;
  font-size: 21px;
  font-weight: 400;
  line-height: 36px;
}

.settings-header .icon-button {
  color: #336633;
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
}

.settings-body {
  padding: 0 20px 80px;
  background: var(--surface);
}

.settings-section {
  margin: 0;
  border: 0;
  padding: 15px 0 21px;
  background: transparent;
}

.settings-section + .settings-section {
  padding-top: 21px;
}

.settings-section h2 {
  margin: 0 0 6px;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.settings-help {
  margin-bottom: 16px;
  color: #333;
  font-size: 12px;
  line-height: 1.35;
}

.settings-section select + label {
  margin-top: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  border: 0;
  padding: 9px 0;
  cursor: pointer;
}

.toggle-row:first-of-type {
  margin-top: 5px;
}

.toggle-row > span {
  min-width: 0;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 12px;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.toggle-row input::after {
  display: none;
  width: 4px;
  height: 8px;
  margin: 2px 0 0 6px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.toggle-row input:checked {
  border-color: var(--green);
  background: var(--green);
}

.toggle-row input:checked::after {
  display: block;
}

.settings-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(100%, 460px);
  border-top: 1px solid var(--line);
  padding: 10px 20px 13px;
  background: var(--surface);
}

.settings-footer .primary {
  margin-top: 0;
}

.settings-scrim {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(18, 27, 21, 0.32);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 340px) {
  .shell {
    padding-inline: 9px;
  }

  .form-card {
    padding: 12px;
  }

  .product-preview {
    grid-template-columns: 1fr;
  }

  .product-visual {
    min-height: 100px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}
