:root { --maroon: #600617; --maroon-2: #7d1026; --gold: #826F41; --gold-soft: #f3ecdc; --ink: #1f1a1b; --muted: #6d6466;
         --line: #e4dcd6; --bg: #f7f3ee; --card: #fff; --ok: #1f6b3a; --okbg: #e6f3ea; --err: #a3172f; --errbg: #fbe7ea; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--maroon); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--maroon); line-height: 1.2; }
h1 { font-size: 26px; margin: 0 0 6px; } h2 { font-size: 19px; margin: 0 0 10px; }
.top { background: var(--maroon); color: #fff; display: flex; align-items: center; gap: 16px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { background: #fff; border-radius: 6px; padding: 2px; object-fit: contain; }
.brand b { font-size: 18px; display: block; line-height: 1.1; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #d8bf7e; font-weight: 600; display: block; }
.top nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.top nav a { color: #f3e7ea; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.top nav a:hover { background: rgba(255,255,255,.12); }
.top nav a.on { background: #fff; color: var(--maroon); font-weight: 600; }
.top nav .who { color: #d8bf7e; margin: 0 6px 0 10px; font-size: 13px; }
.top nav form { margin: 0; } .top nav .link { color: #f3e7ea; }
.wrap { max-width: 980px; margin: 22px auto; padding: 0 16px; } .wrap.wide { max-width: 1200px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card.narrow { max-width: 440px; margin: 30px auto; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.warn { color: var(--err); font-style: normal; }
.ok, .err { padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; }
.ok { background: var(--okbg); color: var(--ok); } .err { background: var(--errbg); color: var(--err); }
.remind { display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--gold-soft); border: 1px solid #e2d5b4; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; flex-wrap: wrap; }
.remind form { margin: 0; }

label { display: block; font-weight: 600; font-size: 14px; }
.opt { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid #cfc5bf; border-radius: 8px; background: #fff; margin-top: 4px; color: var(--ink); }
input:focus, select:focus { outline: 2px solid rgba(96,6,23,.25); border-color: var(--maroon); }
input[type=radio], input[type=checkbox] { width: auto; margin: 0 6px 0 0; accent-color: var(--maroon); }
input.tiny { width: 90px; display: inline-block; }
label.radio, label.check { font-weight: 400; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0; }
label.radio input:not([type=radio]) { width: auto; flex: 1; min-width: 160px; margin-top: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 10px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; color: var(--maroon); }
.stack > * + * { margin-top: 12px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 14px; }
.grid-form .span2 { grid-column: 1 / -1; }
.two-in { display: grid; grid-template-columns: 1fr 90px; gap: 10px; }
.inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.inline label { display: flex; align-items: center; gap: 8px; }
.inline label input:not([type=checkbox]) { margin-top: 0; width: auto; }
.inline > input { width: auto; flex: 1; min-width: 140px; margin-top: 0; }
.wrap-gap { gap: 12px 18px; align-items: center; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.head-row h1, .head-row h2 { margin: 0; }
.filters { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.filters input, .filters select { width: auto; flex: 1; min-width: 160px; margin: 0; }
.filters select { flex: 0 1 220px; }

.btn { display: inline-block; font: 600 14px "Segoe UI", Arial, sans-serif; padding: 9px 16px; border-radius: 8px; border: 1px solid #cdbfb5; background: #fff; color: var(--maroon); cursor: pointer; text-decoration: none; }
.btn:hover { background: #faf5f0; }
.btn.primary { background: var(--maroon); border-color: var(--maroon); color: #fff; } .btn.primary:hover { background: var(--maroon-2); }
.btn.big { padding: 13px 26px; font-size: 16px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--err); border-color: #e3b4bd; }
.link { background: none; border: 0; padding: 0; color: var(--maroon); text-decoration: underline; cursor: pointer; font: inherit; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats > div { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 12px 16px; }
.stats b { display: block; font: 700 26px Georgia, serif; color: var(--maroon); }
.stats span { color: var(--muted); font-size: 13px; }

.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px; }
.list td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.list td.num { font-weight: 700; font-family: Georgia, serif; color: var(--maroon); white-space: nowrap; }
.list tr.st-void td { color: #9b9294; } .list tr.st-void td.num { text-decoration: line-through; color: #9b9294; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #eee8e3; color: #5c5355; font-weight: 600; white-space: nowrap; }
.tag.issued { background: #e7eef9; color: #234a85; } .tag.void { background: var(--errbg); color: var(--err); } .tag.win { background: #f6e9c4; color: #6d5413; }
.row-actions details { position: relative; }
.row-actions summary { cursor: pointer; color: var(--maroon); font-size: 13px; list-style: none; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions summary::after { content: " ▾"; }
.pop { position: absolute; right: 0; top: 22px; z-index: 5; width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.pop form { margin: 0 0 10px; } .pop form:last-child { margin: 0; } .pop label { font-size: 13px; margin-bottom: 6px; }

.issued { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.issued-main { flex: 1; min-width: 260px; }
.issued-main h1 { font-size: 32px; }
.issued-qr { text-align: center; }
.qr { background: #fff; display: inline-block; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.qr svg { width: 200px; height: 200px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.chip { font: 700 22px Georgia, serif; color: var(--maroon); background: var(--gold-soft); border: 2px dashed var(--gold); border-radius: 8px; padding: 6px 14px; }
.chip.new { background: var(--maroon); color: #fff; border-style: solid; border-color: var(--maroon); }
.hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero > div { flex: 1; min-width: 260px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.danger-zone { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.danger-zone summary { cursor: pointer; color: var(--err); font-weight: 600; font-size: 14px; }
.copied { background: var(--okbg) !important; color: var(--ok) !important; }

/* ---- public ticket page (phone) */
body.wallet { background: linear-gradient(180deg, var(--maroon) 0, var(--maroon) 150px, var(--bg) 150px); min-height: 100vh; }
.wallet-top { display: flex; gap: 12px; align-items: center; color: #fff; padding: 18px 16px 10px; max-width: 520px; margin: 0 auto; }
.wallet-top img { background: #fff; border-radius: 6px; padding: 2px; }
.wallet-top b { font-size: 18px; }
.wallet-main { max-width: 520px; margin: 0 auto; padding: 0 16px 30px; }
.hello { color: #fff; margin: 4px 0 14px; font-size: 16px; }
.wticket { display: flex; background: #fffaf0; border-radius: 14px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.12); overflow: hidden; border: 2px solid var(--gold); }
.wstub { width: 112px; background: var(--maroon); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px; border-right: 3px dashed var(--gold); }
.wstub span { font-size: 12px; color: #d8bf7e; text-transform: uppercase; letter-spacing: .1em; }
.wstub b { font: 700 32px Georgia, serif; }
.wbody { padding: 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.wstate { font-weight: 600; color: var(--maroon); }
.wsmall { font-size: 13px; color: var(--muted); margin-top: 4px; }
.wwin { font: 700 24px Georgia, serif; color: #8a6510; }
.wticket.won { border-color: #d4a72c; box-shadow: 0 0 0 4px #f6e2a6, 0 6px 18px rgba(0,0,0,.15); }
.wticket.won .wstub { background: #8a6510; }
.wticket.void { opacity: .55; }
.share summary { cursor: pointer; font-weight: 600; color: var(--maroon); }
.share .qr { margin: 12px auto 0; display: block; width: max-content; }

@media (max-width: 680px) {
  .grid-form, .two { grid-template-columns: 1fr; }
  .top nav { margin-left: 0; }
  .issued-main h1 { font-size: 26px; }
  .qr svg { width: 170px; height: 170px; }
  .pop { width: 240px; }
}
@media print { .top, .foot, .actions, .remind { display: none; } body { background: #fff; } .card { border: 0; box-shadow: none; } }
form.mini { display: inline-block; margin: 0 6px 0 0; }
form.mini .link { text-decoration: none; padding: 0 3px; }
form.mini .link:disabled { opacity: .25; cursor: default; }
.btn.done { background: var(--okbg); color: var(--ok); border-color: #b9dcc4; }
.later-box { border-left: 5px solid var(--gold); }
.tag.later { background: #fff1d6; color: #7a5200; }
.list tr.st-taken td { color: #8b8183; }
.align-end { display: flex; align-items: flex-end; }
.list select { width: auto; max-width: 220px; margin: 0; padding: 6px 8px; }
.wprize { font-weight: 700; color: #6d5413; }
.wlater { margin-top: 6px; font-size: 14px; background: #fff1d6; color: #7a5200; padding: 6px 10px; border-radius: 8px; }
.quick { display: inline-flex; gap: 6px; margin-left: 6px; }
.pay { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid #e2d5b4; border-radius: 10px; padding: 10px 14px; font-size: 17px; }
.pay b { color: var(--maroon); font-size: 22px; font-family: Georgia, serif; }
.pay .check { font-weight: 600; font-size: 15px; }
.pay-line { font-size: 18px; margin: 10px 0 4px; }
.two-in.wide-first { grid-template-columns: 1fr 1fr; }
label.radio input.tiny { flex: 0 0 80px; min-width: 0; }

.dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .35em; vertical-align: baseline; border: 1px solid rgba(0,0,0,.25); }
.colour-pick { width: auto; margin-top: 0; flex: 0 0 auto; }
.colour-hint { margin: 0 0 4px 26px; }
