:root {
  --navy: #0b2545;
  --ink: #16202c;
  --paper: #ffffff;
  --muted: #5b6b7c;
  --traccar: #1f6feb;
  --ais: #f0883e;
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header a { color: #cfe0f5; text-decoration: none; font-size: 14px; }
header button { font: inherit; padding: 4px 10px; border-radius: 6px; border: 1px solid #cfe0f5; background: transparent; color: #fff; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #b3261e; vertical-align: middle; text-transform: uppercase; }

#status {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  padding: 7px 14px;
  background: #eef3f9;
  border-bottom: 1px solid #d5dfeb;
}
#statusMain { font-weight: 600; }
#statusSub { color: var(--muted); }

main { position: relative; flex: 1; min-height: 0; display: flex; }
#map { flex: 1; min-width: 0; background: #aad3df; }

#notice {
  position: absolute;
  z-index: 1000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  padding: 14px 20px;
  border-radius: 10px;
  background: rgba(11, 37, 69, 0.92);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.legend {
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  line-height: 1.6;
}
.legend i { display: inline-block; width: 18px; height: 4px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }

.boat { background: none; border: 0; }
.boat svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

#panel {
  width: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  border-left: 1px solid #d5dfeb;
  background: #f8fafc;
  font-size: 13px;
}
#panel h2 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
#panel ul { margin: 0; padding: 0; list-style: none; }
#panel li { padding: 6px 0; border-bottom: 1px solid #e3e9f0; overflow-wrap: anywhere; }
#panel .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
#panel button, #panel select { font: inherit; padding: 4px 8px; }
#panel .test { color: #8a4b00; }
#publicPreview { padding: 6px 8px; border-radius: 6px; background: #e6eef8; }
#visibility.hidden-mode { background: #b3261e; color: #fff; border-color: #b3261e; }

@media (max-width: 760px) {
  body { font-size: 14px; }
  #panel { position: absolute; z-index: 1100; inset: 0 0 0 auto; width: min(320px, 88vw); box-shadow: -2px 0 8px rgba(0, 0, 0, 0.25); }
  #panel.closed { display: none; }
}
@media (min-width: 761px) {
  #panelToggle { display: none; }
}
