:root {
  --paper: #F7F9FA;
  --card: #FFFFFF;
  --ink: #17242E;
  --ink-soft: #44545F;
  --steel: #5D6E7C;
  --line: #DCE4E9;
  --accent: #0E7C66;
  --accent-dark: #0A6152;
  --accent-soft: #E3F1ED;
  --danger: #B3372F;
  --danger-soft: #F9E9E7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.card {
  width: 100%;
  max-width: 34rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(23, 36, 46, 0.06);
  padding: 2.25rem 2.25rem 2rem;
}

.brand {
  display: block;
  width: 150px;
  height: auto;
  margin: -0.75rem 0 0.5rem -0.6rem; /* the PNG carries its own whitespace */
}

h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  text-wrap: balance;
}
.sub { color: var(--steel); font-size: 0.9rem; margin: 0 0 1.5rem; }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.field { flex: 1 1 12rem; display: flex; flex-direction: column; gap: 0.25rem; }
.field span {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--steel);
}
.field input {
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.55rem 0.75rem;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field.invalid input { border-color: var(--danger); background: var(--danger-soft); }
.field .hint { color: var(--danger); font-size: 0.75rem; }
.todo { color: var(--steel); font-size: 0.78rem; text-align: center; margin: 0.6rem 0 0; min-height: 1em; }

.drop {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.drop:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop.hover { background: var(--accent-soft); border-color: var(--accent); }
.drop strong { color: var(--accent); }
.drop .link { color: var(--accent); text-decoration: underline; }
.drop small { display: block; color: var(--steel); font-size: 0.75rem; margin-top: 0.3rem; }

.files { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.files li {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.83rem; color: var(--ink-soft);
  padding: 0.4rem 0;
}
.files .fname {
  flex: 0 1 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.files .fsize { font-variant-numeric: tabular-nums; color: var(--steel); font-size: 0.75rem; white-space: nowrap; }
.files .bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--line); overflow: hidden; position: relative;
}
.files .bar i {
  position: absolute; inset: 0; width: 0%;
  background: var(--accent); border-radius: 3px; display: block;
  transition: width 0.2s;
}
.files li.failed .bar i { background: var(--danger); }
.files .pct { font-variant-numeric: tabular-nums; font-size: 0.72rem; color: var(--steel); min-width: 3em; text-align: right; }
.files .rm {
  border: none; background: none; color: var(--steel); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 0.2rem;
}
.files .rm:hover { color: var(--danger); }
.files li.oversize .fname { color: var(--danger); }

.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.84rem; color: var(--ink-soft); margin: 0.75rem 0 1rem; }
.consent input { margin-top: 0.2rem; accent-color: var(--accent); width: 1rem; height: 1rem; flex: none; }
.consent a { color: var(--accent); }

.btn {
  font: inherit; font-weight: 600; font-size: 0.92rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  width: 100%;
}
.btn:hover:not(:disabled) { background: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.ghost { background: none; color: var(--accent); border: 1px solid var(--accent); width: auto; }

.error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: 8px; padding: 0.6rem 0.9rem;
  font-size: 0.84rem; margin: 0 0 1rem;
}

.done { text-align: center; padding: 1rem 0 0.5rem; }
.done-mark {
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 1.5rem; line-height: 3rem; margin: 0 auto 0.75rem;
}
.done h2 { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.3rem; margin: 0 0 0.5rem; }
.done code {
  font-family: ui-monospace, monospace; font-size: 1rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.15rem 0.5rem; letter-spacing: 0.08em;
}


dialog {
  border: 1px solid var(--line); border-radius: 12px;
  max-width: 40rem; width: calc(100vw - 2rem);
  max-height: 80vh;
  padding: 0;
  background: var(--card); color: var(--ink);
}
dialog::backdrop { background: rgba(23, 36, 46, 0.45); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.1rem; margin: 0; }
.close { border: none; background: none; font-size: 1.5rem; color: var(--steel); cursor: pointer; line-height: 1; }
.modal-body {
  padding: 1.25rem 1.5rem; overflow-y: auto; max-height: calc(80vh - 4rem);
  font-size: 0.88rem; color: var(--ink-soft); white-space: pre-wrap;
}

@media (max-width: 480px) {
  .card { padding: 1.5rem 1.25rem; }
}
