/* FGS county maps (static/js/fgs_maps.js). Colours come from the site tokens;
   the four risk colours are the FGS's own and never change with the theme. */

.fgsm-tip { position: fixed; z-index: 9999; pointer-events: none; display: none;
  background: var(--p-surface, #fff); color: var(--p-body, #334155); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 14px 32px -10px rgba(15,23,42,.35);
  padding: 10px 14px; min-width: 150px; max-width: min(280px, 78vw); max-height: 240px; overflow: hidden;
  font-family: 'Outfit', sans-serif; }
.fgsm-tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.fgsm-tip-head i { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.fgsm-tip-head span { font-size: 14px; font-weight: 600; color: var(--p-ink, #0f172a); }
.fgsm-tip-sub { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.fgsm-tip-row { font-size: 12px; color: var(--p-muted, #64748b); display: flex; gap: 10px; padding: 1px 0; }
.fgsm-tip-row b { margin-left: auto; color: var(--p-ink, #0f172a); font-weight: 600; text-align: right; }
.fgsm-tip-note { font-size: 12px; color: var(--p-muted, #64748b); font-style: italic; }

.fgsm-map { background: #eef3f6; border: 1px solid #e2e8f0; border-radius: 14px; }
[data-theme="dark"] .fgsm-map { background: #0b1526; border-color: #1e293b; }
.fgsm-map.leaflet-container { font-family: 'Outfit', sans-serif; cursor: grab; }

.fgsm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--p-muted, #64748b); }
.fgsm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fgsm-legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(15,23,42,.12); }

/* Source switch: the site's quiet segmented pill */
.fgsm-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9999px; background: var(--p-seg, rgba(15,23,42,.06)); }
.fgsm-seg button { border: 0; background: transparent; cursor: pointer; font: 500 13px/1.2 'Outfit', sans-serif;
  color: var(--p-body, #334155); padding: 6px 13px; border-radius: 9999px; }
.fgsm-seg button:hover { background: var(--p-seg-hover, rgba(15,23,42,.1)); }
.fgsm-seg button[aria-pressed="true"] { background: var(--p-seg-on, #fff); color: var(--p-seg-on-ink, var(--brand-800)); box-shadow: var(--p-shadow-seg-on, 0 1px 2px rgba(15,23,42,.14)); }
.fgsm-seg button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }

/* Five day row on the card */
.fgsm-days { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgsm-days > .fgsm-day:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) { .fgsm-days { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fgsm-days > .fgsm-day:last-child:nth-child(odd) { grid-column: auto; } }
@media (min-width: 1100px) { .fgsm-days { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fgsm-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; min-height: 40px; }
.fgsm-day-name { font: 600 15px/1.2 'Outfit', sans-serif; color: var(--p-ink, #0f172a); }
.fgsm-day-date { font-size: 12px; color: var(--p-muted, #64748b); }
.fgsm-day-chip { display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1 'Outfit', sans-serif; padding: 5px 9px; border-radius: 9999px; color: #111; white-space: nowrap; }
.fgsm-day .fgsm-map { height: clamp(220px, 34vw, 330px); }
@media (min-width: 1100px) { .fgsm-day .fgsm-map { height: 300px; } }
.fgsm-trend { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--p-muted, #64748b); }
.fgsm-trend .material-icons { font-size: 16px; color: var(--p-ink, #0f172a); }

/* Table thumbnail: a small map beside five day chips */
.fgsm-thumb { position: relative; display: flex; gap: 8px; width: 384px; height: 192px; }
.fgsm-thumb .fgsm-map { flex: 0 0 192px; height: 192px; }
.fgsm-thumb-days { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fgsm-thumb-days button { flex: 1 1 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; cursor: pointer;
  padding: 0 9px; border-radius: 10px; background: var(--p-seg, rgba(15,23,42,.06)); color: var(--p-ink, #0f172a);
  font: 500 12px/1.1 'Outfit', sans-serif; text-align: left; }
.fgsm-thumb-days button:hover { background: var(--p-seg-hover, rgba(15,23,42,.1)); }
.fgsm-thumb-days button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brand-600); background: var(--p-surface, #fff); }
.fgsm-thumb-days button i { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(15,23,42,.2); }
.fgsm-thumb-days button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.fgsm-thumb-open { position: absolute; top: 6px; left: 6px; z-index: 500; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: var(--p-surface, #fff); color: var(--p-ink, #0f172a); box-shadow: 0 1px 3px rgba(15,23,42,.25); }
.fgsm-thumb-open .material-icons { font-size: 18px; }
.fgsm-thumb-open:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.fgsm-thumb-fallback { width: 384px; height: 192px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; cursor: pointer; }
.fgsm-thumb-fallback img { width: 100%; height: 100%; object-fit: contain; }
[data-theme="dark"] .fgsm-thumb-fallback { border-color: #1e293b; }
