:root {
    --green-950: #0b261d;
    --green-800: #164c39;
    --green-600: #24805e;
    --green-100: #e9f5ef;
    --cream: #f7f4ec;
    --ink: #17211d;
    --muted: #68736e;
    --line: #dfe5e1;
    --red: #b42318;
    --red-soft: #fef0ed;
    --shadow: 0 20px 50px rgba(20, 51, 40, .11);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: radial-gradient(circle at 10% 0%, #e5f1e9 0, transparent 35%), var(--cream);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px clamp(20px, 5vw, 70px); background: var(--green-950); color: white; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #65947f; border-radius: 14px; color: #d7b967; font: 700 24px Georgia, serif; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(18px, 3vw, 24px); }
.eyebrow { margin: 0; color: #a9c2b6; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.accent { color: var(--green-600); }
.shell { width: min(100% - 30px, 920px); margin: clamp(28px, 6vw, 70px) auto; }
.search-card { overflow: hidden; padding: clamp(24px, 5vw, 52px); border: 1px solid rgba(22, 76, 57, .08); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.intro h2 { margin: 8px 0 10px; font: 700 clamp(28px, 5vw, 43px)/1.05 Georgia, serif; color: var(--green-950); }
.intro > p:last-child { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.tabs { display: flex; gap: 8px; margin: 34px 0 24px; padding: 5px; width: fit-content; border-radius: 12px; background: #eef2ef; }
.tab { padding: 10px 20px; border: 0; border-radius: 9px; background: transparent; color: #53615b; font: inherit; font-weight: 700; cursor: pointer; }
.tab.active { background: white; color: var(--green-800); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
label { display: block; margin-bottom: 8px; font-weight: 750; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
input { min-width: 0; padding: 15px 17px; border: 1px solid #bfcac4; border-radius: 12px; color: var(--ink); background: white; font: inherit; font-size: 17px; outline: none; }
input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(36,128,94,.13); }
button { touch-action: manipulation; }
.primary-button, .print-button { border: 0; border-radius: 12px; background: var(--green-800); color: white; font: inherit; font-weight: 800; cursor: pointer; }
.primary-button { padding: 0 25px; font-size: 16px; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.clear-button { min-height: 46px; padding: 0 22px; border: 2px solid #9baba3; border-radius: 10px; background: white; color: #34453d; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.clear-button:hover { border-color: var(--green-600); color: var(--green-800); background: var(--green-100); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.feedback { margin: 20px 0; padding: 16px 18px; border-radius: 13px; background: white; border-left: 5px solid var(--green-600); box-shadow: 0 8px 24px rgba(20,51,40,.08); }
.feedback.error, .feedback.empty { border-color: var(--red); background: var(--red-soft); color: #7a271a; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); gap: 18px; margin-top: 20px; }
.member-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 32px rgba(20,51,40,.08); }
.status-banner { display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: var(--green-100); color: var(--green-800); }
.not-eligible .status-banner { background: var(--red-soft); color: var(--red); }
.status-icon { display: grid; flex: 0 0 34px; place-items: center; height: 34px; border: 2px solid currentColor; border-radius: 50%; font-weight: 900; }
.status-banner small, .status-banner strong { display: block; }
.status-banner small { margin-bottom: 2px; opacity: .72; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.status-banner strong { font-size: 14px; }
.member-body { padding: 22px; }
.member-name { min-height: 2.6em; margin: 0 0 20px; font: 700 21px/1.3 Georgia, serif; color: var(--green-950); }
dl { display: grid; gap: 10px; margin: 0 0 20px; }
dl div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 9px; border-bottom: 1px solid #edf0ee; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; text-align: right; font-weight: 750; }
.print-button, .member-card .clear-button { width: 100%; min-height: 46px; padding: 11px; font-size: 15px; }
.print-button { background: transparent; border: 1px solid var(--green-800); color: var(--green-800); }
.member-card .clear-button { margin-top: 8px; }
.print-button:hover { background: var(--green-100); }
#print-ticket { display: none; }

@media (max-width: 580px) {
    .topbar { padding: 14px 18px; }
    .brand-mark { width: 42px; height: 42px; }
    .shell { width: min(100% - 20px, 920px); margin: 20px auto; }
    .search-card { padding: 23px 18px; border-radius: 18px; }
    .tabs { width: 100%; }
    .tab { flex: 1; padding-inline: 10px; }
    .search-row { grid-template-columns: 1fr; }
    .primary-button { width: 100%; min-height: 50px; font-size: 16px; }
    .member-card .print-button, .member-card .clear-button { min-height: 50px; font-size: 16px; }
}

@page { size: 80mm 50mm; margin: 3mm; }
@media print {
    html, body { width: 80mm; height: 50mm; margin: 0; padding: 0; background: white; }
    body > *:not(#print-ticket) { display: none !important; }
    #print-ticket { display: block; width: 74mm; height: 44mm; overflow: hidden; color: #000; font-family: Arial, sans-serif; }
    .ticket-heading { margin: 0 0 1.5mm; padding-bottom: 1mm; border-bottom: .3mm solid #000; text-align: center; font-size: 8pt; font-weight: 800; }
    .ticket-status { margin: 0 0 1.5mm; border: .4mm solid #000; padding: 1mm; text-align: center; font-size: 10pt; font-weight: 900; background: #fff; color: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .printing-eligible #print-ticket .ticket-status { background: #000 !important; color: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .ticket-name { margin: 0 0 1.5mm; font-size: 9pt; font-weight: 800; line-height: 1.15; }
    .ticket-details { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3mm; }
    .ticket-details p { margin: 0 0 .8mm; font-size: 7.5pt; }
    .ticket-details p:last-child { grid-column: 1 / -1; }
    .ticket-date { margin: 1mm 0 0; padding-top: 1mm; border-top: .2mm dashed #555; text-align: right; font-size: 6.5pt; }
}

