/* Con Planner styles. Colors and sizes are set once, here, and reused below. */
:root {
  --bg: #f6f1e7;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #5b6475;
  --line: #e1d9c8;
  --navy: #1f2a44;
  --accent: #d8431e;
  --accent-ink: #ffffff;
  --teal: #0b7f76;
  --warn-bg: #fff1d6;
  --warn-ink: #7a4a00;
  --radius: 14px;
  --head-h: 58px;
  --tabs-h: 64px;
  --toolbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-top: calc(var(--head-h) + var(--safe-t));
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 12px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
img { max-width: 100%; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid #2d7dd2; outline-offset: 2px; }

/* ---------- Header and tabs ---------- */
#top {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: calc(var(--head-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0 16px; background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.top-text { flex: 1; min-width: 0; }
#con-name { margin: 0; font-size: 1.05rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status { margin: 1px 0 0; font-size: .75rem; opacity: .8; min-height: 1em; }
#status.warn { color: #ffd98a; opacity: 1; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:disabled { opacity: .5; }

#tabs {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line); display: flex;
}
#tabs button {
  flex: 1; position: relative; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; font-size: .68rem; padding: 4px 0; min-width: 0;
}
#tabs button svg { width: 24px; height: 24px; }
#tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }
#tabs .count, .dot {
  position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .68rem; line-height: 18px; text-align: center;
}

/* ---------- Common bits ---------- */
.pad { padding: 16px; max-width: 760px; margin: 0 auto; }
.section { font-size: 1.15rem; margin: 22px 0 8px; }
.section.sub { font-size: 1rem; margin-top: 18px; }
.level { font-size: .85rem; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }
.fine { font-size: .82rem; color: var(--muted); }
.desc { white-space: pre-line; }
.back { border: 0; background: none; color: var(--teal); font-weight: 700; padding: 10px 4px; font-size: 1rem; }
.link-btn { border: 0; background: none; color: var(--teal); text-decoration: underline; padding: 6px; }
.link-btn.dark { color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.notice {
  margin: 12px 16px; padding: 12px 14px; border-radius: var(--radius); background: #e4f3f1; color: #0a4a45; border: 1px solid #b6dcd8; font-weight: 600;
}
.notice.important { background: var(--warn-bg); color: var(--warn-ink); border-color: #f0cf8c; }
.notice.flat { margin: 12px 0; }
.home .notice { margin-left: 0; margin-right: 0; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px; background: #ece6d6; color: #3b4254; font-size: .78rem; font-weight: 600;
}
.tag.live { background: #d9f3e3; color: #0b5a2d; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 1.15rem; }
.loading { text-align: center; padding: 60px 24px; color: var(--muted); }
.meeple {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50% 50% 12px 12px; background: var(--accent); position: relative;
  animation: bob 1s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .meeple { animation: none; } * { scroll-behavior: auto !important; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px); z-index: 60;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Forms ---------- */
.search, .field {
  width: 100%; min-height: 44px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.search:focus, .field:focus { border-color: var(--navy); outline: none; }
.form-row { display: block; margin: 12px 0; }
.form-row > span { display: block; font-weight: 700; margin-bottom: 4px; }
.form-row small { color: var(--muted); }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: #a02020; font-weight: 700; }
.search-form { display: flex; gap: 8px; margin: 8px 0; }
.search-form .search { flex: 1; }

/* ---------- Schedule ---------- */
.toolbar { position: sticky; top: calc(var(--head-h) + var(--safe-t)); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 12px 10px; }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto; min-width: 68px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15; position: relative;
}
.day .wd { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day .md { font-weight: 700; }
.day[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.day[aria-selected="true"] .wd { color: #cfd6e6; }
.day .n { position: absolute; top: -6px; right: -4px; background: var(--accent); color: #fff; border-radius: 9px; font-size: .68rem; min-width: 18px; line-height: 18px; text-align: center; }
.plan-days { padding: 8px 0 12px; }
.search-row { display: flex; gap: 8px; margin-top: 6px; }
.search-row .search { flex: 1; }
.filter-toggle { white-space: nowrap; padding: 4px 14px; }
.filter-panel { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: .88rem;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--type, #888); }
.chip[aria-pressed="true"] { border-color: var(--type, var(--navy)); background: color-mix(in srgb, var(--type, #888) 14%, #fff); font-weight: 700; }
.chip.clear { border-style: dashed; }

.list { padding: 8px 12px 16px; max-width: 760px; margin: 0 auto; }
.dayhead { font-size: 1rem; margin: 16px 4px 4px; color: var(--navy); }
.group { display: flex; gap: 10px; margin: 10px 0; }
.when { width: 52px; flex: 0 0 52px; text-align: right; padding-top: 12px; line-height: 1.1; }
.when b { display: block; font-size: 1.02rem; }
.when span { font-size: .68rem; color: var(--muted); font-weight: 700; }
.cards { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.now { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--accent); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.now::before, .now::after { content: ""; flex: 1; height: 2px; background: var(--accent); }

.card {
  position: relative; display: flex; flex-wrap: wrap; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  border-left: 6px solid var(--type, var(--navy)); overflow: hidden;
}
.card.cancelled .title { text-decoration: line-through; }
.card.past { opacity: .6; }
.card-main { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 12px 8px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.card-main.static { cursor: default; }
.title { font-weight: 700; }
.where { color: var(--muted); font-size: .88rem; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.star { width: 48px; border: 0; background: none; color: #a7adba; display: grid; place-items: center; }
.star svg { width: 26px; height: 26px; }
.star.on { color: #e0a100; }
.star.on svg { fill: currentColor; }

.role-bar { flex: 0 0 100%; padding: 3px 12px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--navy); }
.role-host .role-bar, .legend-item.role-host { background: var(--accent); }
.role-volunteer .role-bar, .legend-item.role-volunteer { background: var(--teal); }
.role-switch, .block-actions { flex: 0 0 100%; display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; }
.rs { min-height: 34px; padding: 2px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: .82rem; font-weight: 600; }
.rs[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.rs-host[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.rs-volunteer[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); }
.kinds { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.legend-item { padding: 2px 10px; border-radius: 999px; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 700; }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--bg); }
#sheet {
  width: min(560px, 100vw); max-height: 88vh; margin: auto auto 0; border-radius: 20px 20px 0 0; overflow: auto; position: fixed; inset: auto 0 0 0;
}
@media (min-width: 700px) { #sheet { inset: 0; margin: auto; border-radius: 20px; } }
dialog::backdrop { background: rgba(20,26,40,.55); }
.sheet-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0,0,0,.07); display: grid; place-items: center; }
.sheet-close svg { width: 22px; height: 22px; }
.sheet-body { padding: 20px 18px 24px; border-top: 6px solid var(--type, var(--navy)); }
.sheet-body h2 { margin: 0 44px 10px 0; font-size: 1.3rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.file-in { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.big-file { position: relative; overflow: hidden; width: 100%; }

#badge-dlg { width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #fff; }
.badge-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + var(--safe-t)); }
.badge-tabs { flex: 1; display: flex; gap: 6px; overflow-x: auto; }
.badge-tabs button { flex: 0 0 auto; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; }
.badge-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge-view { padding: 0 12px 16px; text-align: center; }
.badge-name { font-weight: 800; font-size: 1.1rem; margin: 4px 0 8px; }
.badge-view .zoom { height: 62vh; background: #fff; }
.badge-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 12px 0; padding: 14px 16px; border-radius: var(--radius); border: 0;
  background: var(--navy); color: #fff; text-align: left;
}
.badge-btn svg { width: 34px; height: 34px; flex: 0 0 34px; }
.badge-btn b { display: block; font-size: 1.05rem; }
.badge-btn small { opacity: .8; }
.badge-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.badge-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.badge-btns { display: flex; gap: 6px; }

/* ---------- Home ---------- */
.home { max-width: 760px; margin: 0 auto; padding: 0 16px 16px; }
.banner { display: block; width: calc(100% + 32px); max-width: none; margin: 0 -16px; }
.home-head { padding: 14px 0 4px; }
.home-head .dates { margin: 0; font-size: 1.25rem; font-weight: 800; }
.home-head .place { margin: 2px 0 0; color: var(--muted); }
.alert { display: flex; align-items: center; gap: 10px; width: 100%; margin: 12px 0; padding: 12px 14px; border-radius: var(--radius); border: 2px solid var(--accent); background: #fff; font-weight: 700; text-align: left; }
.alert svg { width: 24px; height: 24px; color: var(--accent); flex: 0 0 24px; }
.hub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.hub-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 700; text-align: center;
}
.hub-btn svg { width: 34px; height: 34px; color: var(--accent); }
.hub-btn .dot { top: 8px; left: auto; right: 10px; }
.home-foot { text-align: center; margin-top: 18px; }

.carousel { position: relative; margin: 16px 0; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 16 / 9; display: grid; place-items: center; background: #fff; }
.slide a { display: block; width: 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 4px; }
.dots button { width: 28px; height: 28px; border: 0; background: none; padding: 0; position: relative; }
.dots button::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: rgba(31,36,48,.35); }
.dots button[aria-current="true"]::after { background: var(--accent); }

/* ---------- News, info ---------- */
.news { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.news li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.news h3 { margin: 4px 0; font-size: 1.05rem; }
.news p { white-space: pre-line; margin: 8px 0 0; }
.gallery { display: grid; gap: 8px; margin-bottom: 8px; }
.gallery img { width: 100%; border-radius: var(--radius); }

/* ---------- Exhibitors and sponsors ---------- */
.sponsors { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sponsors a, .sponsors div {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; height: 100%; padding: 12px 8px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.sponsors img { width: 100%; max-height: 84px; object-fit: contain; }
.sp-name { font-weight: 700; font-size: .92rem; }
.ex-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
details.ex { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
details.ex summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; min-height: 56px; }
details.ex summary::-webkit-details-marker { display: none; }
details.ex summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--muted); }
details.ex[open] summary::after { content: "−"; }
.ex-name { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.ex summary img, .ex-head img, .ph { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; object-fit: contain; background: #f3efe4; }
.ph { display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.ex-body { padding: 0 14px 12px; }
.ex-body p { white-space: pre-line; margin: 0 0 8px; }
.ex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }

/* ---------- Map ---------- */
.mapscreen { max-width: 960px; margin: 0 auto; padding: 8px 8px 16px; }
.map-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 4px 8px; }
.map-tabs button { flex: 0 0 auto; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 600; }
.map-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.map-note { text-align: center; }
.zoom { position: relative; overflow: hidden; touch-action: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); height: calc(100dvh - var(--head-h) - var(--tabs-h) - 150px); min-height: 280px; user-select: none; -webkit-user-select: none; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 100%; will-change: transform; }
.stage img { display: block; width: 100%; height: auto; max-width: none; pointer-events: none; }
.hot { position: absolute; border: 2px solid rgba(216,67,30,.9); background: rgba(216,67,30,.22); border-radius: 4px; padding: 0; min-width: 14px; min-height: 14px; }
.hot.focus { background: rgba(224,161,0,.55); border-color: #e0a100; animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.zoom-ctl { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.zoom-ctl button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 1.3rem; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.edit-log { width: 100%; min-height: 120px; margin-top: 8px; font-family: ui-monospace, monospace; font-size: .8rem; }

/* ---------- Convention picker ---------- */
.picker { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.pick { width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 2px; min-height: 56px; }
.pick[aria-current="true"] { border-color: var(--accent); }

@media (min-width: 700px) {
  .sponsors { grid-template-columns: repeat(3, 1fr); }
  .hub { grid-template-columns: repeat(3, 1fr); }
}
