:root {
  --bg: #fff6fb;
  --panel: #ffffff;
  --text: #25101d;
  --muted: #75566a;
  --pink: #d63384;
  --pink-dark: #9f1f61;
  --rose: #ffe0ef;
  --border: #f3bed7;
  --shadow: 0 22px 60px rgba(159, 31, 97, 0.14);
}

* { 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;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #ffe5f2 0, transparent 35%),
    radial-gradient(circle at bottom right, #f7d4ff 0, transparent 28%),
    var(--bg);
}

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

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: center;
  padding: 34px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

h3 { margin-bottom: 8px; font-size: 1rem; }

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-card {
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(160deg, #ffffff, var(--rose));
  border: 1px solid var(--border);
}

.badge, .status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--rose);
  color: var(--pink-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.controls, .studio, .limits { padding: 28px; }

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.92rem;
}

select, input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffafd;
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}

input[type="range"] { accent-color: var(--pink); padding: 0; }

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

button {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffafd;
  color: var(--pink-dark);
  font: inherit;
  font-weight: 850;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(159, 31, 97, 0.12); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

button.primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
  border-color: transparent;
}

.button-row, .transport {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.transport { margin-bottom: 16px; }

.meter {
  width: 100%;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffe8f3;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

#meterBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f783bd, var(--pink));
  transition: width 120ms linear;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.cards article, .prompt-card, .limit-grid > div {
  padding: 18px;
  border-radius: 20px;
  background: #fffafd;
  border: 1px solid var(--border);
}

.cards p, .prompt-card p, .hero-card p, .limits p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.note {
  font-size: 0.9rem;
  margin-top: 10px;
}

.limits { margin-top: 24px; }
.limit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 900px) {
  .hero, .grid, .cards, .limit-grid { grid-template-columns: 1fr; }
  .hero { padding: 26px; }
}

.elevenlabs-card {
  border: 1px solid rgba(214, 51, 132, 0.35);
  background: linear-gradient(135deg, rgba(255, 240, 247, 0.95), rgba(255, 255, 255, 0.95));
}

.ai-transport {
  margin-top: 16px;
}

#audio, audio,
#aiAudio {
  width: 100%;
  margin-top: 14px;
}

.status.connected {
  background: #e9fbef;
  color: #146c2e;
  border-color: #b9efc7;
}

.note.tight {
  margin: 4px 0 0;
}

.limit-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 820px) {
  .limit-grid.three {
    grid-template-columns: 1fr;
  }
}
