:root {
  color-scheme: light dark;
  --ground: #f1f4f3;
  --ink: #11181b;
  --dim: #5b676e;
  --line: #d5dcdb;
  --line-strong: #b4c0bf;
  --accent: #1f5f6b;
  --accent-ink: #ffffff;
  --accent-soft: #e1eeef;
  --good: #256a4a;
  --bad: #9a3b34;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1416;
    --ink: #e8eded;
    --dim: #8e9ca2;
    --line: #2a3438;
    --line-strong: #3d4a4f;
    --accent: #6fb3bf;
    --accent-ink: #0b1a1d;
    --accent-soft: #15303a;
    --good: #7ec49e;
    --bad: #e58f87;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: clamp(28px, 9vh, 104px) 20px 48px;
  display: grid;
  justify-items: center;
  align-content: start;
}

main { width: 100%; max-width: 34rem; }

h1 {
  margin: 0 0 1.9rem;
  font-size: clamp(1.7rem, 5.5vw, 2.15rem);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

/* The drop zone is the page's one real object, so it carries the weight. */
.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 2.2rem 1.25rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop.locked { opacity: 0.55; pointer-events: none; }

/* Visually hidden but still focusable, so the zone works from the keyboard. */
.drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  overflow: hidden;
}

.icon { color: var(--accent); margin-block-end: 0.35rem; }
.drop-title { font-weight: 600; overflow-wrap: anywhere; }
.drop.has-file .drop-title { font-family: var(--mono); font-size: 0.92rem; font-weight: 500; }
.drop-hint { color: var(--dim); font-size: 0.9rem; max-width: 36ch; }
.drop.has-file .drop-hint { font-family: var(--mono); font-size: 0.82rem; }

.field { margin-top: 1.25rem; display: grid; gap: 0.35rem; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input {
  font: inherit;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.field input::placeholder { color: var(--dim); opacity: 0.8; }
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
button {
  font: inherit;
  font-weight: 600;
  min-height: 48px;
  padding: 0 1.6rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: not-allowed; background: transparent; color: var(--dim); border-color: var(--line); }
button.quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 30rem) { .actions button { flex: 1; } }

/* Ten ticks along the bar, so progress reads as distance covered. */
.progress { margin-top: 1.4rem; }
.track {
  position: relative;
  block-size: 8px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.fill { block-size: 100%; inline-size: 0; background: var(--accent); transition: inline-size 0.2s linear; }
.track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--ground) calc(10% - 1px) 10%);
}
.meter { margin: 0.55rem 0 0; font: 0.82rem/1.4 var(--mono); color: var(--dim); }

.status { min-height: 1.6em; margin: 1.1rem 0 0; }
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }

.fine { margin: 2.2rem 0 0; color: var(--dim); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  .drop, .fill { transition: none; }
}
