/* RakshaX premium emergency intelligence styling */
:root {
    --rx-bg: #050b14;
    --rx-bg-strong: #0a1220;
    --rx-panel: rgba(10, 17, 28, 0.8);
    --rx-panel-strong: rgba(15, 22, 35, 0.96);
    --rx-panel-soft: rgba(17, 24, 39, 0.8);
    --rx-surface: rgba(15, 23, 42, 0.82);
    --rx-border: rgba(148, 163, 184, 0.16);
    --rx-border-strong: rgba(125, 211, 252, 0.28);
    --rx-blue: #67d4ff;
    --rx-blue-strong: #38bdf8;
    --rx-red: #ef4444;
    --rx-red-soft: rgba(239, 68, 68, 0.15);
    --rx-amber: #fbbf24;
    --rx-green: #34d399;
    --rx-text: #e2e8f0;
    --rx-text-soft: #94a3b8;
    --rx-shadow: 0 18px 50px rgba(2, 6, 23, 0.5);
    --rx-glow: 0 0 0 1px rgba(103, 212, 255, 0.16), 0 14px 30px rgba(14, 165, 233, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.12), transparent 20%),
        radial-gradient(circle at 85% 10%, rgba(94, 234, 212, 0.08), transparent 18%),
        radial-gradient(circle at 70% 90%, rgba(239, 68, 68, 0.06), transparent 20%),
        #050b14;
    color: var(--rx-text);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 2px solid rgba(103, 212, 255, 0.9);
    outline-offset: 2px;
}

.app-section {
    display: none;
    min-height: 100vh;
    padding-top: 5.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.app-section.active { display: block; opacity: 1; transform: translateY(0); }
.section-content { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.nav-link {
    position: relative;
    color: var(--rx-text-soft);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.nav-link:hover { color: var(--rx-text); background: rgba(15, 23, 42, 0.8); }
.nav-link.active {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(103, 212, 255, 0.24);
    color: #f8fbff;
    font-weight: 600;
    box-shadow: var(--rx-glow);
}

.rx-nav {
    background: rgba(5, 10, 18, 0.86);
    border-bottom: 1px solid var(--rx-border);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}
.rx-brand-mark {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.04));
    border: 1px solid rgba(103, 212, 255, 0.3);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.22);
    color: #dff9ff;
}

.rx-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(8, 15, 27, 0.9));
    border: 1px solid var(--rx-border);
    backdrop-filter: blur(14px);
    box-shadow: var(--rx-shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rx-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(103, 212, 255, 0), rgba(103, 212, 255, 0.38), rgba(103, 212, 255, 0));
    opacity: 0.8;
}
.rx-card:hover {
    transform: translateY(-1px);
    border-color: rgba(103, 212, 255, 0.2);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.56);
}

.rx-section-title { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.04em; }
.rx-chip {
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.8);
    color: var(--rx-text);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.rx-chip:hover { border-color: rgba(103, 212, 255, 0.18); transform: translateY(-1px); }

.rx-pulse { animation: rxPulse 1.8s infinite ease-in-out; }
@keyframes rxPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.rx-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
}
.rx-status-dot.live {
    background: var(--rx-green);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
}

/* command center composition */
.rx-command-shell { padding-top: 4.2rem; }
.rx-hero-shell {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 1.6rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        linear-gradient(135deg, rgba(8, 17, 28, 0.96), rgba(11, 20, 31, 0.82)),
        radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.12), transparent 24%),
        radial-gradient(circle at 80% 30%, rgba(239, 68, 68, 0.08), transparent 20%);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}
.rx-hero-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.2));
}
.rx-hero-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    align-items: stretch;
}
.rx-hero-copy {
    padding: 1rem 0.5rem 0.5rem;
}
.rx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--rx-blue);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.rx-subtitle {
    margin-top: 0.5rem;
    font-size: clamp(1.05rem, 2vw, 1.8rem);
    line-height: 1.2;
    letter-spacing: -0.04em;
    color: #e6f1ff;
    font-family: 'Space Grotesk', sans-serif;
    max-width: 630px;
}
.rx-hero-text {
    max-width: 46rem;
    margin-top: 0.9rem;
    color: var(--rx-text-soft);
    font-size: 1rem;
}
.rx-hero-status {
    position: relative;
    overflow: hidden;
    padding: 1rem 1rem 0.8rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(103, 212, 255, 0.16);
    background: linear-gradient(180deg, rgba(4, 8, 17, 0.78), rgba(9, 17, 28, 0.9));
}
.status-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--rx-text-soft);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.status-pill {
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.22);
    color: #b6f7d7;
    padding: 0.3rem 0.55rem;
}
.status-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.status-item {
    padding: 0.8rem 0.75rem;
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.12);
}
.status-item.wide { grid-column: 1 / -1; }
.status-kicker {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rx-text-soft);
}
.status-item strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.status-wave {
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0));
    border-top: 1px solid rgba(103, 212, 255, 0.12);
}

.rx-metrics-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.rx-metric-card {
    position: relative;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1.1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(8, 15, 27, 0.9));
    overflow: hidden;
}
.rx-metric-card::after {
    content: "";
    position: absolute;
    inset: auto -22px -22px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(103, 212, 255, 0.12), rgba(103, 212, 255, 0));
}
.rx-metric-card.critical::after { background: radial-gradient(circle, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0)); }
.rx-metric-card.warning::after { background: radial-gradient(circle, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0)); }
.metric-label {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rx-text-soft);
}
.metric-value {
    position: relative;
    z-index: 1;
    margin-top: 0.45rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.06em;
}
.rx-metric-card.critical .metric-value { color: #fca5a5; }
.rx-metric-card.warning .metric-value { color: #fcd34d; }

.rx-ops-surface {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) 320px;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}
.rx-map-shell {
    position: relative;
    min-height: 620px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(8, 15, 27, 0.96), rgba(11, 17, 29, 0.96));
    box-shadow: 0 22px 52px rgba(2, 6, 23, 0.52);
    overflow: hidden;
}
.rx-map-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(103, 212, 255, 0.08), transparent 26%, transparent 70%, rgba(103, 212, 255, 0.05));
    pointer-events: none;
    z-index: 600;
}
.rx-map-shell #map { min-height: 620px; width: 100%; height: 100%; }
.rx-map-overlay { position: absolute; z-index: 700; pointer-events: none; }
.rx-map-overlay > * { pointer-events: auto; }
.rx-map-top {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}
.rx-map-bottom { left: 1rem; bottom: 1rem; }
.rx-mini-panel {
    background: rgba(7, 13, 22, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.9rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.27);
}
.rx-mini-panel.compact {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    color: var(--rx-text);
    font-size: 0.76rem;
}
.mini-action {
    border-radius: 0.7rem;
    border: 1px solid rgba(103, 212, 255, 0.18);
    background: rgba(14, 165, 233, 0.08);
    color: #dffbff;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    padding: 0.45rem 0.65rem;
}
.mini-status {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
}
.mini-title {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: #e2e8f0;
}
.mini-subtitle { font-size: 0.62rem; color: var(--rx-text-soft); }
.mini-score { color: var(--rx-blue); font-weight: 700; }
.legend-panel { padding: 0.75rem 0.8rem; }
.legend-title { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--rx-text-soft); }
.legend-items {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--rx-text-soft);
}
.legend-items span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; }
.legend-dot.critical { background: #ef4444; }
.legend-dot.high { background: #fb923c; }
.legend-dot.medium { background: #fbbf24; }
.legend-dot.safe { background: #22c55e; }

.map-filter-panel {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    width: 210px;
    padding: 0.8rem 0.8rem 0.7rem;
    background: rgba(7, 13, 22, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.85rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.27);
    z-index: 700;
}
.panel-title {
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rx-text-soft);
    margin-bottom: 0.6rem;
}
.layer-list { display: grid; gap: 0.45rem; }
.layer-list label {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--rx-text);
    font-size: 0.72rem;
}

.rx-command-feed {
    max-height: 620px;
    overflow-y: auto;
    padding: 1rem 1rem 0.8rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 52px rgba(2, 6, 23, 0.42);
}
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.feed-kicker {
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rx-text-soft);
}
.feed-header h3 {
    margin-top: 0.2rem;
    font-size: 1.55rem;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.04em;
}
.feed-live {
    white-space: nowrap;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a7f3d0;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, 0.22);
    background: rgba(16, 185, 129, 0.08);
}
#rxEmergencyFeed { display: grid; gap: 0.7rem; }
.rx-alert-row {
    position: relative;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.76);
    padding: 0.8rem 0.9rem 0.8rem 0.95rem;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    animation: alert-in 0.35s ease;
    overflow: hidden;
}
.rx-alert-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ef4444, #f59e0b, #10b981);
}
.rx-alert-row:hover {
    transform: translateX(3px);
    background: rgba(30, 41, 59, 0.78);
    border-color: rgba(103, 212, 255, 0.14);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}
.feed-empty-shell { display: block; }
.empty-state-shell {
    display: grid;
    place-items: center;
    min-height: 220px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(10, 15, 24, 0.8));
    border-radius: 1rem;
    text-align: center;
    padding: 1.25rem;
}
.empty-state-shell .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 10px;
    letter-spacing: 0.16em;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.8);
    color: var(--rx-text-soft);
    text-transform: uppercase;
}
.empty-state-shell .status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--rx-green);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
    display: inline-block;
}
.empty-state-shell h4 {
    margin-top: 1rem;
    font-size: 1.2rem;
    letter-spacing: -0.04em;
    color: #eff6ff;
}
.empty-state-shell p {
    margin-top: 0.35rem;
    color: var(--rx-text-soft);
    max-width: 18rem;
}

.rx-intel-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.intel-module {
    padding: 1.1rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(8, 15, 27, 0.9));
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28);
}
.intel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.intel-label {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rx-text-soft);
}
.intel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.6rem;
    background: rgba(103, 212, 255, 0.08);
    border: 1px solid rgba(103, 212, 255, 0.18);
    color: #bfeeff;
}
.intel-badge.green { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.18); color: #baf7dc; }
.intel-badge.amber { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.18); color: #fde68a; }
.intel-summary {
    color: #eaf3ff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.intel-foot {
    margin-top: 0.4rem;
    color: var(--rx-text-soft);
    font-size: 0.72rem;
}
.area-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}
.score-ring {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 2px solid rgba(52, 211, 153, 0.35);
    background: radial-gradient(circle, rgba(52, 211, 153, 0.08), rgba(15, 23, 42, 0.9));
    color: #baf7dc;
    font-weight: 700;
}

.rx-action-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 0.5rem 0 0.2rem;
}
.action-dock-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    text-align: left;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(8, 15, 27, 0.96));
    color: #f8fbff;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.action-dock-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 212, 255, 0.2);
}
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.8rem;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(103, 212, 255, 0.08);
    border: 1px solid rgba(103, 212, 255, 0.18);
}
.action-dock-btn.route .action-icon { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.18); color: #bbf7d0; }
.action-dock-btn.share .action-icon { background: rgba(167, 139, 250, 0.08); border-color: rgba(167, 139, 250, 0.2); color: #ddd6fe; }
.action-dock-btn.sos {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.18), rgba(17, 16, 23, 0.9));
    border-color: rgba(239, 68, 68, 0.2);
}
.action-dock-btn.sos .action-icon {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
    color: #fecaca;
}
.action-dock-btn span:last-child {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: #edf6ff;
}

/* page layouts */
.report-workstation,
.route-workspace,
.response-grid,
.analytics-overview,
.analytics-grid {
    position: relative;
}
.report-header {
    margin-bottom: 1.2rem;
}
.panel-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rx-blue);
    margin-bottom: 0.35rem;
}
.panel-kicker.danger { color: #fca5a5; }
.section-subtext {
    margin-top: 0.4rem;
    color: var(--rx-text-soft);
}
.report-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem;
}
.route-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.2fr;
    gap: 1rem;
}
.process-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.process-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    background: rgba(103, 212, 255, 0.08);
    border: 1px solid rgba(103, 212, 255, 0.18);
    color: var(--rx-blue);
    font-size: 0.7rem;
    font-weight: 700;
}
.process-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.report-form-card,
.report-map-card,
.route-panel,
.route-map-panel,
.response-panel-card,
.response-sos-card,
.analytics-panel,
.unsafe-panel {
    padding: 1.1rem 1rem;
    border-radius: 1.25rem;
}
.field-label {
    display: block;
    color: var(--rx-text-soft);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.primary-submit,
.secondary-btn {
    border: 1px solid rgba(103, 212, 255, 0.2);
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.9));
    color: #ebf7ff;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.primary-submit:hover, .secondary-btn:hover { transform: translateY(-1px); }
.primary-submit.small { padding: 0.72rem 0.8rem; font-size: 0.78rem; }
.secondary-btn {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--rx-text);
}
.success-note {
    color: #a7f3d0;
    font-weight: 600;
    margin-top: 0.35rem;
}
.field-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--rx-text-soft);
    font-size: 0.75rem;
}
.map-surface {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    min-height: 320px;
    background: rgba(9, 16, 27, 0.9);
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}
.route-result-card {
    padding: 0.8rem 0.75rem;
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.16);
}
.stat-value {
    font-size: 1.7rem;
    letter-spacing: -0.05em;
    font-family: 'Space Grotesk', sans-serif;
    margin-top: 0.2rem;
}
.meta-line {
    margin-top: 0.8rem;
    color: var(--rx-text-soft);
    font-size: 0.76rem;
}
.inline-link {
    margin-top: 0.8rem;
    display: inline-block;
    color: var(--rx-blue);
    font-weight: 700;
}

.response-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.response-sos-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    background: linear-gradient(180deg, rgba(31, 10, 12, 0.84), rgba(9, 17, 28, 0.96));
}
.response-head { width: 100%; text-align: left; }
.sos-button {
    width: 10rem;
    height: 10rem;
    margin: 1.1rem 0 0.9rem;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.32);
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.9), rgba(127, 29, 29, 0.92));
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.32);
    animation: sos-breathe 2s ease-in-out infinite;
}
.response-copy { max-width: 21rem; color: var(--rx-text-soft); }
.response-panel-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.split-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.contacts-stack {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.4rem;
}
.top-gap { margin-top: 1rem; }
.wide-panel { grid-column: span 2; }
.fake-call-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.5rem;
}
.delay-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    color: var(--rx-text-soft);
    font-size: 0.8rem;
}
.delay-row label { display: inline-flex; align-items: center; gap: 0.4rem; }
.full-width { width: 100%; }
.response-link {
    margin-top: 0.9rem;
    color: var(--rx-text-soft);
    word-break: break-all;
    font-size: 0.7rem;
}

.analytics-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.analytics-stat {
    padding: 0.9rem 0.85rem;
    border-radius: 1rem;
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.unsafe-panel {
    margin-top: 0;
}

#sosModal .bg-slate-900,
#fakeCallModal .bg-slate-950,
#emergencyContactModal .bg-slate-900 {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(9, 16, 27, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 60px rgba(2, 6, 23, 0.65);
}
#fakeCallModal .w-20.h-20,
#fakeCallModal .rounded-full {
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#liveSharePanel {
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.45);
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sos-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2), 0 0 22px rgba(239, 68, 68, 0.18); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.34), 0 0 34px rgba(239, 68, 68, 0.28); }
}

.leaflet-container { background: #08131d; font: inherit; }
.leaflet-control-zoom {
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 0.8rem !important;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
}
.leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.92) !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}
.leaflet-popup-content-wrapper {
    border-radius: 0.9rem;
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
}
.leaflet-popup-tip { display: none; }

.route-safe { stroke: #34d399 !important; stroke-width: 5; }
.route-moderate { stroke: #fbbf24 !important; stroke-width: 5; }
.route-risky { stroke: #ef4444 !important; stroke-width: 5; }
.safe-zone-marker { font-size: 20px; text-align: center; }
.incident-marker { display: flex; align-items: center; justify-content: center; }
.incident-dot {
    width: 100%; height: 100%; border-radius: 9999px;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), 0 0 18px rgba(15, 23, 42, 0.8);
    transform-origin: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.severity-low { background: #facc15; border: 2px solid #fef3c7; }
.severity-medium { background: #fb923c; border: 2px solid #fdba74; }
.severity-high { background: #ef4444; border: 2px solid #fecaca; }
.incident-marker:hover .incident-dot {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), 0 0 26px rgba(251, 113, 133, 0.9);
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
.pulse-marker { animation: pulse 1.5s infinite; }
.shared-location-marker div { animation: pulse 1.5s infinite; }

#sosButton {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2), 0 0 28px rgba(239, 68, 68, 0.28);
    animation: sos-breathe 2s ease-in-out infinite;
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(8, 15, 27, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.26);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    color: var(--rx-text);
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 212, 255, 0.2);
    box-shadow: 0 18px 36px rgba(4, 10, 18, 0.32);
}
.quick-action-btn small { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--rx-text-soft); margin-bottom: 0.2rem; }
.quick-action-btn strong { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; letter-spacing: -0.03em; }
.quick-action-icon {
    width: 2.3rem; height: 2.3rem; border-radius: 0.8rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
    background: rgba(103, 212, 255, 0.08); border: 1px solid rgba(103, 212, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.quick-action-sos {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.18), rgba(17, 16, 23, 0.9));
    border-color: rgba(239, 68, 68, 0.18);
}
.quick-action-sos .quick-action-icon {
    background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.22); color: #fecaca;
}

.map-expanded { position: fixed !important; inset: 5.5rem 1rem 1rem 1rem !important; z-index: 1400 !important; max-height: calc(100vh - 6.5rem); min-height: 0 !important; }
#incidentDetailDrawer { background: rgba(2, 6, 23, 0.97); }
#incidentDetailDrawer.translate-x-0 { transform: translateX(0); }
#incidentDetailDrawer.translate-x-full { transform: translateX(100%); }
#commandPalette { background: rgba(2, 6, 23, 0.7); }
#commandPaletteList button { transition: background 0.15s ease, transform 0.15s ease; }
#commandPaletteList button:hover, #commandPaletteList button:focus { background: rgba(15, 23, 42, 0.9); transform: translateX(2px); }

@media (max-width: 1200px) {
    .rx-hero-panel, .rx-ops-surface, .report-layout, .route-layout, .analytics-grid { grid-template-columns: 1fr; }
    .rx-intel-strip { grid-template-columns: 1fr; }
    .rx-action-dock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .response-grid { grid-template-columns: 1fr; }
    .wide-panel { grid-column: auto; }
}
@media (max-width: 1024px) {
    .rx-metrics-strip, .analytics-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rx-map-shell, .rx-map-shell #map { min-height: 520px; }
    .section-content { padding-top: 1.25rem; }
}
@media (max-width: 768px) {
    .rx-command-shell { padding-top: 4.2rem; }
    .rx-hero-panel { grid-template-columns: 1fr; }
    .rx-map-shell, .rx-map-shell #map { min-height: 470px; border-radius: 1.2rem; }
    .rx-map-top { flex-direction: column; align-items: flex-start; }
    .rx-metrics-strip, .analytics-overview, .rx-action-dock { grid-template-columns: 1fr; }
    .rx-action-dock { gap: 0.7rem; }
    #sosButton { bottom: 1rem; right: 1rem; width: 4.2rem; height: 4.2rem; }
    .map-filter-panel { width: 170px; }
}
@media (max-width: 640px) {
    .app-section { padding-top: 4.8rem; }
    .section-content { padding-left: 0.75rem; padding-right: 0.75rem; }
    .rx-map-overlay { position: static; padding: 0.75rem 0.75rem 0; }
    .rx-map-shell { padding-bottom: 0.75rem; }
    .rx-map-top, .rx-map-bottom { position: absolute; }
    .rx-map-top { left: 0.75rem; right: 0.75rem; top: 0.75rem; }
    .rx-map-bottom { left: 0.75rem; bottom: 0.75rem; }
    .map-wrapper { height: 100%; }
    .sos-button { width: 8rem; height: 8rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
