:root {
  color-scheme: dark;
  --background: #101012;
  --panel: #18171a;
  --panel-low: #131215;
  --line: #383238;
  --control: #6a565f;
  --ink: #f8f3ef;
  --muted: #bdb2b7;
  --accent: #f58e99;
  --accent-surface: #351d24;
  --primary: #ad3146;
  --primary-hover: #ba3d52;
  --gold: #ffde9e;
  --success: #b8e2cb;
  --error: #ffc3c9;
  --ui: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); font: 500 16px/1.55 var(--ui); }
h1, h2, h3, p, figure { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, label:has(input:not(:disabled)) { cursor: pointer; }
button, a { touch-action: manipulation; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#main:focus, #hero-title:focus, .target-heading:focus { outline: none; }
.container { max-width: 1416px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 62px); }
.muted { color: var(--muted); }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 8px; color: var(--ink); background: var(--panel); padding: 10px 14px; border-radius: 6px; clip-path: inset(50%); }
.skip-link:focus { clip-path: none; }
[data-icon], .icon { display: inline-flex; flex: none; width: 18px; height: 18px; }
[data-icon] svg, .icon svg { width: 100%; height: 100%; display: block; }

.masthead { border-bottom: 1px solid #2a2729; background: #121214; }
.masthead-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 10px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.organizer-mark { display: grid; place-items: center; flex: none; width: 103px; min-height: 48px; padding: 6px 8px; border-radius: 7px; background: #f5efeb; }
.organizer-mark img { width: 100%; height: 36px; object-fit: contain; }
.event-lockup { border-left: 1px solid #4d3d43; padding-left: 14px; }
.event-lockup strong, .event-lockup span { display: block; }
.event-lockup strong { font-size: 14px; letter-spacing: .055em; line-height: 1.25; }
.event-lockup span { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--muted); margin-top: 4px; }

.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: clamp(590px, calc(100svh - 158px), 790px); border-bottom: 1px solid var(--line); }
.hero-art, .hero-piano { position: absolute; pointer-events: none; }
.hero-art { z-index: -2; inset: 0; background:
  linear-gradient(90deg, var(--background) 1%, #101012f2 25%, #1010125e 59%, #10101229 77%, #101012b0 100%),
  linear-gradient(0deg, var(--background), #10101220 31%, #10101210 72%, #101012b0),
  url("/assets/esma-sultan.jpg") right 44% / min(96%, 1180px) auto no-repeat; }
.hero-piano { z-index: -1; inset: 7% 2% 5% 52%; background: url("/assets/lang-lang-grand-piano.webp") right center / contain no-repeat; filter: drop-shadow(0 12px 28px #000b); }
.hero-inner { width: min(100%, 600px); padding-block: 44px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 730; letter-spacing: .19em; margin-bottom: 12px; }
.eyebrow span { width: 22px; height: 1px; background: currentColor; }
h1 { font: 400 clamp(56px, 7.1vw, 103px)/1 var(--display); letter-spacing: -.056em; overflow-wrap: normal; margin-bottom: 14px; text-shadow: 0 2px 22px #120d11b0; }
.venue { display: flex; align-items: center; gap: 8px; color: #e9dedb; font-size: 14px; }
.venue [data-icon] { color: var(--accent); width: 16px; height: 16px; }
.hero.compact { min-height: 232px; margin-bottom: 24px; }
.hero.compact h1 { font-size: clamp(42px, 6vw, 80px); }
.hero.compact .hero-art { inset-inline-start: 18%; background-size: auto, auto, min(96%, 940px) auto; }
.hero.compact .hero-piano { inset: 3% 3% 3% 44%; background-position: right bottom; }
.login-form { display: grid; gap: 10px; width: min(100%, 430px); margin-top: 24px; }
.login-intro { color: #e4d9db; margin-bottom: 8px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { color: var(--ink); font-weight: 675; font-size: 14px; }
.field .muted { font-size: 14px; overflow-wrap: anywhere; margin-bottom: 4px; }
.input-shell { display: flex; min-width: 0; min-height: 52px; align-items: center; gap: 10px; padding-inline: 13px; border: 1px solid var(--control); border-radius: 8px; background: #141217f5; color: var(--accent); }
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #d75b742a; }
.input-shell input { color: var(--ink); flex: 1; min-width: 0; width: 100%; border: 0; padding-block: 12px; outline: none; background: transparent; line-height: 1.4; font-size: 16px; }
#code { letter-spacing: .23em; font-variant-numeric: tabular-nums; }
.login-form .primary { justify-content: space-between; min-height: 48px; }
.login-form .text-button { justify-self: start; }

.button, .text-button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; border-radius: 8px; min-height: 44px; text-decoration: none; text-align: center; font-size: 14px; font-weight: 680; line-height: 1.35; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.button { color: var(--ink); background: #242125; border: 1px solid var(--control); padding: 10px 14px; }
.button:hover { background: #34292f; border-color: var(--accent); }
.button:active { background: #3d2c34; }
.button.primary { background: var(--primary); border-color: #c65667; color: #fff9f8; }
.button.primary:hover { background: var(--primary-hover); border-color: #dc7a87; }
.button.primary:active { background: #93283a; }
.button:disabled, .button.is-disabled { opacity: .56; cursor: not-allowed; }
.button:disabled:hover, .button.is-disabled:hover { border-color: var(--control); background: #242125; }
.button.primary:disabled:hover { border-color: #c65667; background: var(--primary); }
.header-button { flex: none; white-space: nowrap; }
.text-button { color: var(--muted); background: transparent; border: 0; padding: 7px 2px; }
.text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger { color: var(--error); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; }
.demo-banner, .demo-code { color: #ffe5ba; padding: 9px 12px; border: 1px solid #674e3f; border-radius: 8px; background: #2a231d; font-size: 14px; }
.demo-banner { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #e0a36a; box-shadow: 0 0 8px #e0a36655; }
.demo-code { font-variant-numeric: tabular-nums; }
.feedback, .support { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.feedback.error { color: var(--error); }
.feedback.success { color: var(--success); }
.app-message { padding: 12px 14px; margin-block: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }

h2 { font-size: clamp(20px, 2.8vw, 25px); letter-spacing: -.025em; line-height: 1.3; }
h3 { font-size: 16px; line-height: 1.35; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: clamp(15px, 2.4vw, 24px); }
.panel-heading { display: flex; align-items: start; gap: 12px; margin-bottom: 16px; }
.panel-heading > div { min-width: 0; }
.panel-heading p { color: var(--muted); margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 9px; background: var(--accent-surface); border: 1px solid #633643; color: var(--accent); }
.guest-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(295px, 370px); align-items: start; gap: 18px; }
.guest-layout.registering { grid-template-columns: minmax(0, 620px); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 12px; }
.gallery-card, .empty-state { background: var(--panel-low); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-card .button { margin: 10px; width: calc(100% - 20px); }
.empty-state { display: grid; gap: 5px; align-content: center; justify-items: start; min-height: 132px; padding: 18px; }
.empty-state p { font-size: 14px; color: var(--muted); }
.registration, .account-card { display: grid; gap: 13px; }
.registration .panel-heading, .account-card .panel-heading { margin-bottom: 0; }
.consent-row { display: flex; align-items: start; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-low); min-height: 44px; font-size: 14px; }
.consent-row input, .match-option input { accent-color: var(--primary); width: 19px; height: 19px; flex: 0 0 19px; margin: 2px 0 0; }
.notice-link, .account-card .text-button { justify-self: start; }
.notice-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.capture-frame { position: relative; width: min(100%, 365px); aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse at center, #2b1c24 4%, var(--panel-low) 80%); border-radius: 10px; border: 1px solid var(--line); }
.capture-frame video, .capture-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.capture-frame video { transform: scaleX(-1); }
.capture-frame > .icon { width: 36px; height: 36px; color: var(--accent); }
.file-input { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
input.file-input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 3px; }
.registration .submit-selfie { justify-self: start; }
.member-email { color: var(--muted); overflow-wrap: anywhere; }

.staff-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 355px); align-items: start; gap: 18px; }
.stacks, .review-list, .staff-guests, .upload-form { display: grid; gap: 12px; min-width: 0; }
.upload-form .button-row { justify-content: space-between; }
.review-list, .staff-guests { gap: 9px; }
.queues-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.queues-toolbar .panel-heading { margin-bottom: 0; }
.filter-group { display: inline-flex; border: 1px solid var(--line); background: var(--panel-low); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.filter-group .button { border-color: transparent; padding: 8px 10px; min-height: 44px; background: transparent; }
.filter-group .button[aria-pressed="true"] { background: var(--accent-surface); border-color: #80505c; color: #ffdadc; }
.review-card, .guest-row { display: grid; min-width: 0; gap: 9px; padding: 12px; border: 1px solid var(--line); background: var(--panel-low); border-radius: 10px; }
.review-card .photo-preview { display: block; max-width: 420px; width: 100%; max-height: 350px; object-fit: contain; object-position: left center; border-radius: 6px; }
.review-card h3, .guest-row h3 { overflow-wrap: anywhere; }
.photo-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.photo-meta .state { white-space: nowrap; }
.state { color: var(--muted); font-size: 13px; }
.state.good { color: var(--success); }
.state.attention { color: var(--gold); }
.state.error { color: var(--error); }
.match-options { display: grid; gap: 8px; }
.match-option { display: flex; gap: 10px; align-items: center; min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.match-option:has(input:checked) { border-color: #bd6676; background: var(--accent-surface); }
.match-option input { align-self: center; margin: 0; }
.match-media { display: flex; align-items: center; gap: 6px; flex: none; }
.match-media img, .match-media canvas { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--control); border-radius: 6px; }
.match-identity { display: grid; gap: 1px; min-width: 0; }
.match-identity span { font-size: 13px; color: var(--muted); }
.match-identity strong { font-size: 15px; overflow-wrap: anywhere; }
.guest-row .button { justify-self: start; }
.guest-row .delivery-note { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.pagination { justify-content: space-between; margin-top: 14px; }

.app-footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; margin-top: 14px; color: var(--muted); }
.powered-by, .footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.powered-by { flex: none; font-size: 11px; }
.powered-by img { width: 85px; height: auto; }
.footer-links { column-gap: 15px; justify-content: end; }
.footer-links .text-button { font-size: 13px; padding-inline: 4px; }
.dialog { width: min(calc(100% - 32px), 460px); padding: 24px; background: var(--panel); color: var(--ink); border: 1px solid var(--control); border-radius: 14px; }
.dialog::backdrop { background: #0a080bef; }
.dialog form { display: grid; gap: 12px; }

@media (max-width: 850px) {
  .staff-layout { grid-template-columns: minmax(0, 1fr); }
  .hero:not(.compact) .hero-piano { opacity: .83; inset-inline-start: 44%; }
  .guest-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 285px); gap: 12px; }
}
@media (max-width: 640px) {
  .masthead-inner { min-height: 66px; gap: 8px; }
  .brand { gap: 8px; }
  .organizer-mark { width: 72px; min-height: 39px; padding: 4px 6px; }
  .organizer-mark img { height: 28px; }
  .event-lockup { padding-left: 8px; }
  .event-lockup strong { font-size: 12px; letter-spacing: .015em; }
  .event-lockup span { font-size: 10px; letter-spacing: .08em; }
  .header-button { padding-inline: 8px; font-size: 12px; }
  .hero { min-height: 565px; align-items: end; }
  .hero-inner { padding-top: 170px; padding-bottom: 30px; }
  .hero-art { background:
    linear-gradient(0deg, var(--background) 25%, #101012a0 58%, #10101220 86%, #10101270),
    url("/assets/esma-sultan.jpg") 46% 3% / auto 345px no-repeat; }
  .hero:not(.compact) .hero-piano { inset: 1% 0 auto 41%; height: 182px; opacity: .95; background-position: right top; }
  .hero h1 { font-size: clamp(48px, 12.7vw, 75px); }
  .hero.compact { min-height: 170px; margin-bottom: 16px; }
  .hero.compact .hero-inner { padding-top: 38px; padding-bottom: 23px; }
  .hero.compact .hero-art { inset-inline-start: 0; background-size: auto, auto 240px; }
  .hero.compact .hero-piano { opacity: .45; inset: 10% 0 4% 44%; }
  .guest-layout, .guest-layout.registering { grid-template-columns: minmax(0, 1fr); }
  .app-footer { align-items: start; }
}
@media (max-width: 355px) {
  .container { padding-inline: 13px; }
  .hero h1 { font-size: 43px; }
  .event-lockup strong { font-size: 11px; }
  .footer-links { column-gap: 8px; }
  .powered-by img { width: 65px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

.roster { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-low); }
.roster summary { cursor: pointer; min-height: 44px; padding: 10px 13px; font-size: 14px; font-weight: 650; }
.roster-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 8px; max-height: 232px; overflow-y: auto; padding: 2px 10px 10px; }
.roster-list .consent-row { background: var(--panel); }
.staff-reference { width: 86px; height: 86px; object-fit: cover; border: 1px solid var(--control); border-radius: 8px; }
.demo-gallery-link { margin-inline-start: 6px; }
