:root {
  color-scheme: dark;
  --bg: #1B1B1A;
  --panel: #242223;
  --panel-raised: #2C292D;
  --line: #494047;
  --text: #FCF2F9;
  --muted: #C0B5BE;
  --dim: #827780;
  --pink: #EBA6C6;
  --pink-hot: #F3B7D0;
  --blue: #B6B6D8;
  --ice: #CEE4F7;
  --shadow: #6B5A65;
  --gel: linear-gradient(110deg, var(--pink-hot) 8%, var(--pink) 42%, var(--blue) 76%, var(--ice));
  --mono: 'SF Mono', Menlo, 'Cascadia Mono', Consolas, monospace;
  --sans: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 52% -24%, rgba(235, 166, 198, .18), transparent 31rem),
    radial-gradient(ellipse at 104% 24%, rgba(182, 182, 216, .12), transparent 26rem),
    radial-gradient(ellipse at -12% 76%, rgba(206, 228, 247, .08), transparent 29rem),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: .12;
  background-image:
    radial-gradient(circle, rgba(252, 242, 249, .9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(206, 228, 247, .9) 0 1px, transparent 1.5px);
  background-position: 0 0, 29px 41px;
  background-size: 83px 91px, 127px 143px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 80%);
}

button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell { position: relative; z-index: 1; width: min(100% - 40px, 820px); margin: 0 auto; padding: 24px 0 36px; }
.login-screen { width: min(100%, 500px); min-height: calc(100vh - 60px); margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 38px 0 48px; }
.login-logo { display: block; width: min(300px, 84vw); height: 170px; margin: 0 0 12px -19px; object-fit: cover; object-position: center; mix-blend-mode: screen; filter: drop-shadow(0 8px 26px rgba(235, 166, 198, .13)); }
.eyebrow, .optional, .door-status, .login-footer, .app-footer { color: var(--muted); font: 500 10px/1.4 var(--mono); letter-spacing: .12em; }
.eyebrow { margin: 0 0 9px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 13px; font-size: clamp(42px, 8vw, 66px); line-height: .98; letter-spacing: -.065em; font-weight: 600; }
h2 { margin: 0; font-size: 23px; line-height: 1.1; letter-spacing: -.04em; font-weight: 600; }
.muted, .hint { color: var(--muted); }
.login-copy { margin: 0 0 36px; font-size: 16px; }
.login-form label, #add-form label { display: block; margin-bottom: 8px; color: #e9dce5; font-size: 13px; font-weight: 600; }
.pin-row { display: flex; gap: 10px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(21, 20, 21, .88); outline: none; transition: border-color .15s, box-shadow .15s; }
input { min-height: 48px; padding: 0 14px; }
textarea { min-height: 80px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(235, 166, 198, .13), 0 0 20px rgba(182, 182, 216, .06); }
input::placeholder, textarea::placeholder { color: #827780; }
.pin-row input { font-family: var(--mono); font-size: 18px; letter-spacing: .24em; }
.button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 14px; min-height: 46px; padding: 0 17px; border: 0; border-radius: 9px; color: #211c21; background: var(--gel); box-shadow: inset 0 1px rgba(255,255,255,.65), 0 5px 20px rgba(235,166,198,.13); cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .12s, filter .12s, box-shadow .12s; }
.button:hover { transform: translateY(-1px); filter: saturate(1.12) brightness(1.05); box-shadow: inset 0 1px rgba(255,255,255,.8), 0 8px 24px rgba(235,166,198,.2); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.button:focus-visible, .text-button:focus-visible, .guest-action:focus-visible, .check-toggle:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.form-message { min-height: 18px; margin: 9px 0 0; color: var(--pink-hot); font-size: 12px; }
.login-footer { display: flex; align-items: center; gap: 8px; margin-top: 48px; }
.live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--pink-hot); box-shadow: 0 0 11px rgba(243, 183, 208, .7); }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 0 17px; border-bottom: 1px solid rgba(235, 166, 198, .18); }
.wordmark { display: inline-flex; align-items: center; gap: 4px; color: var(--text); text-decoration: none; }
.wordmark-logo { display: block; width: 160px; height: 66px; object-fit: cover; object-position: center; mix-blend-mode: screen; filter: drop-shadow(0 4px 16px rgba(235,166,198,.1)); }
.wordmark-caption { padding-left: 3px; color: var(--muted); font: 500 9px/1.7 var(--mono); letter-spacing: .1em; }
.topbar-right { display: flex; align-items: center; gap: 21px; }
.door-status { display: inline-flex; align-items: center; gap: 8px; color: var(--pink-hot); }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: 500 11px var(--mono); }
.text-button:hover { color: var(--text); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 40px 0 28px; }
.intro .eyebrow { margin-bottom: 12px; }
.accent { color: var(--pink-hot); text-shadow: 0 0 23px rgba(243, 183, 208, .5); }
.count-card { display: flex; align-items: baseline; gap: 10px; min-width: 204px; padding: 14px 18px; border: 1px solid rgba(235, 166, 198, .31); border-radius: 12px; background: linear-gradient(118deg, rgba(235,166,198,.13), rgba(182,182,216,.09) 62%, rgba(206,228,247,.06)); box-shadow: inset 0 1px rgba(255,255,255,.04), 0 8px 30px rgba(0,0,0,.12); }
.count-card strong { color: var(--pink-hot); font: 500 32px/.9 var(--mono); letter-spacing: -.09em; text-shadow: 0 0 18px rgba(243,183,208,.24); }
.count-card span { color: var(--muted); font-size: 11px; }
.count-card b { color: var(--text); font-weight: 600; }
.event-card { margin-bottom: 12px; padding: 18px 22px; border: 1px solid rgba(182,182,216,.23); border-radius: 15px; background: linear-gradient(125deg, rgba(182,182,216,.075), transparent 60%), var(--panel); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 14px 38px rgba(0,0,0,.12); }
.event-main { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.event-main .eyebrow { margin-bottom: 6px; }
.event-main h2 { margin-bottom: 4px; font-size: 20px; }
.event-details { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.event-controls { display: flex; flex: 0 0 auto; gap: 8px; }
.button-stop { color: #251b20; background: linear-gradient(135deg, #F3A5BE, #E27A9D); }
.event-history { display: grid; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(182,182,216,.15); }
.event-history-title { margin: 0 0 2px; color: var(--dim); font: 500 9px var(--mono); letter-spacing: .12em; }
.event-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.event-history-meta { color: var(--muted); font-size: 11px; }
.event-download { flex: 0 0 auto; color: var(--ice); font-size: 11px; font-weight: 600; text-decoration: none; }
.event-download:hover { color: var(--pink-hot); text-decoration: underline; }
.add-card { padding: 22px; border: 1px solid rgba(235,166,198,.2); border-radius: 15px; background: linear-gradient(145deg, rgba(243,183,208,.055), transparent 56%), linear-gradient(310deg, rgba(182,182,216,.035), transparent 50%), var(--panel); box-shadow: inset 0 1px rgba(255,255,255,.045), 0 18px 48px rgba(0,0,0,.15); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.add-glyph { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(243,183,208,.2); border-radius: 50%; color: var(--pink-hot); background: linear-gradient(145deg, rgba(235,166,198,.2), rgba(182,182,216,.1)); box-shadow: 0 0 22px rgba(235,166,198,.1); font-size: 22px; }
#add-form { display: grid; grid-template-columns: 1fr; }
#add-form label { margin-top: 1px; }
#add-form input { margin-bottom: 15px; }
#add-form textarea { margin-bottom: 14px; }
.optional { margin-left: 6px; color: var(--dim); font-size: 9px; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { margin: 0; font-size: 12px; line-height: 1.45; }
.form-bottom .button { min-height: 42px; }
.list-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(235,166,198,.12); }
.list-actions-hint { color: var(--dim); font-size: 11px; }
.button-danger { min-height: 38px; padding: 0 13px; border: 1px solid rgba(243,165,190,.32); color: #F3A5BE; background: rgba(143,53,82,.13); box-shadow: inset 0 1px rgba(255,255,255,.035); font-size: 11px; }
.button-danger:hover { background: rgba(143,53,82,.25); box-shadow: 0 0 18px rgba(243,165,190,.1); }
.button-danger:disabled { cursor: not-allowed; opacity: .4; transform: none; }
.import-card { margin-top: 12px; padding: 20px 22px; border: 1px solid rgba(182,182,216,.2); border-radius: 15px; background: linear-gradient(145deg, rgba(182,182,216,.055), transparent 58%), var(--panel); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 12px 36px rgba(0,0,0,.1); }
.import-card .section-heading { margin-bottom: 15px; }
.import-glyph { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(182,182,216,.24); border-radius: 50%; color: var(--ice); background: linear-gradient(145deg, rgba(182,182,216,.16), rgba(206,228,247,.08)); font-size: 20px; }
#csv-import-form label { display: block; margin-bottom: 8px; color: #e9dce5; font-size: 13px; font-weight: 600; }
#csv-file { min-height: 46px; margin-bottom: 12px; padding: 6px; color: var(--muted); font-size: 12px; }
#csv-file::file-selector-button { min-height: 32px; margin-right: 12px; padding: 0 12px; border: 1px solid rgba(235,166,198,.25); border-radius: 7px; color: var(--text); background: rgba(235,166,198,.09); cursor: pointer; font: 500 11px var(--sans); }
#csv-file::file-selector-button:hover { background: rgba(235,166,198,.16); }
#csv-import-form .form-bottom { align-items: center; }
.list-section { margin-top: 40px; }
.list-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.list-heading-row .eyebrow { margin-bottom: 7px; }
.list-total { display: inline-grid; place-items: center; min-width: 24px; height: 23px; margin-left: 5px; padding: 0 6px; vertical-align: 3px; border: 1px solid rgba(235,166,198,.25); border-radius: 20px; color: var(--pink-hot); background: rgba(235,166,198,.055); font: 11px var(--mono); letter-spacing: 0; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(250px, 48%); min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: rgba(21,20,21,.84); }
.search-box span { font-size: 19px; line-height: 1; transform: rotate(-18deg); }
.search-box input { min-height: 35px; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 12px; }
.search-box input:focus { box-shadow: none; }
.guest-list { display: grid; gap: 8px; }
.guest-row { display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 10px 12px; border: 1px solid rgba(206,228,247,.12); border-radius: 11px; background: linear-gradient(110deg, rgba(255,255,255,.025), transparent 64%), rgba(36,34,35,.88); box-shadow: inset 0 1px rgba(255,255,255,.025); transition: border-color .15s, background .15s, transform .15s; }
.guest-row:hover { transform: translateY(-1px); border-color: rgba(206,228,247,.3); }
.guest-row.is-checked { border-color: rgba(235,166,198,.4); background: linear-gradient(110deg, rgba(235,166,198,.10), rgba(182,182,216,.045) 75%), #242223; }
.check-toggle { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid rgba(206,228,247,.4); border-radius: 50%; color: transparent; background: rgba(206,228,247,.035); cursor: pointer; font-size: 18px; font-weight: 700; transition: all .14s; }
.check-toggle:hover { border-color: var(--pink-hot); box-shadow: 0 0 16px rgba(243,183,208,.15); }
.check-toggle:disabled { cursor: not-allowed; opacity: .4; }
.is-checked .check-toggle { border-color: transparent; color: #211c21; background: var(--gel); box-shadow: inset 0 1px rgba(255,255,255,.7), 0 0 17px rgba(235,166,198,.18); }
.guest-info { min-width: 0; flex: 1; }
.guest-name { overflow: hidden; color: var(--text); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.is-checked .guest-name { color: #F8DCE9; }
.party-label { overflow: hidden; margin-top: 3px; color: var(--blue); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.payment-details { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.guest-actions { display: flex; align-items: center; gap: 4px; }
.guest-action { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; color: #AFA2AC; background: transparent; cursor: pointer; font-size: 15px; }
.guest-action:hover { color: var(--text); background: #383238; }
.guest-action.remove:hover { color: #F3A5BE; }
.empty-state { padding: 28px 20px; border: 1px dashed rgba(235,166,198,.3); border-radius: 12px; color: var(--muted); background: linear-gradient(120deg, rgba(235,166,198,.035), rgba(182,182,216,.025)); text-align: center; font-size: 13px; line-height: 1.5; }
.network-message { min-height: 18px; margin: 12px 0 0; color: var(--pink-hot); font-size: 12px; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 42px; padding-top: 14px; border-top: 1px solid rgba(235,166,198,.15); color: #92858E; font-size: 9px; }

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 820px); padding-top: 14px; }
  .login-screen { min-height: calc(100vh - 40px); }
  .topbar { padding-bottom: 12px; }
  .wordmark { gap: 0; }
  .wordmark-logo { width: 135px; height: 59px; }
  .wordmark-caption { font-size: 8px; }
  .topbar-right { gap: 12px; }
  .door-status { font-size: 9px; letter-spacing: .06em; }
  .intro { align-items: flex-start; flex-direction: column; gap: 17px; padding: 29px 0 20px; }
  .intro h1 { font-size: 51px; }
  .count-card { width: 100%; min-width: 0; padding: 12px 15px; }
  .count-card strong { font-size: 29px; }
  .event-card { padding: 16px 14px; }
  .event-main { align-items: stretch; flex-direction: column; }
  .event-controls { flex-direction: column; }
  .event-controls .button { width: 100%; }
  .event-history-row { align-items: flex-start; flex-direction: column; gap: 4px; padding: 6px 0; }
  .add-card { padding: 17px 14px; }
  .import-card { padding: 17px 14px; }
  .form-bottom { align-items: stretch; flex-direction: column; }
  .form-bottom .button { width: 100%; }
  .list-section { margin-top: 32px; }
  .list-heading-row { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
  .guest-row { min-height: 62px; gap: 10px; padding: 8px 9px; }
  .check-toggle { width: 36px; height: 36px; flex-basis: 36px; }
  .list-actions { align-items: stretch; flex-direction: column; }
  .button-danger { width: 100%; }
  .app-footer { font-size: 8px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
