:root { --bg: #f6f5f2; --card: #ffffff; --ink: #1c1b19; --dim: #6b6862; --line: #d9d6cf; --accent: #1f5fbf; --on-accent: #ffffff; --bad: #b3261e; --good: #1d6b3a; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151618; --card: #1f2124; --ink: #ecebe7; --dim: #a09d96; --line: #383b40; --accent: #7fb0ff; --on-accent: #0c1524; --bad: #ff8a80; --good: #7fd49b; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 520px; margin: 0 auto; padding: 28px 16px 48px; }
h1 { font-size: 1.5rem; margin: 0 0 20px; letter-spacing: -0.01em; }
label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 0.95rem; }
.dim { color: var(--dim); font-weight: 400; }
input, select, button { font: inherit; color: inherit; }
input, select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-height: 48px; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button { min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button:disabled { opacity: 0.55; cursor: default; }
button.link { border: 0; background: none; color: var(--dim); text-decoration: underline; min-height: 44px; padding: 0 4px; }
#gate button, #sent button { margin-top: 14px; }
.row { display: flex; gap: 8px; margin-top: 0; }
.row input { flex: 1; min-width: 0; }
#details .row { margin-top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#matches { margin-top: 12px; display: grid; gap: 8px; }
.match { display: block; width: 100%; text-align: left; padding: 10px 14px; height: auto; }
.match .t { display: block; font-weight: 600; overflow-wrap: anywhere; }
.match .s { display: block; color: var(--dim); font-size: 0.9rem; overflow-wrap: anywhere; }
.match .have { display: inline-block; margin-top: 4px; font-size: 0.8rem; color: var(--good); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; }
/* "Send as typed": a real button, clearly different from the match rows above it */
button.typed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; width: 100%; margin-top: 6px;
  padding: 12px 14px; min-height: 52px; height: auto; text-align: left; border: 2px solid var(--accent); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
button.typed .t { color: var(--dim); font-size: 0.9rem; }
button.typed .go { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
button.typed:hover, button.typed:active { background: var(--accent); }
button.typed:hover .t, button.typed:hover .go, button.typed:active .t, button.typed:active .go { color: var(--on-accent); }
.picked { font-weight: 600; margin: 18px 0 0; overflow-wrap: anywhere; }
.big { font-size: 1.4rem; font-weight: 600; margin: 8px 0; }
#msg { min-height: 1.5em; margin: 16px 0 0; color: var(--dim); }
#msg.bad { color: var(--bad); }
.foot { margin-top: 28px; }
#mine { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
#mine h2 { font-size: 1.05rem; margin: 0 0 8px; }
#minelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#minelist li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
#minelist .t { font-weight: 600; overflow-wrap: anywhere; }
#minelist .s { grid-column: 1; color: var(--dim); font-size: 0.85rem; }
#minelist .st { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--dim); font-size: 0.9rem; white-space: nowrap; }
#minelist li.done .st { color: var(--good); font-weight: 600; }
