/* ── Trade Routes ──────────────────────────────────────────────────── */

/* ── Routes Hero Header ─────────────────────────────────────────── */
.routes-hero {
  position: relative;
  min-height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.18);
  box-shadow: 0 12px 40px var(--scrim-35);
  isolation: isolate;
  grid-column: 1 / -1;
  margin-bottom: 4px;
}
.routes-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: saturate(1.1);
  transform: scale(1.03);
  z-index: 0;
}
.routes-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.35) 0%, rgba(8, 12, 22, 0.6) 40%, rgba(8, 12, 22, 0.92) 100%),
    radial-gradient(120% 80% at 50% 100%, rgba(34, 211, 238, 0.12), transparent 60%);
  z-index: 1;
}
.routes-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 24px 24px 20px;
  min-height: 180px;
  justify-content: flex-end;
}
.routes-hero-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(34, 211, 238, 0.85);
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 2px;
  background: rgba(34, 211, 238, 0.08);
}
.routes-hero-title {
  margin: 0;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-shadow: 0 2px 10px var(--scrim-60);
}
.routes-hero-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.8);
  max-width: 440px;
  text-shadow: 0 1px 4px var(--scrim-50);
}
.routes-hero-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.routes-hero-perk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.9);
  padding: 4px 10px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 3px;
}
.routes-hero-perk-icon {
  font-size: 12px;
}
@media (max-width: 720px) {
  .routes-hero { min-height: 160px; }
  .routes-hero-content { padding: 18px 16px 16px; min-height: 160px; }
  .routes-hero-perks { gap: 4px; }
  .routes-hero-perk { font-size: 9px; padding: 3px 7px; }
}

/* Route cards (uses building-card / renderCard system) */
.route-card-paused {
  opacity: 0.55;
}
.route-card-paused:hover {
  opacity: 0.8;
}
.route-card-body {
  cursor: pointer;
}
.route-card-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6rem;
  color: var(--text-dim);
}
.route-card-new .card-art {
  opacity: 0.3;
}

/* Route type badge */
.route-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.route-type-badge.type-shuttle {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.route-type-badge.type-supply_line {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.route-type-badge.type-drain {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.route-type-badge.type-circuit {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.route-type-badge.type-distribution {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

/* Route path mini-diagram */
.route-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  overflow: hidden;
}
.route-path-planet {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
}
.route-path-planet img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.route-path-planet span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-path-arrow {
  color: rgba(var(--accent-rgb), 0.4);
  flex-shrink: 0;
  font-size: 0.7rem;
}
.route-path-multi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.route-path-multi .route-path-planet {
  font-size: 0.6rem;
}

/* Status row */
.route-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  margin-bottom: 6px;
}
.route-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.route-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  animation: route-pulse 2s ease-in-out infinite;
}
.route-status-dot.transit {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5);
  animation: route-pulse 1.5s ease-in-out infinite;
}
.route-status-dot.paused {
  background: #6b7280;
}
.route-status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}
.route-status-dot.loading {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5);
  animation: route-pulse 1s ease-in-out infinite;
}
.route-status-dot.stalled {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.route-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.route-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.route-status-label {
  color: var(--text-dim);
}
.route-status-timer {
  color: var(--cyan);
  font-family: var(--font-mono);
  margin-left: auto;
}

@keyframes route-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Stats row */
.route-stats {
  display: flex;
  gap: 12px;
  font-size: 0.6rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(var(--accent-rgb), 0.06);
  padding-top: 6px;
}
.route-stat {
  display: flex;
  align-items: center;
  gap: 3px;
}
.route-stat-val {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Create Route Modal (Wizard) ─────────────────────────────────── */

.route-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--scrim-70);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.route-create-box {
  max-width: 460px;
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 6px;
  margin: auto;
}
.route-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.04) 0%, transparent 100%);
}
.route-create-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
}
.route-create-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
}
.route-create-close:hover { color: var(--text-primary); }
.route-create-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Wizard steps indicator */
.route-wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
}
.route-wizard-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  flex-shrink: 0;
}
.route-wizard-step.active {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--cyan);
}
.route-wizard-step.complete {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}
.route-wizard-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 12px;
}
.route-wizard-line.complete {
  background: rgba(16, 185, 129, 0.3);
}

/* Section label */
.route-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* Type selector cards */
.route-type-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-type-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.route-type-card:hover {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.2);
}
.route-type-card.selected {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.route-type-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.route-type-card-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.route-type-card-info {
  flex: 1;
  min-width: 0;
}
.route-type-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}
.route-type-card-desc {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.route-type-card-lock {
  font-size: 0.55rem;
  color: #f59e0b;
  margin-top: 2px;
}

/* Planet dropdown (reuse fleet pattern) */
.route-dropdown {
  position: relative;
}
.route-dropdown-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(14, 14, 30, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: border-color 0.15s;
}
.route-dropdown-header:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
}
.route-dropdown-header img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.route-dropdown-arrow {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.6rem;
}
.route-dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.98);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 3px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 2px;
}
.route-dropdown-list.open {
  display: block;
}
.route-dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s;
}
.route-dropdown-item:hover {
  background: rgba(var(--accent-rgb), 0.08);
}
.route-dropdown-item img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.route-dropdown-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.route-dropdown-item-disabled:hover {
  background: transparent;
}
.route-dropdown-item-reason {
  margin-left: auto;
  font-size: 0.55rem;
  color: var(--warning, #d4a04e);
  font-style: italic;
}

/* Ship grid */
.route-ship-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.route-ship-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.63rem;
}
.route-ship-name {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-ship-avail {
  color: var(--text-dim);
  font-size: 0.6rem;
  flex-shrink: 0;
}
.route-ship-qty {
  width: 52px;
  padding: 3px 4px;
  background: rgba(14, 14, 30, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 3px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
  flex-shrink: 0;
  -moz-appearance: textfield;
}
.route-ship-qty::-webkit-inner-spin-button,
.route-ship-qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.route-ship-pm {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}
.route-ship-pm:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--cyan);
}
.route-ship-max {
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  color: var(--cyan);
  font-size: 0.55rem;
  padding: 2px 5px;
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.route-ship-max:hover {
  background: rgba(var(--accent-rgb), 0.15);
}

/* Cargo inputs */
.route-cargo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.route-cargo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
}
.route-cargo-label {
  color: var(--text-dim);
  min-width: 42px;
}
.route-cargo-input {
  width: 70px;
  padding: 4px 6px;
  background: rgba(14, 14, 30, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 3px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
  -moz-appearance: textfield;
}
.route-cargo-input::-webkit-inner-spin-button,
.route-cargo-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Trigger selector */
.route-trigger-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.route-trigger-btn {
  padding: 5px 10px;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.route-trigger-btn.active {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--cyan);
}
.route-trigger-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
}

/* Threshold / retain inputs */
.route-threshold-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-dim);
}
.route-threshold-row label {
  min-width: 50px;
}

/* Waypoint list (circuit) */
.route-waypoint-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 16px;
}
.route-waypoint-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: rgba(var(--accent-rgb), 0.15);
}
.route-waypoint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  position: relative;
}
.route-waypoint-num {
  position: absolute;
  left: -16px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  font-size: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-weight: 700;
  z-index: 1;
}
.route-waypoint-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-waypoint-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 2px;
}
.route-waypoint-remove:hover { color: #ef4444; }

/* Summary panel */
.route-summary {
  background: rgba(var(--accent-rgb), 0.03);
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 4px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.6rem;
}
.route-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.route-summary-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.55rem;
}
.route-summary-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Wizard nav buttons */
.route-wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.route-wizard-nav .btn {
  flex: 1;
}

/* Empty state */
.route-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--text-dim);
  min-height: calc(100vh - 180px);
  min-height: calc(100dvh - 180px);
  grid-column: 1 / -1;
}
.route-empty-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: 12px;
  opacity: 0.85;
  filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.15));
}
.route-empty-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.route-empty-desc {
  font-size: 0.65rem;
  margin-bottom: 18px;
  max-width: 260px;
}

/* Create button */
.route-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px dashed rgba(var(--accent-rgb), 0.2);
  border-radius: 5px;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.route-create-btn:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.route-create-btn .route-count {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* Detail modal */
.route-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--scrim-70);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.route-detail-box {
  max-width: 420px;
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 6px;
  margin: auto;
}
.route-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.04) 0%, transparent 100%);
}
.route-detail-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.route-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.route-detail-actions .btn {
  flex: 1;
  font-size: 0.65rem;
  padding: 8px 10px;
}
.route-detail-delete-btn {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
.route-detail-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Origin chip on route cards */
.route-origin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  font-size: 0.6rem;
  max-width: 100%;
  overflow: hidden;
}
.route-origin-chip-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-size: 0.55rem;
}
.route-origin-chip-planet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}
.route-origin-chip-planet img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.route-origin-chip-planet span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── AUTO-RUTA panel (Comercio > Rutas) ─────────────────────────── */
.ar-section {
  grid-column: 1 / -1;
  margin-top: 12px;
}
.ar-svg {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  color: currentColor;
}

/* ── Section header ── */
.ar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ar-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cyan);
}
.ar-head-title .ar-svg {
  font-size: 1.05rem;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.35));
}
.ar-fleet-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
}
.ar-fleet-count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
}
.ar-fleet-max {
  color: var(--text-dim);
  font-size: 0.64rem;
}

/* ── Stats strip: compact flat tiles (icon + value + short label) ── */
.ar-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
}
@media (max-width: 420px) {
  .ar-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ar-stat {
  --stat-accent: var(--cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  text-align: center;
  background: rgba(8, 12, 22, 0.96);
}
.ar-stat-icon {
  display: inline-flex;
  font-size: 0.95rem;
  color: var(--stat-accent);
}
.ar-stat-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  color: #eef6ff;
}
.ar-stat-label {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-stat--trips   { --stat-accent: #38bdf8; }
.ar-stat--units   { --stat-accent: var(--cyan); }
.ar-stat--tax     { --stat-accent: #34d399; }
.ar-stat--sales   { --stat-accent: #fbbf24; }
.ar-stat--battles { --stat-accent: #c084fc; }
.ar-stat--lost    { --stat-accent: #f87171; }
.ar-stat-sep {
  margin: 0 1px;
  color: var(--text-dim);
}

/* ── Empty state ── */
.ar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 22px 32px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  background: rgba(7, 11, 21, 0.45);
}
.ar-empty-icon {
  display: inline-flex;
  font-size: 2.1rem;
  color: var(--cyan);
  margin-bottom: 12px;
  opacity: 0.85;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.3));
}
.ar-empty-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ar-empty-desc {
  font-size: 0.68rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 300px;
}
/* Compact inline empty state for a single section inside the empire panel. */
.ar-empty--inline {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 16px 16px;
  margin-bottom: 4px;
}
.ar-empty--inline .ar-empty-icon {
  font-size: 1.4rem;
  margin-bottom: 0;
  flex: 0 0 auto;
}
.ar-empty--inline .ar-empty-desc { max-width: none; }

/* ── Section divider (Idle transports / Active routes) ── */
.ar-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 9px;
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ar-subhead .ar-svg {
  font-size: 0.95rem;
  color: var(--cyan);
}
.ar-subhead-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

/* ── Ship cards ── */
.ar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ar-ship {
  --row-accent: var(--cyan);
  --row-accent-rgb: var(--accent-rgb);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(115deg, rgba(var(--row-accent-rgb), 0.05), transparent 42%),
    rgba(9, 13, 23, 0.85);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
/* Top row: glyph + identity body + actions side, laid out horizontally. */
.ar-ship-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
/* Full-width footer: convoy composition, flight plan and the phase bar, each
   free to use the entire card width without competing with the actions column. */
.ar-ship-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
}
.ar-ship-footer > :first-child { margin-top: 0; }
.ar-ship:hover {
  border-color: rgba(var(--row-accent-rgb), 0.3);
  transform: translateY(-1px);
}
.ar-ship--available { --row-accent: #94a3b8; --row-accent-rgb: 148, 163, 184; }
.ar-ship--idle      { --row-accent: #94a3b8; --row-accent-rgb: 148, 163, 184; }
.ar-ship--returning { --row-accent: #a78bfa; --row-accent-rgb: 167, 139, 250; }
.ar-ship--selling   { --row-accent: #fbbf24; --row-accent-rgb: 251, 191, 36; }
.ar-ship--hauling   { --row-accent: #34d399; --row-accent-rgb: 52, 211, 153; }
.ar-ship--mining    { --row-accent: #fb923c; --row-accent-rgb: 251, 146, 60; }
.ar-ship--guild     { --row-accent: #38bdf8; --row-accent-rgb: 56, 189, 248; }
.ar-ship--mine      { --row-accent: #fb923c; --row-accent-rgb: 251, 146, 60; }
.ar-ship-glyph {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.15rem;
  color: var(--row-accent);
  background: rgba(var(--row-accent-rgb), 0.1);
  border: 1px solid rgba(var(--row-accent-rgb), 0.22);
}
.ar-ship-glyph--thumb {
  padding: 0;
  overflow: hidden;
  background: rgba(var(--row-accent-rgb), 0.06);
}
.ar-ship-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.ar-ship-glyph--layered {
  position: relative;
}
.ar-ship-glyph-fallback {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--row-accent);
}
.ar-ship-glyph--layered .ar-ship-thumb {
  position: relative;
  z-index: 1;
}
.ar-ship-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ar-ship-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d8f7ff;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ar-ship-route {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.ar-ship-fleet {
  font-size: 0.63rem;
  color: var(--text-dim);
}
.ar-ship-cargo {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 2px;
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.ar-ship-cargo .ar-svg { font-size: 0.82rem; color: var(--row-accent); flex: none; }

/* ── Cargo chips: per-resource icon + colour (canonical resource palette) ── */
.ar-ship-cargo--chips {
  flex-wrap: nowrap;
  gap: 4px;
}
.ar-cargo-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 1px 6px 1px 4px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-family: var(--font-mono);
  background: rgba(var(--cargo-rgb), 0.1);
  border: 1px solid rgba(var(--cargo-rgb), 0.28);
}
.ar-cargo-chip .icon-res { width: 13px; height: 13px; flex: none; }
.ar-cargo-amt {
  color: var(--cargo-color);
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .ar-ship-cargo--chips { gap: 3px; }
  .ar-cargo-chip { padding: 1px 5px 1px 3px; font-size: 0.6rem; }
  .ar-cargo-chip .icon-res { width: 12px; height: 12px; }
}
.ar-cargo-chip--ore    { --cargo-color: var(--ore-color);    --cargo-rgb: 245, 158, 11; }
.ar-cargo-chip--helium { --cargo-color: var(--helium-color); --cargo-rgb: 59, 130, 246; }
.ar-cargo-chip--plasma { --cargo-color: var(--plasma-color); --cargo-rgb: 176, 184, 200; }

/* ── Route preview: live prediction of Iniciar Ruta for an idle transport ── */
.ar-preview {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 4px 7px;
  font-size: 0.66rem;
  line-height: 1.3;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.06);
  color: var(--text-secondary);
}
.ar-preview-icon {
  flex: none;
  display: inline-flex;
  align-self: center;
  color: var(--row-accent, #22d3ee);
}
.ar-preview-icon .ar-svg { width: 13px; height: 13px; }
.ar-preview-label {
  flex: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.58rem;
  color: var(--row-accent, #22d3ee);
}
.ar-preview-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ar-preview--idle {
  background: rgba(148, 163, 184, 0.06);
}
.ar-preview--idle .ar-preview-icon,
.ar-preview--idle .ar-preview-label { color: var(--text-dim); }

/* ── Per-route stats (Guild convoy / mining run lifetime counters) ── */
.ar-rstats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 6px;
}
.ar-rstat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.ar-rstat .ar-svg { font-size: 0.78rem; color: var(--rstat-accent, var(--row-accent)); flex: none; }
.ar-rstat-val { color: #d8f7ff; font-weight: 600; }
.ar-rstat--trips  { --rstat-accent: #38bdf8; }
.ar-rstat--loaded { --rstat-accent: var(--cyan); }
.ar-rstat--units  { --rstat-accent: var(--cyan); }
.ar-rstat--tax    { --rstat-accent: #34d399; }

/* ── Route phase progress (data-backed: loading → traveling → returning) ── */
.ar-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  width: 100%;
}
.ar-legs {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
}
.ar-leg {
  position: relative;
  flex: 1;
  height: 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.ar-leg-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: rgba(var(--row-accent-rgb), 0.55);
  transition: width 0.6s ease;
}
.ar-leg--done .ar-leg-fill { background: rgba(var(--row-accent-rgb), 0.4); }
.ar-leg--active .ar-leg-fill {
  background: var(--row-accent);
  box-shadow: 0 0 6px rgba(var(--row-accent-rgb), 0.5);
}
.ar-leg-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-shrink: 0;
  font-size: 0.58rem;
}
.ar-leg-now {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-dim);
}
.ar-leg-eta {
  font-family: var(--font-mono);
  color: var(--row-accent);
}

/* ── CARGANDO load progress ("Esperando Excedente") ── */
/* Animated shimmer over the loading fill: a moving highlight band makes it
   visually clear the colony is actively accumulating surplus. */
.ar-leg-fill--loading {
  background: linear-gradient(
    90deg,
    rgba(var(--row-accent-rgb), 0.55) 0%,
    rgba(var(--row-accent-rgb), 0.95) 50%,
    rgba(var(--row-accent-rgb), 0.55) 100%
  );
  background-size: 200% 100%;
  animation: ar-load-shimmer 1.6s linear infinite;
  box-shadow: 0 0 6px rgba(var(--row-accent-rgb), 0.5);
}
@keyframes ar-load-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Blocked: colony will never export (export quota 0). Still, dim, no shimmer. */
.ar-leg--blocked { background: rgba(255, 255, 255, 0.05); }
.ar-leg--blocked .ar-leg-fill {
  background: rgba(148, 163, 184, 0.25);
  box-shadow: none;
}
.ar-leg-load {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
}
.ar-leg-load-pct {
  color: var(--row-accent);
  font-weight: 700;
}
.ar-leg-load-units {
  color: var(--text-secondary);
  font-size: 0.92em;
}
.ar-leg-blocked-note {
  color: var(--text-dim);
  font-style: italic;
}
.ar-progress--blocked .ar-leg-now { color: var(--text-dim); }

.ar-ship-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 9px;
  white-space: nowrap;
}

/* ── Status pill (999px radius) ── */
.ar-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--row-accent);
  background: rgba(var(--row-accent-rgb), 0.12);
  border: 1px solid rgba(var(--row-accent-rgb), 0.32);
}

/* ── Row actions ── */
.ar-ship-actions {
  display: flex;
  gap: 6px;
}
.ar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.63rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
}
.ar-btn .ar-svg { font-size: 0.85rem; }
.ar-btn--go {
  color: #061018;
  background: var(--cyan);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3);
}
.ar-btn--go:hover { filter: brightness(1.1); }
.ar-btn--ghost {
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  padding: 5px 7px;
}
.ar-btn--ghost:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.ar-btn--stop {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.ar-btn--stop:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}
.ar-btn--escort {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.32);
}
.ar-btn--escort:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.5);
}

/* Attached-escort chip on the convoy card */
.ar-ship-escort {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 5px;
  font-size: 0.66rem;
  color: #fbbf24;
  min-width: 0;
}
.ar-ship-escort span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.ar-ship-escort .ar-svg { font-size: 0.82rem; flex: none; line-height: 1.3; }

/* Escort picker (hosted inside the confirm modal) */
.ar-escort-modal { text-align: left; }
.ar-escort-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 6px 0 12px;
  line-height: 1.4;
}
.ar-escort-group { margin-bottom: 12px; }
.ar-escort-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan);
  margin-bottom: 6px;
}
.ar-escort-empty {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 6px 0;
}
.ar-escort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin-bottom: 5px;
}
.ar-escort-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  color: var(--text);
}
.ar-escort-name .ar-ship-thumb { width: 26px; height: 26px; object-fit: contain; }
.ar-escort-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ar-escort-step {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--cyan);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.ar-escort-step:hover { background: rgba(var(--accent-rgb), 0.22); }
.ar-escort-val {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.ar-escort-max { font-size: 0.66rem; color: var(--text-dim); }

/* Planet filter bar at the top of the routes list */
.routes-filter-bar {
  grid-column: 1 / -1;
  margin: 10px 0 8px;
}
.routes-filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 18px 12px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  margin: 6px 0 10px;
}
