:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2b36;
  --muted: #5d6b76;
  --line: #d9d5cb;
  --primary: #1f5f7a;
  --primary-dark: #174a5f;
  --accent: #b5402f;
  --good: #1f7a4d;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4a00;
  --bad-bg: #fde8e4;
  --bad-ink: #8a2a1d;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
a { color: var(--primary); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 640px; margin: 28px auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

header.site { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding-top: 12px; padding-bottom: 12px; }
header.site .brand { display: block; line-height: 0; flex: 0 1 330px; min-width: 0; }
header.site .brand img { width: min(100%, 330px); height: auto; display: block; }
header.site .head-text { flex: 1 1 320px; min-width: 0; }
header.site h1 { margin: 0; font-size: 1.4rem; color: var(--primary-dark); }
header.site .meta { color: var(--muted); font-size: .95rem; }
header.site .meta a { white-space: nowrap; }
header.site .admin-bar { margin-left: auto; display: flex; gap: 10px; align-items: center; }
@media (max-width: 520px) { header.site h1 { font-size: 1.2rem; } }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.poster { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
header.masthead .wrap { align-items: flex-start; gap: 14px 28px; padding-top: 14px; padding-bottom: 16px; }
header.masthead .brand { flex: none; }
header.masthead .brand img { width: min(100%, 460px); }
header.masthead .mast-media { flex: 0 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
header.masthead .head-text { flex: 1 1 320px; }
header.masthead .evmeta { color: var(--ink); font-size: 1.12rem; font-weight: 600; margin-top: 4px; }
header.masthead .lead { margin: 12px 0; }
header.masthead .donate { margin-bottom: 0; }
@media (max-width: 760px) { header.masthead .mast-media { flex: 1 1 100%; } }
.donate { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 14px; background: #eef6f0; border-color: #b9d8c4; }
.donate p { margin: 0; flex: 1 1 260px; }
.donate .btn { flex: none; }
/* The Donate Now bar sits in the header on wide screens. On phones and narrow screens it moves under the seat map. */
.donate-below { display: none; margin: 12px 0 2px; }
@media (max-width: 920px) {
  header.masthead .donate { display: none; }
  .mapcard .donate-below { display: flex; }
}
.btn.give { background: var(--good); border-color: #145c38; color: #fff; }
.btn.give:hover { background: #17633f; }
.gift { border: 1px solid var(--line); border-radius: 10px; margin: 14px 0 0; padding: 10px 12px 12px; }
.gift legend { font-weight: 700; padding: 0 6px; }
.chip[aria-pressed=true] { background: var(--good); border-color: #0f4d2e; color: #fff; }

.banner { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #ecd48f; }
.banner.bad { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid #f0bdb4; }
.banner.good { background: #e3f4ea; color: #145c38; border: 1px solid #a9d9bd; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
@media (max-width: 920px) { .layout { grid-template-columns: 1fr; } }

.mapcard { padding: 10px; }
.seatmap { width: 100%; height: auto; display: block; background: #fbfaf7; border-radius: 8px; user-select: none; -webkit-tap-highlight-color: transparent; }
.seatmap .stage { fill: #cfd3d6; stroke: #a7adb2; stroke-width: 2; }
.seatmap .stage-label { fill: #5b6670; font-size: 14px; letter-spacing: .12em; }
.seatmap .table-body { fill: #d4d7da; stroke: #a9aeb3; stroke-width: 2; }
.seatmap .table-label { fill: #3a4752; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: #fbfaf7; stroke-width: 3.5px; stroke-linejoin: round; }
.seatmap .table-label.big { font-size: 20px; stroke: none; }
.seatmap .table-letter { fill: #3a4752; font-size: 28px; font-weight: 800; user-select: none; }
.seatmap .clickable { cursor: pointer; }
.seatmap .table-body.clickable:hover { fill: #c6cbd0; }
.seatmap .table-focus .table-body { stroke: var(--primary); stroke-width: 4; }
.seatmap .seat circle { stroke-width: 2; }
.seatmap .seat text { font-size: 11px; font-weight: 700; pointer-events: none; }
.seatmap .seat text.big { font-size: 17px; }
.seatmap .seat:focus { outline: none; }
.seatmap .seat:focus-visible circle { stroke: #000; stroke-width: 3.5; }
.seat-open circle { fill: #fff; stroke: #3d6b7d; }
.seat-open text { fill: #1d2b36; }
.seat-selected circle { fill: var(--good); stroke: #0f4d2e; }
.seat-selected text { fill: #fff; }
.seat-hold circle { fill: #f2c14e; stroke: #b88a12; }
.seat-hold text { fill: #3d2d00; }
.seat-sold circle { fill: #5a6672; stroke: #3b444c; }
.seat-sold text { fill: #fff; }
.seat-blocked circle { fill: #ebedef; stroke: #8b949c; stroke-dasharray: 3 2; }
.seat-blocked text { fill: #7b858d; }
.seat-mine circle { fill: #f0a500; stroke: #1d2b36; stroke-width: 3.5; }
.seat-mine text { fill: #1d2b36; }
.seat.clickable:hover circle { stroke-width: 3.5; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 4px 2px; font-size: .88rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 2px solid; }
.legend i.open { background: #fff; border-color: #3d6b7d; }
.legend i.selected { background: var(--good); border-color: #0f4d2e; }
.legend i.hold { background: #f2c14e; border-color: #b88a12; }
.legend i.sold { background: #5a6672; border-color: #3b444c; }
.legend i.blocked { background: #ebedef; border: 2px dashed #8b949c; }
.legend i.mine { background: #f0a500; border-color: #1d2b36; }

.side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 920px) { .side { position: static; } }
.side .card h2 { margin-bottom: 8px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; text-align: center;
}
.btn:hover { border-color: #aaa; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: #fff; color: var(--accent); border-color: #e0b5ad; }
.btn.big { padding: 13px 20px; font-size: 1.05rem; width: 100%; }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #7fb3c8; outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.chip { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; font-size: .9rem; }
.chip:hover { border-color: var(--primary); }
.soldout { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin: 2px 2px 10px; padding: 14px 12px; border-radius: 10px; background: var(--bad-bg); border: 2px solid #e3a99e; color: var(--bad-ink); }
.soldout strong { font-size: 2rem; letter-spacing: .08em; line-height: 1.1; }
.soldout span { font-size: .95rem; }
.soldout span:empty { display: none; }
.chip.chip-main { background: var(--primary); border-color: var(--primary-dark); color: #fff; font-weight: 600; }
.chip.chip-main:hover { background: var(--primary-dark); }
.tablepanel .tp-summary { margin: 8px 0 4px; font-weight: 600; }
.tablepanel .tp-summary:empty { display: none; }
.tablepanel .tp-hint { margin: 8px 0 0; }

.row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 1.1rem; }
.row .neg { color: var(--good); }
.stack > * + * { margin-top: 10px; }

label.field { display: block; font-weight: 600; margin-top: 10px; }
label.field span.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=datetime-local], input[type=time], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b8b4aa; border-radius: 8px; background: #fff; margin-top: 4px;
}
label.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-weight: 400; }
label.check input { margin-top: 5px; width: 18px; height: 18px; }

.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.tablepanel .detail { max-width: 300px; margin: 6px auto; }

/* order page */
.seatlist { list-style: none; padding: 0; margin: 8px 0; }
.seatlist li { padding: 4px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #e8ecef; }
.pill.paid { background: #dff3e7; color: #145c38; }
.pill.pending { background: var(--warn-bg); color: var(--warn-ink); }
.pill.refunded, .pill.partially_refunded, .pill.expired, .pill.cancelled { background: var(--bad-bg); color: var(--bad-ink); }

/* admin */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tabs button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; }
.tabs button[aria-selected=true] { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.5rem; }
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: #f1eee6; position: sticky; top: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bars div { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: .9rem; }
.bars .bar { height: 14px; background: var(--primary); border-radius: 3px; min-width: 2px; }

/* QR cards */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.qr-card { background: #fff; border: 1px dashed #9aa3aa; border-radius: 10px; padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; break-inside: avoid; page-break-inside: avoid; }
.qr-card .qr-logo { width: 92%; max-width: 300px; height: auto; }
.qr-card .qr-table { font-size: 2rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.qr-card .qr-img { width: 100%; max-width: 230px; height: auto; background: #fff; }
.qr-card .qr-say { font-weight: 700; font-size: 1.05rem; }
.qr-card .qr-thanks { color: var(--muted); font-size: .95rem; }
.qr-card .qr-url { color: var(--muted); font-size: .8rem; word-break: break-all; }
.qr-preview { margin: 8px 0; }
@media print {
  body.print-qr { background: #fff; }
  body.print-qr header.site, body.print-qr .tabs, body.print-qr #msg, body.print-qr .qr-screen { display: none !important; }
  body.print-qr .wrap { max-width: none; padding: 0; }
  body.print-qr .qr-sheet { grid-template-columns: repeat(2, 1fr); gap: .25in; margin: 0; }
  body.print-qr .qr-card { height: 4.6in; border: 1px dashed #777; border-radius: 0; justify-content: flex-start; gap: .07in; padding: .15in; overflow: hidden; }
  body.print-qr .qr-card .qr-logo { width: 3in; max-width: 90%; height: auto; }
  body.print-qr .qr-card .qr-table { font-size: 34pt; }
  body.print-qr .qr-card .qr-img { max-width: 2.25in; }
  body.print-qr .qr-card .qr-say { font-size: 13pt; }
  body.print-qr .qr-card .qr-thanks { display: none; }
  body.print-qr .qr-card .qr-url { font-size: 9pt; }
}
