/* EventManager public app — mobile first, themed by CSS variables set in _layout.php */
:root {
  --em-primary: #FCC900; --em-ink: #141515; --em-accent: #00A658; --em-surface: #F6F5EF;
  --em-card: #ffffff; --em-muted: #6b6f72; --em-line: #e6e4dc; --em-danger: #D6362B; --em-warn: #E8A000;
  --em-radius: 16px; --em-shadow: 0 2px 10px rgba(20, 21, 21, .06);
  --em-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--em-font); background: var(--em-surface); color: var(--em-ink); line-height: 1.45; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.em-nonav { padding-bottom: 24px; }
a { color: var(--em-ink); }
h2 { font-size: 1.35rem; margin: .2rem 0 .4rem; line-height: 1.2; }
p { margin: .4rem 0; }
small { font-size: .82rem; }
img { max-width: 100%; }

/* Header */
.em-header { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--em-ink); color: #fff; position: sticky; top: 0; z-index: 20; min-height: 64px; }
.em-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.em-logo { height: 52px; width: auto; max-width: 120px; object-fit: contain; display: block; }
.em-logo-fallback { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--em-primary); color: var(--em-ink); font-size: 1.3rem; }
.em-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.em-brand-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-brand-text small { opacity: .75; }
.em-practice { margin-left: auto; background: #0dcaf0; color: #062c33; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.em-notice { background: var(--em-primary); color: var(--em-ink); padding: 8px 16px; font-size: .9rem; }

/* Layout */
.em-main { padding: 12px 16px; max-width: 640px; margin: 0 auto; }
.em-card { background: var(--em-card); border-radius: var(--em-radius); box-shadow: var(--em-shadow); padding: 14px 16px; margin: 0 0 12px; }
.em-card-accent { border-left: 6px solid var(--em-accent); }
.em-card-head { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.em-card-head .bi { color: var(--em-accent); }
.em-hero { text-align: center; padding: 20px 8px; }
.em-hero h2 { font-size: 1.6rem; }
.em-cta { text-align: center; margin: 8px 0 14px; }
.em-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.em-tile { background: var(--em-card); border-radius: var(--em-radius); box-shadow: var(--em-shadow); padding: 14px 6px; text-align: center; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.em-tile .bi { font-size: 1.5rem; color: var(--em-accent); }
.em-tile-accent { background: var(--em-primary); }
.em-tile-accent .bi { color: var(--em-ink); }
.em-muted { color: var(--em-muted); }
.em-small { font-size: .85rem; }
.em-center { text-align: center; }
.em-block { display: block; }
.em-mt { margin-top: 10px; }
.em-grow { flex: 1 1 auto; min-width: 0; }
.em-row { display: flex; gap: 8px; align-items: center; }
.em-row-wrap { flex-wrap: wrap; }
.em-img { width: 100%; border-radius: 10px; }
.em-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; color: var(--em-accent); }
.em-social { margin: 0 4px; font-size: 1.2rem; color: var(--em-ink); }

/* Buttons and inputs */
.em-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid transparent; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: #eee; color: var(--em-ink); min-height: 44px; }
.em-btn-primary { background: var(--em-primary); }
.em-btn-accent { background: var(--em-accent); color: #fff; }
.em-btn-ghost { background: transparent; border-color: var(--em-line); }
.em-btn-lg { width: 100%; font-size: 1.1rem; min-height: 54px; margin: 8px 0; }
.em-btn-sm { padding: 6px 10px; min-height: 36px; font-size: .85rem; border-radius: 10px; }
.em-btn:disabled { opacity: .5; cursor: default; }
.em-icon-btn { border: 0; background: transparent; color: var(--em-muted); font-size: 1.2rem; padding: 6px; cursor: pointer; }
.em-input { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--em-line); border-radius: 12px; background: #fff; min-height: 44px; }
.em-input:focus { outline: none; border-color: var(--em-accent); }
.em-input-code { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; font-size: 1.2rem; }
.em-input-short { max-width: 90px; }
.em-input-initial { max-width: 58px; text-transform: uppercase; text-align: center; }
.em-form label { display: block; font-weight: 600; margin: 10px 0 4px; }
.em-form label .em-input { margin-top: 4px; font-weight: 400; }
.em-filepick { display: block; border: 2px dashed var(--em-line); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; }
.em-filepick input { display: none; }
.em-filepick span { font-weight: 700; display: block; }
.em-filepick small { color: var(--em-muted); }
.em-check { display: inline-flex; align-items: center; gap: 4px; padding: 6px; }
.em-details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.em-linklist { list-style: none; margin: 0; padding: 0; }
.em-linklist li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--em-line); }

/* Alerts and toast */
.em-alert { background: #fff4e5; border-left: 5px solid var(--em-warn); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; display: flex; gap: 8px; align-items: flex-start; }
.em-alert-ok { background: #e8f7ef; border-color: var(--em-accent); }
.em-alert-info { background: #eef4ff; border-color: #4f7df3; }
.em-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--em-ink); color: #fff; padding: 10px 16px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 90vw; text-align: center; font-weight: 600; }
.em-toast.is-on { opacity: 1; transform: translateX(-50%); }
body.em-nonav .em-toast { bottom: 24px; }

/* People lists */
.em-people { list-style: none; margin: 0; padding: 0; }
.em-people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--em-line); }
.em-people li:last-child { border-bottom: 0; }
.em-people small { display: block; color: var(--em-muted); }
.em-people-pick label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.em-people-pick input { width: 24px; height: 24px; accent-color: var(--em-accent); }
.em-people-pick li.is-hit { background: #e8f7ef; border-radius: 8px; padding-left: 6px; }
.em-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--em-accent); }
.em-dot-lg { width: 20px; height: 20px; }
.em-places { list-style: none; margin: 0; padding: 0; }
.em-places li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--em-line); flex-wrap: wrap; }
.em-places .em-input { flex: 1 1 120px; min-height: 40px; padding: 6px 10px; }
.em-places .em-input-email { flex: 1 1 100%; font-size: .9rem; }
.em-place-meta { flex-basis: 100%; }

/* Chips and states */
.em-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.em-chips-scroll { flex-wrap: wrap; }
.em-map-tools .em-chip, .em-chips-compact .em-chip { padding: 4px 9px; font-size: .78rem; border-width: 1.5px; }
.em-chip { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--em-line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: .85rem; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--em-ink); cursor: pointer; font-family: inherit; max-width: 100%; }
.em-checkin .em-chip { white-space: normal; text-align: left; }
.em-chip.is-on { background: var(--em-ink); color: #fff; border-color: var(--em-ink); }
.em-chip[style*="--chip"].is-on { background: var(--chip); border-color: var(--chip); }
.em-code-chip { display: inline-block; background: var(--em-ink); color: var(--em-primary); font-weight: 800; letter-spacing: .15em; padding: 4px 10px; border-radius: 8px; font-size: 1rem; }
.em-code-chip-sm { font-size: .8rem; padding: 2px 7px; }
.em-state-empty { color: var(--em-muted); }
.em-state-quiet { background: #e8f7ef; border-color: #bfe8d2; color: #0b6b3f; }
.em-state-busy { background: #fff4d6; border-color: #f5d87a; color: #7a5600; }
.em-state-full { background: #fde7e5; border-color: #f3b4ae; color: #8d1f16; }
.em-dot.em-state-quiet { background: var(--em-accent); } .em-dot.em-state-busy { background: var(--em-warn); } .em-dot.em-state-full { background: var(--em-danger); }
.em-activity-head { margin-bottom: 6px; }
.em-activity-head h2 { margin: 6px 0 2px; }

/* After check-in: rating + suggestion */
.em-after { margin-top: 4px; }
.em-done { text-align: center; padding: 18px 10px; }
.em-done .bi { font-size: 3rem; color: var(--em-accent); }
.em-q { border: 0; padding: 0; margin: 0 0 14px; }
.em-q legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.em-req { color: var(--em-danger); }
.em-faces { display: flex; justify-content: space-between; gap: 4px; }
.em-faces label, .em-scale label, .em-options label { cursor: pointer; }
.em-faces input, .em-scale input, .em-options input { position: absolute; opacity: 0; width: 0; height: 0; }
.em-faces span { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; font-size: 1.9rem; border-radius: 50%; border: 2px solid var(--em-line); background: #fff; transition: .15s; }
.em-faces input:checked + span { border-color: var(--em-accent); background: #e8f7ef; transform: scale(1.12); }
.em-scale { display: flex; flex-wrap: wrap; gap: 6px; }
.em-scale span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--em-line); font-weight: 700; background: #fff; }
.em-scale input:checked + span { background: var(--em-primary); border-color: var(--em-primary); }
.em-options { display: flex; flex-wrap: wrap; gap: 6px; }
.em-options span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--em-line); font-weight: 600; background: #fff; }
.em-options input:checked + span { background: var(--em-ink); color: #fff; border-color: var(--em-ink); }
.em-suggest { background: linear-gradient(135deg, #fff 0, #f2fbf6 100%); border: 2px solid var(--em-accent); }
.em-suggest h3 { margin: 4px 0; font-size: 1.15rem; }
.em-suggest .em-alt { font-size: .85rem; color: var(--em-muted); }

/* Map */
.em-mapwrap { margin: -4px -16px 0; }
.em-map-tools { padding: 0 16px; }
.em-map-frame { position: relative; }
.em-map-stage { position: relative; overflow: auto; background: #ddd; touch-action: pan-x pan-y; max-height: 72vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; cursor: grab; }
.em-map-stage.is-dragging { cursor: grabbing; user-select: none; }
.em-map-inner { position: relative; width: 100%; overflow: hidden; } /* clipped so pins at the edge never widen the scroll area */
.em-map-inner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.em-map-pins { position: absolute; inset: 0; }
.em-map-areas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.em-map-areas polygon { fill-opacity: .28; stroke-width: 2; vector-effect: non-scaling-stroke; }
.em-map-areas .em-area-mask { fill-opacity: 1; }
.em-map-areas mask polygon { fill: #000; fill-opacity: 1; stroke: none; }
.em-map-areas .em-area-edge { stroke-width: 3; stroke-dasharray: 6 4; }
.em-map-areas text { font-size: 2.4px; font-weight: 800; fill: #141515; paint-order: stroke; stroke: #fff; stroke-width: .6px; text-anchor: middle; dominant-baseline: middle; }
.em-pin { position: absolute; transform: translate(-50%, -100%); border: 0; background: transparent; padding: 0; cursor: pointer; font-family: inherit; }
.em-pin-act { display: flex; flex-direction: column; align-items: center; }
.em-pin-act .em-pin-dot { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--em-accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: width .15s, height .15s; display: flex; align-items: center; justify-content: center; }
.em-pin-act .em-pin-dot i { transform: rotate(45deg); color: #fff; font-size: 11px; line-height: 1; }
.em-pin-act.is-focus .em-pin-dot i { font-size: 14px; }
.em-act-ic { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1rem; flex-shrink: 0; background: var(--em-accent); }
.em-act-ic.em-state-busy { background: var(--em-warn); } .em-act-ic.em-state-full { background: var(--em-danger); } .em-act-ic.em-state-empty { background: #8d9397; }
.em-act-ic.em-act-ic-ink { background: var(--em-ink); } .em-act-ic.em-act-ic-lg { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 14px; }
.em-pin-static i { font-size: .55rem; } .em-pin-static.is-done i { font-size: .75rem; }
.em-pin-act.em-state-busy .em-pin-dot { background: var(--em-warn); } .em-pin-act.em-state-full .em-pin-dot { background: var(--em-danger); } .em-pin-act.em-state-empty .em-pin-dot { background: #8d9397; } .em-pin-act.is-closed .em-pin-dot { background: #555; opacity: .6; }
.em-pin-act .em-pin-label { display: none; font-size: .6rem; font-weight: 700; background: rgba(255,255,255,.92); padding: 1px 5px; border-radius: 6px; margin-top: 2px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.em-map-stage.show-labels .em-pin-label, .em-pin-act.is-focus .em-pin-label { display: block; }
.em-pin-act.is-focus { z-index: 5; }
.em-pin-act.is-focus .em-pin-dot { width: 26px; height: 26px; border-width: 3px; animation: em-bounce 1s infinite; box-shadow: 0 0 0 6px rgba(252,201,0,.55), 0 2px 6px rgba(0,0,0,.4); }
.em-pin-act.is-focus .em-pin-label { background: var(--em-ink); color: #fff; font-size: .72rem; }
.em-pin-fac { transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 50%; background: var(--em-ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.em-pin.is-hidden { display: none; }
.em-map-arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.em-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.em-key li { display: flex; align-items: center; gap: 8px; font-size: .82rem; padding: 2px 0; }
.em-key svg { flex-shrink: 0; }
.em-map-key { margin: 8px 16px 0; }
.em-map-key[hidden], .em-chip[hidden] { display: none; }
.em-map-label { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-weight: 800; white-space: nowrap; background: rgba(255,255,255,.88); padding: 1px 6px; border-radius: 6px; line-height: 1.2; text-shadow: 0 0 2px #fff; }
.em-map-label.no-bg { background: none; padding: 0; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.em-map-label-s { font-size: .62rem; } .em-map-label-m { font-size: .8rem; } .em-map-label-l { font-size: 1.05rem; }
.em-map-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 6; }
.em-map-zoom button { width: 56px; height: 56px; border-radius: 14px; border: 0; background: var(--em-primary); color: var(--em-ink); font-size: 1.7rem; font-weight: 800; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
.em-map-zoom button[data-zoom="fit"] { background: #fff; font-size: 1.2rem; }
.em-map-zoom button:disabled { opacity: .4; }
.em-map-zoom button:active { transform: scale(.94); }
@keyframes em-bounce { 0%, 100% { transform: rotate(-45deg) translate(0, 0); } 50% { transform: rotate(-45deg) translate(-4px, -4px); } }
.em-actlist li.is-on { background: #fff8d6; border-radius: 8px; }
.em-actlist li.no-pin { opacity: .7; }
.em-map-mini { position: relative; border-radius: 10px; overflow: hidden; margin: 8px 0; }
.em-map-mini img { display: block; width: 100%; }
.em-map-mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.em-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.2); padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 55; max-height: 60vh; overflow: auto; }
.em-sheet h3 { margin: 0 0 4px; }
.em-sheet-close { position: absolute; right: 10px; top: 8px; }
.em-actlist { list-style: none; margin: 0; padding: 0 16px; }
.em-actlist li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--em-line); cursor: pointer; }
.em-actlist small { display: block; color: var(--em-muted); }
.em-card .em-actlist { padding: 0; }

/* Static map with facility pins (info page) */
.em-map-static { position: relative; border-radius: 10px; overflow: hidden; }
.em-map-static img { display: block; width: 100%; }
.em-map-static .em-pin-fac { position: absolute; }
.em-pin-static { position: absolute; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: var(--em-accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; }
.em-pin-static.is-done { width: 20px; height: 20px; background: var(--em-primary); color: var(--em-ink); }
.em-faclist { list-style: none; margin: 0; padding: 0; }
.em-faclist li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--em-line); }
.em-faclist .em-pin-fac { position: static; transform: none; flex-shrink: 0; }
.em-faclist small { display: block; color: var(--em-muted); }

/* Leaderboard */
.em-board { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.em-board li { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--em-line); border-radius: 8px; }
.em-board li.is-mine { background: #fff8d6; }
.em-board small { display: block; color: var(--em-muted); }
.em-rank { width: 34px; text-align: center; font-weight: 800; font-size: 1.2rem; }
.em-score { text-align: right; font-weight: 800; font-size: 1.2rem; line-height: 1; }
.em-score small { display: block; font-weight: 400; font-size: .7rem; color: var(--em-muted); }
.em-favs { margin: 0; padding-left: 20px; }
.em-favs li { display: flex; gap: 8px; padding: 4px 0; }
.em-stars { color: var(--em-warn); white-space: nowrap; }

/* Passport */
.em-passport-head { display: flex; align-items: center; gap: 12px; }
.em-passport-qr { flex-shrink: 0; display: block; }
.em-passport-qr img { width: 84px; height: 84px; border-radius: 10px; background: #fff; padding: 4px; box-shadow: var(--em-shadow); image-rendering: pixelated; display: block; }
.em-stats { display: flex; gap: 8px; margin: 10px 0; }
.em-stats div { flex: 1; background: var(--em-surface); border-radius: 12px; padding: 8px; text-align: center; }
.em-stats strong { display: block; font-size: 1.3rem; line-height: 1.1; }
.em-stats small { color: var(--em-muted); }
.em-awards { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.em-award { background: var(--em-primary); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .85rem; }
.em-award small { font-weight: 400; }
.em-timeline { list-style: none; margin: 8px 0; padding: 0; }
.em-timeline li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-left: 3px solid var(--em-accent); padding-left: 10px; margin-left: 6px; }
.em-timeline small { display: block; color: var(--em-muted); }
.em-time { font-weight: 700; font-variant-numeric: tabular-nums; width: 46px; }
.em-message { padding: 30px 16px; }
.em-message-icon { font-size: 3rem; color: var(--em-accent); }

/* Digital badge */
.em-badge { text-align: center; padding: 18px 16px 22px; }
.em-badge .em-badge-qr { width: min(78vw, 360px); height: auto; border-radius: 16px; background: #fff; padding: 10px; box-shadow: var(--em-shadow); image-rendering: pixelated; }
.em-badge h2 { margin: 12px 0 2px; font-size: 1.6rem; }
.em-badge .em-code-chip { font-size: 1.4rem; padding: 6px 16px; margin-top: 8px; }
.em-badge-switch { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
body.em-bright { background: #fff; }

/* Tagging, share page */
.em-tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.em-tag { cursor: pointer; }
.em-tag input { position: absolute; opacity: 0; width: 0; height: 0; }
.em-tag span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 2px solid var(--em-line); background: #fff; font-size: .85rem; font-weight: 600; }
.em-tag input:checked + span { background: var(--em-ink); color: #fff; border-color: var(--em-ink); }
.em-tag.is-nophoto span { border-style: dashed; color: var(--em-danger); }
.em-tag.is-nophoto input:checked + span { background: var(--em-danger); border-color: var(--em-danger); color: #fff; }
.em-photo-cap { display: block !important; }
.em-tagform { margin-top: 6px; }
.em-switch { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 600; cursor: pointer; }
.em-switch input { width: 22px; height: 22px; accent-color: var(--em-accent); }
.em-sharebox { background: var(--em-surface); border-radius: 12px; padding: 12px; }
.em-sharelink { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-all; }
.em-share-head { display: flex; align-items: center; gap: 12px; }
.em-stats-card { margin: 0 0 12px; }
.em-daylist { list-style: none; margin: 0; padding: 0; }
.em-daylist li { padding: 8px 0; border-bottom: 1px solid var(--em-line); }
.em-daylist li strong { display: block; margin-bottom: 4px; }
.em-daylist .em-chips { margin: 0; }
.em-sharegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.em-sharegrid figure { margin: 0; border-radius: 10px; overflow: hidden; background: #f0efe8; }
.em-sharegrid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.em-sharegrid figcaption { font-size: .75rem; padding: 4px 8px; color: var(--em-muted); }

/* Showcase site (next year's public page) */
body.em-site { padding-bottom: 0; }
body.em-site .em-main { max-width: none; padding: 0 0 24px; }
.em-hero-site { text-align: center; padding: 36px 8px 28px; }
.em-hero-logo { height: 120px; width: auto; max-width: 70vw; object-fit: contain; margin-bottom: 14px; }
.em-hero-site h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin: 0 0 6px; letter-spacing: -.02em; line-height: 1.05; }
.em-hero-strap { font-size: 1.15rem; color: var(--em-muted); margin: 0 0 10px; }
.em-hero-when { font-weight: 700; font-size: 1.05rem; margin: 6px 0 14px; }
.em-hero-cta { display: inline-flex; width: auto; padding-left: 28px; padding-right: 28px; }
.em-site-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 20px; }
.em-site-stats div { background: var(--em-ink); color: #fff; border-radius: 14px; padding: 14px 8px; text-align: center; }
.em-site-stats strong { display: block; font-size: 1.7rem; line-height: 1.05; color: var(--em-primary); }
.em-site-stats small { color: rgba(255,255,255,.8); }
.em-site-outof { font-size: .9rem; color: rgba(255,255,255,.7); }
.em-site-section { margin: 26px 0; }
.em-site-section h2 { font-size: 1.6rem; margin: 0 0 4px; }
.em-site-intro { font-size: 1.08rem; line-height: 1.6; background: #fff; border-radius: var(--em-radius); padding: 18px 20px; box-shadow: var(--em-shadow); }
.em-site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.em-site-card { background: #fff; border-radius: var(--em-radius); padding: 14px 16px; box-shadow: var(--em-shadow); border-top: 5px solid var(--em-primary); }
.em-site-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.em-site-card p { color: #3d4043; font-size: .95rem; }
.em-site-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.em-site-meta .em-chip { font-size: .75rem; padding: 3px 9px; }
.em-site-stars { color: var(--em-warn); font-weight: 700; letter-spacing: 1px; }
.em-site-stars small { color: var(--em-muted); letter-spacing: 0; }
.em-site-quote { margin: 0; background: var(--em-ink); color: #fff; border-radius: var(--em-radius); padding: 18px 20px; font-size: 1.05rem; line-height: 1.5; }
.em-site-quote p { margin: 0 0 8px; }
.em-site-quote footer { color: var(--em-primary); font-weight: 700; font-size: .9rem; }
.em-site-gallery { columns: 2; column-gap: 8px; margin-top: 12px; }
.em-site-gallery a { display: block; break-inside: avoid; margin-bottom: 8px; border-radius: 12px; overflow: hidden; }
.em-site-gallery img { width: 100%; display: block; }
.em-site-book { background: var(--em-primary); border-radius: var(--em-radius); padding: 20px; }
.em-site-book .em-btn-ghost { background: #fff; border-color: #fff; }
.em-site-footer { text-align: center; padding: 20px 0 10px; color: var(--em-muted); }
.em-site-footer a { color: var(--em-ink); }
@media (min-width: 640px) { .em-site-gallery { columns: 3; } }
@media (min-width: 900px) { .em-site-gallery { columns: 4; } }

/* Leader / instructor */
.em-leaderhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.em-leaderhead h2 { margin: 0; }
.em-subtabs { display: flex; gap: 4px; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 12px; box-shadow: var(--em-shadow); }
.em-subtabs a { flex: 1; text-align: center; padding: 8px 4px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.em-subtabs a.is-active { background: var(--em-ink); color: #fff; }
.em-count { background: var(--em-danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .7rem; }
.em-photogrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.em-photo { margin: 0; background: #fff; border-radius: var(--em-radius); overflow: hidden; box-shadow: var(--em-shadow); }
.em-photo img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.em-photo figcaption { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .9rem; }
.em-photo-pending { outline: 3px solid var(--em-warn); }
.em-photo-rejected { opacity: .55; }
.em-update { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--em-line); }
.em-update.em-dim { opacity: .6; }
.em-pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.em-pill-warn { background: var(--em-warn); color: #000; }
.em-pill-muted { background: var(--em-line); color: var(--em-muted); }
.em-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.em-row2 label { margin-top: 10px; }
.em-btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.em-btn-row-tight { margin-top: 0; gap: 0; flex-shrink: 0; }
.em-btn-row-tight form { display: contents; }
.em-prose p { margin: .4rem 0; } .em-prose ul { padding-left: 20px; }
.em-person-card { background: var(--em-surface); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.em-awardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.em-awardbtn { border: 2px solid var(--em-line); background: #fff; border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-weight: 700; cursor: pointer; }
.em-awardbtn .bi { font-size: 1.5rem; color: var(--em-accent); }
.em-awardbtn small { color: var(--em-muted); }
.em-awardbtn:disabled { opacity: .4; }
.em-awardbtn.is-busy { border-color: var(--em-primary); }
.em-lost { list-style: none; margin: 0; padding: 0; }
.em-lost li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--em-line); }
.em-lost img, .em-lost-ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--em-surface); display: inline-flex; align-items: center; justify-content: center; color: var(--em-muted); flex-shrink: 0; }
.em-lost small { display: block; color: var(--em-muted); }

/* Tab bar */
.em-tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--em-line); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 50; }
.em-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; text-decoration: none; color: var(--em-muted); border: 0; background: transparent; font-family: inherit; min-width: 46px; flex: 1; }
.em-tab .bi { font-size: 1.35rem; }
.em-tab.is-active { color: var(--em-ink); }
.em-tab-scan { margin-top: -22px; }
.em-tab-scan-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--em-primary); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.25); color: var(--em-ink); }
.em-tab-scan-btn .bi { font-size: 1.6rem; }

/* Scanner overlay */
.em-scanner { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; }
.em-scanner[hidden] { display: none; }
.em-scanner-top { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
.em-scanner video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.em-scanner-form { background: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.em-scanner-form label { font-weight: 600; display: block; margin-bottom: 6px; }

@media (min-width: 560px) { .em-photogrid { grid-template-columns: 1fr 1fr; } .em-mapwrap { margin: 0; } .em-actlist { padding: 0; } }
@media (prefers-reduced-motion: reduce) { .em-pin-act.is-focus .em-pin-dot { animation: none; } }

/* ----- leader area: visibly different from the participant app ----- */
.em-leader-mode .em-header { border-bottom: 4px solid var(--em-accent); }
.em-leader-pill { background: var(--em-accent); color: #fff; }
.em-leader-band { background: var(--em-accent); color: #fff; }
.em-tabbar-leader { background: var(--em-ink); }
.em-tabbar-leader .em-tab { color: rgba(255,255,255,.75); }
.em-tabbar-leader .em-tab.is-active { color: var(--em-primary); }
.em-tab-badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--em-danger); color: #fff; font-size: .62rem; line-height: 16px; text-align: center; vertical-align: top; }
/* ----- how-to guide ----- */
.em-howto-switch { display: flex; gap: 8px; margin: 0 16px 12px; }
.em-howto-switch a { flex: 1; text-align: center; padding: 8px; border-radius: 10px; background: var(--em-card); box-shadow: var(--em-shadow); font-weight: 700; text-decoration: none; color: inherit; }
.em-howto-switch a.is-on { background: var(--em-ink); color: #fff; }
.em-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.em-steps li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--em-line); align-items: flex-start; }
.em-steps li:last-child { border-bottom: 0; }
.em-steps .em-step-ic { position: relative; flex-shrink: 0; width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; background: rgba(0,166,88,.12); color: var(--em-accent); }
.em-steps .em-step-ic::after { counter-increment: step; content: counter(step); position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--em-ink); color: #fff; font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.em-steps .em-step-ic.is-primary { background: rgba(252,201,0,.3); color: var(--em-ink); }
.em-steps .em-step-ic.is-danger { background: rgba(214,54,43,.12); color: var(--em-danger); }
.em-steps li > div > strong { display: block; margin-bottom: 2px; }
.em-steps p { margin: 0; color: var(--em-muted); font-size: .9rem; }
.em-howto-phone { margin: 10px auto 0; width: 150px; border: 3px solid var(--em-ink); border-radius: 18px; padding: 10px 8px; background: #fff; text-align: center; }
.em-howto-phone .em-code-chip { font-size: 1rem; }
.em-howto-phone small { display: block; color: var(--em-muted); font-size: .7rem; margin-top: 4px; }
.em-dont { background: rgba(214,54,43,.08); border-left: 4px solid var(--em-danger); padding: 10px 12px; border-radius: 8px; }
@media print { .em-tabbar, .em-header, .em-notice, .em-howto-switch { display: none !important; } .em-main { padding: 0; } .em-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; } }
.em-places-head { background: var(--em-surface); padding: 4px 8px !important; border-radius: 6px; margin-top: 8px; }
.em-input-section { max-width: 110px; font-size: .8rem; padding: 6px 8px; }
.em-awardgrid-radio .em-awardbtn { cursor: pointer; position: relative; }
.em-awardgrid-radio .em-awardbtn input { position: absolute; opacity: 0; width: 0; height: 0; }
.em-awardgrid-radio .em-awardbtn:has(input:checked) { outline: 3px solid var(--em-primary); background: rgba(252,201,0,.25); }
.em-label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.em-section-logo { height: 44px; width: auto; max-width: 110px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 3px 6px; box-sizing: content-box; }
.em-section-logo-sm { height: 22px; max-width: 60px; margin-right: 6px; vertical-align: middle; }

/* ---- Leader accounts, bookings and health forms (EM-BOOKINGS-2026-11-16) ---- */
.em-auth { max-width: 520px; margin-left: auto; margin-right: auto; }
.em-check-line { display: flex !important; align-items: flex-start; gap: 8px; font-weight: 400 !important; margin: 8px 0 !important; }
.em-check-line input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.em-pill-ok { background: #d1f2df; color: #0b5a32; }
.em-pill-bad { background: #fde2e1; color: #8a1c15; }
.em-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .95rem; }
.em-table td, .em-table th { padding: 7px 4px; border-bottom: 1px solid var(--em-line); text-align: left; vertical-align: top; }
.em-table .em-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.em-table .em-total td { font-weight: 700; border-top: 2px solid var(--em-ink); }
.em-kv th { width: 42%; font-weight: 600; color: var(--em-muted); font-size: .88rem; }
.em-kv .em-flag td { background: #fff4e5; }
.em-todo { padding-left: 22px; }
.em-todo li { margin: 8px 0; }
.em-todo li.is-done { color: var(--em-muted); }
.em-todo li.is-done::marker { content: "✓  "; color: var(--em-accent); font-weight: 700; }
.em-book-sections li { flex-wrap: nowrap; }
.em-book-total { font-size: 1.15rem; margin: 10px 0; }
.em-formlist li form { margin: 0; }
.em-form-h { font-size: 1.05rem; margin: 22px 0 6px; padding-top: 12px; border-top: 1px solid var(--em-line); }
.em-yn { border: 0; padding: 0; margin: 14px 0 6px; }
.em-yn legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.em-yn .em-check-line { display: inline-flex !important; margin-right: 18px !important; }
.em-yn-details { margin-top: 6px; }
.em-field-error { display: block; color: #b42318; font-weight: 600; margin: 2px 0 8px; }
.em-hf .em-input[type=file] { padding: 8px; }
