/* ============================================================
   NextClass · campus map. Full-screen state under "Go".
   Paper Model canvas, board HUD tiles, one non-modal sheet with
   three snap points (peek / half / full). Loaded with styles.css.
   ============================================================ */
.view-map { position: fixed; inset: 0; z-index: var(--z-map); background: #DCD4C1; --sheet-h: 118px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); overflow: hidden; }
.view-map .campus-map { position: absolute; inset: 0; width: 100%; height: 100%; }   /* beats MapLibre's own .maplibregl-map { position: relative } */
.campus-map .maplibregl-canvas { outline: none; }
.map-hud { position: absolute; inset: 0; pointer-events: none; }
.map-hud > * { pointer-events: auto; }
.tile {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; height: 48px; padding: 0 12px; border-radius: 8px; border: 0;
  background: var(--board); color: var(--board-text); cursor: pointer; box-shadow: 0 2px 6px rgba(14, 29, 24, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: var(--mono); font-stretch: 87.5%; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; touch-action: manipulation;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.tile:active { transform: scale(.94); }
.tile svg { width: 20px; height: 20px; }
.tile-mono { font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.tile-amber { background: var(--signal); color: var(--signal-ink); }
.tile.is-on { color: var(--signal); }
.tile-ghost { background: transparent; box-shadow: none; border: 1.5px solid rgba(242, 239, 230, .35); height: 40px; min-width: 0; padding: 0 12px; }
.tile-ghost.dark { border-color: var(--line-2); color: var(--ink); }
#map-back { position: absolute; top: max(12px, var(--sat)); left: max(12px, env(safe-area-inset-left, 0px)); }
#map-today { position: absolute; top: max(12px, var(--sat)); right: max(12px, env(safe-area-inset-right, 0px)); }
.view-map[data-mode="today"] #map-today { background: var(--signal); color: var(--signal-ink); }
.map-ctrls { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(var(--sheet-h) + 12px); display: grid; gap: 8px; transition: bottom 360ms var(--ease-drawer); }
.map-notice { position: absolute; top: calc(max(12px, var(--sat)) + 60px); left: 50%; transform: translateX(-50%); max-width: min(92vw, 420px); background: var(--board); color: var(--board-text); padding: 10px 14px; border-radius: 8px; font-family: var(--mono); font-stretch: 87.5%; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; text-align: center; box-shadow: var(--shadow-2); animation: rise 220ms var(--ease-out) both; }

/* attribution: restyled, never hidden */
.view-map .maplibregl-ctrl-attrib { background: rgba(241, 236, 225, .9); color: var(--ink); font: 500 10.5px/1.4 var(--mono); font-stretch: 87.5%; border-radius: 4px 0 0 0; }
.view-map .maplibregl-ctrl-attrib a { color: var(--ink); }
.view-map .maplibregl-ctrl-bottom-left { bottom: var(--sheet-h); transition: bottom 360ms var(--ease-drawer); }
.view-map .maplibregl-ctrl-bottom-right { display: none; }
.view-map .maplibregl-ctrl-attrib.maplibregl-compact { margin: 0 0 8px 8px; }

/* markers */
.mk-dest { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.mk-dest b { background: var(--board); color: var(--signal); font-family: var(--mono); font-stretch: 87.5%; font-weight: 700; font-size: 15px; letter-spacing: .06em; padding: 5px 9px; border-radius: 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 6px rgba(14, 29, 24, .35); white-space: nowrap; }
.mk-dest i { display: block; width: 1.5px; height: 14px; background: var(--board); position: relative; }
.mk-dest i::after { content: ""; position: absolute; left: -2.25px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--board); }
.mk-user { width: 56px; height: 56px; position: relative; pointer-events: none; }
.mk-user .dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--now); border: 3px solid var(--snow); box-shadow: 0 0 0 1px rgba(14, 29, 24, .35), 0 2px 6px rgba(14, 29, 24, .35); }
.mk-user.is-stale .dot { animation: stale 1.6s ease-in-out infinite; }
@keyframes stale { 0%, 100% { box-shadow: 0 0 0 1px rgba(14, 29, 24, .35), 0 0 0 0 rgba(240, 96, 63, .6); } 50% { box-shadow: 0 0 0 1px rgba(14, 29, 24, .35), 0 0 0 12px rgba(240, 96, 63, 0); } }
.mk-user .cone { position: absolute; inset: 0; opacity: 0; transform-origin: 50% 50%; background: conic-gradient(from -22deg at 50% 50%, rgba(240, 96, 63, .35) 0 44deg, transparent 44deg); -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px); mask: radial-gradient(circle, transparent 9px, #000 10px); transition: transform 200ms var(--ease-out), opacity 200ms ease; }
.mk-origin { width: 12px; height: 12px; border-radius: 50%; background: var(--board); border: 2px solid var(--snow); box-shadow: 0 1px 3px rgba(14, 29, 24, .4); }
.mk-stop { display: flex; align-items: center; gap: 6px; background: var(--board); color: var(--board-text); padding: 4px 8px 4px 4px; border-radius: 4px; box-shadow: 0 2px 6px rgba(14, 29, 24, .35); cursor: pointer; font-family: var(--mono); font-stretch: 87.5%; font-size: 12px; letter-spacing: .06em; }
.mk-stop b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; background: var(--signal); color: var(--signal-ink); font-size: 11px; }

/* the sheet */
.msheet { position: absolute; left: 0; right: 0; bottom: 0; height: var(--sheet-h); background: var(--snow); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(14, 29, 24, .25); display: flex; flex-direction: column; transition: height 360ms var(--ease-drawer); z-index: 2; }
.msheet.is-dragging, .msheet.no-anim { transition: none; }
.msheet-handle { flex: none; height: 20px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.msheet-handle::before { content: ""; width: 42px; height: 5px; border-radius: 999px; background: var(--paper-3); }
.msheet-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 16px calc(16px + var(--sab)); -webkit-overflow-scrolling: touch; }
.ms-head { touch-action: none; }
.ms-head.paper { padding: 2px 0 12px; }
.ms-head.board { background: var(--board); color: var(--board-text); margin: -20px -16px 12px; padding: 22px 16px 16px; border-radius: 16px 16px 0 0; }
.ms-eyebrow { display: block; font-family: var(--mono); font-stretch: 87.5%; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ms-head.board .ms-eyebrow { color: var(--signal); }
.ms-eyebrow.ok { color: var(--ok) !important; }
.ms-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ms-dest { min-width: 0; }
.ms-dest b.display { display: block; font-size: 30px; line-height: .95; }
.ms-sub { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.ms-head.board .ms-sub { color: var(--board-muted); }
.ms-stat { text-align: right; flex: none; }
.ms-stat .flap b, .ms-head .flap b { background: var(--board); color: var(--board-text); font-size: 15px; height: 1.7em; width: 1.35ch; }
.ms-head.board .flap b { background: var(--board-3); }
.ms-big { display: block; font-size: 30px; }
.ms-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.ms-cta .btn-lg { min-height: 52px; }
.ms-from { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.ms-hint { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.ms-ctx { font-family: var(--mono); font-stretch: 87.5%; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin: 8px 0 0; color: var(--muted); }
.ms-ctx.now { color: var(--now); } .ms-ctx.amber { color: #8A6200; } .ms-ctx.ok { color: #2E6B4C; }
.ms-head.board .ms-ctx.amber { color: var(--signal); } .ms-head.board .ms-ctx.ok { color: var(--ok); }
.ms-chooser { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--snow); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip:active { transform: scale(.96); }
.ms-legs { margin-top: 12px; font-size: 14px; }
.ms-legs summary { cursor: pointer; font-family: var(--mono); font-stretch: 87.5%; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ms-legs ol { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ms-legs li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; }
.ms-legs .mono { font-size: 12px; color: var(--ink-2); }
.on-board { border-color: rgba(242, 239, 230, .35); color: var(--board-text); }
.on-board:hover { color: var(--board-text); background: rgba(242, 239, 230, .08); }
.ms-search { display: flex; align-items: center; gap: 10px; }
.ms-search .ico { font-size: 18px; color: var(--muted); flex: none; }
.ms-search input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--snow); font: inherit; font-size: 16px; appearance: none; -webkit-appearance: none; }
.ms-search input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px rgba(240, 179, 60, .22); }
.ms-section { font-family: var(--mono); font-stretch: 87.5%; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.ms-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ms-list li { border-bottom: 1px solid var(--line); }
.ms-list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 2px; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; color: var(--ink); min-height: 48px; }
.ms-list button:active { background: var(--paper-2); }
.ms-li-main { display: grid; min-width: 0; }
.ms-li-main b { font-stretch: 80%; font-size: 17px; text-transform: uppercase; }
.ms-li-main span { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-li-min { flex: none; font-size: 12px; color: var(--ink-2); }
.ms-list.compact button { min-height: 42px; padding: 7px 2px; }
.ms-list.compact .ms-li-main b { font-size: 15px; }
.ms-empty { color: var(--muted); font-size: 14.5px; padding: 10px 0; }
.ms-credit { font-size: 11.5px; color: var(--muted); margin: 20px 0 0; }
.ms-today { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ms-stop-row { display: grid; grid-template-columns: 24px auto 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ms-n { display: grid; place-items: center; width: 22px; height: 22px; background: var(--board); color: var(--signal); font-family: var(--mono); font-size: 11px; border-radius: 3px; }
.ms-stop-row .mono { font-size: 12px; }
.ms-stop-name { display: grid; min-width: 0; }
.ms-stop-name b { font-stretch: 80%; font-size: 16px; text-transform: uppercase; }
.ms-stop-name span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-leg { margin-left: 34px; display: grid; gap: 8px; }
.ms-leg > button:first-child { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "time walk" "status status"; gap: 4px 12px; align-items: baseline; width: 100%; border: 0; background: var(--paper-2); border-left: 4px solid var(--line-2); border-radius: 6px; padding: 8px 10px; text-align: left; font: inherit; cursor: pointer; }
.ms-leg .mono { grid-area: time; font-size: 11.5px; color: var(--ink-2); }
.ms-leg-walk { grid-area: walk; font-size: 13px; color: var(--ink-2); }
.ms-leg-status { grid-area: status; font-family: var(--mono); font-stretch: 87.5%; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.ms-leg.is-easy > button:first-child { border-left-color: #6E9E7C; } .ms-leg.is-easy .ms-leg-status { color: #2E6B4C; }
.ms-leg.is-leave > button:first-child { border-left-color: var(--amber-edge); } .ms-leg.is-leave .ms-leg-status { color: #8A6200; }
.ms-leg.is-tight > button:first-child { border-left-color: var(--now); } .ms-leg.is-tight .ms-leg-status { color: var(--now); }
.ms-leg.is-free .ms-leg-status, .ms-leg.is-same .ms-leg-status { color: var(--muted); }
.ms-leg.is-selected > button:first-child { background: var(--snow); box-shadow: 0 0 0 1.5px var(--ink); }
.ms-leg.is-current > button:first-child { background: var(--board); color: var(--board-text); border-left-color: var(--signal); }
.ms-leg.is-current .mono, .ms-leg.is-current .ms-leg-walk { color: var(--board-muted); }

/* location pre-prompt: the only modal on the map */
.geo-modal { position: absolute; inset: 0; z-index: 5; background: rgba(14, 29, 24, .55); display: grid; place-items: end center; padding: 16px; animation: fadeOnly 180ms ease both; }
.geo-box { width: min(100%, 440px); background: var(--board); color: var(--board-text); border-radius: 14px; padding: 20px 20px calc(20px + var(--sab)); box-shadow: var(--shadow-2); animation: rise 260ms var(--ease-out) both; }
.geo-box .eyebrow { color: var(--signal); margin-bottom: 8px; }
.geo-box h3 { font-size: 30px; margin-bottom: 8px; }
.geo-box p { color: var(--board-muted); font-size: 15px; margin: 0 0 14px; }
.geo-actions { display: grid; gap: 8px; }
.geo-actions .btn-ghost { border-color: rgba(242, 239, 230, .35); color: var(--board-text); }

/* no WebGL / no assets */
.map-fallback { position: absolute; inset: 0; z-index: 4; background: var(--paper); display: grid; align-content: center; gap: 12px; padding: 24px var(--gutter-r) 24px var(--gutter-l); text-align: center; }
.mf-title { font-size: 34px; }
.mf-text { color: var(--ink-2); max-width: 46ch; margin: 0 auto 8px; }
.map-fallback .btn { justify-self: center; min-width: 260px; }

/* schedule toolbar: the map entry point + the details sheet's extra links */
.tool-primary { background: var(--board); color: var(--board-text); border-color: var(--board); }
.tool-primary svg { color: var(--signal); }
.tool-primary:hover { background: var(--board-3); border-color: var(--board-3); }
.sheet-more { display: grid; gap: 10px; }
.sheet-more summary { cursor: pointer; font-family: var(--mono); font-stretch: 87.5%; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }

@media (min-width: 720px) {
  .msheet { left: 16px; right: auto; width: 420px; border-radius: 16px 16px 0 0; }
  .map-ctrls { right: 16px; bottom: 16px; }
  .view-map .maplibregl-ctrl-bottom-left { bottom: 0; left: 452px; }
}
@media (prefers-reduced-motion: reduce) {
  .msheet, .map-ctrls, .view-map .maplibregl-ctrl-bottom-right { transition: none; }
  .mk-user.is-stale .dot { animation: none; }
}
