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

:root {
  --bg:      #0f0f0f;
  --surface: #1a1a1a;
  --border:  #2a2a2a;
  --accent:  #ff3b3b;
  --accent2: #ff6b35;
  --text:    #f0f0f0;
  --muted:   #888;
  --green:   #4caf7d;
  --radius:  14px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.seo-content {
  width: 100%;
  max-width: 560px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.seo-content h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.seo-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px;
  letter-spacing: -0.2px;
}

.seo-content p { margin-bottom: 12px; }
.seo-content p:last-child { margin-bottom: 0; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  will-change: transform;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item summary { transition: color .15s; }
.faq-item summary:hover { color: var(--accent); }

.faq-item .faq-content {
  display: block;
  height: 0;
  overflow: hidden;
  transition: height .25s ease;
}

.faq-item .faq-answer {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

@media (max-width: 480px) {
  body { padding: 20px 12px; }
  .card { padding: 20px; }
}

.site-footer {
  width: 100%;
  max-width: 560px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.site-footer a:hover { color: var(--accent); }
.site-footer .sep { color: var(--border); }

.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  padding: 16px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform .3s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p {
  margin: 0;
  max-width: 640px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.cookie-banner button {
  flex-shrink: 0;
  padding: 10px 22px;
  border: none;
  border-radius: calc(var(--radius) / 2);
  background: var(--accent);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.cookie-banner button:hover { background: var(--accent2); }

@media (max-width: 480px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; padding: 16px; }
  .cookie-banner button { width: 100%; }
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 20px;
}
input[type="text"]:focus { border-color: var(--accent); }
input[type="text"]::placeholder { color: var(--muted); }

.preview-box {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  margin-bottom: 20px;
}
.preview-box.visible { display: flex; }
.preview-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface);
  flex-shrink: 0;
}
.preview-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

input.preview-title-input,
input.preview-artist-input {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 1px 4px;
  margin: -1px -4px 0; /* overrides the global input[type="text"] margin-bottom */
  font-family: inherit;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s, border-color .15s;
}
input.preview-title-input:hover,
input.preview-artist-input:hover { border-color: var(--border); }
input.preview-title-input:focus,
input.preview-artist-input:focus { background: var(--bg); border-color: var(--accent); }
input.preview-title-input::placeholder,
input.preview-artist-input::placeholder { color: var(--muted); opacity: .6; }

input.preview-title-input {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
input.preview-artist-input {
  font-size: 12px;
  color: var(--muted);
}

.format-row { display: flex; gap: 8px; margin-bottom: 6px; }
.fmt-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0 6px;
  cursor: pointer;
  transition: all .2s;
}
.fmt-btn .fmt-sub { display: block; font-size: 10px; font-weight: 400; margin-top: 2px; opacity: .7; }
.fmt-btn.active { background: #2a0a0a; border-color: var(--accent); color: var(--accent); }
.fmt-btn:hover:not(.active) { border-color: #555; color: var(--text); }

.fmt-note { font-size: 12px; color: var(--muted); margin-top: 8px; margin-bottom: 20px; min-height: 16px; }
.fmt-note.good { color: var(--green); }

.quality-section { margin-bottom: 28px; }
.quality-row { display: flex; gap: 8px; margin-top: 8px; }
.q-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 0;
  cursor: pointer;
  transition: all .2s;
}
.q-btn.active { background: #2a0a0a; border-color: var(--accent); color: var(--accent); }
.q-btn:hover:not(.active) { border-color: #555; color: var(--text); }

.trim-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
  transition: color .15s;
}
.trim-toggle:hover { color: var(--text); }
.trim-toggle-icon {
  display: inline-block;
  font-size: 10px;
  transition: transform .2s;
}
.trim-toggle.expanded .trim-toggle-icon { transform: rotate(90deg); }

.trim-section { margin-bottom: 20px; }
.trim-row { display: flex; gap: 8px; }
.trim-field { flex: 1; }
.trim-field label { margin-bottom: 4px; }
.trim-field input[type="text"] { margin-bottom: 0; padding: 10px 12px; font-size: 13px; }

.trim-reset {
  display: block;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.trim-reset:hover { color: var(--accent); }

.trim-error {
  font-size: 12px;
  color: #ff6b6b;
  margin-top: 6px;
}
.trim-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  letter-spacing: 0.02em;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ── Progress ── */
.status-box { margin-top: 24px; display: none; }
.status-box.visible { display: block; }

.stage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stage-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stage-label .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.pct-display {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.pct-display.done { color: var(--green); }

.progress-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width .35s ease;
  width: 0%;
}

.progress-fill.converting {
  background: linear-gradient(90deg, #ff6b35, #ffa500);
}

.progress-fill.done-fill {
  background: linear-gradient(90deg, #2d7a4f, var(--green));
}

.status-sub {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.status-sub.error { color: #ff6b6b; }

.download-btn {
  display: none;
  width: 100%;
  margin-top: 16px;
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  border-radius: 10px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
  transition: background .2s;
  letter-spacing: 0.02em;
}
.download-btn.visible { display: block; }
.download-btn:hover { background: #1f3a1f; }

.divider { height: 1px; background: var(--border); margin: 28px 0; }
.hint { font-size: 11px; color: #555; text-align: center; line-height: 1.6; }

.source-links {
  width: 100%;
  max-width: 560px;
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.source-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.source-links a:hover { color: var(--accent); }
