.barcode-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label{
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

.barcode-input,
.label-input{
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  box-sizing: border-box;
}

.barcode-input:focus,
.label-input:focus{
  border-color: #45a7ff;
  outline: 3px solid rgba(69,167,255,0.18);
}

.label-inputs{
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  margin-top: 6px;
}

.file-name-option{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.file-name-option input{
  width: 18px;
  height: 18px;
  accent-color: #45a7ff;
  cursor: pointer;
}

.barcode-message{
  min-height: 22px;
  margin: 4px 0 0;
  font-size: 14px;
  color: #475569;
}

.barcode-message.is-error{
  color: #e11d48;
  font-weight: 800;
}

.barcode-message.is-success{
  color: #0f766e;
  font-weight: 800;
}

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

/* character-counter と同じ立体感のある操作ボタン */
.barcode-actions .btn{
  position: relative;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.15);
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(to bottom, #45a7ff, #1e6fd6);
  box-shadow:
    0 10px 18px rgba(0,0,0,0.18),
    0 2px 0 rgba(0,0,0,0.25);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.barcode-actions .btn::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%,
    rgba(255,255,255,0.20),
    rgba(255,255,255,0) 55%
  );
  pointer-events: none;
}

.barcode-actions .btn:hover:not(:disabled){
  transform: translateY(-2px);
  box-shadow:
    0 14px 26px rgba(0,0,0,0.22),
    0 2px 0 rgba(0,0,0,0.22);
}

.barcode-actions .btn:active:not(:disabled){
  transform: translateY(1px);
  box-shadow:
    0 6px 12px rgba(0,0,0,0.18),
    0 1px 0 rgba(0,0,0,0.20);
}

.barcode-actions .btn:disabled{
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.2);
}

.barcode-actions .btn-blue{
  background: linear-gradient(to bottom, #38bdf8, #2563eb);
}

.barcode-actions .btn-pink{
  background: linear-gradient(to bottom, #ff5c93, #d61e5d);
}

.barcode-actions .btn-ghost{
  background: linear-gradient(to bottom, #64748b, #334155);
}

.barcode-preview-wrap{
  width: 100%;
}

.preview-heading{
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
  color: #334155;
}

.label-preview{
  width: min(100%, 560px);
  min-height: 260px;
  margin: 0 auto;
  padding: 22px;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
  box-sizing: border-box;
  text-align: center;
}

.label-text-area{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 12px;
}

.label-line{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  color: #1e293b;
  text-align: left;
  word-break: break-word;
}

.barcode-only-area{
  display: inline-block;
  max-width: 100%;
  padding: 10px 12px;
  background: #fff;
  text-align: center;
}

.barcode-svg{
  display: block;
  max-width: 100%;
  height: auto;
}

.barcode-value{
  display: none;
}

#printLabelRoot{
  display: none;
}

@media print{
  @page{
    margin: 10mm;
  }

  html,
  body{
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body > :not(#printLabelRoot){
    display: none !important;
  }

  #printLabelRoot{
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #printLabelRoot .label-preview{
    width: 560px;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: none;
  }
}

@media (max-width: 900px){
  .barcode-actions{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px){
  .label-inputs{
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .file-name-option{
    align-items: flex-start;
    line-height: 1.5;
  }

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

  .barcode-actions .btn{
    width: 100%;
  }

  .label-preview{
    padding: 16px 10px;
  }

  .label-line{
    font-size: 15px;
  }
}
