:root {
  --ground: #F4F6F8; --surface: #FFFFFF; --raised: #F8FAFC; --line: #DDE2E8; --ink: #14181D; --muted: #5A6472;
  --accent: #1F4FBF; --accent-ink: #1A43A3; --accent-soft: #E8EEFB; --pass: #136B45; --pass-soft: #E3F3EA;
  --fail: #A8321A; --fail-soft: #FBE7E1; --warn: #7A4E00; --warn-soft: #FFF1D6; --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 29, .06), 0 8px 24px rgba(20, 24, 29, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #12161B; --surface: #1A2027; --raised: #20272F; --line: #2C3540; --ink: #E7EBF0; --muted: #9AA5B2;
    --accent: #7FA2F0; --accent-ink: #A9C0F5; --accent-soft: #1E2A44; --pass: #6FCF9E; --pass-soft: #15301F;
    --fail: #F08C74; --fail-soft: #3A1F18; --warn: #F2C26B; --warn-soft: #3A2E14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; line-height: 1.25; }
h2 { font-size: 16px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; }
.mark::after { content: ''; position: absolute; left: 5px; right: 5px; top: 9px; height: 4px; border-radius: 2px; background: #fff; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; min-width: 0; }
.who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 16px; max-width: 920px; margin: 0 auto; }
@media (max-width: 640px) {
  .top { padding: 0 16px; }
  .who .email { display: none; }
  .content { padding: 16px 16px 48px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card.flush > .card-head { padding: 16px 16px 0; }
.card-head .grow { flex: 1; }
.narrow { max-width: 420px; width: 100%; margin: 32px auto 0; display: flex; flex-direction: column; gap: 14px; }
form { display: flex; flex-direction: column; gap: 12px; }
form.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
form.row .field { flex: 1 1 200px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-weight: 400; font-size: 12px; }
input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-width: 0; }
input[readonly] { background: var(--raised); color: var(--muted); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; font-weight: 550; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 9px 16px; cursor: pointer; white-space: nowrap; }
button:hover { background: var(--raised); }
button:disabled { opacity: .55; cursor: progress; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--fail); }
button.small { padding: 3px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td .btn-row { justify-content: flex-end; flex-wrap: nowrap; }
.links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; flex-wrap: wrap; }

.banner { padding: 10px 14px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); }
.banner.error { background: var(--fail-soft); color: var(--fail); border-color: transparent; }
.banner.ok { background: var(--pass-soft); color: var(--pass); border-color: transparent; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 600; word-break: break-word; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--raised); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.sub-line { color: var(--muted); font-size: 12px; }
.chip { display: inline-flex; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.chip.ok { background: var(--pass-soft); color: var(--pass); }
.chip.bad { background: var(--fail-soft); color: var(--fail); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.seats { font-size: 13px; color: var(--muted); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-weight: 550; }
.toast.bad { background: var(--fail); color: #fff; }
dialog.dlg { border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(10, 14, 20, .45); }
.dlg-body { display: flex; flex-direction: column; gap: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
