.labels-page {
  --labels-blue: #3964f4;
  --labels-blue-soft: #edf1ff;
  --labels-green: #4e7d1c;
  min-width: 0;
}

.labels-topbar {
  align-items: center;
}

.labels-format-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 9px 30px rgb(31 39 51 / 5%);
}

.labels-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
  align-items: start;
  gap: 22px;
}

.labels-converter-card,
.labels-guide-card {
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--card);
  box-shadow: 0 20px 60px rgb(31 39 51 / 5%);
}

.labels-converter-card {
  padding: clamp(20px, 3vw, 32px);
}

.labels-card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.labels-heading-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--nav);
  color: var(--lime);
}

.labels-heading-icon svg,
.labels-upload-mark svg,
.labels-privacy-note svg {
  width: 23px;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.labels-card-heading h2,
.labels-guide-card h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.labels-card-heading h2 {
  font-size: 21px;
}

.labels-card-heading p,
.labels-guide-card > p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.labels-dropzone {
  display: flex;
  width: 100%;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 28px;
  border: 1.5px dashed #b6bdca;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgb(57 100 244 / 7%), transparent 48%),
    #fafaf8;
  color: var(--ink);
  text-align: center;
  transition: 180ms ease;
}

.labels-dropzone:hover,
.labels-dropzone:focus-visible,
.labels-dropzone.is-dragging {
  border-color: var(--labels-blue);
  background-color: var(--labels-blue-soft);
  transform: translateY(-1px);
}

.labels-dropzone.is-processing {
  cursor: wait;
  opacity: 0.72;
}

.labels-dropzone.is-ready {
  border-color: #9dbd77;
  background: #f7fbed;
}

.labels-dropzone.has-file {
  border: 2px solid #9dbd77;
  background: #f7fbed;
}

.labels-dropzone.has-file .labels-upload-mark {
  background: #dff0ca;
  color: var(--labels-green);
}

.labels-file-check,
.labels-dropzone.has-file .labels-upload-icon {
  display: none;
}

.labels-dropzone.has-file .labels-file-check {
  display: block;
}

.labels-upload-prompt {
  display: grid;
  gap: 9px;
}

.labels-file-status {
  color: var(--labels-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.labels-dropzone.has-error {
  border-color: #e19884;
  background: #fff8f5;
}

.labels-upload-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 17px;
  background: var(--labels-blue-soft);
  color: var(--labels-blue);
}

.labels-dropzone strong {
  font-size: 14px;
}

.labels-dropzone strong span {
  color: var(--labels-blue);
}

.labels-dropzone small {
  color: var(--ink-soft);
  font-size: 11px;
}

.labels-dropzone small b {
  color: var(--labels-blue);
}

.labels-selected-file {
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  color: #737b89;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgb(31 39 51 / 7%);
}

.labels-dropzone.has-file .labels-selected-file {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: none;
}

.labels-upload-help {
  margin: 10px 3px 0;
  color: #7a818d;
  font-size: 10px;
  line-height: 1.45;
}

.labels-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.labels-submit-row .primary-button {
  min-width: 112px;
  border: 0;
  cursor: pointer;
}

.labels-submit-row .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.labels-settings {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.labels-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.labels-settings-grid .labels-setting-wide {
  grid-column: 1 / -1;
}

.labels-settings-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #7a818d;
  font-size: 9px;
  line-height: 1.4;
}

.labels-settings-grid label {
  display: grid;
  gap: 6px;
}

.labels-settings-grid label > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.labels-mode-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.labels-mode-picker legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.labels-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.labels-settings-grid .labels-mode-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.labels-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.labels-settings-grid .labels-mode-option > span {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.labels-mode-option > span::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid #aeb8c7;
  border-radius: 50%;
  background: white;
}

.labels-mode-option input:checked + span {
  border-color: var(--labels-blue);
  background: var(--labels-blue-soft);
  color: #284dc7;
  box-shadow: inset 0 0 0 1px var(--labels-blue);
}

.labels-mode-option input:checked + span::before {
  border-color: var(--labels-blue);
  background: var(--labels-blue);
  box-shadow: inset 0 0 0 3px white;
}

.labels-mode-option:hover > span {
  border-color: var(--labels-blue);
}

.labels-mode-option input:focus-visible + span {
  outline: 3px solid rgb(57 100 244 / 30%);
  outline-offset: 3px;
}

.labels-settings-grid select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font-size: 11px;
}

.labels-settings-grid select:disabled {
  cursor: not-allowed;
  background: #f1f2f4;
  color: #7a818d;
}

.labels-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
}

.labels-settings-actions > span {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.labels-reset-settings {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink-soft);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.labels-reset-settings:hover {
  border-color: #aeb8c7;
  background: #f8f9fb;
  color: var(--ink);
}

.labels-progress,
.labels-result,
.labels-error {
  margin-top: 18px;
  border-radius: 16px;
}

.labels-progress {
  padding: 17px 18px;
  background: var(--nav);
  color: white;
}

.labels-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.labels-progress-heading div {
  display: grid;
  gap: 3px;
}

.labels-progress-heading strong {
  font-size: 12px;
}

.labels-progress-heading span {
  color: #aeb7c6;
  font-size: 10px;
}

.labels-progress-heading > b {
  color: var(--lime);
  font-size: 13px;
}

.labels-progress-track {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 13%);
}

.labels-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 220ms ease;
}

.labels-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid #d7e9c2;
  background: #f7fbed;
}

.labels-result-icon {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 50%;
  background: #dff0ca;
  color: var(--labels-green);
  font-size: 17px;
  font-weight: 900;
}

.labels-packing-review {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #d9dfca;
  border-radius: 14px;
  background: #fbfcf6;
}

.labels-packing-review > strong {
  color: var(--ink);
  font-size: 11px;
}

.labels-packing-review ol {
  display: grid;
  gap: 6px;
  margin: 9px 0 7px;
  padding: 0;
  list-style: none;
}

.labels-packing-review li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 10px;
}

.labels-packing-review li span {
  min-width: 0;
}

.labels-packing-review li b {
  flex: 0 0 auto;
  color: var(--ink);
}

.labels-packing-review small {
  color: #7a818d;
  font-size: 9px;
}

.labels-result strong,
.labels-error strong {
  font-size: 12px;
}

.labels-result p,
.labels-error p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.labels-result .primary-button {
  margin: 0;
  padding: 10px 13px;
  border-radius: 10px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.labels-error {
  padding: 16px;
  border: 1px solid #f0c7bb;
  background: #fff6f2;
}

.labels-error strong {
  color: #a33d23;
}

.labels-error .ghost-button {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 10px;
}

.labels-history {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.labels-history > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.labels-history .eyebrow {
  font-size: 9px;
}

.labels-history h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.labels-history > header small,
.labels-history-status,
.labels-history-empty {
  color: var(--ink-soft);
  font-size: 10px;
}

.labels-history-actions {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  flex-direction: column;
}

.labels-history-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #7a818d;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.labels-history-actions button:hover {
  color: var(--ink);
  text-decoration: underline;
}

.labels-history-status:empty {
  display: none;
}

.labels-history-status {
  margin: 10px 0 0;
}

.labels-history-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.labels-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafaf8;
}

.labels-history-item time {
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.labels-history-item a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--nav);
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.labels-history-item a:hover {
  background: #233149;
}

.labels-history-empty {
  margin: 14px 0 0;
  padding: 16px;
  border-radius: 12px;
  background: #f6f5f1;
  text-align: center;
}

.labels-guide-card {
  position: sticky;
  top: 30px;
  overflow: hidden;
  padding: 27px 25px 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(216 240 111 / 21%), transparent 38%),
    var(--card);
}

.labels-guide-card h2 {
  max-width: 14ch;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.08;
}

.labels-guide-card ol {
  display: grid;
  gap: 17px;
  margin: 25px 0;
  padding: 0;
  list-style: none;
}

.labels-guide-card li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.labels-guide-card li > b {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--nav);
  color: var(--lime);
  font-size: 10px;
}

.labels-guide-card li div {
  display: grid;
  gap: 4px;
}

.labels-guide-card li strong {
  font-size: 11px;
}

.labels-guide-card li span {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.labels-mode-guide {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #d7e9c2;
  border-radius: 14px;
  background: #f7fbed;
}

.labels-mode-guide strong {
  color: var(--ink);
  font-size: 11px;
}

.labels-mode-guide p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.labels-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f1f0eb;
  color: #657080;
}

.labels-privacy-note svg {
  width: 18px;
  flex: 0 0 auto;
}

.labels-privacy-note p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.labels-privacy-note strong {
  color: var(--ink);
  font-size: 10px;
}

.labels-privacy-note span {
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 1020px) {
  .labels-layout {
    grid-template-columns: 1fr;
  }

  .labels-guide-card {
    position: static;
  }

  .labels-guide-card h2 {
    max-width: 24ch;
  }
}

@media (max-width: 620px) {
  .labels-topbar {
    align-items: flex-start;
  }

  .labels-format-badge {
    display: none;
  }

  .labels-converter-card,
  .labels-guide-card {
    border-radius: 19px;
  }

  .labels-dropzone {
    min-height: 210px;
    padding: 24px 16px;
  }

  .labels-settings-grid {
    grid-template-columns: 1fr;
  }

  .labels-mode-options {
    grid-template-columns: 1fr;
  }

  .labels-settings-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .labels-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .labels-result .primary-button {
    grid-column: 1 / -1;
    text-align: center;
  }

  .labels-history > header,
  .labels-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .labels-history-item a {
    width: 100%;
    text-align: center;
  }
}
