/*! Campus Map Kit v1.0.0 — all classes are prefixed with .cmk to avoid clashes.
   Themed from the site's design tokens (assets/css/toshloq.css, --tt-*), so the
   light and the dark theme follow without a second set of rules. */
.cmk {
    --cmk-primary: var(--tt-primary);
    --cmk-on-primary: var(--tt-on-primary);
    --cmk-accent: var(--tt-primary-deep);
    --cmk-text: var(--tt-ink);
    --cmk-muted: var(--tt-muted);
    --cmk-soft: var(--tt-tint);
    --cmk-line: var(--tt-tint-2);
    --cmk-panel-bg: var(--tt-card);
    --cmk-radius: clamp(28px, 4vw, 48px);
    --cmk-shadow: var(--tt-shadow-pop);
    --cmk-font: inherit;
    --cmk-panel-width: 340px;

    position: relative;
    /* Own stacking context: the map's layers (MapLibre's "hold Ctrl to zoom"
       screen uses z-index 99999) stay inside the map and never cover the
       sticky site header. */
    isolation: isolate;
    height: 620px;
    min-height: 420px;
    overflow: hidden;
    font-family: var(--cmk-font);
    color: var(--cmk-text);
    background: var(--cmk-line);
    border-radius: var(--cmk-radius);
    box-sizing: border-box;
}
.cmk *, .cmk *::before, .cmk *::after { box-sizing: border-box; }
.cmk .cmk-canvas, .cmk .cmk-canvas.maplibregl-map { position: absolute; inset: 0; font-family: var(--cmk-font); }
.cmk:fullscreen { border-radius: 0; }

/* MapLibre's own controls (zoom, compass, fullscreen): rounded like the rest. */
.cmk .maplibregl-ctrl-top-left { top: 6px; left: 6px; }
.cmk .maplibregl-ctrl-group { overflow: hidden; border-radius: 18px; }
.cmk .maplibregl-ctrl-group button { width: 34px; height: 34px; }
.cmk .maplibregl-ctrl-attrib { border-radius: 14px; }

.cmk-toolbar { position: absolute; top: 16px; left: 64px; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.cmk-group { display: flex; gap: 2px; padding: 4px; background: var(--cmk-panel-bg); border-radius: 999px; box-shadow: 0 10px 24px -16px rgba(33, 31, 77, 0.6); }
.cmk-group button, .cmk-reset {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 34px; padding: 0 12px; margin: 0;
    font: 800 13.5px/1 var(--cmk-font); color: var(--cmk-accent);
    background: transparent; border: 0; border-radius: 999px; cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.cmk-group button:hover { background: var(--cmk-soft); }
.cmk-group button.is-active { color: var(--cmk-on-primary); background: var(--cmk-primary); }
.cmk-reset { width: 42px; height: 42px; min-width: 0; padding: 0; background: var(--cmk-panel-bg); box-shadow: 0 10px 24px -16px rgba(33, 31, 77, 0.6); }
.cmk-reset:hover { color: var(--cmk-primary); }
.cmk-group button:focus-visible, .cmk-reset:focus-visible, .cmk-list button:focus-visible, .cmk-close:focus-visible { outline: 3px solid var(--cmk-primary); outline-offset: 2px; }

.cmk-panel {
    position: absolute; top: 14px; right: 14px; bottom: 14px; z-index: 2;
    width: var(--cmk-panel-width); overflow-y: auto; padding: 24px;
    background: var(--cmk-panel-bg); border-radius: 30px; box-shadow: var(--cmk-shadow);
}
.cmk-empty-icon { display: grid; place-items: center; width: 60px; height: 60px; color: var(--cmk-accent); background: var(--cmk-line); border-radius: 50%; }
.cmk-empty > p { margin: 14px 0 18px; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--cmk-muted); }
.cmk-list { margin: 0; padding: 0; list-style: none; }
.cmk-list button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    margin: 0 0 8px; padding: 11px 16px;
    font: 800 14.5px/1.3 var(--cmk-font); color: var(--cmk-text); text-align: left;
    background: var(--cmk-soft); border: 2px solid transparent; border-radius: 20px; cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.cmk-list button:hover, .cmk-list button.is-active { border-color: var(--cmk-primary); }
.cmk-list button.is-active { background: var(--cmk-line); }
.cmk-swatch { flex: 0 0 14px; height: 14px; border-radius: 50%; }

.cmk-body { position: relative; }
.cmk-body h3 { margin: 14px 0 6px; padding-right: 44px; font-size: 22px; font-weight: 900; line-height: 1.2; letter-spacing: -0.02em; }
.cmk-body h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 800; letter-spacing: 0; color: var(--cmk-muted); }
.cmk-body p, .cmk-body li { margin: 0 0 8px; font-size: 14.5px; line-height: 1.5; }
.cmk-body ul { margin: 0; padding-left: 20px; list-style: disc; }
.cmk-body li::marker { color: var(--cmk-primary); }
.cmk-body a { color: var(--cmk-primary); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.cmk-subtitle { font-weight: 800; color: var(--cmk-accent); }
.cmk-meta { color: var(--cmk-muted); }
.cmk-meta strong { color: var(--cmk-text); }
.cmk-dept-floor { display: inline-block; margin-left: 4px; padding: 1px 9px; font-size: 12.5px; font-weight: 800; color: var(--cmk-muted); background: var(--cmk-soft); border-radius: 999px; }
.cmk-close {
    position: absolute; top: -6px; right: -6px;
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
    color: var(--cmk-accent); background: var(--cmk-soft); border: 0; border-radius: 50%; cursor: pointer;
    transition: background-color 0.2s;
}
.cmk-close:hover { background: var(--cmk-line); }
.cmk-badge { display: inline-block; padding: 5px 14px; font-size: 13.5px; font-weight: 800; line-height: 1.3; border-radius: 999px; }
.cmk-badge.is-verified { color: var(--tt-mint-ink); background: var(--tt-mint); }
.cmk-badge.is-unverified { color: var(--tt-sun-ink); background: var(--tt-sun); }
.cmk-message { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; padding: 24px; font-weight: 700; color: var(--cmk-muted); text-align: center; }

@media (max-width: 767px) {
    .cmk { height: auto !important; min-height: 0; }
    .cmk .cmk-canvas, .cmk .cmk-canvas.maplibregl-map { position: relative; inset: auto; height: 420px; }
    .cmk-panel { position: static; width: auto; padding: 20px 18px; border-radius: 0; box-shadow: none; }
    .cmk-toolbar { top: 14px; left: 58px; right: 12px; }
}
