:root {
  --ink: #1f2a44; --muted: #6b7280; --line: #e5e7eb; --bg: #fff; --card: #fff; --hover: #eef2ff;
  --saved: #e0457b; --visited: #2a9d5c; --sel: #1d4ed8;
  --floor: #f6f3ee; --wall: #9aa3b2; --zone-bg: #e3eef7; --zone-ink: #3b5068;
  --g-vendors: #a9d5a4; --g-artists: #ecd9a0; --g-clubs: #f0b8ae; --g-other: #d7b3dd; --g-rooms: #90caf9; --g-guests: #f0b8ae;
  --hall: #c9e4f6; --service: #d6d8da;
  color-scheme: light dark;
}
/* dark tokens: follow the system unless the viewer picked a theme with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e5e7eb; --muted: #9ca3af; --line: #374151; --bg: #111827; --card: #1f2937; --hover: #273449;
    --floor: #1f2630; --wall: #6b7280; --zone-bg: #263548; --zone-ink: #cbd5e1; --hall: #2b4660; --service: #3b4350;
    --g-rooms: #2f6fa3; --room-ink: #f1f5f9;
  }
}
:root[data-theme="dark"] {
    --ink: #e5e7eb; --muted: #9ca3af; --line: #374151; --bg: #111827; --card: #1f2937; --hover: #273449;
    --floor: #1f2630; --wall: #6b7280; --zone-bg: #263548; --zone-ink: #cbd5e1; --hall: #2b4660; --service: #3b4350;
    --g-rooms: #2f6fa3; --room-ink: #f1f5f9;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; font: 15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
#app { display: flex; flex-direction: column; height: 100dvh; }
header { padding: 10px 16px 0; }
header .titlerow { display: flex; align-items: center; gap: 8px; }
header h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .sub { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1 { margin: 0; font-size: 1.15rem; }
h1 a { color: inherit; text-decoration: none; }
h1 a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }

.controls { padding: 8px 16px; display: grid; gap: 8px; }
.mi { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -.2em; }
.searchrow { display: flex; gap: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); }
.search:focus-within { border-color: var(--sel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel) 18%, transparent); }
.search input, .search input::placeholder { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; padding: 8px 0 !important; background: none !important; color: var(--ink); font: inherit; }
.filterbtn { display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; font: inherit; cursor: pointer; }
.filterbtn.on { border-color: var(--ink); }
.filterbtn .badge { background: var(--sel); color: #fff; border-radius: 999px; font-size: .72rem; min-width: 1.3em; padding: 0 5px; text-align: center; }
.chips .sep { width: 1px; background: var(--line); margin: 2px 2px; }
.chip .mi { width: 1em; height: 1em; }
.chip.clear { color: var(--muted); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn.push { margin-left: auto; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease-out; }
.modal { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); color: var(--ink); border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); outline: 0; animation: pop .15s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal h2 { margin: 0; font-size: 1.1rem; }
.modal h3 { margin: 14px 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; background: var(--card); color: inherit; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost:disabled { opacity: .4; cursor: default; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 820px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
.modal.doc { width: min(620px, 100%); }
.modal.doc .modal-head { margin-bottom: -28px; }
.modal.doc h1 { font-size: 1.35rem; margin: 4px 40px 10px 0; }
.modal.doc h2 { font-size: 1rem; margin: 18px 0 6px; }
.modal.doc p, .modal.doc li { line-height: 1.55; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
input[type=search], textarea { background: var(--card); color: inherit; }
input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .actions button, .zoom button { border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 999px; padding: 4px 10px; font: inherit; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.chip.saved.on, .actions .saved.on { background: var(--saved); border-color: var(--saved); color: #fff; }
.chip.visited.on, .actions .visited.on { background: var(--visited); border-color: var(--visited); color: #fff; }
.g-rooms { --c: var(--g-rooms); } .g-guests { --c: var(--g-guests); } .g-vendors { --c: var(--g-vendors); } .g-artists { --c: var(--g-artists); } .g-clubs { --c: var(--g-clubs); } .g-other { --c: var(--g-other); }

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 0 16px 8px; }
.map { position: relative; flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.scroller { width: 100%; height: 100%; overflow: auto; touch-action: pan-x pan-y; }
.scroller svg { display: block; width: 100%; height: auto; }
.zoom { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; gap: 4px; }
.mapcol { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.mapbar { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--hover); }
.mapbar button { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.mapbar button .name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.mapbar button small { font-size: .75rem; }
.mapbar button:hover { color: var(--ink); }
.mapbar button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.mapbar button.on small { color: var(--muted); }
.zoom button { width: 32px; height: 32px; padding: 0; font-size: 1.1rem; }
.zoom button { display: inline-flex; align-items: center; justify-content: center; }
.map.full { position: fixed; inset: 0; z-index: 15; height: auto !important; border: 0; border-radius: 0; }
.map.full .zoom { top: calc(8px + env(safe-area-inset-top)); }
.map.full .scroller { position: absolute; inset: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0; width: auto; height: auto; }
.scroller { overscroll-behavior: contain; }
html.mapfull, html.mapfull body { overflow: hidden; }
.fullcard { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.fullcard .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fullsheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; max-height: 65%; overflow: auto; overscroll-behavior: contain; padding: 4px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25); animation: pop .15s ease-out; }
.fullsheet .detail { border: 0; padding: 4px 2px; }
.sheethandle { display: block; width: 100%; padding: 6px 0 8px; border: 0; background: none; cursor: pointer; }
.sheethandle span { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line); }
.fullcard .what span { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* floor plan */
.floor text { font-family: inherit; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; }
.area.room rect { fill: var(--floor); stroke: var(--wall); stroke-width: 3; }
.area.floor rect, .area.floor polygon, .area.footprint polygon { fill: var(--floor); }
.area.footprint polygon { stroke: var(--wall); stroke-width: 2; stroke-linejoin: round; }
.area.service polygon, .area.service rect { stroke: var(--wall); stroke-width: 1; }
.area.stage polygon { fill: #6b7280; }
.area.arrow polygon { stroke-width: 1.2; }
.area.line polyline { fill: none; stroke-linecap: round; }
.area.line.wall polyline { stroke: var(--wall); stroke-width: 2; stroke-linejoin: round; }
.area.line.step polyline { stroke: var(--ink); stroke-width: 2.2; opacity: .8; }
.venue .area.label.skywalk text { font-size: 15px; font-weight: 700; fill: var(--ink); }
.area.line.badgeline polyline { stroke: var(--wall); stroke-width: 2; stroke-dasharray: 5 5.8; stroke-linecap: butt; }
.area.line.leader polyline { stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.area.line.leader.red polyline { stroke: #d9414b; }
.area.line.leader.green polyline { stroke: #2f9a66; }
.area.leader.dot polygon { stroke: var(--card); stroke-width: 2; }
.area.leader.red.dot polygon { fill: #d9414b; }
.area.leader.green.dot polygon { fill: #2f9a66; }
.venue .area.label.edge text { font-size: 10px; font-weight: 600; fill: var(--room-ink, #1f2a44); opacity: .8; letter-spacing: .02em; }
.venue .area.label.hangout text { font-size: 12px; font-style: italic; font-weight: 600; fill: var(--muted); }
.legend { position: absolute; left: 8px; bottom: 8px; z-index: 1; font-size: .72rem; color: var(--muted); background: color-mix(in srgb, var(--card) 85%, transparent); padding: 3px 8px; border-radius: 999px; display: flex; gap: 10px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; clip-path: polygon(50% 0, 100% 90%, 50% 69%, 0 90%); }
.legend i.room { background: #8b6fd1; } .legend i.badge { background: #e0a400; }
.nownext .live { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.nownext .live:hover { background: var(--hover); }
.nownext .live.on { background: color-mix(in srgb, var(--visited) 12%, transparent); }
.nownext .time { min-width: 4.2em; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nownext .live.on .time { color: var(--visited); font-weight: 700; }
.nownext .what { flex: 1; }
.nownext .where { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.area.arrow.room polygon { fill: #d9c7ea; stroke: #7c4dbd; }
.area.arrow.badge polygon { fill: #f6e36b; stroke: #d97b1f; }
.area.arrow.venue polygon { fill: #e8536f; stroke: #7a1c2a; }
.venue .area.zone rect, .venue .area.zone polygon { stroke: var(--wall); stroke-width: 1; }
.venue .area.label.small text { font-size: 12px; font-weight: 600; fill: var(--ink); }
.venue g.b rect { stroke: var(--wall); stroke-width: 1; }
.venue .area.label.wc text { font-size: 12px; }
.area.hall rect, .area.hall polygon { fill: var(--hall); }
.area.service rect, .area.service polygon { fill: var(--service); }
.area.stage rect { fill: #6b7280; }
.area.label rect { fill: none; }
.area.label text { fill: var(--ink); font-size: 44px; font-weight: 800; }
.area.label.small text { font-size: 14px; font-weight: 600; fill: var(--muted); }
.area.zone rect, .area.zone polygon { fill: var(--zone-bg); }
.area.zone text { fill: var(--zone-ink); font-size: 22px; font-weight: 600; }
.venue .area.zone text { font-size: 11px; }
.venue .area.label text { font-size: 13px; font-weight: 600; fill: var(--muted); }
.area.faint rect { fill: none; stroke: var(--wall); stroke-dasharray: 6 5; stroke-width: 1.5; }
.area.faint text { fill: var(--muted); font-size: 16px; }
.entrance { stroke: var(--floor); stroke-width: 1.4; stroke-linejoin: round; paint-order: stroke; }
.entrance.room { fill: #8b6fd1; }
.entrance.badge { fill: #e0a400; }

g.b { cursor: pointer; }
g.b rect { fill: var(--c); stroke: var(--floor); stroke-width: 1.5; transition: opacity .15s; }
g.b:hover rect { filter: brightness(.93); }
g.b .blabel { fill: #1f2a44; font-weight: 700; }
g.b.g-rooms .blabel { fill: var(--room-ink, #1f2a44); }
.venue .area.callout rect, .venue .area.callout polygon { fill: var(--card); stroke-width: 1.5; }
.venue .area.callout text { fill: var(--ink); font-size: 11px; font-weight: 600; }
g.b .bname { display: none; font-size: 6.5px; fill: #374151; }
.floor.z2 g.b .bname { display: block; }
g.b.img rect { fill: #fff; }
g.b.img image { pointer-events: none; }
g.b.saved rect { fill: var(--saved); }
g.b.saved .blabel, g.b.saved .bname, g.b.visited .blabel, g.b.visited .bname { fill: #fff; }
g.b.visited rect { fill: var(--visited); }
g.b.saved.visited rect { fill: var(--visited); stroke: var(--saved); stroke-width: 4; }
g.b.sel rect { stroke: var(--sel); stroke-width: 4; stroke-linejoin: round; }
/* dimmed listings stay opaque so nothing underneath shows through */
g.b.dim rect { fill: color-mix(in srgb, var(--c) 22%, var(--floor)); stroke: color-mix(in srgb, var(--wall) 50%, var(--floor)); }
g.b.dim .blabel, g.b.dim .bname, g.b.dim image { opacity: .35; }
g.b.hit rect { stroke: var(--sel); stroke-width: 2.5; }
.countpill rect { fill: var(--sel); }
.countpill text { fill: #fff; font-size: 10px; font-weight: 700; }
.elsewhere { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--sel); color: #fff; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; }

/* artwork-backed maps: booths are invisible hit areas until something marks them */
.overlay g.b rect { fill-opacity: 0; stroke: none; }
.overlay g.b:hover rect { fill: var(--sel); fill-opacity: .18; }
.overlay g.b .blabel, .overlay g.b .bname { display: none; }
.overlay g.b.hit rect { fill: var(--sel); fill-opacity: .22; }
.overlay g.b.saved rect { fill: var(--saved); fill-opacity: .45; }
.overlay g.b.visited rect { fill: var(--visited); fill-opacity: .45; }
.overlay g.b.saved.visited rect { fill: var(--visited); fill-opacity: .45; stroke: var(--saved); stroke-width: 4; }
.overlay g.b.sel rect { stroke: var(--sel); stroke-width: 5; stroke-linejoin: round; }

.side { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.side > * { flex-shrink: 0; }
.side .list { flex: 1 1 auto; min-height: 0; overflow: auto; }
.detail { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--card); }
.detail .row { display: flex; gap: 8px; align-items: baseline; }
.ex p { margin: 2px 0; color: var(--muted); font-size: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.tag { border: 0; border-radius: 6px; padding: 2px 8px; font: inherit; font-size: .75rem; background: var(--hover); color: var(--ink); cursor: pointer; }
.tag.on { background: var(--sel); color: #fff; }
.exname { font-weight: 600; }
.ex.person { display: flex; gap: 12px; align-items: flex-start; }
.ex .exbody { min-width: 0; flex: 1; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; object-position: center 25%; background: var(--hover); }
/* logomarks show whole on the tile instead of being cropped like photos */
.avatar[src*="-logo."] { object-fit: contain; padding: 0; background: #fff; }
.avatar.initial { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; color: var(--muted); }
.exlinks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.exlink { display: inline-flex; align-items: center; gap: 6px; }
.exlink .mi { width: 1em; height: 1em; color: var(--muted); }
.actions { display: flex; gap: 6px; }
.sched h4 { margin: 10px 0 4px; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sched details { border-left: 3px solid var(--line); padding: 2px 8px; margin: 2px 0; }
.sched details.now { border-left-color: var(--visited); background: color-mix(in srgb, var(--visited) 12%, transparent); }
.sched details.past { opacity: .55; }
.sched summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; list-style: none; }
.sched summary::-webkit-details-marker { display: none; }
.sched .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.sched .where { font-size: .75rem; color: var(--muted); margin-left: auto; white-space: nowrap; }
.sched p { margin: 4px 0 2px; font-size: .9rem; color: var(--muted); }
.linkmap { justify-self: start; }
textarea { width: 100%; min-height: 60px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; resize: vertical; }

.count { padding: 0 4px; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.list li { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li:hover, .list li.sel { background: var(--hover); }
.list li.empty { cursor: default; color: var(--muted); justify-content: center; padding: 20px; }
.list .tag { min-width: 2.6em; text-align: center; font-weight: 600; font-size: .85rem; padding: 2px 6px; border-radius: 6px; background: var(--c, var(--line)); color: #1f2a44; }
.list .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .marks { color: var(--saved); letter-spacing: 2px; }

/* signoff, same treatment as the esports portal footer */
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .75em; color: var(--muted); padding: 4px 16px 10px; }
.app-footer img { height: 1em; width: auto; vertical-align: -0.15em; }
.app-footer .signoff, .app-footer .signoff:visited, .app-footer .signoff:hover { color: inherit; text-decoration: none; }
.app-footer nav { display: flex; gap: 14px; }
.app-footer nav a { color: var(--muted); text-decoration: none; }
.app-footer nav a:hover, .app-footer nav a.active { color: var(--ink); text-decoration: underline; }

.page { max-width: 680px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.page h1 { font-size: 1.5rem; margin: 12px 0; }
.page h2 { font-size: 1.05rem; margin: 20px 0 6px; }
.page p, .page li { color: var(--ink); line-height: 1.55; }
.page .back { color: var(--sel); text-decoration: none; font-size: .9rem; }

@media (max-width: 820px) {
  #app { height: auto; min-height: 100dvh; }
  .main { grid-template-columns: 1fr; grid-template-rows: none; flex: none; }
  .map { height: 52vh; flex: none; }
  .mapbar button small { display: none; }
  .side { overflow: visible; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chip { white-space: nowrap; }
}

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: .6rem 1.25rem; background: lightyellow; color: #000; box-shadow: 0 -1px 2px rgba(0,0,0,.2); }
#blazor-error-ui .dismiss { position: absolute; right: .75rem; top: .5rem; cursor: pointer; }
