/* v1.8.0: interactive map viewer, Maps screen (practice map lab), Squad Lab form tab / dossier / calendar heat.
 * Theme tokens only; plain rgba tints (no colour mixing, older Android WebViews drop it). */

/* Anything with the hidden attribute stays hidden, even when a .btn / sheet class sets display (the recorder's
   Delete button used to show with nothing selected). */
[hidden] { display: none !important; }

/* ---------- map viewer ---------- */
.mapsvg { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none; }
.mapsvg.is-zoomed { touch-action: none; }
.mapsvg.is-drag { cursor: grabbing; }
.mapsvg:focus-visible { box-shadow: 0 0 0 3px var(--primary, #f6c445) inset; }
.mapsvg .mk { cursor: pointer; }
.mapzoom { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(10, 13, 19, .72); color: #fff; font-size: .72rem; font-weight: 800; }
.mapzoom:empty { display: none; }
.map-marker-sheet { display: grid; gap: 2px; padding: 10px 40px 10px 12px; line-height: 1.35; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.map-marker-sheet b { font-size: .9rem; overflow-wrap: anywhere; }
.map-marker-sheet small { color: rgba(255, 255, 255, .78); overflow-wrap: anywhere; }
.map-marker-sheet .btn { justify-self: start; min-height: 36px; }
.mv-close { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }

/* ---------- Maps screen ---------- */
.sm-maps-screen .maps-scope, .sm-maps-screen .maps-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.sm-maps-screen .maps-types { margin: 10px 0; }
.sm-maps-screen .chip-btn { min-height: 38px; }
.sm-maps-screen .chip-btn small { margin-left: 4px; opacity: .75; font-weight: 800; }
.maps-viewer-host { margin-top: 4px; }
.maps-help { margin: 6px 0 0; color: var(--on-surface-variant, #aeb8c7); }
.maps-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.maps-kpis div { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border-radius: 12px; background: var(--surface-container-high, rgba(255, 255, 255, .05)); min-width: 0; }
.maps-kpis b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.maps-kpis small { font-size: .66rem; color: var(--on-surface-variant, #aeb8c7); }
.maps-tips, .sm-si-tips ul, .sm-si-tips-l { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .85rem; line-height: 1.4; }
.sm-maps-screen h4 small { font-weight: 500; color: var(--on-surface-variant, #aeb8c7); font-size: .75rem; }
.maps-spot .tag.ok { background: rgba(62, 207, 142, .18); color: #3ecf8e; }
.maps-empty { margin-top: 12px; }
.maps-empty .btn { margin-top: 8px; }
@media (max-width: 380px) { .maps-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Squad Lab ---------- */
.sm-si-title { display: grid; gap: 2px; }
.sm-si-title h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.sm-si-title h3 .icon, .sm-si-title h3 svg { width: 22px; height: 22px; color: var(--si-gold); fill: currentColor; }
.sm-si-title small { color: var(--si-mute); font-size: .78rem; }
.sm-si-seg.sm-si-seg--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 400px) { .sm-si-seg--4 button .icon, .sm-si-seg--4 button svg { display: none; } .sm-si-seg--4 button { font-size: .8rem; } }
.sm-si-kpi em { font-style: normal; font-size: .64rem; color: var(--si-mute); }
.sm-si-kpi em.up { color: var(--si-ok); } .sm-si-kpi em.down { color: var(--si-bad); }
.sm-si-card > h4 span { color: var(--si-mute); letter-spacing: 0; text-transform: none; font-weight: 600; margin-left: 4px; }
.sm-si-trend { display: block; width: 100%; height: auto; }
.sm-si-trend .g { stroke: var(--si-line); stroke-width: 1; }
.sm-si-trend .k { fill: rgba(125, 167, 255, .35); }
.sm-si-trend .p { fill: none; stroke: var(--si-gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.sm-si-trend circle { fill: var(--si-card); stroke: var(--si-gold); stroke-width: 2; }
.sm-si-trend circle.t { fill: var(--si-gold); }
.sm-si-trend circle.w { fill: var(--si-ok); stroke: var(--si-ok); }
.sm-si-legend .ln { height: 3px; border-radius: 2px; background: var(--si-gold); }
.sm-si-legend .br { background: rgba(125, 167, 255, .55); }
.sm-si-tips ul { margin: 0; }
.sm-si-dist { display: grid; gap: 8px; }
.sm-si-dist div { display: grid; grid-template-columns: 74px minmax(0, 1fr) 76px; align-items: center; gap: 8px; }
.sm-si-dist small { color: var(--si-mute); font-size: .75rem; }
.sm-si-dist i { display: block; height: 10px; border-radius: 999px; background: var(--si-card2); overflow: hidden; }
.sm-si-dist u { display: block; height: 100%; border-radius: inherit; background: var(--si-gold); }
.sm-si-dist b { font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; } .sm-si-dist b span { color: var(--si-mute); font-weight: 500; }
.sm-si-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; text-align: center; }
.sm-si-wd div { display: grid; gap: 3px; justify-items: center; min-width: 0; }
.sm-si-wd i { display: block; width: 70%; border-radius: 6px 6px 2px 2px; background: var(--si-gold-b); }
.sm-si-wd div.off i { background: var(--si-card2); }
.sm-si-wd b { font-size: .78rem; font-variant-numeric: tabular-nums; } .sm-si-wd small { font-size: .62rem; color: var(--si-mute); white-space: nowrap; }
.sm-si-slots { display: grid; gap: 6px; }
.sm-si-slots span { display: grid; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--si-card2); }
.sm-si-slots small { color: var(--si-mute); font-size: .74rem; }
.sm-si-sparkrow { display: grid; gap: 6px; } .sm-si-sparkrow small { color: var(--si-mute); font-size: .72rem; }
.sm-si-spark { display: flex; align-items: flex-end; gap: 3px; height: 42px; }
.sm-si-spark i { flex: 1 1 0; min-width: 4px; border-radius: 3px 3px 1px 1px; background: var(--si-gold); }
/* calendar: brighter = more squad kills; #n = best placement that day */
.sm-si-cell.has.h1 { background: rgba(246, 196, 69, .14); } .sm-si-cell.has.h2 { background: rgba(246, 196, 69, .26); }
.sm-si-cell.has.h3 { background: rgba(246, 196, 69, .40); } .sm-si-cell.has.h4 { background: rgba(246, 196, 69, .58); }
.sm-si-legend span.has.h4 { background: rgba(246, 196, 69, .58); }
.sm-si-cell em { position: absolute; bottom: 2px; left: 0; right: 0; font-style: normal; font-size: .55rem; font-weight: 800; color: var(--si-text); opacity: .85; }
/* squad drop spots */
.sm-si-drops { display: grid; gap: 10px; }
.sm-si-spots { display: grid; gap: 6px; }
.sm-si-spot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; text-align: left; padding: 10px 12px; min-height: 48px; border-radius: 14px; border: 1px solid var(--si-line); background: var(--si-card2); }
.sm-si-spot b { grid-column: 1; } .sm-si-spot small { grid-column: 1; color: var(--si-mute); font-size: .75rem; }
.sm-si-spot em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--si-gold-a); color: var(--si-gold); }
