:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #151922;
  --muted: #667085;
  --line: #d7deea;
  --panel: #ffffff;
  --panel-strong: #ecf2ff;
  --brand: #1769ff;
  --brand-dark: #0d47b8;
  --green: #0f9f6e;
  --red: #c93434;
  --shadow: 0 18px 70px rgba(27, 40, 70, 0.12);
}

* {
  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;
  background:
    linear-gradient(135deg, rgba(23, 105, 255, 0.10), rgba(15, 159, 110, 0.07)),
    var(--bg);
  color: var(--ink);
}

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

.site-header {
  display: flex;
  align-items: center;
  min-height: 76px;
  margin-bottom: 28px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  width: min(184px, 50vw);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}

.hero-copy {
  max-width: 780px;
}

.panel-kicker {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.96;
}

.lede {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: start;
}

.upload-panel,
.result-panel {
  min-width: 0;
  border: 1px solid rgba(215, 222, 234, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 300px;
  padding: 28px;
  border: 2px dashed #aebbd0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--panel-strong));
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--brand);
  transform: translateY(-1px);
  background: #f7faff;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
}

.drop-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.drop-subtitle,
.selected-file,
.error-text,
#jobMessage,
#queuePosition {
  color: var(--muted);
}

.selected-file {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
}

.platform-field {
  margin-top: 14px;
}

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

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

.field span,
.target-header label {
  color: #344054;
  font-size: 0.88rem;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  padding: 0 12px;
}

.advanced-options {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.advanced-options summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 850;
}

.advanced-options summary::marker {
  color: var(--brand);
}

.advanced-options summary small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.target-control {
  display: grid;
  gap: 12px;
  padding: 0 14px 16px;
}

.target-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

#targetLabel {
  color: var(--brand-dark);
  font-weight: 850;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

input[type="range"]:disabled {
  opacity: 0.55;
}

.primary-button,
.download-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover,
.download-button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  background: #98a2b3;
  cursor: wait;
  transform: none;
}

.error-text {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--red);
  font-weight: 700;
}

.warning-text {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #f2d08b;
  border-radius: 8px;
  background: #fff8e8;
  color: #815b0d;
  font-weight: 750;
  line-height: 1.45;
}

.result-panel {
  min-height: 424px;
  padding: 22px;
}

.empty-state {
  display: grid;
  min-height: 360px;
  align-content: center;
}

.empty-state h2,
.job-state h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e9efff;
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-badge.done {
  background: #e8f8f1;
  color: var(--green);
}

.status-badge.failed {
  background: #ffefef;
  color: var(--red);
}

.progress-bar {
  height: 10px;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.progress-bar span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--green));
  transition: width 220ms ease;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.metrics div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.metrics dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 850;
}

@media (max-width: 860px) {
  .shell {
    width: min(calc(100% - 24px), 640px);
    padding: 28px 0;
  }

  .site-header {
    min-height: 68px;
    margin-bottom: 24px;
  }

  .brand-logo {
    width: min(170px, 56vw);
  }

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

  .drop-zone {
    min-height: 230px;
  }
}

@media (max-width: 520px) {
  h1 {
    max-width: 340px;
    font-size: 1.9rem;
    line-height: 1.08;
  }

  .lede {
    max-width: 340px;
    font-size: 0.95rem;
  }

  .drop-zone {
    padding: 24px 16px;
  }

  .drop-title {
    max-width: 100%;
    font-size: 1.1rem;
  }

  .stats-strip,
  .status-row,
  .options-grid,
  .metrics {
    display: grid;
    grid-template-columns: 1fr;
  }

  .target-header {
    display: grid;
  }

  #targetLabel {
    text-align: left;
  }
}
