html, body {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body {
  font-family: sans-serif;
  margin: 0;
  padding: 0 0 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 20px;
  text-align: center;
  background: #fff;
  color: #000;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  display: none;
  transition: opacity 0.3s ease;
}

.toggle-icon {
  width: 50px;
  height: 50px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-icon:hover {
  background: #ddd;
}

.toggle-icon svg {
  width: 28px;
  height: 28px;
}

#warning {
  color: red;
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#warning.visible {
  opacity: 1;
}

.main-wrapper {
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 0;
  flex: 1;
  padding: 10px;
}

.logo-placeholder {
  margin-bottom: 20px;
  text-align: center;
  padding: 10px;
}

.logo-placeholder img {
  display: block;
  margin: 20px auto;
  width: 80px;
  height: 80px;
  object-fit: contain;
  max-width: 90%;
  height: auto;
  max-height: 150px;
}

h1 {
  font-size: 2rem;
  margin: 20px 0 5px;
}

p {
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

input {
  width: 100%;
  padding: 12px 36px 12px 12px;
  font-size: 16px;
  border: 2px solid #007bff;
  border-radius: 6px;
  box-sizing: border-box;
}

input[type="text"], textarea, select {
  font-size: 16px;
}

.barcode-container.print-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-height: 50vh;
  overflow: auto;
}

.barcode-controls-top {
  margin-bottom: 10px;
}

#upc-suggestion-container {
  display: none;
}

#upc-suggestion {
  background: #eee;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#upc-suggestion:hover {
  background: #ccc;
}

.barcode,
.qrcode {
  margin: 10px 0 0;
}

#text-toggle {
  display: none;
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  margin-top: 5px;
  transition: color 0.3s ease;
}

#text-toggle:hover {
  color: #0056b3;
}

.export-label {
  font-weight: bold;
  font-size: 20px;
  margin: 20px 0 10px;
}

.toggle-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.toggle-row select {
  padding: 5px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.toggle-row button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-row button:hover {
  background-color: #0056b3;
}

.toggle-row button svg {
  width: 20px;
  height: 20px;
}

.about-link {
  display: block;
  margin-top: 25px;
  font-size: 14px;
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

#about-modal {
  display: none;
  position: fixed;
  z-index: 1100;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  position: relative;
  text-align: left;
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: #000;
}

#qr-svg {
  display: none;
}

.about-main {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.content-section {
  text-align: left;
  margin: 20px auto;
  max-width: 800px;
  line-height: 1.6;
}

.content-section h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.content-section h3 {
  font-size: 1.4rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.content-section ul.about-main,
.content-section ol.about-main {
  padding-left: 20px;
  margin-bottom: 20px;
}

.content-section ul.about-main li,
.content-section ol.about-main li {
  margin-bottom: 15px;
}

.content-section hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 20px 0;
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-code,
  .print-code * {
    visibility: visible;
  }
  .print-code {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  canvas.qrcode {
    display: none !important;
  }
  #qr-svg {
    display: block !important;
  }
  #text-toggle {
    display: none !important;
  }
  #upc-suggestion {
    display: none !important;
  }
}
