:root {
  --bg: #f4f2ee; --card: #fff; --text: #1f1d1a; --muted: #6b665e; --line: #e2ddd4;
  --accent: #b5302a; --accent-text: #fff;
  --gold: #b8860b; --gold-bg: #fbf1d6; --silver: #6d7480; --silver-bg: #eceef1;
  --ok: #1d6b3a; --ok-bg: #e3f3e8; --err: #9b1c1c; --err-bg: #fbe5e5; --note-bg: #fff6dc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614; --card: #22201d; --text: #ece8e1; --muted: #a39d93; --line: #3a3732;
    --accent: #e0574f; --gold: #e2b33c; --gold-bg: #3a2f12; --silver: #b9c0ca; --silver-bg: #2d3036;
    --ok: #7fd49c; --ok-bg: #173323; --err: #f39b9b; --err-bg: #3d1a1a; --note-bg: #352d16;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
a { color: var(--accent); }
header.site { padding: 8px 0 20px; }
header.site a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
header.site span { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card > :first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 4px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled, textarea:disabled { opacity: .7; }
textarea { resize: vertical; }
button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px;
  padding: 10px 18px; background: var(--accent); color: var(--accent-text); margin-top: 16px; }
button.link { background: none; color: var(--muted); padding: 0; margin: 0; font-weight: 400; text-decoration: underline; }
button.danger { background: none; color: var(--err); border: 1px solid currentColor; }
.code-form input { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; letter-spacing: .08em; text-transform: uppercase; }
.hint { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
.counter.over { color: var(--err); font-weight: 600; }
.perks { margin: 0; padding-left: 20px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.badge.gold { color: var(--gold); background: var(--gold-bg); }
.badge.silver { color: var(--silver); background: var(--silver-bg); }
.flash, .notice { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.notice { background: var(--note-bg); }
.logout { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row button { margin-top: 0; }
.event-pick { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-top: 12px; }
.event-id { display: flex; gap: 8px; }
.event-id input { width: 8.5em; }
.event-id button { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 0 12px; }
.grid-create { display: grid; grid-template-columns: 2fr 1fr; gap: 8px 12px; }
.grid-create input[name=note] { grid-column: 1 / -1; }
.grid-create button { margin-top: 0; grid-column: 1 / -1; justify-self: start; }
code.code { font-size: 1.05rem; font-weight: 700; }
.voucher .row:last-child { margin-top: 16px; }
body.admin main { max-width: 900px; }
body.embed main { max-width: none; padding: 16px; }
body.embed .card { margin-bottom: 0; }
.quick-add { display: grid; grid-template-columns: 2fr 2fr auto; gap: 8px; margin: 16px 0 8px; }
.quick-add button { margin-top: 0; }
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table.vouchers { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.vouchers th, table.vouchers td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
table.vouchers th:first-child, table.vouchers td:first-child { padding-left: 20px; }
table.vouchers th { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.vouchers td:nth-child(2) { white-space: normal; }
table.vouchers td.code { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; }
table.vouchers tbody tr { cursor: pointer; }
table.vouchers tbody tr:hover { background: var(--bg); }
table.vouchers a { color: var(--text); font-weight: 600; text-decoration: none; }
dialog { width: min(640px, calc(100vw - 32px)); height: min(88vh, 820px); padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); }
dialog iframe { flex: 1; width: 100%; border: 0; }
@media (max-width: 480px) {
  .grid-2, .grid-create, .event-pick, .quick-add { grid-template-columns: 1fr; }
  .quick-add button { justify-self: start; }
}
.next-event { overflow: hidden; }
.event-image { display: block; width: calc(100% + 40px); max-width: none; height: auto; margin: -20px -20px 16px; }
a.button { display: inline-block; font-weight: 600; text-decoration: none; border-radius: 8px;
  padding: 10px 18px; background: var(--accent); color: var(--accent-text); margin-top: 8px; }
.steps, .packages { padding-left: 20px; }
.steps li, .packages li { margin-bottom: 8px; }
details.settings summary { cursor: pointer; font-weight: 600; }
details.settings[open] summary { margin-bottom: 4px; }
.weiter-card { text-align: center; }
button.weiter { width: 100%; margin: 0; padding: 18px; font-size: 1.6rem; font-weight: 800; letter-spacing: .02em;
  transition: background-color .2s, transform .1s; }
button.weiter:active { transform: scale(.98); }
button.weiter.sent { background: var(--ok); cursor: default; }
.weiter-admin { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; }
.weiter-admin button { margin-top: 0; }
