:root {
  --bg-top: #070914;
  --bg-mid: #161c29;
  --bg-warm: #3d1c19;
  --panel: rgba(255, 255, 255, 0.08);
  --text: #f6f7fb;
  --muted: rgba(246, 247, 251, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --red: #d53d2f;
  --amber: #d79a27;
  --teal: #1f8e90;
}

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: #070914;
}

* {
  box-sizing: border-box;
}

body {
  width: 100%;
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(213, 61, 47, 0.18), transparent 32%),
    linear-gradient(145deg, var(--bg-top), #161c29 50%, var(--bg-warm));
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  cursor: pointer;
}

.page {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: clip;
  padding: max(12px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom)) 12px;
}

.phone-shell {
  width: 100%;
  max-width: 430px;
  min-width: 0;
  border-radius: 44px;
  padding: 16px;
  background: linear-gradient(180deg, #1b1e27, #05070d);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  position: relative;
}

.phone-notch {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: 140px;
  height: 26px;
  border-radius: 20px;
  background: #000;
}

.screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border-radius: 34px;
  padding: calc(22px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom)) 16px;
  background: linear-gradient(160deg, rgba(7, 9, 20, 0.98), rgba(22, 28, 41, 0.94) 60%, rgba(61, 28, 25, 0.90));
  min-height: 860px;
  min-height: 100%;
}

.device-iphone .phone-shell {
  width: min(430px, 100%);
  border-radius: 44px;
}

.device-iphone .phone-notch {
  display: block;
}

.device-android .phone-shell {
  max-width: 440px;
  border-radius: 28px;
  padding: 12px;
  background: linear-gradient(180deg, #171b24, #05070d);
}

.device-android .phone-notch {
  display: none;
}

.device-android .screen {
  border-radius: 24px;
}

.device-browser .page {
  padding: 24px;
}

.device-browser .phone-shell {
  max-width: 1180px;
  border-radius: 36px;
  padding: 18px;
}

.device-browser .phone-notch {
  display: none;
}

.device-browser .screen {
  min-height: auto;
  padding: 24px 24px 32px;
}

.device-browser .hero-card {
  min-height: 240px;
  background:
    linear-gradient(90deg, rgba(7, 9, 20, 0.92), rgba(7, 9, 20, 0.62) 40%, rgba(7, 9, 20, 0.18)),
    url("assets/foc-background.gif") right center / cover no-repeat;
}

.device-browser .tabbar,
.device-browser .filters,
.device-browser .hero-metrics {
  gap: 12px;
}

.device-browser .feed-card,
.device-browser .panel,
.device-browser .priority-card,
.device-browser .hero-card {
  border-radius: 30px;
}

.device-browser .map-surface {
  height: 620px;
  min-height: 620px;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/foc-background.gif") center top / cover no-repeat;
  opacity: 0.78;
  filter: saturate(1.05) contrast(1.08) brightness(0.95);
  pointer-events: none;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(243, 109, 58, 0.12), transparent 16%),
    linear-gradient(180deg, rgba(4, 7, 16, 0.12), rgba(7, 9, 20, 0.48) 34%, rgba(7, 9, 20, 0.78) 62%, rgba(7, 9, 20, 0.90));
  pointer-events: none;
}

.screen > * {
  position: relative;
  z-index: 1;
}

.hero-card,
.bulldog-card,
.priority-card,
.feed-card,
.panel,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(16px);
}

.hero-card,
.priority-card,
.feed-card,
.panel {
  padding: 20px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background:
    linear-gradient(90deg, rgba(7, 9, 20, 0.90), rgba(7, 9, 20, 0.62) 46%, rgba(7, 9, 20, 0.28)),
    url("assets/foc-background.gif") right center / cover no-repeat;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 24%, rgba(245, 126, 73, 0.22), transparent 14%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.detail-label {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
}

.panel-copy {
  color: var(--muted);
  line-height: 1.5;
}

.filters,
.section-heading,
.feed-top,
.meta-row,
.tabbar,
.modal-grid,
.hero-metrics {
  display: flex;
  gap: 10px;
}

.hero-metrics,
.tabbar,
.filters {
  flex-wrap: wrap;
}

.tabbar,
.filters {
  margin: 16px 0;
}

.filter,
.severity,
.star-button,
.tab,
.primary-button,
.mode-toggle {
  border-radius: 999px;
  min-height: 44px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 700;
  border: 0;
}

.mode-toggle {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-toggle.active {
  background: var(--amber);
  color: black;
}

.bulldog-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-top: 16px;
}

.bulldog-card img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.bulldog-card p {
  color: var(--muted);
  margin-top: 6px;
}

#albert-quote {
  min-height: 40px;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.tab,
.filter,
.star-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

.tab.active,
.filter.active {
  background: white;
  color: black;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.briefing-mode-panel {
  margin: 16px 0 20px;
}

.screen.briefing-mode .briefing-mode-hidden {
  display: none !important;
}

.screen.briefing-mode .briefing-mode-panel.hidden {
  display: block !important;
}

.screen.briefing-mode .tab-panel.active {
  display: block;
}

.screen.briefing-mode .tab-panel.active:not([data-panel="firstalert"]) {
  display: none;
}

.screen.briefing-mode .hero-card {
  min-height: 200px;
}

.screen.briefing-mode .summary-panel {
  margin-bottom: 0;
}

.priority-card {
  background: linear-gradient(145deg, rgba(213, 61, 47, 0.88), rgba(61, 28, 25, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.priority-card.context-priority {
  background: linear-gradient(145deg, rgba(31, 142, 144, 0.30), rgba(22, 28, 41, 0.92));
}

.priority-card h2 {
  margin: 8px 0 6px;
  font-size: 30px;
}

.muted {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

.actionable {
  cursor: pointer;
}

.section {
  margin-top: 18px;
}

.section-heading,
.meta-row {
  justify-content: space-between;
  align-items: center;
}

.meta-row {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.trust-signal {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 5px 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trust-signal-confirmed {
  background: rgba(52, 211, 153, 0.24);
  border-color: rgba(52, 211, 153, 0.52);
  color: #d1fae5;
}

.trust-signal-multi-source {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(59, 130, 246, 0.52);
  color: #dbeafe;
}

.trust-signal-single-source {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.trust-signal-unverified {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(239, 68, 68, 0.52);
  color: #fecaca;
}

.feed-card + .feed-card,
.note-card + .note-card {
  margin-top: 12px;
}

.feed-top {
  justify-content: space-between;
  align-items: flex-start;
}

.feed-top p {
  color: var(--muted);
  margin-top: 6px;
}

.feed-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.star-button.active {
  color: #ffd25e;
}

.hero-metrics {
  margin-top: 16px;
}

.briefing-panel {
  margin: 16px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.briefing-panel pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.copy-button {
  justify-self: auto;
  align-self: flex-start;
}

.secondary-button {
  border-radius: 999px;
  min-height: 44px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.briefing-mode-panel .primary-button {
  justify-self: auto;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.metric {
  min-width: 110px;
  flex: 1;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-search-metric {
  min-width: 0;
  flex: 999 1 320px;
  padding: 0 14px;
}

.hero-update-metric {
  flex: 0 1 220px;
}

.hero-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.hero-search-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.62);
  transition: color 160ms ease;
}

.hero-search-input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
}

.hero-search-input::placeholder {
  color: rgba(246, 247, 251, 0.62);
}

.hero-search-metric:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 28px rgba(126, 188, 255, 0.12);
}

.hero-search-metric:focus-within .hero-search-icon {
  color: rgba(255, 255, 255, 0.88);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.metric strong {
  font-size: 14px;
}

.hero-refresh-button {
  margin-top: 10px;
  width: 100%;
}

.hero-status {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(246, 247, 251, 0.78);
  word-break: break-word;
}

.audit-banner {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.audit-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.audit-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.audit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(246, 247, 251, 0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.audit-failures ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.audit-failures li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(246, 247, 251, 0.86);
  line-height: 1.45;
}

.audit-failures li.audit-empty {
  color: rgba(246, 247, 251, 0.68);
  font-style: italic;
}

.severity-critical {
  background: rgba(213, 61, 47, 0.22);
}

.severity-high {
  background: rgba(223, 101, 26, 0.22);
}

.severity-elevated {
  background: rgba(192, 164, 45, 0.22);
}

.severity-moderate {
  background: rgba(31, 142, 144, 0.22);
}

.feed-card[data-severity="critical"] {
  border-left: 3px solid #d53d2f;
}

.feed-card[data-severity="high"] {
  border-left: 3px solid #df651a;
}

.feed-card[data-severity="elevated"] {
  border-left: 3px solid #c0a42d;
}

.feed-card[data-severity="moderate"] {
  border-left: 3px solid #1f8e90;
}

/* ── Aesthetic: glass-morphism map container ──
   Frosted-glass border effect with a subtle inner glow gives the
   map a premium, modern look that ties into the dark UI. */
.map-surface {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  height: 340px;
  min-height: 300px;
  border-radius: 16px;
  position: relative;
  background: #e2e8f0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10);
}

/* ── Aesthetic: map surface top-edge highlight ──
   Faint horizontal light-leak along the top inner edge of the map
   surface, mimicking light hitting the upper rim of a glass panel. */
.map-surface::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 420;
  pointer-events: none;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    90deg,
    transparent 4%,
    rgba(255, 255, 255, 0.14) 28%,
    rgba(200, 225, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.14) 72%,
    transparent 96%
  );
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.map-panel {
  width: 100%;
  max-width: 100%;
  padding: 14px;
}

.map-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.map-mode-tabs {
  display: inline-flex;
  gap: 8px;
  max-width: 100%;
}

.map-mode-tab {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.map-mode-tab.active {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}

.map-status-line {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 450;
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(246, 247, 251, 0.88);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: opacity 0.3s ease;
}

/* When backdrop-filter is supported, lower background opacity for a true frosted-glass effect */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .map-status-line {
    background: rgba(15, 23, 42, 0.55);
  }
}

/* ── Aesthetic: map vignette ──
   Subtle radial shadow around the map edges draws the eye to the centre
   and adds cinematic depth without obscuring content. */
.map-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
}

.map-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 405;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 52%,
    rgba(7, 9, 20, 0.22) 100%
  );
  transition: background 0.6s ease;
}

/* ── Severity-coloured vignette tint ──
   Tint the map edge glow to match the highest-severity visible alert. */
.map-viewport[data-vignette="critical"]::after {
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 52%,
    rgba(220, 38, 38, 0.18) 100%
  );
}

.map-viewport[data-vignette="high"]::after {
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 52%,
    rgba(234, 88, 12, 0.16) 100%
  );
}

.map-viewport[data-vignette="elevated"]::after {
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 52%,
    rgba(217, 119, 6, 0.14) 100%
  );
}

.map-viewport[data-vignette="moderate"]::after {
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 52%,
    rgba(2, 132, 199, 0.14) 100%
  );
}

.map-motion-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 410;
  overflow: hidden;
}

.map-motion-track {
  position: absolute;
  left: -18%;
  width: 136%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 20%, rgba(162, 211, 255, 0.36) 52%, rgba(255, 255, 255, 0.10) 84%, transparent 100%);
  opacity: 0.68;
}

.map-motion-track--one {
  top: 24%;
  transform: rotate(-14deg);
}

.map-motion-track--two {
  top: 50%;
  transform: rotate(8deg);
  opacity: 0.52;
}

.map-motion-track--three {
  top: 73%;
  transform: rotate(-5deg);
  opacity: 0.42;
}

.map-motion-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, rgba(179, 226, 255, 0.92) 56%, rgba(73, 169, 255, 0.82) 100%);
  box-shadow: 0 0 0 2px rgba(146, 212, 255, 0.18), 0 0 14px rgba(111, 199, 255, 0.5);
}

.map-motion-blip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(167, 221, 255, 0.42);
  animation: map-motion-pulse 1.8s ease-out infinite;
}

.map-motion-blip--one {
  top: 20%;
  animation: map-motion-flight-1 10s linear infinite;
}

.map-motion-blip--two {
  top: 47%;
  animation: map-motion-flight-2 13s linear infinite;
}

.map-motion-blip--three {
  top: 70%;
  animation: map-motion-flight-3 16s linear infinite;
}

@keyframes map-motion-flight-1 {
  0% { transform: translate3d(-10%, 0, 0); opacity: 0; }
  8% { opacity: 0.95; }
  82% { opacity: 0.9; }
  100% { transform: translate3d(1220%, 0, 0); opacity: 0; }
}

@keyframes map-motion-flight-2 {
  0% { transform: translate3d(1180%, 0, 0); opacity: 0; }
  10% { opacity: 0.9; }
  82% { opacity: 0.85; }
  100% { transform: translate3d(-12%, 0, 0); opacity: 0; }
}

@keyframes map-motion-flight-3 {
  0% { transform: translate3d(-12%, 0, 0); opacity: 0; }
  12% { opacity: 0.84; }
  80% { opacity: 0.8; }
  100% { transform: translate3d(1220%, 0, 0); opacity: 0; }
}

@keyframes map-motion-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.25); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .map-motion-overlay {
    display: none;
  }
}

.map-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.map-controls {
  display: flex;
  gap: 8px;
}

.map-control {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
}

.leaflet-map {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  z-index: 400;
}

.leaflet-container {
  width: 100%;
  max-width: 100%;
  height: 100%;
  position: relative;
  background: #e2e8f0;
  font: inherit;
}

.leaflet-interactive.watch-zone {
  mix-blend-mode: screen;
}

.leaflet-interactive.fusion-line {
  filter: drop-shadow(0 0 6px rgba(95, 168, 255, 0.18));
}

/* ── Aesthetic: muted tiles ──
   Desaturate + slightly darken light tiles so the base map recedes
   behind the vivid severity dots and matches the dark UI chrome. */
.leaflet-tile-pane {
  filter: saturate(0.35) brightness(0.92) contrast(1.05);
  transition: filter 0.4s ease;
}

.leaflet-control-attribution {
  background: rgba(7, 9, 20, 0.62) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  color: rgba(255, 255, 255, 0.78) !important;
  border-radius: 10px 0 0 0;
  padding: 2px 6px !important;
}

/* Leaflet zoom controls — glass style */
.leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.leaflet-control-zoom a {
  background: rgba(9, 14, 25, 0.68) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  transition: background 0.2s;
}

.leaflet-control-zoom a:hover {
  background: rgba(20, 28, 46, 0.88) !important;
}

.leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.88) !important;
}

.map-preview-tooltip-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.map-preview-tooltip {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.map-preview-tooltip strong {
  font-size: 12px;
  line-height: 1.25;
  color: #f8fafc;
}

.map-preview-tooltip span {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.82);
}

/* ── Aesthetic: popup glassmorphism ──
   Frosted-glass popup with backdrop blur, refined border glow, and
   elevated shadow so popups feel layered above the map. */
.map-preview-popup-shell .leaflet-popup-content-wrapper,
.map-preview-popup-shell .leaflet-popup-tip {
  background: rgba(9, 14, 25, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.40),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.map-preview-popup-shell .leaflet-popup-content {
  margin: 12px 14px;
}

.map-preview-card {
  display: grid;
  gap: 6px;
  min-width: 200px;
  max-width: 240px;
}

.map-cluster-card {
  max-width: 280px;
}

.map-cluster-list {
  display: grid;
  gap: 6px;
}

.map-cluster-item {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 18, 30, 0.55);
  color: #f8fafc;
  text-align: left;
}

.map-cluster-item strong {
  font-size: 12px;
  line-height: 1.3;
}

.map-cluster-item span {
  font-size: 10px;
  color: rgba(226, 232, 240, 0.72);
}

.map-cluster-more {
  font-size: 10px;
  color: rgba(226, 232, 240, 0.62);
  padding-left: 2px;
}

.map-cluster-actions {
  display: grid;
  gap: 6px;
}

.map-cluster-link {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 26, 38, 0.6);
  text-align: center;
}

/* ── Aesthetic: empty-state breathing pulse ──
   Frosted-glass treatment with a soft breathing border glow so the
   "No alerts" placeholder feels alive rather than static. */
.map-empty-state {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 450;
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: map-empty-breathe 3s ease-in-out infinite;
}

@keyframes map-empty-breathe {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.30),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  50% {
    border-color: rgba(148, 196, 255, 0.28);
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.30),
      0 0 12px 2px rgba(120, 180, 255, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

.map-preview-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.map-preview-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.86);
}

.map-preview-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.62);
}

.map-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: rgba(226, 232, 240, 0.72);
}

.map-preview-button {
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f2b432, #d89a15);
  color: #101418;
  font-size: 12px;
  font-weight: 800;
}

.leaflet-container {
  touch-action: pan-x pan-y pinch-zoom;
}

.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 2;
}

.map-dot-icon,
.map-pin-icon {
  background: transparent;
  border: 0;
  position: relative;
}

/* ── Aesthetic: dot glow ──
   Soft coloured halo lifts each severity dot off the desaturated tiles,
   giving depth without clutter. The halo colour inherits from the dot's
   background via a layered box-shadow. */
.map-dot {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.28),
    0 0 6px 2px rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* ── Aesthetic: dot hover glow intensification ──
   On hover the dot scales up AND the severity-coloured halo intensifies
   dramatically, making the dot "light up" under the cursor. */
.map-dot:hover {
  transform: scale(1.25);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 14px 5px rgba(255, 255, 255, 0.28);
}

.map-dot--fresh::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(143, 219, 255, 0.58);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: map-fresh-dot-pulse 1.8s ease-out infinite;
}

.map-dot--critical {
  background: #dc2626;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.28),
    0 0 8px 3px rgba(220, 38, 38, 0.45);
}
.map-dot--critical:hover {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 18px 7px rgba(220, 38, 38, 0.62);
}

.map-dot--high {
  background: #ea580c;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.28),
    0 0 8px 3px rgba(234, 88, 12, 0.40);
}
.map-dot--high:hover {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 18px 7px rgba(234, 88, 12, 0.58);
}

.map-dot--elevated {
  background: #d97706;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.28),
    0 0 8px 3px rgba(217, 119, 6, 0.35);
}
.map-dot--elevated:hover {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 18px 7px rgba(217, 119, 6, 0.52);
}

.map-dot--moderate {
  background: #0284c7;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.28),
    0 0 8px 3px rgba(2, 132, 199, 0.35);
}
.map-dot--moderate:hover {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 18px 7px rgba(2, 132, 199, 0.52);
}

/* ── Attack-type icon overlay ──
   Small emoji badge offset from the severity dot, showing the
   classified attack type (vehicle / blade / IED / shooter). */
.map-dot-attack-icon {
  position: absolute;
  bottom: -2px;
  right: -6px;
  font-size: 10px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  z-index: 1;
}

.map-pin-shell {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
}

.map-pin-shell--context {
  opacity: 0.9;
}

.map-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-ring--active {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 116, 92, 0.46);
  box-shadow: 0 0 0 8px rgba(255, 116, 92, 0.12), 0 0 28px rgba(255, 107, 82, 0.28);
  animation: map-ring-pulse 2.2s ease-out infinite;
}

.map-ring--disrupted {
  width: 34px;
  height: 34px;
  border: 2px dashed rgba(255, 184, 84, 0.8);
  box-shadow: 0 0 0 6px rgba(255, 184, 84, 0.10), 0 0 18px rgba(255, 173, 77, 0.18);
}

.map-ring--case {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(113, 209, 232, 0.52);
  box-shadow: 0 0 0 5px rgba(113, 209, 232, 0.10);
}

.map-ring--arrest {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(120, 164, 255, 0.72);
  box-shadow: 0 0 0 6px rgba(120, 164, 255, 0.10), 0 0 18px rgba(82, 126, 230, 0.14);
}

.map-ring--context {
  width: 28px;
  height: 28px;
  border: 2px dotted rgba(84, 212, 188, 0.56);
  box-shadow: 0 0 0 4px rgba(84, 212, 188, 0.08);
}

.map-pin {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  border: 2px solid rgba(255, 255, 255, 0.96);
  transform: translate(10px, 10px) rotate(-45deg);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08), 0 10px 20px rgba(0, 0, 0, 0.35);
}

.map-pin::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
}

.map-pin--critical {
  background: linear-gradient(180deg, #ff6b52, #c42d1f);
}

.map-pin--high {
  background: linear-gradient(180deg, #ffad4d, #c96a10);
}

.map-pin--elevated {
  background: linear-gradient(180deg, #f2d55b, #b89a21);
}

.map-pin--moderate {
  background: linear-gradient(180deg, #4fd2d0, #1d8381);
}

.map-pin--active {
  filter: saturate(1.08);
}

.map-pin--disrupted {
  box-shadow: 0 0 0 7px rgba(255, 201, 110, 0.10), 0 10px 20px rgba(0, 0, 0, 0.35);
}

.map-pin--arrest {
  box-shadow: 0 0 0 7px rgba(120, 164, 255, 0.10), 0 10px 20px rgba(0, 0, 0, 0.35);
}

.map-pin--context {
  box-shadow: 0 0 0 5px rgba(84, 212, 188, 0.08), 0 10px 18px rgba(0, 0, 0, 0.28);
}

.map-pin-glyph {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -62%);
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(10, 16, 28, 0.82);
  color: #f8fafc;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.map-pin-glyph--active {
  background: rgba(114, 23, 16, 0.88);
}

.map-pin-glyph--disrupted {
  background: rgba(111, 69, 10, 0.88);
}

.map-pin-glyph--arrest {
  background: rgba(19, 42, 98, 0.88);
}

.map-pin-glyph--context {
  background: rgba(16, 77, 79, 0.88);
}

.map-cluster-icon {
  background: transparent;
  border: 0;
}

/* ── Aesthetic: cluster pulse ring ──
   Pulsing ring behind each cluster draws attention to grouped alerts.
   The ring colour matches the cluster severity via a shared
   --cluster-ring custom property set on each severity variant. */
.map-cluster {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
  --cluster-ring: rgba(148, 163, 184, 0.35);
  position: relative;
}

.map-cluster::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--cluster-ring);
  animation: map-cluster-ring-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

/* ── Aesthetic: cluster inner radial gradient ──
   Subtle radial highlight makes each cluster feel spherical rather
   than flat, adding depth without changing the base colour palette. */
.map-cluster--critical {
  background: radial-gradient(circle at 38% 34%, #fecaca 0%, #fca5a5 58%, #f87171 100%);
  --cluster-ring: rgba(252, 165, 165, 0.50);
}

.map-cluster--high {
  background: radial-gradient(circle at 38% 34%, #fed7aa 0%, #fdba74 58%, #fb923c 100%);
  --cluster-ring: rgba(253, 186, 116, 0.45);
}

.map-cluster--elevated {
  background: radial-gradient(circle at 38% 34%, #fde68a 0%, #f59e0b 58%, #d97706 100%);
  --cluster-ring: rgba(245, 158, 11, 0.40);
}

.map-cluster--moderate {
  background: radial-gradient(circle at 38% 34%, #bfdbfe 0%, #93c5fd 58%, #60a5fa 100%);
  --cluster-ring: rgba(147, 197, 253, 0.40);
}

@keyframes map-cluster-ring-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes map-ring-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 116, 92, 0.18), 0 0 18px rgba(255, 107, 82, 0.20);
    opacity: 0.9;
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 116, 92, 0.04), 0 0 30px rgba(255, 107, 82, 0.10);
    opacity: 0.78;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 116, 92, 0), 0 0 18px rgba(255, 107, 82, 0.18);
    opacity: 0.9;
  }
}

@keyframes map-fresh-dot-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-dot--fresh::after {
    animation: none;
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.35);
  }
  .map-marker-enter {
    animation: none !important;
  }
  .map-cluster::before {
    animation: none;
    opacity: 0.35;
    transform: scale(1.2);
  }
  .map-empty-state {
    animation: none;
  }
}

/* ── Aesthetic: map control glassmorphism ──
   Frosted-glass treatment on all map overlays so they feel unified
   with the popup glassmorphism and sit cohesively above the tiles. */
.map-severity-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(9, 14, 25, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #f8fafc;
  line-height: 1.3;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

/* ── Aesthetic: legend dot micro-glow ──
   Severity-matched soft glow on each legend swatch so the legend
   mirrors the glowing dots on the map, reinforcing the colour key. */
.map-legend-dot--critical {
  background: #dc2626;
  box-shadow: 0 0 6px 1px rgba(220, 38, 38, 0.55);
}

.map-legend-dot--high {
  background: #ea580c;
  box-shadow: 0 0 6px 1px rgba(234, 88, 12, 0.50);
}

.map-legend-dot--elevated {
  background: #d97706;
  box-shadow: 0 0 6px 1px rgba(217, 119, 6, 0.45);
}

.map-legend-dot--moderate {
  background: #0284c7;
  box-shadow: 0 0 6px 1px rgba(2, 132, 199, 0.45);
}

/* ── Watch-zone radius overlay ──
   Translucent boundary shown in "Near me" mode so the user can
   see the NEARBY_RADIUS_KM watch zone around their position. */
.map-radius-overlay {
  fill: rgba(96, 165, 250, 0.10);
  stroke: rgba(96, 165, 250, 0.45);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}

/* ── Dark-mode tile toggle ── */
.map-tile-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 14, 25, 0.68);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  color: #f8fafc;
  font-size: 16px;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s, box-shadow 0.2s;
}

.map-tile-toggle:hover {
  background: rgba(20, 28, 46, 0.95);
}

/* ── Hover tooltip ── */
.map-hover-tooltip {
  background: rgba(9, 14, 25, 0.92);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
}

.map-hover-tooltip::before {
  border-top-color: rgba(9, 14, 25, 0.92);
}

/* ── Marker entry animation ── */
@keyframes map-marker-drop {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(0.6);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.map-marker-enter {
  animation: map-marker-drop 0.35s ease-out both;
}

/* ── Cluster expansion animation ── */
.map-cluster {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.map-cluster:hover {
  transform: scale(1.12);
}

.watch-site-icon {
  background: transparent;
  border: 0;
}

.watch-site-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.06), 0 10px 18px rgba(0, 0, 0, 0.30);
}

.watch-site-marker--transport {
  background: #53b6ff;
}

.watch-site-marker--embassy {
  background: #c46bff;
}

.watch-site-marker--hospital {
  background: #48c97d;
}

.watch-site-marker--worship {
  background: #f0c95e;
}

.watch-site-marker--government {
  background: #ff7a64;
}

.watch-site-glyph {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.watch-site-glyph svg {
  width: 16px;
  height: 16px;
  stroke: rgba(9, 14, 25, 0.92);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.watch-site-marker--worship .watch-site-glyph svg,
.watch-site-marker--government .watch-site-glyph svg {
  fill: rgba(9, 14, 25, 0.10);
}

.watch-site-popup strong {
  display: block;
  margin-bottom: 4px;
}

.watch-site-popup p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.fusion-node {
  filter: drop-shadow(0 0 8px rgba(95, 168, 255, 0.25));
}

@keyframes card-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#feed-list,
#supporting-list {
  display: grid;
  gap: 12px;
}

#feed-list > .feed-card,
#supporting-list > .supporting-card {
  animation: card-fade-in 0.3s ease both;
}

@media (prefers-reduced-motion: reduce) {
  #feed-list > .feed-card,
  #supporting-list > .supporting-card {
    animation: none;
  }
}

.supporting-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.supporting-card.is-quarantine {
  background: rgba(213, 61, 47, 0.08);
  border: 1px solid rgba(213, 61, 47, 0.24);
}

.supporting-card + .supporting-card {
  margin-top: 12px;
}

.list-more-button {
  margin-top: 12px;
  width: 100%;
}

.supporting-card h4 {
  font-size: 16px;
  line-height: 1.3;
}

.supporting-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.supporting-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.supporting-badge.is-quarantine {
  background: rgba(213, 61, 47, 0.14);
}

.supporting-badge.is-context {
  background: rgba(31, 142, 144, 0.16);
  color: rgba(225, 252, 255, 0.92);
}


.story-geo-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 255, 0.92);
}

.region-badge.is-london {
  background: rgba(102, 61, 214, 0.22);
  border-color: rgba(139, 104, 247, 0.46);
}

.region-badge.is-uk {
  background: rgba(41, 108, 211, 0.24);
  border-color: rgba(100, 161, 255, 0.48);
}

.region-badge.is-eu,
.region-badge.is-europe {
  background: rgba(29, 113, 181, 0.24);
  border-color: rgba(85, 165, 230, 0.5);
}

.region-badge.is-us {
  background: rgba(190, 53, 73, 0.24);
  border-color: rgba(234, 120, 133, 0.5);
}

.region-badge.is-international {
  background: rgba(22, 149, 129, 0.24);
  border-color: rgba(103, 220, 198, 0.52);
}

.region-badge.is-country {
  background: rgba(87, 96, 116, 0.24);
  border-color: rgba(173, 184, 207, 0.5);
}

.region-badge.is-other {
  background: rgba(115, 125, 146, 0.18);
  border-color: rgba(170, 181, 206, 0.4);
}

.note-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.tab-panel[data-panel="notes"] .panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(236, 246, 255, 0.10), rgba(207, 229, 255, 0.04)),
    var(--panel);
  border-color: rgba(149, 186, 236, 0.35);
}

.tab-panel[data-panel="notes"] .panel::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  bottom: 18px;
  width: 2px;
  background: rgba(255, 133, 133, 0.35);
  box-shadow: 14px 0 0 rgba(255, 255, 255, 0.04);
}

.tab-panel[data-panel="notes"] .panel > * {
  position: relative;
  z-index: 1;
}

.source-request-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.note-form input,
.source-request-form input,
.note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tab-panel[data-panel="notes"] .note-form input,
.tab-panel[data-panel="notes"] .note-form textarea {
  border-color: rgba(153, 193, 245, 0.42);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(150, 184, 233, 0.16) 0,
      rgba(150, 184, 233, 0.16) 1px,
      rgba(255, 255, 255, 0.06) 1px,
      rgba(255, 255, 255, 0.06) 30px
    );
  box-shadow: inset 0 0 0 1px rgba(12, 18, 30, 0.12);
}

.tab-panel[data-panel="notes"] .note-form .primary-button {
  background: linear-gradient(180deg, #ffd76b, #f0b63d);
  color: #1a1206;
}

.note-form textarea {
  min-height: 120px;
  resize: vertical;
}

#source-request-list {
  display: grid;
  gap: 12px;
}

.source-request-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.source-request-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.source-request-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(111, 192, 255, 0.16);
  border: 1px solid rgba(111, 192, 255, 0.32);
  color: rgba(230, 244, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-request-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.source-request-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-request-status {
  margin-top: 12px;
}

.source-request-status.is-error {
  color: #ffd0d0;
}

.source-request-status.is-success {
  color: #c8f6d1;
}

.primary-button {
  justify-self: start;
  padding: 12px 18px;
  background: var(--amber);
  color: black;
}

.note-card {
  padding: 18px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(123, 170, 234, 0.15) 0,
      rgba(123, 170, 234, 0.15) 1px,
      rgba(255, 255, 255, 0.07) 1px,
      rgba(255, 255, 255, 0.07) 28px
    );
  border: 1px solid rgba(149, 186, 236, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.note-card p {
  margin-top: 8px;
  color: var(--muted);
}

.tab-panel[data-panel="notes"] #notes-list {
  display: grid;
  gap: 12px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)) 14px;
  overflow-y: auto;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  position: relative;
  width: min(460px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom)) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 24px;
  line-height: 1;
}

.modal-grid {
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-grid > div {
  min-width: calc(50% - 10px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 14px;
}

.summary-panel {
  margin: 16px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.summary-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.summary-panel pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.long-brief-fallback-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(213, 61, 47, 0.7);
  background: rgba(213, 61, 47, 0.15);
  color: #ff7f74;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.scene-clock-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.scene-clock-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.scene-clock-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.scene-clock-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.confidence-ladder {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.confidence-ladder-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.confidence-rung {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.confidence-rung.active {
  border-color: rgba(241, 178, 21, 0.45);
  background: linear-gradient(180deg, rgba(241, 178, 21, 0.28), rgba(241, 178, 21, 0.12));
  color: var(--text);
  box-shadow: 0 8px 18px rgba(241, 178, 21, 0.14);
}

.confidence-ladder-steps {
  display: grid;
  gap: 10px;
}

.confidence-step {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.confidence-step.active {
  border-color: rgba(241, 178, 21, 0.28);
  background: rgba(241, 178, 21, 0.08);
}

.confidence-step strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.confidence-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.corroboration-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.corroboration-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.corroboration-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.corroboration-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  background: var(--amber);
  color: black;
}

.modal-watch-toggle.active {
  border-color: rgba(241, 178, 21, 0.34);
  background: rgba(241, 178, 21, 0.16);
  color: #fff5d1;
}

/* ===== iPhone / iOS app-shell hardening ===== */

html.device-iphone,
body.device-iphone {
  width: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: #070914;
}

.device-iphone body,
body.device-iphone {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.device-iphone .page {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding:
    max(0px, env(safe-area-inset-top))
    max(0px, env(safe-area-inset-right))
    max(0px, env(safe-area-inset-bottom))
    max(0px, env(safe-area-inset-left));
}

.device-iphone .phone-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.device-iphone .phone-notch {
  display: none;
}

.device-iphone .screen {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  border-radius: 0;
  overflow-x: hidden;
  padding:
    calc(12px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
  background:
    linear-gradient(160deg, rgba(7, 9, 20, 0.98), rgba(22, 28, 41, 0.94) 60%, rgba(61, 28, 25, 0.90));
}

.device-iphone .hero-metrics {
  flex-direction: column;
  align-items: stretch;
}

.device-iphone .metric {
  min-width: 0;
}

.device-iphone .hero-search-metric,
.device-android .hero-search-metric {
  padding: 0 13px;
}

.device-iphone .hero-card,
.device-iphone .priority-card,
.device-iphone .feed-card,
.device-iphone .panel,
.device-iphone .modal-card,
.device-iphone .note-card,
.device-iphone .bulldog-card {
  border-radius: 24px;
}

.device-iphone .hero-card {
  min-height: 190px;
  background:
    linear-gradient(180deg, rgba(7, 9, 20, 0.92), rgba(7, 9, 20, 0.58) 45%, rgba(7, 9, 20, 0.30)),
    url("assets/foc-background.gif") center top / cover no-repeat;
}

.device-iphone h1 {
  font-size: clamp(32px, 9vw, 42px);
  line-height: 0.98;
}

.device-iphone .tabbar,
.device-iphone .filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.device-iphone .tabbar::-webkit-scrollbar,
.device-iphone .filters::-webkit-scrollbar {
  display: none;
}

.device-iphone .tab,
.device-iphone .filter,
.device-iphone .map-chip,
.device-iphone .map-mode-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.device-iphone .detail-actions,
.device-iphone .map-toolbar,
.device-iphone .section-heading {
  flex-direction: column;
  align-items: stretch;
}

.device-iphone .mode-toggle,
.device-iphone .copy-button,
.device-iphone .secondary-button,
.device-iphone .primary-button,
.device-iphone .primary-link {
  width: 100%;
  text-align: center;
  justify-self: stretch;
}

.device-iphone .map-surface {
  height: clamp(300px, 48vh, 440px);
  min-height: 300px;
  border-radius: 16px;
}

.device-iphone .leaflet-container {
  border-radius: 16px;
  touch-action: pan-x pan-y pinch-zoom;
}

.device-iphone .modal {
  align-items: end;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

.device-iphone .modal-card {
  width: 100%;
  max-width: 100%;
  max-height: calc(100dvh - env(safe-area-inset-top) - 8px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.device-iphone .modal-backdrop {
  backdrop-filter: blur(4px);
}

.device-iphone .note-form input,
.device-iphone .note-form textarea {
  font-size: 16px;
}

.device-iphone .close-button,
.device-iphone .map-control,
.device-iphone .tab,
.device-iphone .filter,
.device-iphone .star-button,
.device-iphone .primary-button,
.device-iphone .secondary-button,
.device-iphone .mode-toggle {
  min-height: 44px;
}

.device-iphone .screen.briefing-mode {
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

@media (display-mode: standalone) {
  .device-iphone .screen {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .device-iphone .hero-card {
    min-height: 180px;
  }
}

@supports (-webkit-touch-callout: none) {
  html.device-iphone,
  body.device-iphone,
  .device-iphone .page,
  .device-iphone .phone-shell,
  .device-iphone .screen {
    min-height: -webkit-fill-available;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px;
  }

  .phone-shell {
    border-radius: 32px;
    padding: 12px;
  }

  .screen {
    border-radius: 24px;
    min-height: auto;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-card,
  .priority-card,
  .feed-card,
  .panel,
  .modal-card {
    border-radius: 24px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 42px);
  }

  .modal-grid > div {
    min-width: 100%;
  }

  .map-surface {
    height: 320px;
    min-height: 300px;
  }

  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .phone-shell {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-notch {
    display: none;
  }

  .screen {
    border-radius: 0;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero-card {
    min-height: 200px;
    background:
      linear-gradient(180deg, rgba(7, 9, 20, 0.90), rgba(7, 9, 20, 0.56) 46%, rgba(7, 9, 20, 0.30)),
    url("assets/foc-background.gif") center top / cover no-repeat;
  }

  .tabbar,
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabbar::-webkit-scrollbar,
  .filters::-webkit-scrollbar {
    display: none;
  }

  .tab,
  .filter {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .mode-toggle {
    width: 100%;
    text-align: center;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .briefing-panel .section-heading {
    gap: 12px;
  }

  .copy-button,
  .secondary-button,
  .primary-link,
  .primary-button {
    width: 100%;
    justify-self: stretch;
    text-align: center;
  }

  .modal {
    align-items: end;
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .modal-card {
    width: min(calc(100% - 16px), 460px);
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }

  .bulldog-card {
    align-items: flex-start;
  }

  .map-surface {
    height: 420px;
    min-height: 420px;
  }
}

@media (max-width: 768px) and (pointer: coarse) {
  .page {
    padding:
      max(0px, env(safe-area-inset-top))
      max(0px, env(safe-area-inset-right))
      max(0px, env(safe-area-inset-bottom))
      max(0px, env(safe-area-inset-left));
  }

  .phone-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-notch {
    display: none;
  }

  .screen {
    width: 100%;
    min-width: 0;
    min-height: 100svh;
    min-height: 100dvh;
    border-radius: 0;
    padding:
      calc(12px + env(safe-area-inset-top))
      calc(14px + env(safe-area-inset-right))
      calc(18px + env(safe-area-inset-bottom))
      calc(14px + env(safe-area-inset-left));
  }

  .hero-card,
  .bulldog-card,
  .priority-card,
  .feed-card,
  .panel,
  .modal-card,
  .note-card,
  .supporting-card {
    border-radius: 22px;
  }

  .hero-card {
    min-height: 176px;
    padding: 18px;
    background:
      linear-gradient(180deg, rgba(7, 9, 20, 0.92), rgba(7, 9, 20, 0.64) 48%, rgba(7, 9, 20, 0.38)),
      url("assets/foc-background.gif") center top / cover no-repeat;
  }

  h1 {
    font-size: clamp(30px, 9.5vw, 40px);
    line-height: 0.96;
    word-break: break-word;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .metric {
    min-width: 0;
    padding: 12px 13px;
  }

  .hero-search-metric {
    padding: 0 13px;
  }

  .tabbar,
  .filters {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab,
  .filter,
  .map-mode-tab,
  .map-control,
  .primary-button,
  .secondary-button,
  .primary-link {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 10px;
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .tabbar,
  .filters,
  .map-controls,
  .modal-actions,
  .detail-actions {
    -webkit-user-select: none;
    user-select: none;
  }

  .bulldog-card {
    align-items: flex-start;
  }

  .priority-card h2 {
    font-size: clamp(24px, 7vw, 30px);
  }

  .meta-row,
  .section-heading,
  .map-toolbar,
  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .meta-row {
    gap: 6px;
  }

  .map-chip {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .map-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .map-surface {
    height: min(54vh, 420px);
    min-height: 300px;
  }

  .modal {
    align-items: end;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 8px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
  }

  .modal-grid > div {
    min-width: 100%;
  }

  .summary-panel pre,
  .briefing-panel pre {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
