:root {
  color-scheme: dark;
  --bg: #0a110e;
  --surface: #101a15;
  --surface-2: #132019;
  --surface-3: #0c1511;
  --border: #263a30;
  --border-soft: #1a2a22;
  --text: #eef4f1;
  --muted: #91a49a;
  --muted-strong: #b6c4bd;
  --accent: #a7efc7;
  --accent-strong: #79d9a4;
  --accent-ink: #08140e;
  --danger: #ff9d9d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(104, 215, 155, 0.08), transparent 32rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
select,
label[for],
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.shell {
  width: min(100% - 40px, 650px);
  margin: 0 auto;
}

.site-header {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--accent-ink);
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 0 28px rgba(167, 239, 199, 0.12);
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.hero {
  padding: 36px 0 30px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #9dc2ae;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 7vw, 46px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.06;
}

.hero-copy {
  max-width: 590px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.55;
}

.stage {
  padding: 0 0 32px;
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stage-number {
  display: grid;
  width: 28px;
  height: 32px;
  place-items: center;
  color: #b4dac6;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.stage-meta {
  color: var(--muted);
  font-size: 12px;
}

.dropzone {
  display: flex;
  min-height: 300px;
  padding: 34px 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  border: 1px dashed #385244;
  border-radius: 17px;
  background: rgba(18, 31, 24, 0.82);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--accent-strong);
  background: #14251c;
  outline: none;
  transform: translateY(-2px);
}

.dropzone strong {
  font-size: 18px;
}

.dropzone > span:not(.outline-button) {
  color: var(--muted);
  line-height: 1.5;
}

.upload-icon {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.outline-button {
  padding: 12px 18px;
  color: var(--accent);
  border: 1px solid #385244;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.notice {
  padding-top: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.notice strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}

.notice p {
  margin-bottom: 0;
}

.source-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.source-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  border-radius: 10px;
  background: rgba(167, 239, 199, 0.08);
}

.file-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.source-copy {
  min-width: 0;
  flex: 1;
}

.source-copy strong,
.source-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-copy strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.source-copy span {
  color: var(--muted);
  font-size: 12px;
}

.source-card audio,
.result-card audio {
  width: 100%;
  height: 38px;
  margin-top: 16px;
  color-scheme: dark;
}

.icon-button,
.result-remove {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted-strong);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  font-size: 23px;
}

.icon-button:hover,
.result-remove:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.results-stage {
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
}

.section-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.results-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.result-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.result-copy {
  min-width: 0;
  flex: 1;
}

.result-copy strong,
.result-copy span {
  display: block;
}

.result-copy strong {
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy span {
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-button {
  display: inline-flex;
  padding: 9px 12px;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  border-radius: 8px;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.settings-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, #111c17, #0e1813);
  box-shadow: var(--shadow);
}

.settings-heading {
  margin-bottom: 24px;
}

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

.spaced-grid {
  margin-top: 24px;
}

.field {
  min-width: 0;
}

.full-field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 9px;
  color: #dce7e1;
  font-size: 13px;
}

input[type="number"],
select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid #2a4034;
  border-radius: 9px;
  outline: 0;
  background: #0a130f;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  cursor: pointer;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(121, 217, 164, 0.09);
}

.field-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  margin-top: 24px;
  padding: 20px 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.toggle-label,
.toggle-help {
  display: block;
}

.toggle-label {
  margin-bottom: 5px;
  font-size: 14px;
}

.toggle-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #263a30;
  transition: background 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #899d92;
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  background: var(--accent-ink);
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.estimate {
  display: flex;
  margin: 20px 0;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(4, 11, 7, 0.26);
  font-size: 12px;
}

.estimate strong {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.primary-button svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.primary-button:hover:not(:disabled) {
  background: #b8f7d2;
  transform: translateY(-1px);
}

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

.form-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-status.is-error {
  color: var(--danger);
}

.form-status.is-success {
  color: var(--accent);
}

.progress-wrap {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
}

.progress-label {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #213129;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 120ms linear;
}

.text-button {
  margin-top: 11px;
  padding: 0;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

footer {
  display: flex;
  padding: 34px 0;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 28px, 650px);
  }

  .site-header {
    padding-top: 14px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .hero {
    padding-top: 30px;
  }

  .dropzone {
    min-height: 255px;
  }

  .settings-card {
    padding: 18px 14px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid .field + .field {
    margin-top: 2px;
  }

  .estimate {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .estimate strong {
    text-align: left;
  }

  .result-top {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Light two-panel workspace inspired by the Multi Joiner reference. */
:root {
  color-scheme: light;
  --bg: #fffaf4;
  --surface: #ffffff;
  --surface-2: #fffdf9;
  --surface-3: #f7f2eb;
  --border: #d9d1c7;
  --border-soft: #ebe3da;
  --text: #292724;
  --muted: #82776d;
  --muted-strong: #625950;
  --accent: #ff9141;
  --accent-strong: #e8711d;
  --accent-ink: #2b1609;
  --danger: #b94c3e;
  --shadow: 0 18px 42px rgba(76, 50, 27, 0.08);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% -12%, rgba(255, 171, 100, 0.14), transparent 30rem),
    var(--bg);
}

.shell {
  width: min(calc(100% - 64px), 1240px);
  padding-bottom: 24px;
}

.site-header {
  padding: 42px 0 12px;
  border: 0;
}

.brand {
  display: inline-flex;
  gap: 0;
  color: var(--text);
  font-size: clamp(42px, 5.6vw, 70px);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.brand-word-looper {
  margin-left: 10px;
  color: var(--accent-strong);
  text-shadow: 0 2px 0 rgba(130, 58, 12, 0.08);
}

.brand-underline {
  display: block;
  width: 54px;
  height: 5px;
  margin-top: 20px;
  border-radius: 99px;
  background: var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 26px;
  align-items: start;
  margin-top: 34px;
}

.left-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 24px;
}

.stage,
.settings-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.source-panel {
  min-height: 620px;
}

.settings-panel {
  min-width: 0;
  background: var(--surface-2);
}

.stage-heading {
  margin-bottom: 24px;
}

.stage-title {
  gap: 12px;
}

.stage-title h2 {
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
}

.stage-number {
  width: 31px;
  height: 31px;
  color: var(--accent-strong);
  border-color: #e9b489;
  background: #fff7ef;
  font-weight: 700;
}

.stage-meta,
.format-badge {
  padding: 7px 10px;
  color: var(--accent-strong);
  border: 1px solid #ebc39f;
  border-radius: 7px;
  background: #fff8f0;
  font-size: 11px;
  font-weight: 700;
}

.format-badge {
  margin-left: auto;
}

.dropzone {
  min-height: 326px;
  border-color: #cdb9a5;
  border-radius: 15px;
  background: #fffdf9;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: #fff6ec;
  box-shadow: 0 10px 30px rgba(229, 120, 36, 0.08);
}

.dropzone strong {
  color: var(--text);
  font-size: 19px;
}

.dropzone > span:not(.outline-button) {
  color: var(--muted);
}

.upload-icon {
  stroke: var(--accent);
}

.outline-button {
  color: var(--accent-ink);
  border-color: #e4a875;
  background: #fff8ef;
}

.notice {
  margin-top: 28px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border-soft);
}

.notice strong {
  color: var(--muted-strong);
  font-weight: 700;
}

.notice p,
.section-copy,
.empty-state,
.field-help,
.toggle-help,
.form-status {
  color: var(--muted);
}

.source-card,
.result-card {
  border-color: var(--border);
  background: #fffaf5;
  box-shadow: none;
}

.file-icon {
  color: var(--accent-strong);
  background: #fff0e2;
}

.icon-button,
.result-remove {
  color: var(--muted);
}

.results-stage {
  padding-top: 28px;
  border-top: 0;
}

.settings-heading {
  margin-bottom: 26px;
}

.field label {
  color: var(--muted-strong);
  font-weight: 600;
}

input[type="number"],
select {
  height: 47px;
  color: var(--text);
  border-color: #d5c9bd;
  background: #fff;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 145, 65, 0.13);
}

.toggle-row {
  border-color: var(--border-soft);
}

.toggle-label {
  color: var(--text);
  font-weight: 600;
}

.switch-track {
  background: #d9cec3;
}

.switch-track::after {
  background: #fff;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  background: #fff;
}

.estimate {
  color: var(--muted);
  border-color: var(--border-soft);
  background: #fffaf5;
}

.estimate strong {
  color: var(--text);
}

.progress-wrap {
  border-color: var(--border);
  background: #fffaf5;
}

.progress-track {
  background: #eadfd4;
}

.progress-track span {
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}

.primary-button {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(224, 111, 27, 0.16);
}

.primary-button:hover:not(:disabled) {
  background: #ff9d57;
}

footer {
  margin-top: 32px;
  color: var(--muted);
  border-color: var(--border-soft);
}

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

  .settings-panel {
    order: -1;
  }

  .source-panel {
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(calc(100% - 28px), 650px);
  }

  .site-header {
    padding-top: 28px;
  }

  .brand {
    font-size: 45px;
  }

  .workspace {
    gap: 18px;
    margin-top: 26px;
  }

  .stage,
  .settings-card {
    padding: 18px 15px;
  }

  .dropzone {
    min-height: 265px;
  }
}
