:root {
  color-scheme: dark;
  --bg: #050606;
  --nav: #080a09;
  --panel: #0d1110;
  --panel-2: #141a18;
  --panel-3: #19211e;
  --text: #f2f7f4;
  --muted: #8b9891;
  --line: #27322e;
  --line-strong: #3b4a44;
  --accent: #58e083;
  --accent-soft: rgba(88, 224, 131, 0.12);
  --warn: #f4c95d;
  --danger: #ff6b6b;
  --blue: #67a7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
}

button,
input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080b0a;
  color: var(--text);
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 800;
}

select,
input {
  padding: 0 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.landing {
  background: linear-gradient(180deg, rgba(5, 6, 6, 0.78), #050606), url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.landing-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
  gap: 48px;
  min-height: 100vh;
  align-items: center;
  padding: 6vw;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  color: #d7ded8;
  font-size: 1.16rem;
  line-height: 1.6;
}

.login-panel,
.signal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 16, 0.9);
}

.login-panel {
  max-width: 520px;
  margin-top: 36px;
  padding: 22px;
}

.login-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-row button {
  background: var(--accent);
  color: #061008;
  border-color: transparent;
  padding: 0 16px;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.signal-panel {
  padding: 24px;
}

.pulse-line,
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(88, 224, 131, 0.16);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metric-grid div {
  padding: 16px;
  background: var(--panel-2);
  border-radius: 8px;
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--nav);
}

.brand-lockup {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(88, 224, 131, 0.42);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.rail {
  display: grid;
  gap: 3px;
  padding: 10px 8px 18px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  background: transparent;
  border-color: transparent;
  color: #9aa7a0;
  text-align: left;
}

.rail-item span {
  width: 24px;
  color: #66756d;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.rail-item:hover,
.rail-item.active {
  background: var(--accent-soft);
  border-color: rgba(88, 224, 131, 0.24);
  color: var(--text);
}

.rail-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.rail-item.active span {
  color: var(--accent);
}

.workbench {
  min-width: 0;
  padding: 18px 20px 30px;
}

.ops-topbar,
.panel-header,
.map-header,
.topbar-actions,
.ticker,
.event-meta,
.event-footer,
.analysis-row,
.region-row {
  display: flex;
  align-items: center;
}

.ops-topbar {
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ops-topbar h1 {
  margin: 0;
  font-size: 1.6rem;
}

.view-subtitle {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.topbar-actions {
  gap: 12px;
}

.live-pill,
.logout,
.text-button,
.map-mode {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0d0c;
  color: var(--text);
  text-decoration: none;
}

.text-button,
.map-mode.active {
  color: var(--accent);
}

.topic-tickers {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
  background: rgba(5, 6, 6, 0.9);
  backdrop-filter: blur(10px);
}

.topic-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topic-ticker.infra {
  background: #1a1509;
  border-color: #51451f;
}

.topic-ticker.cyber {
  background: #09151a;
  border-color: #1d4250;
}

.topic-ticker.geo {
  background: #171017;
  border-color: #4a2a4b;
}

.topic-ticker strong {
  flex: 0 0 auto;
  color: var(--warn);
  font-size: 0.86rem;
}

.topic-ticker > span {
  display: inline-block;
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 80%;
  white-space: nowrap;
  animation: ticker-scroll 42s linear infinite;
}

.topic-ticker:hover > span {
  animation-play-state: paused;
}

.topic-ticker > span a {
  color: var(--text);
  text-decoration: none;
}

.topic-ticker > span a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.ticker-separator {
  display: inline-block;
  margin: 0 18px;
  color: var(--warn);
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-strip,
.overview-watch,
.source-grid {
  display: grid;
  gap: 14px;
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.ops-panel,
.event-card,
.source-card,
.compact-signal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card {
  padding: 15px;
}

.metric-card span,
.metric-card small,
.source-card small,
.compact-signal small,
.event-meta,
.event-footer,
.analysis-row,
.empty,
.panel-header p,
.map-header p {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 4px 0;
  font-size: 2rem;
}

.metric-card.urgent {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(68, 18, 18, 0.24);
}

.overview-watch {
  grid-template-columns: minmax(280px, 0.74fr) minmax(420px, 1.45fr) minmax(240px, 0.55fr);
  align-items: stretch;
}

.ops-panel {
  padding: 16px;
}

.local-watch,
.texas-map-card,
.overview-side {
  min-height: 620px;
}

.panel-header,
.map-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.panel-header h2,
.map-header h2 {
  margin-bottom: 4px;
}

.feed-toolbar {
  align-items: flex-end;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.live-toggle {
  padding: 0 12px;
  color: var(--muted);
}

.live-toggle.active {
  border-color: rgba(88, 224, 131, 0.36);
  background: var(--accent-soft);
  color: var(--accent);
}

.intel-live-status {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.compact-list,
.event-list,
.region-list {
  display: grid;
  gap: 10px;
}

.local-watch .compact-list {
  max-height: 540px;
  overflow: auto;
  padding-right: 2px;
}

.compact-signal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.compact-signal:hover {
  border-color: rgba(88, 224, 131, 0.42);
  background: #1b2420;
}

.compact-signal strong,
.compact-signal small {
  display: block;
}

.compact-signal strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-signal time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.region-row {
  justify-content: space-between;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
}

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

.source-grid.full {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.source-card {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.source-card strong,
.source-card small {
  display: block;
}

.source-card > span {
  width: max-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f2724;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.source-card.status-healthy > span {
  background: rgba(88, 224, 131, 0.14);
  color: var(--accent);
}

.source-card.status-stale > span {
  background: rgba(244, 201, 93, 0.14);
  color: var(--warn);
}

.metric-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mini-metrics span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-metrics strong {
  color: var(--text);
  font-size: 1.12rem;
}

.breaking-watch {
  display: flex;
  flex-direction: column;
}

.breaking-watch .panel-header {
  align-items: flex-start;
}

.breaking-list {
  flex: 1;
  min-height: 0;
  max-height: 472px;
  overflow: auto;
  padding-right: 2px;
}

.metric-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.metric-stack span {
  color: var(--muted);
}

.metric-stack strong {
  font-size: 1.65rem;
}

.intel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.intel-layout .event-list {
  height: min(72vh, 760px);
  min-height: 520px;
  overflow: auto;
  padding-right: 2px;
  scroll-behavior: smooth;
}

.travel-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.travel-search button {
  padding: 0 18px;
  background: var(--accent);
  color: #061008;
  border-color: transparent;
}

.event-list {
  margin-top: 10px;
}

.event-card {
  padding: 15px;
  background: var(--panel-2);
}

.event-card h3 {
  margin: 10px 0 8px;
  font-size: 1.04rem;
}

.event-card p {
  margin-bottom: 12px;
  color: #d8dfd9;
  line-height: 1.48;
}

.event-meta,
.event-footer,
.analysis-row {
  flex-wrap: wrap;
  gap: 9px;
  font-size: 0.82rem;
}

.event-footer {
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.analysis-row span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1110;
}

.severity {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #050606;
  font-size: 0.78rem;
  font-weight: 900;
}

.severity-p1,
.severity-p2 {
  background: var(--danger);
}

.severity-p3 {
  background: var(--warn);
}

.severity-p4 {
  background: var(--blue);
}

.map-panel,
.texas-map-card {
  min-height: 640px;
}

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

.map-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-shell {
  position: relative;
  height: min(68vh, 660px);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid #b8c0b8;
  border-radius: 8px;
  background: #e7ece6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.overview-map-shell {
  height: 540px;
  min-height: 540px;
}

.map-count {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 107, 107, 0.32);
  border-radius: 999px;
  color: var(--danger);
  font-weight: 900;
}

.signal-map {
  position: absolute;
  inset: 0;
  height: 100%;
}

.map-base-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #e7ece6;
  filter: saturate(0.9) contrast(0.98) brightness(1.02);
  pointer-events: none;
}

.geo-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.map-overlay-svg {
  position: relative;
  z-index: 1;
}

.map-bg {
  fill: rgba(255, 255, 255, 0.02);
}

.boundary {
  vector-effect: non-scaling-stroke;
}

.boundary-texas {
  fill: rgba(255, 255, 255, 0.02);
  fill-opacity: 1;
  stroke: rgba(47, 63, 76, 0.4);
  stroke-width: 1;
}

.map-road {
  fill: none;
  stroke: rgba(35, 47, 56, 0.62);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-road-i35 {
  stroke: rgba(188, 61, 48, 0.82);
  stroke-width: 5;
}

.map-road-sh130,
.map-road-us79,
.map-road-us290,
.map-road-sh71 {
  stroke: rgba(141, 103, 40, 0.76);
  stroke-width: 3;
}

.map-road-label {
  fill: #151918;
  font-size: 12px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 250, 238, 0.95);
  stroke-width: 4px;
}

.boundary-world {
  fill: #111b22;
  fill-opacity: 0.8;
  stroke: rgba(103, 167, 255, 0.68);
  stroke-width: 0.8;
}

.event-dot {
  stroke: #f2f7f4;
  stroke-width: 1.3;
  opacity: 0.92;
}

.heat-ring {
  fill: rgba(207, 45, 45, 0.62);
  stroke: rgba(108, 17, 17, 0.76);
  stroke-width: 1.4;
}

.heat-core {
  fill: #ffca55;
  stroke: #3b2410;
  stroke-width: 1;
}

.map-label {
  fill: #101513;
  font-size: 13px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 250, 238, 0.96);
  stroke-width: 4px;
}

.clickable-heat {
  cursor: pointer;
}

.clickable-heat:hover {
  stroke-width: 3;
}

.camera-marker {
  cursor: pointer;
  pointer-events: auto;
}

.camera-marker circle:first-child {
  fill: rgba(8, 11, 10, 0.86);
  stroke: rgba(255, 250, 238, 0.92);
  stroke-width: 2;
}

.camera-marker path {
  fill: #f2f7f4;
}

.camera-marker .camera-lens {
  fill: #111513;
  stroke: none;
}

.camera-marker.camera-txdot circle:first-child {
  stroke: rgba(103, 167, 255, 0.95);
}

.camera-marker.camera-austin circle:first-child {
  stroke: rgba(88, 224, 131, 0.95);
}

.camera-marker:hover circle:first-child {
  fill: #050606;
  stroke-width: 3;
}

.heat-detail {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.heat-detail p {
  color: var(--muted);
}

.heat-detail .compact-list {
  max-height: 220px;
  overflow: auto;
}

.travel-results {
  margin-bottom: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.travel-results:empty {
  display: none;
}

.travel-results table {
  width: 100%;
  border-collapse: collapse;
}

.travel-results td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}

.travel-results td:first-child {
  width: 74%;
}

.travel-results td strong,
.travel-results td small {
  display: block;
}

.travel-results td small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.travel-results tr {
  cursor: pointer;
}

.travel-results tbody tr:hover {
  background: var(--accent-soft);
}

.autocomplete-heading,
.autocomplete-status {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.autocomplete-status {
  border-bottom: 0;
}

.place-type {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  white-space: nowrap;
}

.mini-select {
  min-height: 30px;
  padding: 0 10px;
  color: var(--accent);
}

.travel-map-panel {
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.travel-map-panel[hidden] {
  display: none;
}

.travel-map-panel iframe {
  display: block;
  width: 100%;
  height: min(46vh, 440px);
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101513;
}

.travel-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.travel-context article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.travel-context h3 {
  margin-bottom: 8px;
}

.context-body {
  color: var(--muted);
  line-height: 1.5;
}

.map-loading {
  display: grid;
  min-height: 430px;
  place-items: center;
  color: var(--muted);
}

.map-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-status span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(21, 25, 23, 0.18);
  border-radius: 6px;
  background: rgba(255, 250, 238, 0.88);
  color: #1d2521;
  font-size: 0.8rem;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

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

.camera-modal-card {
  width: min(900px, 94vw);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.camera-modal-header,
.camera-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.camera-modal-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.camera-modal-header button {
  min-height: 32px;
  padding: 0 10px;
}

.camera-frame {
  display: grid;
  min-height: 360px;
  place-items: center;
  background: #050606;
}

.camera-frame img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.camera-fallback {
  max-width: 520px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.camera-modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup {
    padding: 10px 14px;
  }

  .rail {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 12px 12px;
  }

  .rail-item {
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .rail-item span {
    width: auto;
    min-width: 24px;
  }

  .metric-strip,
  .overview-watch,
  .intel-layout,
  .source-grid {
    grid-template-columns: 1fr 1fr;
  }

  .texas-map-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .landing-shell,
  .metric-strip,
  .overview-watch,
  .intel-layout,
  .travel-context,
  .source-grid,
  .password-row,
  .travel-search {
    grid-template-columns: 1fr;
  }

  .workbench {
    padding: 14px;
  }

  .ops-topbar,
  .panel-header,
  .map-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing h1 {
    font-size: 3.2rem;
  }

  .topic-ticker {
    align-items: flex-start;
    flex-direction: column;
  }
}
