* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0e1116; color: #e7eaf0; }

header {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 1rem; background: #161b22; border-bottom: 1px solid #2a313c;
}
.brand { display: flex; align-items: baseline; gap: 0.6rem; }
.logo { font-weight: 800; letter-spacing: 0.08em; color: #f4a259; font-size: 1.4rem; }
.tagline { color: #9ca3af; font-size: 0.85rem; }
.status { margin-left: auto; color: #9ca3af; font-size: 0.85rem; }
button {
  background: #f4a259; color: #161b22; border: none; padding: 0.4rem 0.9rem;
  border-radius: 6px; cursor: pointer; font-weight: 600;
}
button:hover { background: #ffb874; }

main { display: grid; grid-template-columns: 1fr 360px; height: calc(100vh - 96px); }
#map { height: 100%; }
#sidebar {
  overflow-y: auto; background: #161b22; border-left: 1px solid #2a313c;
  padding: 1rem; font-size: 0.9rem;
}
#sidebar h2 {
  font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #9ca3af; margin: 1rem 0 0.4rem; border-bottom: 1px solid #2a313c;
  padding-bottom: 0.3rem;
}
.list .item {
  background: #1f242c; border: 1px solid #2a313c; border-radius: 6px;
  padding: 0.5rem 0.6rem; margin-bottom: 0.4rem;
}
.list .item .title { font-weight: 600; }
.list .item .meta { color: #9ca3af; font-size: 0.78rem; margin-top: 0.2rem; }
.list .empty { color: #6b7280; font-style: italic; }

.hint { color: #9ca3af; font-size: 0.83rem; }
.shelter-card {
  background: #1f242c; border: 1px solid #2a313c; border-radius: 6px;
  padding: 0.55rem 0.7rem; margin-top: 0.4rem;
}
.shelter-card .title { font-weight: 600; }
.shelter-card .meta { color: #9ca3af; font-size: 0.78rem; }
.rec { background: #0a3d2e; border-color: #19744f; }

footer {
  padding: 0.5rem 1rem; background: #161b22; border-top: 1px solid #2a313c;
  color: #9ca3af; font-size: 0.78rem;
}

.risk-marker {
  border-radius: 50%; opacity: 0.85; border: 2px solid #fff;
}
.risk-watch    { background: #facc15; }
.risk-elevated { background: #f97316; }
.risk-high     { background: #ef4444; }
.risk-extreme  { background: #b91c1c; box-shadow: 0 0 0 4px rgba(185,28,28,0.35); }

.legend {
  position: absolute; bottom: 1rem; left: 1rem; z-index: 500;
  background: rgba(22,27,34,0.92); border: 1px solid #2a313c;
  padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.78rem;
}
.legend .row { display: flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0; }
.legend .swatch { width: 12px; height: 12px; border-radius: 50%; }




  100% { transform: translateX(-100%); }
}
  100% { transform: translateX(-100%); }
}
  100% { transform: translateX(-100%); }
}


/* J.O.N.A.S. Agent Operations live feed */
.ops-feed {
  margin-top: 0.3rem;
  background: #0e1116;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  min-height: 340px; max-height: 340px; flex-shrink: 0;
  overflow-y: scroll;
  font-size: 0.83rem;
  scrollbar-width: thin;
  scrollbar-color: #2a313c #0e1116;
}
.ops-feed::-webkit-scrollbar { width: 6px; }
.ops-feed::-webkit-scrollbar-thumb { background: #2a313c; border-radius: 3px; }
.ops-feed .ops-empty {
  color: #6b7280; font-style: italic; text-align: center;
  padding: 0.6rem 0;
}
.ops-row {
  display: flex; gap: 0.45rem;
  padding: 0.32rem 0;
  border-bottom: 1px dashed #1f242c;
}
.ops-row:last-child { border-bottom: none; }
.ops-time {
  color: #6b7280; font-variant-numeric: tabular-nums;
  font-size: 0.74rem; white-space: nowrap; padding-top: 0.1rem;
}
.ops-dot {
  flex: 0 0 8px; width: 8px; height: 8px; margin-top: 0.45rem;
  border-radius: 50%; background: #60a5fa;
}
.ops-row.success .ops-dot { background: #22c55e; }
.ops-row.warn    .ops-dot { background: #f97316; }
.ops-row.error   .ops-dot { background: #ef4444; }
.ops-msg {
  flex: 1 1 auto; min-width: 0;
  color: #e7eaf0; word-wrap: break-word; line-height: 1.35;
}
.ops-action {
  display: inline-block; margin-right: 0.35rem;
  font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: #9ca3af; background: #1f242c; padding: 0 0.35rem;
  border-radius: 3px;
}
.ops-row.success .ops-action { color: #86efac; background: #052e16; }
.ops-row.warn    .ops-action { color: #fed7aa; background: #3a1f10; }
.ops-row.error   .ops-action { color: #fecaca; background: #3f1d1d; }


/* FIND SHELTER (desktop) — mirrors the mobile toggle / guidance */
.shelter-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  margin: 0.2rem 0 0.45rem;
}
.mode-btn {
  appearance: none; background: #1f242c; color: #e7eaf0;
  border: 1px solid #2a313c; border-radius: 8px;
  padding: 0.45rem 0.4rem; font-weight: 600; font-size: 0.88rem;
  cursor: pointer;
}
.mode-btn[aria-pressed="true"] {
  background: #f4a259; color: #161b22; border-color: #f4a259;
}
.mode-btn .mode-icon { margin-right: 0.3rem; font-size: 1.05rem; }
.mode-detected {
  font-size: 0.74rem; color: #6b7280; font-style: italic;
  margin-bottom: 0.45rem; text-align: center;
}
.guidance {
  background: #1f242c; border: 1px solid #2a313c; border-radius: 8px;
  padding: 0.6rem 0.75rem; margin-bottom: 0.55rem;
}
.guidance .guidance-title {
  font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem;
  color: #f4a259;
}
.guidance.warn .guidance-title { color: #ef4444; }
.guidance ul    { margin: 0.2rem 0 0; padding-left: 1.05rem; }
.guidance li    { margin: 0.22rem 0; font-size: 0.86rem; line-height: 1.4; }
.guidance li strong { color: #fde68a; }
.guidance .empty { color: #6b7280; font-style: italic; font-size: 0.86rem; }


/* Historic NWS warnings - scrolling feed mirroring Agent Operations */
.historic-feed {
  margin-top: 0.3rem;
  background: #0e1116;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  min-height: 260px; max-height: 260px; flex-shrink: 0;
  overflow-y: scroll;
  font-size: 0.83rem;
  scrollbar-width: thin;
  scrollbar-color: #2a313c #0e1116;
}
.historic-feed::-webkit-scrollbar { width: 6px; }
.historic-feed::-webkit-scrollbar-thumb { background: #2a313c; border-radius: 3px; }
.historic-feed .empty {
  color: #6b7280; font-style: italic; text-align: center;
  padding: 0.6rem 0;
}
.hist-row {
  display: flex; gap: 0.45rem;
  padding: 0.32rem 0;
  border-bottom: 1px dashed #1f242c;
}
.hist-row:last-child { border-bottom: none; }
.hist-time {
  color: #6b7280; font-variant-numeric: tabular-nums;
  font-size: 0.74rem; white-space: nowrap; padding-top: 0.1rem;
  flex: 0 0 auto;
}
.hist-msg {
  flex: 1 1 auto; min-width: 0;
  color: #e7eaf0; word-wrap: break-word; line-height: 1.35;
}
.hist-event {
  display: inline-block; margin-right: 0.35rem;
  font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fecaca; background: #3f1d1d; padding: 0 0.35rem;
  border-radius: 3px;
}
.hist-event.watch { color: #fde68a; background: #3a2f10; }
.hist-area { color: #9ca3af; font-size: 0.78rem; margin-top: 0.15rem; }


/* Community SAFE SHELTER AREA share controls */
.share-shelter-btn {
  display: block; width: 100%; margin: 0.6rem 0 0;
  background: #f4a259; color: #161b22;
  border: 1px solid #f4a259; border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.share-shelter-btn:hover  { background: #ffb874; border-color: #ffb874; }
.share-shelter-btn:active { background: #e08e3a; border-color: #e08e3a; }
.share-shelter-btn:disabled { opacity: 0.6; cursor: progress; }
.share-shelter-status {
  margin-top: 0.35rem; min-height: 1em;
  font-size: 0.78rem; color: #9ca3af; font-style: italic;
}
.share-shelter-status.success { color: #86efac; font-style: normal; }
.share-shelter-status.error   { color: #fecaca; font-style: normal; }

/* Pulsing green community-shelter marker on the map */
.community-shelter-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: #22c55e; border: 2px solid #052e16;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.55);
  animation: community-shelter-pulse 1.6s ease-in-out infinite;
}
@keyframes community-shelter-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15); }
}

/* Highlighted "SAFE SHELTER AREA" card */
.shelter-card.safe {
  background: #052e16; border-color: #22c55e;
}
.shelter-card.safe .title { color: #86efac; }


/* Collapsible Indoor/Outdoor guidance */
.guidance-details {
  border: 1px solid #2a313c; background: #1f242c;
  border-radius: 8px; margin: 0.2rem 0 0.55rem;
  overflow: hidden;
}
.guidance-details > summary {
  list-style: none; cursor: pointer;
  padding: 0.55rem 0.7rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem;
  font-weight: 700; font-size: 0.92rem; color: #f4a259;
  user-select: none;
}
.guidance-details > summary::-webkit-details-marker { display: none; }
.guidance-details > summary::after {
  content: "▾"; transition: transform 0.18s ease; color: #9ca3af;
}
.guidance-details[open] > summary::after { transform: rotate(180deg); }
.guidance-details.warn > summary { color: #ef4444; }
.guidance-details .guidance-summary-meta {
  font-weight: 500; color: #9ca3af; font-size: 0.78rem;
  margin-left: auto; margin-right: 0.4rem; font-style: italic;
}
.guidance-details > .guidance-body {
  padding: 0.6rem 0.75rem 0.7rem; border-top: 1px solid #2a313c;
}
.guidance-details > .guidance-body ul {
  margin: 0.2rem 0 0; padding-left: 1.05rem;
}
.guidance-details > .guidance-body li {
  margin: 0.22rem 0; font-size: 0.86rem; line-height: 1.4;
}
.guidance-details > .guidance-body li strong { color: #fde68a; }
