:root {
  --bg: #0c0e12;
  --panel: rgba(14, 17, 22, 0.84);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eaed;
  --muted: #9aa4b2;
  --accent: #ffd166;
  --tab: #ff9a1f;
  --live: #ff5a5f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#map { position: fixed; inset: 0; }

.card {
  position: absolute; bottom: 14px; left: 14px; z-index: 2;
  width: max-content; max-width: min(360px, calc(100vw - 32px)); padding: 16px 18px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.eyebrow:empty { display: none; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.place { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 2px; }
.meta { font-size: 14px; color: #c3cad5; }
.totals { font-size: 12px; color: var(--muted); margin-top: 8px; }
.totals:empty, .meta:empty { display: none; }
.public-sees { font-size: 12px; color: var(--accent); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.public-sees:empty { display: none; }

.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text);
  font: inherit; font-size: 12.5px; padding: 6px 11px; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[hidden] { display: none; }

.updated { font-size: 12.5px; color: #c3cad5; margin-top: 4px; }
.updated:empty { display: none; }
/* The legend folds behind a link at the foot of the card, so opening it grows the card upward. */
.legend-box { margin-top: 10px; }
.legend-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 7px; }
.legend-list[hidden] { display: none; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c3cad5; }
.legend-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.legend-btn:hover { color: var(--text); }
.legend-btn[aria-expanded="true"]::after { content: " ▾"; }
.legend-btn[aria-expanded="false"]::after { content: " ▴"; }
.legend-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #c3cad5; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip-emoji { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid; background: #0c0e12; font-size: 12px; line-height: 1; flex: none; }

/* Where I am. The public ring is deliberately wide: it marks a town, not a door. */
.town {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--accent); background: rgba(255, 209, 102, 0.16);
  animation: pulse-town 2.4s ease-out infinite;
}
.me {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--live); border: 2px solid #fff;
  animation: pulse-me 2s ease-out infinite;
}
@keyframes pulse-town { 0% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.45); } 100% { box-shadow: 0 0 0 22px rgba(255, 209, 102, 0); } }
@keyframes pulse-me { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.55); } 100% { box-shadow: 0 0 0 18px rgba(255, 90, 95, 0); } }
/* The card's status: a coloured dot and a word. On the move pulses, like my dot on the map. */
.status-line { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #718096; }
.status-dot[data-state="moving"] { background: #ff5a5f; animation: pulse-dot 2s ease-out infinite; }
.status-dot[data-state="exploring"] { background: #48bb78; }
.status-dot[data-state="idle"] { background: #ecc94b; }
.status-dot[data-state="offline"] { background: #4a5568; box-shadow: inset 0 0 0 2px #718096; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(255, 90, 95, 0); } }
@media (prefers-reduced-motion: reduce) { .town, .me, .status-dot { animation: none !important; } }

/* Popups, dark to match. */
.maplibregl-popup-content { background: #141820; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.maplibregl-popup-tip { border-top-color: #141820 !important; border-bottom-color: #141820 !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 2px 8px; }
.pop-kind { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pop-title { font-size: 16px; font-weight: 650; margin: 2px 0 4px; padding-right: 14px; }
.pop-prose { margin: 6px 0; font-size: 13.5px; color: #c3cad5; }
.pop-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pop-links { display: flex; gap: 6px; margin-top: 10px; }
.maplibregl-ctrl-attrib { background: rgba(12, 14, 18, 0.7) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

@media (max-width: 520px) {
  .card { padding: 12px 14px 10px; }
  .place { font-size: 26px; }
}

/* ---- The pause menu --------------------------------------------------------
   Off Rockstar's pause menus: the game plays a moment behind, then blurs and
   pauses as the menu opens. Title and status on top, tabs across, one panel. */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #2a3a2c 0%, #151b17 45%, #0c0e12 100%); }
.backdrop .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: filter 0.9s ease, transform 0.9s ease; }
.backdrop video:not([src]), .backdrop video.missing { display: none; }
/* No play button over the game, ever: it's scenery, not a player. */
.backdrop video::-webkit-media-controls, .backdrop video::-webkit-media-controls-start-playback-button,
.backdrop video::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
.backdrop .bg { pointer-events: none; }
body.menu-open .backdrop .bg { filter: blur(14px) brightness(0.55) saturate(0.9); transform: scale(1.06); }
body.menu-open .backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(8, 10, 12, 0.25); }

.menu { position: fixed; inset: 0; z-index: 1; display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr);
  width: min(1180px, 100%); margin: 0 auto;
  padding: max(28px, 4.5vh) max(24px, 4vw) calc(max(18px, 2.5vh) + 42px);
  transition: opacity 0.35s ease, transform 0.35s ease; }
body:not(.menu-open) .menu { opacity: 0; transform: scale(0.985); pointer-events: none; }

.menu-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 15px; }
.menu-me { display: flex; align-items: flex-end; gap: 12px; }
.portrait { width: 64px; height: 64px; object-fit: cover; display: block; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.pin { margin-right: 4px; }
.pin:has(+ :empty) { display: none; }
.flag { width: 26px; height: 26px; margin-right: 10px; vertical-align: -3px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.flag[hidden] { display: none; }
.menu-title { margin: 0; font: 500 clamp(28px, 4.2vw, 46px)/1 Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.005em; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.menu-status { text-align: right; font: 500 15px/1.15 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase;
  letter-spacing: 0.03em; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.menu-status #statusPlace { color: #d8dde4; }

.tabs-wrap { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.tab-arrow { appearance: none; border: 0; background: none; color: #fff; font-size: 28px; line-height: 1;
  padding: 0 4px; cursor: pointer; opacity: 0.85; }
.tab-arrow:hover { opacity: 1; }
.tabs { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { appearance: none; flex: 1 0 auto; min-width: 118px; scroll-snap-align: start;
  border: 0; border-left: 1px solid rgba(255, 255, 255, 0.10); border-top: 4px solid transparent;
  background: rgba(12, 14, 18, 0.72); color: #e9ecef; cursor: pointer;
  font: 500 14px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 11px 16px 12px; }
.tab:first-child { border-left: 0; }
.tab:hover { background: rgba(40, 44, 52, 0.85); }
.tab[aria-selected="true"] { background: #f4f5f6; color: #0c0e12; border-top-color: var(--tab); }
.tab:focus-visible, .tab-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.panel { position: relative; min-height: 0; margin-top: 12px; background: rgba(12, 14, 18, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); overflow: hidden; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.view-map #map { position: absolute; inset: 0; }
.view-page { overflow-y: auto; padding: 26px clamp(18px, 3vw, 36px) 32px; }
.view-page h2 { margin: 0 0 16px; font: 500 26px/1.1 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
.empty { color: var(--muted); max-width: 56ch; }
.who { max-width: 62ch; font-size: 16px; line-height: 1.6; color: #dfe3e8; }
.who p { margin: 0 0 14px; }
.who p:first-child { font: 500 20px/1.3 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter { appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text);
  font: inherit; font-size: 12.5px; padding: 6px 12px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; }
.filter[aria-pressed="true"] { background: #f4f5f6; color: #0c0e12; }
.filter:disabled { opacity: 0.35; cursor: default; }
.feed { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.feed li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.feed li:first-child { border-top: 0; }
.feed li.empty { display: block; cursor: default; }
.feed li:hover .feed-title { color: var(--accent); }
.feed-day { font-size: 12.5px; color: var(--muted); padding-top: 3px; }
.feed-kind { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.feed-title { font-size: 16px; font-weight: 600; }

.stats { display: grid; grid-template-columns: 1fr auto; margin: 0; max-width: 620px; }
.stats dt, .stats dd { margin: 0; padding: 11px 0; border-top: 1px solid var(--line); }
.stats dt { color: #cfd5dd; text-transform: uppercase; font-size: 13px; letter-spacing: 0.05em; }
.stats dd { text-align: right; font: 500 18px/1.2 Oswald, "Arial Narrow", sans-serif; }
.stats dt:first-of-type, .stats dd:first-of-type { border-top: 0; }

/* Missions, after Red Dead's replay menu: a category heading paged with arrows,
   the chosen mission's detail on the left, the list on the right. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The categories as a row of tabs, all at once, scrolling sideways on a phone. */
.mission-cats { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.mission-cats::-webkit-scrollbar { display: none; }
.mission-cats[hidden] { display: none; }
.mission-cat { appearance: none; flex: none; display: inline-flex; align-items: baseline; gap: 8px; background: none; border: 0; border-bottom: 3px solid transparent; color: #c3cad5; cursor: pointer;
  padding: 8px 12px 9px; font: 500 17px/1.1 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.mission-cat:hover { color: #fff; }
.mission-cat.on { color: #fff; border-bottom-color: var(--tab); }
.mission-cat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat-count { font: 600 11.5px/1 system-ui, sans-serif; color: var(--muted); letter-spacing: 0; }
.detail-set { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.mission-menu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; align-items: start; }
.mission-menu[hidden] { display: none; }
.mission-detail { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.detail-title { font: 500 20px/1.15 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
.mission-prose { margin: 8px 0 0; color: #cfd5dd; font-size: 14px; line-height: 1.45; }
.checklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; color: #cfd5dd; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .box { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #9aa4b2; font-size: 13px; font-weight: 700; color: #ff5a5f; }
.mission-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); display: grid; gap: 4px; padding-top: 8px; }
.mission-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid transparent; cursor: pointer; font-size: 15px; }
.mission-row:hover { background: rgba(255, 255, 255, 0.09); }
.mission-row.on { border-color: #d64545; background: rgba(255, 255, 255, 0.09); }
.mission-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mission-mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #9aa4b2; font-size: 12px; font-weight: 700; color: #0c0e12; }
.mission-mark.done { background: #ecc94b; border-color: #ecc94b; }
.mission-mark.count { width: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; color: #e9ecef; font-size: 11.5px; }
@media (max-width: 700px) {
  .mission-menu { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.projects li { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); padding: 16px 18px; }
.projects h3 { margin: 0 0 6px; font: 500 20px/1.1 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; }
.projects p { margin: 0 0 12px; color: #c3cad5; }

/* The same bounds as the menu's content, so the footer lines up with the map at every width. */
.menu-foot { position: fixed; z-index: 2; left: calc(max(0px, (100vw - 1180px) / 2) + max(24px, 4vw)); right: calc(max(0px, (100vw - 1180px) / 2) + max(24px, 4vw)); bottom: max(18px, 2.5vh);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; pointer-events: none; }
.menu-foot > * { pointer-events: auto; }
a.hint-btn { text-decoration: none; }
.foot-copy { color: var(--muted); }
body:not(.menu-open) .browse-hint { display: none; }
.browse-hint { display: inline-flex; align-items: center; gap: 8px; }
.hint-label { color: var(--muted); }
.hint-btn { appearance: none; border: 0; background: none; color: inherit; font: inherit; padding: 4px 6px; margin: -4px -6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.hint-btn:hover { color: #fff; }
.hint-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hints { display: flex; align-items: center; gap: 22px; font-size: 13px; color: #e9ecef; background: rgba(12, 14, 18, 0.72); padding: 6px 10px; }
.hints kbd { display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 5px; background: #f4f5f6; color: #0c0e12;
  font: 600 11px/1.5 ui-sans-serif, system-ui, sans-serif; text-align: center; }
/* Phones: buttons without the keyboard's letters, along the bottom. */
@media (hover: none), (max-width: 700px) {
  .hints kbd { display: none; }
  .menu-foot { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .hints { justify-content: space-between; padding: 0; background: none; }
  #hideBtn { margin-left: auto; }
  .hint-btn { margin: 0; padding: 10px 16px; min-width: 48px; justify-content: center; background: rgba(20, 23, 29, 0.86); border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
  .hint-btn span[aria-hidden] { font-size: 20px; line-height: 1; }
  .browse-hint { gap: 6px; }
  .hint-label { display: none; }
  /* The links sit in a small line above the buttons. */
  .menu-foot { gap: 6px; }
  .menu-foot > .hints { flex: 1 1 100%; }
  /* The buttons first, then the site's links spread to the map's edges. */
  .foot-links { order: 2; justify-content: space-between; gap: 14px; font-size: 12px; }
  .foot-links .hint-btn { background: none; border: 0; padding: 2px 0; min-width: 0; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
}

@media (max-width: 700px) {
  /* The menu runs down to just above the buttons, the game showing round its edges. */
  .menu { grid-template-rows: auto auto minmax(0, 1fr); padding: max(10px, env(safe-area-inset-top)) 12px calc(max(12px, env(safe-area-inset-bottom)) + 92px); }
  .menu-head { padding: 0 2px 8px; align-items: center; }
  .menu-title { font-size: 26px; }
  .menu-status { font-size: 13px; }
  .portrait { width: 40px; height: 40px; }
  .menu-me { gap: 8px; }
  .flag { width: 22px; height: 22px; margin-right: 8px; }
  .st-country { display: none; }
  .tabs-wrap { gap: 0; }
  .tab-arrow { padding: 0 6px; font-size: 24px; }
  .tab { min-width: 0; flex: 0 0 auto; font-size: 13px; padding: 10px 14px 11px; }
  /* Space under the tabs, and the map and its card as two blocks with the game between. */
  .panel { margin-top: 10px; box-shadow: none; background: transparent; overflow: visible; }
  .view-page { background: rgba(12, 14, 18, 0.78); }
  /* On a phone the card sits under the map rather than over it. */
  .view-map { display: flex; flex-direction: column; gap: 10px; }
  .view-map #map { position: relative; inset: auto; flex: 1; min-height: 0; }
  .view-map .card { position: static; width: auto; max-width: none; border-radius: 0; box-shadow: none; padding: 12px 14px 10px; }
  .view-page { padding: 20px 16px max(28px, env(safe-area-inset-bottom)); }
  .feed li { grid-template-columns: 70px 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .backdrop .bg, .menu { transition: none; } }

/* ---- The sorting page ------------------------------------------------------ */
body[data-mode="admin"] { height: auto; min-height: 100%; }
body[data-mode="admin"] #map { position: sticky; top: 0; inset: auto; height: 34vh; min-height: 200px; z-index: 1; }
.sorter { max-width: 640px; margin: 0 auto; padding: 16px 16px max(40px, env(safe-area-inset-bottom)); }
.sort-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pin-card {
  --kind: #718096;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--kind);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.pin-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pin-name { font-size: 16px; font-weight: 650; }
.pin-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pin-status { font-size: 12.5px; color: var(--accent); margin-top: 10px; }
.icon-btn { appearance: none; background: none; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kind {
  --c: #718096;
  appearance: none; font: inherit; font-size: 13px; padding: 7px 11px; min-height: 34px; border-radius: 999px; cursor: pointer;
  color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.kind.on { background: var(--c); color: #0c0e12; font-weight: 650; border-color: var(--c); }
.kind.keep { --c: #a0aec0; }
.kind.back { --c: #4a5568; color: var(--muted); }
.kind:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.done-box { margin-top: 18px; }
.done-box summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; }
.empty { color: var(--muted); font-size: 14px; }
.chosen { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45); }
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: #1a202c; color: var(--text); border: 1px solid var(--line); padding: 9px 14px; border-radius: 999px;
  font-size: 13.5px; transition: opacity 0.2s, transform 0.2s; z-index: 5; pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

body[data-mode="admin"] .tabs { display: flex; gap: 6px; margin: 0 0 14px; }
body[data-mode="admin"] .tab {
  appearance: none; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 999px; cursor: pointer; min-width: 0; flex: 1 1 0;
  color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
body[data-mode="admin"] .tab.on { color: var(--text); background: rgba(255, 255, 255, 0.12); }
body[data-mode="admin"] .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.leg-route { font-size: 16px; font-weight: 650; }

.view-btn { display: grid; place-items: center; color: #333; }

/* The dashboard's own fields. */
.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field textarea, .pin-card textarea {
  font: 15px/1.4 system-ui, sans-serif; color: var(--text); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-transform: none; letter-spacing: 0; width: 100%; box-sizing: border-box; }
.field input[type="date"] { color-scheme: dark; }
.field textarea, .pin-card textarea { resize: vertical; }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field-row .field { flex: 1 1 140px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 8px 0; }
.mission-form { display: grid; gap: 10px; margin-bottom: 16px; }
.mission-form .btn { justify-self: start; }
.pin-emoji { font-size: 20px; margin-right: 6px; }
.prose-box { display: grid; gap: 6px; margin-top: 10px; }
.prose-box .btn { justify-self: start; }
.pin-prose { margin: 8px 0 0; color: #cfd5dd; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.kind.danger { --c: #fc8181; color: #fc8181; }

/* ---- Plain pages: the privacy policy -------------------------------------- */
body[data-mode="page"] { height: auto; min-height: 100%; overflow: auto; }
.doc { max-width: 640px; margin: 0 auto; padding: 32px 20px 48px; line-height: 1.55; }
.doc h1 { margin: 22px 0 14px; font: 500 34px/1.1 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; }
.doc h2 { margin: 26px 0 6px; font: 500 18px/1.2 Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.doc p { margin: 0 0 12px; color: #d8dde4; }
.doc a:not(.btn) { color: var(--text); }
.doc-foot { margin-top: 32px; font-size: 13px; color: var(--muted) !important; }

/* A mission's steps on the dashboard. */
.steps { display: grid; gap: 6px; margin-top: 10px; }
.step-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.step-row .step-text { flex: 1; }
.step-row input[type="date"] { color-scheme: dark; background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 13px; }
.step-row input:not([type]) { flex: 1; background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 14px; }
