/* =================================================================
   Classroom Atlas — styles
   ================================================================= */
:root {
  --paper: #f8f4ea;
  --card: #ffffff;
  --ink: #26323f;
  --muted: #6b7280;
  --accent: #1e3a5f;
  --gold: #b8860b;
  --line: #e3dcc9;
  --scale: 1;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  overflow: hidden;
}

#app { display: flex; height: 100vh; }

/* ---------------- Sidebar ---------------- */
#sidebar {
  width: 350px; min-width: 350px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: margin-left 0.3s ease;
  z-index: 1001;
}
body.sidebar-hidden #sidebar { margin-left: -350px; }
#sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent); color: #fff;
}
#sidebar-header h1 {
  margin: 0; font-size: 19px; letter-spacing: 0.4px;
  font-family: Iowan Old Style, Palatino, Georgia, serif;
}
#sidebar-header .sub { font-size: 11px; opacity: 0.75; margin-top: 2px; }
#btn-collapse {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
#btn-collapse:hover { background: rgba(255,255,255,0.15); }

#sidebar-body { flex: 1; overflow-y: auto; padding: 10px 14px 30px; }

details.section { margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
details.section > summary {
  cursor: pointer; padding: 10px 12px; font-weight: 650; font-size: 14px;
  list-style: none; user-select: none; color: var(--accent);
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: '▸'; float: right; color: var(--muted); transition: transform 0.15s; }
details.section[open] > summary::after { transform: rotate(90deg); }
.section-body { padding: 0 12px 12px; }

select, input[type="text"] {
  width: 100%; padding: 8px 10px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
select:focus, input:focus { outline: 2px solid #a9c3e0; }

button.pill {
  border: 1px solid var(--line); background: #fff; color: var(--accent);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  margin: 3px 4px 3px 0;
}
button.pill:hover { background: #eef3f9; }
button.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: #2c5384; }

.hidden { display: none !important; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 2px; }

/* Passage card */
#passage-card { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
#p-title { font-family: Iowan Old Style, Palatino, Georgia, serif; font-size: 17px; margin: 0 0 2px; color: var(--accent); }
#p-ref { font-size: 13px; color: var(--gold); font-weight: 650; }
#p-date { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
#p-summary { font-size: 13px; line-height: 1.45; margin: 6px 0; }
#p-distance { font-size: 12.5px; color: var(--accent); font-weight: 600; }
#p-routenote { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 3px; }

#p-stops { list-style: none; padding: 0; margin: 8px 0; }
#p-stops li {
  display: flex; align-items: baseline; gap: 8px; padding: 5px 6px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
#p-stops li:hover { background: #efe9d8; }
#p-stops li .num {
  background: var(--accent); color: #fff; min-width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  align-self: center;
}
#p-stops li.role-key .num { background: var(--gold); }
#p-stops li .nm { font-weight: 600; }
#p-stops li .vs { color: var(--muted); font-size: 11.5px; margin-left: auto; white-space: nowrap; }

#p-text, #lookup-result {
  background: #fffdf5; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px; font-size: 13.5px; line-height: 1.55;
  max-height: 300px; overflow-y: auto;
  font-family: Iowan Old Style, Palatino, Georgia, serif;
}
.txt-ref { font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.txt-body sup { color: var(--gold); font-weight: 700; margin-right: 2px; }
.txt-src { margin-top: 8px; font-size: 11px; color: var(--muted); font-family: -apple-system, sans-serif; }

/* Overlay radios */
.overlay-list { display: flex; flex-direction: column; gap: 2px; }
.overlay-list label {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  padding: 4px 6px; border-radius: 6px; cursor: pointer;
}
.overlay-list label:hover { background: #efe9d8; }
.overlay-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 8px 0 2px; }
#opacity-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
#overlay-opacity { flex: 1; }

/* Search */
#search-results { margin-top: 6px; }
.search-hit { padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.search-hit:hover { background: #efe9d8; }
.sh-modern { color: var(--muted); font-size: 12px; }
.search-none { color: var(--muted); font-size: 12.5px; padding: 6px; }

/* ---------------- Map ---------------- */
#map { flex: 1; height: 100%; background: #cfe3f0; }

#btn-open-sidebar {
  position: absolute; top: 12px; left: 12px; z-index: 1000;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 13px; font-size: 15px; cursor: pointer; display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
body.sidebar-hidden #btn-open-sidebar { display: block; }

/* Region labels */
.region-label {
  font-family: Iowan Old Style, Palatino, Georgia, serif;
  font-variant: small-caps; letter-spacing: 1.5px;
  font-size: calc(14px * var(--scale)); font-weight: 700; color: #4a3a24;
  text-align: center; white-space: nowrap;
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 6px #fff, 1px 1px 2px #fff;
  pointer-events: none;
}

/* Stop markers */
.stop-marker {
  background: var(--accent); border: 2.5px solid #fff; border-radius: 50%;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: calc(13px * var(--scale)); font-weight: 800;
  box-shadow: 0 1px 5px rgba(0,0,0,0.5);
  transform: scale(var(--scale)); transform-origin: center;
}
.stop-marker span { line-height: 1; }
.stop-marker.role-key { background: var(--gold); }
.stop-marker.role-start { background: #2e7d32; }
.stop-marker.role-end { background: #8e2323; }

.mover { font-size: calc(26px * var(--scale)); text-shadow: 0 0 6px #fff, 0 1px 3px rgba(0,0,0,0.6); }

.temp-label {
  font-size: calc(11px * var(--scale)); font-weight: 700; color: #1a1a2e; text-align: center;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff;
  pointer-events: none;
}

.measure-tip {
  background: #fff8e6; border: 1px solid var(--gold); border-radius: 6px;
  font-size: 12px; font-weight: 700; color: #7a5800; padding: 2px 6px;
  white-space: nowrap; width: auto !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* Popups */
.popup .pp-name { font-family: Iowan Old Style, Palatino, Georgia, serif; font-weight: 700; font-size: calc(16px * var(--scale)); color: var(--accent); }
.popup .pp-verse { color: var(--gold); font-weight: 650; font-size: calc(12.5px * var(--scale)); margin: 2px 0 4px; }
.popup .pp-note { font-size: calc(13px * var(--scale)); line-height: 1.4; }
.popup .pp-modern { font-size: calc(11.5px * var(--scale)); color: var(--muted); margin-top: 6px; border-top: 1px solid #eee; padding-top: 4px; }
.leaflet-popup-content { margin: 12px 16px; }

/* Legend */
.atlas-legend {
  background: rgba(255,255,255,0.95); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: calc(12px * var(--scale)); color: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18); max-width: 280px; display: none;
  max-height: 55vh; overflow-y: auto;
}
.lg-hr { border: none; border-top: 1px dashed var(--line); margin: 8px 0; }
.lg-group { font-weight: 650; font-size: calc(11px * var(--scale)); color: var(--muted); margin: 5px 0 2px; text-transform: uppercase; letter-spacing: 0.6px; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 3px 8px; }
.lg-chip { display: inline-flex; align-items: center; gap: 3px; font-size: calc(10.5px * var(--scale)); cursor: help; }
.lg-chip .lg-swatch { width: 12px; height: 10px; }
.lg-dot { border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 2px rgba(0,0,0,0.4); flex: none; }
.units-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.units-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
button.pill.seg { padding: 5px 10px; margin: 0; border-radius: 7px; }
.lg-title { font-weight: 750; margin-bottom: 6px; font-size: calc(13px * var(--scale)); color: var(--accent); }
.lg-unit { font-weight: 400; color: var(--muted); }
.lg-row { display: flex; align-items: center; gap: 7px; margin: 2px 0; }
.lg-swatch { width: 16px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.15); flex: none; }
.lg-note { margin-top: 6px; font-size: calc(10.5px * var(--scale)); color: var(--muted); }
.tt-yr { color: var(--muted); font-size: 11px; }

/* ---------------- Graticule (lat/long grid) ---------------- */
.grat-label {
  width: 0 !important; height: 0 !important;
  white-space: nowrap; pointer-events: none;
  font-size: calc(11px * var(--scale)); font-weight: 700; color: #24405f;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 5px #fff;
  font-variant-numeric: tabular-nums;
}
.grat-lat { transform: translate(5px, -140%); }
.grat-lon { transform: translate(4px, 3px); }
.grat-zero { color: #9c2b2b; font-size: calc(12px * var(--scale)); }
.grat-named { color: #9c2b2b; font-style: italic; font-weight: 650; letter-spacing: 0.4px; }
.grat-special { color: #7a5310; font-style: italic; font-weight: 650; }

/* ---------------- Coordinates game ---------------- */
.g-field { display: block; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.g-field span { display: block; margin-bottom: 3px; }
.g-check { display: flex; align-items: center; gap: 7px; font-size: 13px; margin: 10px 0; cursor: pointer; }
.g-start { width: 100%; margin-top: 4px; }

.g-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 12px; }
.g-progress { color: var(--muted); font-weight: 600; }
.g-score { color: var(--accent); font-weight: 750; }

.g-card {
  background: #fffdf5; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; text-align: center;
}
.g-ask { font-size: 13px; color: var(--muted); }
.g-coords {
  font-family: Iowan Old Style, Palatino, Georgia, serif;
  font-size: calc(26px * var(--scale)); font-weight: 700; color: var(--accent);
  margin: 6px 0 12px; letter-spacing: 0.5px;
}
.g-city {
  font-family: Iowan Old Style, Palatino, Georgia, serif;
  font-size: calc(22px * var(--scale)); font-weight: 700; color: var(--accent); margin: 4px 0 12px;
}
.g-country { display: block; font-family: -apple-system, sans-serif; font-size: 12px; color: var(--muted); font-weight: 400; }

.g-choices { display: flex; flex-direction: column; gap: 6px; }
.g-choice {
  text-align: left; padding: 9px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1.25;
}
.g-choice:hover:not(:disabled) { background: #eef3f9; border-color: #a9c3e0; }
.g-choice .g-country { display: block; font-weight: 400; }
.g-choice.right { background: #e4f5e6; border-color: #2e7d32; }
.g-choice.wrong { background: #fdeaea; border-color: #b03030; }
.g-choice:disabled { cursor: default; opacity: 0.95; }

.g-inputs { margin: 4px 0 10px; }
.g-inrow { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.g-inrow label { width: 68px; text-align: right; font-size: 12.5px; color: var(--muted); }
.g-inrow input { width: 74px; padding: 7px 8px; font-size: 15px; text-align: right; }
.g-inrow select { width: 58px; padding: 7px 4px; }
.g-deg { font-size: 15px; color: var(--muted); }
.g-warn { color: #b03030; font-size: 12px; margin-top: 6px; min-height: 14px; }

.g-verdict { font-size: 15px; font-weight: 700; margin: 10px 0 4px; text-align: center; }
.g-verdict.ok { color: #2e7d32; }
.g-verdict.no { color: #b03030; }
.g-answer { font-size: 13.5px; line-height: 1.45; text-align: center; margin-bottom: 8px; }
.g-exactc { font-size: 11.5px; color: var(--muted); }
.g-yours { font-size: 12.5px; color: #b03030; }
#g-feedback button { width: 100%; }
.g-quit { width: 100%; margin-top: 10px; color: var(--muted); }

.g-result { text-align: center; }
.g-bigscore {
  font-family: Iowan Old Style, Palatino, Georgia, serif;
  font-size: calc(40px * var(--scale)); font-weight: 700; color: var(--accent); line-height: 1.1;
}
.g-pct { font-size: 13px; color: var(--gold); font-weight: 650; }
.g-msg { font-size: 13px; margin: 8px 0 10px; }
.g-review { list-style: none; padding: 0; margin: 0 0 12px; text-align: left; max-height: 260px; overflow-y: auto; }
.g-review li {
  display: flex; align-items: baseline; gap: 7px; padding: 4px 7px;
  border-radius: 6px; font-size: 12.5px; border-left: 3px solid transparent;
}
.g-review li.ok { background: #f0f8f1; border-left-color: #2e7d32; }
.g-review li.no { background: #fdf1f1; border-left-color: #b03030; }
.g-rnum { color: var(--muted); min-width: 16px; font-size: 11px; }
.g-rcity { font-weight: 650; }
.g-rcoord { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.g-result button { width: 100%; margin-bottom: 6px; }

/* Reveal pin on the map */
.g-pin { width: 0 !important; height: 0 !important; pointer-events: none; }
.g-pin-dot {
  position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: #2e7d32; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.g-pin.no .g-pin-dot { background: #b03030; }
.g-pin-name {
  position: absolute; left: 14px; top: -12px; white-space: nowrap;
  font-size: calc(14px * var(--scale)); font-weight: 750; color: #1e3a5f; line-height: 1.2;
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 6px #fff, 0 0 6px #fff;
}
.g-pin-name small { font-size: calc(11px * var(--scale)); font-weight: 600; color: #7a5310; }

/* ---------------- Account ---------------- */
.acct-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.acct-pic { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.acct-initial { background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.acct-who { flex: 1; min-width: 0; }
.acct-name { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-role { font-size: 11.5px; color: var(--muted); }
.acct-out { margin: 0; font-size: 12px; padding: 5px 9px; }
.acct-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.acct-actions button { width: 100%; margin: 0; }
.acct-list-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 12px 0 4px; }
.acct-list { display: flex; flex-direction: column; gap: 4px; }
.acct-signed-out { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dev-login { display: flex; gap: 5px; margin-top: 8px; }
.dev-login input { flex: 1; font-size: 12px; padding: 5px 7px; }

.map-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title btns" "meta btns";
  gap: 0 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.map-row:hover { background: #f4f8fc; }
.map-open { grid-area: title; text-align: left; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 650; color: var(--accent); }
.map-meta { grid-area: meta; font-size: 11px; color: var(--muted); }
.map-btns { grid-area: btns; display: flex; align-items: center; gap: 3px; }
.mini {
  border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer;
  font-size: 12px; padding: 3px 7px; color: var(--muted); line-height: 1.2;
}
.mini:hover { background: #eef3f9; color: var(--accent); }

/* ---------------- Classroom ---------------- */
.cls-new { display: flex; gap: 5px; margin-bottom: 10px; }
.cls-new input { flex: 1; }
.cls-new button { margin: 0; white-space: nowrap; }
.cls-card { border: 1px solid var(--line); border-radius: 9px; background: #fff; margin-bottom: 6px; overflow: hidden; }
.cls-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.cls-title { flex: 1; text-align: left; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 650; color: var(--accent); }
.cls-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cls-detail { padding: 0 10px 10px; border-top: 1px dashed var(--line); }
.cls-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); margin: 9px 0 4px; }
.roster { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef3f9; border-radius: 999px;
  padding: 3px 5px 3px 9px; font-size: 11.5px; }
.chip-x { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 11px; padding: 0 2px; }
.chip-x:hover { color: #b03030; }
.cls-add-students { display: flex; gap: 5px; margin-top: 6px; }
.cls-add-students input { flex: 1; font-size: 12px; padding: 6px 8px; }
.cls-add-students button { margin: 0; }
.asg-form { display: flex; flex-direction: column; gap: 5px; }
.asg-form input { font-size: 12.5px; }
.asg-row { display: flex; gap: 4px; }
.asg-row select { flex: 1; font-size: 12px; padding: 5px 4px; }
.asg-form button { margin: 2px 0 0; width: 100%; }
.asg-row-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name btns" "meta btns";
  gap: 0 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin-top: 5px; background: #fff;
}
.asg-name { grid-area: name; font-size: 13px; font-weight: 650; }
.asg-meta { grid-area: meta; font-size: 11px; color: var(--muted); }
.asg-btns { grid-area: btns; display: flex; align-items: center; gap: 3px; }
.asg-closed { font-size: 10px; background: #eee; color: var(--muted); border-radius: 4px; padding: 1px 5px; }
.mini-take { margin: 0; padding: 4px 10px; font-size: 12px; }
.cls-del { width: 100%; margin-top: 10px; color: #b03030; }

/* Quiz banner inside the game panel */
.g-quizbar {
  background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; font-weight: 650; margin-bottom: 8px;
  display: flex; justify-content: space-between; gap: 8px;
}
.g-quizbar span { font-weight: 400; opacity: 0.8; }
.g-nav { display: flex; gap: 6px; margin-top: 8px; }
.g-nav button { flex: 1; margin: 0; }
.g-choice.picked { background: #e7effa; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.g-teachernote {
  background: #fffdf5; border-left: 3px solid var(--gold); padding: 7px 10px;
  font-size: 12.5px; font-style: italic; margin: 8px 0; text-align: left; border-radius: 0 6px 6px 0;
}

/* ---------------- Gradebook modal ---------------- */
#gradebook {
  position: fixed; inset: 0; background: rgba(20,28,38,0.55); z-index: 4000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
#gradebook.hidden { display: none; }
.gb-inner {
  background: #fff; border-radius: 12px; padding: 18px 20px; width: min(920px, 100%);
  max-height: 86vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.gb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.gb-title { font-family: Iowan Old Style, Palatino, Georgia, serif; font-size: 19px; font-weight: 700; color: var(--accent); }
.gb-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.gb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gb-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); border-bottom: 2px solid var(--line); padding: 6px 8px;
}
.gb-table td { padding: 7px 8px; border-bottom: 1px solid #f0ece0; vertical-align: middle; }
.gb-name { font-weight: 650; }
.gb-email { font-size: 11px; color: var(--muted); }
.gb-score { white-space: nowrap; font-size: 14px; }
.gb-adj { font-size: 10px; color: var(--gold); }
.gb-none { color: var(--muted); }
.gb-ovr { width: 62px; padding: 5px 7px; font-size: 13px; text-align: right; }
.gb-com { width: 100%; padding: 5px 7px; font-size: 12.5px; }
.gb-ans { display: flex; flex-direction: column; gap: 3px; padding: 4px 0 8px; }
.gb-ans-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  font-size: 12px; padding: 4px 8px; border-radius: 5px; border-left: 3px solid transparent;
}
.gb-ans-row.ok { background: #f2f9f3; border-left-color: #2e7d32; }
.gb-ans-row.no { background: #fdf2f2; border-left-color: #b03030; }
.gb-ans-q { font-weight: 650; }
.gb-ans-c { color: var(--muted); }

/* Toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 4px 16px rgba(0,0,0,0.35); z-index: 3000;
  opacity: 0; transition: all 0.3s ease; max-width: 80vw; text-align: center; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Presentation mode: bigger everything for the projector */
body.present { --scale: 1.45; }
body.present .leaflet-container { font-size: 15px; }
body.present .atlas-legend { max-width: 340px; }

/* Small screens */
@media (max-width: 720px) {
  #sidebar { position: absolute; height: 100%; box-shadow: 4px 0 18px rgba(0,0,0,0.25); }
}
