:root {
  --ink: #1f2430;
  --ink-soft: #54607a;
  --line: #e7e9f0;
  --bg: #f6f5f2;
  --card: #ffffff;
  --grad: linear-gradient(90deg, #7b6cae 0%, #e79bb1 36%, #f4c06a 68%, #8fbf7a 100%);
  --session: #4f46a8;
  --meal: #b07d2b;
  --poster: #2a7f8e;
  --social: #c0567f;
  --logistics: #5b6472;
  --neutral: #8a93a6;
  --pin: #c0392b;
  --maxw: 760px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .06), 0 6px 18px rgba(20, 22, 40, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-size: 16px;
}
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; }

/* ---------- masthead ---------- */
.masthead { background: var(--grad); color: #fff; }
.masthead-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 20px 32px; }
.masthead h1 { margin: 0 0 .25em; font-size: 1.95rem; letter-spacing: .2px; }
.masthead .venue { margin: .1em 0; font-weight: 600; }
.masthead .dates { margin: .1em 0; opacity: .92; }
.masthead .tagline { margin: .7em 0 0; opacity: .85; font-style: italic; max-width: 50ch; }

/* logo-led masthead: let the brand artwork lead on a soft, sunset-tinted ground */
.masthead.has-logo {
  background: linear-gradient(180deg, #f3eff8 0%, #fdf6ee 55%, #fbf2e8 100%);
  color: var(--ink);
  border-style: solid; border-width: 0 0 4px; border-image: var(--grad) 1;
}
.masthead.has-logo .masthead-inner { padding: 30px 20px 22px; text-align: center; }
.masthead .logo { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; }
.masthead .logo[hidden] { display: none; }  /* author display:block would otherwise override the hidden attribute */
.masthead.has-logo .dates {
  margin: .8em 0 0; opacity: 1; color: #2b2d6b; font-weight: 600;
  font-family: Georgia, "Times New Roman", serif; letter-spacing: .01em;
}
.masthead .page-title { margin: .55em 0 0; font-size: 1.4rem; font-weight: 700; letter-spacing: .01em; }
.masthead.has-logo .page-title { color: #2b2d6b; }
.masthead .actions { margin: 16px 0 0; }
.pdf-link {
  display: inline-block; font-size: .85rem; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--session); padding: 9px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
}
.pdf-link:hover { filter: brightness(1.07); }

/* ---------- sticky day nav ---------- */
.daynav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 245, 242, .9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.daynav-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px 12px; display: flex; gap: 6px; overflow-x: auto; }
.daynav a {
  flex: 0 0 auto; text-decoration: none; font-size: .92rem; font-weight: 600;
  color: var(--ink-soft); padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.daynav a:hover { background: #ececf2; }
.daynav a.active { color: #fff; background: var(--session); }
.daynav-sep { flex: 0 0 auto; align-self: center; width: 1px; height: 22px; background: rgba(84, 96, 122, .3); margin: 0 3px; }
/* "Now" tab — hidden until the schedule begins (shown via JS); distinct "live" colour */
.now-tab { display: none; align-items: center; gap: .45em; background: #2f8f57; color: #fff !important; }
.now-tab.show { display: inline-flex; }
/* Keep the Now button green in every state (hover/focus/active, incl. iOS sticky :hover after a tap). */
.now-tab, .now-tab:hover, .now-tab:focus, .now-tab.active { background: #2f8f57 !important; }
.now-dot { width: .5em; height: .5em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: now-pulse 1.8s infinite; }
@keyframes now-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); } 70% { box-shadow: 0 0 0 .45em rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .now-dot { animation: none; } }
.event.now-here .event-body { box-shadow: 0 0 0 2px #2f8f57, var(--shadow); transition: box-shadow .2s; }

main { max-width: var(--maxw); margin: 0 auto; padding: 6px 16px 40px; display: flex; flex-direction: column; }
.notes { order: -1; }   /* Info leads on screen; DOM order (schedule first) is restored for print below */

/* shown only in the printed PDF (the route map lives on its own web page) */
.print-only { display: none; }

/* ---------- section headings ---------- */
.sec-head { display: flex; align-items: baseline; gap: .6em; margin: 26px 0 12px; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .14em; }
.sec-label { font-weight: 800; }
.sec-sub { color: var(--ink-soft); font-weight: 600; letter-spacing: .03em; text-transform: none; font-size: .95rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 78px 1fr; gap: 14px; padding-bottom: 14px; }
.event-time { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; font-size: .84rem; padding-top: 14px; text-align: right; }
.event-body { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--neutral); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 16px; }
.event[data-kind="session"]   .event-body { border-left-color: var(--session); }
.event[data-kind="meal"]      .event-body { border-left-color: var(--meal); }
.event[data-kind="poster"]    .event-body { border-left-color: var(--poster); }
.event[data-kind="social"]    .event-body { border-left-color: var(--social); }
.event[data-kind="logistics"] .event-body { border-left-color: var(--logistics); }

.event-title { margin: 0; font-size: 1.05rem; }
.event-loc { margin: .4em 0 0; }
.loc-chip { display: inline-flex; align-items: center; gap: .45em; font-size: .82rem; color: var(--ink-soft); text-decoration: none; background: #f0f1f6; border-radius: 999px; padding: 3px 11px 3px 4px; }
.loc-chip.plain { padding-left: 11px; }
.loc-chip.inline { vertical-align: middle; margin: 0 1px; }
.loc-num { display: inline-grid; place-items: center; width: 1.5em; min-width: 1.5em; height: 1.5em; padding: 0; border-radius: 50%; background: var(--pin-c, var(--pin)); color: #fff; font-size: .68rem; font-weight: 700; }
/* location colour categories (map pins, legend & schedule chips) */
.cat-red    { --pin-c: #c0392b; }
.cat-orange { --pin-c: #cc7a2e; }
.cat-green  { --pin-c: #4f8a5b; }
.cat-blue   { --pin-c: #4068a6; }
.event-note { margin: .5em 0 0; color: var(--ink-soft); font-size: .92rem; }

/* ---------- sub-sessions & talks ---------- */
.blocks { margin-top: .3em; }
.subsession { margin-top: .8em; padding-top: .8em; border-top: 1px dashed var(--line); }
.subsession:first-child { border-top: none; margin-top: .6em; padding-top: 0; }
.sub-name { margin: 0 0 .15em; font-size: .96rem; color: var(--session); }
.sub-desc { color: var(--ink-soft); font-weight: 500; font-size: .84em; }
.sub-time { color: var(--ink-soft); font-weight: 500; font-size: .82em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-time { color: var(--ink-soft); font-weight: 600; margin-left: .35em; font-variant-numeric: tabular-nums; }
.chairs { margin: 0 0 .4em; font-size: .84rem; color: var(--ink-soft); }
.talks-label { margin: 0 0 .25em; font-size: .96rem; font-weight: 700; color: var(--session); }
.panel { margin: .5em 0 0; font-size: .85rem; color: var(--ink-soft); }
.panel::before { content: ""; }
.talks { display: flex; flex-direction: column; gap: 6px; }
.talk { display: grid; grid-template-columns: 1fr; gap: 1px; padding: 8px 11px; background: #fafafb; border: 1px solid var(--line); border-radius: 9px; }
.talk-name { font-weight: 700; font-size: .9rem; }
.talk-title { color: var(--ink-soft); font-size: .9rem; }
.mini { margin: .6em 0 0; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--neutral); font-weight: 600; }
.mini.break::before { content: "\2615  "; }

@media (min-width: 560px) {
  .talk { grid-template-columns: minmax(118px, .4fr) 1fr; gap: 14px; align-items: baseline; }
}

/* ---------- practical notes ---------- */
.notes { padding-top: 6px; }
.notecards { display: grid; gap: 12px; grid-template-columns: 1fr; }
.notecard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.notecard h3 { margin: 0 0 .35em; font-size: .98rem; }
.notecard p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
@media (min-width: 560px) { .notecards { grid-template-columns: 1fr 1fr; } }

.infobar { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 4px 0 14px; padding: 16px 18px; background: var(--ink); color: #fff; border-radius: var(--radius); font-size: .9rem; }
.info { display: flex; flex-direction: column; }
.info-k { color: #e0a35a; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 2px; }
.infobar-title { margin: 16px 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--ink-soft); }
.announce { background: #f3eff8; border: 1px solid #e1ddf4; border-left: 3px solid var(--session); border-radius: var(--radius); padding: 12px 16px; margin: 6px 0 16px; }
.announce-title { margin: 0 0 .4em; font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--session); }
.announce ul { margin: 0; padding-left: 1.15em; color: var(--ink); font-size: .92rem; }
.announce li { margin: .25em 0; }
.timed-notice { margin: 0 0 .6em; padding: 8px 12px; background: #fff; border: 1px solid #e1ddf4; border-radius: 10px; font-size: .92rem; font-weight: 600; color: var(--ink); }
.timed-notice a { color: var(--session); text-decoration: underline; text-underline-offset: 2px; }
.daily-games { margin: 0 0 14px; }
.daily-game { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; background: var(--grad); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.daily-game[hidden] { display: none; }  /* author display:flex would otherwise override the hidden attribute */
.daily-game:hover { filter: brightness(1.05); }
.daily-game .dg-tag { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; opacity: .92; }
.daily-game .dg-name { font-weight: 800; font-size: 1.1rem; flex: 1; }
.daily-game .dg-go { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.note-cell { max-width: 52ch; }
/* push the WhatsApp cell (the only linked note) toward the right on wider screens */
@media screen and (min-width: 560px) { .infobar .info:has(.info-link) { margin-left: auto; } }
.info-v { white-space: pre-line; }
.info-link { color: #f4c06a; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.info-link:hover { color: #fff; }

/* ---------- map ---------- */
.map { padding-top: 6px; }
.mapimg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.mapimg + .mapimg { margin-top: 14px; }   /* stacked route images */

/* numbered location pins overlaid on the venue map (crisp HTML over the faint baked-in ones) */
.mapwrap { position: relative; container-type: inline-size; line-height: 0; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; place-items: center; line-height: 1;
  width: 4.6cqw; height: 4.6cqw; border-radius: 50%;
  background: var(--pin-c, var(--pin)); color: #fff;
  font-weight: 800; font-size: 2.6cqw; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 0.45cqw rgba(255, 255, 255, .9), 0 1px 3px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px 16px; font-size: .86rem; }
.legend li { display: flex; align-items: center; gap: .55em; }
@media (min-width: 560px) { .legend { grid-template-columns: repeat(3, 1fr); } }

/* legend grouped by colour category */
.legend-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 16px; }
.legend-group-title { margin: 0 0 7px; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: .5em; }
.legend-group-title::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: var(--pin-c, var(--pin)); }
.legend-group .legend { display: flex; flex-direction: column; gap: 5px; margin: 0; }
@media (min-width: 560px) { .legend-groups { grid-template-columns: repeat(4, 1fr); } }

/* ---------- posters ---------- */
.posters { padding-top: 6px; }
.poster-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.poster { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--poster); border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px 15px; }
.poster-author { display: block; font-size: .9rem; }
.poster-author strong { font-weight: 700; }
.poster-title { display: block; color: var(--ink-soft); font-size: .92rem; margin-top: 2px; }
.poster-link { margin: .5em 0 0; }
.poster-link a { color: var(--poster); font-weight: 700; font-size: .9rem; text-decoration: none; }
.poster-link a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--ink-soft); font-size: .82rem; padding: 28px 16px 42px; }
.foot p { margin: .2em 0; }
.foot .url { font-weight: 600; }

/* ---------- internal / organizing-team build ---------- */
.team-banner { background: #4f46a8; color: #fff; text-align: center; font-weight: 600; font-size: .88rem; padding: 10px 16px; }
.team-sync { text-align: center; font-size: .78rem; color: var(--ink-soft); background: #f3eff8; border-bottom: 1px solid var(--line); padding: 6px 16px; }
.team-sync.ok { color: #2f7d4f; background: #eef7f0; }
.team-sync.warn { color: #9a5b00; background: #fdf3e6; }
.team-edit { text-align: center; font-size: .8rem; color: var(--ink-soft); background: #f3eff8; border-bottom: 1px solid var(--line); padding: 7px 16px; }
.team-edit a { color: var(--session); font-weight: 700; }
.event.internal-only .event-body { border-left-style: dashed; }
.team-tag { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--social); color: #fff; padding: 2px 7px; border-radius: 999px; vertical-align: middle; margin-left: .4em; }
.team { margin-top: .65em; padding: 9px 11px; background: #f1f0fb; border: 1px solid #e1ddf4; border-left: 3px solid var(--session); border-radius: 9px; }
.team .vols { margin: 0 0 .4em; display: flex; flex-wrap: wrap; gap: 5px; }
.team .vols:last-child { margin-bottom: 0; }
.vol { font-size: .76rem; font-weight: 600; background: var(--session); color: #fff; padding: 2px 9px; border-radius: 999px; }
.team-note { margin: 0; font-size: .85rem; color: #463f7a; }
/* unmet need — stands out so organizers can spot tasks still needing an owner */
.team-need { margin-top: .55em; padding: 9px 11px; background: #fdf3e6; border: 1px solid #f0d9b5; border-left: 3px solid #d98324; border-radius: 9px; }
.need-label { display: block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #9a5b00; margin-bottom: .3em; }
.need-item { margin: .12em 0 0; font-size: .85rem; color: #7a4a08; }
.team-brief { margin-top: 14px; padding: 14px 16px; background: #f1f0fb; border: 1px solid #e1ddf4; border-radius: var(--radius); }
.team-brief h3 { margin: 0 0 .4em; font-size: .95rem; color: var(--session); }
.team-brief ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); font-size: .9rem; }
.team-brief li { margin: .2em 0; }

/* ---------- print / PDF ---------- */
@media print {
  @page { size: A4; margin: 8mm 10mm; }
  :root { --maxw: 100%; }
  html, body { background: #fff; font-size: 8pt; line-height: 1.32; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .daynav, .pdf-link, script { display: none !important; }
  .print-only { display: block; }

  /* compact masthead */
  .masthead.has-logo .masthead-inner { padding: 0 0 4px; text-align: center; }
  .masthead .logo { max-width: 70px; margin-left: auto; margin-right: auto; }
  .masthead .page-title { font-size: .85rem; margin-top: .05em; }
  .masthead { border-bottom-width: 3px; }
  main { padding: 0; display: block; }   /* restore source order (schedule first) for the PDF */
  .notes { order: 0; }

  /* PAGE 1 — schedule packed into two columns */
  .days { column-count: 2; column-gap: 18mm; }
  .day { padding-top: 0; }
  #thu { break-before: page; page-break-before: always; }
  .sec-head { margin: 1px 0 3px; font-size: .78rem; letter-spacing: .09em; break-after: avoid; }
  .event { grid-template-columns: 42px 1fr; gap: 5px; padding-bottom: 4px; break-inside: avoid; page-break-inside: avoid; }
  .event-time { font-size: .66rem; padding-top: 5px; }
  .event-body { padding: 4px 7px; border-radius: 6px; border-left-width: 3px; }
  .event-title { font-size: .78rem; }
  .event-loc { margin-top: .15em; }
  .loc-chip { font-size: .64rem; padding: 1px 6px 1px 3px; }
  .loc-num { width: 1.3em; min-width: 1.3em; height: 1.3em; padding: 0; font-size: .58rem; }
  .event-note { font-size: .68rem; margin-top: .2em; }
  .blocks { margin-top: .1em; }
  .subsession { margin-top: .32em; padding-top: .32em; break-inside: avoid; }
  .sub-name { font-size: .73rem; }
  .chairs { font-size: .65rem; margin-bottom: .2em; }
  .talks-label { font-size: .75rem; margin-bottom: .2em; }
  .panel { font-size: .65rem; margin-top: .3em; }
  .talks { gap: 2px; }
  .talk { grid-template-columns: 21mm 1fr; gap: 2px 7px; padding: 2px 6px; line-height: 1.25; break-inside: avoid; }
  .talk-name, .talk-title { font-size: .67rem; }
  .mini { font-size: .62rem; margin-top: .25em; }
  .event-body, .notecard, .talk, .infobar { box-shadow: none; }
  a { text-decoration: none; }

  /* PAGE 2 — Thursday, a single-row info bar, and the squeezed venue map */
  .notes { padding-top: 4px; break-before: avoid; }
  .notes .sec-head { margin: 2px 0 3px; }
  .infobar { margin: 2px 0 6px; padding: 7px 12px; font-size: .66rem; gap: 4px 16px; flex-wrap: wrap; align-content: flex-start; break-inside: avoid; }
  .infobar-title { margin: 4px 0 3px; break-after: avoid; }
  .info-k { font-size: .58rem; }
  .map { padding-top: 2px; break-before: page; break-inside: avoid; }   /* venue map starts a fresh page, header + map + legend kept together */
  /* container-type:inline-size + fit-content collapses the box in print → disable containment here */
  .mapwrap { width: fit-content; margin: 0 auto; container-type: normal; }
  .mapwrap .mapimg { width: auto; max-height: 110mm; }
  .map-pin { width: 5mm; height: 5mm; font-size: 2.9mm; box-shadow: 0 0 0 .4mm rgba(255,255,255,.9); }
  .legend-groups { grid-template-columns: repeat(4, 1fr); gap: 4px 8px; margin-top: 6px; }
  .legend-group-title { font-size: .55rem; margin-bottom: 3px; }
  .legend-group .legend { gap: 2px; font-size: .58rem; }
  #route { break-before: page; page-break-before: always; }
  .map .sec-head { margin: 2px 0 3px; break-after: avoid; }
  .mapimg { max-width: 100%; max-height: 116mm; width: auto; display: block; margin: 0 auto; }
  .legend { grid-template-columns: repeat(6, 1fr); gap: 3px 8px; font-size: .58rem; margin-top: 5px; }

  /* posters — own page, two compact columns */
  #posters { break-before: page; page-break-before: always; padding-top: 0; }
  .posters .sec-head { margin: 2px 0 4px; }
  .poster-list { display: block; column-count: 2; column-gap: 10mm; gap: 0; }
  .poster { break-inside: avoid; padding: 3px 7px; margin-bottom: 4px; border-radius: 6px; border-left-width: 3px; box-shadow: none; }
  .poster-author { font-size: .68rem; }
  .poster-title { font-size: .63rem; margin-top: 1px; }
}
