/* =============================================================================
   MERICS Members Day — styles (mobile-first)
   ========================================================================== */

/* MERICS headline/UI typeface (licensed — see README). Body uses it too for now;
   Meta Serif Pro Book can be added later for brand-accurate body copy. */
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Light.woff2")   format("woff2"); font-weight: 300; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Medium.woff2")  format("woff2"); font-weight: 500; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Italic.woff2")  format("woff2"); font-weight: 400; font-style: italic;  font-display: swap; }

:root {
  /* MERICS palette (HEX from Corporate Design Manual, 2022) */
  --red:        #E8412B;  /* 01 Light Red — primary  */
  --red-deep:   #BE111F;  /* 04 Red                  */
  --raspberry:  #DD0646;  /* 07 Raspberry            */
  --orange:     #F46500;  /* 03 Orange               */
  --dark-blue:  #116179;  /* 12 Dark Blue            */
  --turquoise:  #8BCAAE;  /* 09 Turquoise            */
  --light-blue: #84C7C8;  /* 11 Light Blue           */
  --mustard:    #D9B300;  /* 13 Mustard              */
  --beige:      #F0EAE5;  /* 00 Beige                */
  --grey:       #70706F;  /* 00 Grey                 */
  --black:      #14110F;

  --ink:        #1c1a18;
  --ink-soft:   #57534e;
  --line:       #e6ded7;
  --card:       #ffffff;
  --bg:         #faf7f4;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20,17,15,.06), 0 2px 8px rgba(20,17,15,.05);
  --shadow-lg: 0 8px 40px rgba(20,17,15,.18);
  --tap: 44px; /* min touch target */

  --font: "Neo Sans Pro", "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* Neo Sans Pro ships Light/Regular/Medium only — never fake heavier/italic. */
  font-synthesis: none;
}
a { color: var(--dark-blue); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  color: var(--ink);
  padding: env(safe-area-inset-top) 0 0;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 720px; margin: 0 auto;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 26px; width: auto; display: block; }
.header-meta { margin-left: auto; text-align: right; font-size: 11px; color: var(--grey); line-height: 1.3; }
.backbtn {
  display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px;
  border-radius: 50%; color: var(--ink); text-decoration: none; flex: none;
}
.backbtn svg { width: 24px; height: 24px; }
.backbtn:active { background: var(--beige); }

/* ---------- Landing: welcome + tiles ---------- */
.welcome {
  max-width: 720px; margin: 0 auto; padding: 30px 20px 18px;
}
.welcome .kicker {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}
.welcome h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; }
.welcome .lead { margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); }
.btn-cal {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 36px;
}
.btn-cal svg { width: 15px; height: 15px; }
.btn-cal:active { transform: scale(.98); }

.tiles {
  max-width: 720px; margin: 0 auto; padding: 8px 20px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 132px; padding: 16px; border-radius: var(--radius);
  text-decoration: none; color: #fff; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:active { transform: scale(.985); }
.tile:focus-visible { outline: 3px solid var(--dark-blue); outline-offset: 3px; }
.tile-wide { grid-column: 1 / -1; }
.tile-tall { min-height: 150px; }

.tile-text h2 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.1; }
.tile-text p { margin: 6px 0 0; font-size: 13.5px; opacity: .92; max-width: 30ch; }
.tile-icon {
  position: absolute; top: 16px; left: 16px;
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.18); display: grid; place-items: center;
}
.tile-icon svg { width: 22px; height: 22px; stroke: #fff; }
.tile-go {
  position: absolute; top: 16px; right: 18px; font-size: 22px; font-weight: 700; opacity: .9;
}

.tile-agenda { background: linear-gradient(135deg, var(--red), var(--orange)); }
.tile-menti  { background: linear-gradient(135deg, var(--dark-blue), #0d4a5c); min-height: 150px; }
/* Wide tile has room: let the meeting-code line run full width instead of
   wrapping under the icon. */
.tile-menti .tile-text p { max-width: none; }

/* Photo tiles use --img set inline */
.tile-photo { background-image: linear-gradient(180deg, rgba(20,17,15,.05), rgba(20,17,15,.62)), var(--img); background-size: cover; background-position: center; min-height: 150px; }

/* About tile — solid MERICS green (#516234) instead of a photo */
.tile-about { background: #516234; min-height: 150px; }

/* ---------- Content pages (about / publications) ---------- */
.page {
  max-width: 720px; margin: 0 auto; padding: 18px 20px 50px;
}
.page-hero {
  width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius);
  display: block; margin-bottom: 18px;
}
.page h1 { font-size: 28px; font-weight: 800; margin: 6px 0 4px; line-height: 1.12; }
.page h2 { font-size: 18px; font-weight: 700; margin: 26px 0 6px; }
.page .page-lead { font-size: 15px; color: var(--grey); font-style: italic; margin: 0 0 18px; }
.page p { font-size: 15px; color: var(--ink); margin: 10px 0; }
.page ul { font-size: 15px; color: var(--ink); margin: 10px 0; padding-left: 20px; }
.page li { margin: 6px 0; line-height: 1.4; }
.page-links { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Location page */
.loc-map {
  display: block; width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin: 12px 0;
}
.loc-maplink { display: block; }
.loc-address {
  display: flex; gap: 10px; align-items: flex-start;
  font-style: normal; font-size: 15px; line-height: 1.5; margin: 14px 0;
}
.loc-address svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--red); }
.btn-maps {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--dark-blue); color: #fff; text-decoration: none; font-weight: 700;
  font-size: 14px; padding: 12px 18px; border-radius: 12px; min-height: var(--tap);
  margin: 4px 0 14px; border: 0; cursor: pointer; font-family: inherit;
}

/* Interactive map (consent-gated Google embed) */
.loc-embed {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin: 12px 0;
  aspect-ratio: 4 / 3; background: var(--beige) center / cover no-repeat;
}
.loc-embed-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Video embed (consent-gated YouTube/Vimeo) — same pattern, 16:9, dark stage */
.vid-embed {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin: 12px 0;
  aspect-ratio: 16 / 9; background: var(--ink, #14110F);
}
.vid-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.loc-embed--ask .loc-consent,
.vid-embed--ask .loc-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 20px; background: rgba(250,247,244,.88); backdrop-filter: blur(3px);
}
.loc-consent p { max-width: 420px; font-size: 13.5px; color: var(--ink-soft); margin: 0 0 10px; }
.loc-consent .btn-maps { margin: 0; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff; text-decoration: none; font-weight: 700;
  font-size: 14px; padding: 12px 18px; border-radius: 12px; min-height: var(--tap);
}

/* Publication cards */
.pub {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.pub:active { transform: scale(.99); }
.pub-tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--tag, var(--grey));
  border-radius: 6px; padding: 2px 9px;
}
.pub h3 { margin: 10px 0 4px; font-size: 17px; line-height: 1.25; }
.pub p { margin: 4px 0 8px; font-size: 14px; color: var(--ink-soft); }
.pub-meta { font-size: 12.5px; color: var(--grey); }

/* Download / materials rows */
.dl {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.dl:active { transform: scale(.99); }
.dl-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--beige); display: grid; place-items: center; color: var(--red);
}
.dl-icon svg { width: 20px; height: 20px; }
.dl-text { min-width: 0; }
.dl-label { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.dl-meta { display: block; font-size: 12.5px; color: var(--grey); margin-top: 2px; overflow-wrap: anywhere; }
.dl-arrow { margin-left: auto; font-size: 20px; font-weight: 700; color: var(--dark-blue); }

/* FAQ accordion (native details/summary) */
.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; min-height: var(--tap); font-weight: 700; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; flex: none; font-size: 20px; font-weight: 700;
  color: var(--red); transition: transform .15s ease;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 16px 14px; font-size: 14.5px; color: var(--ink); }
.faq-a p { margin: 8px 0; }
.faq-a ul { margin: 8px 0; padding-left: 20px; }

/* ---------- Hero ---------- */
.hero {
  max-width: 720px; margin: 0 auto;
  padding: 26px 18px 8px;
}
.hero .kicker {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
}
.hero h1 { margin: 0; font-size: 30px; line-height: 1.08; font-weight: 800; }
.hero .lead { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.hero .factline {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 13px; color: var(--ink-soft);
}
.hero .factline span { display: inline-flex; align-items: center; gap: 6px; }
.hero .factline svg { width: 15px; height: 15px; opacity: .7; flex: none; }

/* "Live now" banner */
.livebar {
  max-width: 720px; margin: 16px auto 0; padding: 0 18px;
}
.livebar-inner {
  display: none; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  color: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; box-shadow: var(--shadow-sm);
}
.livebar-inner.show { display: flex; }
.livebar .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.8s infinite;
}
.livebar b { font-weight: 800; }
.livebar .live-jump { margin-left: auto; color: #fff; font-weight: 700; text-decoration: underline; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ---------- Agenda ---------- */
.agenda {
  max-width: 720px; margin: 0 auto; padding: 18px 18px 60px;
  display: flex; flex-direction: column; gap: 10px;
}
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--grey); margin: 14px 2px 2px;
}

.agenda-download {
  max-width: 720px; margin: 0 auto; padding: 0 18px;
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.agenda-download .btn-primary svg { width: 18px; height: 18px; }
@media (min-width: 900px) { .agenda-download { max-width: 880px; padding: 0 24px; } }

/* Personal-agenda filter */
.agenda-filter {
  max-width: 720px; margin: 16px auto 0; padding: 0 18px;
  display: flex; gap: 8px;
}
.flt {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 36px;
}
.flt svg { width: 14px; height: 14px; }
.flt.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.flt.is-on svg { fill: var(--mustard); stroke: var(--mustard); }
.agenda-empty {
  color: var(--grey); font-size: 14px; text-align: center; padding: 30px 20px;
}
.agenda-empty svg { width: 14px; height: 14px; vertical-align: -2px; }

/* Session card */
.item {
  position: relative; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 14px 40px 14px 14px;
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  cursor: pointer; color: inherit; font: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.fav-btn {
  position: absolute; right: 4px; top: 4px;
  border: 0; background: transparent; color: var(--grey); cursor: pointer;
  padding: 8px; border-radius: 10px; display: grid; place-items: center;
}
.fav-btn svg { width: 18px; height: 18px; }
.fav-btn:hover { color: var(--ink-soft); }
.fav-btn.is-fav { color: var(--mustard); }
.fav-btn.is-fav svg { fill: var(--mustard); }
.item:active { transform: scale(.99); }
.item:focus-visible { outline: 3px solid var(--dark-blue); outline-offset: 2px; }

.item .time { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.item .time .end { display: block; font-weight: 500; color: var(--ink-soft); }

.item .body { min-width: 0; }
.item h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; }
.item .sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.item .who {
  margin-top: 8px; font-size: 12.5px; color: var(--grey);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.item .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--line); }


/* Day header (multi-day events) */
.day-head {
  display: flex; align-items: baseline; gap: 10px; padding: 18px 2px 2px;
}
.day-head:first-child { padding-top: 4px; }
.day-num {
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--dark-blue); border-radius: 7px; padding: 3px 10px;
}
.day-date { font-size: 13px; font-weight: 600; color: var(--grey); }

/* Break row */
.break {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px; color: var(--grey); font-size: 13px;
}
.break .time { font-weight: 700; min-width: 56px; }
.break .label { font-weight: 600; }
.break .rule { flex: 1; height: 1px; background: var(--line); }

/* Status states */
.item.is-current {
  border-color: var(--red); box-shadow: 0 0 0 2px var(--red), var(--shadow-sm);
}
.item.is-current::before {
  content: "LIVE NOW"; position: absolute; top: -9px; left: 14px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 6px;
}
.item.is-past { opacity: .55; }
.badge-next {
  position: absolute; top: -9px; left: 14px;
  background: var(--dark-blue); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 6px;
}

/* ---------- Detail sheet (modal) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20,17,15,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 720px; margin: 0 auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.7,.2,1);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 0; }
.sheet-head { position: sticky; top: 0; background: var(--card); padding: 6px 20px 12px; }
.sheet-close {
  position: absolute; right: 12px; top: 8px;
  width: var(--tap); height: var(--tap); border: 0; background: transparent;
  font-size: 24px; color: var(--grey); cursor: pointer; border-radius: 50%;
}
.sheet-close:active { background: var(--beige); }
.sheet .s-time { font-size: 13px; font-weight: 700; color: var(--red); margin: 8px 0 4px; }
.sheet h2 { margin: 0; font-size: 26px; line-height: 1.12; padding-right: 36px; }
.sheet .s-sub { margin: 8px 0 0; font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.sheet-body { padding: 4px 20px 0; }
.sheet .s-desc { font-size: 15px; color: var(--ink); margin: 16px 0; }

.sheet .s-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--grey); margin: 20px 0 10px;
}

/* Speaker block */
.speaker-list { margin-top: 10px; }
.speaker { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.speaker:first-of-type { border-top: 0; }
.speaker .avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--beige); display: grid; place-items: center;
  font-weight: 800; color: var(--red); font-size: 18px;
}
.speaker .avatar img { width: 100%; height: 100%; object-fit: cover; }
.speaker .s-name { font-weight: 700; font-size: 15.5px; }
.speaker .s-role { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }
.speaker .s-org { font-size: 12.5px; color: var(--grey); }
.speaker .s-bio { font-size: 13.5px; color: var(--ink); margin-top: 6px; }
.speaker .s-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.speaker .s-links a {
  font-size: 12.5px; text-decoration: none; color: var(--dark-blue);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}

.no-slides { font-size: 13px; color: var(--grey); font-style: italic; }

/* Recommended reading (in-sheet list) */
.read {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  transition: transform .12s ease, border-color .12s ease;
}
.read:active { transform: scale(.99); }
.read-tag {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--tag, var(--grey));
  border-radius: 6px; padding: 2px 8px; margin-bottom: 8px;
}
.read-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.read-meta { display: block; font-size: 12.5px; color: var(--grey); margin-top: 4px; }

/* Mentimeter live-poll button (in-sheet) */
.btn-menti {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--dark-blue), #0d4a5c); color: #fff;
  text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 12px 18px; border-radius: 12px; min-height: var(--tap);
}

/* In-sheet slideshow */
.slideshow { margin-top: 4px; }
.ss-frame {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line);
  background: #000; border-radius: 12px; overflow: hidden; position: relative;
  cursor: pointer; aspect-ratio: 16 / 9;
}
.ss-frame img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.ss-expand {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px;
  background: rgba(20,17,15,.62); border-radius: 9px; display: grid; place-items: center;
}
.ss-expand svg { width: 20px; height: 20px; stroke: #fff; }
.ss-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.ss-nav {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.ss-nav:active { background: var(--beige); }
.ss-nav svg { width: 22px; height: 22px; }
.ss-count { font-size: 14px; font-weight: 700; color: var(--ink-soft); min-width: 56px; text-align: center; }

/* Fullscreen slide viewer */
.viewer {
  position: fixed; inset: 0; z-index: 60; background: #0b0a09;
  display: none; align-items: center; justify-content: center;
}
.viewer.open { display: flex; }
.viewer #vw-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vw-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 10px 12px 28px 18px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
}
.vw-count { color: #fff; font-size: 14px; font-weight: 700; }
.vw-close {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.16); display: grid; place-items: center;
}
.vw-close svg { width: 22px; height: 22px; stroke: #fff; }
.vw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.16); display: grid; place-items: center;
}
.vw-nav svg { width: 26px; height: 26px; stroke: #fff; }
.vw-prev { left: 10px; }
.vw-next { right: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 720px; margin: 0 auto; padding: 24px 18px 40px;
  font-size: 12px; color: var(--grey); text-align: center;
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  justify-content: center; align-items: baseline; margin-bottom: 8px;
}
.footer-links a { color: var(--dark-blue); text-decoration: underline; }
.footer-org { color: var(--grey); }

@media (min-width: 560px) {
  .hero h1 { font-size: 36px; }
  .item { grid-template-columns: 76px 1fr; }
}

/* =============================================================================
   Desktop / large-screen enhancements (≥ 900px).
   Purely additive — every rule below is gated behind a min-width or hover
   media query, so the mobile-first layout above is left completely unchanged.
   ========================================================================== */
@media (min-width: 900px) {
  /* Wider, comfortable reading column. Header tracks the landing width so the
     logo lines up with the home-page content. */
  .header-inner { max-width: 960px; padding: 14px 28px; }
  .logo img { height: 30px; }

  /* Landing: roomier hero + a clean 2×2 tile grid instead of stacked bars */
  .welcome { max-width: 960px; padding: 52px 28px 22px; }
  .welcome h1 { font-size: 44px; }
  .welcome .lead { font-size: 17px; }

  .tiles { max-width: 960px; padding: 12px 28px 32px; gap: 20px; }
  .tile-wide { grid-column: auto; }          /* stop spanning → balanced 2×2 */
  .tile, .tile-tall, .tile-photo { min-height: 210px; }
  .tile-text h2 { font-size: 25px; }
  .tile-text p  { font-size: 14.5px; max-width: 34ch; }

  /* Agenda: single chronological column (correct for a timeline), just wider
     and with a larger hero so it fills the viewport instead of hugging center */
  .hero      { max-width: 880px; padding: 40px 24px 8px; }
  .hero h1   { font-size: 42px; }
  .hero .lead{ font-size: 17px; }
  .livebar   { max-width: 880px; }
  .agenda    { max-width: 880px; gap: 12px; padding: 22px 24px 72px; }

  /* Content pages keep a narrower measure for readability, but get a taller
     hero image to feel less cramped on a big screen */
  .page      { max-width: 760px; padding: 26px 24px 64px; }
  .page-hero { height: 240px; }
  .site-footer { max-width: 960px; }
}

/* Mouse / trackpad pointers get hover affordances the touch UI (:active) lacks.
   hover:hover excludes touchscreens, so phones and tablets are unaffected. */
@media (hover: hover) {
  .tile { transition: transform .14s ease, box-shadow .14s ease; }
  .tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .item:hover { border-color: var(--dark-blue); transform: translateY(-1px);
                box-shadow: 0 4px 18px rgba(20,17,15,.10); }
  .pub { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
  .pub:hover { border-color: var(--dark-blue); transform: translateY(-1px);
               box-shadow: 0 4px 18px rgba(20,17,15,.10); }
  .backbtn:hover, .sheet-close:hover, .ss-nav:hover { background: var(--beige); }
  .btn-primary:hover, .btn-menti:hover { filter: brightness(.94); }
  .read { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
  .read:hover { border-color: var(--dark-blue); transform: translateY(-1px);
                box-shadow: 0 4px 18px rgba(20,17,15,.10); }
  .vw-nav:hover, .vw-close:hover { background: rgba(255,255,255,.28); }
  .live-jump:hover { opacity: .85; }
  .page p a:hover, .speaker .s-links a:hover { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =============================================================================
   Generalized SPA additions (Events App)
   - Single shell, client-side view switching
   - Tiles coloured by section type instead of hardcoded per-event classes
   ========================================================================== */
.view { display: none; }
.view.active { display: block; }

/* Section tiles by type (generalization of the reference's per-tile classes) */
.tile[data-type="agenda"]        { background: linear-gradient(135deg, var(--red), var(--orange)); }
.tile[data-type="external-link"] { background: linear-gradient(135deg, var(--dark-blue), #0d4a5c); }
.tile[data-type="content-page"]  { background: #516234; }
.tile[data-type="location"]      { background: linear-gradient(135deg, #116179, #14808f); }
.tile[data-type="speakers"]      { background: linear-gradient(135deg, var(--raspberry, #DD0646), #9c0a35); }
.tile[data-type="downloads"]     { background: linear-gradient(135deg, var(--orange, #F46500), #c85300); }
.tile[data-type="video"]         { background: linear-gradient(135deg, #14110F, #4a423d); }
.tile[data-type="faq"]           { background: linear-gradient(135deg, var(--mustard, #D9B300), #a68a00); }
.tile[data-type="chat"]          { background: linear-gradient(135deg, var(--red-deep, #BE111F), #8f0d17); }
.tile[data-type="message-board"] { background: linear-gradient(135deg, #516234, #3c491f); }
.tile[data-type="publications"]  {
  background-image: linear-gradient(180deg, rgba(20,17,15,.05), rgba(20,17,15,.62)),
    var(--img, linear-gradient(135deg, var(--dark-blue), var(--turquoise)));
  background-size: cover; background-position: center;
}
.tile[data-type="agenda"]        { grid-column: 1 / -1; min-height: 150px; }

/* Builder-controlled per-tile width + appearance. These win over the type
   defaults above (equal specificity, later in source). Width control targets
   the PHONE layout — the participant surface. */
.tiles .tile.tile--full { grid-column: 1 / -1; min-height: 150px; }
.tiles .tile.tile--half { grid-column: auto; }
.tile--solid, .tile--photo { min-height: 150px; }
.app-loading {
  max-width: 720px; margin: 0 auto; padding: 80px 20px; text-align: center;
  color: var(--grey); font-size: 15px;
}
@media (min-width: 900px) {
  /* Taller tiles on wide screens. The builder's width choice (single/double)
     is respected at EVERY breakpoint — the tile grid must render exactly what
     the canvas shows. */
  .tiles .tile, .tiles .tile.tile--full { min-height: 210px; }
}

/* ---- tier-2/3 gated content ---- */
.tile-lock {
  position: absolute; top: 16px; right: 18px; opacity: .9;
}
.tile-lock svg { width: 20px; height: 20px; }
.tile--locked { opacity: .92; }
.unlock-page { margin-top: 18px; }
.unlock { max-width: 420px; }
.unlock-label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.unlock-row { display: flex; gap: 8px; }
.unlock-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 15px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
.unlock-row .btn-cal { margin-top: 0; }
.unlock-hint { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.unlock-error { font-size: 13px; color: #BE111F; margin-top: 10px; min-height: 1em; }

/* ---- message-board family (Live chat · Feedback/Q&A · session chats) ---- */
.msg-feed { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg-feed--chat {
  max-height: 55vh; overflow-y: auto; padding: 4px 2px;
  scroll-behavior: smooth;
}
.msg {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-name { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.msg-aff { font-size: 12px; color: var(--grey); }
.msg-time { font-size: 11.5px; color: var(--grey); margin-left: auto; }
.msg-text { font-size: 14px; line-height: 1.5; color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }
.msg-empty { color: var(--grey); font-size: 14px; }

.msg-form { margin-top: 14px; }
.msg-id-row { display: flex; gap: 8px; margin-bottom: 8px; }
.msg-id-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
/* Send sits BELOW the message box (a side-by-side button looked off next to
   the resizable textarea). */
.msg-send-row { display: flex; flex-direction: column; gap: 8px; }
.msg-send-row textarea {
  width: 100%; font: inherit; font-size: 14px; resize: vertical;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
.msg-send-row .btn-cal { margin-top: 0; align-self: flex-end; }
.msg-as { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; }
.msg-change {
  font: inherit; font-size: 12px; color: var(--dark-blue); background: none;
  border: none; padding: 0; cursor: pointer; text-decoration: underline;
}
.msg-error { font-size: 13px; color: #BE111F; margin-top: 8px; min-height: 1em; }
.msg-preview-note {
  border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px;
  color: var(--grey); font-size: 13.5px; background: var(--card); margin-top: 14px;
}
#sheet-chat { margin-top: 4px; }
#sheet-chat .msg-feed--chat { max-height: 38vh; }
