.page-shell {
  width: 100%;
  margin: var(--page-margin-desktop);
  box-sizing: border-box;
}

.page-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 20px;
  box-sizing: border-box;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  color: #111827;
}

.page-eyebrow {
  margin: 0 0 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.page-link:hover {
  text-decoration: underline;
}

.page-content {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 13px;
  color: #747475;
  font-weight: 600;
}

.field-label-wrap {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  position: relative;
  max-width: 100%;
}

.form-group .field-hint-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  max-width: 22px;
  min-height: 22px;
  max-height: 22px;
  aspect-ratio: 1 / 1;
  flex: 0 0 22px;
  border: 1px solid #93c5fd;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.field-hint-button:hover,
.field-hint-button:focus-visible {
  background: #dbeafe;
}

.field-hint-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.field-hint-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: none;
  display: none;
  min-width: 0;
  width: min(420px, calc(100vw - 56px));
  max-width: calc(100vw - 56px);
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
  z-index: 10;
}

.field-hint-bubble.is-open {
  display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid #d9d9d9;
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}

#subCategoryContainer {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

#subCategoryContainer .form-group {
  margin: 0;
  padding: 4px 0;
  background: #fff;
}

#subCategoryContainer.open {
  max-height: 6000px;
  opacity: 1;
  transform: translateY(0);
}

.form-group-wide {
  grid-column: 1 / -1;
}

.section-title {
  margin: 4px 0 0;
  font-size: 15px;
  color: #111827;
}

.required {
  color: #dc2626;
}

#itemImageList {
  display: none;
}

.item-image-upload {
  margin-top: 2px;
}

.item-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-image-label {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.item-image-label:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.plus-icon {
  font-size: 34px;
  color: #94a3b8;
  line-height: 1;
}

.preview-image {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.help-text {
  margin: 0;
  color: #6b7280;
  font-size: 11px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.button-primary {
  background: #1d4ed8;
  color: #ffffff;
}

.button-secondary {
  background: #e5e7eb;
  color: #111827;
}

.form-message {
  min-height: 18px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.form-message-info {
  background: #e0f2fe;
  color: #0369a1;
}

.form-message-success {
  background: #dcfce7;
  color: #166534;
}

.form-message-error {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 1024px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-card {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: 100%;
    margin: var(--page-margin-mobile);
  }

  .page-card {
    padding: 18px;
    border-radius: 18px;
  }

  .page-title-row h1 {
    font-size: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .item-image-label,
  .preview-image {
    width: 92px;
    height: 92px;
  }
}
