:root {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: #fffdf8;
  --ink: #1f1a14;
  --muted: #6d6256;
  --line: #d9cfc0;
  --accent: #9a3412;
  --accent-soft: #fff1e8;
  --success: #166534;
  --danger: #b91c1c;
  --shadow: 0 18px 50px rgba(31, 26, 20, 0.08);
  --radius: 18px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(154, 52, 18, 0.08), transparent 28rem),
    linear-gradient(180deg, #efe7da 0%, var(--bg) 40%, #f8f4ec 100%);
  color: var(--ink);
}

.page {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.15rem;
  box-shadow: 0 10px 28px rgba(154, 52, 18, 0.22);
  overflow: hidden;
}

.logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-text {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font: 600 0.78rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.lede,
.hint,
.footer p {
  color: var(--muted);
  line-height: 1.6;
}

.lede {
  max-width: 42rem;
  margin: 0.8rem 0 0;
  font-size: 1.05rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(31, 26, 20, 0.08);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.controls,
.dropzone,
.queue-section,
.progress-section,
.actions,
.results-section {
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  max-width: 16rem;
  font: 500 0.92rem/1.3 ui-sans-serif, system-ui, sans-serif;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.hint {
  margin: 0.55rem 0 0;
  font: 0.9rem/1.5 ui-sans-serif, system-ui, sans-serif;
}

.dropzone {
  border: 2px dashed #c8b8a4;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf3, #f8f1e7);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.dropzone-inner {
  padding: 2.4rem 1rem;
  text-align: center;
}

.drop-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.drop-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font: 0.95rem/1.5 ui-sans-serif, system-ui, sans-serif;
}

.queue-header,
.progress-meta,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.file-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: 0.92rem/1.4 ui-sans-serif, system-ui, sans-serif;
}

.file-meta {
  min-width: 0;
}

.file-name {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 0.84rem;
}

.file-status {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-status.done {
  color: var(--success);
}

.progress-track {
  margin-top: 0.55rem;
  height: 10px;
  border-radius: 999px;
  background: #eadfce;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c2410c, #ea580c);
  transition: width 0.2s ease;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font: 600 0.92rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

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

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

.button-secondary {
  background: #efe4d7;
  color: var(--ink);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  padding-inline: 0.4rem;
}

.results-section {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
}

.result-card + .result-card {
  margin-top: 0.8rem;
}

.result-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.result-parts {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font: 0.9rem/1.6 ui-sans-serif, system-ui, sans-serif;
}

.result-part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid #f0e7da;
}

.result-part:first-child {
  border-top: 0;
  padding-top: 0;
}

.button-small {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.error {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fef2f2;
  color: var(--danger);
  font: 0.92rem/1.5 ui-sans-serif, system-ui, sans-serif;
}

.hidden {
  display: none !important;
}

.footer {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.85rem;
}

.footer-note,
.footer p {
  margin: 0;
  color: var(--muted);
  font: 0.88rem/1.6 ui-sans-serif, system-ui, sans-serif;
}

.credit {
  margin: 0;
  color: var(--ink);
  font: 500 0.92rem/1.6 ui-sans-serif, system-ui, sans-serif;
}

.credit a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(154, 52, 18, 0.35);
}

.credit a:hover,
.credit a:focus-visible {
  border-bottom-color: var(--accent);
}

.partner-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.partner-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e4d9c8;
  border-radius: 12px;
  padding: 0.35rem 0.45rem;
  line-height: 0;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.partner-logo:hover,
.partner-logo:focus-visible {
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(31, 26, 20, 0.06);
  outline: none;
}

.partner-logo img {
  display: block;
  width: auto;
  height: 2.75rem;
  max-width: min(100%, 28rem);
  object-fit: contain;
  border-radius: 4px;
}

.partner-logo-humanum img {
  height: 2.6rem;
}

@media (max-width: 640px) {
  .page {
    width: min(100%, calc(100% - 1rem));
    padding-top: 1.2rem;
  }

  .brand {
    gap: 0.85rem;
  }

  .logo {
    width: 3.6rem;
    height: 3.6rem;
  }

  .panel {
    padding: 1rem;
  }

  .actions,
  .queue-header {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .partner-logo img {
    height: 2.25rem;
    max-width: 100%;
  }

  .partner-logo-humanum img {
    height: 2.1rem;
  }

  .partner-logo {
    padding: 0.3rem 0.4rem;
    border-radius: 10px;
  }
}
