:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --ink: #161616;
  --muted: #60605c;
  --line: #d9d8d2;
  --accent: #f45f65;
  --accent-dark: #b5333b;
  --panel: #ffffff;
  --ok: #16754f;
  --warn: #a75d00;
  --bad: #b3261e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 95, 101, 0.08), transparent 240px),
    var(--bg);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

.tool {
  display: grid;
  gap: 16px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 14px;
}

.brand {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(18px, 3vw, 31px);
  line-height: 1.05;
  letter-spacing: 0;
}

.note {
  max-width: 280px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.drop-zone {
  min-height: 132px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 20px;
  border: 2px dashed #aaa79e;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
  text-align: left;
  padding: 18px 22px;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff;
}

.drop-zone:focus-within {
  outline: 3px solid rgba(244, 95, 101, 0.28);
  outline-offset: 4px;
}

#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
}

.drop-text {
  display: grid;
  gap: 6px;
}

.drop-title {
  font-size: 22px;
  font-weight: 720;
}

.drop-copy {
  display: block;
  color: var(--muted);
  font-size: 16px;
}

.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 16px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  color: var(--muted);
}

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

.meter {
  height: 8px;
  margin: 10px 0 0;
  border-radius: 999px;
  background: #eeeeea;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.details {
  display: none;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.download {
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  align-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 0 18px;
  font-weight: 720;
}

.download.secondary {
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
}

.message {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.message.ok {
  color: var(--ok);
}

.message.warn {
  color: var(--warn);
}

.message.bad {
  color: var(--bad);
}

@media (max-width: 700px) {
  .shell {
    width: min(100vw - 24px, 940px);
    padding: 28px 0;
  }

  .masthead {
    display: grid;
    align-items: start;
  }

  .note {
    max-width: none;
  }

  .drop-zone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: 190px;
  }

  .details {
    display: none;
  }
}
