@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

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

:root {
  --text: #d8dfe8;
  --text-secondary: #8a99b0;
  --text-tertiary: #546070;
  --bg: #0b0f18;
  --bg-alt: #111826;
  --bg-card: #131c2b;
  --bg-dark: #080c13;
  --border: #1e2a3a;
  --border-light: #253345;
  --accent: #4a8fd4;
  --accent-light: #6aaee8;
  --accent-dim: #2a5a8a;
  --link: #6aaee8;
  --tag-bg: #0d1a2e;
  --tag-text: #5a9fd4;
  --sans: "Helvetica Neue", "Segoe UI", "Arial", sans-serif;
  --serif: "Charter", "Bitstream Charter", "Georgia", "Cambria", serif;
  --mono: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
}

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   NAV
   ============================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 24, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
nav .nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
nav .nav-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}
nav .nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
}
nav .nav-links a {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
nav .nav-links a:hover { color: var(--accent-light); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-secondary);
  transition: 0.3s;
}

.right-side {
  display: flex;
  flex-direction: row;
  gap: 15px;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 2.5rem 0; }
section + section { border-top: 1px solid var(--border); }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 0;
  border-bottom: none;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 50%, rgba(30, 60, 100, 0.18) 0%, transparent 65%);
}
.hero-layout {
  display: flex;
  align-items: center;
  min-height: 400px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1.5rem;
}
.hero-text {
  flex: 1;
  padding: 3rem 0;
  z-index: 2;
}
.hero-canvas-wrap {
  width: 380px;
  height: 380px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
#satellite-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  transition: filter 0.6s ease;
}
#satellite-canvas:active { cursor: grabbing; }
.hero-canvas-wrap:hover #satellite-canvas {
  filter: brightness(1.12) drop-shadow(0 0 10px rgba(74, 143, 212, 0.2));
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: #e8eef5;
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}
.hero .subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
}
.hero .affiliation {
  margin-top: 1.4rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--text-tertiary);
  line-height: 1.7;
}
.hero .affiliation span {
  display: inline-block;
  margin-right: 0.6rem;
}
.hero .affiliation span:not(:last-of-type)::after {
  content: "/";
  margin-left: 0.6rem;
  color: var(--border-light);
}

.hero .tags span {
  font-family: var(--mono);
  font-size: 0.62rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

/* ============================================
   HEADINGS & TEXT
   ============================================ */
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}
h2 .section-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-right: 0.5rem;
  font-weight: 400;
}
h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
p { margin-bottom: 0.75rem; font-size: 0.92rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--link); }
a:hover { text-decoration: underline; }

.lead-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 750px;
  line-height: 1.6;
}

#context .lead-text,
#architecture .arch-description {
  margin-left: 1.35rem;
}

#context .lead-text,
#architecture .architecture-caption {
  max-width: none;
}

/* ============================================
   ARCHITECTURE
   ============================================ */

#architecture .architecture-figure {
  margin: 1.5rem 0 2.5rem;
}

#architecture img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
  margin: 1.5rem 0;
  cursor: zoom-in;
  transition: opacity 0.2s;
}
#architecture img:hover {
  opacity: 0.85;
}

#architecture .architecture-figure img {
  margin: 0;
}

#architecture .architecture-caption {
  display: block;
  margin: 0.75rem 1.35rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

#architecture .arch-details {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 15, 24, 0.95);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s ease;
}

.modal.show {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 25px;
  right: 35px;
  color: var(--text-secondary);
  font-size: 40px;
  font-family: var(--sans);
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1001;
}

.modal-close:hover {
  color: var(--accent-light);
}

/* ============================================
   APP SHOWCASE (COMPOSE MOCKUP)
   ============================================ */
.phone-wrapper { display: flex; justify-content: center; flex: 1; }

.phone-frame {
  width: 300px;
  height: 620px;
  background: #000;
  border: 10px solid #1e2a3a;
  border-radius: 40px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), inset 0 0 0 2px #4a8fd4;
  overflow: hidden;
  font-family: var(--sans);
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 25px;
  background: #1e2a3a;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 20;
}

.app-screen {
  width: 100%;
  height: 100%;
  background: #141c28; /* Fundo base da App */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Status Bar */
.app-status-bar {
  height: 35px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px 8px;
  font-size: 0.7rem;
  color: white;
  z-index: 10;
}
.status-icons { display: flex; gap: 4px; align-items: center; }

/* Top Bar */
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #192434;
  border-bottom: 1px solid #233144;
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease, border-color 0.35s ease;
}
.app-user-info { display: flex; align-items: center; gap: 10px; }
.app-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #e0e0e0; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; /* Garante que o avatar nunca encolhe no flexbox! */
}
.app-user-text { display: flex; flex-direction: column; }
.app-role { font-size: 0.55rem; color: #8a99b0; letter-spacing: 0.05em; }
.app-name { font-size: 0.9rem; color: white; }

.app-top-actions { display: flex; gap: 8px; position: relative; }
.app-top-btn {
  background: #253347; border: none; border-radius: 6px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: #8a99b0; cursor: pointer;
}
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #00E5A0; transition: background 0.2s; }
.status-dot.offline { background: #666; }

/* Status Dropdown */
.status-dropdown {
  position: absolute;
  top: 91px;   /* abaixo do topbar; ajustado via JS */
  right: 12px;
  background: #1a2638;
  border: 1px solid #2e4260;
  border-radius: 10px;
  overflow: hidden;
  z-index: 50;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: dropdownFadeIn 0.15s ease;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.78rem;
  color: #c8d4e4;
  font-family: var(--sans);
  transition: background 0.12s;
}
.status-option:hover { background: #253347; }
.status-option.active { background: #1e3050; color: white; }
.status-opt-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* Esconder topbar quando conversa está aberta */
.app-screen.chat-open .app-topbar {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

/* Views Container */
.app-views { flex: 1; position: relative; }
.app-view {
  position: absolute; inset: 0;
  padding: 15px;
  display: flex; flex-direction: column; gap: 12px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  overflow-y: auto;
}
.app-view.active { opacity: 1; pointer-events: auto; }

/* Components (Cards) */
.app-section-title { font-size: 0.75rem; font-weight: bold; color: #4aa0d4; margin-bottom: 4px; text-transform: uppercase; }
.app-card { background: #1e2b3e; border-radius: 8px; padding: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.app-card-row { display: flex; align-items: center; gap: 12px; }
.card-indicator { width: 3px; height: 30px; background: #666; border-radius: 2px; }
.card-indicator.active { background: #00d28a; }
.card-text { flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 0.9rem; color: white; }
.card-sub { font-size: 0.75rem; color: #8a99b0; }
.card-icons { display: flex; align-items: center; gap: 10px; }

/* Map View */
#view-map { padding: 0; }
.map-mockup {
  width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="%23d6d6d6"/><path d="M10,10 L90,30 L70,80 L20,90 Z" fill="%23ececec" stroke="%23ffffff" stroke-width="2"/></svg>') center/cover;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.map-marker { display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3)); }
.marker-label { background: white; padding: 2px 6px; border-radius: 4px; font-size: 0.65rem; color: black; font-weight: bold; margin-top: -5px; }


/* ============================================
   PTT VIEW & BUTTON LOGIC
   ============================================ */
.ptt-layout { align-items: center; padding-top: 40px; }
.ptt-channel-label { font-size: 0.7rem; color: #4aa0d4; letter-spacing: 0.1em; margin-bottom: 20px; }

/* Dropdown Funcional */
.ptt-dropdown-container { 
  background: #1e2b3e; 
  border: 1px solid #4a8fd4; 
  width: 100%; 
  padding: 8px 15px; 
  border-radius: 8px; 
  margin-bottom: 50px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.ptt-select {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  font-family: var(--sans);
  font-weight: 600;
  outline: none;
  margin-top: 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}
.ptt-select option { background: #1e2b3e; color: white; }

.ptt-dropdown-container::after {
  content: '▾';
  color: white;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-20%);
  pointer-events: none;
}

/* Botão Base */
.ptt-btn-wrapper { position: relative; display: inline-block; }
.ptt-big-btn {
  width: 160px; height: 160px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: white; font-weight: bold; transition: all 0.2s ease;
}

/* Estado 1: Inativo */
.ptt-big-btn.inactive {
  background: #2a3545;
  border: 6px solid #3b4e68;
  cursor: not-allowed;
  color: #8a99b0;
}
.ptt-big-btn.inactive i { color: #8a99b0 !important; }

/* Estado 2: Pronto */
.ptt-big-btn.ready {
  background: #00d28a;
  border: 6px solid #00ffa6;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 210, 138, 0.3);
}
.ptt-big-btn.ready i { color: white !important; }

/* Estado 3: A Pressionar */
.ptt-big-btn.ready:active { 
  background: #ff5252; 
  border-color: #ff8a80; 
  transform: scale(0.95); 
  box-shadow: 0 0 30px rgba(255, 82, 82, 0.6);
}

/* Bottom Nav */
.app-bottom-nav {
  position: absolute; bottom: 15px; left: 15px; right: 15px;
  background: #1d2a3d; border-radius: 25px;
  display: flex; justify-content: space-around; padding: 10px 5px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  z-index: 10;
}
.nav-icon {
  background: transparent; border: none; color: #8a99b0;
  width: 45px; height: 45px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.2s;
}
.nav-icon.active { background: #2f4562; color: white; }

/* ============================================
   APP SHOWCASE - SETTINGS & MESSAGES
   ============================================ */

/* --- Settings Classes --- */
.settings-header {
  font-size: 0.6rem;
  color: #6ea1d4;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
}
.settings-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}
.settings-row.mt-3 { margin-top: 16px; } /* Maior espaçamento para segundas linhas */
.settings-text-col {
  display: flex;
  flex-direction: column;
}
.settings-label {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #8a99b0;
  text-transform: uppercase;
}
.settings-val {
  font-family: var(--mono);
  font-size: 0.95rem;
  margin-top: 2px;
  color: white;
}
.settings-val.success { color: #52ff61; }

/* --- Messages Classes --- */
.msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.msg-time {
  font-size: 0.65rem;
  color: #8a99b0;
}
.msg-preview {
  font-size: 0.75rem;
  color: #8a99b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px; /* Evita que o texto saia do cartão */
}
.msg-unread {
  width: 8px;
  height: 8px;
  background: #4a8fd4;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ============================================
   APP SHOWCASE - CHAT DETAILS
   ============================================ */
.clickable-card {
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.clickable-card:active {
  transform: scale(0.98);
  background: #253347;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.4;
}
.chat-bubble.received {
  background: #1e2b3e;
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
}
.chat-bubble.sent {
  background: #2a5a8a; /* Azul característico da app */
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
}
.chat-time {
  font-size: 0.6rem;
  color: #a0aabf;
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   DISPATCHER WEB UI MOCKUP
   ============================================ */
.dispatcher-showcase-layout {
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) minmax(0, 2.4fr);
  gap: 2rem;
  align-items: center;
}

.dispatcher-copy .lead-text {
  max-width: 360px;
}

.dispatcher-shell {
  position: relative;
  min-height: 980px;
  background: #0b0f18;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.36);
  font-family: var(--sans);
  font-size: 0.9rem;
  zoom: 0.72;
}

.dispatcher-header {
  height: 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.85rem;
  background: rgba(8, 12, 19, 0.95);
  border-bottom: 1px solid var(--border);
}

.dispatcher-brand {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-light);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dispatcher-clock {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dispatcher-actions {
  display: flex;
  justify-content: flex-end;
}

.dispatcher-header-btn,
.dispatcher-control-btn,
.dispatcher-detail-close {
  font-family: var(--mono);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dispatcher-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0 0.55rem;
  border-radius: 5px;
  font-size: 0.58rem;
}

.dispatcher-header-btn:hover,
.dispatcher-control-btn:not(:disabled):hover,
.dispatcher-detail-close:hover {
  color: var(--text);
  border-color: var(--accent-dim);
  background: var(--bg-alt);
}

.dispatcher-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  height: calc(100% - 42px);
  min-height: 938px;
}

.dispatcher-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--border);
  background: #0d1420;
  min-width: 0;
}

.dispatcher-directory-block {
  min-height: 0;
  padding: 0.55rem;
  overflow: auto;
  scrollbar-color: rgba(74, 143, 212, 0.45) transparent;
  scrollbar-width: thin;
}

.dispatcher-directory-block + .dispatcher-directory-block {
  border-top: 1px solid var(--border);
}

.dispatcher-directory-block::-webkit-scrollbar {
  width: 6px;
}

.dispatcher-directory-block::-webkit-scrollbar-track {
  background: transparent;
}

.dispatcher-directory-block::-webkit-scrollbar-thumb {
  background: rgba(74, 143, 212, 0.42);
  border-radius: 999px;
}

.dispatcher-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dispatcher-badge {
  min-width: 1.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--accent-light);
  text-align: center;
}

.dispatcher-user-card,
.dispatcher-group-card,
.dispatcher-video-card,
.dispatcher-marker {
  font-family: var(--sans);
  border: 1px solid var(--border);
  color: inherit;
  background: var(--bg-card);
  cursor: pointer;
}

.dispatcher-user-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 43px;
  margin-bottom: 0.34rem;
  padding: 0.36rem 0.45rem;
  border-radius: 6px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.dispatcher-user-card:hover,
.dispatcher-group-card:hover {
  border-color: var(--accent-dim);
  background: #162235;
}

.dispatcher-shell[data-edit-mode="on"] .dispatcher-user-card,
.dispatcher-shell[data-edit-mode="on"] .dispatcher-group-card {
  border-style: dashed;
}

.dispatcher-shell[data-edit-mode="on"] .dispatcher-user-card {
  cursor: grab;
}

.dispatcher-shell[data-edit-mode="on"] .dispatcher-user-card:active {
  cursor: grabbing;
}

.dispatcher-user-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.dispatcher-group-card.is-drop-target {
  border-color: var(--accent-light);
  background: rgba(74, 143, 212, 0.12);
}

.dispatcher-group-card.is-pending {
  border-color: #c8922a;
}

.dispatcher-avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dispatcher-avatar-drone {
  background: #4a8fd4;
  clip-path: polygon(50% 0%, 92% 26%, 92% 74%, 50% 100%, 8% 74%, 8% 26%);
  border-radius: 0;
}

.dispatcher-avatar-rover {
  background: #c8922a;
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.dispatcher-user-main,
.dispatcher-user-tools,
.dispatcher-group-card,
.dispatcher-member-row,
.dispatcher-video-card,
.dispatcher-video-empty,
.dispatcher-detail-header,
.dispatcher-detail-body {
  min-width: 0;
}

.dispatcher-user-main {
  display: flex;
  flex-direction: column;
}

.dispatcher-user-name,
.dispatcher-group-title,
.dispatcher-video-name {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-user-role,
.dispatcher-group-meta,
.dispatcher-video-state {
  color: var(--text-secondary);
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-user-tools {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.dispatcher-location-icon {
  color: var(--accent-light);
  font-size: 0.78rem;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.dispatcher-location-icon:hover {
  color: var(--text);
}

.dispatcher-camera-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 92, 92, 0.55);
  border-radius: 5px;
  background: rgba(255, 92, 92, 0.12);
  color: #ff5c5c;
  animation: dispatcher-camera-pulse 1.4s ease-in-out infinite;
}

@keyframes dispatcher-camera-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.58; }
}

.dispatcher-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.dispatcher-status-dot.is-ready { background: #00e5a0; }
.dispatcher-status-dot.is-waiting { background: #f5c518; }
.dispatcher-status-dot.is-preparing { background: #00d4ff; }
.dispatcher-status-dot.is-emergency { background: #ff5c5c; }

.dispatcher-group-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  padding: 0.58rem;
  border-radius: 6px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dispatcher-member-row {
  display: flex;
  gap: 0.24rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.dispatcher-member-pill {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  background: var(--accent-dim);
  border: 0;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.dispatcher-member-pill:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.12);
}

.dispatcher-member-responder {
  border-radius: 50%;
  background: #2e8b57;
}

.dispatcher-member-drone {
  border-radius: 0;
  background: #4a8fd4;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.dispatcher-member-rover {
  border-radius: 0;
  background: #c8922a;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.dispatcher-panel-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.dispatcher-control-btn {
  min-height: 32px;
  border-radius: 5px;
  font-size: 0.6rem;
  opacity: 0.42;
  cursor: not-allowed;
}

.dispatcher-shell[data-edit-mode="on"] .dispatcher-control-btn {
  opacity: 1;
  cursor: pointer;
}

.dispatcher-save-btn:not(:disabled) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-light);
}

.dispatcher-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-dark);
}

.dispatcher-mode-switcher {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.dispatcher-mode-switcher::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 2px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.22s ease;
}

.dispatcher-mode-switcher[data-active-mode="video"]::after {
  transform: translateX(100%);
}

.dispatcher-mode-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.dispatcher-mode-tab.active {
  color: var(--accent-light);
}

.dispatcher-mode-content {
  flex: 1;
  position: relative;
  min-height: 0;
}

.dispatcher-mode-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.dispatcher-mode-panel.active {
  opacity: 1;
  pointer-events: auto;
}

.dispatcher-map {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(106, 174, 232, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(106, 174, 232, 0.05) 1px, transparent 1px),
    linear-gradient(145deg, #111826 0%, #182130 48%, #0c111b 100%);
  background-size: 46px 46px, 46px 46px, cover;
}

.dispatcher-map::before,
.dispatcher-map::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(106, 174, 232, 0.18);
  transform: rotate(-18deg);
  pointer-events: none;
}

.dispatcher-map::before {
  width: 72%;
  height: 104px;
  left: 10%;
  top: 32%;
}

.dispatcher-map::after {
  width: 50%;
  height: 76px;
  right: 8%;
  bottom: 18%;
}

.dispatcher-map-toolbar {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dispatcher-map-chip {
  font-family: var(--mono);
  font-size: 0.56rem;
  color: var(--text-secondary);
  background: rgba(19, 28, 43, 0.88);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
}

.dispatcher-map-chip.active {
  color: var(--accent-light);
  border-color: var(--accent-dim);
}

.dispatcher-marker {
  position: absolute;
  z-index: 2;
  width: 52px;
  min-height: 58px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  transform: translate(-50%, -50%);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dispatcher-marker:hover,
.dispatcher-marker.is-focused {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: none;
}

.dispatcher-unit-shape {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e3e3e3;
  background: var(--bg-card);
  border: 3px solid var(--status-color, #00E5A0);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
}

.dispatcher-unit-shape svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.dispatcher-unit-responder {
  border-radius: 50%;
  background: #2e8b57;
}

.dispatcher-unit-drone {
  border-radius: 0;
  background: #4a8fd4;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.dispatcher-unit-rover {
  border-radius: 0;
  background: #c8922a;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.dispatcher-marker-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(0, 229, 160, 0.62);
  border-radius: inherit;
  opacity: 0;
}

.dispatcher-marker.is-focused .dispatcher-marker-pulse {
  animation: dispatcher-marker-pulse 1.2s ease-out infinite;
}

@keyframes dispatcher-marker-pulse {
  0% { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.55); }
}

.dispatcher-marker-label {
  max-width: 110px;
  padding: 0.16rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(19, 28, 43, 0.94);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.56rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-detail-kicker {
  font-family: var(--mono);
  font-size: 0.52rem;
  color: var(--accent-light);
  letter-spacing: 0.06em;
}

.dispatcher-video-wall {
  height: 100%;
  padding: 0.75rem;
  background: #080c13;
}

.dispatcher-video-wall.grid-stack {
  background: #080c13;
}

.dispatcher-video-wall .grid-stack-item-content {
  inset: 0 !important;
}

.dispatcher-video-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  min-height: 180px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  text-align: left;
  background: #000;
  cursor: move;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dispatcher-video-card:hover,
.dispatcher-video-card.is-active {
  transform: none;
}

.dispatcher-video-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
  filter: none;
}

.dispatcher-video-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.65rem;
  padding: 1.5rem 0.65rem 0.55rem;
  background: linear-gradient(transparent, rgba(8, 12, 19, 0.9));
  pointer-events: none;
}

.dispatcher-video-overlay-name {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.dispatcher-video-overlay-imsi,
.dispatcher-video-overlay-time {
  color: var(--text-tertiary);
}

.dispatcher-video-overlay-time {
  font-family: var(--mono);
  font-size: 0.58rem;
  white-space: nowrap;
}

.dispatcher-video-online-indicator {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a9e6e;
}

.dispatcher-video-wall > .grid-stack-placeholder > .placeholder-content {
  background: rgba(74, 143, 212, 0.18);
  border: 2px dashed var(--accent);
  border-radius: 3px;
  inset: 0;
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}

.dispatcher-video-wall .grid-stack-item.ui-draggable-dragging {
  opacity: 0.85;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--accent);
}

.dispatcher-detail-panel[hidden] {
  display: none !important;
}

.dispatcher-detail-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(2px);
}

.dispatcher-detail-card {
  width: min(720px, 100%);
  max-height: calc(100% - 1rem);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(13, 20, 32, 0.98);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dispatcher-detail-body {
  flex: 1 1 auto;
}

.dispatcher-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dispatcher-detail-header strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.2;
}

.dispatcher-detail-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  flex-shrink: 0;
}

.dispatcher-detail-body {
  display: block;
  padding: 0;
  overflow-y: auto;
}

.dispatcher-info-list {
  display: block;
  padding: 0.4rem 1rem 0.6rem;
}

.dispatcher-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.dispatcher-info-row:last-child {
  border-bottom: none;
}

.dispatcher-info-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.dispatcher-info-value {
  color: #fff;
  font-size: 0.85rem;
  text-align: right;
}

.dispatcher-members-header {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 0.75rem 1rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dispatcher-members-list {
  display: block;
  padding: 0 1rem 1rem;
}

.dispatcher-members-list > .dispatcher-popup-member + .dispatcher-popup-member {
  margin-top: 0.4rem;
}

.dispatcher-popup-member {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(70px, 1fr)) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.dispatcher-popup-member-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.dispatcher-popup-member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.dispatcher-popup-member-name {
  min-width: 0;
}

.dispatcher-popup-member-name strong {
  display: block;
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-popup-member-name span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-popup-member-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dispatcher-popup-meta-label {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dispatcher-popup-meta-value {
  font-size: 0.74rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatcher-popup-member-remove {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.7rem;
  border: 1px solid #c84040;
  background: transparent;
  color: #ff7a7a;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dispatcher-popup-member-remove:hover {
  background: #c84040;
  color: #fff;
}

.dispatcher-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.dispatcher-detail-row strong {
  color: var(--text);
  text-align: right;
}

.dispatcher-toast {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 30;
  max-width: calc(100% - 1.6rem);
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(0, 229, 160, 0.36);
  border-radius: 6px;
  background: rgba(19, 61, 46, 0.96);
  color: #dffcef;
  font-family: var(--sans);
  font-size: 0.72rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dispatcher-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dispatcher-showcase-layout {
  grid-template-columns: minmax(180px, 0.28fr) minmax(600px, 1.1fr);
  gap: 1.8rem;
}

.dispatcher-shell {
  height: 820px;
  min-height: 820px;
  background: #060b13;
  border-color: #273447;
  border-radius: 10px;
  font-size: 0.82rem;
}

.dispatcher-header {
  height: 34px;
  background: #050a12;
  border-bottom-color: #1d293a;
}

.dispatcher-workspace {
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 786px;
  height: calc(100% - 34px);
  overflow: hidden;
}

.dispatcher-sidebar {
  background: #101827;
  grid-template-rows: minmax(0, var(--dispatcher-users-fr, 1fr)) 6px minmax(0, var(--dispatcher-groups-fr, 0.88fr));
  min-height: 0;
  overflow: hidden;
}

.dispatcher-sidebar-resizer {
  position: relative;
  background: var(--border);
  cursor: ns-resize;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
  touch-action: none;
}

.dispatcher-sidebar-resizer:hover,
.dispatcher-sidebar-resizer.is-dragging {
  background: var(--accent-dim);
}

.dispatcher-sidebar-resizer::after {
  content: '';
  position: absolute;
  inset: -4px 0;
  /* expand hit-area without growing the visual bar */
}

.dispatcher-directory-block {
  padding: 0.5rem 0.45rem;
}

.dispatcher-list {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.dispatcher-section-header {
  justify-content: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.dispatcher-section-header .dispatcher-badge {
  margin-left: auto;
}

.dispatcher-add-btn {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--accent-light);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.dispatcher-add-btn:hover {
  color: #b7dcff;
}

.dispatcher-user-card,
.dispatcher-group-card {
  background: #121c2c;
  border-color: #26364b;
  border-radius: 5px;
}

.dispatcher-user-card {
  min-height: 40px;
  padding: 0.28rem 0.36rem;
}

.dispatcher-user-card:hover,
.dispatcher-group-card:hover {
  background: #162235;
  border-color: #2f6ca7;
}

.dispatcher-avatar,
.dispatcher-avatar-drone,
.dispatcher-avatar-rover,
.dispatcher-member-pill,
.dispatcher-member-drone,
.dispatcher-member-rover,
.dispatcher-unit-drone,
.dispatcher-unit-rover {
  border-radius: 50%;
  clip-path: none;
}

.dispatcher-user-name small {
  color: var(--text-secondary);
  font-size: 0.56rem;
  font-weight: 600;
}

.dispatcher-user-delete-btn {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #ff5c5c;
  font-size: 0.68rem;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.dispatcher-user-card:hover .dispatcher-user-delete-btn,
.dispatcher-shell[data-edit-mode="on"] .dispatcher-user-delete-btn {
  opacity: 1;
  pointer-events: auto;
}

.dispatcher-user-delete-btn:hover {
  color: #ff8b8b;
}

.dispatcher-status-dot.is-offline {
  background: #9aa4b2;
}

.dispatcher-panel-controls {
  position: sticky;
  bottom: 0;
  padding-top: 0.55rem;
  background: linear-gradient(transparent, #101827 18%);
}

.dispatcher-mode-switcher {
  background: #111a2a;
}

.dispatcher-map {
  background: #1b1f24;
}

.dispatcher-map::before,
.dispatcher-map::after {
  display: none;
}

.dispatcher-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #1b1f24;
}

.dispatcher-map .leaflet-container {
  font-family: var(--mono);
  background: #1b1f24;
}

.dispatcher-map .leaflet-tile {
  filter: grayscale(1) invert(1) brightness(0.76) contrast(1.2) saturate(0.2);
  opacity: 0.92;
}

.dispatcher-map .leaflet-control-zoom {
  border: 0;
  margin: 12px 0 0 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.dispatcher-map .leaflet-control-zoom a {
  width: 30px;
  height: 30px;
  border: 1px solid #26364b;
  border-bottom: 0;
  background: #111a2a;
  color: var(--text);
  line-height: 28px;
}

.dispatcher-map .leaflet-control-zoom a:last-child {
  border-bottom: 1px solid #26364b;
}

.dispatcher-map .leaflet-control-zoom a:hover {
  background: #19263a;
  color: var(--accent-light);
}

.dispatcher-map-filters {
  position: absolute;
  top: 22px;
  right: 12px;
  z-index: 4;
  width: min(170px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid #26364b;
  border-radius: 3px;
  background: rgba(17, 26, 42, 0.93);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.dispatcher-filter-title {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}

.dispatcher-map-filters label {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 0.58rem;
  line-height: 1.25;
}

.dispatcher-map-filters input {
  width: 11px;
  height: 11px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.dispatcher-leaflet-icon-shell {
  border: 0;
  background: transparent;
}

.dispatcher-leaflet-marker {
  width: 88px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text);
  transform: translateY(0);
  transition: transform 0.16s ease;
}

.dispatcher-leaflet-marker:hover,
.dispatcher-leaflet-marker.is-focused {
  transform: translateY(-2px);
}

.dispatcher-map-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--marker-color, #00e5a0);
  border-radius: 50%;
  background: #121c2c;
  color: #eef6ff;
  font-size: 1rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.48);
}

.dispatcher-leaflet-marker.is-focused .dispatcher-map-avatar::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid rgba(74, 143, 212, 0.55);
  border-radius: 50%;
  animation: dispatcher-marker-pulse 1.2s ease-out infinite;
}

.dispatcher-leaflet-marker .dispatcher-marker-label {
  max-width: 88px;
  padding: 0.12rem 0.32rem;
  border-radius: 2px;
  background: rgba(8, 12, 19, 0.92);
  border-color: #26364b;
  font-size: 0.54rem;
  line-height: 1.3;
}

.dispatcher-detail-members {
  display: grid;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.dispatcher-detail-members > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.dispatcher-empty-copy {
  color: var(--text-tertiary);
  font-size: 0.66rem;
}

.dispatcher-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.dispatcher-modal-overlay[hidden] {
  display: none;
}

.dispatcher-modal-card {
  width: min(430px, 100%);
  max-height: calc(100% - 2rem);
  overflow: auto;
  border: 1px solid #26364b;
  border-radius: 6px;
  background: #111a2a;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.55);
}

.dispatcher-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid #26364b;
}

.dispatcher-modal-title {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dispatcher-modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.dispatcher-modal-close:hover {
  color: var(--text);
}

.dispatcher-modal-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.dispatcher-modal-body label {
  display: grid;
  gap: 0.26rem;
}

.dispatcher-modal-body label span {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dispatcher-modal-body label strong {
  color: #ff5c5c;
}

.dispatcher-modal-body input,
.dispatcher-modal-body select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #26364b;
  border-radius: 4px;
  background: #111827;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.72rem;
  padding: 0 0.55rem;
  outline: 0;
}

.dispatcher-modal-body input:focus,
.dispatcher-modal-body select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 143, 212, 0.18);
}

.dispatcher-modal-submit {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: #4a90d9;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.dispatcher-modal-submit:hover {
  background: #5aa2eb;
}

/* ============================================
   FEATURES & VIDEO DEMO LAYOUT
   ============================================ */
.features-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.features-stage {
  display: flex;
  gap: 2rem;
  align-items: stretch;
}

.features-video-col {
  flex: 1.95;
  display: flex;
  min-width: 0;
}

.features-video-col video {
  width: 100%;
  height: auto;
  align-self: flex-start;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.feature-cell {
  position: relative;
  background: var(--bg-card);
  padding: 0.95rem 1.1rem;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.feature-cell:hover {
  background: var(--bg-alt);
}

.feature-cell-detail {
  display: none;
}

.feature-cell.is-highlighted {
  background: var(--bg-alt);
  border-color: var(--accent-light);
  box-shadow: 0 0 24px rgba(74, 143, 212, 0.28);
  transform: translateY(-3px);
  z-index: 2;
}

/* ===== Detail panel (right of the video, inside .features-stage) ===== */
.features-detail-panel {
  flex: 1;
  min-width: 0;
  padding: 1.6rem 1.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.features-detail-panel[data-state="active"] {
  border-color: var(--accent-dim);
  background: var(--bg-alt);
}

.features-detail-panel[data-state="idle"] .features-detail-content { display: none; }
.features-detail-panel[data-state="active"] .features-detail-empty { display: none; }

.features-detail-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.features-detail-empty-tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.features-detail-empty p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  max-width: 38ch;
}

.features-detail-content {
  display: flex;
  flex-direction: column;
}

.features-detail-content .feature-tag {
  margin-bottom: 0.5rem;
}

.features-detail-content h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.features-detail-long {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.features-detail-long strong {
  color: var(--accent-light);
  font-weight: 600;
}

.features-detail-long em {
  color: var(--text);
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.feature-tag {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}

.feature-cell h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.feature-cell p {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .features-stage {
    flex-direction: column;
  }
  .features-video-col {
    width: 100%;
  }
  .features-detail-panel {
    width: 100%;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   RESULTS TABLE
   ============================================ */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.85rem;
}
.results-table th {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--border-light);
}
.results-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table .metric-val {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent-light);
  font-size: 0.82rem;
}

/* ============================================
   TEAM
   ============================================ */
.team-section-group { margin-bottom: 1.8rem; }
.team-section-group:last-child { margin-bottom: 0; }
.team-section-group h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.15s;
}
.team-card:hover { border-color: var(--border-light); }
.team-card .name {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.team-card .role {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.1rem;
}
.team-card .work {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}
.team-card .nmec {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-tertiary);
  margin-top: 0.15rem;
}
.team-card .email {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--link);
  text-decoration: none;
  margin-top: 0.15rem;
  display: inline-block;
}

/* ============================================
   DEMO SECTION
   ============================================ */
.demo-layout {
  display: flex;
  gap: 2.5rem;
  margin-top: 1.5rem;
  align-items: flex-start;
}

.demo-video-wrap {
  flex: 1.4;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.demo-video-wrap video {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.demo-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.demo-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.demo-step.is-highlighted {
  opacity: 1;
  border-color: var(--accent-light);
  box-shadow: 0 0 15px rgba(74, 143, 212, 0.25);
  transform: translateX(4px);
}

.demo-time-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent-light);
  background: var(--tag-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .demo-layout {
    flex-direction: column;
  }
}

/* ============================================
   RESOURCES
   ============================================ */
.resource-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.resource-link {
  font-family: var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--link);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.resource-link:hover {
  border-color: var(--accent-dim);
  background: var(--bg-alt);
  text-decoration: none;
}
.resource-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 0;
  margin-top: 0.5rem;
}
footer .footer-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  line-height: 1.7;
}
footer .footer-inner a { color: var(--text-tertiary); }
footer .footer-inner a:hover { color: var(--text-secondary); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-layout {
    flex-direction: column-reverse;
    align-items: center;
    min-height: auto;
  }
  .hero-text { padding: 1.5rem 0 2rem; }
  .hero-canvas-wrap {
    width: 300px;
    height: 300px;
    margin-top: 1.5rem;
  }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .dispatcher-showcase-layout {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .dispatcher-copy .lead-text {
    max-width: none;
  }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.3rem; }
  .features-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  #context .lead-text,
  #architecture .arch-description {
    margin-left: 0;
  }
  #architecture .architecture-caption {
    margin-left: 0;
    margin-right: 0;
  }
  nav .nav-links { gap: 0.7rem; }
  nav .nav-links a { font-size: 0.7rem; }
  .hero-canvas-wrap {
    width: 240px;
    height: 240px;
  }
  .resource-links { flex-direction: column; }
  .dispatcher-shell {
    height: auto;
    min-height: 0;
  }
  .dispatcher-header {
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 48px;
    row-gap: 0.2rem;
    padding: 0.45rem 0.65rem;
  }
  .dispatcher-clock {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }
  .dispatcher-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .dispatcher-sidebar {
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .dispatcher-directory-block {
    max-height: none;
  }
  .dispatcher-main {
    min-height: 430px;
  }
  .dispatcher-mode-content {
    min-height: 392px;
  }
  .dispatcher-video-wall {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .dispatcher-detail-panel {
    padding: 0.5rem;
  }
  .dispatcher-detail-card {
    width: 100%;
  }
  .dispatcher-popup-member {
    grid-template-columns: 1fr;
  }
  .dispatcher-popup-member-remove {
    justify-self: end;
  }
  .dispatcher-map-toolbar {
    right: 0.5rem;
  }
  .dispatcher-map-chip {
    font-size: 0.52rem;
  }
}

/* =========================
   LANGUAGE SWITCH
   ========================= */

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 16px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-light);
  transition: 0.25s;
  border-radius: 20px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--accent-light);
  transition: 0.25s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--accent-dim);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

@media (max-width: 768px) {

  nav .nav-inner {
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }

  nav .nav-links {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 0.5rem 0;
  }

  nav .nav-links li {
    width: 100%;
  }

  nav .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
  }

  nav .nav-links.show {
    display: flex;
  }

  .lang-switch {
    margin-left: auto;
  }
}

/* ============================================
   APP SHOWCASE - STREAM VIEW
   ============================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

#stream-overlay, #stream-overlay-b2 {
    transition: opacity 0.35s ease;
}

#stream-mute-btn, #stream-mute-btn-b2 {
    transition: all 0.2s ease;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 6px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

#stream-mute-btn.inactive, #stream-mute-btn-b2.inactive {
    background: #2a3545;
    border-color: #3b4e68;
    color: #8a99b0;
    cursor: not-allowed;
}

#stream-mute-btn.ready, #stream-mute-btn-b2.ready {
    background: #00d28a;
    border-color: #00ffa6;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 210, 138, 0.3);
}

#stream-mute-btn.active-stream, #stream-mute-btn-b2.active-stream {
    background: #ff5252;
    border-color: #ff8a80;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.4);
}

#stream-mute-btn.ready:active,
#stream-mute-btn.active-stream:active,
#stream-mute-btn-b2.ready:active,
#stream-mute-btn-b2.active-stream:active {
    transform: scale(0.95);
}

#team-jose-oliveira,
#team-jose-oliveira * {
  cursor: default;
}

.cepo-drop {
  position: fixed;
  top: -2rem;
  font-family: var(--mono, monospace);
  font-weight: 700;
  color: #ff2b2b;
  text-shadow: 0 0 4px rgba(255, 43, 43, 0.55);
  pointer-events: none;
  user-select: none;
  z-index: 9999;
  animation-name: cepo-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes cepo-fall {
  from { transform: translateY(0); }
  to   { transform: translateY(110vh); }
}