:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5f6673;
  --line: #d5d9e0;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --error: #c62828;
  --good: #1b7f4b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1b1e24;
    --ink: #eceef2;
    --muted: #a0a7b4;
    --line: #333844;
    --accent: #5b8ff7;
    --error: #ff6b6b;
    --good: #4cc38a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 2rem; margin: 0 0 8px; }
h2 { font-size: 1.6rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 28px; font-size: 1.1rem; }

.field { display: block; margin-bottom: 20px; }
.label { display: block; font-weight: 600; margin-bottom: 8px; }
.label em { font-weight: 400; color: var(--muted); font-style: normal; }
.hint { display: block; margin-top: 6px; font-size: 0.9rem; color: var(--muted); }
.hint.bad { color: var(--error); }
.count { text-align: right; }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 56px;
  transition: border-color 0.15s;
}
textarea { resize: vertical; min-height: 110px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--error); }

.entries { list-style: none; margin: 8px 0 0; padding: 0; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px 4px; margin-bottom: 16px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.entry-no { font-weight: 700; color: var(--muted); }
.remove { background: none; border: none; color: var(--muted); font: inherit; font-size: 0.95rem; cursor: pointer; padding: 8px; }
.remove:hover { color: var(--error); }

button { font: inherit; cursor: pointer; border-radius: 12px; }
.primary, .secondary { display: block; width: 100%; min-height: 60px; font-size: 1.2rem; font-weight: 700; }
.primary { background: var(--accent); color: var(--accent-ink); border: none; margin-top: 8px; }
.primary:disabled { opacity: 0.6; cursor: wait; }
.secondary { background: transparent; color: var(--accent); border: 2px dashed var(--line); margin-bottom: 24px; }
.secondary:hover { border-color: var(--accent); }

.error { color: var(--error); font-weight: 600; margin: 0 0 8px; }
.privacy { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
.thanks { text-align: center; padding-top: 48px; }
.thanks p { color: var(--muted); margin-bottom: 24px; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* searchable picker */
.combo { position: relative; }
.combo .who { padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.combo-list {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.25);
}
.combo-list li { padding: 12px 14px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1.3; }
.combo-list li small { display: block; color: var(--muted); font-size: 0.9rem; }
.combo-list li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.combo-list li.sep { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; }
.combo-list .empty { color: var(--muted); cursor: default; }
