*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.subtitle-primary {
  color: #3c3c43;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.subtitle-secondary {
  color: #6e6e73;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  max-width: 520px;
  line-height: 1.45;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #c7c7cc;
  border-radius: 16px;
  background: #fff;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.drop-zone.dragover {
  border-color: #0071e3;
  background: #f0f7ff;
}

.drop-zone.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.drop-zone h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.drop-zone p {
  color: #6e6e73;
  font-size: 0.9rem;
}

.browse-link {
  color: #0071e3;
  text-decoration: underline;
  cursor: pointer;
}

/* Format badges */
.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.badge {
  background: #f5f5f7;
  border: 1px solid #e5e5ea;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  color: #3c3c43;
}

/* Options row */
.options-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.api-key-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.api-key-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #3c3c43;
}

.api-key-group input[type="password"] {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
  color: #1d1d1f;
  font-family: "SF Mono", monospace;
  letter-spacing: 0.05em;
}

.api-key-group input[type="password"]:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.1);
}

.help-text {
  font-size: 0.75rem;
  color: #6e6e73;
}

.options-row label {
  font-size: 0.9rem;
  color: #3c3c43;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

.options-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0071e3;
  cursor: pointer;
}

/* Status */
.status {
  margin-top: 1.5rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #3c3c43;
}

.status.visible {
  display: flex;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e5ea;
  border-top-color: #0071e3;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.error-box {
  display: none;
  margin-top: 1.5rem;
  background: #fff0f0;
  border: 1px solid #ffc7c7;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: #c00;
  font-size: 0.9rem;
}

.error-box.visible {
  display: block;
}

/* Result */
.result {
  display: none;
  margin-top: 2rem;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  animation: slideUp 0.25s ease;
}

.result.visible {
  display: block;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e5ea;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-filename {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  font-size: 0.8rem;
  color: #6e6e73;
  margin-top: 2px;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #0071e3;
  color: #fff;
}

.btn-primary:hover {
  background: #0077ed;
}

.btn-copy {
  background: #fff;
  color: #0071e3;
  border: 1.5px solid #0071e3;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-copy:hover {
  background: #f0f7ff;
}

.btn-copy.copied {
  background: #34c759;
  color: #fff;
  border-color: #34c759;
}

.copy-icon {
  font-size: 1rem;
  line-height: 1;
}

textarea.output {
  width: 100%;
  min-height: 360px;
  padding: 1.25rem;
  font-family: "SF Mono", "Fira Mono", "Consolas", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  border: none;
  resize: vertical;
  color: #1d1d1f;
  background: #fafafa;
  outline: none;
}
