/* AIM standard popup + full intel panel (aim_std.js). Dark map look by default,
   light mode under body.light-mode, phone (under 700px) as a bottom sheet.
   Text 11px or larger; light-mode text meets 4.5:1 (muted 7:1). */

/* ── popup ── */
.std-popwrap .leaflet-popup-content-wrapper { background: #0f1a0f; color: #e8f0e8; border: 1px solid #2a3a2a; border-radius: 4px; }
.std-popwrap .leaflet-popup-tip { background: #0f1a0f; border: 1px solid #2a3a2a; }
.std-popwrap .leaflet-popup-content { margin: 10px 12px; }
.std-pop { font-family: 'Share Tech Mono', monospace; font-size: 12px; line-height: 1.45; color: #e8f0e8; }
.std-k { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 1.5px; color: #b0c4b0; }
.std-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.std-ttl { font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif; font-weight: 700; font-size: 16px; letter-spacing: .4px; color: #ffffff; margin-top: 3px; line-height: 1.2; overflow-wrap: anywhere; }
.std-sub { font-size: 12px; color: #b0c4b0; overflow-wrap: anywhere; }
.std-ttl, .std-sub, .std-facts, .std-tbl > div, .std-block, .std-note, .std-foot { text-transform: none; }
.std-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.std-badge { font-size: 11px; padding: 1px 6px; border: 1px solid; letter-spacing: .5px; line-height: 1.5; }
.std-g { color: #6dde72; border-color: #6dde72; } .std-a { color: #ffb300; border-color: #ffb300; } .std-r { color: #ff7466; border-color: #ff7466; }
.std-b, .std-bx { color: #86bde6; border-color: #86bde6; } .std-p { color: #c79bff; border-color: #c79bff; } .std-n { color: #b0c4b0; border-color: #4a5a4a; }
.std-ring { margin-top: 6px; padding: 4px 6px; border: 1px dashed #ffb300; color: #ffb300; font-size: 11px; line-height: 1.4; }
.std-live { margin-top: 5px; font-size: 11px; color: #6dde72; letter-spacing: .5px; }
.std-facts { margin-top: 7px; font-size: 12px; }
.std-facts span { color: #b0c4b0; }
.std-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.std-btn { font-family: 'Share Tech Mono', monospace; font-size: 11px; letter-spacing: .5px; background: rgba(255,255,255,.06); border: 1px solid #2a3a2a; color: #e8f0e8; padding: 7px 2px; min-height: 30px; cursor: pointer; }
.std-btn:hover { border-color: #6dde72; }
.std-btn:focus-visible, .std-full:focus-visible, .std-x:focus-visible { outline: 2px solid #ffb300; outline-offset: 1px; }
.std-full { display: block; width: 100%; margin-top: 5px; font-family: 'Share Tech Mono', monospace; font-weight: bold; font-size: 12px; letter-spacing: 1px; background: rgba(255,179,0,.12); border: 1px solid #ffb300; color: #ffb300; padding: 7px 0; cursor: pointer; }
.std-src { margin-top: 7px; padding-top: 5px; border-top: 1px solid #2a3a2a; font-size: 11px; color: #b0c4b0; }

/* ── full panel ── */
.std-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: #0a110a; border-left: 1px solid #2a3a2a; z-index: 1500;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.25,.46,.45,.94); overflow-y: auto; overflow-x: hidden; pointer-events: none;
  scrollbar-width: thin; scrollbar-color: #2a3a2a #0a110a; font-family: 'Share Tech Mono', monospace; color: #e8f0e8; }
.std-panel.panel-open { transform: translateX(0); pointer-events: auto; }
.std-grab { display: none; }
.std-ph { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #0b120b; border-bottom: 1px solid #2a3a2a; }
.std-ph .std-k { flex: 1; min-width: 0; }
.std-x { flex: none; }
.std-pb { padding: 10px 12px 18px; display: grid; gap: 9px; }
.std-hbox { border-left: 4px solid #6dde72; padding: 3px 0 3px 10px; }
.std-hbox .std-ttl { font-size: 19px; }
.std-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.std-tile { border: 1px solid #2a3a2a; padding: 5px 8px; min-width: 0; }
.std-tile b { display: block; font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif; font-weight: 500; font-size: 19px; color: #ffffff; overflow-wrap: anywhere; }
.std-tile span { font-size: 11px; color: #b0c4b0; letter-spacing: .5px; }
.std-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.std-acts .std-pr { border-color: #6dde72; color: #6dde72; }
.std-extra .std-btn { border-style: dashed; }
.std-gx { color: #6dde72; } .std-ax { color: #ffb300; } .std-rx { color: #ff7466; } .std-px { color: #c79bff; } .std-nx { color: #e8f0e8; }
.std-sec { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: 2px; font-weight: bold; color: #ffb300; border-bottom: 1px solid #2a3a2a; padding-bottom: 3px; margin-top: 4px; }
.std-sec i { font-style: normal; font-weight: normal; letter-spacing: 1px; color: #b0c4b0; }
.std-tbl { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 4px 10px; font-size: 12px; }
.std-tbl > span { color: #b0c4b0; font-size: 11px; letter-spacing: .5px; padding-top: 1px; }
.std-tbl > div { overflow-wrap: anywhere; color: #e8f0e8; }
.std-tbl a, .std-foot a { color: #86bde6; }
.std-note { font-size: 12px; color: #b0c4b0; line-height: 1.5; }
.std-foot { font-size: 11px; color: #b0c4b0; line-height: 1.5; }
/* note blocks carried over from a layer's earlier panel (tactical callouts, link lists) */
.std-block { font-family: Barlow, Arial, sans-serif; font-size: 12px; line-height: 1.55; color: #e8f0e8; background: rgba(255,255,255,.04); border-left: 3px solid #3a5a3a; padding: 6px 9px; overflow-wrap: anywhere; }
.std-block b, .std-block strong { color: #ffffff; }
.std-block a { color: #86bde6; }
.std-block + .std-block { margin-top: 5px; }
.std-tbl > div p, .std-block p { margin: 0 0 4px; }
body.light-mode .std-block { color: #1b1f18; background: #f4f6f1; border-left-color: #8a9480; }
body.light-mode .std-block b, body.light-mode .std-block strong { color: #1b1f18; }
body.light-mode .std-block a { color: #0d47a1; }

/* ── light mode ── */
body.light-mode .std-popwrap .leaflet-popup-content-wrapper, body.light-mode .std-popwrap .leaflet-popup-tip { background: #ffffff; color: #1b1f18; border-color: #8a9480; }
body.light-mode .std-pop, body.light-mode .std-panel { color: #1b1f18; }
body.light-mode .std-k, body.light-mode .std-sub, body.light-mode .std-facts span, body.light-mode .std-src, body.light-mode .std-tile span,
body.light-mode .std-tbl > span, body.light-mode .std-note, body.light-mode .std-foot, body.light-mode .std-sec i { color: #333b30; }
body.light-mode .std-ttl, body.light-mode .std-tile b { color: #1b1f18; }
body.light-mode .std-g, body.light-mode .std-gx, body.light-mode .std-live { color: #1b5e20; border-color: #1b5e20; }
body.light-mode .std-a, body.light-mode .std-ax { color: #6d4c00; border-color: #6d4c00; }
body.light-mode .std-r, body.light-mode .std-rx { color: #a3141a; border-color: #a3141a; }
body.light-mode .std-b, body.light-mode .std-bx { color: #0d47a1; border-color: #0d47a1; }
body.light-mode .std-p, body.light-mode .std-px { color: #4a148c; border-color: #4a148c; }
body.light-mode .std-n { color: #333b30; border-color: #8a9480; }
body.light-mode .std-ring { color: #6d4c00; border-color: #6d4c00; }
body.light-mode .std-btn { background: #f4f6f1; border-color: #8a9480; color: #1b1f18; }
body.light-mode .std-acts .std-pr { border-color: #1b5e20; color: #1b5e20; }
body.light-mode .std-full { background: #fff4dc; border-color: #6d4c00; color: #6d4c00; }
body.light-mode .std-src, body.light-mode .std-sec, body.light-mode .std-tile { border-color: #c9cfc0; }
body.light-mode .std-sec { color: #6d4c00; }
/* the older light-mode rule keeps map panels dark with light text ([id$="-intel-panel"]);
   the standard panel is light in light mode (approved mockup), so its id rule wins */
body.light-mode #std-intel-panel { background: #ffffff; border-color: #8a9480; scrollbar-color: #c9cfc0 #ffffff; color: #1b1f18;
  --wm-t-green: #1b5e20; --wm-t-grey: #333b30; --wm-t-amber: #6d4c00; --wm-t-red: #a3141a; --wm-t-blue: #0d47a1; --text: #1b1f18; --text-dim: #333b30; --white: #1b1f18; }
body.light-mode #std-intel-panel .std-tbl > div { color: #1b1f18; }
body.light-mode .std-x { background: #ffffff; color: #333b30; border-color: #8a9480; }
body.light-mode .std-ph { background: #eef1ea; border-color: #c9cfc0; }
body.light-mode .std-tbl a, body.light-mode .std-foot a { color: #0d47a1; }

/* ── phone: the full panel slides up from the bottom ── */
@media screen and (max-width: 699px) {
  .std-panel { top: 14%; left: 0; right: 0; width: auto; border-left: 0; border-top: 2px solid #2a3a2a; border-radius: 12px 12px 0 0; transform: translateY(100%); }
  .std-panel.panel-open { transform: translateY(0); }
  .std-grab { display: block; width: 44px; height: 4px; border-radius: 2px; background: #3a4a3a; margin: 6px auto 0; }
  .std-btn { min-height: 36px; }
  body.light-mode .std-panel { border-top-color: #8a9480; }
}
@media (prefers-reduced-motion: reduce) { .std-panel { transition: none; } }
.std-colh { color: #b0c4b0; font-size: 11px; letter-spacing: .5px; }
body.light-mode .std-colh { color: #333b30; }
/* a popup never wider than the screen, even where a layer asks Leaflet for a wide one */
.std-pop { max-width: calc(100vw - 72px); }
/* links in a carried-over block (external resources): one per line, never run together */
.std-block a { display: inline-block; margin: 0 12px 4px 0; }
