* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#stale-banner {
  display: none;
  position: fixed;
  bottom: 20%;
  left: 0;
  right: 0;
  height: 10vh;
  z-index: 9999;
  background: rgba(30, 30, 30, 0.88);
  color: #ccc;
  font-size: 1.1rem;
  font-weight: 500;
  gap: 10px;
  align-items: center;
  justify-content: center;
  direction: rtl;
  pointer-events: none;
}
#stale-banner.visible {
  display: flex;
}
.stale-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(200,200,200,0.3);
  border-top-color: #ccc;
  border-radius: 50%;
  animation: staleSpin 0.8s linear infinite;
}
@keyframes staleSpin {
  to { transform: rotate(360deg); }
}

/* Live badge */
#live-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(0, 200, 80, 0.85);
  text-shadow: 0 0 6px rgba(0, 200, 80, 0.4);
  pointer-events: none;
  will-change: opacity;
}
#live-badge .offline-text { display: none; }
#live-badge.offline .live-text { display: none; }
#live-badge.offline .offline-text { display: inline; }
#live-badge.offline {
  color: rgba(255, 40, 40, 0.85);
  text-shadow: 0 0 6px rgba(255, 40, 40, 0.4);
  animation: none;
  opacity: 1;
}
#live-badge.offline .live-dot {
  background: rgba(255, 40, 40, 0.9);
  box-shadow: 0 0 4px rgba(255, 40, 40, 0.6);
  animation: liveDotPulse 1s steps(10) infinite;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 200, 80, 0.9);
  box-shadow: 0 0 4px rgba(0, 200, 80, 0.6);
  animation: liveDotPulse 2s steps(10) infinite;
  will-change: transform, opacity;
}
@media (min-width: 900px) {
  #live-badge {
    font-size: 1.3rem;
    gap: 7px;
  }
  .live-dot {
    width: 12px;
    height: 12px;
  }
}
@keyframes livePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes liveDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

header {
  text-align: center;
  padding: 12px 16px 8px;
  border-bottom: 1px solid #222;
}

header h1 {
  font-size: 1.4rem;
  color: #ff2020;
  letter-spacing: 0.05em;
}

.subtitle {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

main {
  margin: 0 auto;
  position: relative;
}

/* Map (Leaflet) */
#map {
  position: relative;
  width: 100%;
  background: #0a0a0a;
}

/* AOI panel */
#aoi-panel {
  display: contents;
}

/* Drawer knob (mobile only) */
.drawer-knob {
  display: none;
}

/* Wide screen: 2-column (map + feed), AOI floats over map */
@media (min-width: 900px) {
  main {
    display: flex;
    height: 100%;
    direction: ltr;
  }
  #aoi-panel {
    display: contents;
  }
  #map {
    flex: 1;
    min-width: 0;
    height: 100%;
  }
  #feed-drawer {
    flex: 0 0 35%;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    direction: rtl;
    background: #0a0a0a;
    border-left: 1px solid #222;
  }
  #aoi-search, #aoi-chips {
    --aoi-width: 240px;
  }
}

/* Narrow screen: map fullscreen + bottom drawer */
@media (max-width: 899px) {
  main {
    position: relative;
    overflow: hidden;
    height: 100%;
  }
  #aoi-panel {
    display: contents;
  }
  #aoi-search {
    position: absolute;
    z-index: 1000;
    transition: width 0.2s ease;
  }
  #aoi-search:has(#aoi-input:focus) {
    width: calc(var(--aoi-width, 168px) * 1.33);
  }
  #aoi-search:has(#aoi-input:focus) #aoi-box {
    transform: scale(1);
    width: 100%;
  }
  #map {
    height: calc(100% - 40px);
  }
  #feed-drawer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateY(calc(100% - 40px));
    transition: transform 0.3s ease;
    background: #0a0a0a;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    overscroll-behavior-y: contain;
  }
  #feed-drawer.drawer-open {
    transform: translateY(0);
  }
  #feed-drawer #feed {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .drawer-knob {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    cursor: pointer;
    flex-shrink: 0;
    background: #1a1a1a;
    border-top: 1px solid #3a3a3a;
    border-radius: 12px 12px 0 0;
  }
  .drawer-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .drawer-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ccc;
    border-radius: 1px;
  }
  .drawer-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ddd;
    letter-spacing: 0.02em;
    line-height: 1;
    align-self: center;
    display: none;
  }
  #feed-drawer.drawer-open .drawer-label {
    display: block;
  }
}


/* Areas of Interest search */
#aoi-search {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1000;
  width: var(--aoi-width, 168px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#aoi-chips {
  position: absolute;
  left: 8px;
  top: calc(8px + var(--aoi-box-height, 80px) + 4px);
  width: var(--aoi-width, 168px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  direction: ltr;
  z-index: 999;
}

.aoi-chip {
  max-width: 100%;
}

.aoi-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  background: #555;
  color: #ddd;
  font-size: 0.84rem;
  padding: 0;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  max-width: 100%;
  transition: background 0.4s, border-color 0.4s, border-width 0.2s, box-shadow 0.4s, color 0.3s, font-weight 0.3s;
}
.chip-label-clip {
  overflow: hidden;
  min-width: 0;
  flex: 1;
  padding: 3px 4px;
  display: flex;
  align-items: center;
}
.chip-label {
  display: inline-block;
}
.chip-ticker {
  display: inline-block;
  animation: chipTicker 14s linear infinite reverse;
}
@keyframes chipTicker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--ticker-dist)); }
}


.aoi-chip-x {
  background: #444;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 0 6px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border-radius: 2px;
  font-size: 0.8rem;
  line-height: 1;
}

.aoi-chip-x:hover {
  color: #ff6666;
}

/* Per-AOI bell */
.aoi-chip-bell {
  background: #444;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 2px 4px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  flex-shrink: 0;
  border-radius: 2px;
}
.aoi-chip-bell .bell-mute-line {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.aoi-chip-bell.muted {
  color: #999;
  opacity: 0.8;
}
.aoi-chip-bell.muted .bell-mute-line {
  display: block;
}

.tg-bot-link {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: #ddd;
  flex-shrink: 0;
}
@media (max-width: 899px) {
  .tg-bot-link {
    display: inline-flex;
  }
  #aoi-box {
    transform: scale(0.85);
    transform-origin: top left;
    transition: transform 0.2s ease;
  }
  #aoi-chips {
    transform: scale(0.85);
    transform-origin: top left;
  }
}

#aoi-input {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 0.8rem;
  padding: 8px 10px;
  outline: none;
  flex: 1;
  min-width: 0;
  width: 100%;
}

#aoi-box {
  display: flex;
  flex-direction: column;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

#aoi-buttons-row {
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: #2a2a2a;
}

#aoi-buttons-row button {
  background: #1a1a1a;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

#aoi-buttons-row button:hover {
  background: #666;
}

#aoi-input-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid #444;
  background: #1a1a1a;
}

#aoi-toggle:focus {
  outline: none;
}

#aoi-toggle {
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: Georgia, "Times New Roman", serif;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

@media (hover: hover) {
  #aoi-toggle:hover { color: #fff !important; }
}
#aoi-toggle .aoi-hide-line {
  display: none;
}
#aoi-toggle.aoi-on { color: #e0e0e0; }
#aoi-toggle:not(.aoi-on) .aoi-hide-line {
  display: block;
}

#notif-toggle {
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

#notif-toggle:focus {
  outline: none;
}
#notif-toggle .notif-mute-line {
  display: none;
}
#notif-toggle.notif-on { color: #e0e0e0; }
#notif-toggle:not(.notif-on) .notif-mute-line {
  display: block;
}
@media (hover: hover) {
  #notif-toggle:hover { color: #fff !important; }
}
#notif-toggle.bell-blink {
  animation: bellBlink 0.6s ease 5;
}
@keyframes bellBlink {
  0%, 100% { color: inherit; }
  50% { color: #22c55e; }
}

#aoi-results {
  background: rgba(20, 20, 20, 0.92);
  border-radius: 6px;
  overflow: hidden;
}

.aoi-result {
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #333;
  direction: rtl;
}

.aoi-result:first-child {
  border-top: none;
}

.aoi-result:hover {
  background: rgba(79, 195, 247, 0.15);
}

.aoi-result-type {
  font-size: 0.65rem;
  color: #777;
}

.aoi-no-results {
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  direction: rtl;
}

/* Leaflet AOI labels (divIcon) */
.aoi-label {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  white-space: nowrap;
  background: none !important;
  border: none !important;
  pointer-events: none;
  transition: font-size 0.2s;
}

.aoi-label.aoi-enlarged {
  font-size: 1.2rem;
}

/* Leaflet tooltip for area names */
.area-tooltip {
  background: rgba(20, 20, 20, 0.9) !important;
  border: 1px solid #555 !important;
  color: #e0e0e0 !important;
  font-size: 0.8rem !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  direction: rtl;
}

.area-tooltip::before {
  border-top-color: #555 !important;
}

/* Location pin glow */
.location-pin {
  filter: drop-shadow(0 0 4px rgba(0, 204, 85, 0.9));
}

/* Radar */
.radar-icon { background: none !important; border: none !important; pointer-events: none; }
.radar-scanner { width: 100%; height: 100%; clip-path: circle(50% at 50% 50%); position: relative; }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 280deg, rgba(0,120,50,0.05) 310deg, rgba(0,120,50,0.5) 348deg, rgba(0,120,50,0.9) 360deg); animation: radarSpin 4.2s linear infinite; will-change: transform; }
.radar-ring { position: absolute; inset: 28%; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); pointer-events: none; }
.radar-center { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #fff; top: 50%; left: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 4px rgba(0,0,0,0.6); }
@keyframes radarSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }



/* Location toggle button (inside aoi-input-row) */
#loc-toggle {
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}
#loc-toggle:focus { outline: none; }
@media (hover: hover) {
  #loc-toggle:hover { color: #fff !important; }
}
#loc-toggle .loc-hide-line { display: none; }
#loc-toggle:not(.loc-on):not(.loc-waiting) .loc-hide-line { display: block; }
#loc-toggle.loc-on { color: #fff; }
#loc-toggle.loc-on svg path { fill: #fff; }
#loc-toggle.loc-on .pin-hole { fill: #888; }
#loc-toggle.loc-waiting {
  animation: locBlink 1s ease infinite;
}
@keyframes locBlink {
  0%, 100% { color: inherit; }
  50% { color: #22c55e; }
}
#loc-toggle.loc-waiting svg path {
  animation: locFillBlink 1s ease infinite;
}
@keyframes locFillBlink {
  0%, 100% { fill: currentColor; }
  50% { fill: #22c55e; }
}

/* Alert feed */
#feed {
  padding: 8px 6px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-empty {
  text-align: center;
  color: #555;
  padding: 24px;
  font-size: 0.9rem;
}

.alert-card {
  background: #151515;
  border-radius: 8px;
  padding: 10px 14px;
  border-right: 4px solid #333;
  animation: slideIn 0.3s ease-out;
}

.alert-card.cat-1 { border-right-color: #ff2020; }
.alert-card.cat-2,
.alert-card.cat-6 { border-right-color: #ff8c00; }
.alert-card.cat-3 { border-right-color: #9b30ff; }
.alert-card.cat-10 { border-right-color: #cc0000; }
.alert-card.cat-13 { border-right-color: #bb00ff; }
.alert-card.cat-11,
.alert-card.cat-101 { border-right-color: #ffdd00; }
.alert-card.cat-12,
.alert-card.cat-102,
.alert-card.cat-103 { border-right-color: #888; }
.alert-card.cat-98 { border-right-color: #ffdd00; }
.alert-card.cat-99 { border-right-color: #2090ff; }
.alert-card.evt-rockets { border-right-color: #ff2020; }
.alert-card.evt-uav { border-right-color: #ff8c00; }
.alert-card.evt-infiltration { border-right-color: #bb00ff; }
.alert-card.evt-pre_warning { border-right-color: #ffdd00; }
.alert-card.evt-test { border-right-color: #2090ff; }
.alert-card.evt-standdown { border-right-color: #888; }

.alert-cat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  color: #888;
}

.cat-1 .alert-cat-label { color: #ff2020; }
.cat-2 .alert-cat-label,
.cat-6 .alert-cat-label { color: #ff8c00; }
.cat-3 .alert-cat-label { color: #9b30ff; }
.cat-10 .alert-cat-label { color: #cc0000; }
.cat-13 .alert-cat-label { color: #bb00ff; }
.cat-11 .alert-cat-label,
.cat-101 .alert-cat-label { color: #ffdd00; }
.cat-12 .alert-cat-label,
.cat-102 .alert-cat-label,
.cat-103 .alert-cat-label { color: #888; }  /* stand-down / all-clear */
.cat-98 .alert-cat-label { color: #ffdd00; }
.cat-99 .alert-cat-label { color: #2090ff; }
.evt-rockets .alert-cat-label { color: #ff2020; }
.evt-uav .alert-cat-label { color: #ff8c00; }
.evt-infiltration .alert-cat-label { color: #bb00ff; }
.evt-pre_warning .alert-cat-label { color: #ffdd00; }
.evt-test .alert-cat-label { color: #2090ff; }
.evt-standdown .alert-cat-label { color: #888; }

.alert-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-districts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
  direction: rtl;
}

.alert-district-pill {
  font-size: 0.7rem;
  color: #ccc;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 1px 8px;
  white-space: nowrap;
}

.alert-ended-pill {
  font-size: 0.65rem;
  color: #999;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 1px 8px;
  margin-right: 6px;
}

.alert-areas-toggle {
  margin-bottom: 4px;
}

.alert-areas-toggle summary {
  font-size: 0.8rem;
  color: #777;
  cursor: pointer;
  user-select: none;
}

.alert-areas-toggle summary:hover {
  color: #aaa;
}

.alert-areas {
  font-size: 0.85rem;
  color: #bbb;
  margin-top: 4px;
  line-height: 1.4;
}

.alert-desc {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 4px;
}

.alert-time-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.alert-ago {
  font-size: 0.7rem;
  color: #777;
}

.alert-ago-hot {
  background: #cc0000;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
}

.alert-time {
  font-size: 0.7rem;
  color: #bbb;
  background: #333;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.alert-time-hot {
  background: #cc0000;
  color: #fff;
}


@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* Zoom reset pill */
#threat-tooltip {
  display: none;
  position: absolute;
  bottom: 16px;
  right: 96px;
  z-index: 1001;
  background: rgba(20, 20, 20, 0.9);
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  white-space: nowrap;
  pointer-events: none;
  direction: rtl;
}

#threat-tooltip.visible {
  display: block;
}

/* Icon deck — stacked cards */
#icon-deck {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  cursor: pointer;
  touch-action: manipulation;
  width: 50px;
  height: 50px;
}

#icon-deck .indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#icon-deck .indicator.active {
  transition: none;
}

/* Stacked offsets (collapsed) — all huddled together */
#pw-indicator { z-index: 4; transform: translate(0, 0); }
#rockets-indicator { z-index: 3; transform: translate(-3px, -3px); }
#uav-indicator { z-index: 2; transform: translate(-6px, -6px); }
#infiltration-indicator { z-index: 1; transform: translate(-8px, -8px); }

/* Expanded — fan out vertically */
#icon-deck.expanded #pw-indicator { transform: translate(0, -150px); }
#icon-deck.expanded #rockets-indicator { transform: translate(0, -100px); }
#icon-deck.expanded #uav-indicator { transform: translate(0, -50px); }
#icon-deck.expanded #infiltration-indicator { transform: translate(0, 0); }

/* Active indicators pop out to their spread position */
#pw-indicator.active { z-index: 10; transform: translate(0, -150px); }
#rockets-indicator.active { z-index: 10; transform: translate(0, -100px); }
#uav-indicator.active { z-index: 10; transform: translate(0, -50px); }

/* Inactive icons get greyed out */
.indicator:not(.active) img {
  filter: grayscale(1) brightness(0.4);
  transition: filter 0.3s;
}
.indicator.active img {
  filter: none;
  transition: filter 0.3s;
}

.indicator img {
  display: block;
  width: 39px;
  height: 39px;
  margin: 6px;
  border-radius: 6px;
  border: 3px solid transparent;
  outline: 1px solid #444;
  background: #1e1e1e;
  transition: border-color 0.3s, filter 0.3s;
}

.indicator img.test-frame {
  border-color: #4dabf7;
}

#zoom-reset {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(20, 20, 20, 0.85);
  color: #e0e0e0;
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

#zoom-reset img {
  display: block;
  margin: auto;
}

#zoom-reset.visible {
  display: flex;
}

#zoom-reset:hover {
  border-color: #4fc3f7;
}

/* Leaflet overrides for dark theme */
.leaflet-container {
  background: #0a0a0a;
  direction: ltr;
}

.leaflet-interactive:focus {
  outline: none;
}


/* Settings panel */
#settings-panel {
  position: fixed;
  top: 8px;
  right: 0;
  z-index: 1200;
  display: flex;
  flex-direction: row-reverse;
  overflow: hidden;
}

#settings-handle {
  background: #1a1a1a;
  border: 1px solid #444;
  border-right: none;
  border-radius: 6px 0 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 8px;
  height: 57px;
  color: #999;
  flex-shrink: 0;
  align-self: flex-start;
  position: relative;
  z-index: 1;
}

#settings-body {
  position: relative;
  width: 264px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 12px;
  padding-top: 36px;
  direction: rtl;
  white-space: nowrap;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  margin-right: -264px;
}

#settings-panel.open #settings-body {
  transform: translateX(0);
  margin-right: 0;
}

#settings-panel.open #settings-handle {
  display: none;
}

#settings-close {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border-radius: 6px 0 3px 0;
  border-bottom: 1px solid #333;
  border-right: 1px solid #333;
}

.settings-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ccc;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Info button + tip */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #555;
  color: #ccc;
  font-size: 10px;
  font-style: italic;
  font-family: serif;
  cursor: pointer;
  vertical-align: middle;
  margin: 0 4px;
  line-height: 1;
}
.info-tip {
  display: none;
  font-size: 11px;
  color: #aaa;
  font-weight: 400;
  position: absolute;
  top: 100%;
  right: 0;
  white-space: nowrap;
}
.info-tip.show {
  display: block;
}

/* Notification pill toggle */
.notif-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.notif-pill input {
  display: none;
}
.pill-track {
  display: inline-block;
  width: 32px;
  height: 18px;
  background: #444;
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}
.pill-knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #999;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.notif-pill input:checked + .pill-track {
  background: #16a34a;
}
.notif-pill input:checked + .pill-track .pill-knob {
  transform: translateX(-14px);
  background: #fff;
}

.sound-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #222;
}
.sound-row:last-child { border-bottom: none; }

.sound-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sound-label {
  font-size: 0.75rem;
  color: #bbb;
  flex: 1;
  min-width: 0;
}

.sound-select {
  background: #222;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.7rem;
  padding: 2px 4px;
  direction: rtl;
  flex-shrink: 0;
  width: 100px;
}

.sound-preview {
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sound-preview:hover {
  color: #ddd;
  background: #333;
}

@media (min-width: 900px) {
  #settings-panel { right: 35%; }
}

/* Consent dialog */
#consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

#consent-box {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 400px;
  width: 90%;
  direction: rtl;
  text-align: center;
}

#consent-box p {
  color: #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.consent-cookies {
  font-size: 0.8rem !important;
  color: #888 !important;
}

#consent-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #ccc;
  cursor: pointer;
  margin-bottom: 16px;
}

#consent-check {
  accent-color: #16a34a;
}

#consent-ok {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 32px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

#consent-ok:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* Bell hint toast */
#bell-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: rgba(20, 20, 20, 0.9);
  color: #e0e0e0;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #444;
  pointer-events: none;
  opacity: 0;
  direction: rtl;
  white-space: nowrap;
}
#bell-hint.show {
  animation: bellHintFade 2.5s ease forwards;
}
#bell-hint.show-long {
  animation: bellHintFade 8s ease forwards;
  pointer-events: auto;
}
@keyframes bellHintFade {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Debug: red outlines around main containers */
.debug #aoi-panel { outline: 1px solid red; }
.debug #map { outline: 1px solid red; }
.debug #feed-drawer { outline: 1px solid red; }
