:root {
  color-scheme: light dark;
  --bg: #f6f5f3;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #6c6862;
  --line: #dedbd5;
  --accent: #8a4b2a;
  --accent-ink: #ffffff;
  --bad-bg: #fbeceb;
  --bad-ink: #8a2b22;
  --ok-bg: #edf5ee;
  --ok-ink: #2c5c38;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --card: #201f1c;
    --ink: #eceae6;
    --muted: #9c968c;
    --line: #35332e;
    --accent: #d08a5f;
    --accent-ink: #201f1c;
    --bad-bg: #3a201d;
    --bad-ink: #f0a99f;
    --ok-bg: #1d2f22;
    --ok-ink: #9ed4ac;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 3rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 40rem; margin: 0 auto; }

h1 { margin: 0 0 .3rem; font-size: 1.5rem; letter-spacing: -.02em; }
.lede { margin: 0 0 2rem; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}

label { display: block; font-weight: 600; font-size: .8rem;
        letter-spacing: .02em; margin-bottom: .35rem; }

input[type=text], input[type=password], input[type=number] {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
}

input:focus-visible, button:focus-visible, .drop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: .65rem 1.3rem;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button:disabled { opacity: .55; cursor: default; }

/* Drop zone --------------------------------------------------------- */

.drop {
  display: block;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}

.drop:hover, .drop.over { border-color: var(--accent); background: var(--bg); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { display: block; font-size: 1rem; }
.drop span { color: var(--muted); font-size: .85rem; }

/* Options ----------------------------------------------------------- */

details { margin: 1.25rem 0; }
summary { cursor: pointer; color: var(--muted); font-size: .875rem; }
summary::marker { color: var(--line); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 400; font-size: .9rem; }

.actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }

/* Messages ---------------------------------------------------------- */

.msg { margin-top: 1rem; padding: .7rem .9rem; border-radius: 7px;
       font-size: .9rem; }
.msg.bad { background: var(--bad-bg); color: var(--bad-ink); }
.msg.ok  { background: var(--ok-bg);  color: var(--ok-ink); }
.msg:empty { display: none; }

footer { margin-top: 2rem; color: var(--muted); font-size: .8rem; }
footer a { color: inherit; }
footer form { display: inline; }
footer button {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 400;
  color: inherit; text-decoration: underline; cursor: pointer;
}
