* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #1f2937;
  line-height: 1.5;
  min-height: 100vh;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 20px;
}

.topbar-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #111827;
  font-weight: 700;
  font-size: 18px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #0284c7;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}

.limit-note {
  font-size: 12px;
  color: #6b7280;
}

.container {
  max-width: 780px;
  margin: 28px auto 60px;
  padding: 0 16px;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.dropzone-sub {
  font-size: 13px;
  color: #6b7280;
}

.preview-area {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 600px) {
  .preview-area {
    grid-template-columns: 1fr;
  }
}

.thumb-box {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: #ffffff;
}

input[type="text"]:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.14);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

button {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #f3f4f6;
}

button.primary {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 600;
}

button.primary:hover:not(:disabled) {
  background: #0369a1;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-line {
  font-size: 12px;
  color: #4b5563;
  margin-top: 6px;
}

.status-line.error {
  color: #dc2626;
}

.results-card {
  margin-top: 20px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.results-preview {
  max-height: 360px;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  margin-bottom: 16px;
}

.code-row {
  margin-bottom: 10px;
}

.code-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 3px;
}

.copy-group {
  display: flex;
  gap: 6px;
}

.copy-group input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: #f9fafb;
}

.hidden {
  display: none !important;
}
