:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-alt: #f8fafd;
  --navy: #0f2942;
  --navy-light: #1a3f66;
  --accent: #0d6efd;
  --teal: #0e8a7d;
  --amber: #d97706;
  --red: #dc2626;
  --green: #15803d;
  --text: #162133;
  --text-muted: #55657a;
  --border: #dce4ef;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(15, 41, 66, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 12% 0%, #eaf1fa 0%, var(--bg) 38%, #eef3f9 100%);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.topbar {
  background: linear-gradient(135deg, #0b1f35 0%, var(--navy) 50%, #1c4772 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 4px 16px rgba(11, 31, 53, 0.24);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #e0f2fe;
}

.btn-topbar {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn-topbar:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-topbar:active {
  transform: scale(0.97);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: statusPulse 2.4s infinite;
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.65); }
  70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.subnav {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.alert-banner {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

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

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--navy);
}

.kpi-card[data-kpi-id="nowcast"]::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.kpi-card[data-kpi-id="short_h1"]::before { background: linear-gradient(90deg, #0d6efd, #38bdf8); }
.kpi-card[data-kpi-id="medium_h3"]::before { background: linear-gradient(90deg, #0e8a7d, #2dd4bf); }
.kpi-card[data-kpi-id="sse_cbfi_live"]::before { background: linear-gradient(90deg, #4f46e5, #818cf8); }

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 41, 66, 0.1);
  border-color: #bfd0e6;
}

.exec-brief {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(90deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid #cbd9ec;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(15, 41, 66, 0.05);
}

.exec-brief-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: #e0edff;
  padding: 3px 10px;
  border-radius: 999px;
}

.exec-brief-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.kpi-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}

.kpi-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.delta-up {
  color: var(--red);
  font-weight: 600;
}

.delta-down {
  color: var(--green);
  font-weight: 600;
}

.delta-flat {
  color: var(--text-muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  scroll-margin-top: 112px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 17px;
  color: var(--navy);
}

.panel-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-group {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.btn-chip {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  color: var(--navy);
  background: rgba(13, 110, 253, 0.08);
}

.btn-chip.active {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.select-wrap select,
.select-wrap input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0b5ed7;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.chart-card,
.nowcast-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-title-row h3,
.subpanel h3 {
  margin: 0;
  font-size: 14px;
  color: var(--navy);
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6eef8;
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}

.badge-accent {
  background: #fef3c7;
  color: #92400e;
}

.badge-champ {
  background: #dcfce7;
  color: #166534;
}

.badge-baseline {
  background: #e2e8f0;
  color: #334155;
}

.badge-candidate {
  background: #dbeafe;
  color: #1e40af;
}

.chart-box {
  width: 100%;
  min-height: 300px;
}

.nowcast-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.nowcast-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.nowcast-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.indicator-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ind-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.ind-pill.selected {
  background: #e8f1ff;
  border-color: var(--accent);
  color: #0b4db8;
  font-weight: 600;
}

.subpanel {
  margin-top: 18px;
}

.subpanel h3 {
  margin-bottom: 10px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.table-scroll.compact {
  max-height: 290px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
}

.data-table th {
  background: #f4f7fb;
  color: var(--navy);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.row-champion {
  background: #f0fdf4 !important;
}

.sig-bull {
  color: var(--red);
  font-weight: 600;
}

.sig-bear {
  color: var(--green);
  font-weight: 600;
}

.sig-neutral {
  color: var(--text-muted);
}

.limitations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.limit-item {
  background: var(--surface-alt);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 10px 12px;
}

.limit-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--navy);
}

.limit-item p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  padding: 16px 24px 28px;
  color: var(--text-muted);
  font-size: 12px;
}

.weekly-panel {
  margin-top: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.weekly-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr;
  gap: 14px;
  margin-top: 8px;
}

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

.weekly-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weekly-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
}

.weekly-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.weekly-card-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.weekly-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.weekly-alerts {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.weekly-alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12px;
}

.weekly-alert-title {
  font-weight: 600;
  color: var(--navy);
}

.weekly-alert-meta {
  color: var(--text-muted);
  font-size: 11.5px;
}

.weekly-bt-strip {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.weekly-bt-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--text);
}

/* Interactive AIS Maritime Map */
.ais-toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.ais-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1080px) {
  .ais-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ais-kpi-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}

.ais-kpi-pill-title {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.ais-kpi-pill-main {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.ais-kpi-pill-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ais-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.ais-search-wrap {
  position: relative;
}

.ais-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ais-search-input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 24px 5px 9px;
  font-size: 12px;
  width: 240px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ais-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.14);
}

.ais-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.ais-search-clear:hover {
  color: var(--navy);
}

.ais-search-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 410px;
  max-width: 88vw;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15, 41, 66, 0.22);
  z-index: 1200;
}

.ais-suggest-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ais-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ais-suggest-item:last-child {
  border-bottom: none;
}

.ais-suggest-item:hover,
.ais-suggest-item.active {
  background: #eff6ff;
}

.ais-suggest-main {
  min-width: 0;
  flex: 1;
}

.ais-suggest-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.ais-suggest-name mark {
  background: #fef08a;
  color: #0f2942;
  padding: 0 2px;
  border-radius: 3px;
}

.ais-suggest-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ais-src-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.ais-src-local {
  background: #e0f2fe;
  color: #0369a1;
}

.ais-src-cloud {
  background: #ede9fe;
  color: #5b21b6;
}

.ais-src-watched {
  background: #fef3c7;
  color: #b45309;
}

.ais-star-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.ais-star-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}

.ais-star-btn.is-watched {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.ais-suggest-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Company Fleet Watchlist Panel */
.ais-watchlist-panel {
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  border: 1px solid #f1dec0;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 9px 12px;
}

.ais-watchlist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ais-watchlist-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.watch-star-badge {
  font-weight: 700;
  color: #92400e;
}

.watch-count-pill {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
}

.watch-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ais-watchlist-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-xs {
  padding: 3px 9px;
  font-size: 11.5px;
}

.btn-ghost.active-watch {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 600;
}

.ais-watchlist-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ais-watchlist-cards:empty {
  display: none;
}

.watch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 248px;
  max-width: 340px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 41, 66, 0.05);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.watch-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.16);
  transform: translateY(-1px);
}

.watch-card-info {
  min-width: 0;
  flex: 1;
}

.watch-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-card-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.watch-mini-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--navy);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
}

.watch-mini-btn:hover {
  background: #eef4fc;
  border-color: #93c5fd;
}

.watch-mini-btn.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Map toast notification */
.ais-map-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 620;
  background: rgba(15, 41, 66, 0.94);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(15, 41, 66, 0.28);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.ais-map-toast.toast-warn {
  background: rgba(180, 83, 9, 0.95);
}

.ais-map-toast.toast-ok {
  background: rgba(14, 116, 144, 0.95);
}

.ais-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.ais-map-wrap {
  position: relative;
  z-index: 1;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #d8e7f3;
}

.ais-map-canvas {
  width: 100%;
  height: 540px;
  z-index: 1;
}

.ais-legend {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(15, 41, 66, 0.12);
}

.ais-legend-title {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.leg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.leg-port {
  background: #0f2942;
  border: 2px solid #fbbf24;
  width: 11px;
  height: 11px;
}

.leg-watched {
  background: #f59e0b;
  border: 2px solid #78350f;
  width: 11px;
  height: 11px;
}

.leg-line {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px dashed #0d6efd;
  margin-right: 6px;
  vertical-align: middle;
}

.leg-track {
  border-top: 2.5px solid #7c3aed;
}

.port-beacon-wrap,
.hydro-beacon-wrap,
.watched-beacon-wrap,
.dynamic-beacon-wrap,
.track-stop-wrap {
  background: transparent;
  border: none;
}

.watched-beacon-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  color: #fff;
  border: 2px solid #fef08a;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 3px 9px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), 0 3px 10px rgba(15, 41, 66, 0.42);
}

.dynamic-beacon-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: 2px solid #ddd6fe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 3px 9px;
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.42);
}

.track-stop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  background: #7c3aed;
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.ais-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.ais-popup-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--navy);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.14s ease;
}

.ais-popup-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.ais-popup-btn.star-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.ais-popup-visits {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.ais-popup-visits ul {
  margin: 3px 0 0;
  padding-left: 15px;
}

.ais-popup-visits li {
  margin-bottom: 1px;
}

.port-beacon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  background: rgba(15, 41, 66, 0.92);
  color: #fff;
  border: 1.8px solid #fbbf24;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 3px 8px;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 7px rgba(15, 41, 66, 0.35);
}

.port-beacon-icon.yangtze {
  background: rgba(14, 116, 144, 0.94);
  border-color: #fde68a;
}

.hydro-beacon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  background: rgba(14, 138, 125, 0.92);
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  padding: 2px 7px;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.ais-popup {
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
  min-width: 205px;
}

.ais-popup h4 {
  margin: 0 0 5px;
  font-size: 13.5px;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.ais-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ais-popup-row span:first-child {
  color: var(--text-muted);
}

/* Executive polish utilities: sentiment meter, ghost buttons, mini bars, back-to-top */
.sentiment-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 11.5px;
}

.sentiment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.sentiment-bar {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  gap: 1px;
}

.sent-bull { background: #dc2626; }
.sent-neutral { background: #94a3b8; }
.sent-bear { background: #15803d; }

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: #eef4fc;
  border-color: #9fb8d8;
}

.mini-bar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-bar {
  width: 44px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  display: inline-block;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d6efd, #0e8a7d);
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 650;
  background: var(--navy);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 41, 66, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tbody tr:hover {
  background: #f1f6fd;
}
