/* Дизаріум 2026 — програма.
   Palette follows dysarium.com (--_colors--- vars) and the printed program poster.
   All colours live in :root so a dark theme can be added later by overriding tokens. */

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #000;
  --ink-2: #3d3d3d;
  --ink-3: #6b6b6b;
  --paper: #fff;
  --line: #e6e6e6;
  --grey: #f6f6f6;
  --sky: #92cffc;
  --sky-2: #c9e7ff;
  --sky-3: #eef7ff;
  --pink: #ffedfe;
  --pink-2: #ffc7fc;
  --green: #eafde0;
  --green-2: #baecb7;
  --yellow: #fffd86;
  --break: #dcefff;
  --danger: #d4145a;

  --radius: 24px;
  --radius-s: 14px;
  --pill: 999px;
  --shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(30, 90, 150, .25);
  --font: "Onest", "PP Radio Grotesk", Arial, sans-serif;
  --gutter: 16px;
  --topbar-h: 64px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 72px); }
body {
  margin: 0;
  font: 400 16px/1.4 var(--font);
  color: var(--ink);
  background: var(--sky-3) linear-gradient(180deg, var(--sky) 0, var(--sky-2) 260px, var(--sky-3) 640px) no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(146, 207, 252, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar__inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brand img { width: 96px; height: auto; }
.tabs { display: flex; gap: 4px; margin-left: auto; background: var(--paper); border-radius: var(--pill); padding: 4px; }
.tab {
  border: 0; background: transparent; border-radius: var(--pill);
  padding: 8px 14px; font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab.is-active { background: var(--ink); color: var(--paper); }
.tab__count { background: var(--danger); color: #fff; border-radius: var(--pill); min-width: 22px; padding: 1px 6px; font-size: 13px; text-align: center; }
.net { position: absolute; top: calc(100% + 4px); right: var(--gutter); background: var(--yellow); border-radius: var(--pill); padding: 2px 10px; font-size: 13px; }

/* ---------- page ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter) 16px; }

/* day switcher */
.stickybar {
  position: sticky; top: var(--topbar-h); z-index: 15;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
  background: rgba(201, 231, 255, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.days { display: flex; gap: 8px; padding: 10px 0; }
.day {
  flex: 1 1 0; border: 1px solid transparent; background: var(--paper); border-radius: var(--pill);
  padding: 10px 14px; text-align: left; display: flex; flex-direction: column; line-height: 1.15; box-shadow: var(--shadow);
}
.day small { font-size: 13px; color: var(--ink-3); }
.day.is-active { background: var(--ink); color: var(--paper); }
.day.is-active small { color: #cfcfcf; }
@media (min-width: 700px) { .day { flex: 0 0 auto; min-width: 200px; } }

/* filters */
.controls { display: grid; gap: 10px; margin: 4px 0 18px; }
body.view-mine .controls { display: none; }
.search input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--pill); background: var(--paper);
  padding: 12px 18px; font-size: 16px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--ink); background: var(--paper); border-radius: var(--pill);
  padding: 7px 14px; font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--green-2); }
@media (min-width: 900px) { .controls { grid-template-columns: minmax(260px, 380px) 1fr; align-items: center; } .chips { margin: 0; padding: 2px 0; flex-wrap: wrap; } }

/* ---------- "all day" strip (desktop grid) ---------- */
.allday { display: grid; gap: 8px; margin-bottom: 22px; }
.allday__title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 0; }
.allday__list { display: flex; gap: 8px; flex-wrap: wrap; }
.allday__item { background: var(--pink); border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; border: 1px solid var(--pink-2); text-align: left; }
.allday__item b { font-weight: 500; display: block; }

/* ---------- timeline (mobile: stages as rows, time left → right) ----------
   Stage names sit on a pinned left stripe and times on a pinned top ruler,
   so cards only show title, speakers and the heart. */
.tl, .ruler { --tl-offset: 36px; --tl-stripe: 28px; } /* --tl-offset must match TL_OFFSET in app.js */
.ruler { overflow: hidden; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px var(--tl-offset); clip-path: inset(0 0 0 var(--tl-offset)); }
.ruler__track { position: relative; height: 18px; will-change: transform; }
.ruler__tick { position: absolute; top: 0; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink); padding-left: 4px; border-left: 1px solid rgba(0, 0, 0, .35); line-height: 18px; }
.ruler__tick.is-half { color: var(--ink-3); border-left-color: rgba(0, 0, 0, .15); }

.tl { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 8px 0; scrollbar-width: none; overscroll-behavior-x: contain; }
.tl::-webkit-scrollbar { display: none; }
.tl__inner { position: relative; padding-right: var(--gutter); }
.tl-row { display: flex; gap: calc(var(--tl-offset) - var(--tl-stripe)); }
.tl-row__label {
  position: sticky; left: 0; z-index: 3; flex: 0 0 var(--tl-stripe); margin: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #d3e6f6; border-right: 1px solid rgba(0, 0, 0, .06);
  font-weight: 500; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2);
}
.tl-row:first-child .tl-row__label { border-top-right-radius: 10px; }
.tl-row:last-child .tl-row__label { border-bottom-right-radius: 10px; }
.tl-row__label span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; line-height: 1.1; max-height: calc(100% - 10px); overflow: hidden; }
.tl-row__track { position: relative; height: 140px; flex: 0 0 auto; }
.tl-row--low .tl-row__track { height: 84px; }
.tl__now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--danger); z-index: 2; pointer-events: none; }

.tl .card { position: absolute; top: 4px; bottom: 4px; overflow: clip; padding: 0; display: block; border-radius: 16px; box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 4px 14px -8px rgba(30, 90, 150, .3); }
.tl .card__in { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 10px 10px 9px; }
.tl .card.is-picked { border-width: 2px; padding: 0; }
.tl .card.is-picked .card__in { padding: 9px 9px 8px; }
.tl .card__where, .tl .time, .tl .tag--type { display: none; }
.tl .card__head { position: absolute; top: 6px; right: 6px; }
.tl .pin { width: 28px; height: 28px; border-color: rgba(0, 0, 0, .25); }
.tl .pin svg { width: 15px; height: 15px; }
.tl .pin[aria-pressed="true"] { border-color: var(--danger); }
/* long titles end with "…": a <button> is one atomic box, so the clamp sits on the span inside it.
   No automatic hyphenation: oneHyphen() in app.js adds at most one soft hyphen per title. */
.tl .card__title { overflow-wrap: break-word; flex: 0 0 auto; padding-right: 32px; font-size: 13.5px; font-weight: 500; line-height: 1.25; letter-spacing: 0; }
.tl .card__title button, .grid .card__title button { display: block; width: 100%; min-width: 0; }
.tl .card__t, .grid .card__t { overflow-wrap: anywhere; hyphens: manual; }
.tl .card__t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.grid .card__t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.tl .card__people { flex: none; margin-top: auto; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl .card__people b { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-2); }
.tl .card__foot { margin-top: 0; flex-wrap: nowrap; overflow: hidden; gap: 4px; }
.tl .card__foot:empty, .tl .card__foot:not(:has(.tag:not(.tag--type))) { display: none; }
.tl .tag { font-size: 10.5px; padding: 1px 7px; }
.tl-row--low .card__t { -webkit-line-clamp: 2; }
.tl .card--break { display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--ink-3); padding: 2px; background: transparent; border: 1.5px dashed rgba(0, 0, 0, .14); box-shadow: none; }
/* narrow cards (≈30 min): title gets the full width, heart sits in the bottom corner */
.tl .card.is-narrow .card__foot { display: none; }
.tl .card.is-narrow .card__t { -webkit-line-clamp: 2; }
/* a tag row (ENG / Open Call) takes one title line, so the speaker line still fits */
.tl .card:has(.card__foot .tag:not(.tag--type)) .card__t { -webkit-line-clamp: 4; }
.tl-row--low .card:has(.card__people) .card__t { -webkit-line-clamp: 1; }
.tl .card--break.is-narrow { color: transparent; }
.tl .card.is-live { box-shadow: 0 0 0 2px var(--danger); }
.tl .card.is-live::before { display: none; }

/* ---------- card ---------- */
.card {
  position: relative; background: var(--paper); border-radius: var(--radius); padding: 16px 16px 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.card--break { background: var(--break); border-color: transparent; box-shadow: none; padding: 10px 14px; }
.card.is-picked { border: 2px solid var(--ink); padding: 15px 15px 13px; }
.card.is-live::before { content: "Зараз"; position: absolute; top: -9px; left: 16px; background: var(--danger); color: #fff; font-size: 12px; border-radius: var(--pill); padding: 1px 8px; }
.card.is-past { opacity: .55; }
article.card[data-open] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
article.card[data-open]:active { filter: brightness(.97); }

.card__in { display: contents; }
.card__head { display: flex; align-items: flex-start; gap: 10px; }
.card__where { font-size: 13px; color: var(--ink-2); flex: 1; min-width: 0; padding-top: 2px; }
.card__where b { font-weight: 500; color: var(--ink); }
.card__title { margin: 0; font-weight: 400; font-size: 19px; line-height: 1.2; letter-spacing: -.005em; text-wrap: pretty; }
.card__title button { all: unset; cursor: pointer; }
.card__title button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.card__people { font-size: 14px; color: var(--ink-2); }
.card__people b { font-weight: 500; color: var(--ink); }
.card__foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.time { font-size: 14px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 4px; }
.tag { border-radius: var(--pill); padding: 3px 10px; font-size: 12px; background: var(--grey); white-space: nowrap; }
.tag--eng { background: var(--ink); color: var(--paper); }
.tag--call { background: var(--yellow); }
.tag--type { background: var(--sky); }
.tag--reg { background: var(--green-2); }
.tag--full { background: #d9d9d9; color: var(--ink-2); }

.pin {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper);
  display: grid; place-items: center; font-size: 22px; line-height: 1; transition: transform .15s ease, background .15s;
}
.pin:active { transform: scale(.9); }
.pin svg { width: 20px; height: 20px; }
.pin { color: var(--ink); }
/* picked: translucent pink over white, same as the popup "В обраному" button */
.pin[aria-pressed="true"] { background: linear-gradient(rgba(212, 20, 90, .1), rgba(212, 20, 90, .1)), var(--paper); color: var(--danger); border-color: var(--danger); }

/* ---------- grid (desktop timetable) ---------- */
.grid-wrap { padding-bottom: 8px; }
.grid {
  display: grid; position: relative;
  grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr));
  column-gap: 8px;
}
.grid__head { position: sticky; top: calc(var(--topbar-h) + 66px); z-index: 5; background: var(--paper); border-radius: var(--radius-s); padding: 10px 12px; box-shadow: var(--shadow); margin-bottom: 10px; }
.grid__head b { display: block; font-weight: 500; font-size: 15px; }
.grid__head small { color: var(--ink-3); font-size: 13px; }
.grid__body { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; position: relative; }
.grid__hours { position: relative; }
.grid__hour { position: absolute; left: 0; font-size: 13px; font-variant-numeric: tabular-nums; transform: translateY(-50%); color: var(--ink-2); }
.grid__col { position: relative; border-left: 1px dashed rgba(0, 0, 0, .1); }
.grid__line { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(0, 0, 0, .06); pointer-events: none; }
.grid__now { position: absolute; left: 56px; right: 0; border-top: 2px solid var(--danger); z-index: 4; pointer-events: none; }
.grid .card { position: absolute; left: 3px; right: 3px; overflow: hidden; padding: 10px 12px; gap: 6px; border-radius: 18px; }
.grid .card.is-picked { padding: 9px 11px; }
.grid .card__title { font-size: 15px; }
.grid .card__people { font-size: 13px; min-width: 0; }
.grid .pin { width: 32px; height: 32px; }
.grid .card--break { display: grid; place-items: center; text-align: center; font-size: 13px; color: var(--ink-2); padding: 4px; }
.grid .card__where { display: none; }
.grid .card__head { position: absolute; top: 8px; right: 8px; }
.grid .card__title { padding-right: 34px; }
.grid .card.is-short .card__people, .grid .card.is-short .card__foot .tag { display: none; }

/* ---------- my schedule ---------- */
.mine-day { margin-bottom: 28px; }
.mine-day h2 { font-weight: 400; font-size: 22px; text-transform: uppercase; margin: 0 0 12px; }
.mine-list { display: grid; gap: 10px; max-width: 760px; margin-top: 10px; }
.gap { font-size: 13px; color: var(--ink-3); padding: 0 16px; }
.conflict { font-size: 13px; background: var(--yellow); border-radius: var(--radius-s); padding: 8px 14px; }
.empty { background: var(--paper); border-radius: var(--radius); padding: 28px 22px; max-width: 560px; box-shadow: var(--shadow); }
.empty h2 { margin: 0 0 8px; font-weight: 400; font-size: 24px; text-transform: uppercase; }
.empty p { margin: 0 0 16px; color: var(--ink-2); }
.btn { border: 0; background: var(--ink); color: var(--paper); border-radius: var(--pill); padding: 12px 20px; font-size: 15px; }
.btn--icon { display: inline-flex; align-items: center; gap: 8px; }
.btn--icon svg { width: 20px; height: 20px; flex: none; }
/* popup "В обраному": red outline, text and heart on a translucent pink fill */
.btn[data-pin][aria-pressed="true"] { background: rgba(212, 20, 90, .1); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn--ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.nothing { color: var(--ink-2); padding: 20px 0; }

/* ---------- detail sheet ---------- */
.sheet {
  width: min(640px, 100%); max-height: 88vh; margin: auto auto 0; border: 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: var(--radius) var(--radius) 0 0; background: var(--paper); color: var(--ink);
}
.sheet::backdrop { background: rgba(10, 40, 70, .35); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: var(--radius); } }
/* close button and the header (.sheet__top) are sticky: only the content below them scrolls */
/* sticky offsets count from the dialog padding edge (22px), hence the negative tops/margins */
.sheet__close { position: sticky; top: -22px; z-index: 3; height: 0; margin-top: -22px; display: flex; justify-content: flex-end; }
.sheet__close button { position: relative; top: 12px; right: -8px; }
.sheet__top {
  position: sticky; top: -22px; z-index: 2; background: var(--paper);
  margin: 0 -20px 14px; padding: 22px 20px 10px; box-shadow: 0 1px 0 var(--line);
}
.sheet__top h2 { margin-bottom: 0 !important; }
.sheet__close button { border: 0; background: var(--grey); width: 36px; height: 36px; border-radius: 50%; }
.sheet h2 { font-weight: 400; font-size: 24px; line-height: 1.15; margin: 6px 44px 12px 0; }
.sheet .meta { font-size: 14px; color: var(--ink-2); margin: 0 0 12px; }
.sheet .desc { margin: 0 0 12px; }
.sheet .card__foot { margin-bottom: 18px; }
.sheet .desc { line-height: 1.5; }
.sheet .source { margin: -10px 0 18px; font-size: 14px; }
.sheet .reg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.sheet .reg .btn { text-decoration: none; display: inline-block; }
.sheet .reg--full { background: var(--grey); border-radius: var(--radius-s); padding: 10px 14px; font-weight: 500; }
.sheet .source a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- speakers ---------- */
body.view-speakers .controls, body.view-speakers .stickybar { display: none; }
.spk { max-width: 760px; padding-top: 4px; } /* same offset as the programme search (.controls margin-top) */
.spk__search { display: block; position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 5; margin-bottom: 10px; }
.spk__search input { box-shadow: var(--shadow); }
@media (min-width: 900px) { .spk__search { max-width: 380px; } } /* programme search column width */
.spk__list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.spk__list > li + li { border-top: 1px solid var(--line); }
.spk__list .nothing { padding: 20px; }
.spk__row { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.spk__row:active { background: var(--grey); }
.spk__row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.spk__avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-2); color: var(--ink); font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.spk__avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.spk__avatar--md { width: 36px; height: 36px; font-size: 13px; }
.spk__avatar--sm { width: 22px; height: 22px; font-size: 9.5px; }
/* names in cards (venue panel): small avatar + name, each a link to the speaker */
/* speakers in cards: rows like the popup; the timetables show only the plain names */
.card__plain { display: none; }
.tl .card__plain, .grid .card__plain { display: inline; }
.tl .card__people .sheetpeople, .tl .card__people .sheetpeople__note,
.grid .card__people .sheetpeople, .grid .card__people .sheetpeople__note { display: none; }
.card .sheetpeople { margin: 0; }
.card .sheetpeople__note { margin: 6px 0 0; }
/* no venue line (e.g. venue panel): heart in the top-right corner, title beside it */
.sheetcards .card--nowhere .card__head { position: absolute; top: 14px; right: 14px; }
.sheetcards .card--nowhere .card__title { padding-right: 48px; }
/* session popup: speakers as rows */
.sheetpeople { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.sheetpeople__row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; cursor: pointer; }
span.sheetpeople__row { cursor: default; }
.sheetpeople__row:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.sheetpeople__text { display: flex; flex-direction: column; min-width: 0; }
.sheetpeople__text b { font-weight: 500; font-size: 15.5px; }
button.sheetpeople__row:hover b { text-decoration: underline; text-underline-offset: 3px; }
.sheetpeople__text small { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.sheetpeople__note { margin: -6px 0 14px; font-size: 13px; color: var(--ink-3); }
.spk__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.spk__text b { font-weight: 500; font-size: 15.5px; }
.spk__text small { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spk__dots { flex: none; display: flex; gap: 8px; color: var(--ink-3); }
.spk__dot svg { width: 20px; height: 20px; display: block; }
.spkcard__head { display: flex; align-items: center; gap: 14px; }
.spkcard__head > div { margin-right: 44px; }
.spkcard__head h2 { margin: 0 0 2px !important; }
.spkcard__head .meta { margin: 0; }
.spkcard__links { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.social { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; color: var(--ink); }
.social:hover { background: var(--ink); color: var(--paper); }
.social svg { width: 20px; height: 20px; }
.sheetcards { display: grid; gap: 10px; }
/* venue panel and Обране: time (and badges) right under the title, speakers at the bottom */
.sheetcards .card__foot { margin-bottom: 0; } /* the popup's own time row has a bottom margin; cards inside popups don't */
.sheetcards--venue .card__foot, .mine-list .card__foot { order: 1; margin-top: 0; }
.sheetcards--venue .card__people, .mine-list .card__people { order: 2; }
.namelink { all: unset; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.namelink:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- map ---------- */
body.view-map .controls, body.view-map .stickybar, body.view-map .footer { display: none; }
.mapview { position: relative; height: calc(100dvh - var(--topbar-h) - 24px); margin: 8px calc(-1 * var(--gutter)) 0; }
@media (min-width: 1000px) { .mapview { margin: 8px 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); } }
.mapview.leaflet-container { background: var(--sky-3); font: inherit; }
.plan * { vector-effect: non-scaling-stroke; }
/* Leaflet makes the whole overlay interactive (and its CSS loads later): only venue buildings take taps */
.mapview svg.plan, .mapview svg.plan * { pointer-events: none !important; cursor: inherit; }
.mapview svg.plan .plan__venue { pointer-events: auto !important; cursor: pointer; }
.plan [id^="building"], .plan [id^="angar_"], .plan__poi { fill: #cfd8e3; opacity: 1; }
.plan [id^="street"] { stroke: #9fb3c8; }
.plan #footpath { stroke: #7d8fa3; }
.plan__venue { fill: var(--paper); opacity: 1; stroke: var(--ink); stroke-width: 1.5; cursor: pointer; pointer-events: auto; transition: fill .15s; }
.plan__venue:hover { fill: #f2fbef; }
.plan__venue.is-selected { fill: var(--green-2); stroke-width: 2.5; }
.mlabel-wrap { background: none; border: 0; }
.mlabel {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px;
  max-width: 170px; padding: 5px 11px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 14px;
  background: var(--paper); color: var(--ink); box-shadow: 0 4px 14px -6px rgba(30, 90, 150, .45);
  font: 500 12.5px/1.2 var(--font); text-align: center; white-space: nowrap; cursor: pointer;
}
.mlabel b { font-weight: 500; }
.mlabel small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-weight: 400; font-size: 11px; color: var(--ink-2); }
.mlabel small.is-now { color: var(--danger); }
.mlabel.is-selected { background: var(--ink); color: var(--paper); z-index: 2; }
.mlabel.is-hidden, .mpoi.is-hidden { visibility: hidden; }
.mpoi--icon { font-size: 20px; text-shadow: none; }
.plan #fountain { fill: #69cfff; }
.mapview.is-compact .mlabel { padding: 4px 9px; font-size: 12px; }
.mapview.is-compact .mlabel small, .mapview.is-compact .mlabel__tag { display: none; }
.mlabel.is-selected small { color: #ddd; }
.mlabel__tag { display: block; font-style: normal; font-weight: 400; font-size: 11px; color: var(--ink-2); }
.mlabel.is-selected .mlabel__tag { color: #ddd; }
.mpoi { position: absolute; transform: translate(-50%, -50%); font-size: 11px; line-height: 1.2; text-align: center; color: var(--ink-2); white-space: pre; pointer-events: none; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.venuecard {
  display: flex; align-items: center; gap: 10px; margin: 10px 10px 0 !important; padding: 10px 12px 10px 14px;
  width: calc(100vw - 20px); max-width: 460px; box-sizing: border-box;
  background: var(--paper); color: var(--ink); text-decoration: none; border-radius: 16px; box-shadow: var(--shadow);
  font: 14px/1.25 var(--font); pointer-events: auto;
}
.mapview.leaflet-container a.venuecard, .mapview.leaflet-container a.venuecard:hover { color: var(--ink); }
.venuecard__pin { font-size: 20px; flex: none; }
.venuecard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.venuecard__text b { font-weight: 500; }
.venuecard__text small { color: var(--ink-2); font-size: 12.5px; }
.venuecard__go { flex: none; font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--ink); border-radius: var(--pill); white-space: nowrap; }
.mapview.leaflet-container a.venuecard:hover .venuecard__go { background: var(--ink); color: var(--paper); }
@media (min-width: 1000px) { .venuecard { width: 420px; } }
.compass {
  width: 44px; height: 44px; margin-bottom: 8px !important; padding: 2px; border: 0; border-radius: 50%;
  background: var(--paper); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center;
}
.compass svg { width: 34px; height: 34px; overflow: visible; transition: transform .05s linear; }
.compass__n { font: 600 7px var(--font); fill: var(--ink); }
.compass.is-rotated { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
.mapview .leaflet-bar { border: 0; box-shadow: var(--shadow); border-radius: 14px; overflow: hidden; }
.mapview .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 20px; color: var(--ink); }
.sheet .maplink { margin: 0 0 14px; }
.tl-row__label[data-mapstage] { cursor: pointer; }

/* ---------- bottom menu (phones) ---------- */
.bottomnav { display: none; }
@media (max-width: 999px) {
  :root { --bottomnav-h: 64px; }
  .topbar .tabs { display: none; }
  .topbar__inner { min-height: 44px; }
  .bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid rgba(0, 0, 0, .08);
  }
  .bottomnav__item {
    position: relative; border: 0; background: none; color: var(--ink-3);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px;
  }
  .bottomnav__item svg { width: 24px; height: 24px; }
  .bottomnav__item.is-active { color: var(--ink); font-weight: 500; }
  .bottomnav__item.is-active svg { stroke-width: 2.2; }
    .bottomnav__count {
    position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--pill); background: var(--danger); color: #fff; font-size: 11px; font-weight: 500; line-height: 18px; text-align: center;
  }
  body { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
  .mapview { height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - env(safe-area-inset-bottom) - 8px); }
}

/* ---------- footer: community banner ---------- */
.footer { max-width: 1400px; margin: 8px auto 0; padding: 0 var(--gutter) calc(32px + env(safe-area-inset-bottom)); }
.community {
  background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
}
.community__text { margin: 0; font-size: 17px; line-height: 1.3; }
.community__text b { font-weight: 500; }
.community__links { display: flex; gap: 10px; }
.community__links a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--ink); border-radius: 50%; color: var(--ink);
}
.community__links a:hover { background: var(--ink); color: var(--paper); }
.community__links svg { width: 20px; height: 20px; }
.nowrap { white-space: nowrap; }
.footer__note { margin: 12px 4px 0; font-size: 13px; color: var(--ink-3); }
.footer__note a { color: inherit; text-underline-offset: 3px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: var(--paper); border-radius: var(--pill); padding: 10px 18px; font-size: 14px;
  display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}
.toast button { border: 0; background: transparent; color: var(--yellow); text-decoration: underline; padding: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .topbar, .days, .controls, .pin, .ruler, .footer, .bottomnav { display: none !important; }
  body { background: #fff; }
}
.grid .card__people { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.grid .card__people { -webkit-line-clamp: 3; }
