/* Base reset */
html,
body {
  margin: 0;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}

/* Layout: full-height chart, vessel list docked right, stacks under the chart on phones.
   Look matches tdi-bi.com (Avada theme): Plus Jakarta Sans headings, Roboto body,
   brand blue #323fcc / navy #2a328d, #555 body text, near-square 2px corners. */
:root {
  --sea: #eef1f6;
  --land: #cdd2e2;
  --land-edge: #b6bdd3;
  --border: #f8f9fa;
  --lbl-country: #1c1c1c;
  --lbl-region: #6b7080;
  --lbl-sea: #7a80a0;
  --lbl-city: #212934;
  --ink: #1c1c1c;
  --ink-2: #555555;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --line: #e2e2e2;
  --accent: #323fcc;
  --accent-deep: #2a328d;
  --on-accent: #ffffff;
  --focus: #6d79ff;
  --ok: #2f7d4a;
  --warn: #b07a12;
  --bad: #a3342a;
  --v1: #c4502a;
  --v2: #1f7fb8;
  --v3: #7a3fa0;
  --v4: #1d8a7a;
  --v5: #b0770c;
  --card-bg: #2a328d;
  --card-fg: #ffffff;
  --card-eyebrow: #ffcd2a;
  --radius: 2px;
  --f-display: 'Plus Jakarta Sans', Arial, Helvetica, sans-serif;
  --f-body: Roboto, Arial, Helvetica, sans-serif;
  --f-data: 'Roboto Mono', ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sea: #161c24;
    --land: #2e3746;
    --land-edge: #3c4757;
    --border: #556178;
    --lbl-country: #f8f9fa;
    --lbl-region: #9aa2b4;
    --lbl-sea: #8a93b0;
    --lbl-city: #e2e2e2;
    --ink: #f8f9fa;
    --ink-2: #a9b0bd;
    --panel: #212934;
    --panel-2: #1b222c;
    --line: #343d4b;
    --accent: #8d96ff;
    --accent-deep: #6d79ff;
    --on-accent: #12163f;
    --focus: #a3aaff;
    --ok: #5fcf86;
    --warn: #e8b447;
    --bad: #ff7a6e;
    --v1: #ff8a5c;
    --v2: #6fc0ff;
    --v3: #c79bf0;
    --v4: #4fd3bd;
    --v5: #f0c05a;
    --card-bg: #2a328d;
    --card-fg: #ffffff;
    --card-eyebrow: #ffcd2a;
    color-scheme: dark;
  }
}
html,
body {
  height: 100%;
}
body {
  background: var(--panel);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.4;
}
.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}
html.marketing .app > header,
html.marketing aside {
  display: none;
}
html.marketing .main {
  grid-template-columns: 1fr;
  height: 100%;
}
html.marketing .app {
  grid-template-rows: 1fr;
}
.marketing-badge {
  display: none;
}
html.marketing .marketing-badge {
  display: block;
  position: absolute;
  left: 10px;
  top: 10px;
  background: var(--card-bg);
  color: var(--card-fg);
  font: 500 0.78rem var(--f-body);
  padding: 7px 12px;
  border-radius: var(--radius);
  z-index: 3;
}
html.marketing .marketing-badge b {
  font: 700 0.95rem var(--f-display);
  display: block;
}
.badge-hint {
  display: block;
  margin-top: 2px;
  color: var(--card-eyebrow);
}
.sub {
  color: var(--ink-2);
  font-size: 0.88rem;
}
header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
h1 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--accent-deep);
  text-wrap: balance;
}
h1 span {
  color: var(--accent);
}
.hdr-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
button {
  font: 500 0.85rem var(--f-body);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* primary button, as on tdi-bi.com */
#fitBtn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 9px 18px;
}
/* hamburger toggle for the vessel list; tinted while the list is open */
#listBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}
#listBtn svg {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
#listBtn[aria-expanded='true'] {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
#fitBtn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
button:focus-visible,
a:focus-visible,
.vessel:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.main {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 0;
}
.list-hidden .main {
  grid-template-columns: 1fr;
}
.list-hidden aside {
  display: none;
}
.chart {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--sea);
  overflow: hidden;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.chart svg:active {
  cursor: grabbing;
}
.land {
  fill: var(--land);
  stroke: var(--land-edge);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.borders {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.pl {
  pointer-events: none;
  paint-order: stroke;
  stroke-linejoin: round;
  stroke-width: 3px;
}
.pl.country {
  font: 600 14px var(--f-body);
  fill: var(--lbl-country);
  stroke: none;
}
.pl.country.big {
  font-size: 17px;
}
.pl.region {
  font: 500 11px var(--f-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--lbl-region);
  stroke: none;
}
.pl.sea {
  font: italic 400 16px var(--f-body);
  letter-spacing: 0.18em;
  fill: var(--lbl-sea);
  stroke: var(--sea);
}
.pl.ocean {
  font: italic 400 19px var(--f-body);
  letter-spacing: 0.22em;
  fill: var(--lbl-sea);
  stroke: var(--sea);
}
.pl.city {
  font: 400 12.5px var(--f-body);
  fill: var(--lbl-city);
  stroke: none;
}
.pl.hq {
  font: 600 12.5px var(--f-body);
  fill: var(--lbl-city);
  stroke: none;
}
.pl-dot {
  fill: var(--lbl-city);
  stroke: var(--land);
  stroke-width: 1.5;
}
.mk {
  cursor: pointer;
}
/* only .hit takes the mouse: the rings are outline-only and the pulse moves,
   so pointing at them directly flickers */
.mk circle {
  pointer-events: none;
}
.mk .hit {
  fill: transparent;
  pointer-events: all;
}
.mk:focus-visible {
  outline: 2px solid var(--focus);
}
.mk .body {
  stroke: var(--card-fg);
  stroke-width: 1.5;
}
.mk .halo {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.55;
}
/* expanding ring that marks a live position */
.mk .pulse {
  fill: none;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}
.mk.stale .pulse {
  display: none;
}
.lead {
  stroke-width: 1.5;
}
.mk.sel .halo {
  opacity: 1;
  stroke-width: 2.5;
}
.mk.stale .body {
  opacity: 0.55;
}
.callout {
  position: absolute;
  text-decoration: none;
  background: var(--card-bg);
  color: var(--card-fg);
  border-radius: var(--radius);
  padding: 12px 16px 13px;
  /* text on the left, ship photo on the right */
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(8, 20, 30, 0.35);
  border-top: 3px solid var(--c);
  z-index: 2;
}
.callout:hover {
  box-shadow: 0 8px 24px rgba(8, 20, 30, 0.5);
  outline: 2px solid var(--c);
}
/* dashboard vessel label: just the name; sits under the full card */
.callout.mini {
  padding: 5px 10px 6px;
  z-index: 1;
}
.callout.mini .ctext {
  min-width: 0;
}
.callout.mini .cname {
  font-size: 0.85rem;
}
.callout.mini .cpos {
  margin-top: 1px;
  white-space: nowrap;
}
.callout .ctext {
  min-width: 190px;
}
.callout .cphoto {
  flex: none;
  width: 110px;
  height: auto;
}
.callout .cname {
  font: 700 1.05rem var(--f-display);
  white-space: nowrap; /* keeps the arrow beside the name */
}
/* says the card is a link to the vessel page */
.callout .carrow {
  color: var(--card-eyebrow);
  font-weight: 600;
}
.callout .cline {
  font-size: 0.8rem;
  opacity: 0.85;
}
.callout .cgo {
  font: 600 0.72rem var(--f-body);
  color: var(--card-eyebrow);
  margin-top: 6px;
}
/* marketing mode is for screenshots: no click hint */
html.marketing .callout .cgo {
  display: none;
}
.callout .cupd {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 2px;
}
.callout .cpos {
  font: 0.72rem var(--f-data);
  opacity: 0.75;
  margin-top: 4px;
}
.scale-note {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font: 11px var(--f-body);
  color: var(--lbl-region);
  background: color-mix(in srgb, var(--sea) 80%, transparent);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* sits just left of the zoom buttons */
.photo-toggle {
  position: absolute;
  right: 52px;
  top: 10px;
  height: 34px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font: 500 0.8rem var(--f-body);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  z-index: 3;
}
.photo-toggle input {
  margin: 0;
  accent-color: var(--accent);
}
html.no-photos .callout .cphoto {
  display: none;
}
.zoom button {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.1rem;
}
/* marketing mode has no header, so its "show whole fleet" lives under the zoom buttons */
#zfit {
  display: none;
  place-items: center;
}
html.marketing #zfit {
  display: grid;
}
#zfit svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
aside {
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.feed {
  padding: 10px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-2);
  flex: none;
}
.dot.live {
  background: var(--ok);
}
.list {
  display: flex;
  flex-direction: column;
}
/* vessel card: name + location beside the photo, then full-width rows */
.vessel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 14px 16px 14px 13px;
  border-left: 3px solid var(--c);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}
.vessel > :not(.vhead):not(.thumb) {
  grid-column: 1 / -1;
}
.vhead {
  min-width: 0;
}
.thumb {
  width: 88px;
  height: 48px;
  object-fit: contain;
}
.vessel:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.vessel.sel {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.vname {
  font: 700 1.05rem var(--f-display);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.facts {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.74rem;
  color: var(--ink-2);
}
.facts dd {
  margin: 0;
  font: 500 0.86rem var(--f-data);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* place description, not a number: body font */
.facts dd.where {
  font-family: var(--f-body);
}
.ids {
  font: 0.74rem var(--f-data);
  color: var(--ink-2);
}
.links {
  display: flex;
  gap: 4px 12px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.links a {
  color: var(--ink-2);
  text-decoration: none;
}
.links a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.links a.tdi {
  font-weight: 600;
  color: var(--accent);
}
.foot {
  padding: 12px 16px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-top: auto;
}
@media (max-width: 820px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: 58vh auto;
  }
  .app {
    height: auto;
    min-height: 100%;
  }
  aside {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  /* list hidden: chart fills the screen */
  .list-hidden .app {
    height: 100%;
  }
  .list-hidden .main {
    grid-template-rows: 1fr;
  }
}
html.marketing .app {
  height: 100%;
}
html.marketing .main {
  grid-template-rows: 1fr;
  height: 100%;
}
html.marketing .marketing-badge {
  max-width: calc(100% - 70px);
}
@media (max-width: 560px) {
  html.marketing .marketing-badge {
    font-size: 0.7rem;
    padding: 5px 8px;
  }
  html.marketing .marketing-badge b {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .mk .pulse {
    display: none;
  }
}
