:root {
  color-scheme: dark;
  --bg: #04101d;
  --bg-soft: #081726;
  --panel: rgba(9, 22, 39, 0.8);
  --panel-strong: rgba(7, 18, 33, 0.92);
  --panel-muted: rgba(12, 29, 50, 0.74);
  --line: rgba(128, 173, 201, 0.18);
  --line-strong: rgba(97, 167, 212, 0.32);
  --text: #e7f1fa;
  --muted: #8ea9bb;
  --accent: #35d3ff;
  --accent-2: #2ae6a1;
  --accent-warm: #f8b95f;
  --danger: #ff657f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(53, 211, 255, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(42, 230, 161, 0.09), transparent 30%),
    linear-gradient(160deg, #030c15 0%, #07111d 42%, #0a1726 100%);
  color: var(--text);
  font-family: var(--font-body);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 85%);
}

body::after {
  background:
    radial-gradient(circle at 15% 18%, rgba(56, 142, 255, 0.14), transparent 18%),
    radial-gradient(circle at 80% 10%, rgba(41, 226, 165, 0.08), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(248, 185, 95, 0.05), transparent 25%);
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 26px auto 40px;
}

.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 10, 17, 0.76);
  backdrop-filter: blur(16px);
}

.auth-loading__panel {
  width: min(560px, 100%);
  padding: 32px;
  text-align: center;
}

.auth-loading__panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.auth-loading__panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-pending .app-shell {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

body:not(.auth-pending) .auth-loading {
  display: none;
}

.auth-failed .auth-loading__panel {
  border-color: rgba(255, 101, 127, 0.32);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 101, 127, 0.12);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-page__shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.88fr);
  gap: 24px;
  width: min(1180px, 100%);
}

.auth-overview,
.auth-card {
  padding: 32px;
}

.auth-overview__brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.auth-overview__grid {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.auth-overview__card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid rgba(92, 167, 214, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8, 21, 37, 0.84), rgba(5, 14, 25, 0.94));
}

.auth-overview__card strong {
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.45;
}

.auth-card {
  align-self: center;
}

.auth-card__header {
  margin-bottom: 22px;
}

.auth-card__meta {
  margin-top: 12px;
  max-width: none;
  text-align: left;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-message {
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(92, 167, 214, 0.18);
  border-radius: 16px;
  background: rgba(8, 19, 32, 0.84);
  color: var(--muted);
  line-height: 1.6;
}

.auth-message[data-state="error"] {
  border-color: rgba(255, 101, 127, 0.28);
  background: rgba(42, 11, 20, 0.68);
  color: #ffb5c3;
}

.auth-message[data-state="success"] {
  border-color: rgba(42, 230, 161, 0.24);
  background: rgba(8, 34, 28, 0.68);
  color: #9af2cf;
}

.auth-message[data-state="info"] {
  border-color: rgba(53, 211, 255, 0.22);
  color: #c8ebf7;
}

.auth-actions {
  display: flex;
  align-items: center;
}

.auth-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(10, 24, 43, 0.92), rgba(7, 18, 32, 0.9));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(63, 144, 188, 0.08);
  pointer-events: none;
}

.hero {
  padding: 32px 32px 24px;
}

.hero__brand,
.command-strip,
.panel-heading,
.panel-actions,
.log-status-row,
.site-footer,
.map-toolbar {
  display: flex;
  align-items: center;
}

.hero__brand {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 28px;
}

.hero-session {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.session-chip {
  display: grid;
  gap: 4px;
  min-width: 164px;
  padding: 12px 14px;
  border: 1px solid rgba(89, 164, 210, 0.18);
  border-radius: 18px;
  background: rgba(8, 19, 33, 0.82);
}

.session-chip strong {
  font-family: var(--font-heading);
  font-size: 0.98rem;
}

.session-chip__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(53, 211, 255, 0.16), rgba(42, 230, 161, 0.08)),
    rgba(10, 26, 43, 0.92);
  border: 1px solid rgba(68, 174, 226, 0.34);
  box-shadow: inset 0 0 24px rgba(53, 211, 255, 0.12), 0 18px 48px rgba(0, 0, 0, 0.3);
}

.brand-mark svg {
  width: 46px;
  height: 46px;
  stroke: rgba(92, 224, 255, 0.95);
  fill: none;
  stroke-width: 2.4;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow--inline {
  margin-bottom: 2px;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.subcopy {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-ribbon {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(84, 162, 208, 0.18);
  border-radius: 999px;
  background: rgba(7, 19, 33, 0.82);
}

.hero-ribbon__label {
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-ribbon__value {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-card__label,
.field span,
.route-metric span,
.progress-copy span,
.panel-kicker,
.route-intel__label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card__meta,
.panel-heading__meta,
.map-toolbar__hint,
.site-footer,
.log-status-row__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 156px;
  padding: 20px 20px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(84, 162, 208, 0.18);
  background:
    linear-gradient(180deg, rgba(8, 21, 37, 0.9), rgba(6, 16, 28, 0.96)),
    radial-gradient(circle at top right, rgba(53, 211, 255, 0.08), transparent 60%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.stat-card--feature {
  grid-column: span 2;
  background:
    linear-gradient(180deg, rgba(9, 24, 41, 0.92), rgba(7, 17, 31, 0.98)),
    radial-gradient(circle at top right, rgba(53, 211, 255, 0.16), transparent 58%);
}

.stat-card__value {
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: clamp(1.12rem, 2vw, 1.46rem);
  line-height: 1.2;
}

.stat-card__value--feature {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.05;
}

.stat-card__meta--wide {
  max-width: 38ch;
  line-height: 1.6;
}

.stat-card--live {
  background:
    linear-gradient(180deg, rgba(8, 24, 37, 0.88), rgba(7, 22, 33, 0.98)),
    radial-gradient(circle at top right, rgba(42, 230, 161, 0.16), transparent 55%);
}

.live-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-warm);
  box-shadow: 0 0 0 6px rgba(248, 185, 95, 0.14);
}

.live-dot.is-running {
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(42, 230, 161, 0.15), 0 0 20px rgba(42, 230, 161, 0.3);
}

.live-dot.is-paused {
  background: var(--accent-warm);
}

.live-dot.is-stopped {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(255, 101, 127, 0.14);
}

.command-strip {
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(85, 162, 209, 0.18);
  background:
    linear-gradient(180deg, rgba(6, 17, 30, 0.82), rgba(5, 13, 24, 0.92)),
    radial-gradient(circle at right, rgba(53, 211, 255, 0.08), transparent 30%);
}

.command-strip__progress {
  flex: 1 1 auto;
}

.command-strip__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.command-strip__copy strong {
  font-family: var(--font-heading);
  font-size: 1.04rem;
}

.command-strip__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(67, 133, 176, 0.2);
  background: rgba(5, 13, 24, 0.9);
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(53, 211, 255, 0.92), rgba(42, 230, 161, 0.88)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent 50%);
  box-shadow: 0 0 18px rgba(53, 211, 255, 0.28);
}

.progress-track--hero {
  height: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  gap: 24px;
  margin-top: 24px;
}

.fleet-panel {
  margin-top: 24px;
  padding: 24px;
}

.fleet-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.field--inline {
  min-width: min(380px, 100%);
}

.fleet-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.fleet-summary-card {
  padding: 16px 18px;
  border: 1px solid rgba(89, 164, 210, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 24, 41, 0.84), rgba(7, 19, 34, 0.94));
}

.fleet-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fleet-summary-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 1.24rem;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.fleet-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(89, 164, 210, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(8, 21, 37, 0.88), rgba(5, 14, 25, 0.96));
}

.fleet-card--active {
  border-color: rgba(53, 211, 255, 0.48);
  box-shadow: inset 0 0 0 1px rgba(53, 211, 255, 0.16);
}

.fleet-card__top,
.fleet-card__stats,
.fleet-card__actions {
  display: flex;
  gap: 12px;
}

.fleet-card__top {
  align-items: flex-start;
  justify-content: space-between;
}

.fleet-card__title strong,
.fleet-card__stats strong {
  display: block;
  font-family: var(--font-heading);
}

.fleet-card__title strong {
  font-size: 1rem;
}

.fleet-card__meta,
.fleet-card__submeta {
  color: var(--muted);
  font-size: 0.88rem;
}

.fleet-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fleet-card__stat {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(89, 164, 210, 0.14);
  background: rgba(8, 18, 31, 0.76);
}

.fleet-card__stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fleet-card__stat strong {
  margin-top: 6px;
  font-size: 0.98rem;
}

.fleet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 169, 215, 0.16);
  background: rgba(8, 18, 31, 0.86);
  font-family: var(--font-heading);
  font-size: 0.86rem;
}

.fleet-status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
}

.fleet-status-badge.is-running::before {
  background: var(--accent-2);
}

.fleet-status-badge.is-paused::before {
  background: var(--accent-warm);
}

.fleet-card__progress {
  display: grid;
  gap: 10px;
}

.fleet-card__progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.fleet-card__actions {
  flex-wrap: wrap;
}

.fleet-card__actions .btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.route-panel {
  padding: 24px;
}

.sidebar-stack {
  display: grid;
  gap: 24px;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-kicker {
  margin: 0 0 6px;
}

.panel h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.panel-heading__meta {
  max-width: 340px;
  text-align: right;
}

.route-intel {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(92, 167, 214, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(8, 20, 35, 0.86), rgba(6, 16, 28, 0.94)),
    radial-gradient(circle at top right, rgba(53, 211, 255, 0.08), transparent 60%);
}

.route-intel__summary {
  display: grid;
  gap: 8px;
}

.route-intel__summary strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.45;
}

.route-intel__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.map-toolbar {
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.map-toolbar--panel {
  padding: 14px 16px;
  border: 1px solid rgba(92, 167, 214, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(7, 18, 31, 0.82), rgba(5, 13, 24, 0.92));
}

.map-toolbar__hint {
  margin-left: auto;
  max-width: 420px;
  text-align: right;
  line-height: 1.55;
}

.map-shell {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 14px;
  border: 1px solid rgba(97, 167, 212, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(53, 211, 255, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(248, 185, 95, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(8, 20, 34, 0.98), rgba(4, 12, 22, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(53, 211, 255, 0.08),
    0 0 0 1px rgba(7, 18, 31, 0.66),
    0 26px 50px rgba(0, 0, 0, 0.24);
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 1;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(53, 211, 255, 0.06), transparent 42%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: auto, 84px 84px, 84px 84px;
  opacity: 0.56;
  pointer-events: none;
}

#map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 560px;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 32px rgba(0, 0, 0, 0.2);
}

.map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), transparent 20%),
    linear-gradient(transparent 76%, rgba(0, 0, 0, 0.18)),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(3, 10, 17, 0.18) 100%);
  pointer-events: none;
}

.map-overlay {
  position: absolute;
  top: 26px;
  left: 26px;
  z-index: 500;
  max-width: min(460px, calc(100% - 52px));
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(97, 167, 212, 0.24);
  background:
    linear-gradient(180deg, rgba(7, 20, 34, 0.88), rgba(4, 14, 25, 0.8)),
    radial-gradient(circle at top right, rgba(90, 193, 215, 0.08), transparent 60%);
  backdrop-filter: blur(10px);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.map-overlay__eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-overlay__eyebrow-row > span {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-overlay > strong {
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.45;
}

.map-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 19, 31, 0.76);
  color: #d8e8f3;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-status-pill[data-state="running"] {
  border-color: rgba(56, 216, 156, 0.34);
  background: rgba(8, 41, 31, 0.76);
  color: #8af0c5;
}

.map-status-pill[data-state="paused"] {
  border-color: rgba(242, 186, 103, 0.34);
  background: rgba(47, 31, 11, 0.76);
  color: #f7ce92;
}

.map-status-pill[data-state="stopped"] {
  border-color: rgba(222, 98, 125, 0.34);
  background: rgba(48, 16, 24, 0.76);
  color: #ffb4c2;
}

.map-overlay__meta {
  color: #dbeaf4;
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.map-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(93, 171, 214, 0.18);
  background: rgba(10, 24, 39, 0.78);
  color: #eef6fb;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.map-chip--muted {
  color: #cee1ed;
  background: rgba(8, 19, 33, 0.72);
}

.map-legend,
.map-readout {
  position: absolute;
  z-index: 500;
  border: 1px solid rgba(97, 167, 212, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(7, 20, 34, 0.88), rgba(4, 14, 25, 0.8)),
    radial-gradient(circle at top right, rgba(90, 193, 215, 0.06), transparent 60%);
  backdrop-filter: blur(11px);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.map-legend {
  top: 26px;
  right: 26px;
  width: min(312px, calc(100% - 52px));
  display: grid;
  gap: 12px;
  padding: 15px 16px 16px;
  pointer-events: none;
}

.map-legend__section {
  display: grid;
  gap: 10px;
}

.map-legend__section + .map-legend__section {
  padding-top: 10px;
  border-top: 1px solid rgba(97, 167, 212, 0.12);
}

.map-legend__title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-legend__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.map-legend__item,
.map-legend__route-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dcebf5;
  font-size: 0.78rem;
  line-height: 1.35;
}

.map-legend__status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-chip {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px 999px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.04),
    0 0 16px rgba(0, 0, 0, 0.16);
}

.legend-chip--tanker {
  background: linear-gradient(180deg, #f0ca90 0%, #cfa25c 100%);
}

.legend-chip--cargo {
  background: linear-gradient(180deg, #8dd7ea 0%, #4f98bb 100%);
}

.legend-chip--passenger {
  background: linear-gradient(180deg, #d6fbff 0%, #83cad2 100%);
}

.legend-chip--fishing {
  background: linear-gradient(180deg, #a8dfba 0%, #5eab76 100%);
}

.legend-chip--tug {
  background: linear-gradient(180deg, #f2c79c 0%, #b9784c 100%);
}

.legend-chip--naval {
  background: linear-gradient(180deg, #cad8ef 0%, #7088ac 100%);
}

.legend-chip--other {
  background: linear-gradient(180deg, #dce8ef 0%, #8fa4b4 100%);
}

.legend-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5f1f9;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(7, 19, 33, 0.72);
}

.legend-state--running {
  border-color: rgba(56, 216, 156, 0.34);
  background: rgba(10, 43, 32, 0.72);
  color: #8af0c5;
}

.legend-state--paused {
  border-color: rgba(242, 186, 103, 0.34);
  background: rgba(48, 31, 10, 0.72);
  color: #f6cd8f;
}

.legend-state--stopped {
  border-color: rgba(222, 98, 125, 0.34);
  background: rgba(47, 16, 24, 0.72);
  color: #ffb0c0;
}

.legend-line {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 0;
  border-top: 4px solid #5ac1d7;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-line--completed {
  border-top-color: #e0b26f;
  opacity: 0.88;
}

.legend-waypoint {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(88, 193, 215, 0.34);
  background: linear-gradient(180deg, rgba(8, 22, 38, 0.96), rgba(4, 14, 24, 0.96));
  color: #f0f8fd;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(88, 193, 215, 0.08);
  flex: 0 0 auto;
}

.map-readout {
  right: 26px;
  bottom: 26px;
  display: grid;
  gap: 10px;
  min-width: 252px;
  padding: 14px 15px;
}

.map-readout span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-readout strong {
  font-family: var(--font-heading);
  font-size: 0.94rem;
}

.map-readout__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.map-readout__metric {
  display: grid;
  gap: 5px;
  padding-top: 10px;
  border-top: 1px solid rgba(97, 167, 212, 0.1);
}

.map-readout__metric span {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.map-readout__metric strong {
  font-size: 0.79rem;
  line-height: 1.45;
}

.route-metric {
  min-width: 150px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(89, 164, 210, 0.18);
  background: linear-gradient(180deg, rgba(9, 24, 41, 0.84), rgba(7, 19, 34, 0.94));
}

.route-metric--chart {
  min-width: 0;
}

.route-metric strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.panel:not(.route-panel) {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid--vessel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field__error {
  min-height: 1.1em;
  color: #ff9fb0;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field__error[hidden] {
  display: none;
}

.field--wide,
.field--toggle {
  grid-column: 1 / -1;
}

.field--invalid input,
.field--invalid select {
  border-color: rgba(255, 101, 127, 0.64);
  box-shadow:
    0 0 0 1px rgba(255, 101, 127, 0.18),
    0 0 0 4px rgba(255, 101, 127, 0.12);
}

.field--invalid input:focus,
.field--invalid select:focus {
  border-color: rgba(255, 101, 127, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 101, 127, 0.18);
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid rgba(95, 169, 215, 0.22);
  border-radius: 16px;
  background: rgba(5, 16, 28, 0.86);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(53, 211, 255, 0.66);
  box-shadow: 0 0 0 4px rgba(53, 211, 255, 0.12);
}

.field input::placeholder {
  color: #7b94a8;
}

.field input:disabled,
.field select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle__track {
  position: relative;
  width: 62px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(95, 169, 215, 0.25);
  background: rgba(4, 13, 23, 0.92);
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d3e8f6, #8fb3c7);
  transition: transform 160ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.toggle input:checked + .toggle__track {
  background: rgba(24, 95, 90, 0.72);
  border-color: rgba(42, 230, 161, 0.5);
}

.toggle input:checked + .toggle__track .toggle__thumb {
  transform: translateX(26px);
  background: linear-gradient(180deg, #d7fff0, #73e4bb);
}

.toggle__label {
  color: var(--text);
  font-weight: 600;
}

.panel-actions {
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.panel-actions--end {
  justify-content: flex-end;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row--end {
  margin-left: auto;
}

.panel-footnote {
  margin-top: 18px;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.progress-copy strong {
  font-family: var(--font-heading);
  font-size: 0.98rem;
}

.btn {
  position: relative;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(92, 167, 214, 0.22);
  border-radius: 16px;
  background: rgba(6, 16, 29, 0.84);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(53, 211, 255, 0.55);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, rgba(32, 139, 173, 0.92), rgba(47, 179, 210, 0.92));
  border-color: rgba(84, 223, 255, 0.35);
}

.btn--soft {
  background: linear-gradient(135deg, rgba(24, 104, 125, 0.94), rgba(38, 150, 136, 0.92));
  border-color: rgba(84, 223, 255, 0.24);
}

.btn--muted {
  background: rgba(14, 31, 51, 0.88);
}

.btn--ghost {
  background: rgba(8, 20, 35, 0.88);
}

.btn--ghost-danger {
  background: rgba(24, 10, 18, 0.86);
  border-color: rgba(255, 101, 127, 0.25);
}

.btn--danger {
  background: linear-gradient(135deg, rgba(118, 25, 47, 0.9), rgba(172, 48, 78, 0.92));
  border-color: rgba(255, 126, 155, 0.32);
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.85fr);
  gap: 24px;
  margin-top: 24px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(92, 167, 214, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8, 20, 33, 0.66), rgba(5, 14, 25, 0.84));
}

.destinations-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.destinations-table th,
.destinations-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(128, 173, 201, 0.12);
  text-align: left;
  vertical-align: middle;
}

.destinations-table th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(9, 22, 39, 0.92);
}

.destinations-table td {
  background: rgba(7, 18, 31, 0.72);
}

.destinations-table tr:last-child td {
  border-bottom: none;
}

.table-input,
.table-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 167, 214, 0.2);
  border-radius: 14px;
  background: rgba(5, 16, 28, 0.92);
  color: var(--text);
}

.table-input--host {
  min-width: 210px;
}

.table-select--format,
.table-select--protocol {
  min-width: 118px;
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.table-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-2);
}

.dispatch-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 169, 215, 0.16);
  background: rgba(8, 18, 31, 0.82);
  color: #dceaf3;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dispatch-status::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #6f8ca0;
  box-shadow: 0 0 0 5px rgba(111, 140, 160, 0.1);
}

.dispatch-status[data-state="sent"] {
  border-color: rgba(42, 230, 161, 0.24);
  color: #94f1cb;
  background: rgba(8, 34, 28, 0.7);
}

.dispatch-status[data-state="sent"]::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(42, 230, 161, 0.12);
}

.dispatch-status[data-state="failed"] {
  border-color: rgba(255, 101, 127, 0.24);
  color: #ffb0c0;
  background: rgba(42, 11, 20, 0.72);
}

.dispatch-status[data-state="failed"]::before {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 101, 127, 0.12);
}

.dispatch-status[data-state="blocked"] {
  border-color: rgba(248, 185, 95, 0.24);
  color: #ffd39b;
  background: rgba(45, 26, 8, 0.72);
}

.dispatch-status[data-state="blocked"]::before {
  background: var(--accent-warm);
  box-shadow: 0 0 0 5px rgba(248, 185, 95, 0.12);
}

.dispatch-status[data-state="timeout"] {
  border-color: rgba(122, 199, 255, 0.24);
  color: #b4dcff;
  background: rgba(12, 24, 42, 0.78);
}

.dispatch-status[data-state="timeout"]::before {
  background: #6ec7ff;
  box-shadow: 0 0 0 5px rgba(110, 199, 255, 0.12);
}

.save-feedback {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2200;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(42, 230, 161, 0.24);
  background:
    linear-gradient(180deg, rgba(7, 26, 23, 0.94), rgba(5, 16, 17, 0.98)),
    radial-gradient(circle at top right, rgba(42, 230, 161, 0.12), transparent 60%);
  color: #dff7ea;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.save-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.save-feedback[data-state="error"] {
  border-color: rgba(255, 101, 127, 0.26);
  background:
    linear-gradient(180deg, rgba(34, 11, 18, 0.95), rgba(21, 7, 12, 0.98)),
    radial-gradient(circle at top right, rgba(255, 101, 127, 0.14), transparent 60%);
  color: #ffd7df;
}

.log-panel {
  display: flex;
  flex-direction: column;
}

.log-status-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(95, 169, 215, 0.18);
  border-radius: 999px;
  background: rgba(8, 18, 31, 0.86);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 101, 127, 0.15);
}

.status-pill.is-running::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(42, 230, 161, 0.12);
}

.status-pill.is-paused::before {
  background: var(--accent-warm);
  box-shadow: 0 0 0 5px rgba(248, 185, 95, 0.13);
}

.activity-log {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 440px;
  max-height: 700px;
  overflow-y: auto;
  padding: 4px;
}

.log-entry {
  padding: 14px 14px 13px;
  border-radius: 18px;
  border: 1px solid rgba(92, 167, 214, 0.15);
  background: linear-gradient(180deg, rgba(8, 21, 38, 0.9), rgba(6, 16, 29, 0.98));
}

.log-entry__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.log-entry__time {
  color: var(--muted);
  font-size: 0.82rem;
}

.log-entry__badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(53, 211, 255, 0.12);
  color: var(--accent);
}

.log-entry__badge--success {
  background: rgba(42, 230, 161, 0.14);
  color: #8effcf;
}

.log-entry__badge--warning {
  background: rgba(248, 185, 95, 0.14);
  color: #ffd08c;
}

.log-entry__badge--error {
  background: rgba(255, 101, 127, 0.14);
  color: #ff9eb0;
}

.log-entry__badge--data {
  background: rgba(125, 188, 255, 0.14);
  color: #96c8ff;
}

.log-entry p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.log-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 32px;
  border-radius: 20px;
  border: 1px dashed rgba(92, 167, 214, 0.2);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 20px 8px 0;
  border-top: 1px solid rgba(92, 167, 214, 0.12);
  color: #a9c0d1;
}

.leaflet-control-zoom a {
  background: rgba(5, 16, 28, 0.88);
  color: var(--text);
  border-bottom-color: rgba(95, 169, 215, 0.2);
}

.leaflet-bar {
  border: 1px solid rgba(95, 169, 215, 0.2);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.leaflet-control-attribution {
  background: rgba(5, 16, 28, 0.82);
  color: #d3e3ef;
}

.waypoint-marker {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(132, 180, 209, 0.4);
  background: linear-gradient(180deg, rgba(8, 22, 39, 0.96), rgba(5, 15, 26, 0.96));
  color: #eef6fb;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow:
    0 0 0 5px rgba(88, 155, 196, 0.12),
    0 10px 22px rgba(0, 0, 0, 0.22);
  transition:
    transform 160ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.waypoint-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(132, 180, 209, 0.4);
  border-bottom: 1px solid rgba(132, 180, 209, 0.4);
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.08);
}

.waypoint-marker--pending {
  border-color: rgba(127, 165, 191, 0.3);
  color: #d6e5ef;
}

.waypoint-marker--active {
  border-color: rgba(83, 205, 232, 0.86);
  background: linear-gradient(180deg, rgba(11, 34, 57, 0.98), rgba(4, 18, 32, 0.98));
  color: #f5fbff;
  transform: translateY(-1px) scale(1.08);
  box-shadow:
    0 0 0 6px rgba(83, 205, 232, 0.2),
    0 0 26px rgba(83, 205, 232, 0.22);
}

.waypoint-marker--passed {
  border-color: rgba(56, 216, 156, 0.56);
  background: linear-gradient(180deg, rgba(11, 40, 31, 0.96), rgba(7, 24, 20, 0.96));
  color: #9bf1cb;
  box-shadow:
    0 0 0 5px rgba(56, 216, 156, 0.12),
    0 0 20px rgba(56, 216, 156, 0.14);
}

.vessel-icon {
  background: none !important;
  border: none !important;
  pointer-events: none;
  will-change: transform, opacity;
}

.vessel-marker {
  --vessel-hull: #8fa4b4;
  --vessel-hull-edge: #eef6fb;
  --vessel-glow: rgba(143, 164, 180, 0.26);
  --vessel-wake: rgba(145, 194, 216, 0.18);
  --vessel-route: rgba(90, 193, 215, 0.78);
  --vessel-status: #de627d;
  --vessel-bridge: rgba(238, 245, 251, 0.96);
  --vessel-glass: rgba(80, 126, 158, 0.7);
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28));
  transform: translateZ(0);
}

.vessel-marker__tag,
.vessel-marker__halo,
.vessel-marker__wake,
.vessel-marker__ship {
  position: absolute;
  left: 50%;
  top: 50%;
}

.vessel-marker__tag {
  top: -11px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(93, 171, 214, 0.16);
  background: rgba(6, 17, 30, 0.9);
  color: #ecf5fb;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.vessel-marker__halo {
  width: 78%;
  height: 78%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.045), transparent 66%);
  box-shadow:
    0 0 0 1px rgba(90, 193, 215, 0.08),
    0 0 24px rgba(0, 0, 0, 0.1);
  opacity: 0.58;
  transform: translate(-50%, -50%);
  transition:
    opacity 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    transform 320ms ease;
}

.vessel-marker__wake {
  width: 52%;
  height: 82%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), var(--vessel-wake) 28%, transparent 100%);
  clip-path: polygon(50% 6%, 78% 24%, 66% 100%, 34% 100%, 22% 24%);
  filter: blur(1.4px);
  opacity: 0.68;
  transform: translate(-50%, -32%);
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease,
    filter 200ms ease;
}

.vessel-marker__ship {
  width: 58%;
  height: 88%;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    filter 220ms ease;
  filter: drop-shadow(0 0 10px var(--vessel-glow));
  will-change: transform;
}

.vessel-marker__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vessel-marker__shadow {
  fill: rgba(4, 13, 24, 0.3);
}

.vessel-marker__hull {
  fill: var(--vessel-hull);
  stroke: var(--vessel-hull-edge);
  stroke-width: 3.6;
  stroke-linejoin: round;
}

.vessel-marker__keel {
  fill: rgba(0, 10, 20, 0.18);
}

.vessel-marker__deck {
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(2, 16, 29, 0.18);
  stroke-width: 1.6;
}

.vessel-marker__channel {
  fill: none;
  stroke: rgba(14, 33, 49, 0.16);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 2.2 5.5;
}

.vessel-marker__bridge {
  fill: var(--vessel-bridge);
  stroke: rgba(8, 25, 39, 0.2);
  stroke-width: 1.4;
}

.vessel-marker__glass {
  fill: var(--vessel-glass);
  opacity: 0.92;
}

.vessel-marker__mast {
  fill: none;
  stroke: rgba(245, 251, 255, 0.7);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.vessel-marker__beacon {
  fill: var(--vessel-status);
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px var(--vessel-status));
  transform-origin: center;
}

.vessel-marker--running .vessel-marker__wake {
  opacity: 0.96;
  filter: blur(1px);
}

.vessel-marker--running .vessel-marker__beacon {
  animation: vessel-beacon-pulse 1.7s ease-in-out infinite;
}

.vessel-marker--paused .vessel-marker__wake {
  opacity: 0.38;
  filter: blur(1.9px);
}

.vessel-marker--paused .vessel-marker__halo {
  border-color: rgba(242, 186, 103, 0.34);
  opacity: 0.74;
}

.vessel-marker--stopped .vessel-marker__wake {
  opacity: 0.08;
  filter: blur(2.4px);
}

.vessel-marker--stopped .vessel-marker__ship {
  opacity: 0.86;
  filter: saturate(0.82) brightness(0.94) drop-shadow(0 0 6px rgba(0, 0, 0, 0.18));
}

.vessel-marker--stopped .vessel-marker__halo {
  opacity: 0.38;
}

.vessel-marker--active .vessel-marker__halo {
  opacity: 1;
  border-color: var(--vessel-status);
  box-shadow:
    0 0 0 1px rgba(90, 193, 215, 0.1),
    0 0 22px var(--vessel-glow),
    0 0 34px rgba(53, 211, 255, 0.18);
  animation: vessel-halo-pulse 2.5s ease-in-out infinite;
}

.vessel-marker--active .vessel-marker__ship {
  filter: drop-shadow(0 0 14px var(--vessel-glow));
}

.vessel-marker--active .vessel-marker__tag {
  border-color: rgba(90, 193, 215, 0.26);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 18px rgba(90, 193, 215, 0.14);
}

.vessel-marker--ghost {
  opacity: 0.76;
}

.vessel-marker--ghost .vessel-marker__tag {
  display: none;
}

.vessel-marker--ghost .vessel-marker__wake {
  opacity: 0.18;
}

.vessel-marker--ghost .vessel-marker__ship {
  opacity: 0.88;
  filter: saturate(0.92) brightness(0.94) drop-shadow(0 0 6px rgba(0, 0, 0, 0.16));
}

.vessel-marker--ghost .vessel-marker__halo {
  opacity: 0.24;
}

@keyframes vessel-halo-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes vessel-beacon-pulse {
  0%,
  100% {
    opacity: 0.82;
    filter: drop-shadow(0 0 4px var(--vessel-status));
  }

  50% {
    opacity: 1;
    filter: drop-shadow(0 0 10px var(--vessel-status));
  }
}

@media (max-width: 1260px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-card--feature {
    grid-column: span 3;
  }

  .dashboard-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .fleet-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-intel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-page__shell {
    grid-template-columns: 1fr;
  }

  .map-toolbar__hint,
  .panel-heading__meta {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100%, calc(100% - 20px));
    margin-top: 14px;
  }

  .hero,
  .route-panel,
  .panel:not(.route-panel) {
    padding: 18px;
  }

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

  .stat-card--feature {
    grid-column: 1 / -1;
  }

  .form-grid,
  .form-grid--vessel {
    grid-template-columns: 1fr;
  }

  .command-strip,
  .fleet-toolbar,
  .panel-heading,
  .panel-actions,
  .log-status-row,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .command-strip__copy,
  .progress-copy,
  .hero__brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .fleet-summary-grid {
    grid-template-columns: 1fr;
  }

  .route-intel__grid {
    grid-template-columns: 1fr;
  }

  .button-row--end {
    margin-left: 0;
  }

  .hero-session,
  .auth-actions {
    width: 100%;
    justify-content: space-between;
  }

  .session-chip {
    width: 100%;
  }

  .map-shell,
  #map {
    min-height: 420px;
    height: 420px;
  }

  .map-overlay,
  .map-legend,
  .map-readout {
    border-radius: 15px;
  }

  .map-overlay {
    top: 20px;
    left: 20px;
    max-width: calc(100% - 40px);
  }

  .map-legend {
    top: auto;
    left: 20px;
    right: auto;
    bottom: 20px;
    width: min(250px, calc(100% - 40px));
    gap: 10px;
    padding: 12px 13px 13px;
  }

  .map-readout {
    right: 20px;
    bottom: 20px;
    min-width: 220px;
  }

  .map-readout__metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card--feature {
    grid-column: auto;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-overview,
  .auth-card,
  .auth-loading__panel {
    padding: 22px;
  }

  .btn {
    width: 100%;
  }

  .map-overlay {
    top: 16px;
    left: 16px;
    max-width: calc(100% - 32px);
    padding: 11px 12px;
  }

  .map-legend {
    top: auto;
    left: 16px;
    right: auto;
    bottom: 16px;
    width: min(188px, calc(100% - 32px));
    padding: 11px 12px 12px;
  }

  .map-legend__grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .map-legend__item,
  .map-legend__route-row {
    font-size: 0.74rem;
  }

  .map-readout {
    right: 16px;
    bottom: 16px;
    min-width: 172px;
    padding: 11px 12px;
  }

  .map-overlay__eyebrow-row,
  .map-overlay__chips {
    gap: 6px;
  }

  .map-readout__metrics {
    gap: 8px;
  }

  .save-feedback {
    right: 16px;
    bottom: 16px;
    left: 16px;
    justify-content: center;
  }
}

.map-console-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.15fr) minmax(260px, 0.95fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.map-console-card {
  min-width: 0;
  height: 100%;
}

.map-console-grid .map-overlay,
.map-console-grid .map-legend,
.map-console-grid .map-readout {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: auto;
  max-width: none;
  min-width: 0;
  pointer-events: auto;
}

.map-console-grid .map-overlay {
  padding: 18px 20px;
}

.map-console-grid .map-legend {
  width: auto;
  padding: 17px 18px 18px;
}

.map-console-grid .map-readout {
  min-width: 0;
  padding: 18px 20px;
}

.map-console-grid .map-readout__metrics {
  height: 100%;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-gutter: stable both-edges;
}

.destinations-table {
  min-width: 1020px;
}

.destinations-table__cell--label {
  width: 19%;
}

.destinations-table__cell--protocol,
.destinations-table__cell--format {
  width: 124px;
}

.destinations-table__cell--host {
  width: 31%;
}

.destinations-table__cell--port {
  width: 112px;
}

.destinations-table__cell--enabled {
  width: 128px;
}

.destinations-table__cell--status {
  width: 132px;
}

.table-input,
.table-select {
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.table-input:focus,
.table-select:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(53, 211, 255, 0.42);
  background: rgba(7, 20, 35, 0.96);
  box-shadow:
    0 0 0 4px rgba(53, 211, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.table-input--label {
  min-width: 168px;
}

.table-input--host {
  min-width: 260px;
}

.table-input--port {
  min-width: 94px;
}

.table-select {
  cursor: pointer;
}

.table-select--format,
.table-select--protocol {
  min-width: 124px;
}

.dispatch-status {
  justify-content: center;
  min-width: 96px;
}

@media (max-width: 1180px) {
  .map-console-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-console-grid .map-legend {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .map-console-grid {
    grid-template-columns: 1fr;
  }

  .map-console-grid .map-legend,
  .map-console-grid .map-readout,
  .map-console-grid .map-overlay {
    grid-column: auto;
    width: auto;
  }
}
