:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --text: #0b1f33;
  --muted: #60758b;
  --line: #d6e0e9;
  --primary: #0f766e;
  --primary-2: #0b5f59;
  --accent: #f5b63a;
  --danger: #b42318;
  --success: #1f7a4d;
  --shadow: 0 18px 48px rgba(11, 31, 51, .11);
  --shadow-soft: 0 9px 26px rgba(11, 31, 51, .08);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 92% 0, rgba(15,118,110,.13), transparent 32rem), var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.shell { max-width: 1180px; margin: 0 auto; padding: 18px 18px calc(88px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; min-height: 64px; }
.brand-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; border-radius: 14px; padding: 5px 8px; }
.brand:hover { background: rgba(255,255,255,.72); }
.brand img { width: min(230px, 42vw); height: auto; display: block; }
.brand span { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: .86rem; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.back-link { font-size: 1.25rem; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.actions.start { justify-content: flex-start; }
.compact-select { width: auto; min-width: 68px; min-height: 42px; padding: 8px 28px 8px 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 14px; padding: 11px 15px; font-weight: 780; color: var(--text); background: var(--surface-2); transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(15,118,110,.25); outline-offset: 2px; }
.btn.primary { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 24px rgba(15,118,110,.22); }
.btn.secondary { background: white; border: 1px solid var(--line); }
.btn.danger { color: white; background: var(--danger); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.text-center { text-align: center; }

.card { background: rgba(255,255,255,.97); border: 1px solid rgba(214,224,233,.95); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: clamp(18px, 4vw, 30px); }
.grid { display: grid; gap: 18px; }
.grid.events { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hero { padding: clamp(25px, 6vw, 48px); border-radius: 30px; color: white; background: linear-gradient(135deg, #0b1f33, #0f766e); box-shadow: var(--shadow); margin-bottom: 22px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(245,182,58,.24); right: -80px; top: -120px; }
.hero h2 { margin: 0 0 8px; font-size: clamp(1.65rem, 7vw, 3rem); letter-spacing: -.045em; max-width: 720px; }
.hero p { margin: 0; opacity: .88; max-width: 680px; line-height: 1.55; }
.brand-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.hero-eyes { font-size: clamp(3rem, 8vw, 6rem); letter-spacing: .15em; opacity: .12; transform: rotate(-5deg); }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 900; opacity: .78; }

.event-card { display: flex; flex-direction: column; min-height: 310px; position: relative; }
.event-cover { height: 155px; padding: 16px; color: white; position: relative; display: flex; justify-content: flex-end; align-items: flex-start; overflow: hidden; background: #0b1f33; }
.event-cover .theme-art, .event-admin-hero .theme-art, .guest-hero .theme-art, .theme-preview .theme-art, .printable-qr-card .theme-art { position: absolute; inset: 0; background-size: cover; background-position: center; pointer-events: none; }
.event-cover-badges { display: flex; gap: 7px; position: relative; z-index: 2; }
.event-card.theme-kermes .event-cover .theme-art { background-image: linear-gradient(90deg, rgba(111,36,25,.2), rgba(255,184,61,.05)), url('../assets/themes/kermes.svg'); background-position: center 37%; }
.event-card.theme-night .event-cover .theme-art { background-image: url('../assets/themes/night.svg'); }
.event-card.theme-family .event-cover .theme-art { background-image: url('../assets/themes/family.svg'); background-position: center 48%; }
.event-card.theme-professional .event-cover .theme-art { background-image: url('../assets/themes/professional.svg'); }
.event-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.event-body h3 { margin: 0; letter-spacing: -.025em; font-size: 1.25rem; }
.event-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.event-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 850; background: var(--surface-2); color: var(--text); }
.badge.active { color: #11643f; background: #dcfce7; }
.badge.closed { color: #7f1d1d; background: #fee2e2; }
.badge.draft { color: #7c4a03; background: #fef3c7; }
.badge.scheduled { color: #3730a3; background: #e0e7ff; }
.badge.pro { color: #6b3f00; background: #fff0c2; }

.form { display: grid; gap: 18px; }
.form-card { padding: clamp(18px, 4vw, 34px); }
.form-section { display: grid; gap: 17px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; padding-bottom: 5px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; }
.section-heading > span { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.field { display: grid; gap: 7px; }
.field label, .legend { font-size: .88rem; font-weight: 820; color: var(--text); }
.field small { color: var(--muted); line-height: 1.45; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 14px; padding: 12px 13px; min-height: 46px; }
select { appearance: auto; cursor: pointer; }
textarea { min-height: 105px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

.theme-preview { min-height: 220px; position: relative; border-radius: 22px; overflow: hidden; isolation: isolate; box-shadow: var(--shadow-soft); }
.theme-preview::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(6,18,31,.74), rgba(6,18,31,.08)); }
.theme-preview-copy { position: relative; z-index: 2; max-width: 520px; padding: 30px; color: white; display: grid; gap: 8px; }
.theme-preview-copy span { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 900; letter-spacing: -.045em; }
.theme-preview-copy strong { font-size: .95rem; line-height: 1.5; font-weight: 600; opacity: .92; }
.theme-preview.theme-kermes .theme-art { background-image: url('../assets/themes/kermes.svg'); background-position: center 42%; }
.theme-preview.theme-night .theme-art { background-image: url('../assets/themes/night.svg'); }
.theme-preview.theme-family .theme-art { background-image: url('../assets/themes/family.svg'); }
.theme-preview.theme-professional .theme-art { background-image: url('../assets/themes/professional.svg'); }

.quote-card { margin-top: 18px; padding: 22px; border-radius: 20px; border: 1px solid #f1d18a; background: linear-gradient(135deg, #fffaf0, #fff); box-shadow: var(--shadow-soft); }
.quote-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.quote-head h3 { margin: 3px 0 0; font-size: clamp(1.8rem, 6vw, 2.8rem); letter-spacing: -.045em; }
.quote-lines { display: grid; gap: 8px; margin: 18px 0 12px; }
.quote-lines > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed #e9d7aa; padding-bottom: 8px; }
.accept-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.accept-row input { width: 22px; height: 22px; min-height: auto; flex: 0 0 22px; }
.accept-row span { display: grid; gap: 4px; }
.accept-row small { color: var(--muted); line-height: 1.45; }
.locked-plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface-2); }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 80% 12%, rgba(245,182,58,.15), transparent 25rem), radial-gradient(circle at 15% 85%, rgba(15,118,110,.14), transparent 28rem); }
.auth-card { width: min(100%, 460px); }
.auth-head { padding: 32px 28px 12px; text-align: center; }
.auth-logo { width: min(300px, 82%); height: auto; }
.auth-head h1 { margin: 14px 0 6px; letter-spacing: -.04em; }
.auth-head p { margin: 12px 0 0; color: var(--muted); }
.auth-body { padding: 20px 28px 30px; }

.dashboard-head { display: grid; gap: 16px; grid-template-columns: 1fr auto; align-items: end; margin-bottom: 18px; }
.dashboard-head h2 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: -.045em; }
.dashboard-head p { margin: 4px 0 0; color: var(--muted); }
.event-admin-hero { min-height: 300px; border-radius: 30px; position: relative; overflow: hidden; color: white; display: flex; align-items: flex-end; isolation: isolate; box-shadow: var(--shadow); }
.event-admin-hero::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(5,17,29,.86), rgba(5,17,29,.15)); }
.event-admin-hero .admin-hero-content { position: relative; z-index: 2; padding: clamp(24px, 5vw, 46px); max-width: 780px; }
.event-admin-hero h2 { margin: 10px 0 8px; font-size: clamp(2rem, 8vw, 4.4rem); letter-spacing: -.055em; }
.event-admin-hero p { margin: 0; max-width: 680px; line-height: 1.5; opacity: .92; }
.event-admin-hero.theme-kermes .theme-art { background-image: url('../assets/themes/kermes.svg'); background-position: center 38%; }
.event-admin-hero.theme-night .theme-art { background-image: url('../assets/themes/night.svg'); }
.event-admin-hero.theme-family .theme-art { background-image: url('../assets/themes/family.svg'); }
.event-admin-hero.theme-professional .theme-art { background-image: url('../assets/themes/professional.svg'); }
.dashboard-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin: 15px 0; }
.event-detail-line { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 15px; }
.stat span { color: var(--muted); font-size: .8rem; font-weight: 750; }
.stat strong { display: block; font-size: 1.3rem; margin-top: 4px; }
.progress { height: 10px; background: #e6edf3; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; transition: width .2s ease; }
.points-summary { margin: 18px 0; }
.points-summary h3 { margin-top: 0; }
.points-summary p { margin: 7px 0 0; color: var(--muted); }
.break-url { word-break: break-all; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 18px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 10px 14px; font-weight: 750; }
.tab.active { background: var(--text); color: white; border-color: var(--text); }
.gallery-filters { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.media-card { position: relative; border-radius: 16px; overflow: hidden; background: #d9e2ec; aspect-ratio: 1; border: 0; padding: 0; box-shadow: var(--shadow-soft); }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .media-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 9px; color: white; font-size: .75rem; font-weight: 750; background: linear-gradient(transparent, rgba(0,0,0,.78)); text-align: left; }
.video-mark { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: white; background: rgba(0,0,0,.55); }

/* Integral event themes */
.guest-shell { min-height: 100vh; position: relative; background-color: #f7fafc; background-attachment: fixed; }
.guest-shell.theme-kermes { --theme-primary: #c84934; --theme-accent: #f5b63a; --theme-ink: #4b241c; background: #fff5df radial-gradient(circle at 10% 25%, rgba(241,79,69,.13), transparent 18rem); }
.guest-shell.theme-night { --theme-primary: #7c3aed; --theme-accent: #22d3ee; --theme-ink: #ede9fe; background: #120b2d url('../assets/themes/night.svg') center/cover fixed; color: #f8fafc; }
.guest-shell.theme-family { --theme-primary: #0f766e; --theme-accent: #f59e0b; --theme-ink: #0b3b3a; background: #fffaf1 url('../assets/themes/family.svg') center/cover fixed; }
.guest-shell.theme-professional { --theme-primary: #0f766e; --theme-accent: #fbbf24; --theme-ink: #0f172a; background: #e9eef3 url('../assets/themes/professional.svg') center/cover fixed; }
.guest-hero { color: white; min-height: 360px; padding: 25px 18px 64px; position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; }
.guest-hero::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(4,14,25,.88), rgba(4,14,25,.16)); }
.guest-hero .inner { position: relative; z-index: 2; width: 100%; max-width: 980px; margin: 0 auto; }
.guest-logo { width: min(250px, 68vw); height: auto; display: block; margin-bottom: 18px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.guest-hero h1 { margin: 8px 0; font-size: clamp(2.4rem, 10vw, 5rem); letter-spacing: -.06em; max-width: 850px; }
.guest-hero p { margin: 0; opacity: .92; max-width: 680px; font-size: 1rem; line-height: 1.55; }
.guest-shell.theme-kermes .guest-hero .theme-art { background-image: url('../assets/themes/kermes.svg'); background-position: center 36%; }
.guest-shell.theme-night .guest-hero .theme-art { background-image: url('../assets/themes/night.svg'); }
.guest-shell.theme-family .guest-hero .theme-art { background-image: url('../assets/themes/family.svg'); }
.guest-shell.theme-professional .guest-hero .theme-art { background-image: url('../assets/themes/professional.svg'); }
.guest-main { max-width: 980px; margin: -24px auto 0; padding: 0 16px calc(90px + var(--safe-bottom)); position: relative; z-index: 4; }
.guest-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; background: rgba(255,255,255,.96); border-radius: 20px; padding: 8px; box-shadow: var(--shadow); position: sticky; top: 8px; z-index: 8; backdrop-filter: blur(12px); }
.guest-actions button { border: 0; border-radius: 13px; background: transparent; padding: 12px 6px; font-weight: 850; color: #0b1f33; }
.guest-actions button.active { background: var(--theme-primary, var(--text)); color: white; }
.guest-panel { margin-top: 16px; }
.guest-shell.theme-night .guest-panel .card, .guest-shell.theme-night .gallery-filters { background: rgba(20,13,48,.9); border-color: rgba(167,139,250,.28); color: #f8fafc; }
.guest-shell.theme-night .guest-panel input, .guest-shell.theme-night .guest-panel select, .guest-shell.theme-night .guest-panel textarea { background: rgba(255,255,255,.09); color: white; border-color: rgba(255,255,255,.2); }
.guest-shell.theme-night .guest-panel option { color: #0b1f33; }
.guest-shell.theme-kermes .guest-panel .card { border: 2px solid rgba(200,73,52,.16); }
.guest-shell.theme-family .guest-panel .card { border: 2px solid rgba(15,118,110,.13); }
.guest-shell.theme-professional .guest-panel .card { border-radius: 10px; box-shadow: 0 14px 34px rgba(15,23,42,.13); }

.upload-zone { border: 2px dashed #9fb3c8; border-radius: 20px; padding: 26px 18px; text-align: center; background: rgba(248,251,253,.9); }
.upload-choice-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.upload-file-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.9); margin-top: 10px; }
.upload-file-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.upload-file-card .progress { margin: 12px 0 5px; }

.ranking-search { margin-bottom: 14px; }
.ranking-search > label { font-weight: 850; display: block; margin-bottom: 9px; }
.ranking-search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.person-ranking-result { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.person-ranking-result h3 { margin: 0 0 8px; }
.person-ranking-result > div { display: flex; flex-wrap: wrap; gap: 10px; }
.person-ranking-result span { padding: 8px 10px; border-radius: 10px; background: white; }
.ranking-list { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; background: rgba(255,255,255,.96); color: #0b1f33; border: 1px solid var(--line); border-radius: 14px; padding: 11px; }
.rank-pos { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 900; }
.rank-row:nth-child(1) .rank-pos { background: #f6c453; }
.rank-row:nth-child(2) .rank-pos { background: #d6dde6; }
.rank-row:nth-child(3) .rank-pos { background: #d7a36d; }
.ranking-details { margin-top: 12px; }
.ranking-details summary { cursor: pointer; font-weight: 800; color: var(--primary); margin-bottom: 10px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5,15,25,.76); display: grid; place-items: center; padding: 18px; }
.modal { width: min(100%, 650px); max-height: calc(100vh - 36px); overflow: auto; border-radius: 24px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.viewer { width: min(100%, 980px); background: #07111b; color: white; overflow: hidden; }
.viewer-stage { position: relative; min-height: 280px; display: grid; place-items: center; }
.viewer-stage img, .viewer-stage video { display: block; width: 100%; max-height: 74vh; object-fit: contain; }
.viewer .modal-head { color: white; border-color: rgba(255,255,255,.15); }
.viewer .modal-body { background: #fff; color: var(--text); }
.viewer-head-actions { display: flex; align-items: center; gap: 8px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 64px; border: 0; color: white; font-size: 2.4rem; background: rgba(0,0,0,.35); border-radius: 14px; }
.viewer-nav.previous { left: 10px; }
.viewer-nav.next { right: 10px; }

.qr-modal { width: min(100%, 880px); }
.qr-modal-backdrop { align-items: start; overflow: auto; }
.qr-actions { justify-content: center; margin-top: 18px; }
.printable-qr-card { width: min(100%, 720px); min-height: 940px; margin: auto; padding: 48px; position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-rows: auto 1fr auto auto; gap: 24px; color: white; border-radius: 30px; box-shadow: var(--shadow); background: #0b1f33; }
.printable-qr-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(145deg, rgba(4,14,25,.92), rgba(4,14,25,.35)); }
.printable-qr-card .theme-art { z-index: -2; }
.printable-qr-card.theme-kermes .theme-art { background-image: url('../assets/themes/kermes.svg'); background-position: center 40%; }
.printable-qr-card.theme-night .theme-art { background-image: url('../assets/themes/night.svg'); }
.printable-qr-card.theme-family .theme-art { background-image: url('../assets/themes/family.svg'); }
.printable-qr-card.theme-professional .theme-art { background-image: url('../assets/themes/professional.svg'); }
.qr-card-brand img { width: 240px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.3)); }
.qr-card-copy { align-self: end; }
.qr-card-copy h1 { margin: 8px 0 12px; font-size: clamp(2.7rem, 8vw, 5.1rem); line-height: .96; letter-spacing: -.065em; }
.qr-card-copy p { max-width: 580px; line-height: 1.5; font-size: 1.08rem; }
.qr-event-details { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.qr-event-details span { padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.qr-code-wrap { width: 100%; max-width: 360px; justify-self: center; text-align: center; display: grid; gap: 9px; padding: 20px; border-radius: 24px; color: #0b1f33; background: white; }
.qr-code-wrap svg { width: 100%; height: auto; }
.qr-code-wrap small { word-break: break-all; color: var(--muted); font-size: .68rem; }
.printable-qr-card footer { text-align: center; font-weight: 800; letter-spacing: .02em; }
.print-page { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #e8edf2; }
.print-page .printable-qr-card { width: 180mm; min-height: 245mm; box-shadow: none; border-radius: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 100; transform: translateX(-50%); background: var(--text); color: white; border-radius: 999px; padding: 11px 16px; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.error-box { background: #fff1f0; color: #8f1d16; border: 1px solid #ffc9c5; padding: 12px 14px; border-radius: 14px; }
.notice-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; line-height: 1.5; }
.empty { text-align: center; padding: 42px 18px; color: var(--muted); }
.ad-placeholder { display: grid; place-items: center; min-height: 72px; margin-top: 16px; border: 1px dashed #9fb3c8; border-radius: 14px; color: var(--muted); font-size: .8rem; background: rgba(255,255,255,.82); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hidden { display: none !important; }
.storage-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); margin-bottom: 16px; }
.storage-status.connected { background: #ecfdf5; border-color: #a7f3d0; }
code { padding: 2px 6px; border-radius: 6px; background: rgba(16,42,67,.08); }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media print {
  @page { size: A4 portrait; margin: 8mm; }
  .print-page { padding: 0; background: white; }
  .print-page .printable-qr-card { width: 194mm; min-height: 277mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (max-width: 760px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .brand span, .actions .user-name { display: none; }
  .dashboard-head { grid-template-columns: 1fr; }
  .dashboard-head .btn { width: 100%; }
  .brand-hero { grid-template-columns: 1fr; }
  .hero-eyes { display: none; }
  .event-admin-hero { min-height: 350px; }
  .dashboard-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .media-card { border-radius: 10px; }
  .gallery-filters { grid-template-columns: 1fr; }
  .guest-hero { min-height: 420px; }
  .printable-qr-card { min-height: 760px; padding: 30px; }
  .qr-card-copy h1 { font-size: 3.2rem; }
  .qr-code-wrap { max-width: 280px; }
}

@media (max-width: 520px) {
  .shell { padding-inline: 12px; }
  .topbar { gap: 8px; }
  .brand img { width: 180px; }
  .actions { width: 100%; justify-content: flex-end; }
  .auth-body, .auth-head { padding-inline: 20px; }
  .guest-main { padding-inline: 10px; }
  .guest-actions { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .dashboard-actions { grid-template-columns: 1fr; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .btn { width: 100%; }
  .ranking-search-row { grid-template-columns: 1fr; }
  .viewer-nav { width: 38px; height: 54px; }
  .printable-qr-card { min-height: 690px; padding: 24px; }
  .qr-card-brand img { width: 190px; }
  .qr-card-copy h1 { font-size: 2.8rem; }
}

/* Theme system refinements: each theme changes the entire guest experience, not only the hero. */
.guest-shell.theme-kermes { background-image: linear-gradient(rgba(255,247,227,.91), rgba(255,247,227,.96)), url('../assets/themes/kermes.svg'); background-size: cover; background-position: center; }
.guest-shell.theme-kermes .guest-actions { border: 2px solid rgba(230,95,63,.28); box-shadow: 0 14px 35px rgba(111,36,25,.18); }
.guest-shell.theme-kermes .guest-panel .card, .guest-shell.theme-kermes .gallery-filters { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(255,247,224,.96)); border: 2px solid rgba(230,95,63,.20); }
.guest-shell.theme-kermes .upload-zone { border-color: #e65f3f; background: repeating-linear-gradient(-45deg, #fff8e8, #fff8e8 14px, #fff2d1 14px, #fff2d1 28px); }
.guest-shell.theme-kermes .rank-pos { background: #ffe0a0; }

.guest-shell.theme-night .guest-actions { background: rgba(16,10,43,.86); border: 1px solid rgba(167,139,250,.35); }
.guest-shell.theme-night .guest-actions button { color: #ede9fe; }
.guest-shell.theme-night .upload-zone { background: rgba(255,255,255,.07); border-color: #a78bfa; }
.guest-shell.theme-night .upload-file-card { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.guest-shell.theme-night .muted { color: #c4b5fd; }

.guest-shell.theme-family .guest-actions { border: 1px solid rgba(15,118,110,.18); box-shadow: 0 14px 35px rgba(15,118,110,.12); }
.guest-shell.theme-family .guest-panel .card, .guest-shell.theme-family .gallery-filters { background: rgba(255,253,247,.96); }
.guest-shell.theme-family .upload-zone { border-color: #0f766e; background: linear-gradient(145deg, #fffdf7, #ecfeff); }

.guest-shell.theme-professional .guest-actions { border-radius: 10px; background: rgba(255,255,255,.97); border-top: 4px solid #0f766e; }
.guest-shell.theme-professional .guest-actions button { border-radius: 7px; }
.guest-shell.theme-professional .gallery-filters, .guest-shell.theme-professional .upload-zone, .guest-shell.theme-professional .upload-file-card { border-radius: 8px; }
.guest-shell.theme-professional .guest-panel .card { background: rgba(255,255,255,.97); }

/* The official dark logo remains legible over every event artwork. */
.guest-logo { background: rgba(255,255,255,.94); padding: 9px 13px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.qr-card-brand { width: max-content; max-width: 100%; padding: 9px 13px; border-radius: 16px; background: rgba(255,255,255,.95); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.qr-card-brand img { display: block; }

/* v1.3.0 celebratory refresh */
.celebration-hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.16), transparent 12rem),
    radial-gradient(circle at 84% 22%, rgba(245,182,58,.32), transparent 16rem),
    radial-gradient(circle at 70% 78%, rgba(255,255,255,.10), transparent 14rem),
    linear-gradient(135deg, #071b32 0%, #0f766e 55%, #16a085 100%);
}
.celebration-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 8% 30%, rgba(255,255,255,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 18% 68%, rgba(255,255,255,.65) 0 2px, transparent 3px),
    radial-gradient(circle at 56% 26%, rgba(245,182,58,.8) 0 3px, transparent 4px),
    radial-gradient(circle at 74% 62%, rgba(255,255,255,.5) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 28%, rgba(245,182,58,.82) 0 4px, transparent 5px);
  pointer-events: none;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero-chips .badge { background: rgba(255,255,255,.16); color: white; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); }
.hero-chips .badge.pro { background: rgba(245,182,58,.24); color: #fff7e0; border-color: rgba(245,182,58,.34); }
.hero-chips .badge.active { background: rgba(34,197,94,.18); color: #e7fff2; border-color: rgba(34,197,94,.28); }
.start-grace-note { margin-top: 16px; }
.event-detail-line:empty, .qr-event-details:empty { display: none; }
