:root {
  --ink: #12212c;
  --muted: #63727d;
  --line: rgba(18, 33, 44, 0.12);
  --panel: #ffffff;
  --soft: #eef4f2;
  --navy: #17394c;
  --green: #12966f;
  --amber: #c78119;
  --red: #b83b45;
  --blue: #2667c9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  color: var(--ink);
  background: #eef4f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.analytics-shell {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  padding: 18px;
  overflow-x: hidden;
}

.analytics-header {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(520px, 1.3fr);
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(18, 33, 44, 0.08);
}

.analytics-header > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #355163;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 18px;
}

.clock {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 420px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 980px;
  width: 100%;
}

.select,
.action-btn,
.range-btn {
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: #edf3f2;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.select {
  flex: 1 1 100%;
  min-width: 220px;
  max-width: 100%;
  width: 100%;
  padding: 0 34px 0 12px;
  border-color: var(--line);
  background: #fff;
}

.action-btn,
.range-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 0 13px;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
}

.action-btn:hover,
.range-btn:hover,
.range-btn.active {
  color: #fff;
  background: var(--navy);
}

.range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1 1 520px;
  min-width: 0;
  max-width: none;
  justify-content: flex-start;
  padding: 4px;
  border-radius: 8px;
  background: #e7efed;
}

.command-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.status-banner strong {
  display: block;
  margin-bottom: 3px;
}

.status-banner > div {
  min-width: 0;
}

.status-banner span {
  display: block;
  color: rgba(18, 33, 44, 0.78);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.status-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 999px;
  color: #17394c;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-banner.live {
  color: #075d42;
  border-color: rgba(18, 150, 111, 0.22);
  background: #e8f7f1;
}

.status-banner.warning {
  color: #7c4c09;
  border-color: rgba(199, 129, 25, 0.28);
  background: #fff7e8;
}

.status-banner.offline {
  color: #8b202b;
  border-color: rgba(184, 59, 69, 0.28);
  background: #fff0f1;
}

.fleet-ops-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(18, 33, 44, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 57, 76, 0.96), rgba(12, 32, 45, 0.98)),
    #17394c;
  color: #eef8fb;
  box-shadow: 0 14px 34px rgba(18, 33, 44, 0.16);
}

.fleet-ops-panel .eyebrow {
  color: rgba(190, 235, 245, 0.82);
}

.fleet-ops-panel .panel-pill {
  color: #d9fbff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.fleet-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fleet-vessel-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 5px solid #00d6a0;
  border-radius: 8px;
  background: rgba(7, 24, 37, 0.82);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.fleet-vessel-card:hover,
.fleet-vessel-card.selected {
  transform: translateY(-1px);
  border-color: rgba(103, 228, 255, 0.55);
  background: rgba(10, 36, 54, 0.94);
}

.fleet-vessel-card.warning {
  border-left-color: #f2b84b;
}

.fleet-vessel-card.critical {
  border-left-color: #ff5b6b;
}

.fleet-card-top,
.fleet-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.fleet-card-top p {
  margin: 0 0 3px;
  color: #65dbff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.fleet-card-top h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.fleet-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.fleet-status.ok {
  color: #061f19;
  background: #20e1a9;
}

.fleet-status.warning {
  color: #291700;
  background: #f2b84b;
}

.fleet-status.critical {
  color: #fff;
  background: #ff5b6b;
}

.fleet-route {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fleet-route strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.fleet-route span,
.fleet-card-foot span {
  color: rgba(221, 240, 247, 0.72);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.fleet-metrics,
.fleet-rob-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fleet-metrics div,
.fleet-rob-grid span {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.fleet-metrics span,
.fleet-rob-grid span {
  color: rgba(221, 240, 247, 0.62);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.fleet-metrics strong,
.fleet-rob-grid b {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 13px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.fleet-focus-btn {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid rgba(101, 219, 255, 0.34);
  border-radius: 8px;
  color: #d9fbff;
  background: rgba(101, 219, 255, 0.1);
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.fleet-vessel-card.selected .fleet-focus-btn,
.fleet-focus-btn:hover {
  color: #082232;
  background: #65dbff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.alert-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 33, 44, 0.06);
}

.alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.alert-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(18, 33, 44, 0.1);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #f7fbf9;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.alert-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(18, 33, 44, 0.08);
}

.alert-card.warning {
  border-left-color: var(--amber);
  background: #fff8eb;
}

.alert-card.critical {
  border-left-color: var(--red);
  background: #fff1f2;
}

.alert-card strong,
.alert-card b {
  font-size: 14px;
  font-weight: 900;
}

.alert-card span,
.alert-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.alert-card p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #253947;
  font-size: 13px;
  line-height: 1.35;
}

.kpi {
  min-height: 106px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
}

.kpi small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.kpi-spark {
  display: block;
  width: 100%;
  height: 26px;
  margin-top: 8px;
  overflow: visible;
}

.selected-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(18, 33, 44, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 33, 44, 0.06);
}

.selected-detail-head > div {
  min-width: 0;
}

.selected-detail-head h2 {
  font-size: 21px;
}

.selected-detail-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.detail-jump-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.detail-jump-actions a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(18, 33, 44, 0.1);
  border-radius: 8px;
  color: #17394c;
  background: #edf3f2;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.detail-jump-actions a:hover {
  color: #fff;
  background: var(--navy);
}

.kpi-spark .spark-area {
  fill: currentColor;
  opacity: 0.12;
}

.kpi-spark .spark-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.kpi-spark .spark-base {
  stroke: rgba(18, 33, 44, 0.12);
  stroke-width: 1;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.ops-grid .chart-panel.wide {
  grid-column: auto;
}

.ops-side-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chart-panel,
.weather-panel,
.report-panel,
.table-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 33, 44, 0.06);
}

.chart-panel,
.weather-panel,
.report-panel {
  padding: 14px;
}

.chart-panel.wide {
  grid-column: 1 / -1;
}

.chart-grid > article.chart-panel:nth-child(1) {
  grid-column: span 7;
}

.chart-grid > article.report-panel:nth-child(2) {
  grid-column: span 5;
}

.chart-grid > article.chart-panel:nth-child(3) {
  grid-column: span 5;
}

.chart-grid > article.chart-panel:nth-child(4) {
  grid-column: span 7;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #275164;
  background: #edf3f2;
  font-size: 12px;
  font-weight: 850;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.chart-box {
  position: relative;
  width: 100%;
  height: clamp(260px, 28vw, 330px);
}

.chart-grid .chart-box {
  height: clamp(205px, 20vw, 260px);
}

.chart-grid > article:nth-child(4) .chart-box {
  height: clamp(220px, 22vw, 285px);
}

.course-chart-box {
  height: clamp(310px, 32vw, 390px);
}

.ops-grid .course-chart-box {
  height: clamp(180px, 18vw, 235px);
}

.course-compass-card {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.ops-grid .course-compass-card {
  grid-template-columns: minmax(270px, 0.82fr) minmax(240px, 1fr);
  gap: 12px;
}

.course-compass-map {
  min-height: 360px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(18, 33, 44, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.92) 0 28%, transparent 29%),
    radial-gradient(circle at 26% 22%, rgba(48, 187, 218, 0.15) 0 18%, transparent 19%),
    radial-gradient(circle at 78% 76%, rgba(18, 150, 111, 0.13) 0 20%, transparent 21%),
    linear-gradient(145deg, #edf4f3, #dce8e8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.ops-grid .course-compass-map,
.ops-grid .course-readout {
  min-height: 240px;
}

.ops-grid .compass-ring {
  width: min(100%, 290px);
}

.compass-ring {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(18, 33, 44, 0.08);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.88) 0 44%, rgba(235, 243, 243, 0.5) 45% 66%, transparent 67%),
    conic-gradient(from -22.5deg, rgba(18, 150, 111, 0.12), rgba(38, 103, 201, 0.12), rgba(199, 129, 25, 0.14), rgba(122, 75, 176, 0.12), rgba(18, 150, 111, 0.12));
  box-shadow:
    0 18px 40px rgba(18, 33, 44, 0.12),
    inset 0 0 0 12px rgba(255, 255, 255, 0.56);
}

.compass-ring::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.86) 0 17%, transparent 18%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(38, 81, 100, 0.08));
  box-shadow: inset 0 0 0 1px rgba(18, 33, 44, 0.08);
}

.compass-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 62%, rgba(18, 33, 44, 0.88) 62.3% 62.9%, transparent 63.3%),
    repeating-conic-gradient(from -0.5deg, rgba(18, 33, 44, 0.85) 0deg 0.8deg, transparent 0.8deg 3deg),
    repeating-conic-gradient(from -1deg, #12212c 0deg 2.2deg, transparent 2.2deg 15deg);
  mask: radial-gradient(circle, transparent 0 57%, #000 57.4% 71%, transparent 71.4%);
}

.compass-cardinal {
  position: absolute;
  z-index: 3;
  color: #12212c;
  font-size: 24px;
  font-weight: 950;
}

.compass-cardinal.north {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.compass-cardinal.east {
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
}

.compass-cardinal.south {
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
}

.compass-cardinal.west {
  top: 50%;
  left: -16px;
  transform: translateY(-50%);
}

.north-marker {
  position: absolute;
  top: 28px;
  left: 50%;
  z-index: 4;
  width: 0;
  height: 0;
  border-right: 15px solid transparent;
  border-bottom: 42px solid #e23b55;
  border-left: 15px solid transparent;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 10px rgba(216, 47, 69, 0.22));
}

.compass-env-arrow {
  position: absolute;
  inset: 0;
  z-index: 4;
  color: var(--env-color);
  opacity: 0.72;
  pointer-events: none;
  transform: rotate(var(--env-deg, 0deg));
  transform-origin: center;
  transition: opacity 160ms ease, transform 180ms ease;
}

.compass-env-arrow.missing {
  opacity: 0;
}

.compass-env-arrow i {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 3px;
  height: 84px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0 12%, currentColor 44%, currentColor 100%);
  box-shadow: 0 0 0 4px var(--env-halo);
  transform: translateX(-50%);
}

.compass-env-arrow i::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  border-top: 14px solid currentColor;
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 9px rgba(18, 33, 44, 0.15));
}

.compass-env-arrow span {
  display: none;
}

.compass-env-arrow.wind {
  --env-color: #12966f;
  --env-halo: rgba(18, 150, 111, 0.12);
}

.compass-env-arrow.wave {
  --env-color: #2667c9;
  --env-halo: rgba(38, 103, 201, 0.12);
}

.ship-bearing {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 5;
  width: 214px;
  height: 92px;
  transform: translate(-50%, -50%) rotate(var(--bearing, 0deg));
  transform-origin: center;
  transition: transform 180ms ease;
}

.ship-wake {
  position: absolute;
  left: 4px;
  top: 44px;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(48, 187, 218, 0.58));
}

.ship-wake::before,
.ship-wake::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 58px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(48, 187, 218, 0.38));
}

.ship-wake::before {
  top: -10px;
  transform: rotate(-10deg);
}

.ship-wake::after {
  top: 14px;
  transform: rotate(10deg);
}

.ship-shadow {
  position: absolute;
  left: 34px;
  top: 48px;
  width: 138px;
  height: 7px;
  border-radius: 999px;
  background: rgba(18, 33, 44, 0.16);
  filter: blur(6px);
}

.ship-body {
  position: absolute;
  left: 32px;
  top: 39px;
  width: 132px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a2534, #1fc7da 52%, #0b2535);
  box-shadow:
    0 12px 24px rgba(18, 33, 44, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: none;
}

.ship-body::before {
  content: "";
  position: absolute;
  left: -18px;
  top: -12px;
  width: 36px;
  height: 38px;
  background: linear-gradient(135deg, #07131b, #0b2535);
  clip-path: polygon(0 0, 100% 38%, 100% 62%, 0 100%, 38% 50%);
  filter: drop-shadow(0 8px 14px rgba(18, 33, 44, 0.16));
}

.ship-body::after {
  content: "";
  position: absolute;
  left: 58px;
  top: -11px;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 28%, rgba(31, 199, 218, 0.36) 30% 100%);
  box-shadow: 0 8px 18px rgba(18, 33, 44, 0.14);
}

.ship-arrow {
  position: absolute;
  right: 10px;
  top: 23px;
  width: 0;
  height: 0;
  border-top: 23px solid transparent;
  border-bottom: 23px solid transparent;
  border-left: 50px solid #07131b;
  filter: drop-shadow(0 12px 16px rgba(18, 33, 44, 0.2));
}

.ship-arrow::after {
  content: "";
  position: absolute;
  left: -45px;
  top: -11px;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 25px solid #1fc7da;
  opacity: 0.92;
}

.ship-speed {
  position: absolute;
  top: 29px;
  left: 72px;
  z-index: 6;
  min-width: 80px;
  padding: 7px 11px;
  border-radius: 8px;
  color: #12212c;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(18, 33, 44, 0.18);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  transform: rotate(calc(-1 * var(--bearing, 0deg)));
}

.ship-speed strong {
  display: block;
  font-size: 22px;
}

.compass-weather-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: min(100%, 360px);
  position: relative;
  z-index: 6;
}

.compass-weather-strip span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(18, 33, 44, 0.08);
  border-left: 4px solid var(--strip-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(18, 33, 44, 0.08);
}

.compass-weather-strip small {
  color: #6c8190;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compass-weather-strip strong {
  color: #12212c;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.compass-weather-strip .wind {
  --strip-color: #12966f;
}

.compass-weather-strip .wave {
  --strip-color: #2667c9;
}

.compass-weather-strip .beaufort {
  --strip-color: #c78119;
}

.weather-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 12px;
}

.storm-risk-card {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(18, 33, 44, 0.09);
  border-left: 5px solid var(--risk-color);
  border-radius: 8px;
  color: #12212c;
  background:
    linear-gradient(135deg, var(--risk-bg), rgba(255, 255, 255, 0.86)),
    #fff;
}

.storm-risk-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 950;
}

.storm-risk-card strong::after {
  content: attr(data-score);
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #12212c;
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 950;
}

.storm-risk-card span {
  color: #253947;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.storm-risk-card.calm {
  --risk-color: #12966f;
  --risk-bg: rgba(18, 150, 111, 0.12);
}

.storm-risk-card.watch {
  --risk-color: #c78119;
  --risk-bg: rgba(199, 129, 25, 0.13);
}

.storm-risk-card.high {
  --risk-color: #d15b2f;
  --risk-bg: rgba(209, 91, 47, 0.14);
}

.storm-risk-card.storm {
  --risk-color: #b83b45;
  --risk-bg: rgba(184, 59, 69, 0.15);
}

.weather-flow-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(18, 33, 44, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--flow-bg), rgba(255, 255, 255, 0.78)),
    #fff;
}

.weather-flow-arrow {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--flow-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(18, 33, 44, 0.08), 0 10px 24px var(--flow-shadow);
}

.weather-flow-arrow::before {
  content: "";
  position: absolute;
  inset: 9px 18px 8px 18px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(var(--flow-deg, 0deg));
  transform-origin: 50% 50%;
}

.weather-flow-arrow::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 15px;
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-bottom: 11px solid currentColor;
  border-left: 6px solid transparent;
  transform: rotate(var(--flow-deg, 0deg)) translateY(-5px);
  transform-origin: 50% 16px;
}

.weather-flow-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.weather-flow-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.weather-flow-card.wind {
  --flow-color: #12966f;
  --flow-bg: rgba(18, 150, 111, 0.13);
  --flow-shadow: rgba(18, 150, 111, 0.16);
}

.weather-flow-card.wave {
  --flow-color: #2667c9;
  --flow-bg: rgba(38, 103, 201, 0.13);
  --flow-shadow: rgba(38, 103, 201, 0.16);
}

.weather-flow-card.current {
  --flow-color: #7a4bb0;
  --flow-bg: rgba(122, 75, 176, 0.13);
  --flow-shadow: rgba(122, 75, 176, 0.16);
}

.weather-flow-card.weather-from {
  --flow-color: #17394c;
  --flow-bg: rgba(48, 187, 218, 0.14);
  --flow-shadow: rgba(48, 187, 218, 0.18);
}

.weather-flow-card.beaufort {
  --flow-color: #c78119;
  --flow-bg: rgba(199, 129, 25, 0.14);
  --flow-shadow: rgba(199, 129, 25, 0.16);
}

.course-readout {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  min-height: 360px;
  padding: 16px;
  border: 1px solid rgba(18, 33, 44, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0%, rgba(48, 187, 218, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(18, 33, 44, 0.02), rgba(18, 33, 44, 0.065)),
    #f8fbfa;
}

.course-status-card,
.course-position-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(18, 33, 44, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(18, 33, 44, 0.08);
}

.course-status-card {
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(48, 187, 218, 0.32), transparent 34%),
    linear-gradient(135deg, #0b2535, #12212c);
}

.course-status-label,
.course-position-card small,
.course-metrics small {
  color: rgba(143, 165, 180, 0.92);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.course-status {
  display: block;
  color: #fff;
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.course-area {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 850;
}

.course-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.course-metrics span {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 78px;
  align-content: center;
  padding: 11px;
  border: 1px solid rgba(18, 33, 44, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 33, 44, 0.07);
}

.course-metrics strong,
.course-position-card strong {
  color: #12212c;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.course-position-card small,
.course-metrics small {
  color: #6c8190;
}

.course-angle-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px dashed rgba(18, 33, 44, 0.17);
  border-radius: 8px;
  color: #425767;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.course-coord-chip {
  display: block;
}

.course-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.course-legend-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(18, 33, 44, 0.08);
  border-radius: 8px;
  background: #f4f7f5;
}

.course-legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--course-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--course-color) 16%, transparent);
}

.course-legend-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.course-legend-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.weather-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.ops-side-stack .weather-flow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-side-stack .weather-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.ops-side-stack .weather-chart-box {
  height: 220px;
}

.ops-side-stack .report-text {
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}

.weather-values,
.fuel-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 0;
}

.weather-values div,
.fuel-values div {
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f5;
}

.weather-values dt,
.fuel-values dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.weather-values dd,
.fuel-values dd {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 850;
}

.weather-metric dd {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.weather-value-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.weather-risk-metric {
  grid-column: 1 / -1;
  border-left: 5px solid var(--risk-color);
  background:
    linear-gradient(135deg, var(--risk-bg), rgba(255, 255, 255, 0.84)),
    #f4f7f5;
}

.weather-risk-metric dt {
  color: var(--risk-color);
}

.weather-risk-metric dd {
  grid-template-columns: 1fr;
  gap: 6px;
}

.weather-risk-metric b {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #12212c;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  vertical-align: middle;
}

.weather-risk-metric small {
  color: #253947;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.weather-risk-metric.calm {
  --risk-color: #12966f;
  --risk-bg: rgba(18, 150, 111, 0.13);
}

.weather-risk-metric.watch {
  --risk-color: #c78119;
  --risk-bg: rgba(199, 129, 25, 0.15);
}

.weather-risk-metric.high {
  --risk-color: #d15b2f;
  --risk-bg: rgba(209, 91, 47, 0.16);
}

.weather-risk-metric.storm {
  --risk-color: #b83b45;
  --risk-bg: rgba(184, 59, 69, 0.17);
}

.weather-arrow {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  min-width: 92px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--arrow-color);
  background: var(--arrow-bg);
  font-size: 11px;
  font-weight: 900;
}

.weather-arrow i {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  transform: rotate(var(--arrow-deg, 0deg));
}

.weather-arrow i::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.weather-arrow i::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-bottom: 9px solid currentColor;
  border-left: 6px solid transparent;
}

.weather-arrow small {
  color: #12212c;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.weather-arrow.wind,
.weather-arrow.gust {
  --arrow-color: #12966f;
  --arrow-bg: rgba(18, 150, 111, 0.12);
}

.weather-arrow.wave,
.weather-arrow.swell {
  --arrow-color: #2667c9;
  --arrow-bg: rgba(38, 103, 201, 0.12);
}

.weather-arrow.current {
  --arrow-color: #7a4bb0;
  --arrow-bg: rgba(122, 75, 176, 0.12);
}

.weather-arrow.weather-from {
  --arrow-color: #17394c;
  --arrow-bg: rgba(48, 187, 218, 0.14);
}

.weather-arrow.beaufort {
  --arrow-color: #c78119;
  --arrow-bg: rgba(199, 129, 25, 0.14);
}

.weather-metric.beaufort .weather-value-main {
  white-space: nowrap;
}

.fuel-chart-box {
  margin-top: 14px;
}

.fuel-entry input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.fuel-entry-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fuel-entry-status.ok {
  color: var(--green);
}

.fuel-entry-status.err {
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 33, 44, 0.36);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(780px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 33, 44, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-close {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #edf3f2;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
}

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

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.weather-chart-box {
  position: relative;
  width: 100%;
  height: 260px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(18, 33, 44, 0.08);
}

.report-text {
  display: grid;
  gap: 8px;
  color: #253947;
  font-size: 14px;
  line-height: 1.45;
}

.report-text p {
  margin: 0;
}

.table-panel {
  margin-top: 14px;
  padding: 14px;
}

.export-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 12px 0 14px;
}

.export-controls label {
  display: grid;
  gap: 4px;
  min-width: 160px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.export-controls input {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

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

.data-table-card {
  min-width: 0;
}

.data-table-card.wide {
  grid-column: 1 / -1;
}

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

.table-title h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.table-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(18, 33, 44, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #eef4f2;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .weather-grid,
  .data-table-grid,
  .chart-grid,
  .ops-grid,
  .course-compass-card {
    grid-template-columns: 1fr;
  }

  .ops-grid .course-compass-card {
    grid-template-columns: minmax(270px, 0.9fr) minmax(240px, 1fr);
  }

  .ops-side-stack .weather-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-side-stack .report-text {
    max-height: none;
  }

  .analytics-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }

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

  .chart-grid > article.chart-panel:nth-child(1),
  .chart-grid > article.report-panel:nth-child(2),
  .chart-grid > article.chart-panel:nth-child(3),
  .chart-grid > article.chart-panel:nth-child(4) {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .analytics-shell {
    padding: 10px;
  }

  .analytics-header {
    padding: 13px;
  }

  h1 {
    font-size: 26px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    overflow: hidden;
  }

  .header-actions > * {
    min-width: 0;
  }

  .select {
    min-width: 0;
  }

  .range-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: none;
    justify-content: stretch;
  }

  .command-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .action-btn,
  .range-btn {
    min-width: 0;
    width: 100%;
    padding: 0 8px;
  }

  .kpi-grid,
  .weather-values,
  .fuel-values,
  .course-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .status-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-jump-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .detail-jump-actions a {
    min-width: 0;
  }

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

  .chart-box {
    height: 280px;
  }

  .course-compass-map,
  .course-readout {
    min-height: 320px;
  }

  .ops-grid .course-compass-card,
  .ops-side-stack .weather-flow {
    grid-template-columns: 1fr;
  }

  .course-readout {
    grid-template-columns: 1fr;
  }

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

  .ship-bearing {
    width: 200px;
  }

  .weather-flow {
    grid-template-columns: 1fr;
  }

  .ship-speed {
    font-size: 22px;
  }

  .weather-chart-box {
    height: 250px;
  }
}

@media (max-width: 560px) {
  .header-actions {
    grid-template-columns: 1fr;
  }

  .range-tabs,
  .command-actions,
  .detail-jump-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-pill {
    align-self: flex-start;
  }

  .status-chip {
    white-space: normal;
  }

  .alert-card {
    grid-template-columns: 1fr;
  }

  .alert-card b {
    justify-self: flex-start;
  }

  .kpi-grid,
  .weather-values,
  .fuel-values,
  .course-legend {
    grid-template-columns: 1fr;
  }

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

  .fuel-entry-grid,
  .export-controls,
  .modal-actions,
  .panel-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .export-controls label,
  .export-controls .action-btn {
    width: 100%;
  }

  .chart-box {
    height: 250px;
  }

  .course-compass-map,
  .course-readout {
    min-height: 260px;
    padding: 12px;
  }

  .compass-cardinal {
    font-size: 20px;
  }

  .ship-bearing {
    width: 174px;
    height: 76px;
  }

  .ship-body {
    left: 28px;
    top: 32px;
    width: 104px;
    height: 12px;
  }

  .ship-body::before {
    left: -15px;
    top: -10px;
    width: 30px;
    height: 32px;
  }

  .ship-body::after {
    left: 45px;
    top: -9px;
    width: 30px;
    height: 30px;
  }

  .ship-arrow {
    right: 8px;
    top: 20px;
    border-top-width: 20px;
    border-bottom-width: 20px;
    border-left-width: 42px;
  }

  .ship-arrow::after {
    left: -38px;
    top: -9px;
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 21px;
  }

  .ship-speed {
    left: 55px;
    top: 23px;
    min-width: 70px;
    padding: 6px 8px;
  }

  .ship-speed strong {
    font-size: 18px;
  }

  .compass-env-arrow i {
    top: 38px;
    height: 56px;
  }

  .compass-weather-strip {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .compass-weather-strip span {
    grid-template-columns: 42px 1fr;
    align-items: center;
    padding: 7px 8px;
  }

  .weather-flow-card {
    padding: 10px;
  }

  .weather-metric dd {
    grid-template-columns: 1fr;
  }

  .weather-arrow {
    justify-self: start;
  }

  .weather-chart-box {
    height: 230px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .header-actions,
  .table-panel {
    display: none;
  }

  .analytics-shell {
    padding: 0;
  }

  .analytics-header,
  .chart-panel,
  .weather-panel,
  .report-panel,
  .fleet-ops-panel,
  .kpi {
    box-shadow: none;
  }
}
