:root {
  /* Colour */
  --ink: #13161C;          /* header, dark cards, primary dark buttons */
  --ink-2: #252A33;        /* code chip background */
  --ink-3: #2A2F38;        /* progress track on dark */
  --ink-line: #3A404B;     /* outline buttons on dark */
  --paper: #F3F1EA;        /* page background */
  --card: #FFFFFF;
  --field: #F8F7F3;        /* input fill inside cards */
  --line: #E2DED4;         /* card borders, dividers */
  --line-strong: #D6D2C7;  /* input borders */
  --muted: #5B5F66;        /* secondary text (passes 4.5:1 on white) */
  --muted-on-ink: #C9CBD0; /* secondary text on --ink */
  --yellow: #F2B705;       /* brand accent: Create, Invite, MEET pin, code */
  --teal: #0B7A5F;         /* sharing on, member avatar, arrived */
  --teal-soft: #5FC7A8;    /* progress fill on dark */
  --danger: #A0201A;
  --danger-bg: #FDECEA;
  --danger-line: #E7B4AE;
  --host-bg: #FFF3CC;
  --host-fg: #6B5000;
  --map-bg: #F2F2F0;      /* close to the toned-down tiles while they load */
  --yellow-hover: #DCA704;

  /* Radius */
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 22px;

  /* Shadow */
  --shadow-float: 0 4px 16px rgba(19, 22, 28, 0.12);

  /* Type */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  font-family: var(--font-body);
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Buttons and fields ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 0.7rem 1.2rem;
  font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
/* Before js/app.js has loaded: Create/Join can't work yet, so show it instead of ignoring taps. */
.booting #joinBtn, .booting #createBtn { opacity: 0.55; cursor: progress; pointer-events: none; }
.booting #joinBtn::after, .booting #createBtn::after { content: "..."; }
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }

input[type="text"], input[type="search"], select {
  width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--card); color: var(--ink);
}
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.row { display: flex; gap: 0.5rem; align-items: center; }
.row-wrap { flex-wrap: wrap; }

/* ---------- Home ---------- */
.home { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; background: var(--paper); }

.brand {
  position: relative; overflow: hidden;
  flex: 1 1 460px; min-width: 0; background: var(--ink); color: var(--paper);
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 44px; height: 44px; flex: none; display: block; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.logo span, .hero span { color: var(--yellow); }
.brand-copy { display: flex; flex-direction: column; gap: 20px; max-width: 520px; }
.hero {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 76px;
  line-height: 0.95; letter-spacing: -0.035em;
}
.tagline { margin: 0; font-size: 19px; line-height: 1.5; color: var(--muted-on-ink); }
.brand-logo, .brand-copy, .brand-art { position: relative; } /* above the background map */
.brand-art { z-index: 1; }
.brand-logo, .brand-copy { z-index: 2; } /* text stays above the scene's roads and tails, which spill upward */
.brand-map {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 60%; pointer-events: none;
}
.brand-art {
  display: block; width: calc(100% + 112px); max-width: 820px; height: auto;
  margin: 0 -56px -24px; overflow: visible; pointer-events: none;
}

/* Home illustration animation (only when the SVG has .sk-anim) */
@keyframes sk-flow { to { stroke-dashoffset: -28; } }
@keyframes sk-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes sk-go-b {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { transform: translate(0, 0); opacity: 1; }
  26% { transform: translate(80px, 0); }
  48.5% { transform: translate(80px, -100px); }
  72% { transform: translate(185px, -100px); opacity: 1; }
  86%, 100% { transform: translate(185px, -100px); opacity: 0; }
}
@keyframes sk-go-j {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { transform: translate(0, 0); opacity: 1; }
  36% { transform: translate(0, 90px); }
  72% { transform: translate(-115px, 90px); opacity: 1; }
  86%, 100% { transform: translate(-115px, 90px); opacity: 0; }
}
@keyframes sk-go-g {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { transform: translate(0, 0); opacity: 1; }
  72% { transform: translate(0, -115px); opacity: 1; }
  86%, 100% { transform: translate(0, -115px); opacity: 0; }
}
.sk-anim .sk-flow { animation: sk-flow 1.4s linear infinite; }
.sk-anim .sk-flag { transform-box: fill-box; transform-origin: 50% 100%; animation: sk-pulse 2.4s ease-in-out infinite; }
.sk-anim .sk-b { animation: sk-go-b 7s linear infinite; }
.sk-anim .sk-j { animation: sk-go-j 6s linear infinite 1s; }
.sk-anim .sk-g { animation: sk-go-g 5s linear infinite 2s; }
@media (prefers-reduced-motion: reduce) { .sk-anim * { animation: none !important; } }

.home-main {
  flex: 1 1 520px; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 56px 24px;
}
.home-form { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 24px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.home input[type="text"] {
  height: 54px; padding: 0 18px; border-radius: var(--r-lg); border: 1.5px solid var(--line-strong);
  background: var(--card); font-size: 17px; font-weight: 500; color: var(--ink);
}
.home input::placeholder { color: #7A7E85; }

.home-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 24px; display: flex; flex-direction: column; gap: 22px;
}
.home-section { display: flex; flex-direction: column; gap: 10px; }
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); }
.home-card .row { gap: 10px; }
.home-card input[type="text"] { flex: 1 1 auto; min-width: 0; background: var(--field); }
#codeInput {
  font-family: var(--font-mono); font-weight: 700; font-size: 18px;
  letter-spacing: 0.3em; text-transform: uppercase;
}
.home-card .btn { height: 54px; padding: 0 24px; border-radius: var(--r-lg); font-size: 16px; }
#joinBtn { font-weight: 600; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.error {
  margin: 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: 15px;
}
/* Icon drawn in CSS because the JS sets the banner's text with textContent. */
.error::before {
  content: ""; flex: none; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fine-print { margin: 0; display: flex; gap: 10px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.fine-print svg { flex: none; margin-top: 2px; }
/* © on the left (in line with the lock icon), Privacy policy · Contact us on the right */
.home-legal-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: -16px; font-size: 14px; font-weight: 600;
}
.home-legal-links a { color: var(--ink); text-decoration: none; border-radius: 4px; }
.home-legal-links a:hover { text-decoration: underline; }
.home-legal-links span { color: #B8B4A9; }
.home-legal-links .home-copy { color: var(--muted); font-weight: 500; margin-right: auto; } /* links go to the right */

@media (max-width: 899px) {
  /* All-dark mobile Home in one screen: the illustration flexes, everything else is compact.
     Very short screens (or an error banner) can still scroll. */
  .home {
    flex-direction: column; flex-wrap: nowrap; background: var(--ink); color: #fff;
    min-height: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  }
  .brand {
    flex: 1 1 auto; min-height: 0; padding: 20px 24px 0; padding-top: max(20px, env(safe-area-inset-top));
    gap: 10px; justify-content: flex-start;
  }
  /* 56px fade at the bottom so the map and roads melt into the page */
  .brand::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none;
    background: linear-gradient(to bottom, rgba(19, 22, 28, 0), #13161C);
  }
  .brand-logo, .brand-copy { flex: none; }
  .brand-copy { gap: 8px; }
  .brand-logo { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; }
  .logo { font-size: 19px; }
  .hero { font-size: 40px; letter-spacing: -0.03em; margin-top: 2px; }
  .tagline { font-size: 14px; line-height: 1.45; }
  /* Full-bleed scene that takes the leftover height (viewBox crop set inline in index.html) */
  .brand-art { flex: 1 1 0; min-height: 96px; height: auto; width: 100vw; max-width: none; margin: 0 -24px; }

  .home-main {
    flex: none; display: flex; align-items: stretch;
    padding: 0 20px max(14px, env(safe-area-inset-bottom));
  }
  .home-form { flex: 1; gap: 12px; max-width: 560px; margin: 0 auto; }

  .field { gap: 6px; }
  .field label { font-size: 13px; color: #E4E5E8; }
  .home input[type="text"] {
    height: 46px; padding: 0 14px; border-radius: var(--r-md); font-size: 16px;
    background: #1C2028; border-color: #2F343D; color: #fff;
  }
  .home input::placeholder { color: #8A8F98; }

  .home-card { padding: 14px; gap: 12px; border-radius: 18px; background: #1A1E25; border-color: #2A2F38; }
  .home-section { gap: 8px; }
  .home-card input[type="text"] { background: #12151B; border-color: #2F343D; }
  .section-title { font-size: 17px; color: #fff; }
  .hint { color: #9A9EA6; }
  #codeInput { font-size: 16px; letter-spacing: 0.25em; }
  .home-card .btn { height: 46px; padding: 0 18px; border-radius: var(--r-md); font-size: 15px; }
  #joinBtn { background: var(--paper); color: var(--ink); font-weight: 700; } /* ink would vanish on dark */
  #joinBtn:hover { background: #E4E1D8; }

  .divider { color: #8A8F98; font-size: 12px; }
  .divider::before, .divider::after { background: #2A2F38; }

  .error {
    padding: 10px 14px; border-radius: var(--r-md); font-size: 14px;
    background: #3A1A1C; border: 1px solid #5C2A2C; color: #FFA59C;
  }
  .fine-print { font-size: 12px; line-height: 1.45; color: #9A9EA6; }
  .home-legal-links { margin-top: -12px; gap: 0 12px; font-size: 13px; }
  .home-legal-links a { color: #E4E5E8; padding: 6px 0; }
  .home-legal-links span { color: var(--muted); }
  .home-legal-links .home-copy { color: #9A9EA6; }
}

/* ---------- Room layout ---------- */
.room {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; background: var(--paper);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 24px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--ink); color: #fff; z-index: 1000; flex: none;
}
.topbar-title { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.topbar-brand { display: flex; align-items: center; gap: 14px; flex: none; }
.topbar-logo { width: 42px; height: 42px; flex: none; display: block; }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  color: #fff; text-decoration: none; white-space: nowrap; border-radius: 6px;
}
.wordmark span { color: var(--yellow); }
.topbar-divider { width: 1px; height: 28px; background: var(--ink-line); flex: none; }
.title-stack { display: flex; align-items: center; gap: 14px; min-width: 0; }
#roomName {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.code-chip {
  display: flex; align-items: center; background: var(--ink-2); border-radius: var(--r-sm);
  padding: 4px 4px 4px 12px; flex: none; white-space: nowrap;
}
.code-text {
  border: 0; background: none; padding: 0; cursor: pointer; height: 100%;
  font-family: var(--font-mono); font-weight: 700; font-size: 15px; letter-spacing: 0.22em; color: var(--yellow);
}
.copy-code {
  width: 32px; height: 32px; display: grid; place-items: center; margin-left: 4px;
  border: 0; border-radius: 8px; background: none; color: var(--muted-on-ink); cursor: pointer;
}
.copy-code:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.copy-code .i-check { display: none; }
.copy-code.copied { color: var(--teal-soft); }
.copy-code.copied .i-copy { display: none; }
.copy-code.copied .i-check { display: block; }

.topbar-actions { display: flex; gap: 10px; flex: none; }
.btn-bar {
  height: 44px; padding: 0 18px; border-radius: var(--r-md); font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-icon-bar {
  position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--ink-line); border-radius: var(--r-md); background: transparent; color: #fff; cursor: pointer;
}
.btn-icon-bar:hover { background: rgba(255, 255, 255, 0.06); }
.btn-icon-bar .i-bell-off { display: none; }
.btn-icon-bar.is-muted { color: var(--muted-on-ink); }
.btn-icon-bar.is-muted .i-bell { display: none; }
.btn-icon-bar.is-muted .i-bell-off { display: block; }
.notify-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1;
}
.notify-dot {
  display: none; position: absolute; top: 8px; right: 9px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--ink);
}
.btn-icon-bar.needs-permission .notify-dot { display: block; }
.btn-outline-ink { background: transparent; color: #fff; border: 1.5px solid var(--ink-line); font-weight: 600; }
.btn-outline-ink:hover { background: rgba(255, 255, 255, 0.06); }

/* Body: map + side panel */
.room-body {
  flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 16px; padding: 16px; overflow-y: auto;
}
.map-wrap {
  position: relative; flex: 999 1 560px; min-width: 0; min-height: 620px;
  border-radius: var(--r-2xl); overflow: hidden; background: var(--map-bg);
}
.map { position: absolute; inset: 0; background: var(--map-bg); font-family: var(--font-body); }
.map.picking { cursor: crosshair; }

/* Map overlays */
.map-top {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 900;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.host-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; flex: 1 1 auto; min-width: 0; max-width: 440px; }
.search {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
}
.search-icon { flex: none; color: var(--muted); }
.search-wrap { position: relative; z-index: 2; width: 100%; }
.search-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
}
.search-item {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--muted);
}
.search-item span { min-width: 0; display: flex; flex-direction: column; }
.search-item b { color: var(--ink); font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item svg { flex: none; }
.search-item:hover, .search-item[aria-selected="true"] { background: var(--field); }
.search-empty { padding: 12px; font-size: 14px; color: var(--muted); }
.search input[type="search"] {
  flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0 6px;
  font-size: 16px; font-weight: 500; color: var(--ink);
}
.search input::placeholder { color: #7A7E85; }
.search .btn { height: 40px; padding: 0 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 15px; }
.tap-set {
  height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid transparent; border-radius: var(--r-lg); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-float); font-weight: 600; font-size: 15px; cursor: pointer;
}
.tap-set.active { background: var(--yellow); border-color: var(--ink); }
.host-tools.locked .search-wrap, .host-tools.locked .tap-set { display: none; }
.pin-lock {
  margin: 0; min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow-float);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pin-lock .i-lock { display: none; }
.pin-lock.is-locked { color: var(--muted); }
.pin-lock.is-locked .i-lock { display: block; }
.pin-lock.is-locked .i-timer { display: none; }

.map-tools {
  display: flex; flex-direction: column; gap: 4px; padding: 4px; margin-left: auto; flex: none;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
}
.tool {
  width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent;
  font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer;
}
.tool[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Minimal map: desaturate and soften only the tiles; markers, lines and controls keep their colours. */
.leaflet-tile-pane { filter: grayscale(0.92) brightness(1.06) contrast(0.86); }

/* Leaflet controls: restyled, not rebuilt */
.leaflet-bottom.leaflet-left .leaflet-control { margin: 0 0 16px 16px; }
.leaflet-touch .leaflet-bar, .leaflet-bar.leaflet-control-zoom {
  border: 0; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-float); background: var(--card);
}
.leaflet-control-zoom a, .leaflet-touch .leaflet-control-zoom a {
  width: 44px; height: 44px; line-height: 44px; font-size: 22px; font-weight: 500;
  color: var(--ink); background: var(--card); border-bottom: 1px solid var(--line);
}
.leaflet-control-zoom a:last-child { border-bottom: 0; }
.leaflet-control-zoom a:hover { background: var(--field); }
.leaflet-touch .leaflet-bar a:first-child, .leaflet-touch .leaflet-bar a:last-child { border-radius: 0; }
.leaflet-control-attribution.leaflet-control {
  margin: 0 12px 12px 0; padding: 2px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.88); font-size: 11px; color: #3D4148;
}
.leaflet-control-attribution a { color: var(--ink); }

/* ---------- Side panel ---------- */
.panel {
  flex: 1 1 340px; max-width: 420px; min-width: 0;
  display: flex; flex-direction: column; gap: 12px; padding-bottom: env(safe-area-inset-bottom);
}
.panel-handle, .sheet-expand { display: none; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px;
}
.card-ink { background: var(--ink); border-color: var(--ink); color: #fff; padding: 20px; }
.eyebrow {
  margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.card-divider { border: 0; height: 1px; background: var(--line); margin: 12px 0 8px; }

/* Card A: meetup summary */
.meetup-info .eyebrow { color: #A9ADB4; margin-bottom: 4px; }
.mi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mi-name {
  margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.15;
  overflow-wrap: anywhere;
}
.mi-head { min-width: 0; }
.mi-sub { display: none; } /* note + arrived count line: only in the collapsed mobile sheet */
.mi-dist { text-align: right; flex: none; }
.mi-dist strong {
  display: block; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; color: var(--yellow);
}
.mi-dist span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted-on-ink); }
.progress { height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; margin: 18px 0 10px; }
.progress > div { height: 100%; background: var(--teal-soft); border-radius: 999px; transition: width 0.3s; }
.mi-arrived { margin: 0; font-size: 14px; color: var(--muted-on-ink); }
.mi-arrived strong { color: #fff; }
.mi-empty { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted-on-ink); }
.mi-empty strong { color: #fff; }
.mi-flag {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-md); background: var(--ink-2); color: var(--yellow);
  display: grid; place-items: center;
}

/* Landmark notes */
.note-card { padding: 16px 18px; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-head .eyebrow { margin: 0; display: flex; align-items: center; gap: 6px; }
.link-btn {
  min-height: 44px; margin: -12px -10px -12px 0; padding: 0 10px; border: 0; background: none;
  color: var(--teal); font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 8px;
}
.link-btn:hover { text-decoration: underline; }
.note-text { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card.empty .note-text { color: var(--muted); }
.note-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.note-form textarea {
  width: 100%; min-height: 84px; resize: vertical; padding: 10px 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong); background: var(--field); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.45;
}
.note-form textarea::placeholder { color: #7A7E85; }
.note-actions { display: flex; align-items: center; gap: 8px; }
.note-count { margin-right: auto; font-size: 12px; color: var(--muted); }
.note-actions .btn { height: 44px; padding: 0 18px; border-radius: var(--r-md); font-size: 15px; font-weight: 600; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--field); }

/* Card B: controls */
.status-group > .eyebrow { display: block; margin-bottom: 8px; }
.my-controls { padding: 16px; }
.status-track {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; border-radius: 16px; background: var(--paper);
}
.status-btn {
  min-height: 52px; padding: 6px 4px; border-radius: var(--r-md); border: 1.5px solid transparent;
  background: transparent; color: #3D4148; font: 600 13px var(--font-body);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.status-btn svg { flex: none; width: 18px; height: 18px; }
.status-btn span { white-space: nowrap; } /* "Running late" never wraps */
.status-btn:hover:not(:disabled) { background: rgba(19, 22, 28, 0.04); }
.status-btn:disabled { color: #8A8D93; cursor: not-allowed; }
.status-btn:disabled svg { opacity: 0.6; }
.arrive-hint { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }

/* Custom status */
.custom-status { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.custom-title { margin: 0; }
.custom-row { display: flex; gap: 8px; }
.custom-field { position: relative; flex: 1; min-width: 0; }
.custom-field input {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-lg); background: var(--field); color: var(--ink); font-size: 15px;
}
.custom-field input.has-icon { padding-left: 42px; }
.custom-field input::placeholder { color: #7A7E85; }
.custom-field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: grid; color: var(--ink); pointer-events: none; }
.custom-save { height: 48px; padding: 0 20px; border-radius: var(--r-lg); font-size: 15px; font-weight: 600; flex: none; }
.custom-icons { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.custom-icon {
  height: 44px; min-width: 0; display: grid; place-items: center; border: 1.5px solid var(--line);
  border-radius: var(--r-md); background: var(--card); color: #33373E; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.custom-icon:hover { border-color: var(--line-strong); background: var(--field); }
.custom-icon[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.custom-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.custom-note .note-short { display: none; }
.custom-showing { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.showing-label { color: var(--muted); flex: none; }
.showing-value { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-weight: 600; color: var(--ink); }
.showing-value svg { flex: none; }
.showing-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showing-clear {
  flex: none; min-height: 32px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--teal); font-size: 13px; font-weight: 600; text-decoration: underline; border-radius: 6px;
}
/* People list: custom status as an outlined tag next to the status chip */
.custom-tag {
  display: inline-flex; align-items: center; gap: 4px; max-width: 170px; padding: 2px 8px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink);
}
.custom-tag svg { flex: none; }
.custom-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-btn[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(19, 22, 28, 0.10); }
.status-btn[data-status="on_the_way"][aria-pressed="true"] { background: #DDF1EA; border-color: var(--teal); color: #075C47; }
.status-btn[data-status="late"][aria-pressed="true"] { background: var(--host-bg); border-color: #D9A400; color: var(--host-fg); }
.status-btn[data-status="arrived"][aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }

.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.share-text { display: flex; flex-direction: column; }
.share-title { font-size: 16px; font-weight: 600; }
.share-hint { font-size: 14px; color: var(--muted); }
.switch {
  width: 56px; height: 32px; flex: none; padding: 3px; border: 0; border-radius: 999px;
  background: #C9C5BA; cursor: pointer; display: flex; align-items: center; transition: background 0.15s;
  /* keep a 44px hit area around the 32px track */
  position: relative;
}
.switch::after { content: ""; position: absolute; inset: -6px 0; }
.switch .knob {
  width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--teal); }
.switch[aria-checked="true"] .knob { transform: translateX(24px); }

.loc-row { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.loc-msg { margin: 12px 0 0; font-size: 14px; color: var(--danger); }

/* Card C: people */
.member-list { list-style: none; margin: 0; padding: 0; }
.member-item { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.member-item:first-child { padding-top: 0; }
.member-item:last-child { border-bottom: 0; padding-bottom: 0; }
.member {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  flex: 1; min-width: 0; margin: 0 -8px; padding: 8px; border: 0; border-radius: var(--r-md);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color 0.15s;
}
.member:hover { background: var(--field); }
.member-more {
  flex: none; width: 40px; height: 44px; margin-right: -8px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.member-more:hover, .member-more[aria-expanded="true"] { background: var(--field); color: var(--ink); }
.member + .member-more { margin-left: 8px; } /* the row button's -8px right margin */
.cohost-badge { background: #DDF1EA; color: #075C47; }

/* Per-person options menu (floats above everything; placed by JS) */
.member-menu {
  position: fixed; z-index: 1200; min-width: 190px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(19, 22, 28, 0.18);
}
.menu-item {
  display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--field); }
.menu-item:focus-visible { outline-offset: -3px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }
.member:active { background: var(--line); }
.member-main, .member-name, .member-sub { min-width: 0; }
.member-main { display: block; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 16px; background: var(--c);
}
.member.stale .avatar { filter: grayscale(0.8); opacity: 0.6; }
.member-name { display: flex; width: 100%; align-items: center; flex-wrap: wrap; gap: 6px; }
.member-name b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.member-name .you { font-size: 14px; color: var(--muted); }
.host-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--host-bg); color: var(--host-fg); padding: 2px 7px; border-radius: 6px;
}
.member-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.member-dist { text-align: right; font-family: var(--font-display); font-weight: 800; font-size: 20px; white-space: nowrap; }
.member-dist small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-preparing { background: #EEEBE3; color: #3D4148; }
.badge-on_the_way { background: #DDF1EA; color: #075C47; }
.badge-late { background: var(--host-bg); color: var(--host-fg); }
.badge-arrived { background: var(--teal); color: #fff; }

.end-btn {
  margin-top: auto; width: 100%; min-height: 48px; flex: none; border-radius: var(--r-lg);
  border: 1.5px solid var(--danger-line); background: transparent; color: var(--danger);
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.end-btn:hover { background: var(--danger-bg); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-float); max-width: calc(100% - 32px);
  cursor: pointer;
}

/* ---------- Notification cards (under the room header) ---------- */
.notice-stack {
  position: fixed; z-index: 1050; top: calc(var(--topbar-h, 68px) + 12px);
  left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 420px;
  pointer-events: none;
}
.notice-stack > * { pointer-events: auto; }
.notice-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: #1C2028; border: 1px solid #2F343D; border-radius: 16px;
  box-shadow: 0 12px 28px rgba(19, 22, 28, 0.28); color: #fff;
}
.notice-avatar {
  position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--c);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.notice-badge {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #1C2028; display: grid; place-items: center; color: var(--ink);
}
.badge-late { background: var(--yellow); }
.badge-onTheWay { background: var(--teal-soft); }
.badge-arrived { background: var(--teal); color: #fff; }
.badge-custom { background: #fff; }
.badge-other { background: #C9CBD0; }
.notice-text { flex: 1; min-width: 0; }
.notice-line1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.notice-line1 b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-time { flex: none; font-size: 12px; color: #8A8F98; }
.notice-msg { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: #E4E5E8; overflow-wrap: anywhere; }
.notice-dismiss {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: #8A8F98; cursor: pointer;
}
.notice-dismiss:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* Collapsed stack: newest card + up to two peek layers + "N more updates" */
.notice-pile { position: relative; }
.notice-pile .notice-card { position: relative; z-index: 2; }
.notice-peek { position: absolute; border-radius: 16px; z-index: 1; }
.notice-peek.peek-1 { left: 8px; right: 8px; top: 10px; bottom: -10px; background: #23272F; border: 1px solid #2F343D; opacity: 0.85; }
.notice-peek.peek-2 { left: 16px; right: 16px; top: 18px; bottom: -18px; background: #2A2F38; opacity: 0.55; z-index: 0; }
.notice-more {
  display: flex; align-items: center; gap: 6px; margin: 22px auto 0; height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: rgba(19, 22, 28, 0.88); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-float);
}
.notice-card.is-new { animation: notice-in 0.2s ease-out; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes notice-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .notice-card.is-new { animation-name: notice-fade; } }

/* Expanded list over a dimmed page (the header stays clear) */
.notice-dim {
  position: fixed; z-index: 1040; left: 0; right: 0; bottom: 0; top: var(--topbar-h, 68px);
  background: rgba(19, 22, 28, 0.45);
}
.notice-list {
  display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain;
  max-height: calc(100vh - var(--topbar-h, 68px) - 24px); max-height: calc(100dvh - var(--topbar-h, 68px) - 24px);
  overflow-y: auto;
}
.notice-head { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 700; padding: 0 2px; }
.notice-head span { margin-right: auto; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.notice-pill {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(19, 22, 28, 0.88);
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.notice-pill.is-muted { background: var(--yellow); color: var(--ink); }
.notice-head { flex-wrap: wrap; }
.notice-empty {
  margin: 0; padding: 14px 16px; border-radius: 16px; background: #1C2028; border: 1px solid #2F343D;
  color: #E4E5E8; font-size: 14px;
}
.notice-card { touch-action: pan-x; transition: opacity 0.15s; }
.notice-collapse {
  width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(19, 22, 28, 0.88); color: #fff; cursor: pointer;
}
.notice-prev { margin: 4px 0 0; font-size: 12px; color: #8A8F98; }

/* ---------- Map markers (L.divIcon with className: '') ---------- */
.pin { position: relative; width: 46px; height: 56px; display: flex; flex-direction: column; align-items: center; }
.pin-dot {
  width: 46px; height: 46px; border-radius: 50%; flex: none; background: var(--c); border: 3px solid #fff;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 18%, transparent), 0 2px 6px rgba(19, 22, 28, 0.25);
  display: grid; place-items: center; color: #fff; font-family: var(--font-body); font-weight: 700; font-size: 17px;
}
.pin-stem { width: 3px; height: 10px; background: var(--c); }
.pin-name {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #fff; color: var(--ink); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-body); font-size: 13px; font-weight: 600; box-shadow: 0 1px 4px rgba(19, 22, 28, 0.18);
}
.pin.stale .pin-dot, .pin.stale .pin-stem { filter: grayscale(0.8); opacity: 0.6; }
.pin.arrived .pin-dot { box-shadow: 0 0 0 8px rgba(11, 122, 95, 0.32), 0 2px 6px rgba(19, 22, 28, 0.25); }

.meet-pin { width: 180px; height: 47px; display: flex; flex-direction: column; align-items: center; }
.meet-body {
  height: 40px; padding: 0 14px 0 12px; display: flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--yellow); border: 2px solid var(--yellow); border-radius: var(--r-md);
  font-family: var(--font-body); font-weight: 700; font-size: 14px; letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(19, 22, 28, 0.3);
}
.meet-logo { width: 24px; height: 24px; flex: none; display: block; margin-left: -2px; }
.meet-tail { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 7px solid var(--yellow); }

/* Wide screens: map and panel side by side at full height; the panel scrolls on its own. */
@media (min-width: 980px) {
  .room-body { flex-wrap: nowrap; overflow: hidden; }
  .map-wrap { min-height: 0; }
  .panel { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* Mid widths: the panel wraps under the map, so let it use the full row. */
@media (min-width: 768px) and (max-width: 979px) {
  .panel { max-width: none; }
  .map-wrap { min-height: 520px; }
}

/* ---------- Narrow screens: map on top, panel as a bottom sheet ---------- */
@media (max-width: 767px) {
  /* Two rows: brand + actions, then a bar with the meetup name and code side by side. */
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
    padding: 10px 12px 12px 16px; padding-top: max(10px, env(safe-area-inset-top));
  }
  .topbar-title { display: contents; }
  .topbar-brand { grid-column: 1; grid-row: 1; gap: 8px; min-width: 0; }
  .topbar-logo { width: 36px; height: 36px; }
  .wordmark { font-size: 18px; }
  .topbar-divider { display: none; }
  .topbar-actions { grid-column: 2; grid-row: 1; gap: 8px; }
  .title-stack {
    grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 10px;
    background: var(--ink-2); border-radius: var(--r-md); padding: 6px 6px 6px 12px;
  }
  #roomName { font-size: 17px; }
  .code-chip { height: 32px; padding: 0 2px 0 10px; background: var(--ink); border-radius: 8px; }
  .code-text { font-size: 13px; letter-spacing: 0.2em; }
  .copy-code { width: 28px; height: 28px; margin-left: 2px; }
  .btn-bar { padding: 0 14px; font-size: 14px; }
  .btn-bar svg { display: none; }

  .room-body { flex-wrap: nowrap; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
  .map-wrap { flex: none; height: 44vh; height: 44dvh; min-height: 260px; border-radius: 0; }
  .map-top { top: 12px; left: 12px; right: 12px; gap: 8px; }
  .host-tools { gap: 8px; max-width: none; }
  .search { padding: 4px 4px 4px 12px; border-radius: var(--r-md); }
  .search input[type="search"] { height: 38px; font-size: 16px; }
  .search .btn { height: 38px; padding: 0 14px; font-size: 14px; }
  .tap-set { font-size: 14px; border-radius: var(--r-md); }
  .map-tools { flex-direction: row; gap: 2px; border-radius: var(--r-md); }
  .tool { width: 44px; height: 38px; }

  /* Zoom bottom-right and attribution bottom-left, both above the sheet's rounded top. */
  .leaflet-bottom { bottom: 24px; }
  .leaflet-bottom.leaflet-left { left: auto; right: 0; }
  .leaflet-bottom.leaflet-right { right: auto; left: 0; }
  .leaflet-bottom.leaflet-left .leaflet-control { float: right; margin: 0 12px 12px 0; }
  .leaflet-bottom.leaflet-right .leaflet-control { float: left; margin: 0 0 8px 10px; }
  .leaflet-control-attribution.leaflet-control { font-size: 10px; padding: 2px 6px; border-radius: 5px; }

  .panel {
    flex: 1; min-height: 0; max-width: none; margin-top: -22px; position: relative; z-index: 950;
    background: var(--paper); border-radius: 24px 24px 0 0; box-shadow: 0 -6px 24px rgba(19, 22, 28, 0.12);
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
  }
  /* Grab handle: a full-width 32px button around the 40x4 bar. */
  .panel-handle {
    display: block; flex: none; height: 44px; margin: -10px -16px -8px; padding: 0;
    border: 0; background: transparent; cursor: pointer; touch-action: none;
  }
  .panel-handle::before {
    content: ""; display: block; width: 40px; height: 4px; margin: 0 auto;
    border-radius: 999px; background: #C9C5BA;
  }
  .panel-handle:focus-visible { outline-offset: -3px; }
  /* Expand/shrink button at the top right of the sheet */
  .panel { position: relative; }
  .sheet-expand {
    display: grid; place-items: center; position: absolute; top: 6px; right: 14px; z-index: 2;
    width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: transparent;
    color: var(--muted); cursor: pointer;
  }
  /* 44px tap area around the smaller visible button */
  .sheet-expand::after { content: ""; position: absolute; inset: -4px; }
  .sheet-expand:hover { background: rgba(19, 22, 28, 0.06); color: var(--ink); }
  .sheet-expand .i-min { display: none; }
  .sheet-expand[aria-pressed="true"] .i-max { display: none; }
  .sheet-expand[aria-pressed="true"] .i-min { display: block; }

  /* Full sheet: details and people fill the screen under the header; the map is hidden. */
  .room.sheet-full .map-wrap { flex: none; height: 0; min-height: 0; overflow: hidden; }
  .room.sheet-full .panel { margin-top: 0; border-radius: 0; box-shadow: none; }

  /* Collapsed sheet: only the handle and the meetup summary stay; the map takes the rest. */
  .room.sheet-collapsed .map-wrap { flex: 1; height: auto; }
  .room.sheet-collapsed .panel { flex: none; overflow: hidden; }
  .room.sheet-collapsed .panel > :not(.panel-handle):not(#meetupInfo) { display: none; }
  .room.sheet-collapsed .panel { gap: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

  /* Collapsed summary: one strip with name + distance, and the landmark note on one line. */
  .room.sheet-collapsed #meetupInfo { padding: 10px 14px; border-radius: 14px; }
  .room.sheet-collapsed .mi-top { align-items: center; gap: 12px; }
  .room.sheet-collapsed .meetup-info .eyebrow,
  .room.sheet-collapsed .progress,
  .room.sheet-collapsed .mi-arrived,
  .room.sheet-collapsed .mi-dist span { display: none; }
  .room.sheet-collapsed .mi-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room.sheet-collapsed .mi-dist strong { font-size: 20px; }
  .room.sheet-collapsed .mi-sub {
    display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--muted-on-ink);
  }
  .room.sheet-collapsed .mi-note { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room.sheet-collapsed .mi-count { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
  .room.sheet-collapsed .mi-count strong { color: #fff; }
  .room.sheet-collapsed .mi-empty { font-size: 13px; gap: 10px; }
  .room.sheet-collapsed .mi-flag { width: 32px; height: 32px; border-radius: 9px; }
  .room.sheet-collapsed #meetupInfo { cursor: pointer; }
  .card { border-radius: 16px; padding: 14px; }

  /* Compact meetup summary */
  .card-ink { padding: 14px 16px; }
  .mi-name { font-size: 18px; }
  .mi-dist strong { font-size: 26px; }
  .mi-dist span { font-size: 12px; }
  .progress { height: 6px; margin: 12px 0 8px; }
  .mi-arrived { font-size: 12px; }
  .mi-empty { font-size: 14px; }

  /* Status buttons sit straight on the sheet */
  .my-controls { display: contents; }
  .my-controls > .eyebrow, .card-divider { display: none; }
  .status-group > .eyebrow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .status-track { background: #fff; border: 1px solid var(--line); }
  .status-btn { min-height: 50px; font-size: 12px; gap: 3px; padding: 6px 2px; }
  .custom-status { margin-top: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; gap: 8px; }
  .custom-icons { gap: 5px; }
  .custom-icon { height: 42px; }
  .custom-icon svg { width: 18px; height: 18px; }
  .custom-note { font-size: 11px; }
  .custom-note .note-long { display: none; }
  .custom-note .note-short { display: inline; }
  .status-btn svg { width: 18px; height: 18px; }
  .share-row, .loc-row, .loc-msg { background: var(--card); border: 1px solid var(--line); padding: 12px 14px; }
  .share-row { border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: 6px; }
  .loc-row {
    margin-top: -12px; border-top: 0; border-radius: 0 0 16px 16px; padding-top: 6px;
    flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px;
  }
  .loc-msg { margin: -12px 0 0; border-radius: 0 0 16px 16px; border-top: 0; }
  .loc-row:has(+ .loc-msg:not([hidden])) { border-radius: 0; }
  .share-title { font-size: 14px; }
  .share-hint { font-size: 12px; }
  .switch { width: 52px; height: 30px; }
  .switch .knob { width: 24px; height: 24px; }
  .switch[aria-checked="true"] .knob { transform: translateX(22px); }
  .check { font-size: 14px; gap: 8px; }
  .check input { width: 18px; height: 18px; }

  .member { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .avatar { width: 40px; height: 40px; font-size: 15px; }
  .member-name b { font-size: 15px; }
  .member-dist { font-size: 17px; }
  .member-dist small { font-size: 11px; }
  .end-btn { margin-top: 4px; min-height: 46px; border-radius: var(--r-md); font-size: 14px; }

  .toast { bottom: auto; top: calc(118px + 12px + env(safe-area-inset-top)); }
}

/* Very small phones: keep brand, bell, Invite and Leave on one row. */
@media (max-width: 380px) {
  .wordmark { font-size: 16px; }
  .topbar-actions { gap: 6px; }
  .btn-bar { padding: 0 11px; }
}

/* ---------- Invite sheet (QR code of the join link) ---------- */
/* Desktop: centred dialog. Mobile (<= 767px): bottom sheet with a grab handle. */
.invite-dim {
  position: fixed; inset: 0; z-index: 1300; background: rgba(19, 22, 28, 0.55);
  opacity: 0; transition: opacity 0.2s ease;
}
.invite-dim.is-open { opacity: 1; }
.invite-sheet {
  position: fixed; z-index: 1310; left: 50%; top: 50%;
  width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: #fff; border-radius: 26px; padding: 10px 20px 24px;
  box-shadow: 0 -10px 30px rgba(19, 22, 28, 0.25);
  display: flex; flex-direction: column; gap: 16px;
  translate: -50% -50%; opacity: 0; scale: 0.97;
  transition: opacity 0.2s ease, scale 0.2s ease;
}
.invite-sheet.is-open { opacity: 1; scale: 1; }
.invite-sheet[hidden], .invite-dim[hidden] { display: none; }
.invite-grab { display: none; }

.invite-head { display: flex; align-items: flex-start; gap: 12px; padding-top: 10px; }
.invite-head-text { flex: 1; min-width: 0; }
.invite-title {
  margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invite-sub { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.invite-close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.invite-close:hover { background: var(--field); }

.invite-qr-card {
  align-self: center; padding: 18px; border-radius: 22px; background: #fff;
  border: 1.5px solid var(--line); box-shadow: 0 6px 20px rgba(19, 22, 28, 0.08);
}
.invite-qr {
  width: 260px; height: 260px; display: grid; place-items: center;
  color: var(--muted); font-size: 14px; text-align: center;
}
.invite-qr svg { display: block; }

.invite-code-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.invite-code-label { font-size: 13px; color: var(--muted); }
.invite-code {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px;
  border: 0; border-radius: 10px; background: var(--ink); color: var(--yellow); cursor: pointer;
}
.invite-code-text { font-family: var(--font-mono); font-weight: 700; font-size: 16px; letter-spacing: 0.22em; }
.invite-code:hover { background: var(--ink-2, #22262E); }

.invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.invite-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; border-radius: 14px; font: 600 15px/1 var(--font-body); color: var(--ink); cursor: pointer;
}
.invite-btn-share { background: var(--yellow); border: 1.5px solid var(--yellow); }
.invite-btn-share:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }
.invite-btn-copy { background: #fff; border: 1.5px solid var(--line-strong); }
.invite-btn-copy:hover { background: var(--field); }

.invite-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; margin-top: -6px; border: 0; border-radius: 12px; background: transparent;
  color: var(--teal); font: 600 14px/1 var(--font-body); cursor: pointer;
}
.invite-save:hover { background: rgba(11, 122, 95, 0.08); }

.invite-sheet :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

@media (max-width: 767px) {
  .invite-sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(100dvh - 24px);
    border-radius: 26px 26px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom));
    translate: none; scale: 1; opacity: 1; transform: translateY(100%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .invite-sheet.is-open { transform: translateY(0); }
  .invite-sheet.is-dragging { transition: none; }
  .invite-grab {
    display: block; width: 40px; height: 4px; border-radius: 999px; background: #D6D2C7;
    margin: 0 auto -6px; flex: none;
  }
  .invite-grab, .invite-head, .invite-qr-card { touch-action: none; }
  .invite-qr { width: 236px; height: 236px; }
}
@media (max-width: 380px) {
  .invite-sheet { padding-left: 16px; padding-right: 16px; }
  .invite-qr { width: 216px; height: 216px; }
}
@media (prefers-reduced-motion: reduce) {
  .invite-sheet, .invite-dim { transition: none; }
}
.invite-link-field {
  width: 100%; height: 44px; margin-top: -6px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--field); color: var(--ink);
  font: 500 14px/1 var(--font-body);
}
.invite-link-field[hidden] { display: none; }
.invite-btn.is-done .invite-btn-label, .invite-code.is-done .invite-code-text { font-weight: 700; }
.invite-code.is-done .invite-code-text { letter-spacing: 0.04em; font-family: var(--font-body); }
