:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #59655f;
  --line: #d8ded8;
  --paper: #fbfbf7;
  --panel: #ffffff;
  --accent: #176b5c;
  --accent-strong: #0d4d43;
  --warm: #be6b29;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23, 107, 92, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(190, 107, 41, 0.13), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace {
  width: min(1120px, 100%);
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.masthead > div:first-child {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 920px;
  font-size: clamp(2rem, 5.2vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.status-pill {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  min-height: 420px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 740;
}

.script-note {
  font-size: 0.85rem;
  font-weight: 520;
}

textarea {
  width: 100%;
  min-height: 260px;
  flex: 1;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f6f8f4;
  color: var(--ink);
  padding: 16px;
  font-size: 1.1rem;
  line-height: 1.55;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.15);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 760;
}

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

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.icon-button {
  background: #eef2ec;
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover,
.icon-button:hover {
  background: #e2e9e0;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.settings {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 18px;
}

.settings h2 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.settings p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f4;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.settings-button {
  align-self: end;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.audio-tools {
  margin-top: 10px;
}

audio {
  width: 100%;
}

.audio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.audio-links a {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2ec;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 740;
}

@media (max-width: 780px) {
  .app-shell {
    padding: 18px;
    align-items: flex-start;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .panels,
  .settings,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 330px;
  }

  textarea {
    min-height: 200px;
  }
}
