:root {
  --ink: #1A1030;
  --brand: #D61F69;
  --bg: #FFF4EC;
  --surface: #FFFFFF;
  --accent: #FFB000;
  --muted: #6B5A78;
  --line: #EBD9CF;
  --link: #007C80;
  --link-hover: #005F62;
  --header-ink: #2B0B4A;
  --night-page: #1A1030;
  --header-venue: #E9DDF7;
  --header-switch: rgba(255, 255, 255, .12);
  --header-outline: rgba(255, 255, 255, .45);
  --on-brand: #FFFFFF;
  --zone-a: #DCE6CF;
  --zone-b: #F0D6D3;
  --zone-c: #D4E0F2;
  --zone-d: #CDE7E5;
  --zone-e: #E9D5A8;
  --card-shadow: 0 1px 2px rgba(26, 16, 48, .06);
  --s4: 4px;
  --s8: 8px;
  --s12: 12px;
  --s16: 16px;
  --s24: 24px;
  --s32: 32px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --radius-pill: 999px;
  --radius-card: 16px;
  --radius-booth: 4px;
  --border: 1px;
  --nav-marker: 2px;
  --tap: 44px;
  --dot: 6px;
  --page-width: 1080px;
  --booth-width: 68px;
  --bottom-nav: calc(var(--tap) + var(--s12) + var(--border) + env(safe-area-inset-bottom, 0px));
  color-scheme: light;
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: var(--text);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

* {box-sizing: border-box}
body {margin: 0; padding-bottom: var(--bottom-nav); background: var(--bg); color: var(--ink)}
html:has(body.theme-night) {background: var(--night-page)}
body.theme-night {
  --ink: #FFFFFF;
  --bg: #1A1030;
  --surface: #24173F;
  --line: #3A2A5C;
  --muted: #B9A8D9;
  --link: #FF2E88;
  --link-hover: var(--link);
  --brand: #FF2E88;
  --night-time: #00E5D4;
  --header-ink: #140C26;
  --night-outline: #5B4785;
  --card-shadow: none;
  color-scheme: dark;
  min-height: 100svh;
}

[hidden] {display: none !important}
a {color: var(--link); text-underline-offset: .25em}
a:where(:hover) {color: var(--link-hover)}
button, input, select {font: inherit; color: inherit}
button {cursor: pointer}
:where(button, input, select, a, summary):focus-visible {outline: var(--nav-marker) solid var(--brand); outline-offset: var(--nav-marker)}
h1, h2, h3 {margin: 0; font-weight: 700; line-height: 1.3}
h1 {font-size: var(--text-xl)}
h2, h3 {font-size: var(--text-lg)}
p {margin-block: 0 var(--s8)}
.wrap {width: min(var(--page-width), calc(100% - var(--s32))); margin-inline: auto}
main {padding-block: var(--s24) var(--s32)}

.masthead {color: var(--on-brand); background: var(--header-ink)}
.masthead:has(.intro:not([hidden])) {
  background: linear-gradient(170deg, #2B0B4A 0%, #2B0B4A max(62%, calc(100% - 24px)), #8E1B6E max(80%, calc(100% - 14px)), #E0237A max(91%, calc(100% - 7px)), #FF8A3D 100%);
}
.mastbar {display: flex; align-items: center; justify-content: space-between; min-height: calc(var(--tap) + var(--s8))}
.brand {font-weight: 700; letter-spacing: .08em; text-transform: uppercase}
.intro {display: grid; gap: var(--s24); padding-block: var(--s16) var(--s24)}
.date {color: var(--accent); margin: 0 0 var(--s4); font-size: var(--text-sm)}
.venue {color: var(--header-venue); margin: var(--s8) 0 0; font-size: var(--text-sm)}
.map-label {display: flex; gap: var(--s8); align-items: center}
.map-label h2 {font-size: var(--text)}
.map p {margin-block: var(--s4) var(--s8); font-size: var(--text-sm)}
.map-link, .card .find-map[href], .floor-search button[type="submit"],
.talk-source-links a:first-child, :is(#routes, #first-routes) .info-links a:first-child {
  display: inline-flex; min-height: var(--tap); align-items: center; justify-content: center;
  padding-inline: var(--s16); border: var(--border) solid transparent; border-radius: var(--radius-pill);
  background: var(--brand); color: var(--on-brand); font-size: var(--text-sm); font-weight: 700;
  text-decoration: none;
}
.masthead :focus-visible {outline-color: var(--on-brand)}

#directory {min-height: 100svh}
.section-title, .results-bar {display: flex; justify-content: space-between; align-items: center; gap: var(--s12)}
.section-title {margin-bottom: var(--s8)}
.section-title p, .results-bar p {margin: 0; color: var(--muted); font-size: var(--text-sm)}
.search-controls {position: sticky; top: 0; z-index: 2; padding-top: var(--s4); background: var(--bg)}
.search {display: flex; align-items: center; gap: var(--s8); margin-bottom: var(--s4); padding-inline: var(--s12); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-pill)}
.search:focus-within {border-color: var(--brand)}
.search svg {flex: none}
.search input {width: 100%; min-width: 0; min-height: var(--tap); padding: 0; border: 0; background: transparent}
.search input:focus-visible {outline: none}
.filters {display: flex; gap: var(--s4); overflow-x: auto; padding-block: var(--s4); scrollbar-width: none}
.filters::-webkit-scrollbar {display: none}
.filter, .floor-button, .find-map, .report-link, .official-agenda-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap);
  padding: var(--s4) var(--s12); border: var(--border) solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
}
.filter, .floor-zones button {flex: none; background: var(--surface)}
.filter[aria-pressed="true"], .floor-zones button[aria-pressed="true"] {background: var(--ink); color: var(--on-brand); border-color: var(--ink)}
.filter:focus-visible, .floor-zones button:focus-visible {outline-offset: calc(-1 * var(--nav-marker))}
.results-bar {min-height: var(--tap)}
.sort, .talk-stage {display: inline-flex; align-items: center; gap: var(--s4); color: var(--muted); font-size: var(--text-sm)}
.sort select, .talk-stage select {
  min-width: var(--tap); min-height: var(--tap); padding-inline: var(--s8); border: var(--border) solid var(--line);
  border-radius: var(--radius-pill); color: var(--ink); background: var(--surface);
}
.results {display: grid; gap: var(--s12); margin: var(--s8) 0 0; padding: 0; list-style: none}
.card, .info-card {padding: var(--s16); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--card-shadow); overflow-wrap: anywhere}
.card {display: grid; grid-template-columns: var(--booth-width) minmax(0, 1fr); align-items: start; gap: var(--s12)}
.booth {display: grid; align-content: center; gap: var(--s4); min-height: var(--booth-width); padding: var(--s4); border-radius: var(--radius-booth); background: var(--bg); text-align: center; font-size: var(--text-sm)}
.booth strong {font-size: var(--text-lg); line-height: 1.3}
.booth .booth-unknown {font-size: var(--text-sm)}
.card h3 {font-size: var(--text)}
.card p {margin: var(--s4) 0}
.card .exhibitor-meta, .card .exhibitor-topics {color: var(--muted); font-size: var(--text-sm)}
.billing {display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); font-size: var(--text-sm); margin-top: var(--s4)}
.model-chip, .event-tag {display: inline-flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s8); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600}
.model-chip {background: var(--bg)}
.model-chip.unknown, .match-note {color: var(--muted)}
.match-note {margin-top: var(--s4); font-size: var(--text-sm)}
.find-map {margin: var(--s4) var(--s4) 0 0}
.exhibitor-topics summary, .talk-details summary {width: fit-content; min-width: var(--tap); min-height: var(--tap); align-content: center; cursor: pointer; color: var(--link)}
.empty {grid-column: 1 / -1; padding: var(--s24) var(--s12); border: var(--border) solid var(--line); border-radius: var(--radius-card); text-align: center; color: var(--muted)}

footer {display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s8) var(--s16); padding-block: var(--s12) var(--s24); border-top: var(--border) solid var(--line); color: var(--muted); font-size: var(--text-sm)}
footer p {margin: 0}
footer a, .info-links a, .talk-speakers a {display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap); font-size: var(--text-sm); font-weight: 600}
.bottom-nav {position: fixed; z-index: 3; inset: auto 0 0; background: var(--surface); border-top: var(--border) solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px)}
.bottom-nav .wrap {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); min-height: calc(var(--tap) + var(--s12)); align-items: center}
.bottom-nav a {display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border-bottom: var(--nav-marker) solid transparent; color: var(--muted); font-size: var(--text-sm); font-weight: 600; text-decoration: none}
.bottom-nav a[aria-current="page"] {color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); box-shadow: inset 0 -1px var(--brand)}
.toast {position: fixed; z-index: 5; inset: auto var(--s16) calc(var(--bottom-nav) + var(--s8)); width: max-content; max-width: calc(100% - var(--s32)); margin: auto; padding: var(--s8) var(--s16); border-radius: var(--radius-card); background: var(--surface); color: var(--ink); font-size: var(--text-sm)}
.toast:empty {display: none}

.info-page {min-height: calc(100svh - var(--bottom-nav) - var(--s32))}
.info-page h1 {margin-bottom: var(--s8)}
.info-group h2 {margin-block: var(--s24) var(--s8)}
.page-context, .verified {color: var(--muted); font-size: var(--text-sm)}
.info-card {margin-bottom: var(--s12)}
.info-card h2, .info-card h3 {margin: 0 0 var(--s8)}
.info-meta {color: var(--muted); font-size: var(--text-sm); font-weight: 600}
.info-links, .info-labels {display: flex; flex-wrap: wrap; gap: var(--s4) var(--s12)}
.info-labels {margin-block: var(--s8)}
.event-tag {background: var(--surface); color: var(--ink); border: var(--border) solid var(--line)}
.event-tag[data-entry]::before {content: ""; width: var(--dot); height: var(--dot); border-radius: var(--radius-pill); background: var(--muted)}
.event-tag[data-entry="waitlist"]::before, .event-tag[data-entry="sold_out"]::before {background: var(--accent)}
.theme-night .bottom-nav {background: var(--header-ink)}
.theme-night .bottom-nav a:not([aria-current="page"]) {color: var(--on-brand)}
.theme-night [data-page="tonight"] .info-card {border: var(--border) solid var(--line)}
.theme-night #events :is(.info-group > h2, .info-meta) {color: var(--night-time)}
.theme-night :is(.event-tag, .official-agenda-link) {background: transparent; color: var(--on-brand); border-color: var(--night-outline)}
.theme-night .info-card.ended {opacity: .55}
.verified, .info-group .empty {margin: 0}
.route-stops, .talk-speakers {padding-inline-start: var(--s24); margin-block: var(--s8); color: var(--muted)}
.route-stops {display: grid; gap: var(--s4)}
.talk-source-links {margin-bottom: var(--s8)}
.talk-controls, .talk-date {display: flex; flex-wrap: wrap; align-items: center; gap: var(--s8)}
.talk-card .talk-names {color: var(--muted)}
.talk-details h3 {margin-top: var(--s8); font-size: var(--text)}
.talk-speakers a {margin-inline-start: var(--s8)}

@media (min-width: 701px) {
  .intro {grid-template-columns: 1fr minmax(0, .55fr); align-items: center}
  .results {grid-template-columns: repeat(2, minmax(0, 1fr))}
}

.exhibitor-booth, .floor-selection {position:relative}
.floor-selection:has(.exhibitor-logo.is-ready) {display:flex; align-items:center; gap:var(--s8)}
.exhibitor-logo {
  position:absolute; inset:0 auto auto 0; opacity:0; pointer-events:none; object-fit:contain;
}
.exhibitor-logo.is-ready {
  position:static; display:block; flex:none; opacity:1; border-radius:var(--radius-booth); background:var(--bg);
}
.exhibitor-booth .exhibitor-logo.is-ready {margin-top:var(--s4)}

.talk-timeline {margin-bottom: var(--s16); padding: 0 var(--s8) var(--s8); border-radius: var(--radius-card); background: var(--surface)}
.talk-timeline summary {align-content: center; min-height: var(--tap); font-weight: 700; cursor: pointer}
.talk-timeline-row {
  display: grid; grid-template-columns: calc(2 * var(--s24)) repeat(2, minmax(0, 1fr));
  align-items: start; gap: var(--s8); padding-block: var(--s4); border-top: var(--border) solid var(--line);
  font-size: var(--text-sm);
}
.talk-timeline-header {font-weight: 700}
.talk-timeline-cell {display: grid; gap: var(--s4)}
.talk-timeline-time {color: var(--muted); font-size: var(--text-sm); padding-top: var(--s8)}
.talk-timeline-session {
  text-align: start; overflow-wrap: anywhere; min-height: var(--tap); width: 100%;
  padding: var(--s4) var(--s8); border: 0; border-radius: var(--radius-booth);
  color: var(--link); background: var(--bg); font-weight: 600;
}
.talk-timeline-now {
  border-top: var(--nav-marker) solid var(--brand); color: var(--brand); font-weight: 700;
  padding: var(--s4) var(--s8); font-size: var(--text-sm);
}
.talk-card {scroll-margin-top: var(--s12)}
.talk-timeline-range {display:block; color:var(--ink); font-size:var(--text-sm)}
.talk-timeline-entry {background:var(--bg); border-radius:var(--radius-booth)}
.talk-timeline-overlap {
  min-height:var(--tap); min-width:var(--tap); padding:var(--s4) var(--s8);
  border:0; background:transparent; color:var(--link); font-size:var(--text-sm);
  text-align:start; text-decoration:underline;
}
.talk-conflict {margin:0; padding:0 var(--s8); color:var(--ink); font-size:var(--text-sm); font-weight:700}

html[lang="zh-Hans"] {font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif}
.language-switch {display:flex; align-items:center; gap:var(--s4); border-radius:var(--radius-pill); background:var(--header-switch)}
.language-switch button {
  min-width:var(--tap); min-height:var(--tap); border:var(--border) solid transparent;
  border-radius:var(--radius-pill); background:transparent; color:var(--on-brand);
  font-size:var(--text-sm); font-weight:600;
}
.language-switch [aria-pressed="true"] {background:var(--on-brand); color:var(--header-ink)}
.bottom-nav a, .filter {white-space:nowrap}
.filters .filter {flex-shrink:0}
html[lang="en"] .bottom-nav a {font-size:var(--text-xs)}
[data-english-footer] {font-size:var(--text-xs)}

.arrival {display: grid; gap: var(--s8); align-content: start}
.arrival h2 {font-size: var(--text-lg)}
.arrival p {margin: 0; font-size: var(--text-sm)}
.arrival-links {display: flex; flex-wrap: wrap; gap: 0 var(--s12)}
.arrival-links a, .arrival-quick a {display: inline-flex; align-items: center; min-height: var(--tap); color: var(--on-brand); font-size: var(--text-sm); font-weight: 600}
.arrival-quick {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s8); grid-column: 1 / -1}
.arrival-quick a {justify-content: center; text-align: center; padding-inline: var(--s8); border: var(--border) solid var(--header-outline); border-radius: var(--radius-pill); text-decoration: none}
.arrival-quick a[href="#floorplan"], .map-link {background: var(--on-brand); color: var(--header-ink); border-color: transparent}
.trip-guide summary {display: list-item; min-height: var(--tap); align-content: center; font-weight: 700; cursor: pointer}
.trip-guide .trip-detail {padding-top: var(--s8)}
.trip-guide .trip-detail h3 {margin: var(--s16) 0 var(--s4); font-size: var(--text)}
.trip-guide .trip-detail h3:first-child {margin-top: 0}
#routes .info-card {scroll-margin-top: var(--s12)}

@media (min-width: 640px) {
  .arrival-quick {grid-template-columns: repeat(4, minmax(0, 1fr))}
}

.first-visit-cta {display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); width: fit-content; padding-inline: var(--s16); background: var(--brand); color: var(--on-brand); border-radius: var(--radius-pill); text-decoration: none; font-weight: 700}
.first-visit-sections {display: flex; flex-wrap: wrap; gap: var(--s4) var(--s12); margin-block: var(--s8) var(--s16)}
.first-visit-sections a {display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--text-sm); font-weight: 600}
.first-visit [id] {scroll-margin-top: var(--s16)}
.walk-steps {display: grid; gap: var(--s8); list-style: none; padding: 0; margin: var(--s12) 0 var(--s16)}
.walk-steps li {position: relative; padding-inline-start: var(--s24); min-height: var(--s24)}
.walk-steps li::before {content: ""; position: absolute; inset-inline-start: 3px; top: .62em; width: 9px; height: 9px; border-radius: 50%; background: var(--brand)}
.walk-steps li:not(:last-child)::after {content: ""; position: absolute; inset-inline-start: 7px; inset-block: calc(.62em + 9px) calc(-.62em - var(--s8)); width: 1px; background: var(--line)}
.arrival-landmarks {margin-top: var(--s16); color: var(--ink)}
.arrival-photos {display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: var(--s16); margin-top: var(--s12)}
.arrival-photos figure {margin: 0}
.arrival-photos img {display: block; width: 100%; height: auto; border-radius: var(--radius-card); background: var(--surface)}
.arrival-photos figcaption {margin-top: var(--s8); color: var(--muted); font-size: var(--text-sm)}
.arrival-photos figcaption span {color: var(--ink); font-weight: 600}
.bottom-nav .wrap {grid-template-columns: repeat(5, minmax(0, 1fr))}
.bottom-nav a {text-align: center; line-height: 1.2; white-space: normal}

.subscribe-card {margin-block: var(--s16)}
.subscribe-fields label {font-weight: 600}
.subscribe-inputs {display: flex; flex-wrap: wrap; gap: var(--s8)}
.subscribe-inputs input {flex: 1 1 170px; min-width: 0; min-height: var(--tap); padding-inline: var(--s12); border: var(--border) solid var(--line); border-radius: var(--radius-pill); background: var(--surface)}
.subscribe-button {min-height: var(--tap); padding-inline: var(--s16); border: 0; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-weight: 700}
.theme-night .subscribe-button {color: var(--bg)}
.subscribe-button:disabled {opacity: .65; cursor: default}
.subscribe-status {margin: var(--s8) 0 0}
.subscribe-status:empty {display: none}

.mastbar .brand, .brand-byline {display: block}
.brand-byline {margin: 0; color: var(--header-venue); font-size: var(--text-xs)}
.theme-night .brand-byline {color: var(--muted)}
.masthead:has(.intro:not([hidden])) .mastbar .brand-byline {display: none}
.mast-actions {display: flex; align-items: center; gap: var(--s4)}
.share-button {display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: var(--border) solid var(--line); border-radius: var(--radius-pill); color: var(--ink); background: var(--surface)}
.mast-actions .share-button {color: var(--on-brand); background: transparent; border-color: var(--header-outline)}
.data-credit {margin-top: var(--s16)}
#share-dialog {width: min(360px, calc(100% - var(--s32))); padding: var(--s16); color: var(--ink); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-card)}
#share-dialog textarea {display: block; width: 100%; padding: var(--s8); color: var(--ink); background: var(--surface); border: var(--border) solid var(--line); font: inherit}
#share-dialog button {margin-top: var(--s8); min-height: var(--tap); color: var(--ink); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-pill)}
