:root {
  --bg: #faf7f2; --card: #fff; --ink: #1f1d1a; --muted: #6f6a62;
  --line: #e6e0d6; --accent: #7a4cc2; --accent-soft: #efe8fa; --warn: #b3541e; --ok: #2f7d4f; --ok-soft: #e3f3e8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17161a; --card: #211f25; --ink: #f1eee9; --muted: #a39d94;
    --line: #35323a; --accent: #b794f0; --accent-soft: #2e2738; --warn: #f0a070; --ok: #7fd3a0; --ok-soft: #1f3327; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 800px; margin: 0 auto; padding: 24px 16px 64px; }
nav { display: flex; gap: 16px; margin-bottom: 20px; font-size: .92rem; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.aviso { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.aviso code { word-break: break-all; }
label.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text] { width: 100%; padding: 10px 12px; font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[disabled] { opacity: .8; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.row-form { display: flex; gap: 8px; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 2px 4px; }

.total { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 12px; }
.total b { font-size: 1.4rem; color: var(--accent); }
ol.lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: n; }
li.row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; counter-increment: n; }
.line { display: grid; grid-template-columns: 26px 1fr 110px 90px; gap: 8px; align-items: center; }
.line > * { min-width: 0; }
.line::before { content: counter(n); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.box { height: 42px; border-radius: 10px; background: var(--accent-soft); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 700; text-align: center; padding: 0 6px; line-height: 1.1; }
.box small { font-weight: 500; font-size: .7rem; color: var(--muted); }
.box.pts { background: var(--ok-soft); color: var(--ok); }
.box.empty { color: var(--muted); font-weight: 400; }
.box.zero { background: var(--line); color: var(--muted); }
.picked { display: flex; gap: 8px; align-items: center; margin: 8px 0 0 34px; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.picked img, .opt img, .ph { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.picked .acoes { margin-left: auto; }
.opts { margin: 8px 0 0 34px; display: grid; gap: 6px; }
.opt { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.opt:hover, .opt:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.opt .t { flex: 1; min-width: 0; }
.opt .t b { display: block; }
.opt .t span { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .a { font-weight: 700; white-space: nowrap; font-size: .9rem; }
.picked .info { flex: 1; min-width: 0; }
.msg { margin: 8px 0 0 34px; color: var(--muted); font-size: .9rem; }
.msg.err { color: var(--warn); }
.foot { color: var(--muted); font-size: .88rem; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .line { grid-template-columns: 20px 1fr 74px 62px; gap: 6px; }
  .box { font-size: .9rem; }
  .picked, .opts, .msg { margin-left: 0; }
}
