:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f1eee8;
  --ink: #181512;
  --muted: #675f57;
  --line: #d8d0c4;
  --line-strong: #bfb5a7;
  --rust: #a5482d;
  --green: #1f6656;
  --danger: #a33625;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 80px;
}

.page-header {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
  word-break: keep-all;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 5.8vw, 4.9rem);
  line-height: 1.04;
  font-weight: 850;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.05rem;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
  word-break: keep-all;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.input-panel,
.side-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.input-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

label,
.field label {
  color: var(--ink);
  font-weight: 800;
}

input[type="file"],
input[type="url"],
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
}

input[type="file"] {
  padding: 14px;
}

input[type="url"] {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 280px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 54%, white);
  outline-offset: 2px;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.rights-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 7%, white);
}

.rights-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.rights-check span {
  font-size: 0.96rem;
  line-height: 1.48;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: var(--radius);
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: var(--ink);
  color: #fffaf0;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
}

.text-button {
  color: var(--green);
  font-weight: 850;
  cursor: pointer;
}

.error-text {
  min-height: 22px;
  color: var(--danger);
  font-weight: 750;
  line-height: 1.45;
}

.side-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.steps li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.steps strong {
  color: var(--ink);
}

.steps span,
.legal-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  word-break: keep-all;
}

.legal-note {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.result-panel {
  display: grid;
  gap: 20px;
  margin-top: 20px;
  padding: 24px;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.status-line {
  color: var(--muted);
  font-weight: 800;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.22s ease;
}

.result-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.result-content {
  display: grid;
  gap: 22px;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audio-section,
.prompt-section {
  display: grid;
  gap: 10px;
}

audio {
  width: 100%;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

@media (max-width: 900px) {
  .workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: calc(100vw - 24px);
    padding-top: 24px;
  }

  .input-panel,
  .side-panel,
  .result-panel {
    padding: 18px;
  }

  .result-heading,
  .download-row {
    display: grid;
  }

  .secondary-button {
    width: 100%;
  }
}
