.tool-header {
  justify-content: space-between;
}

.tool-home-link {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  border: 1px solid #c9d9ef;
  border-radius: 11px;
  color: #294968;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.tool-home-link:hover {
  color: var(--blue);
  border-color: #9ebff5;
}

.barcode-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 0 70px;
  overflow: visible;
}

.barcode-hero {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 45px;
  align-items: end;
  margin-bottom: 34px;
}

.barcode-hero h1 {
  margin: 0 0 15px;
  color: var(--ink);
  font-size: 45px;
  letter-spacing: -.065em;
}

.barcode-hero > div:first-child > p:last-child {
  margin: 0;
  max-width: 600px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.75;
}

.format-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.format-summary article {
  min-height: 121px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.format-summary strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 19px;
}

.format-summary span {
  color: var(--body);
  font-size: 13px;
  line-height: 1.6;
}

.barcode-workbench {
  display: grid;
  grid-template-columns: 354px 1fr;
  gap: 20px;
}

.barcode-controls,
.barcode-preview {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(13, 36, 70, .05);
}

.control-heading {
  margin-bottom: 23px;
}

.control-heading h2,
.preview-heading h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 23px;
  letter-spacing: -.04em;
}

.barcode-controls label {
  display: block;
  margin-bottom: 19px;
  color: #38526e;
  font-size: 13px;
  font-weight: 700;
}

.barcode-controls select,
.barcode-controls input {
  width: 100%;
  min-height: 50px;
  display: block;
  margin-top: 9px;
  padding: 0 13px;
  border: 1px solid #cedced;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 15px;
}

.barcode-controls input:focus,
.barcode-controls select:focus {
  outline: 3px solid #e4eeff;
  border-color: var(--blue);
}

.format-rule {
  margin: -9px 0 22px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #58718c;
  background: #f2f6fc;
  font-size: 12px;
  line-height: 1.6;
}

.generate-button,
.download-button,
.secondary-tool-button {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.generate-button,
.download-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.generate-button {
  width: 100%;
}

.generate-button:hover,
.download-button:hover {
  background: var(--blue-dark);
}

.download-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.barcode-preview {
  min-height: 485px;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
}

.preview-status {
  padding: 8px 13px;
  border-radius: 999px;
  color: #08775f;
  background: #e3f5ef;
  font-size: 12px;
  font-weight: 700;
}

.preview-status.error {
  color: #b83744;
  background: #fdebed;
}

.canvas-frame {
  min-height: 252px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 30px 23px;
  border: 1px dashed #c6d8ee;
  border-radius: 12px;
  background: #fbfdff;
}

#barcodeCanvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.barcode-error {
  min-height: 23px;
  margin: 15px 0 0;
  color: #d3424c;
  font-size: 13px;
}

.preview-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}

.secondary-tool-button {
  border: 1px solid #cad9ed;
  color: #36516e;
  background: #fff;
}

.secondary-tool-button:hover {
  background: #f3f7fd;
}

.barcode-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 24px;
}

.barcode-guide article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.barcode-guide span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.barcode-guide h2 {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.barcode-guide p {
  margin: 0;
  color: var(--body);
  font-size: 13px;
  line-height: 1.65;
}

.barcode-guide p strong {
  color: var(--ink);
}

.barcode-footer {
  padding: 26px;
  border-top: 1px solid var(--line);
  color: #687f9b;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1120px) {
  .barcode-page {
    max-width: calc(100% - 38px);
  }

  .barcode-hero,
  .barcode-workbench {
    grid-template-columns: 1fr;
  }

  .barcode-preview {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .tool-home-link {
    width: 100%;
    justify-content: center;
  }

  .barcode-page {
    padding-top: 38px;
  }

  .barcode-hero h1 {
    font-size: 35px;
  }

  .format-summary,
  .barcode-guide {
    grid-template-columns: 1fr;
  }

  .barcode-controls,
  .barcode-preview {
    padding: 20px;
  }

  .preview-actions {
    flex-direction: column;
  }
}
