:root {
  color-scheme: dark;
  --bg: #08080d;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f7f7fb;
  --muted: #a9a9b8;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --danger: #fb7185;
  --success: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.32), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero-card,
.workspace-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.045));
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  border-radius: 28px;
}

.hero-card {
  padding: clamp(22px, 5vw, 46px);
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.06em;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  max-width: 720px;
  margin: 18px 0 0;
}

.support-box {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--muted);
}

.workspace-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  padding: 18px;
}

.upload-panel,
.output-panel {
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
}

.upload-drop {
  min-height: 220px;
  border: 1.5px dashed rgba(255,255,255,0.24);
  border-radius: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.upload-drop:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.06);
}

.upload-drop input {
  display: none;
}

.upload-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 2rem;
  margin-bottom: 12px;
}

.upload-drop small {
  color: var(--muted);
  max-width: 280px;
}

.preview-image {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}

button {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  cursor: pointer;
}

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

#copyBtn {
  background: var(--card-strong);
  border: 1px solid var(--border);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 16px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ready {
  background: var(--success);
}

.status-dot.error {
  background: var(--danger);
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  min-height: 310px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  background: rgba(0,0,0,0.28);
  font-size: 1rem;
  line-height: 1.5;
}

details {
  margin-top: 14px;
  color: var(--muted);
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  max-height: 220px;
  overflow: auto;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1120px);
    padding: 18px 0;
  }

  .workspace-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .hero-card {
    border-radius: 22px;
  }

  .upload-panel,
  .output-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .upload-drop {
    min-height: 180px;
  }

  textarea {
    min-height: 240px;
  }
}